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

Issue 37343002: Allow SkLazyPixelRef to use SkScaledImageCache (Closed)

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

Description

Allow SkLazyPixelRef to use SkScaledImageCache - SkScaledImageCache: - Add new FindAndLock/AddAndLock variants that work well with SkLazyPixelRefs (take width, height, generation_id). - Add static versions of these new variants. - SkLazyPixelRef: - If NULL passed in as SkImageCache* in the constructor, it will now default to using the static SkScaledImageCache methods to cache decoded images. - If (fImageCache==NULL), the default allocator can be changed with the setAllocator method. If (fImageCache!=NULL), the SkImageCache handles allocation. - CachedDecodingPixelRefTest to test the new functionality. BUG= Committed: http://code.google.com/p/skia/source/detail?r=12006

Patch Set 1 #

Patch Set 2 : linted #

Total comments: 31

Patch Set 3 : changes from all commenters #

Total comments: 20

Patch Set 4 : more changes #

Total comments: 10

Patch Set 5 : clean up SkScaledImageCache::ID* vs. SkImageCache::ID #

Patch Set 6 : nits from mtklein #

Patch Set 7 : remove cruft #

Patch Set 8 : again #

Total comments: 22

Patch Set 9 : refactoring SkScaledImageCache.cpp #

Patch Set 10 : lint #

Patch Set 11 : lint #

Total comments: 10

Patch Set 12 : remove allocator, clean up code, nits #

Patch Set 13 : re-upload #

Unified diffs Side-by-side diffs Delta from patch set Stats (+524 lines, -94 lines) Patch
M gyp/tests.gyp View 1 2 3 4 5 6 7 8 2 chunks +2 lines, -0 lines 0 comments Download
M src/core/SkScaledImageCache.h View 1 2 3 4 5 6 7 8 9 10 11 4 chunks +54 lines, -17 lines 0 comments Download
M src/core/SkScaledImageCache.cpp View 1 2 3 4 5 6 7 8 9 10 11 11 chunks +141 lines, -67 lines 0 comments Download
M src/lazy/SkLazyPixelRef.h View 1 2 3 4 5 6 7 8 9 10 11 4 chunks +12 lines, -3 lines 0 comments Download
M src/lazy/SkLazyPixelRef.cpp View 1 2 3 4 5 6 7 8 9 10 11 8 chunks +111 lines, -7 lines 0 comments Download
A tests/CachedDecodingPixelRefTest.cpp View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +204 lines, -0 lines 0 comments Download

Messages

