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

Issue 1301633002: Add subsets to SkImageGenerator and SkImageCacherator . (Closed)

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

Description

Add subsets to SkImageGenerator and SkImageCacherator ... to support subsets in SkImage! BUG=skia: Committed: https://skia.googlesource.com/skia/+/935d6cfaa78b6be75c9fcc596805f0f9b8da972e

Patch Set 1 #

Patch Set 2 : impl subsetting #

Patch Set 3 : don't double delete #

Patch Set 4 : add tests #

Patch Set 5 : fix no-gpu build #

Patch Set 6 : fix release-build warning #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+250 lines, -74 lines) Patch
M gm/image_pict.cpp View 1 2 3 4 5 3 chunks +142 lines, -29 lines 0 comments Download
M include/core/SkImageGenerator.h View 2 chunks +4 lines, -2 lines 0 comments Download
M src/core/SkImageCacherator.h View 2 chunks +8 lines, -5 lines 0 comments Download
M src/core/SkImageCacherator.cpp View 1 5 chunks +79 lines, -31 lines 4 comments Download
M src/core/SkImageGenerator.cpp View 1 2 3 1 chunk +4 lines, -3 lines 0 comments Download
M src/core/SkPictureImageGenerator.cpp View 1 2 chunks +13 lines, -4 lines 0 comments Download

Messages

Total messages: 29 (11 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/1301633002/20001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1301633002/20001
5 years, 4 months ago (2015-08-17 22:05:27 UTC) #3
reed1
ptal
5 years, 4 months ago (2015-08-17 22:05:59 UTC) #4
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-Shared-Trybot on client.skia (JOB_FAILED, http://build.chromium.org/p/client.skia/builders/Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-Shared-Trybot/builds/2652)
5 years, 4 months ago (2015-08-17 22:13:35 UTC) #6
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1301633002/40001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1301633002/40001
5 years, 4 months ago (2015-08-17 22:17:08 UTC) #8
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
5 years, 4 months ago (2015-08-17 22:23:25 UTC) #10
bsalomon
On 2015/08/17 22:23:25, commit-bot: I haz the power wrote: > Dry run: This issue passed ...
5 years, 4 months ago (2015-08-18 13:09:07 UTC) #11
reed1
generateTexture is so new, there are no subclasses before this one (picture). Chrome has a ...
5 years, 4 months ago (2015-08-18 14:05:15 UTC) #12
bsalomon
On 2015/08/18 14:05:15, reed1 wrote: > generateTexture is so new, there are no subclasses before ...
5 years, 4 months ago (2015-08-18 14:11:51 UTC) #13
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1301633002/80001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1301633002/80001
5 years, 4 months ago (2015-08-18 17:48:45 UTC) #15
reed1
now w/ tests for other generators
5 years, 4 months ago (2015-08-18 17:48:52 UTC) #16
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: Build-Mac10.8-Clang-x86_64-Release-Trybot on client.skia.compile (JOB_FAILED, http://build.chromium.org/p/client.skia.compile/builders/Build-Mac10.8-Clang-x86_64-Release-Trybot/builds/5122)
5 years, 4 months ago (2015-08-18 17:50:45 UTC) #18
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1301633002/100001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1301633002/100001
5 years, 4 months ago (2015-08-18 18:05:01 UTC) #20
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
5 years, 4 months ago (2015-08-18 18:11:15 UTC) #22
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1301633002/100001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1301633002/100001
5 years, 4 months ago (2015-08-18 18:15:44 UTC) #25
commit-bot: I haz the power
Committed patchset #6 (id:100001) as https://skia.googlesource.com/skia/+/935d6cfaa78b6be75c9fcc596805f0f9b8da972e
5 years, 4 months ago (2015-08-18 18:16:12 UTC) #26
bsalomon
lgtm
5 years, 4 months ago (2015-08-18 18:16:41 UTC) #27
scroggo
lgtm https://codereview.chromium.org/1301633002/diff/100001/src/core/SkImageCacherator.cpp File src/core/SkImageCacherator.cpp (right): https://codereview.chromium.org/1301633002/diff/100001/src/core/SkImageCacherator.cpp#newcode90 src/core/SkImageCacherator.cpp:90: // need to handle subsetting Should this assert ...
5 years, 4 months ago (2015-08-19 20:58:20 UTC) #28
reed1
5 years, 4 months ago (2015-08-19 21:04:09 UTC) #29
Message was sent while issue was closed.
https://codereview.chromium.org/1301633002/diff/100001/src/core/SkImageCacher...
File src/core/SkImageCacherator.cpp (right):

https://codereview.chromium.org/1301633002/diff/100001/src/core/SkImageCacher...
src/core/SkImageCacherator.cpp:90: // need to handle subsetting
On 2015/08/19 20:58:20, scroggo wrote:
> Should this assert that the dimensions are actually a subset?

I think the caller has done that, but it'd be fine to also assert it here.

https://codereview.chromium.org/1301633002/diff/100001/src/core/SkImageCacher...
src/core/SkImageCacherator.cpp:99: full.readPixels(bitmap->info(),
bitmap->getPixels(), bitmap->rowBytes(),
On 2015/08/19 20:58:20, scroggo wrote:
> Is there a reason you did not call extractSubset? I suppose you'd rather do
the
> copy in this situation and hang on to less memory?

Definitely. This is a generator, not a cacher, and our caller will not know that
it can reuse other parts if it gets a request for a diff subset, so it would be
wasted memory. I have a bug into you/matt/me to expose subsetting directly in
SkImageGenerator, and in that way this code would not make a copy (though some
subclasses of generator may still have to).

Powered by Google App Engine
This is Rietveld 408576698