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

Issue 490253003: Implement SkPicture::bytesUsed() for SkRecord backend (Closed)

Created:
6 years, 4 months ago by Tom Hudson
Modified:
6 years, 1 month ago
CC:
enne_, reviews_skia.org, schenney, vangelis, digit
Base URL:
https://skia.googlesource.com/skia.git@master
Project:
skia
Visibility:
Public.

Description

Patch Set 1 #

Total comments: 1

Patch Set 2 : Move to SkPictureUtils, start unit test #

Total comments: 5

Patch Set 3 : Straightforward rebase / address Mike's comments #

Patch Set 4 : Unit test prevents bloat #

Total comments: 6

Patch Set 5 : Respond to review, add deletion listener tracking #

Total comments: 2

Patch Set 6 : Fix SkTileGrid computation #

Patch Set 7 : Use Mike's SkVarAlloc changes to dynamically compute size #

Patch Set 8 : Fix minor edit error in SkTileGrid::bytesUsed #

Total comments: 5

Patch Set 9 : Tweak SkPictureUtils doc comment #

Patch Set 10 : SkRecord visitor recursively measures SkPictures #

Total comments: 7

Patch Set 11 : Streamline visitor #

Patch Set 12 : Tweak expected upper bound of data structure size #

Patch Set 13 : NOT FOR COMMIT debug logs #

Patch Set 14 : NOT FOR COMMIT more logging #

Patch Set 15 : More tweaks for object size #

