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

Issue 507483002: retool image cache to be generic cache (Closed)

Created:
6 years, 4 months ago by reed1
Modified:
6 years, 3 months ago
CC:
reviews_skia.org
Base URL:
https://skia.googlesource.com/skia.git@master
Project:
skia
Visibility:
Public.

Description

retool image cache to be generic cache, allowing the client to subclass "Rec", so they can provide a custom Key and arbitrary Value. Follow-on CLs - rename ScaledimageCache to something like GeneralCache - explore if we can use call-backs or some mechanism to completely hide "lock/unlock", by forcing all clients to support "copying" their value out of the cache as the result of a Find. Committed: https://skia.googlesource.com/skia/+/680fb9e8f10d24b5fe35c90338de37c57392f1aa

Patch Set 1 #

Patch Set 2 : rebase #

Total comments: 6

Patch Set 3 : bitmapcache wrapper now hides any locking #

Patch Set 4 : address comments from #2 #

Patch Set 5 : clean up includes for bitmapcache #

Total comments: 1

Patch Set 6 : incorporate sizeof key into bytesUsed() #

Total comments: 1

Patch Set 7 : rebase + add comment in unlock #

Unified diffs Side-by-side diffs Delta from patch set Stats (+266 lines, -393 lines) Patch
M bench/ImageCacheBench.cpp View 1 2 3 4 5 3 chunks +12 lines, -7 lines 0 comments Download
M src/core/SkBitmapCache.h View 1 2 3 4 1 chunk +20 lines, -25 lines 0 comments Download
M src/core/SkBitmapCache.cpp View 1 2 3 4 5 6 2 chunks +81 lines, -27 lines 0 comments Download
M src/core/SkBitmapProcState.h View 1 2 3 chunks +4 lines, -2 lines 0 comments Download
M src/core/SkBitmapProcState.cpp View 1 2 11 chunks +29 lines, -87 lines 0 comments Download
M src/core/SkScaledImageCache.h View 1 2 8 chunks +34 lines, -34 lines 0 comments Download
M src/core/SkScaledImageCache.cpp View 1 2 3 4 5 6 10 chunks +44 lines, -123 lines 0 comments Download
M src/lazy/SkCachingPixelRef.h View 1 2 2 chunks +3 lines, -1 line 0 comments Download
M src/lazy/SkCachingPixelRef.cpp View 1 2 2 chunks +8 lines, -30 lines 0 comments Download
M tests/ImageCacheTest.cpp View 1 2 3 4 5 4 chunks +30 lines, -51 lines 0 comments Download
M tests/ScaledImageCache.cpp View 1 2 1 chunk +1 line, -6 lines 0 comments Download

Messages

