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

Issue 748883005: Factor text size device mapping in SkScalerContext. (Closed)

Created:
6 years ago by bungeman-skia
Modified:
5 years, 9 months ago
Reviewers:
mtklein, reed1
CC:
reviews_skia.org
Base URL:
https://skia.googlesource.com/skia.git@master
Project:
skia
Visibility:
Public.

Description

Factor text size device mapping in SkScalerContext. All of our font back-ends use the text size in some way other than simple concatentation with the current matrix. The code here finds the full device matrix and then decomposes it to extract the text size. FreeType, GDI, and DirectWrite use the text size as the pre-hint scale. CoreText will not scale color emoji above the requested text size, and certain features like 'trak' are performed on the text size. Committed: https://skia.googlesource.com/skia/+/5f14c5e038a16c80d50c2f87ae7c8775f977456c

Patch Set 1 #

Patch Set 2 : Works on Windows. #

Patch Set 3 : Somewhat cleaner. #

Patch Set 4 : Line lengths. #

Patch Set 5 : Fix GDI. #

Patch Set 6 : Small but required optimization. #

Patch Set 7 : Add comments, clarify names. #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+167 lines, -136 lines) Patch
M src/core/SkScalerContext.h View 1 2 3 4 5 6 1 chunk +44 lines, -0 lines 0 comments Download
M src/core/SkScalerContext.cpp View 1 2 3 4 5 6 2 chunks +86 lines, -0 lines 0 comments Download
M src/ports/SkFontHost_FreeType.cpp View 1 2 1 chunk +6 lines, -50 lines 0 comments Download
M src/ports/SkFontHost_win.cpp View 1 2 3 4 1 chunk +14 lines, -42 lines 1 comment Download
M src/ports/SkScalerContext_win_dw.cpp View 1 2 2 chunks +17 lines, -44 lines 0 comments Download

Messages

Total messages: 10 (2 generated)
bungeman-skia
I think I've got this doing more or less the same thing it used to ...
6 years ago (2014-12-04 20:02:33 UTC) #2
reed1
1. how about you define a struct with all of the decomposed answers, and just ...
6 years ago (2014-12-04 20:11:53 UTC) #3
bungeman-skia
On 2014/12/04 20:11:53, reed1 wrote: > 1. how about you define a struct with all ...
6 years ago (2014-12-04 20:50:23 UTC) #4
bungeman-skia
For the time being, can I just add a big comment describing what it does ...
6 years ago (2014-12-05 19:51:29 UTC) #5
reed1
lgtm
6 years ago (2014-12-05 20:12:20 UTC) #6
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/748883005/120001
6 years ago (2014-12-05 20:17:09 UTC) #8
commit-bot: I haz the power
Committed patchset #7 (id:120001) as https://skia.googlesource.com/skia/+/5f14c5e038a16c80d50c2f87ae7c8775f977456c
6 years ago (2014-12-05 20:26:50 UTC) #9
bungeman-skia
5 years, 9 months ago (2015-03-17 21:15:19 UTC) #10
Message was sent while issue was closed.
https://codereview.chromium.org/748883005/diff/120001/src/ports/SkFontHost_wi...
File src/ports/SkFontHost_win.cpp (right):

https://codereview.chromium.org/748883005/diff/120001/src/ports/SkFontHost_wi...
src/ports/SkFontHost_win.cpp:637: SkScalar gdiTextSize = scale.fY;
Here we need to call SkScalarRoundToScalar(). The one thing this calculation
does backwards from the old way is that the old way calculates the scale from
the text size, but here we're getting the text size from the scale (which is
arguably the right way to think about it).

In the 'no hinting' case, this was already rounded to an integer (so that the
rest of the matrix is minimized), so there is no change there. In the 'hinted'
case, we've removed the entire scale from the matrix, so the scale value is the
'real' residual size. We used to round this size, and we should continue to do
so.

Powered by Google App Engine
This is Rietveld 408576698