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

Issue 1769803002: add setter on SkPaint that takes sk_sp (Closed)

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

Description

Patch Set 1 #

Total comments: 5
Unified diffs Side-by-side diffs Delta from patch set Stats (+92 lines, -126 lines) Patch
M include/core/SkPaint.h View 12 chunks +27 lines, -18 lines 0 comments Download
M src/core/SkPaint.cpp View 13 chunks +65 lines, -108 lines 5 comments Download

Messages

Total messages: 15 (7 generated)
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1769803002/1 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1769803002/1
4 years, 9 months ago (2016-03-06 00:27:58 UTC) #3
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
4 years, 9 months ago (2016-03-06 00:37:12 UTC) #5
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1769803002/1 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1769803002/1
4 years, 9 months ago (2016-03-06 00:38:11 UTC) #8
commit-bot: I haz the power
Committed patchset #1 (id:1) as https://skia.googlesource.com/skia/+/a917eba6ea8a6936f2c9271e487b14d14b99c98e
4 years, 9 months ago (2016-03-06 00:39:29 UTC) #10
reed1
A revert of this CL (patchset #1 id:1) has been created in https://codereview.chromium.org/1771613002/ by reed@google.com. ...
4 years, 9 months ago (2016-03-06 01:51:27 UTC) #11
bungeman-skia
https://codereview.chromium.org/1769803002/diff/1/src/core/SkPaint.cpp File src/core/SkPaint.cpp (right): https://codereview.chromium.org/1769803002/diff/1/src/core/SkPaint.cpp#newcode66 src/core/SkPaint.cpp:66: #define COPY_CTR(field) field(src.field) Note that for simplicity and uniformity, ...
4 years, 9 months ago (2016-03-06 04:50:05 UTC) #13
bungeman-skia
https://codereview.chromium.org/1769803002/diff/1/src/core/SkPaint.cpp File src/core/SkPaint.cpp (right): https://codereview.chromium.org/1769803002/diff/1/src/core/SkPaint.cpp#newcode92 src/core/SkPaint.cpp:92: #define REF_MOVE(field) field = src.field; src.field = nullptr On ...
4 years, 9 months ago (2016-03-06 14:03:40 UTC) #14
reed1
4 years, 9 months ago (2016-03-06 20:06:18 UTC) #15
Message was sent while issue was closed.
moved to https://codereview.chromium.org/1770723002#

https://codereview.chromium.org/1769803002/diff/1/src/core/SkPaint.cpp
File src/core/SkPaint.cpp (right):

https://codereview.chromium.org/1769803002/diff/1/src/core/SkPaint.cpp#newcode66
src/core/SkPaint.cpp:66: #define COPY_CTR(field) field(src.field)
On 2016/03/06 04:50:05, bungeman1 wrote:
> Note that for simplicity and uniformity, COPY_CTR can just be renamed COPY,
the
> existing COPY below be removed, and just do everything in the member
initializer
> list. Then you don't need two names and everything looks the same.
> Interestingly, it looks like you already did basically this in the
> operator=(const&) below.

Agreed about unity. I think CTR is clearer (to me) than COPY, but I'll go with
COPY.

https://codereview.chromium.org/1769803002/diff/1/src/core/SkPaint.cpp#newcode92
src/core/SkPaint.cpp:92: #define REF_MOVE(field) field = src.field; src.field =
nullptr
On 2016/03/06 14:03:40, bungeman1 wrote:
> On 2016/03/06 04:50:05, bungeman1 wrote:
> > REF_MOVE needs to be removed and all the REF_MOVE below just turn into MOVE.
> > Indeed, this should end up like the copy constructor above, but with MOVE
> > instead of COPY, with everything done in the member initializer list. This
is
> > probably the source of the leak, as the assignment here is actually calling
> the
> > copy assignment operator. It looks like you already did this with move
> > assignment operator.
> 
> I shouldn't write these things so late at night. Of course this should not
leak.
> However, this is calling the copy assignment operator so it's not a very
> efficient move.

Doh! I inverted the intended use. Will move all of them.

Powered by Google App Engine
This is Rietveld 408576698