aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkBitmapCache.h
diff options
context:
space:
mode:
authorGravatar reed <reed@google.com>2014-09-16 10:39:55 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2014-09-16 10:39:55 -0700
commit30ad5306be25565484a3dd76237984e071b7c4b3 (patch)
tree3a54680bf9bc826a5dba45da01a7637e5a17a2cb /src/core/SkBitmapCache.h
parent4815fe5a0a497b676677fb4e4a0f05c511855490 (diff)
allow SkBitmapCache to operate on a local instance, for testability
BUG=skia: R=mtklein@google.com, danakj@chromium.org, piotaixr@chromium.org, junov@chromium.org Author: reed@google.com Review URL: https://codereview.chromium.org/576763002
Diffstat (limited to 'src/core/SkBitmapCache.h')
-rw-r--r--src/core/SkBitmapCache.h12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/core/SkBitmapCache.h b/src/core/SkBitmapCache.h
index aec7a7d41c..181c85812a 100644
--- a/src/core/SkBitmapCache.h
+++ b/src/core/SkBitmapCache.h
@@ -11,6 +11,7 @@
#include "SkScalar.h"
#include "SkBitmap.h"
+class SkResourceCache;
class SkMipMap;
class SkBitmapCache {
@@ -25,25 +26,28 @@ public:
* Search based on the src bitmap and inverse scales in X and Y. If found, returns true and
* result will be set to the matching bitmap with its pixels already locked.
*/
- static bool Find(const SkBitmap& src, SkScalar invScaleX, SkScalar invScaleY, SkBitmap* result);
+ static bool Find(const SkBitmap& src, SkScalar invScaleX, SkScalar invScaleY, SkBitmap* result,
+ SkResourceCache* localCache = NULL);
/*
* result must be marked isImmutable()
*/
static void Add(const SkBitmap& src, SkScalar invScaleX, SkScalar invScaleY,
- const SkBitmap& result);
+ const SkBitmap& result, SkResourceCache* localCache = NULL);
/**
* 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);
+ static bool Find(uint32_t genID, const SkIRect& subset, SkBitmap* result,
+ SkResourceCache* localCache = NULL);
/**
* The width and the height of the provided subset must be the same as the result bitmap ones.
* result must be marked isImmutable()
*/
- static bool Add(uint32_t genID, const SkIRect& subset, const SkBitmap& result);
+ static bool Add(uint32_t genID, const SkIRect& subset, const SkBitmap& result,
+ SkResourceCache* localCache = NULL);
};
class SkMipMapCache {