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

Issue 103033002: Big Cleanup: SkBitmapFactory, SkLazyPixelRef, SkImageCache (Closed)

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

Description

Big Cleanup: SkBitmapFactory, SkLazyPixelRef, SkImageCache Removed SkBitmapFactory since no clients were using it. New cache selection mechanism can simply pass a SkDiscardableMemory::Factory into the SkDiscardablePixelRef if non-default SkDiscardableMemory should be used. Removed BitmapFactoryTest. SkDiscardableMemory::Factory interface. Android will need this functionality in the future inside their BitmapFactory. Removed SkLazyPixelRef, since it's functionality is now subsumed into SkDiscardablePixelRef. Removed LazyPixelRef test. Modified SkDiscardablePixelRef to optionally allow it to use a SkDiscardableMemory::Factory. This tiny change makes it a replacement for SkLazyPixelRef. This functioanlity is also necessary for moving Android over to SkDiscardablePixelRef from SkImageRef in a later CL. Added a test for this. SkDecodingImageGenerator::Install can optionally pass a factory in to SkDiscardablePixelRef. Removed SkImageCache, SkLruImageCache, and SkPurgeableImageCache. This functionality can be handled much more cleanly by SkDiscardableMemory. New SkDiscardableMemoryPool class to replace SkLruImageCache. In a later CL, we will replace SkImageRef_GlobalPool (used by android) as well. This is a concrete implementation of SkDiscardableMemory::Factory. Added a test for this. modified gm/factory.cpp to remove dependnce on SkBitmapFactory + SkLruImageCache. Now uses SkDecodingImageGenerator + SkDiscardablePixelRef + SkDiscardableMemoryPool. SkImageDecoder::Target replaces SkBitmapFactory::Target. The DecodeMemoryToTarget function may disappear in the future. Moved SkLazyCachingPixelRef::DecodeProc replaces SkBitmapFactory::DecodeProc. This is a short term change, since another CL changes SkLazyCachingPixelRef to use SkImageGenerator instead of DecodeProc. Modified DrawBitmapRectTest to use SkDiscardablePixelRef instead of SkLazyPixelRef. tools/LazyDecodeBitmap.cpp now uses SkDecodingImageGenerator + SkDiscardablePixelRef instead of a SkBitmapFactory. bench_pictures uses the Global SkDiscardableMemoryPool instead of a global gLruImageCache. R=reed@google.com, scroggo@google.com Committed: https://code.google.com/p/skia/source/detail?r=12515

Patch Set 1 #

Total comments: 25

Patch Set 2 : revision #

Patch Set 3 : rebased #

Patch Set 4 : bugfix, tests #

Total comments: 6

Patch Set 5 : cleanup test #

Total comments: 1

Patch Set 6 : fixbuild #

Patch Set 7 : fix #

Patch Set 8 : one more timr #

Patch Set 9 : attempt to fix a broken test #

Patch Set 10 : rebase #

Patch Set 11 : rebase one last time #

Unified diffs Side-by-side diffs Delta from patch set Stats (+637 lines, -1642 lines) Patch
M gm/factory.cpp View 1 2 3 2 chunks +9 lines, -14 lines 0 comments Download
M gyp/SampleApp.gyp View 1 2 1 chunk +2 lines, -0 lines 0 comments Download
M gyp/core.gypi View 1 2 3 4 5 6 7 8 9 2 chunks +1 line, -13 lines 0 comments Download
M gyp/dm.gyp View 1 2 3 4 5 6 7 1 chunk +2 lines, -0 lines 0 comments Download
M gyp/gm.gyp View 1 2 1 chunk +2 lines, -0 lines 0 comments Download
M gyp/images.gyp View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M gyp/public_headers.gypi View 1 2 1 chunk +0 lines, -4 lines 0 comments Download
M gyp/tests.gyp View 1 2 3 2 chunks +1 line, -1 line 0 comments Download
M gyp/tools.gyp View 1 2 3 chunks +7 lines, -1 line 0 comments Download
M include/core/SkImageDecoder.h View 1 2 3 4 5 6 7 8 9 3 chunks +16 lines, -2 lines 0 comments Download
D include/lazy/SkBitmapFactory.h View 1 chunk +0 lines, -99 lines 0 comments Download
D include/lazy/SkImageCache.h View 1 chunk +0 lines, -132 lines 0 comments Download
D include/lazy/SkLruImageCache.h View 1 2 3 4 5 6 7 8 9 1 chunk +0 lines, -92 lines 0 comments Download
D include/lazy/SkPurgeableImageCache.h View 1 2 3 4 5 6 7 8 9 1 chunk +0 lines, -48 lines 0 comments Download
M src/core/SkDiscardableMemory.h View 1 2 3 4 5 6 7 3 chunks +12 lines, -1 line 0 comments Download
D src/images/SkDecodingImageGenerator.h View 1 2 chunks +15 lines, -1 line 0 comments Download
M src/images/SkDecodingImageGenerator.cpp View 1 2 3 3 chunks +5 lines, -5 lines 0 comments Download
M src/images/SkImageDecoder.cpp View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -1 line 0 comments Download
D src/lazy/SkBitmapFactory.cpp View 1 2 3 4 5 6 7 8 9 1 chunk +0 lines, -78 lines 0 comments Download
A src/lazy/SkDiscardableMemoryPool.h View 1 2 3 4 5 1 chunk +71 lines, -0 lines 0 comments Download
A src/lazy/SkDiscardableMemoryPool.cpp View 1 2 3 4 5 1 chunk +203 lines, -0 lines 0 comments Download
D src/lazy/SkDiscardablePixelRef.h View 1 4 chunks +19 lines, -4 lines 0 comments Download
M src/lazy/SkDiscardablePixelRef.cpp View 1 2 3 4 chunks +18 lines, -5 lines 0 comments Download
D src/lazy/SkLazyPixelRef.h View 1 chunk +0 lines, -96 lines 0 comments Download
D src/lazy/SkLazyPixelRef.cpp View 1 chunk +0 lines, -311 lines 0 comments Download
D src/lazy/SkLruImageCache.cpp View 1 2 3 4 5 6 7 8 9 1 chunk +0 lines, -203 lines 0 comments Download
D src/lazy/SkPurgeableImageCache.cpp View 1 2 3 4 5 6 7 8 9 1 chunk +0 lines, -159 lines 0 comments Download
M src/ports/SkDiscardableMemory_none.cpp View 1 1 chunk +2 lines, -50 lines 0 comments Download
D tests/BitmapFactoryTest.cpp View 1 chunk +0 lines, -197 lines 0 comments Download
M tests/CachedDecodingPixelRefTest.cpp View 1 2 3 4 5 6 7 8 9 4 chunks +156 lines, -39 lines 0 comments Download
A tests/DiscardableMemoryPool.cpp View 1 2 3 1 chunk +37 lines, -0 lines 0 comments Download
M tests/DrawBitmapRectTest.cpp View 1 2 3 4 5 6 1 chunk +25 lines, -19 lines 0 comments Download
M tools/LazyDecodeBitmap.cpp View 1 1 chunk +23 lines, -52 lines 0 comments Download
M tools/PictureRenderingFlags.cpp View 1 chunk +0 lines, -1 line 0 comments Download
M tools/bench_pictures_main.cpp View 5 chunks +9 lines, -14 lines 0 comments Download

