OLD | NEW |
(Empty) | |
| 1 /* |
| 2 * Copyright 2014 Google Inc. |
| 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. |
| 6 */ |
| 7 |
| 8 #ifndef SkBitmapCache_DEFINED |
| 9 #define SkBitmapCache_DEFINED |
| 10 |
| 11 #include "SkScaledImageCache.h" |
| 12 |
| 13 class SkBitmapCache { |
| 14 public: |
| 15 typedef SkScaledImageCache::ID ID; |
| 16 |
| 17 static void Unlock(ID* id) { |
| 18 SkScaledImageCache::Unlock(id); |
| 19 } |
| 20 |
| 21 /* Input: bitmap+inverse_scale */ |
| 22 static ID* FindAndLock(const SkBitmap& src, SkScalar invScaleX, SkScalar inv
ScaleY, |
| 23 SkBitmap* result); |
| 24 static ID* AddAndLock(const SkBitmap& src, SkScalar invScaleX, SkScalar invS
caleY, |
| 25 const SkBitmap& result); |
| 26 |
| 27 /* Input: bitmap_genID+width+height */ |
| 28 static ID* FindAndLock(uint32_t genID, int width, int height, SkBitmap* resu
lt); |
| 29 |
| 30 static ID* AddAndLock(uint32_t genID, int width, int height, const SkBitmap&
result); |
| 31 }; |
| 32 |
| 33 class SkMipMapCache { |
| 34 public: |
| 35 typedef SkScaledImageCache::ID ID; |
| 36 |
| 37 static void Unlock(ID* id) { |
| 38 SkScaledImageCache::Unlock(id); |
| 39 } |
| 40 |
| 41 static ID* FindAndLock(const SkBitmap& src, const SkMipMap** result); |
| 42 static ID* AddAndLock(const SkBitmap& src, const SkMipMap* result); |
| 43 }; |
| 44 |
| 45 #endif |
OLD | NEW |