Total messages: 22 (0 generated)
hal.canary
Work in progress: it compiles, but isn't tested yet.
7 years, 2 months ago (2013-10-23 14:48:53 UTC) #1
scroggo
https://codereview.chromium.org/37343002/diff/60001/src/core/SkScaledImageCache.cpp File src/core/SkScaledImageCache.cpp (right): https://codereview.chromium.org/37343002/diff/60001/src/core/SkScaledImageCache.cpp#newcode521 src/core/SkScaledImageCache.cpp:521: static SkScaledImageCache* gCache; Doesn't need to be in this ...
7 years, 2 months ago (2013-10-23 15:27:49 UTC) #2
hal.canary
Working on changes suggested by scroggo & reed. Still working on tests https://codereview.chromium.org/37343002/diff/60001/src/core/SkScaledImageCache.cpp File src/core/SkScaledImageCache.cpp ...
7 years, 2 months ago (2013-10-23 16:11:51 UTC) #3
mtklein
https://codereview.chromium.org/37343002/diff/60001/src/core/SkScaledImageCache.cpp File src/core/SkScaledImageCache.cpp (right): https://codereview.chromium.org/37343002/diff/60001/src/core/SkScaledImageCache.cpp#newcode64 src/core/SkScaledImageCache.cpp:64: bool init(int32_t width, Can't hurt to have init take ...
7 years, 2 months ago (2013-10-23 18:50:14 UTC) #4
hal.canary
https://codereview.chromium.org/37343002/diff/60001/src/core/SkScaledImageCache.cpp File src/core/SkScaledImageCache.cpp (right): https://codereview.chromium.org/37343002/diff/60001/src/core/SkScaledImageCache.cpp#newcode64 src/core/SkScaledImageCache.cpp:64: bool init(int32_t width, On 2013/10/23 18:50:14, mtklein wrote: > ...
7 years, 2 months ago (2013-10-23 22:57:40 UTC) #5
scroggo
https://codereview.chromium.org/37343002/diff/60001/src/core/SkScaledImageCache.cpp File src/core/SkScaledImageCache.cpp (right): https://codereview.chromium.org/37343002/diff/60001/src/core/SkScaledImageCache.cpp#newcode231 src/core/SkScaledImageCache.cpp:231: #ifdef USE_HASH On 2013/10/23 18:50:14, mtklein wrote: > It ...
7 years, 2 months ago (2013-10-23 23:38:33 UTC) #6
hal.canary
I still need to ckean up the ID fiasco. https://codereview.chromium.org/37343002/diff/190001/src/lazy/SkLazyPixelRef.cpp File src/lazy/SkLazyPixelRef.cpp (right): https://codereview.chromium.org/37343002/diff/190001/src/lazy/SkLazyPixelRef.cpp#newcode53 src/lazy/SkLazyPixelRef.cpp:53: ...
7 years, 1 month ago (2013-10-24 14:21:54 UTC) #7
mtklein
Let me know if this wasn't enough to get you rolling. Happy to help out ...
7 years, 1 month ago (2013-10-24 16:52:12 UTC) #8
mtklein
https://codereview.chromium.org/37343002/diff/220001/src/core/SkScaledImageCache.cpp File src/core/SkScaledImageCache.cpp (right): https://codereview.chromium.org/37343002/diff/220001/src/core/SkScaledImageCache.cpp#newcode519 src/core/SkScaledImageCache.cpp:519: SkOnce<SkScaledImageCache**>(&create_cache_once, create_cache, &gCache); Just FYI, I think the <SkScaledImageCache**> ...
7 years, 1 month ago (2013-10-24 17:03:25 UTC) #9
hal.canary
Would one of you like to formally review the cl as it stands now? Thanks ...
7 years, 1 month ago (2013-10-24 19:32:41 UTC) #10
scroggo
On 2013/10/24 19:32:41, halcanary wrote: > Would one of you like to formally review the ...
7 years, 1 month ago (2013-10-24 19:54:19 UTC) #11
hal.canary
On 2013/10/24 19:54:19, scroggo wrote: > On 2013/10/24 19:32:41, halcanary wrote: > > Would one ...
7 years, 1 month ago (2013-10-24 20:05:16 UTC) #12
scroggo
https://codereview.chromium.org/37343002/diff/540001/src/core/SkScaledImageCache.cpp File src/core/SkScaledImageCache.cpp (right): https://codereview.chromium.org/37343002/diff/540001/src/core/SkScaledImageCache.cpp#newcode214 src/core/SkScaledImageCache.cpp:214: Rec* rec = fHash->find(key); Can this whole #if #else ...
7 years, 1 month ago (2013-10-24 20:41:38 UTC) #13
reed1
https://codereview.chromium.org/37343002/diff/540001/src/core/SkScaledImageCache.cpp File src/core/SkScaledImageCache.cpp (right): https://codereview.chromium.org/37343002/diff/540001/src/core/SkScaledImageCache.cpp#newcode72 src/core/SkScaledImageCache.cpp:72: SkScalar scaleX, do we *always* pass in 1.0 for ...
7 years, 1 month ago (2013-10-24 21:07:03 UTC) #14
hal.canary
please take a look. I refactored some of the code inside SkScaledImageCache.cpp to make it ...
7 years, 1 month ago (2013-10-25 16:37:09 UTC) #15
reed1
Have we thought about just removing the code-path for ImageCache entirely? We can always re-add ...
7 years, 1 month ago (2013-10-25 18:09:46 UTC) #16
scroggo
https://codereview.chromium.org/37343002/diff/790001/src/core/SkScaledImageCache.cpp File src/core/SkScaledImageCache.cpp (right): https://codereview.chromium.org/37343002/diff/790001/src/core/SkScaledImageCache.cpp#newcode196 src/core/SkScaledImageCache.cpp:196: const SkIRect& bound) { nit: bounds https://codereview.chromium.org/37343002/diff/790001/src/core/SkScaledImageCache.cpp#newcode253 src/core/SkScaledImageCache.cpp:253: scaleY, ...
7 years, 1 month ago (2013-10-25 18:09:47 UTC) #17
hal.canary
https://codereview.chromium.org/37343002/diff/790001/src/core/SkScaledImageCache.cpp File src/core/SkScaledImageCache.cpp (right): https://codereview.chromium.org/37343002/diff/790001/src/core/SkScaledImageCache.cpp#newcode196 src/core/SkScaledImageCache.cpp:196: const SkIRect& bound) { On 2013/10/25 18:09:48, scroggo wrote: ...
7 years, 1 month ago (2013-10-25 20:49:37 UTC) #18
scroggo
On 2013/10/25 20:49:37, halcanary wrote: > https://codereview.chromium.org/37343002/diff/790001/src/core/SkScaledImageCache.cpp > File src/core/SkScaledImageCache.cpp (right): > > https://codereview.chromium.org/37343002/diff/790001/src/core/SkScaledImageCache.cpp#newcode196 > ...
7 years, 1 month ago (2013-10-28 16:23:12 UTC) #19
scroggo
On 2013/10/28 16:23:12, scroggo wrote: > On 2013/10/25 20:49:37, halcanary wrote: > > > https://codereview.chromium.org/37343002/diff/790001/src/core/SkScaledImageCache.cpp ...
7 years, 1 month ago (2013-10-28 21:59:18 UTC) #20
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://skia-tree-status.appspot.com/cq/halcanary@google.com/37343002/1020001
7 years, 1 month ago (2013-10-29 19:41:51 UTC) #21
commit-bot: I haz the power
7 years, 1 month ago (2013-10-29 19:55:07 UTC) #22
Message was sent while issue was closed.
Change committed as 12006

Powered by Google App Engine
This is Rietveld 408576698