Messages

Total messages: 10 (0 generated)
hal.canary
32 files changed 429 insertions 1616 deletions
7 years ago (2013-12-03 22:10:32 UTC) #1
scroggo
https://codereview.chromium.org/103033002/diff/1/gm/factory.cpp File gm/factory.cpp (right): https://codereview.chromium.org/103033002/diff/1/gm/factory.cpp#newcode41 gm/factory.cpp:41: SkASSERT(NULL == data.get()); How is data NULL here? Did ...
7 years ago (2013-12-03 23:00:01 UTC) #2
hal.canary
https://codereview.chromium.org/103033002/diff/1/gm/factory.cpp File gm/factory.cpp (right): https://codereview.chromium.org/103033002/diff/1/gm/factory.cpp#newcode41 gm/factory.cpp:41: SkASSERT(NULL == data.get()); On 2013/12/03 23:00:01, scroggo wrote: > ...
7 years ago (2013-12-04 00:01:36 UTC) #3
hal.canary
https://codereview.chromium.org/103033002/diff/1/gm/factory.cpp File gm/factory.cpp (right): https://codereview.chromium.org/103033002/diff/1/gm/factory.cpp#newcode41 gm/factory.cpp:41: SkASSERT(NULL == data.get()); On 2013/12/04 00:01:36, Hal Canary wrote: ...
7 years ago (2013-12-04 14:30:32 UTC) #4
hal.canary
please take a look.
7 years ago (2013-12-04 18:35:00 UTC) #5
scroggo
lgtm. I have some suggestions for making the test more readable, but the code looks ...
7 years ago (2013-12-04 19:09:24 UTC) #6
hal.canary
https://codereview.chromium.org/103033002/diff/60001/tests/CachedDecodingPixelRefTest.cpp File tests/CachedDecodingPixelRefTest.cpp (right): https://codereview.chromium.org/103033002/diff/60001/tests/CachedDecodingPixelRefTest.cpp#newcode241 tests/CachedDecodingPixelRefTest.cpp:241: * if x == 0, will fail at getPixels() ...
7 years ago (2013-12-04 19:39:40 UTC) #7
scroggo
On 2013/12/04 19:39:40, Hal Canary wrote: > https://codereview.chromium.org/103033002/diff/60001/tests/CachedDecodingPixelRefTest.cpp > File tests/CachedDecodingPixelRefTest.cpp (right): > > https://codereview.chromium.org/103033002/diff/60001/tests/CachedDecodingPixelRefTest.cpp#newcode241 ...
7 years ago (2013-12-04 20:01:25 UTC) #8
reed1
lgtm w/ comment about unneeded empty virtual destructor. https://codereview.chromium.org/103033002/diff/80001/src/core/SkDiscardableMemory.h File src/core/SkDiscardableMemory.h (right): https://codereview.chromium.org/103033002/diff/80001/src/core/SkDiscardableMemory.h#newcode34 src/core/SkDiscardableMemory.h:34: virtual ...
7 years ago (2013-12-04 20:09:47 UTC) #9
hal.canary
7 years ago (2013-12-05 18:31:54 UTC) #10
Message was sent while issue was closed.
Committed patchset #11 manually as r12515 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698