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

Issue 93703004: Change SkDecodingImageGenerator API (Closed)

Created:
7 years ago by hal.canary
Modified:
6 years, 8 months ago
Reviewers:
scroggo, djsollen, reed1
CC:
skia-review_googlegroups.com
Visibility:
Public.

Description

Add Options to SkDecodingImageGenerator, simplify API. Motivation: We want to remove redundant classes from Skia. To that end we want to remove SkImageRef and its subclasses and replace their uses with SkDiscardablePixelRef + SkDecodingImageGenerator. Since Android uses SkImageRef, we need to make sure that SkDecodingImageGenerator allows all of the settings that Android exposes in BitmapFactory.Options. To that end, we have created an Options struct for the SkDecodingImageGenerator which lets the client of the generator set sample size, dithering, and bitmap config. We have made the SkDecodingImageGenerator constructor private and replaced the SkDecodingImageGenerator::Install functions with a SkDecodingImageGenerator::Create functions (one for SkData and one for SkStream) which now take a SkDecodingImageGenerator::Options struct. Also added a ImageDecoderOptions test which loops through a list of sets of options and tries them on a set of 5 small encoded images. Also updated several users of SkDecodingImageGenerator::Install to follow new call signature - gm/factory.cpp, LazyDecodeBitmap.cpp, and PictureTest.cpp, CachedDecodingPixelRefTest.cpp. We also added a new ImprovedBitmapFactory Test which simulates the exact function that Android will need to modify to use this, installPixelRef() in BitmapFactory. R=reed@google.com, scroggo@google.com Committed: https://code.google.com/p/skia/source/detail?r=12744 Committed: https://code.google.com/p/skia/source/detail?r=12855

Patch Set 1 #

Total comments: 24

Patch Set 2 : extensive refactor #

Patch Set 3 : 1 #

Total comments: 17

Patch Set 4 : rebase, verified builds #

Patch Set 5 : changes from scroggo #

Patch Set 6 : whitespace #

Patch Set 7 : rebase #

Total comments: 2

Patch Set 8 : rebase, comments #

Total comments: 9

Patch Set 9 : rebase to remove binaries #

Patch Set 10 : changes from reed #

Total comments: 6

Patch Set 11 : test samplesize only on android/linux #

Patch Set 12 : rebase on 116423006 #

Patch Set 13 : final rebase #

Patch Set 14 : better reporting in unit tests #

Patch Set 15 : compile on windows #

Patch Set 16 : one more thing to check #

Patch Set 17 : final #

Patch Set 18 : rebase again #

Patch Set 19 : rebased #

Unified diffs Side-by-side diffs Delta from patch set Stats (+665 lines, -241 lines) Patch
M gm/factory.cpp View 1 2 3 4 5 6 7 8 9 3 chunks +6 lines, -3 lines 0 comments Download
M include/core/SkImageGenerator.h View 1 1 chunk +2 lines, -0 lines 0 comments Download
M samplecode/SamplePicture.cpp View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +2 lines, -1 line 0 comments Download
M src/image/SkImagePriv.h View 1 2 3 4 5 6 7 8 9 1 chunk +2 lines, -0 lines 0 comments Download
M src/image/SkImagePriv.cpp View 1 2 3 4 5 6 7 8 9 2 chunks +35 lines, -2 lines 0 comments Download
M src/images/SkDecodingImageGenerator.h View 1 2 3 4 5 6 7 8 9 1 chunk +101 lines, -80 lines 0 comments Download
M src/images/SkDecodingImageGenerator.cpp View 1 2 3 4 5 6 7 8 9 4 chunks +193 lines, -114 lines 0 comments Download
M src/lazy/SkCachingPixelRef.cpp View 1 2 3 4 5 6 7 1 chunk +0 lines, -1 line 0 comments Download
M src/lazy/SkDiscardablePixelRef.h View 1 2 3 4 5 6 1 chunk +9 lines, -0 lines 0 comments Download
M src/lazy/SkDiscardablePixelRef.cpp View 1 2 3 4 5 6 7 1 chunk +7 lines, -8 lines 0 comments Download
M tests/CachedDecodingPixelRefTest.cpp View 1 2 3 4 5 6 7 8 9 2 chunks +7 lines, -2 lines 0 comments Download
M tests/ImageDecodingTest.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 7 chunks +293 lines, -24 lines 0 comments Download
M tests/PictureTest.cpp View 1 2 3 4 5 6 7 8 9 3 chunks +4 lines, -3 lines 0 comments Download
M tools/LazyDecodeBitmap.cpp View 1 2 3 4 5 6 7 8 9 1 chunk +4 lines, -3 lines 0 comments Download

Messages

