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

Issue 12433020: Improvements/additions to SkImageCache/SkLazyPixelRef. (Closed)

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

Description

Improvements/additions to SkImageCache/SkLazyPixelRef. SkPurgeableImageCache: New image cache that uses virtual memory to store the pixels. Combines features of SkAshmemImageCache (which has been removed) with SkPurgeableMemoryBlock, which has android and Mac versions. SkImageCache: Modified the API. pinCache now returns a status out parameter which states whether the pinned memory retained the old data. This allows allocAndPinCache to only be used for allocations. Add a new debug only interface to purge unpinned data. Updates to documentation, clarifying behavior. Changed CachedStatus to MemoryStatus SkLruImageCache: Implement the new function purgeAllUnpinnedCaches and change implementation of pinCache for the new behavior. SkLazyPixelRef: Rewrite onLockPixels to account for the new behavior of pinCache. BitmapFactoryTest: Test the new SkPurgeableImageCache. Write tests which directly test the SkImageCaches. Create a larger bitmap, since some of the SkImageCaches are designed to handle large bitmaps. bench_ and render_pictures: Consolidate lazy_decode_bitmap into one function. Allow using a flag to specify using the purgeable image cache. Clean up some #includes. Committed: https://code.google.com/p/skia/source/detail?r=8207

Patch Set 1 #

Patch Set 2 : Modified a comment. #

Total comments: 5

Patch Set 3 : rebase #

Patch Set 4 : in progress changes to unify purgeable image caches #

Patch Set 5 : more cleanups #

Patch Set 6 : #

Total comments: 6

Patch Set 7 : #

Patch Set 8 : #

Patch Set 9 : use ashmem_purge_all_caches #

Patch Set 10 : Now depends on a separate CL for SkPurgeableMemoryBlock #

Patch Set 11 : Remove unneeded file. #

Patch Set 12 : #

Total comments: 2

Patch Set 13 : Respond to comments. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+531 lines, -367 lines) Patch
M gyp/core.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +2 lines, -0 lines 0 comments Download
M gyp/ports.gyp View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +1 line, -4 lines 0 comments Download
M gyp/tools.gyp View 1 2 3 4 5 6 2 chunks +2 lines, -0 lines 0 comments Download
M include/lazy/SkBitmapFactory.h View 1 2 3 4 1 chunk +15 lines, -6 lines 0 comments Download
M include/lazy/SkImageCache.h View 1 2 3 4 5 2 chunks +63 lines, -14 lines 0 comments Download
M include/lazy/SkLruImageCache.h View 1 2 3 4 3 chunks +4 lines, -3 lines 0 comments Download
A include/lazy/SkPurgeableImageCache.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +45 lines, -0 lines 0 comments Download
M include/ports/SkAshmemImageCache.h View 1 2 3 1 chunk +0 lines, -72 lines 0 comments Download
M src/lazy/SkBitmapFactory.cpp View 1 2 3 2 chunks +5 lines, -3 lines 0 comments Download
M src/lazy/SkLazyPixelRef.h View 1 chunk +1 line, -0 lines 0 comments Download
M src/lazy/SkLazyPixelRef.cpp View 1 2 3 4 3 chunks +41 lines, -21 lines 0 comments Download
M src/lazy/SkLruImageCache.cpp View 1 2 3 4 5 chunks +17 lines, -8 lines 0 comments Download
A src/lazy/SkPurgeableImageCache.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +159 lines, -0 lines 0 comments Download
M src/ports/SkAshmemImageCache.cpp View 1 2 3 1 chunk +0 lines, -161 lines 0 comments Download
M tests/BitmapFactoryTest.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 3 chunks +107 lines, -24 lines 0 comments Download
M tools/PictureRenderingFlags.h View 1 2 1 chunk +1 line, -1 line 0 comments Download
M tools/PictureRenderingFlags.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 3 chunks +59 lines, -0 lines 0 comments Download
M tools/bench_pictures_main.cpp View 1 2 3 4 2 chunks +7 lines, -17 lines 0 comments Download
M tools/render_pictures_main.cpp View 1 2 3 4 5 6 7 8 9 3 chunks +2 lines, -33 lines 0 comments Download

Messages

Total messages: 12 (0 generated)
scroggo
7 years, 9 months ago (2013-03-07 00:03:49 UTC) #1
reed1
Can we encapsulate this "purgable allocation block" OS feature in some Skia abstraction, the way ...
7 years, 9 months ago (2013-03-07 14:10:22 UTC) #2
scroggo
> Can we encapsulate this "purgable allocation block" OS > feature in some Skia abstraction, ...
7 years, 9 months ago (2013-03-07 18:07:19 UTC) #3
scroggo
> Can we encapsulate this "purgable allocation block" OS > feature in some Skia abstraction, ...
7 years, 9 months ago (2013-03-13 20:24:53 UTC) #4
reed1
starting to get very yummy. perhaps we land SkPurgeableMemoryBlock as its own CL? https://codereview.chromium.org/12433020/diff/42002/src/lazy/SkPurgeableMemoryBlock.h File ...
7 years, 9 months ago (2013-03-13 20:41:34 UTC) #5
scroggo
> starting to get very yummy. perhaps we land SkPurgeableMemoryBlock as its own > CL? ...
7 years, 9 months ago (2013-03-13 22:06:42 UTC) #6
scroggo
On 2013/03/13 22:06:42, scroggo wrote: > > starting to get very yummy. perhaps we land ...
7 years, 9 months ago (2013-03-14 19:51:04 UTC) #7
scroggo
Latest patch ready for review.
7 years, 9 months ago (2013-03-15 18:52:58 UTC) #8
reed1
https://codereview.chromium.org/12433020/diff/69001/include/lazy/SkPurgeableImageCache.h File include/lazy/SkPurgeableImageCache.h (right): https://codereview.chromium.org/12433020/diff/69001/include/lazy/SkPurgeableImageCache.h#newcode28 include/lazy/SkPurgeableImageCache.h:28: static SkImageCache* GetPurgeableImageCache(); Why isn't this just called Create()?
7 years, 9 months ago (2013-03-18 21:25:17 UTC) #9
reed1
lgtm if we rename the factory to something like Create, and remove the dox that ...
7 years, 9 months ago (2013-03-18 21:28:27 UTC) #10
scroggo
> lgtm if we rename the factory to something like Create, and remove the dox ...
7 years, 9 months ago (2013-03-18 21:37:16 UTC) #11
scroggo
7 years, 9 months ago (2013-03-18 21:38:37 UTC) #12
Message was sent while issue was closed.
Committed patchset #13 manually as r8207 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698