aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkBitmapCache.h
diff options
context:
space:
mode:
authorGravatar reed <reed@google.com>2014-08-21 09:46:49 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2014-08-21 09:46:49 -0700
commit04617139f7f715bdc05a32a58e65e3c208bccff4 (patch)
tree4f2d890e90af537711177fab497741fc98848c8a /src/core/SkBitmapCache.h
parent53fecfb15d254397ab03032b888daa9d15c487b6 (diff)
expose generalized imagecache key
BUG=skia: R=mtklein@google.com, halcanary@google.com, qiankun.miao@intel.com Author: reed@google.com Review URL: https://codereview.chromium.org/483493003
Diffstat (limited to 'src/core/SkBitmapCache.h')
-rw-r--r--src/core/SkBitmapCache.h45
1 files changed, 45 insertions, 0 deletions
diff --git a/src/core/SkBitmapCache.h b/src/core/SkBitmapCache.h
new file mode 100644
index 0000000000..ebade0ebd9
--- /dev/null
+++ b/src/core/SkBitmapCache.h
@@ -0,0 +1,45 @@
+/*
+ * Copyright 2014 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#ifndef SkBitmapCache_DEFINED
+#define SkBitmapCache_DEFINED
+
+#include "SkScaledImageCache.h"
+
+class SkBitmapCache {
+public:
+ typedef SkScaledImageCache::ID ID;
+
+ static void Unlock(ID* id) {
+ SkScaledImageCache::Unlock(id);
+ }
+
+ /* Input: bitmap+inverse_scale */
+ static ID* FindAndLock(const SkBitmap& src, SkScalar invScaleX, SkScalar invScaleY,
+ SkBitmap* result);
+ static ID* AddAndLock(const SkBitmap& src, SkScalar invScaleX, SkScalar invScaleY,
+ const SkBitmap& result);
+
+ /* Input: bitmap_genID+width+height */
+ static ID* FindAndLock(uint32_t genID, int width, int height, SkBitmap* result);
+
+ static ID* AddAndLock(uint32_t genID, int width, int height, const SkBitmap& result);
+};
+
+class SkMipMapCache {
+public:
+ typedef SkScaledImageCache::ID ID;
+
+ static void Unlock(ID* id) {
+ SkScaledImageCache::Unlock(id);
+ }
+
+ static ID* FindAndLock(const SkBitmap& src, const SkMipMap** result);
+ static ID* AddAndLock(const SkBitmap& src, const SkMipMap* result);
+};
+
+#endif