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