Stop using |Font::BoundingBox| in |TextMetrics::Update|
As part of the work to update |TextMetrics::Update| for issue 1010893, the call to |Font::BoundingBox| turned out to be unnecessary: * |Width()| is the sum of advances, which is already comptued as |real_width|. * |Y()| and |MaxY()| are the same as |glyph_bounds|, except that |Font::BoundingBox| clamps them to 0. This patch replaces the call to |Font::BoundingBox| with the equivalent, already computed values. This is to help supporting bidi in |TextMetrics::Update|. WIP: https://crbug.com/c/2196086 but also reduces call to CachingWordShaper and improves the performance. Note that the clamping behavior is not copied. It is most likely unintentional and unlikely to cause compat problems. Currently, this function is the only caller of |Font::BoundingBox|. We can remove it once this change is stabilized. Bug: 1010893 Change-Id: I79d255e1a308e5da501e65a95981c6f13148a57f Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2196624Reviewed-by:Yi Xu <yiyix@chromium.org> Commit-Queue: Koji Ishii <kojii@chromium.org> Cr-Commit-Position: refs/heads/master@{#771497}
Showing
Please register or sign in to comment