OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2006 The Android Open Source Project | 3 * Copyright 2006 The Android Open Source Project |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 | 9 |
10 #ifndef SkGlyphCache_DEFINED | 10 #ifndef SkGlyphCache_DEFINED |
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
241 } | 241 } |
242 } | 242 } |
243 | 243 |
244 protected: | 244 protected: |
245 // Hide the constructors so we can't create one of these directly. | 245 // Hide the constructors so we can't create one of these directly. |
246 // Create SkAutoGlyphCache or SkAutoGlyphCacheNoCache instead. | 246 // Create SkAutoGlyphCache or SkAutoGlyphCacheNoCache instead. |
247 SkAutoGlyphCacheBase(SkGlyphCache* cache) : fCache(cache) {} | 247 SkAutoGlyphCacheBase(SkGlyphCache* cache) : fCache(cache) {} |
248 SkAutoGlyphCacheBase(SkTypeface* typeface, const SkDescriptor* desc) { | 248 SkAutoGlyphCacheBase(SkTypeface* typeface, const SkDescriptor* desc) { |
249 fCache = SkGlyphCache::DetachCache(typeface, desc); | 249 fCache = SkGlyphCache::DetachCache(typeface, desc); |
250 } | 250 } |
251 SkAutoGlyphCacheBase(const SkPaint& paint, | 251 SkAutoGlyphCacheBase(const SkPaint& /*paint*/, |
252 const SkDeviceProperties* deviceProperties, | 252 const SkDeviceProperties* /*deviceProperties*/, |
253 const SkMatrix* matrix) { | 253 const SkMatrix* /*matrix*/) { |
254 fCache = NULL; | 254 fCache = NULL; |
255 } | 255 } |
256 SkAutoGlyphCacheBase() { | 256 SkAutoGlyphCacheBase() { |
257 fCache = NULL; | 257 fCache = NULL; |
258 } | 258 } |
259 ~SkAutoGlyphCacheBase() { | 259 ~SkAutoGlyphCacheBase() { |
260 if (fCache) { | 260 if (fCache) { |
261 SkGlyphCache::AttachCache(fCache); | 261 SkGlyphCache::AttachCache(fCache); |
262 } | 262 } |
263 } | 263 } |
(...skipping 30 matching lines...) Expand all Loading... |
294 const SkMatrix* matrix) { | 294 const SkMatrix* matrix) { |
295 fCache = paint.detachCache(deviceProperties, matrix, true); | 295 fCache = paint.detachCache(deviceProperties, matrix, true); |
296 } | 296 } |
297 | 297 |
298 private: | 298 private: |
299 SkAutoGlyphCacheNoGamma() : SkAutoGlyphCacheBase() {} | 299 SkAutoGlyphCacheNoGamma() : SkAutoGlyphCacheBase() {} |
300 }; | 300 }; |
301 #define SkAutoGlyphCacheNoGamma(...) SK_REQUIRE_LOCAL_VAR(SkAutoGlyphCacheNoGamm
a) | 301 #define SkAutoGlyphCacheNoGamma(...) SK_REQUIRE_LOCAL_VAR(SkAutoGlyphCacheNoGamm
a) |
302 | 302 |
303 #endif | 303 #endif |
OLD | NEW |