Fix gfx_unittests flakiness caused by negative x-offset
This CL is fixing a source of flakiness we observed acrross different computer. The gfx_unittests are using SetGlyphWidth to avoid relying on the underlying font information for testing some API. Unfortunately, we often ovserved inconsistency accross different platform and blocked many CL on incorrect behavior based on the following bug: Within the ShapeRunWithFont(...) code, the x_offset may not be 0 even if the glyph size is zero. It can also be negative for some fonts. Looking to the failing bot, we got these values: Font: ".SF NS Text" Offset: is -0.0952148 Glyph: 1216 To fix the issue, we proposed to keep the x_offset to zero when a glyph_size is used. This only affects tests, otherwise no functionnal change. Bug: 1056220 Change-Id: I486722a5e64c1e4ee85aa373343a19c1a1ac1331 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2075079Reviewed-by:Robert Liao <robliao@chromium.org> Commit-Queue: Etienne Bergeron <etienneb@chromium.org> Cr-Commit-Position: refs/heads/master@{#744782}
Showing
Please register or sign in to comment