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 SkMaskCache_DEFINED | 8 #ifndef SkMaskCache_DEFINED |
9 #define SkMaskCache_DEFINED | 9 #define SkMaskCache_DEFINED |
10 | 10 |
(...skipping 21 matching lines...) Expand all Loading... |
32 | 32 |
33 /** | 33 /** |
34 * Add a mask and its pixel-data to the cache. | 34 * Add a mask and its pixel-data to the cache. |
35 */ | 35 */ |
36 static void Add(SkScalar sigma, SkBlurStyle style, SkBlurQuality quality, | 36 static void Add(SkScalar sigma, SkBlurStyle style, SkBlurQuality quality, |
37 const SkRRect& rrect, const SkMask& mask, SkCachedData* data
, | 37 const SkRRect& rrect, const SkMask& mask, SkCachedData* data
, |
38 SkResourceCache* localCache = NULL); | 38 SkResourceCache* localCache = NULL); |
39 static void Add(SkScalar sigma, SkBlurStyle style, SkBlurQuality quality, | 39 static void Add(SkScalar sigma, SkBlurStyle style, SkBlurQuality quality, |
40 const SkRect rects[], int count, const SkMask& mask, SkCache
dData* data, | 40 const SkRect rects[], int count, const SkMask& mask, SkCache
dData* data, |
41 SkResourceCache* localCache = NULL); | 41 SkResourceCache* localCache = NULL); |
| 42 |
| 43 /** |
| 44 * On success, set mask with cached value, allocate memory for mask->fImage, |
| 45 * copy pixels from SkCachedData in the cache to mask->fImage, then return t
rue. |
| 46 * |
| 47 * On failure, return false, no memory allocated for mask->fImage. |
| 48 */ |
| 49 static bool FindAndCopy(SkScalar sigma, SkBlurStyle style, SkBlurQuality qua
lity, |
| 50 const SkRRect& rrect, SkMask* mask); |
| 51 static bool FindAndCopy(SkScalar sigma, SkBlurStyle style, SkBlurQuality qua
lity, |
| 52 const SkRect rects[], int count, SkMask* mask); |
| 53 |
| 54 /** |
| 55 * Create a new SkCachedData, copy pixels from mask.fImage to it, then add i
t into cache. |
| 56 */ |
| 57 static void AddAndCopy(SkScalar sigma, SkBlurStyle style, SkBlurQuality qual
ity, |
| 58 const SkRRect& rrect, const SkMask& mask); |
| 59 static void AddAndCopy(SkScalar sigma, SkBlurStyle style, SkBlurQuality qual
ity, |
| 60 const SkRect rects[], int count, const SkMask& mask); |
42 }; | 61 }; |
43 | 62 |
44 #endif | 63 #endif |
OLD | NEW |