Total messages: 21 (0 generated)
hal.canary
One more step on the way to destroying SkImageRef
7 years ago (2013-12-12 18:50:09 UTC) #1
scroggo
On 2013/12/12 18:50:09, Hal Canary wrote: > One more step on the way to destroying ...
7 years ago (2013-12-12 19:02:00 UTC) #2
scroggo
On 2013/12/12 19:02:00, scroggo wrote: > On 2013/12/12 18:50:09, Hal Canary wrote: > > One ...
7 years ago (2013-12-12 19:21:00 UTC) #3
hal.canary
On 2013/12/12 19:21:00, scroggo wrote: > In order to introduce no regressions into Android, it ...
7 years ago (2013-12-12 20:41:53 UTC) #4
scroggo
On 2013/12/12 20:41:53, Hal Canary wrote: > On 2013/12/12 19:21:00, scroggo wrote: > > In ...
7 years ago (2013-12-12 22:33:45 UTC) #5
hal.canary
extensive API change https://codereview.chromium.org/93703004/diff/1/src/images/SkDecodingImageGenerator.cpp File src/images/SkDecodingImageGenerator.cpp (right): https://codereview.chromium.org/93703004/diff/1/src/images/SkDecodingImageGenerator.cpp#newcode27 src/images/SkDecodingImageGenerator.cpp:27: SkBitmap::Config config) On 2013/12/12 22:33:46, scroggo ...
7 years ago (2013-12-13 15:48:48 UTC) #6
scroggo
https://codereview.chromium.org/93703004/diff/1/src/images/SkDecodingImageGenerator.cpp File src/images/SkDecodingImageGenerator.cpp (right): https://codereview.chromium.org/93703004/diff/1/src/images/SkDecodingImageGenerator.cpp#newcode37 src/images/SkDecodingImageGenerator.cpp:37: if ((NULL == fTarget) On 2013/12/13 15:48:48, Hal Canary ...
7 years ago (2013-12-13 17:23:02 UTC) #7
hal.canary
I'm getting closer on this. I'm now changing gears to work on Chrome rather than ...
7 years ago (2013-12-16 15:10:26 UTC) #8
scroggo
lgtm https://codereview.chromium.org/93703004/diff/170001/tests/ImageDecodingTest.cpp File tests/ImageDecodingTest.cpp (right): https://codereview.chromium.org/93703004/diff/170001/tests/ImageDecodingTest.cpp#newcode326 tests/ImageDecodingTest.cpp:326: * Given either a SkStream or a SkData, ...
7 years ago (2013-12-16 15:38:36 UTC) #9
hal.canary
Mike, I make two small changes in include/, so PTAL. https://codereview.chromium.org/93703004/diff/170001/tests/ImageDecodingTest.cpp File tests/ImageDecodingTest.cpp (right): https://codereview.chromium.org/93703004/diff/170001/tests/ImageDecodingTest.cpp#newcode326 ...
7 years ago (2013-12-17 17:08:11 UTC) #10
scroggo
On 2013/12/17 17:08:11, Hal Canary wrote: > Mike, I make two small changes in include/, ...
7 years ago (2013-12-17 17:10:08 UTC) #11
reed1
https://codereview.chromium.org/93703004/diff/190001/src/core/SkBitmap.cpp File src/core/SkBitmap.cpp (right): https://codereview.chromium.org/93703004/diff/190001/src/core/SkBitmap.cpp#newcode225 src/core/SkBitmap.cpp:225: Sk64 SkBitmap::ComputeSize64(const SkImageInfo& info) { Why are these in ...
7 years ago (2013-12-17 17:38:52 UTC) #12
hal.canary
https://codereview.chromium.org/93703004/diff/190001/src/core/SkBitmap.cpp File src/core/SkBitmap.cpp (right): https://codereview.chromium.org/93703004/diff/190001/src/core/SkBitmap.cpp#newcode225 src/core/SkBitmap.cpp:225: Sk64 SkBitmap::ComputeSize64(const SkImageInfo& info) { On 2013/12/17 17:38:52, reed1 ...
7 years ago (2013-12-17 21:00:21 UTC) #13
reed1
If scroggo approves, who am I to stand in the way. lgtm
7 years ago (2013-12-17 22:28:57 UTC) #14
scroggo
On 2013/12/17 22:28:57, reed1 wrote: > If scroggo approves, who am I to stand in ...
7 years ago (2013-12-17 22:53:33 UTC) #15
hal.canary
On 2013/12/17 22:53:33, scroggo wrote: > On 2013/12/17 22:28:57, reed1 wrote: > > If scroggo ...
7 years ago (2013-12-18 15:38:40 UTC) #16
hal.canary
https://codereview.chromium.org/93703004/diff/100001/tests/ImageDecodingTest.cpp File tests/ImageDecodingTest.cpp (right): https://codereview.chromium.org/93703004/diff/100001/tests/ImageDecodingTest.cpp#newcode349 tests/ImageDecodingTest.cpp:349: Options(1, true, SkBitmap::kNo_Config), On 2013/12/13 17:23:03, scroggo wrote: > ...
7 years ago (2013-12-18 15:39:05 UTC) #17
scroggo
lgtm https://codereview.chromium.org/93703004/diff/190001/src/images/SkDecodingImageGenerator.cpp File src/images/SkDecodingImageGenerator.cpp (right): https://codereview.chromium.org/93703004/diff/190001/src/images/SkDecodingImageGenerator.cpp#newcode37 src/images/SkDecodingImageGenerator.cpp:37: virtual bool allocPixelRef(SkBitmap* bm, SkColorTable* ct) SK_OVERRIDE { ...
7 years ago (2013-12-18 17:02:19 UTC) #18
hal.canary
Committed patchset #13 manually as r12744 (presubmit successful).
7 years ago (2013-12-18 17:40:34 UTC) #19
robertphillips
A revert of this CL has been created in https://codereview.chromium.org/103753007/ by robertphillips@google.com. The reason for ...
7 years ago (2013-12-18 18:28:14 UTC) #20
hal.canary
6 years, 11 months ago (2014-01-02 13:15:23 UTC) #21
Message was sent while issue was closed.
Committed patchset #19 manually as r12855 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698