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 #include "SkMaskCache.h" | 8 #include "SkMaskCache.h" |
9 | 9 |
10 #define CHECK_LOCAL(localCache, localName, globalName, ...) \ | 10 #define CHECK_LOCAL(localCache, localName, globalName, ...) \ |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 | 84 |
85 *mask = result.fMask; | 85 *mask = result.fMask; |
86 mask->fImage = (uint8_t*)(result.fData->data()); | 86 mask->fImage = (uint8_t*)(result.fData->data()); |
87 return result.fData; | 87 return result.fData; |
88 } | 88 } |
89 | 89 |
90 void SkMaskCache::Add(SkScalar sigma, SkBlurStyle style, SkBlurQuality quality, | 90 void SkMaskCache::Add(SkScalar sigma, SkBlurStyle style, SkBlurQuality quality, |
91 const SkRRect& rrect, const SkMask& mask, SkCachedData* da
ta, | 91 const SkRRect& rrect, const SkMask& mask, SkCachedData* da
ta, |
92 SkResourceCache* localCache) { | 92 SkResourceCache* localCache) { |
93 RRectBlurKey key(sigma, rrect, style, quality); | 93 RRectBlurKey key(sigma, rrect, style, quality); |
94 return CHECK_LOCAL(localCache, add, Add, SkNEW_ARGS(RRectBlurRec, (key, mask
, data))); | 94 return CHECK_LOCAL(localCache, add, Add, new RRectBlurRec(key, mask, data)); |
95 } | 95 } |
96 | 96 |
97 ////////////////////////////////////////////////////////////////////////////////
////////// | 97 ////////////////////////////////////////////////////////////////////////////////
////////// |
98 | 98 |
99 namespace { | 99 namespace { |
100 static unsigned gRectsBlurKeyNamespaceLabel; | 100 static unsigned gRectsBlurKeyNamespaceLabel; |
101 | 101 |
102 struct RectsBlurKey : public SkResourceCache::Key { | 102 struct RectsBlurKey : public SkResourceCache::Key { |
103 public: | 103 public: |
104 RectsBlurKey(SkScalar sigma, SkBlurStyle style, SkBlurQuality quality, | 104 RectsBlurKey(SkScalar sigma, SkBlurStyle style, SkBlurQuality quality, |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 | 180 |
181 *mask = result.fMask; | 181 *mask = result.fMask; |
182 mask->fImage = (uint8_t*)(result.fData->data()); | 182 mask->fImage = (uint8_t*)(result.fData->data()); |
183 return result.fData; | 183 return result.fData; |
184 } | 184 } |
185 | 185 |
186 void SkMaskCache::Add(SkScalar sigma, SkBlurStyle style, SkBlurQuality quality, | 186 void SkMaskCache::Add(SkScalar sigma, SkBlurStyle style, SkBlurQuality quality, |
187 const SkRect rects[], int count, const SkMask& mask, SkCac
hedData* data, | 187 const SkRect rects[], int count, const SkMask& mask, SkCac
hedData* data, |
188 SkResourceCache* localCache) { | 188 SkResourceCache* localCache) { |
189 RectsBlurKey key(sigma, style, quality, rects, count); | 189 RectsBlurKey key(sigma, style, quality, rects, count); |
190 return CHECK_LOCAL(localCache, add, Add, SkNEW_ARGS(RectsBlurRec, (key, mask
, data))); | 190 return CHECK_LOCAL(localCache, add, Add, new RectsBlurRec(key, mask, data)); |
191 } | 191 } |
OLD | NEW |