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

Issue 1128113008: Make GrStrokeInfo inherit from SkStrokeRec (Closed)

Created:
5 years, 7 months ago by Kimmo Kinnunen
Modified:
5 years, 7 months ago
Reviewers:
egdaniel, bsalomon
CC:
reviews_skia.org
Base URL:
https://skia.googlesource.com/skia.git@master
Target Ref:
refs/heads/master
Project:
skia
Visibility:
Public.

Description

Make GrStrokeInfo inherit from SkStrokeRec Make the code more readable by inheriting GrStrokeInfo from SkStrokeRec. This should avoid the long .getStrokeRec() and .getStrokeRecPtr(). These were a bit cumbersome especially in cases where an alias variable was created for these, and then the reader had to keep track to which StrokeInfo member the StrokeRec alias was pointing. Removes SkStrokeRec::SkStrokeRec(const SkStrokeRec&). It was memcpying. Try to play it safe wrt compiler using the possible padding of superclass for subclass members. Instead, let the compiler generate the copy constructor. Assignment operator was already compiler-generated, so at least in that way this is consistent. Renames GrStrokeInfo::applyDash to applyDashToPath for consistency with superclass applyToPath. Committed: https://skia.googlesource.com/skia/+/d156d36af871c23ce471a18764f4597f09cfca95

Patch Set 1 #

Patch Set 2 : #

Patch Set 3 : #

Patch Set 4 : #

Patch Set 5 : rebase #

Total comments: 2

Patch Set 6 : Address review comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+64 lines, -82 lines) Patch
M include/core/SkStrokeRec.h View 1 2 3 4 1 chunk +0 lines, -2 lines 0 comments Download
M src/core/SkStrokeRec.cpp View 1 chunk +0 lines, -4 lines 0 comments Download
M src/gpu/GrAADistanceFieldPathRenderer.cpp View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M src/gpu/GrContext.cpp View 1 2 3 4 10 chunks +11 lines, -18 lines 0 comments Download
M src/gpu/GrDefaultPathRenderer.cpp View 1 2 3 4 3 chunks +5 lines, -5 lines 0 comments Download
M src/gpu/GrPathRenderer.h View 1 chunk +3 lines, -3 lines 0 comments Download
M src/gpu/GrSoftwarePathRenderer.cpp View 1 chunk +1 line, -1 line 0 comments Download
M src/gpu/GrStencilAndCoverPathRenderer.cpp View 3 chunks +4 lines, -4 lines 0 comments Download
M src/gpu/GrStrokeInfo.h View 1 2 3 4 5 6 chunks +22 lines, -24 lines 0 comments Download
M src/gpu/GrStrokeInfo.cpp View 1 chunk +5 lines, -5 lines 0 comments Download
M src/gpu/SkGpuDevice.cpp View 1 2 3 4 5 chunks +9 lines, -12 lines 0 comments Download
M src/gpu/effects/GrDashingEffect.cpp View 1 2 3 4 5 2 chunks +3 lines, -3 lines 0 comments Download

Messages

Total messages: 11 (3 generated)
Kimmo Kinnunen
Would this be useful, or was this sort of inheritance frowned upon? I find it ...
5 years, 7 months ago (2015-05-08 06:53:31 UTC) #2
Kimmo Kinnunen
This would be ready for review
5 years, 7 months ago (2015-05-15 13:19:39 UTC) #3
egdaniel
https://codereview.chromium.org/1128113008/diff/80001/src/gpu/GrStrokeInfo.h File src/gpu/GrStrokeInfo.h (right): https://codereview.chromium.org/1128113008/diff/80001/src/gpu/GrStrokeInfo.h#newcode137 src/gpu/GrStrokeInfo.h:137: bool operator==(const SkStrokeRec& other) const; you declare these comparison ...
5 years, 7 months ago (2015-05-15 14:07:05 UTC) #4
Kimmo Kinnunen
https://codereview.chromium.org/1128113008/diff/80001/src/gpu/GrStrokeInfo.h File src/gpu/GrStrokeInfo.h (right): https://codereview.chromium.org/1128113008/diff/80001/src/gpu/GrStrokeInfo.h#newcode137 src/gpu/GrStrokeInfo.h:137: bool operator==(const SkStrokeRec& other) const; On 2015/05/15 14:07:05, egdaniel ...
5 years, 7 months ago (2015-05-18 06:18:36 UTC) #5
egdaniel
lgtm, adding brian for API
5 years, 7 months ago (2015-05-18 13:34:36 UTC) #7
bsalomon
lgtm
5 years, 7 months ago (2015-05-18 13:45:07 UTC) #8
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1128113008/100001
5 years, 7 months ago (2015-05-19 05:17:20 UTC) #10
commit-bot: I haz the power
5 years, 7 months ago (2015-05-19 05:23:59 UTC) #11
Message was sent while issue was closed.
Committed patchset #6 (id:100001) as
https://skia.googlesource.com/skia/+/d156d36af871c23ce471a18764f4597f09cfca95

Powered by Google App Engine
This is Rietveld 408576698