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

Issue 741793002: Add SkNVRefCnt, prune down SkPicture's size (Closed)

Created:
6 years, 1 month ago by mtklein_C
Modified:
6 years, 1 month ago
CC:
reviews_skia.org
Base URL:
https://skia.googlesource.com/skia.git@master
Project:
skia
Visibility:
Public.

Description

Add SkNVRefCnt, prune down SkPicture's size SkNVRefCnt is a variant of SkRefCnt that's Not Virtual, so weighs 4 bytes instead of 8 or 16. There's only benefit to doing this if the deriving class does not otherwise need a vtable, e.g. SkPicture. I've stripped out some cruft from SkPicture, rearranged fields to pack tightly, and added compile asserts for the sizes of SkPicture, SkRecord, and SkVarAlloc. BUG=skia:3144 Committed: https://skia.googlesource.com/skia/+/08d1fccf6eeec0a9fd5421e59e4d05daccf6e339

Patch Set 1 #

Patch Set 2 : dtor #

Patch Set 3 : trim some bytes #

Patch Set 4 : notes #

Total comments: 4

Patch Set 5 : tom #

Patch Set 6 : trim a bit more, add a compile assert #

Patch Set 7 : update test to current size on my desktop #

Patch Set 8 : pack better, who knows why #

Total comments: 2

Patch Set 9 : picture #

Patch Set 10 : tweak name #

Unified diffs Side-by-side diffs Delta from patch set Stats (+45 lines, -26 lines) Patch
M gm/gmmain.cpp View 4 chunks +4 lines, -4 lines 0 comments Download
M include/core/SkPicture.h View 1 2 3 4 5 5 chunks +5 lines, -9 lines 0 comments Download
M include/core/SkRefCnt.h View 1 2 3 4 1 chunk +19 lines, -0 lines 0 comments Download
M src/core/SkRecord.h View 1 2 3 4 5 6 7 1 chunk +6 lines, -3 lines 0 comments Download
M src/core/SkRecorder.cpp View 1 2 3 4 5 6 7 8 9 2 chunks +8 lines, -8 lines 0 comments Download
M src/core/SkVarAlloc.h View 1 2 3 4 5 6 7 1 chunk +1 line, -0 lines 0 comments Download
M tests/PictureTest.cpp View 1 2 3 4 5 6 7 2 chunks +2 lines, -2 lines 0 comments Download

Messages

Total messages: 18 (4 generated)
mtklein
6 years, 1 month ago (2014-11-19 18:54:28 UTC) #2
tomhudson
https://codereview.chromium.org/741793002/diff/60001/include/core/SkPicture.h File include/core/SkPicture.h (right): https://codereview.chromium.org/741793002/diff/60001/include/core/SkPicture.h#newcode298 include/core/SkPicture.h:298: mutable uint32_t fUniqueID; Follow-on CL to move this up ...
6 years, 1 month ago (2014-11-19 18:59:06 UTC) #3
mtklein
https://codereview.chromium.org/741793002/diff/60001/include/core/SkPicture.h File include/core/SkPicture.h (right): https://codereview.chromium.org/741793002/diff/60001/include/core/SkPicture.h#newcode298 include/core/SkPicture.h:298: mutable uint32_t fUniqueID; On 2014/11/19 18:59:06, tomhudson wrote: > ...
6 years, 1 month ago (2014-11-19 19:19:15 UTC) #4
tomhudson
Mostly LGTM; beside the one comment inline I wonder if 184 -> 144 isn't too ...
6 years, 1 month ago (2014-11-19 20:05:26 UTC) #6
mtklein
https://codereview.chromium.org/741793002/diff/140001/include/core/SkPicture.h File include/core/SkPicture.h (left): https://codereview.chromium.org/741793002/diff/140001/include/core/SkPicture.h#oldcode64 include/core/SkPicture.h:64: typedef SkRefCnt INHERITED; On 2014/11/19 20:05:26, tomhudson wrote: > ...
6 years, 1 month ago (2014-11-19 20:08:46 UTC) #7
tomhudson
On 2014/11/19 20:05:26, tomhudson wrote: > Mostly LGTM; beside the one comment inline I wonder ...
6 years, 1 month ago (2014-11-19 20:47:44 UTC) #8
reed2
I think SkRecorder::newDrawableSnapshot will be broken by this, but not sure. It's custom SkData handler ...
6 years, 1 month ago (2014-11-20 02:03:30 UTC) #10
mtklein
On 2014/11/20 02:03:30, reed2 wrote: > I think SkRecorder::newDrawableSnapshot will be broken by this, but ...
6 years, 1 month ago (2014-11-20 14:15:24 UTC) #11
reed1
On 2014/11/20 14:15:24, mtklein wrote: > On 2014/11/20 02:03:30, reed2 wrote: > > I think ...
6 years, 1 month ago (2014-11-20 17:06:20 UTC) #12
reed1
with futuristic misgivings :) lgtm
6 years, 1 month ago (2014-11-20 17:07:40 UTC) #13
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/741793002/170001
6 years, 1 month ago (2014-11-20 17:09:16 UTC) #15
commit-bot: I haz the power
Committed patchset #10 (id:170001) as https://skia.googlesource.com/skia/+/08d1fccf6eeec0a9fd5421e59e4d05daccf6e339
6 years, 1 month ago (2014-11-20 17:18:42 UTC) #16
f(malita)
On 2014/11/20 17:18:42, I haz the power (commit-bot) wrote: > Committed patchset #10 (id:170001) as ...
6 years, 1 month ago (2014-11-20 19:31:58 UTC) #17
humper
6 years, 1 month ago (2014-11-20 21:39:29 UTC) #18
Message was sent while issue was closed.
A revert of this CL (patchset #10 id:170001) has been created in
https://codereview.chromium.org/749683002/ by humper@google.com.

The reason for reverting is: Breaking Canary and DEPS roll.

Powered by Google App Engine
This is Rietveld 408576698