Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(57)

Issue 2392033002: Correcting text baseline for tiny fonts (Closed)

Created:
4 years, 2 months ago by zakerinasab
Modified:
4 years ago
CC:
ajuma+watch-canvas_chromium.org, ajuma+watch_chromium.org, blink-reviews, blink-reviews-platform-graphics_chromium.org, Rik, chromium-reviews, danakj+watch_chromium.org, dshwang, drott+blinkwatch_chromium.org, krit, f(malita), haraken, jbroman, Justin Novosad, pdr+graphicswatchlist_chromium.org, rwlbuis, Stephen Chennney
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Correcting text baseline for tiny fonts When a tiny font size is used to draw text on canvas and the canvas is scaled up afterward, the rounding operations in CanvasRenderingContext2D::getFontBaseline and SimpleFontData::platformInit() causes different baselines to converge. This CL resolves this issue by using floating point ascent and descent properties. Visual results and comparison to previous state can be found in bug webpage: crbug.com/338908. BUG=338908 Committed: https://crrev.com/c5395a1764dd6ef1439507d88e801eaf06820476 Cr-Commit-Position: refs/heads/master@{#425618}

Patch Set 1 #

Patch Set 2 : Layout test. #

Patch Set 3 : Replacing the layout test. #

Patch Set 4 : Rebaseline. #

Total comments: 2

Patch Set 5 : Fixing broken layout tests. #

Patch Set 6 : TestExpectations #

Patch Set 7 : Rebaseline. #

Patch Set 8 : Fixing broken layout tests. #

Patch Set 9 : Addressing comments. #

Patch Set 10 : Rebaseline. #

Patch Set 11 : Reverting non-canvas layout tests. Plumbing subpixelAscentDescent. #

Patch Set 12 : Fixing broken layout tests. #

Patch Set 13 : Addressing comments. #

Patch Set 14 : Fixing layout tests. #

Patch Set 15 : Fixing flaky layout tests. #

Patch Set 16 : Fixing flaky layout tests. #

Total comments: 3

Patch Set 17 : Going back to adding NeedsRebaseline to TestExpectations. #

Patch Set 18 : Rebaseline. #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+111 lines, -25 lines) Patch
M third_party/WebKit/LayoutTests/TestExpectations View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +4 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/fast/canvas/canvas-text-baseline-tiny-fonts.html View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +37 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2D.h View 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2D.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 2 chunks +18 lines, -5 lines 0 comments Download
M third_party/WebKit/Source/platform/fonts/FontCache.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +2 lines, -1 line 0 comments Download
M third_party/WebKit/Source/platform/fonts/FontCache.cpp View 1 2 3 4 5 6 7 8 9 10 2 chunks +7 lines, -4 lines 0 comments Download
M third_party/WebKit/Source/platform/fonts/FontDataCache.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +2 lines, -1 line 0 comments Download
M third_party/WebKit/Source/platform/fonts/FontDataCache.cpp View 1 2 3 4 5 6 7 8 9 10 2 chunks +5 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/platform/fonts/FontDescription.h View 1 2 3 4 5 6 7 8 9 10 11 12 3 chunks +10 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/platform/fonts/SimpleFontData.h View 1 2 3 4 5 6 7 8 9 10 3 chunks +7 lines, -4 lines 0 comments Download
M third_party/WebKit/Source/platform/fonts/SimpleFontData.cpp View 1 2 3 4 5 6 7 8 9 10 4 chunks +18 lines, -7 lines 1 comment Download

Messages

