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

Issue 1319723002: Have SkPicture::willPlayBackBitmaps() count SkImages too. (Closed)

Created:
5 years, 3 months ago by mtklein_C
Modified:
5 years, 3 months ago
Reviewers:
f(malita), mtklein
CC:
reviews_skia.org, reed1
Base URL:
https://skia.googlesource.com/skia.git@master
Target Ref:
refs/heads/master
Project:
skia
Visibility:
Public.

Description

Have SkPicture::willPlayBackBitmaps() count SkImages too. New unit test fails at head but passes with this patch. BUG=skia:4225 Committed: https://skia.googlesource.com/skia/+/a16af21b17885c517a587482e9062efb99c19306

Patch Set 1 #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+32 lines, -5 lines) Patch
M src/core/SkPictureCommon.h View 3 chunks +16 lines, -5 lines 0 comments Download
M tests/PictureTest.cpp View 2 chunks +16 lines, -0 lines 2 comments Download

Messages

Total messages: 14 (5 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/1319723002/1 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1319723002/1
5 years, 3 months ago (2015-08-26 14:28:28 UTC) #2
mtklein_C
5 years, 3 months ago (2015-08-26 14:35:59 UTC) #4
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
5 years, 3 months ago (2015-08-26 14:37:45 UTC) #6
f(malita)
lgtm https://codereview.chromium.org/1319723002/diff/1/tests/PictureTest.cpp File tests/PictureTest.cpp (right): https://codereview.chromium.org/1319723002/diff/1/tests/PictureTest.cpp#newcode54 tests/PictureTest.cpp:54: SkAutoTUnref<SkImage> image(SkImage::NewFromBitmap(SkBitmap())); I was kinda surprised that this ...
5 years, 3 months ago (2015-08-26 14:56:01 UTC) #7
mtklein
https://codereview.chromium.org/1319723002/diff/1/tests/PictureTest.cpp File tests/PictureTest.cpp (right): https://codereview.chromium.org/1319723002/diff/1/tests/PictureTest.cpp#newcode54 tests/PictureTest.cpp:54: SkAutoTUnref<SkImage> image(SkImage::NewFromBitmap(SkBitmap())); On 2015/08/26 14:56:00, f(malita) wrote: > I ...
5 years, 3 months ago (2015-08-26 15:13:57 UTC) #9
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1319723002/1 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1319723002/1
5 years, 3 months ago (2015-08-26 15:14:18 UTC) #11
commit-bot: I haz the power
Committed patchset #1 (id:1) as https://skia.googlesource.com/skia/+/a16af21b17885c517a587482e9062efb99c19306
5 years, 3 months ago (2015-08-26 15:14:55 UTC) #12
vmpstr
On 2015/08/26 15:14:55, commit-bot: I haz the power wrote: > Committed patchset #1 (id:1) as ...
5 years, 3 months ago (2015-08-26 17:36:18 UTC) #13
mtklein
5 years, 3 months ago (2015-08-26 17:49:57 UTC) #14
Message was sent while issue was closed.
On 2015/08/26 17:36:18, vmpstr wrote:
> On 2015/08/26 15:14:55, commit-bot: I haz the power wrote:
> > Committed patchset #1 (id:1) as
> >
https://skia.googlesource.com/skia/+/a16af21b17885c517a587482e9062efb99c19306
> 
> I was wondering about willPlaybackBitmaps in general and maybe you peeps know
> this off the top of your head: Is this always constant time operation or does
it
> sometimes do some work? In Chromium, we use this pretty aggressively as a
"cheap
> early out" check, but if it's not always cheap then we should probably reduce
> some usages. (sorry about hijacking a review thread :P)

The first time it's called, it's O(N) for N calls made to the original recording
canvas that generated the picture.  It's cached from there on, so it becomes
O(1) if you call it many times per picture.

Right now all of hasText(), willPlayBackBitmaps() and numSlowPaths() follow this
same lazy pattern.  In fact, they run together off the same lazy bit, so the
first time you call one of them, you pre-calculate the other two.

hasText() and willPlayBackBitmaps() may scale sub-O(N) in practice, in that they
can bail out early when they know the answer is 'true'.  numSlowPaths() always
triggers an operation that runs over the whole picture.

These operations are probably faster than can be done with an external SkCanvas
subclass, but they scale pretty much the same way.

Powered by Google App Engine
This is Rietveld 408576698