Total messages: 18 (0 generated)
reed1
6 years, 4 months ago (2014-08-25 20:53:28 UTC) #1
qiankun
qiankun.miao@intel.com changed reviewers: + qiankun.miao@intel.com
6 years, 4 months ago (2014-08-26 07:12:40 UTC) #2
qiankun
https://codereview.chromium.org/507483002/diff/20001/src/core/SkBitmapCache.cpp File src/core/SkBitmapCache.cpp (right): https://codereview.chromium.org/507483002/diff/20001/src/core/SkBitmapCache.cpp#newcode52 src/core/SkBitmapCache.cpp:52: BitmapKey fKey; Can we use pointer type for fKey ...
6 years, 4 months ago (2014-08-26 07:12:40 UTC) #3
reed1
https://codereview.chromium.org/507483002/diff/20001/src/core/SkBitmapCache.cpp File src/core/SkBitmapCache.cpp (right): https://codereview.chromium.org/507483002/diff/20001/src/core/SkBitmapCache.cpp#newcode52 src/core/SkBitmapCache.cpp:52: BitmapKey fKey; On 2014/08/26 07:12:40, qiankun wrote: > Can ...
6 years, 3 months ago (2014-08-26 14:04:02 UTC) #4
reed1
The CQ bit was checked by reed@google.com
6 years, 3 months ago (2014-08-26 14:04:39 UTC) #5
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://skia-tree-status.appspot.com/cq/reed@google.com/507483002/60001
6 years, 3 months ago (2014-08-26 14:05:15 UTC) #6
commit-bot: I haz the power
Note for Reviewers: The CQ is waiting for an approval. If you believe that the ...
6 years, 3 months ago (2014-08-26 14:05:17 UTC) #7
Stephen White
senorblanco@chromium.org changed reviewers: + senorblanco@chromium.org
6 years, 3 months ago (2014-08-26 14:25:08 UTC) #8
Stephen White
https://codereview.chromium.org/507483002/diff/20001/src/core/SkBitmapCache.h File src/core/SkBitmapCache.h (right): https://codereview.chromium.org/507483002/diff/20001/src/core/SkBitmapCache.h#newcode11 src/core/SkBitmapCache.h:11: #include "SkScaledImageCache.h" Not new to this patch, but I'm ...
6 years, 3 months ago (2014-08-26 14:25:08 UTC) #9
reed1
The CQ bit was unchecked by reed@google.com
6 years, 3 months ago (2014-08-26 14:40:51 UTC) #10
reed1
https://codereview.chromium.org/507483002/diff/20001/src/core/SkBitmapCache.h File src/core/SkBitmapCache.h (right): https://codereview.chromium.org/507483002/diff/20001/src/core/SkBitmapCache.h#newcode11 src/core/SkBitmapCache.h:11: #include "SkScaledImageCache.h" On 2014/08/26 14:25:08, Stephen White wrote: > ...
6 years, 3 months ago (2014-08-26 14:45:03 UTC) #11
reed1
PTAL
6 years, 3 months ago (2014-08-26 14:47:08 UTC) #12
mtklein
lgtm https://codereview.chromium.org/507483002/diff/80001/src/core/SkScaledImageCache.cpp File src/core/SkScaledImageCache.cpp (right): https://codereview.chromium.org/507483002/diff/80001/src/core/SkScaledImageCache.cpp#newcode282 src/core/SkScaledImageCache.cpp:282: const_cast<Rec*>(rec)->fLockCount -= 1; // We're under our lock, ...
6 years, 3 months ago (2014-08-26 15:55:51 UTC) #13
reed1
The CQ bit was checked by reed@google.com
6 years, 3 months ago (2014-08-26 16:01:29 UTC) #14
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://skia-tree-status.appspot.com/cq/reed@google.com/507483002/120001
6 years, 3 months ago (2014-08-26 16:01:41 UTC) #15
commit-bot: I haz the power
Committed patchset #7 (120001) as 680fb9e8f10d24b5fe35c90338de37c57392f1aa
6 years, 3 months ago (2014-08-26 16:08:11 UTC) #16
Stephen White
https://codereview.chromium.org/507483002/diff/100001/src/core/SkBitmapProcState.h File src/core/SkBitmapProcState.h (right): https://codereview.chromium.org/507483002/diff/100001/src/core/SkBitmapProcState.h#newcode147 src/core/SkBitmapProcState.h:147: // SkScaledImageCache::ID fScaledCacheID; Remove commented code?
6 years, 3 months ago (2014-08-26 16:10:54 UTC) #17
reed1
6 years, 3 months ago (2014-08-26 17:59:32 UTC) #18
Message was sent while issue was closed.
On 2014/08/26 16:10:54, Stephen White wrote:
>
https://codereview.chromium.org/507483002/diff/100001/src/core/SkBitmapProcSt...
> File src/core/SkBitmapProcState.h (right):
> 
>
https://codereview.chromium.org/507483002/diff/100001/src/core/SkBitmapProcSt...
> src/core/SkBitmapProcState.h:147: //    SkScaledImageCache::ID fScaledCacheID;
> Remove commented code?

Will do.

Powered by Google App Engine
This is Rietveld 408576698