Total messages: 49 (24 generated)
zakerinasab
CL uploaded.
4 years, 2 months ago (2016-10-04 20:15:41 UTC) #5
eae
We tried this before and it broke text line alignment for a bunch of tests ...
4 years, 2 months ago (2016-10-04 20:43:12 UTC) #6
zakerinasab1
On 2016/10/04 20:43:12, eae wrote: > We tried this before and it broke text line ...
4 years, 2 months ago (2016-10-06 20:02:29 UTC) #9
zakerinasab1
https://codereview.chromium.org/2392033002/diff/60001/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2D.cpp File third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2D.cpp (right): https://codereview.chromium.org/2392033002/diff/60001/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2D.cpp#newcode908 third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2D.cpp:908: return fontMetrics.floatAscent(); On 2016/10/04 20:43:11, eae wrote: > In ...
4 years, 2 months ago (2016-10-06 20:02:52 UTC) #11
eae
Much better, thank you! https://codereview.chromium.org/2392033002/diff/240001/third_party/WebKit/LayoutTests/TestExpectations File third_party/WebKit/LayoutTests/TestExpectations (right): https://codereview.chromium.org/2392033002/diff/240001/third_party/WebKit/LayoutTests/TestExpectations#newcode1155 third_party/WebKit/LayoutTests/TestExpectations:1155: crbug.com/338908 fast/canvas/canvas-text-baseline-tiny-fonts.html [ NeedsRebaseline ] ...
4 years, 2 months ago (2016-10-06 20:18:50 UTC) #12
zakerinasab
https://codereview.chromium.org/2392033002/diff/240001/third_party/WebKit/LayoutTests/TestExpectations File third_party/WebKit/LayoutTests/TestExpectations (right): https://codereview.chromium.org/2392033002/diff/240001/third_party/WebKit/LayoutTests/TestExpectations#newcode1155 third_party/WebKit/LayoutTests/TestExpectations:1155: crbug.com/338908 fast/canvas/canvas-text-baseline-tiny-fonts.html [ NeedsRebaseline ] On 2016/10/06 20:18:49, eae ...
4 years, 2 months ago (2016-10-07 14:31:10 UTC) #13
qyearsley
On 2016/10/07 at 14:31:10, zakerinasab wrote: > https://codereview.chromium.org/2392033002/diff/240001/third_party/WebKit/LayoutTests/TestExpectations > File third_party/WebKit/LayoutTests/TestExpectations (right): > > https://codereview.chromium.org/2392033002/diff/240001/third_party/WebKit/LayoutTests/TestExpectations#newcode1155 ...
4 years, 2 months ago (2016-10-12 20:57:51 UTC) #21
Justin Novosad
lgtm with nits for modules/canvas2d https://codereview.chromium.org/2392033002/diff/440001/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2D.cpp File third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2D.cpp (right): https://codereview.chromium.org/2392033002/diff/440001/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2D.cpp#newcode920 third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2D.cpp:920: // If you changed ...
4 years, 2 months ago (2016-10-12 21:20:14 UTC) #22
eae
https://codereview.chromium.org/2392033002/diff/440001/third_party/WebKit/Source/platform/fonts/FontDescription.cpp File third_party/WebKit/Source/platform/fonts/FontDescription.cpp (right): https://codereview.chromium.org/2392033002/diff/440001/third_party/WebKit/Source/platform/fonts/FontDescription.cpp#newcode46 third_party/WebKit/Source/platform/fonts/FontDescription.cpp:46: FontDescription::SubpixelAscentDescent subpixelAscentDescent; There is enough size left in the ...
4 years, 2 months ago (2016-10-12 21:24:06 UTC) #23
zakerinasab
Comments addressed. New patch submitted. https://codereview.chromium.org/2392033002/diff/440001/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2D.cpp File third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2D.cpp (right): https://codereview.chromium.org/2392033002/diff/440001/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2D.cpp#newcode920 third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2D.cpp:920: // If you changed ...
4 years, 2 months ago (2016-10-13 14:46:38 UTC) #24
zakerinasab
New patch set (16) uploaded with results from webkit-patch rebaseline-cl. For some reason results are ...
4 years, 2 months ago (2016-10-13 17:23:41 UTC) #25
eae
LGTM
4 years, 2 months ago (2016-10-13 17:29:45 UTC) #26
zakerinasab
On 2016/10/12 20:57:51, qyearsley wrote: > On 2016/10/07 at 14:31:10, zakerinasab wrote: > > > ...
4 years, 2 months ago (2016-10-14 16:01:08 UTC) #31
qyearsley
https://codereview.chromium.org/2392033002/diff/560001/third_party/WebKit/LayoutTests/fast/canvas/canvas-text-baseline-tiny-fonts.html File third_party/WebKit/LayoutTests/fast/canvas/canvas-text-baseline-tiny-fonts.html (right): https://codereview.chromium.org/2392033002/diff/560001/third_party/WebKit/LayoutTests/fast/canvas/canvas-text-baseline-tiny-fonts.html#newcode14 third_party/WebKit/LayoutTests/fast/canvas/canvas-text-baseline-tiny-fonts.html:14: for(i = 2; i <= 4; i++) { Nit: ...
4 years, 2 months ago (2016-10-14 17:46:44 UTC) #32
qyearsley
On 2016/10/14 at 16:01:08, zakerinasab wrote: > On 2016/10/12 20:57:51, qyearsley wrote: > > On ...
4 years, 2 months ago (2016-10-14 17:53:08 UTC) #33
zakerinasab
On 2016/10/14 17:53:08, qyearsley wrote: > On 2016/10/14 at 16:01:08, zakerinasab wrote: > > On ...
4 years, 2 months ago (2016-10-14 17:55:26 UTC) #34
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2392033002/620001
4 years, 2 months ago (2016-10-17 03:38:25 UTC) #38
commit-bot: I haz the power
Committed patchset #18 (id:620001)
4 years, 2 months ago (2016-10-17 05:03:24 UTC) #40
commit-bot: I haz the power
Patchset 18 (id:??) landed as https://crrev.com/c5395a1764dd6ef1439507d88e801eaf06820476 Cr-Commit-Position: refs/heads/master@{#425618}
4 years, 2 months ago (2016-10-17 05:05:30 UTC) #42
qyearsley
On 2016/10/17 at 05:05:30, commit-bot wrote: > Patchset 18 (id:??) landed as https://crrev.com/c5395a1764dd6ef1439507d88e801eaf06820476 > Cr-Commit-Position: ...
4 years, 2 months ago (2016-10-17 16:36:16 UTC) #43
drott
Excuse my post-land, drive-by review - some comments here. https://codereview.chromium.org/2392033002/diff/620001/third_party/WebKit/Source/platform/fonts/SimpleFontData.cpp File third_party/WebKit/Source/platform/fonts/SimpleFontData.cpp (right): https://codereview.chromium.org/2392033002/diff/620001/third_party/WebKit/Source/platform/fonts/SimpleFontData.cpp#newcode145 third_party/WebKit/Source/platform/fonts/SimpleFontData.cpp:145: ...
4 years, 2 months ago (2016-10-18 10:42:18 UTC) #45
zakerinasab
On 2016/10/18 10:42:18, drott wrote: > Excuse my post-land, drive-by review - some comments here. ...
4 years, 2 months ago (2016-10-18 13:48:07 UTC) #46
drott
> This problem applies to all the text drawing in chromium, including regular text and ...
4 years ago (2016-11-23 13:58:24 UTC) #47
zakerinasab
On 2016/11/23 13:58:24, drott wrote: > > This problem applies to all the text drawing ...
4 years ago (2016-11-23 16:48:53 UTC) #48
drott
4 years ago (2016-11-23 17:20:10 UTC) #49
Message was sent while issue was closed.
On 2016/11/23 at 16:48:53, zakerinasab wrote:
> On 2016/11/23 13:58:24, drott wrote:
> > > This problem applies to all the text drawing in chromium, including
regular
> > text and SVG. The idea was to land three different patches for canvas, SVG
and
> > regular text so that if one of them breaks the user websites we revert only
that
> > one. I'm now trying to do the piping for SVG, but I vote for a universal
> > decision function too.
> > 
> > How is this going?
> 
> As I understand the decision was to go with separate patches. I worked on the
baseline
> problem in SVG but there is a problem with release try bots. I'm trying to
resolve this
> and land the patch:
> https://codereview.chromium.org/2427773002/

Great, yes - agree that the work is split into separate CL, just by "this" I
just meant this effort in general. Thanks for following up on this.

Powered by Google App Engine
This is Rietveld 408576698