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

Issue 20693003: Fix several issues with drawing text as paths.

Created:
7 years, 4 months ago by bungeman-skia
Modified:
6 years, 7 months ago
Reviewers:
reed1
CC:
skia-review_googlegroups.com
Visibility:
Public.

Description

Fix several issues with drawing text as paths. SkPaint::setupForAsPaths currently does not scale the stroke width (or miter) to match the scale. This produces incorrect results when drawing outlined text as paths. Currently, only SkDraw::drawPosText_asPaths is calling SkPaint::setupForAsPaths. For consistency, the other "text as path" methods on SkDraw should do so as well.

Patch Set 1 #

Total comments: 5
Unified diffs Side-by-side diffs Delta from patch set Stats (+17 lines, -11 lines) Patch
src/core/SkDraw.cpp View 3 chunks +12 lines, -8 lines 0 comments Download
src/core/SkPaint.cpp View 3 chunks +5 lines, -3 lines 5 comments Download

Messages

Total messages: 5 (0 generated)
bungeman-skia
This initial change (Patch Set 1) updates SkDraw::drawTextOnPath, but SkDraw::drawText_asPaths should also be updated. This ...
7 years, 4 months ago (2013-07-27 15:23:54 UTC) #1
bungeman-skia
Also note that this may (or may not) have something to do with crbug.com/237181 .
7 years, 4 months ago (2013-07-27 15:27:44 UTC) #2
reed1
Do we have GMs that exercise these code-paths? https://codereview.chromium.org/20693003/diff/1/src/core/SkPaint.cpp File src/core/SkPaint.cpp (right): https://codereview.chromium.org/20693003/diff/1/src/core/SkPaint.cpp#newcode990 src/core/SkPaint.cpp:990: this->setStrokeWidth(fWidth ...
7 years, 4 months ago (2013-07-29 14:44:39 UTC) #3
bungeman-skia
shadertext2 gm exercises this, as does the TextOnPath sample (in a more interesting way). https://codereview.chromium.org/20693003/diff/1/src/core/SkPaint.cpp ...
7 years, 4 months ago (2013-07-29 14:54:18 UTC) #4
bungeman-skia
6 years, 7 months ago (2014-05-22 15:06:25 UTC) #5
https://codereview.chromium.org/20693003/diff/1/src/core/SkPaint.cpp
File src/core/SkPaint.cpp (right):

https://codereview.chromium.org/20693003/diff/1/src/core/SkPaint.cpp#newcode991
src/core/SkPaint.cpp:991: //this->setStrokeMiter(fMiterLimit / scale);
On 2013/07/29 14:54:18, bungeman1 wrote:
> On 2013/07/29 14:44:39, reed1 wrote:
> > Do we need this line?
> 
> Probably? The only reason it's commented out is that this creates crazy
> artifacts in the shadertext2 gm. (The points on the 'A' get pointy.)

Mike pointed out to me that the miter limit is actually a ratio anyway, not a
hard value. As a result, this commented out line should be removed as it does
not need to scale.

Powered by Google App Engine
This is Rietveld 408576698