Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(833)

Issue 6250051: Change patheffect to take a (new) StrokeRec object, which encapsulates the fill (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
12 years, 7 months ago by reed1
Modified:
12 years, 7 months ago
Reviewers:
bungeman, mike3
CC:
skia-review_googlegroups.com
Base URL:
http://skia.googlecode.com/svn/trunk/
Visibility:
Public.

Description

Change patheffect to take a (new) StrokeRec object, which encapsulates the fill or stroke parameters for a path. Today, the patheffect only sees if the caller was going to stroke or fill, and if stroke, it just sees the width. With this change, the effect can see all of the related parameters (e.g. cap/join/miter). No other change is intended at this time. After this change, I hope to use this additional data to allow SkDashPathEffect to, at times, apply the stroke as part of its effect, which may be much more efficient than first dashing, and then reading that and stroking it. Most of these files changed just because of the new parameter to filterPath. The key changes are in SkPathEffect.[h,cpp], SkPaint.cpp and SkScalerContext.cpp Committed: https://code.google.com/p/skia/source/detail?r=4048

Patch Set 1 #

Patch Set 2 : #

Patch Set 3 : #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+267 lines, -213 lines) Patch
M bench/DashBench.cpp View 1 chunk +2 lines, -2 lines 0 comments Download
M include/core/SkPathEffect.h View 1 4 chunks +94 lines, -12 lines 0 comments Download
M include/effects/Sk1DPathEffect.h View 2 chunks +2 lines, -4 lines 0 comments Download
M include/effects/Sk2DPathEffect.h View 1 chunk +1 line, -1 line 0 comments Download
M include/effects/SkCornerPathEffect.h View 1 chunk +1 line, -1 line 0 comments Download
M include/effects/SkDashPathEffect.h View 1 chunk +1 line, -3 lines 0 comments Download
M include/effects/SkDiscretePathEffect.h View 1 chunk +1 line, -3 lines 0 comments Download
M samplecode/ClockFaceView.cpp View 2 chunks +3 lines, -3 lines 0 comments Download
M samplecode/SampleAll.cpp View 1 chunk +3 lines, -3 lines 0 comments Download
M samplecode/SampleSlides.cpp View 1 chunk +3 lines, -5 lines 0 comments Download
M samplecode/SampleTextEffects.cpp View 1 chunk +3 lines, -3 lines 0 comments Download
M src/core/SkPaint.cpp View 1 chunk +15 lines, -49 lines 0 comments Download
M src/core/SkPathEffect.cpp View 1 3 chunks +82 lines, -98 lines 1 comment Download
M src/core/SkScalerContext.cpp View 1 chunk +18 lines, -14 lines 0 comments Download
M src/core/SkStroke.cpp View 1 2 1 chunk +28 lines, -1 line 0 comments Download
M src/effects/Sk1DPathEffect.cpp View 2 chunks +4 lines, -4 lines 0 comments Download
M src/effects/Sk2DPathEffect.cpp View 1 chunk +1 line, -1 line 0 comments Download
M src/effects/SkCornerPathEffect.cpp View 1 chunk +1 line, -1 line 0 comments Download
M src/effects/SkDashPathEffect.cpp View 1 chunk +2 lines, -2 lines 0 comments Download
M src/effects/SkDiscretePathEffect.cpp View 1 chunk +2 lines, -2 lines 0 comments Download
M src/ports/SkGlobalInitialization_default.cpp View 1 chunk +0 lines, -1 line 0 comments Download

Messages

Total messages: 5
reed1
mirror of rev. 4046 (which was reverted in 4047)
12 years, 7 months ago (2012-05-24 20:38:29 UTC) #1
reed1
need to figure out why GM:pathfill fails sometimes...
12 years, 7 months ago (2012-05-24 20:55:56 UTC) #2
mike3
Found the bug: SkStroke.cpp AutoTmpPath -- need to set the fSwap... bool to true in ...
12 years, 7 months ago (2012-05-25 00:06:31 UTC) #3
reed1
fixed in patchset 3
12 years, 7 months ago (2012-05-25 01:03:51 UTC) #4
bungeman
12 years, 7 months ago (2012-05-25 14:00:30 UTC) #5
Stroking needs to come after path effects. Note that previously an 'inner'
stroker could cancel the outer guy (Paint or ScalerContext) from stroking by
mucking with the width. In this case we still want to be able to change the
stroke properties, but we also need to make sure that we don't stoke too early.

https://codereview.appspot.com/6250051/diff/2002/src/core/SkPathEffect.cpp
File src/core/SkPathEffect.cpp (right):

https://codereview.appspot.com/6250051/diff/2002/src/core/SkPathEffect.cpp#ne...
src/core/SkPathEffect.cpp:127: bool SkComposePathEffect::filterPath(SkPath* dst,
const SkPath& src,
It seems that in order for things to work as before, you would need the path
effect to do this self-apply-stroking only when it is the last path effect to be
applied (so that it is as-if the stroke comes after the path effect is applied).
As this is written, it appears that the first path effect with the ability to
self-apply-stroke will do so and then later path effects will get the stroked
version instead of the skeletal version (as they would now).  For example, here
in  SkComposePathEffect it seems that only the 'outer' path effect should do
stroking if it can, while the 'inner' path effect should not do stroking, even
if it can.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b