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

Issue 977623002: Glyph positions maintain 32 bit integer part. (Closed)

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

Description

Glyph positions maintain 32 bit integer part. A glyph position when mapped from canvas space to device space may land outside the bounds of the current 16 bit integer part of device space. Device space is already limited to 32 bits for the integer part, but for a short space in drawText and drawPosText it is currently limited to 16 bits (SkFixed). Raise this limit by moving to 48.16. This matches the current similar fix for measureText. BUG=chromium:375322 Committed: https://skia.googlesource.com/skia/+/79738cc7bf12d212bef4ff80591d1bf6f383663d

Patch Set 1 #

Patch Set 2 : A different approach. Clamp to device space. #

Patch Set 3 : SkScalarPin already exists. #

Patch Set 4 : Branchless (on Clang). #

Total comments: 6

Patch Set 5 : Use Sk48Dot6, do no fixed math. #

Total comments: 7

Patch Set 6 : Update GPU side as well. #

Patch Set 7 : Address comments. #

Patch Set 8 : Add explicit SkIntToScalar for documentation and uniformity. #

Total comments: 5

Patch Set 9 : Warnings as errors on Windows. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+100 lines, -120 lines) Patch
M include/core/SkFixed.h View 1 2 3 4 5 6 7 8 1 chunk +15 lines, -0 lines 0 comments Download
M src/core/SkDraw.cpp View 1 2 3 4 5 6 7 8 9 chunks +30 lines, -29 lines 0 comments Download
M src/core/SkDrawProcs.h View 1 2 3 4 3 chunks +3 lines, -28 lines 0 comments Download
M src/core/SkPaint.cpp View 1 2 3 4 1 chunk +0 lines, -8 lines 0 comments Download
M src/device/xps/SkXPSDevice.cpp View 1 2 3 4 2 chunks +7 lines, -7 lines 0 comments Download
M src/gpu/GrBitmapTextContext.cpp View 1 2 3 4 5 6 7 8 16 chunks +44 lines, -47 lines 0 comments Download
M src/gpu/GrStencilAndCoverTextContext.cpp View 2 3 4 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 35 (5 generated)
bungeman-skia
Essentially we need to make sure coordinates in canvas space are SkScalars, and only convert ...
5 years, 9 months ago (2015-03-03 19:00:04 UTC) #2
bungeman-skia
This change (at PS2) solves the issue seen on Android in the linked bug. This ...
5 years, 9 months ago (2015-03-04 20:12:29 UTC) #4
bungeman-skia
This change should now be just a few added instructions. https://codereview.chromium.org/977623002/diff/60001/include/core/SkScalar.h File include/core/SkScalar.h (right): https://codereview.chromium.org/977623002/diff/60001/include/core/SkScalar.h#newcode177 ...
5 years, 9 months ago (2015-03-04 21:38:05 UTC) #5
mtklein
https://codereview.chromium.org/977623002/diff/60001/include/core/SkScalar.h File include/core/SkScalar.h (right): https://codereview.chromium.org/977623002/diff/60001/include/core/SkScalar.h#newcode177 include/core/SkScalar.h:177: static inline SkScalar SkScalarPin(SkScalar x, SkScalar min, SkScalar max) ...
5 years, 9 months ago (2015-03-04 21:45:30 UTC) #6
bungeman-skia
https://codereview.chromium.org/977623002/diff/60001/src/core/SkTextMapStateProc.h File src/core/SkTextMapStateProc.h (right): https://codereview.chromium.org/977623002/diff/60001/src/core/SkTextMapStateProc.h#newcode59 src/core/SkTextMapStateProc.h:59: return SkScalarPin(a, SkIntToScalar(-16384), SkIntToScalar(16384)); On 2015/03/04 21:45:30, mtklein wrote: ...
5 years, 9 months ago (2015-03-04 21:57:36 UTC) #7
mtklein
On 2015/03/04 21:57:36, bungeman1 wrote: > https://codereview.chromium.org/977623002/diff/60001/src/core/SkTextMapStateProc.h > File src/core/SkTextMapStateProc.h (right): > > https://codereview.chromium.org/977623002/diff/60001/src/core/SkTextMapStateProc.h#newcode59 > ...
5 years, 9 months ago (2015-03-04 22:03:47 UTC) #8
bungeman-skia
On 2015/03/04 22:03:47, mtklein wrote: > On 2015/03/04 21:57:36, bungeman1 wrote: > > > https://codereview.chromium.org/977623002/diff/60001/src/core/SkTextMapStateProc.h ...
5 years, 9 months ago (2015-03-04 22:08:33 UTC) #9
mtklein
https://codereview.chromium.org/977623002/diff/60001/src/core/SkTextMapStateProc.h File src/core/SkTextMapStateProc.h (right): https://codereview.chromium.org/977623002/diff/60001/src/core/SkTextMapStateProc.h#newcode59 src/core/SkTextMapStateProc.h:59: return SkScalarPin(a, SkIntToScalar(-16384), SkIntToScalar(16384)); On 2015/03/04 21:57:35, bungeman1 wrote: ...
5 years, 9 months ago (2015-03-04 22:11:01 UTC) #10
bungeman-skia
On 2015/03/04 22:11:01, mtklein wrote: > https://codereview.chromium.org/977623002/diff/60001/src/core/SkTextMapStateProc.h > File src/core/SkTextMapStateProc.h (right): > > https://codereview.chromium.org/977623002/diff/60001/src/core/SkTextMapStateProc.h#newcode59 > ...
5 years, 9 months ago (2015-03-04 22:23:28 UTC) #11
mtklein
On 2015/03/04 22:23:28, bungeman1 wrote: > On 2015/03/04 22:11:01, mtklein wrote: > > > https://codereview.chromium.org/977623002/diff/60001/src/core/SkTextMapStateProc.h ...
5 years, 9 months ago (2015-03-04 22:30:15 UTC) #12
bungeman-skia
On 2015/03/04 22:30:15, mtklein wrote: > On 2015/03/04 22:23:28, bungeman1 wrote: > > On 2015/03/04 ...
5 years, 9 months ago (2015-03-04 23:11:59 UTC) #13
mtklein
On 2015/03/04 23:11:59, bungeman1 wrote: > On 2015/03/04 22:30:15, mtklein wrote: > > On 2015/03/04 ...
5 years, 9 months ago (2015-03-05 00:18:04 UTC) #14
reed1
https://codereview.chromium.org/977623002/diff/60001/src/core/SkTextMapStateProc.h File src/core/SkTextMapStateProc.h (right): https://codereview.chromium.org/977623002/diff/60001/src/core/SkTextMapStateProc.h#newcode59 src/core/SkTextMapStateProc.h:59: return SkScalarPin(a, SkIntToScalar(-16384), SkIntToScalar(16384)); On 2015/03/04 22:11:00, mtklein wrote: ...
5 years, 9 months ago (2015-03-05 18:27:36 UTC) #15
bungeman-skia
At PS5 I've gone back to what was in PS1 and completed that idea. The ...
5 years, 9 months ago (2015-03-05 20:46:46 UTC) #17
mtklein
https://codereview.chromium.org/977623002/diff/80001/include/core/SkFixed.h File include/core/SkFixed.h (right): https://codereview.chromium.org/977623002/diff/80001/include/core/SkFixed.h#newcode157 include/core/SkFixed.h:157: typedef int64_t Sk48Dot16; Let's harmonize the names of SkFixed3232 ...
5 years, 9 months ago (2015-03-05 21:00:03 UTC) #18
bungeman-skia
https://codereview.chromium.org/977623002/diff/80001/include/core/SkFixed.h File include/core/SkFixed.h (right): https://codereview.chromium.org/977623002/diff/80001/include/core/SkFixed.h#newcode157 include/core/SkFixed.h:157: typedef int64_t Sk48Dot16; On 2015/03/05 21:00:03, mtklein wrote: > ...
5 years, 9 months ago (2015-03-05 21:17:56 UTC) #19
bungeman-skia
On 2015/03/05 21:17:56, bungeman1 wrote: > https://codereview.chromium.org/977623002/diff/80001/include/core/SkFixed.h > File include/core/SkFixed.h (right): > > https://codereview.chromium.org/977623002/diff/80001/include/core/SkFixed.h#newcode157 > ...
5 years, 9 months ago (2015-03-05 21:27:14 UTC) #20
Jvsquare
BitmapTextContext bit looks okay, though I'm not thrilled that we're adding two additional SkScalarToFixed calls ...
5 years, 9 months ago (2015-03-05 22:00:40 UTC) #21
reed1
I wonder if we want to decompose this into 1. fix the overflow in text ...
5 years, 9 months ago (2015-03-05 22:02:37 UTC) #22
bungeman-skia
On 2015/03/05 22:00:40, Jvsquare wrote: > BitmapTextContext bit looks okay, though I'm not thrilled that ...
5 years, 9 months ago (2015-03-05 23:43:18 UTC) #23
bungeman-skia
On 2015/03/05 22:02:37, reed1 wrote: > I wonder if we want to decompose this into ...
5 years, 9 months ago (2015-03-05 23:46:53 UTC) #24
reed1
https://codereview.chromium.org/977623002/diff/80001/include/core/SkFixed.h File include/core/SkFixed.h (right): https://codereview.chromium.org/977623002/diff/80001/include/core/SkFixed.h#newcode162 include/core/SkFixed.h:162: #define SkFloatTo48Dot16(x) ((Sk48Dot16)((x) * SK_Fixed1)) I know the value ...
5 years, 9 months ago (2015-03-09 16:33:56 UTC) #25
bungeman-skia
https://codereview.chromium.org/977623002/diff/80001/include/core/SkFixed.h File include/core/SkFixed.h (right): https://codereview.chromium.org/977623002/diff/80001/include/core/SkFixed.h#newcode162 include/core/SkFixed.h:162: #define SkFloatTo48Dot16(x) ((Sk48Dot16)((x) * SK_Fixed1)) On 2015/03/09 16:33:56, reed1 ...
5 years, 9 months ago (2015-03-09 17:49:12 UTC) #26
reed1
api lgtm
5 years, 9 months ago (2015-03-09 17:53:05 UTC) #27
jvanverth1
A couple of comments: https://codereview.chromium.org/977623002/diff/140001/src/gpu/GrBitmapTextContext.cpp File src/gpu/GrBitmapTextContext.cpp (right): https://codereview.chromium.org/977623002/diff/140001/src/gpu/GrBitmapTextContext.cpp#newcode156 src/gpu/GrBitmapTextContext.cpp:156: Sk48Dot16 fx = SkScalarTo48Dot16(x + ...
5 years, 9 months ago (2015-03-10 18:44:26 UTC) #28
bungeman-skia
https://codereview.chromium.org/977623002/diff/140001/src/gpu/GrBitmapTextContext.cpp File src/gpu/GrBitmapTextContext.cpp (right): https://codereview.chromium.org/977623002/diff/140001/src/gpu/GrBitmapTextContext.cpp#newcode156 src/gpu/GrBitmapTextContext.cpp:156: Sk48Dot16 fx = SkScalarTo48Dot16(x + halfSampleX); On 2015/03/10 18:44:26, ...
5 years, 9 months ago (2015-03-10 19:18:12 UTC) #29
bungeman-skia
https://codereview.chromium.org/977623002/diff/140001/src/gpu/GrBitmapTextContext.cpp File src/gpu/GrBitmapTextContext.cpp (right): https://codereview.chromium.org/977623002/diff/140001/src/gpu/GrBitmapTextContext.cpp#newcode242 src/gpu/GrBitmapTextContext.cpp:242: Sk48Dot16 fx = SkScalarTo48Dot16(tmsLoc.fX + halfSampleX); Now, down here ...
5 years, 9 months ago (2015-03-10 19:55:32 UTC) #30
jvanverth1
GPU text lgtm
5 years, 9 months ago (2015-03-11 17:25:26 UTC) #31
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/977623002/160001
5 years, 9 months ago (2015-03-11 20:58:30 UTC) #34
commit-bot: I haz the power
5 years, 9 months ago (2015-03-11 21:05:32 UTC) #35
Message was sent while issue was closed.
Committed patchset #9 (id:160001) as
https://skia.googlesource.com/skia/+/79738cc7bf12d212bef4ff80591d1bf6f383663d

Powered by Google App Engine
This is Rietveld 408576698