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 |
(...skipping 13 matching lines...) Expand all Loading... |
24 /** | 24 /** |
25 * Search based on the src bitmap and inverse scales in X and Y. If found,
returns true and | 25 * Search based on the src bitmap and inverse scales in X and Y. If found,
returns true and |
26 * result will be set to the matching bitmap with its pixels already locked
. | 26 * result will be set to the matching bitmap with its pixels already locked
. |
27 */ | 27 */ |
28 static bool Find(const SkBitmap& src, SkScalar invScaleX, SkScalar invScaleY
, SkBitmap* result); | 28 static bool Find(const SkBitmap& src, SkScalar invScaleX, SkScalar invScaleY
, SkBitmap* result); |
29 | 29 |
30 /* | 30 /* |
31 * result must be marked isImmutable() | 31 * result must be marked isImmutable() |
32 */ | 32 */ |
33 static void Add(const SkBitmap& src, SkScalar invScaleX, SkScalar invScaleY, | 33 static void Add(const SkBitmap& src, SkScalar invScaleX, SkScalar invScaleY, |
34 const SkBitmap& result); | 34 const SkBitmap& result); |
35 | 35 |
36 /** | 36 /** |
37 * Search based on the bitmap's genID, width, height. If found, returns tru
e and | 37 * Search based on the bitmap's genID, width, height. If found, returns tru
e and |
38 * result will be set to the matching bitmap with its pixels already locked
. | 38 * result will be set to the matching bitmap with its pixels already locked
. |
39 */ | 39 */ |
40 static bool Find(uint32_t genID, int width, int height, SkBitmap* result); | 40 static bool Find(uint32_t genID, int width, int height, SkBitmap* result); |
41 | 41 |
42 /* | 42 /** |
43 * result must be marked isImmutable() | 43 * The width and the height provided for the key must be the same as the res
ult bitmap ones. |
| 44 * |
| 45 * result must be marked isImmutable() |
44 */ | 46 */ |
45 static void Add(uint32_t genID, int width, int height, const SkBitmap& resul
t); | 47 static bool Add(uint32_t genID, int width, int height, const SkBitmap& resul
t); |
| 48 |
| 49 /** |
| 50 * Search based on the bitmap's genID and subset. If found, returns true an
d |
| 51 * result will be set to the matching bitmap with its pixels already locked
. |
| 52 */ |
| 53 static bool Find(uint32_t genID, const SkIRect& subset, SkBitmap* result); |
| 54 |
| 55 /** |
| 56 * The width and the height of the provided subset must be the same as the r
esult bitmap ones. |
| 57 * result must be marked isImmutable() |
| 58 */ |
| 59 static bool Add(uint32_t genID, const SkIRect& subset, const SkBitmap& resul
t); |
46 }; | 60 }; |
47 | 61 |
48 class SkMipMapCache { | 62 class SkMipMapCache { |
49 public: | 63 public: |
50 static const SkMipMap* FindAndRef(const SkBitmap& src); | 64 static const SkMipMap* FindAndRef(const SkBitmap& src); |
51 static void Add(const SkBitmap& src, const SkMipMap* result); | 65 static void Add(const SkBitmap& src, const SkMipMap* result); |
52 }; | 66 }; |
53 | 67 |
54 #endif | 68 #endif |
OLD | NEW |