Unified diffs Side-by-side diffs Delta from patch set Stats (+95 lines, -0 lines) Patch
M include/core/SkPicture.h View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M include/utils/SkPictureUtils.h View 1 2 3 4 5 6 7 8 9 1 chunk +8 lines, -0 lines 0 comments Download
M src/core/SkBBoxHierarchy.h View 1 2 1 chunk +2 lines, -0 lines 0 comments Download
M src/core/SkRTree.h View 1 2 3 4 5 6 7 8 9 2 chunks +2 lines, -0 lines 0 comments Download
M src/core/SkRTree.cpp View 1 2 3 4 5 6 1 chunk +8 lines, -0 lines 0 comments Download
M src/core/SkRecord.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +6 lines, -0 lines 0 comments Download
M src/core/SkTileGrid.h View 1 2 1 chunk +2 lines, -0 lines 0 comments Download
M src/core/SkTileGrid.cpp View 1 2 3 4 5 6 7 1 chunk +11 lines, -0 lines 0 comments Download
M src/utils/SkPictureUtils.cpp View 1 2 3 4 5 6 7 8 9 10 13 14 3 chunks +28 lines, -0 lines 0 comments Download
M tests/PictureTest.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 4 chunks +26 lines, -0 lines 0 comments Download
M tests/RecordDrawTest.cpp View 1 2 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 65 (7 generated)
tomhudson
Support a year+-old feature request from Telemetry/Svelte once we shift to SkRecord. reed@: one new ...
6 years, 4 months ago (2014-08-21 17:02:35 UTC) #1
mtklein
impl LGTM https://codereview.chromium.org/490253003/diff/1/include/core/SkPicture.h File include/core/SkPicture.h (right): https://codereview.chromium.org/490253003/diff/1/include/core/SkPicture.h#newcode212 include/core/SkPicture.h:212: size_t bytesUsed() const; I'd perhaps hedge to ...
6 years, 4 months ago (2014-08-21 17:18:06 UTC) #2
reed1
Agree that this is impossible to return exactly. What is the current use-case and importance. ...
6 years, 4 months ago (2014-08-21 18:02:07 UTC) #3
tomhudson
The use case is that (a year and a quarter ago) we were interested in ...
6 years, 4 months ago (2014-08-22 14:06:09 UTC) #4
nduca
It'd be nice to have benchmark coverage of the sizes. Not intended for decision making. ...
6 years, 4 months ago (2014-08-22 18:22:35 UTC) #5
tomhudson
In out-of-band discussion, Mike Reed suggested implementing this in SkPictureUtils, but I think that requires ...
6 years, 3 months ago (2014-08-25 17:27:18 UTC) #6
mtklein
On 2014/08/25 17:27:18, tomhudson wrote: > In out-of-band discussion, Mike Reed suggested implementing this in ...
6 years, 3 months ago (2014-08-25 17:30:14 UTC) #7
enne (OOO)
On 2014/08/22 at 14:06:09, tomhudson wrote: > The use case is that (a year and ...
6 years, 3 months ago (2014-08-25 17:54:19 UTC) #8
tomhudson
Moves code to SkPictureUtils at the suggestion of reed@ to avoid putting any more non-core-drawing ...
6 years, 3 months ago (2014-08-25 18:38:41 UTC) #9
Tom Hudson
Slimming Paint wants this to monitor their migration, so we need to dust this off ...
6 years, 1 month ago (2014-11-17 20:08:02 UTC) #10
Stephen Chennney
We now have a pressing use case with the Slimming Paint project tracking the overhead ...
6 years, 1 month ago (2014-11-17 20:10:13 UTC) #12
mtklein
Might want to start fresh. All these implementation details have changed. Do you care that ...
6 years, 1 month ago (2014-11-17 20:19:32 UTC) #13
Stephen Chennney
On 2014/11/17 20:19:32, mtklein wrote: > Might want to start fresh. All these implementation details ...
6 years, 1 month ago (2014-11-17 20:40:55 UTC) #14
tomhudson
Naive rebase was easy with Mike's instructions. Added a test that the size of an ...
6 years, 1 month ago (2014-11-17 21:29:53 UTC) #15
reed1
https://codereview.chromium.org/490253003/diff/60001/include/utils/SkPictureUtils.h File include/utils/SkPictureUtils.h (right): https://codereview.chromium.org/490253003/diff/60001/include/utils/SkPictureUtils.h#newcode83 include/utils/SkPictureUtils.h:83: static size_t approximateBytesUsed(const SkPicture* pict); nit: Skia Static Methods ...
6 years, 1 month ago (2014-11-17 21:32:26 UTC) #16
chrishtr
https://codereview.chromium.org/490253003/diff/60001/src/core/SkTileGrid.cpp File src/core/SkTileGrid.cpp (right): https://codereview.chromium.org/490253003/diff/60001/src/core/SkTileGrid.cpp#newcode181 src/core/SkTileGrid.cpp:181: for (int i = 0; i < fXTiles * ...
6 years, 1 month ago (2014-11-17 21:34:21 UTC) #18
mtklein
https://codereview.chromium.org/490253003/diff/60001/tests/PictureTest.cpp File tests/PictureTest.cpp (right): https://codereview.chromium.org/490253003/diff/60001/tests/PictureTest.cpp#newcode1730 tests/PictureTest.cpp:1730: // A SkPicture also has SkRecord and possibly SkBBHierarchy ...
6 years, 1 month ago (2014-11-17 21:43:20 UTC) #19
tomhudson
https://codereview.chromium.org/490253003/diff/60001/include/utils/SkPictureUtils.h File include/utils/SkPictureUtils.h (right): https://codereview.chromium.org/490253003/diff/60001/include/utils/SkPictureUtils.h#newcode83 include/utils/SkPictureUtils.h:83: static size_t approximateBytesUsed(const SkPicture* pict); On 2014/11/17 21:32:26, reed1 ...
6 years, 1 month ago (2014-11-17 22:12:15 UTC) #21
mtklein
https://codereview.chromium.org/490253003/diff/60001/src/core/SkTileGrid.cpp File src/core/SkTileGrid.cpp (right): https://codereview.chromium.org/490253003/diff/60001/src/core/SkTileGrid.cpp#newcode182 src/core/SkTileGrid.cpp:182: byteCount = fTiles[i].reserved() * sizeof(unsigned); I think you want ...
6 years, 1 month ago (2014-11-17 23:15:33 UTC) #22
chrishtr
https://codereview.chromium.org/490253003/diff/80001/src/core/SkRecord.h File src/core/SkRecord.h (right): https://codereview.chromium.org/490253003/diff/80001/src/core/SkRecord.h#newcode241 src/core/SkRecord.h:241: unsigned fBytesAllocated; On 2014/11/17 at 23:15:33, mtklein wrote: > ...
6 years, 1 month ago (2014-11-17 23:22:13 UTC) #23
mtklein
> non-constant runtime is probably ok so long as it isn't too slow. How slow ...
6 years, 1 month ago (2014-11-18 00:16:55 UTC) #24
tomhudson
On 2014/11/17 23:15:33, mtklein wrote: > https://codereview.chromium.org/490253003/diff/60001/src/core/SkTileGrid.cpp > File src/core/SkTileGrid.cpp (right): > > https://codereview.chromium.org/490253003/diff/60001/src/core/SkTileGrid.cpp#newcode182 > ...
6 years, 1 month ago (2014-11-18 15:53:55 UTC) #25
tomhudson
malloc_usable_size() was deprecated ~4 years ago on Android; although jemalloc normally ships with it on ...
6 years, 1 month ago (2014-11-18 16:33:53 UTC) #26
mtklein
On 2014/11/18 16:33:53, tomhudson wrote: > malloc_usable_size() was deprecated ~4 years ago on Android; although ...
6 years, 1 month ago (2014-11-18 16:34:48 UTC) #27
tomhudson
On 2014/11/18 16:34:48, mtklein wrote: > Tom, are you working on this: https://codereview.chromium.org/730193003/ ? Nope, ...
6 years, 1 month ago (2014-11-18 16:37:50 UTC) #28
mtklein
> Nope, I wasn't aware of that, but Clank TOT isn't using dlmalloc, so I ...
6 years, 1 month ago (2014-11-18 16:43:30 UTC) #29
tomhudson
On 2014/11/18 16:43:30, mtklein wrote: > OK. Going to have it return 0 on Android ...
6 years, 1 month ago (2014-11-18 17:21:44 UTC) #30
mtklein
> ... but that makes the exact measurement approach completely wrong on Android, > which ...
6 years, 1 month ago (2014-11-18 17:32:25 UTC) #31
mtklein
> It's not a problem to leave out referenced objects that we would expect to ...
6 years, 1 month ago (2014-11-18 17:41:58 UTC) #32
enne (OOO)
> > How often do you guys figure you'll be calling ApproximateBytesUsed, and do you ...
6 years, 1 month ago (2014-11-18 18:48:57 UTC) #33
tomhudson
reed@: PTAL at public API again; is the documentation added to SkPictureUtil::ApproximateBytesUsed() adequate? Do you ...
6 years, 1 month ago (2014-11-18 19:17:47 UTC) #34
mtklein
impl lgtm https://codereview.chromium.org/490253003/diff/140001/include/utils/SkPictureUtils.h File include/utils/SkPictureUtils.h (right): https://codereview.chromium.org/490253003/diff/140001/include/utils/SkPictureUtils.h#newcode86 include/utils/SkPictureUtils.h:86: * (e.g. paths, pixels backing bitmaps). Might ...
6 years, 1 month ago (2014-11-18 19:26:14 UTC) #35
tomhudson
https://codereview.chromium.org/490253003/diff/140001/include/utils/SkPictureUtils.h File include/utils/SkPictureUtils.h (right): https://codereview.chromium.org/490253003/diff/140001/include/utils/SkPictureUtils.h#newcode86 include/utils/SkPictureUtils.h:86: * (e.g. paths, pixels backing bitmaps). On 2014/11/18 19:26:14, ...
6 years, 1 month ago (2014-11-18 19:35:12 UTC) #36
Stephen Chennney
On 2014/11/18 19:35:12, tomhudson wrote: > https://codereview.chromium.org/490253003/diff/140001/include/utils/SkPictureUtils.h > File include/utils/SkPictureUtils.h (right): > > https://codereview.chromium.org/490253003/diff/140001/include/utils/SkPictureUtils.h#newcode86 > ...
6 years, 1 month ago (2014-11-18 19:41:54 UTC) #37
mtklein
https://codereview.chromium.org/490253003/diff/140001/src/core/SkRTree.h File src/core/SkRTree.h (right): https://codereview.chromium.org/490253003/diff/140001/src/core/SkRTree.h#newcode57 src/core/SkRTree.h:57: virtual size_t bytesUsed() const SK_OVERRIDE; On 2014/11/18 19:35:12, tomhudson ...
6 years, 1 month ago (2014-11-18 19:41:58 UTC) #38
mtklein
> Sorry, I totally spaced on the SkPicture refs and was head down not checking ...
6 years, 1 month ago (2014-11-18 19:59:22 UTC) #39
chrishtr
On 2014/11/18 at 19:59:22, mtklein wrote: > > Sorry, I totally spaced on the SkPicture ...
6 years, 1 month ago (2014-11-18 20:04:32 UTC) #40
tomhudson
On 2014/11/18 19:41:58, mtklein wrote: > Uh, okay, but that's a more confusing answer than ...
6 years, 1 month ago (2014-11-18 20:09:42 UTC) #41
mtklein
> If we aren't keeping a word around with size information, it looks like > ...
6 years, 1 month ago (2014-11-18 20:22:02 UTC) #42
mtklein
> Yes, we can, and should, inject a common arena, to avoid the expense of ...
6 years, 1 month ago (2014-11-18 20:28:11 UTC) #43
chrishtr
On 2014/11/18 at 20:28:11, mtklein wrote: > > Yes, we can, and should, inject a ...
6 years, 1 month ago (2014-11-18 20:31:30 UTC) #44
mtklein
> Agreed, let's take that approach. Do we have the pattern to inject an arena ...
6 years, 1 month ago (2014-11-18 20:38:04 UTC) #45
chrishtr
On 2014/11/18 at 20:38:04, mtklein wrote: > > Agreed, let's take that approach. Do we ...
6 years, 1 month ago (2014-11-18 20:41:05 UTC) #46
mtklein
> I guess my question is merely whether you're pretty sure there is a reasonable ...
6 years, 1 month ago (2014-11-18 20:57:31 UTC) #47
Stephen Chennney
On 2014/11/18 20:31:30, chrishtr wrote: > On 2014/11/18 at 20:28:11, mtklein wrote: > > > ...
6 years, 1 month ago (2014-11-18 21:25:42 UTC) #48
tomhudson
Here's a draft with a SkRecord visitor to recursively measure SkPictures, and another trivial unit ...
6 years, 1 month ago (2014-11-18 21:28:26 UTC) #49
Stephen Chennney
On 2014/11/18 21:28:26, tomhudson wrote: > Here's a draft with a SkRecord visitor to recursively ...
6 years, 1 month ago (2014-11-18 21:38:00 UTC) #50
mtklein
https://codereview.chromium.org/490253003/diff/180001/src/core/SkRecord.h File src/core/SkRecord.h (right): https://codereview.chromium.org/490253003/diff/180001/src/core/SkRecord.h#newcode242 src/core/SkRecord.h:242: #endif //SkRecord_DEFINED oh snap https://codereview.chromium.org/490253003/diff/180001/src/utils/SkPictureUtils.cpp File src/utils/SkPictureUtils.cpp (right): https://codereview.chromium.org/490253003/diff/180001/src/utils/SkPictureUtils.cpp#newcode225 ...
6 years, 1 month ago (2014-11-18 21:38:32 UTC) #51
mtklein
https://codereview.chromium.org/490253003/diff/180001/src/utils/SkPictureUtils.cpp File src/utils/SkPictureUtils.cpp (right): https://codereview.chromium.org/490253003/diff/180001/src/utils/SkPictureUtils.cpp#newcode225 src/utils/SkPictureUtils.cpp:225: template <typename T> void operator()(const T& op) { On ...
6 years, 1 month ago (2014-11-18 21:46:23 UTC) #52
tomhudson
https://codereview.chromium.org/490253003/diff/180001/src/core/SkRecord.h File src/core/SkRecord.h (right): https://codereview.chromium.org/490253003/diff/180001/src/core/SkRecord.h#newcode242 src/core/SkRecord.h:242: #endif //SkRecord_DEFINED On 2014/11/18 21:38:32, mtklein wrote: > oh ...
6 years, 1 month ago (2014-11-18 21:49:37 UTC) #54
mtklein
https://codereview.chromium.org/490253003/diff/180001/src/core/SkRecord.h File src/core/SkRecord.h (right): https://codereview.chromium.org/490253003/diff/180001/src/core/SkRecord.h#newcode242 src/core/SkRecord.h:242: #endif //SkRecord_DEFINED On 2014/11/18 21:49:37, tomhudson wrote: > On ...
6 years, 1 month ago (2014-11-18 21:54:35 UTC) #55
mtklein
On 2014/11/18 21:54:35, mtklein wrote: > https://codereview.chromium.org/490253003/diff/180001/src/core/SkRecord.h > File src/core/SkRecord.h (right): > > https://codereview.chromium.org/490253003/diff/180001/src/core/SkRecord.h#newcode242 > ...
6 years, 1 month ago (2014-11-18 21:55:10 UTC) #56
mtklein
(forgot to say, lgtm)
6 years, 1 month ago (2014-11-18 21:58:59 UTC) #57
reed1
api lgtm
6 years, 1 month ago (2014-11-18 22:12:56 UTC) #58
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/490253003/200001
6 years, 1 month ago (2014-11-19 13:15:21 UTC) #60
commit-bot: I haz the power
Try jobs failed on following builders: Test-Ubuntu13.10-GCE-NoGPU-x86_64-Debug-Trybot on client.skia (http://build.chromium.org/p/client.skia/builders/Test-Ubuntu13.10-GCE-NoGPU-x86_64-Debug-Trybot/builds/789)
6 years, 1 month ago (2014-11-19 13:32:35 UTC) #62
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/490253003/280001
6 years, 1 month ago (2014-11-19 18:37:00 UTC) #64
commit-bot: I haz the power
6 years, 1 month ago (2014-11-19 18:41:17 UTC) #65
Message was sent while issue was closed.
Committed patchset #15 (id:280001) as
https://skia.googlesource.com/skia/+/158fcaa031d105dc999d9813fee8927db56a871c

Powered by Google App Engine
This is Rietveld 408576698