diff options
author | 2014-09-03 11:33:13 -0700 | |
---|---|---|
committer | 2014-09-03 11:33:13 -0700 | |
commit | 42b0dfeb29e993b7fd247dcecff705d3dd4cf191 (patch) | |
tree | 6a4d4f6fdbac825a79280ca717cb4739e8b93681 /src/core/SkBitmapCache.h | |
parent | d982eb22d7bce655a609e9b481b3ddfeff361067 (diff) |
The key for SkBitmapCache can now be genID+SkIRect
BUG=skia:2894
R=junov@chromium.org, reed@google.com
Author: piotaixr@chromium.org
Review URL: https://codereview.chromium.org/518983002
Diffstat (limited to 'src/core/SkBitmapCache.h')
-rw-r--r-- | src/core/SkBitmapCache.h | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/src/core/SkBitmapCache.h b/src/core/SkBitmapCache.h index 9291ff5702..cd644fff03 100644 --- a/src/core/SkBitmapCache.h +++ b/src/core/SkBitmapCache.h @@ -31,7 +31,7 @@ public: * result must be marked isImmutable() */ static void Add(const SkBitmap& src, SkScalar invScaleX, SkScalar invScaleY, - const SkBitmap& result); + const SkBitmap& result); /** * Search based on the bitmap's genID, width, height. If found, returns true and @@ -39,10 +39,24 @@ public: */ static bool Find(uint32_t genID, int width, int height, SkBitmap* result); - /* - * result must be marked isImmutable() + /** + * The width and the height provided for the key must be the same as the result bitmap ones. + * + * result must be marked isImmutable() + */ + static bool Add(uint32_t genID, int width, int height, const SkBitmap& result); + + /** + * Search based on the bitmap's genID and subset. If found, returns true and + * result will be set to the matching bitmap with its pixels already locked. + */ + static bool Find(uint32_t genID, const SkIRect& subset, SkBitmap* result); + + /** + * The width and the height of the provided subset must be the same as the result bitmap ones. + * result must be marked isImmutable() */ - static void Add(uint32_t genID, int width, int height, const SkBitmap& result); + static bool Add(uint32_t genID, const SkIRect& subset, const SkBitmap& result); }; class SkMipMapCache { |