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 16 matching lines...) Expand all Loading... |
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 | |
38 * result will be set to the matching bitmap with its pixels already locked
. | |
39 */ | |
40 static bool Find(uint32_t genID, int width, int height, SkBitmap* result); | |
41 | |
42 /** | |
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() | |
46 */ | |
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 | 37 * 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
. | 38 * result will be set to the matching bitmap with its pixels already locked
. |
52 */ | 39 */ |
53 static bool Find(uint32_t genID, const SkIRect& subset, SkBitmap* result); | 40 static bool Find(uint32_t genID, const SkIRect& subset, SkBitmap* result); |
54 | 41 |
55 /** | 42 /** |
56 * The width and the height of the provided subset must be the same as the r
esult bitmap ones. | 43 * 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() | 44 * result must be marked isImmutable() |
58 */ | 45 */ |
59 static bool Add(uint32_t genID, const SkIRect& subset, const SkBitmap& resul
t); | 46 static bool Add(uint32_t genID, const SkIRect& subset, const SkBitmap& resul
t); |
60 }; | 47 }; |
61 | 48 |
62 class SkMipMapCache { | 49 class SkMipMapCache { |
63 public: | 50 public: |
64 static const SkMipMap* FindAndRef(const SkBitmap& src); | 51 static const SkMipMap* FindAndRef(const SkBitmap& src); |
65 static void Add(const SkBitmap& src, const SkMipMap* result); | 52 static void Add(const SkBitmap& src, const SkMipMap* result); |
66 }; | 53 }; |
67 | 54 |
68 #endif | 55 #endif |
OLD | NEW |