Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(850)

Side by Side Diff: src/core/SkGlyphCache.h

Issue 1983353003: Attempt to improve lifetime management of SkGlyphCache in Ganesh atlas text code. (Closed) Base URL: https://skia.googlesource.com/skia.git@fixtest
Patch Set: Updated to only compare descriptors Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/core/SkDescriptor.h ('k') | src/gpu/batches/GrAtlasTextBatch.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2006 The Android Open Source Project 2 * Copyright 2006 The Android Open Source Project
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. 4 * Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
5 */ 5 */
6 6
7 #ifndef SkGlyphCache_DEFINED 7 #ifndef SkGlyphCache_DEFINED
8 #define SkGlyphCache_DEFINED 8 #define SkGlyphCache_DEFINED
9 9
10 #include "SkBitmap.h" 10 #include "SkBitmap.h"
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after
270 // used to track (approx) how much ram is tied-up in this cache 270 // used to track (approx) how much ram is tied-up in this cache
271 size_t fMemoryUsed; 271 size_t fMemoryUsed;
272 272
273 AuxProcRec* fAuxProcList; 273 AuxProcRec* fAuxProcList;
274 }; 274 };
275 275
276 class SkAutoGlyphCache : public std::unique_ptr<SkGlyphCache, SkGlyphCache::Atta chCacheFunctor> { 276 class SkAutoGlyphCache : public std::unique_ptr<SkGlyphCache, SkGlyphCache::Atta chCacheFunctor> {
277 public: 277 public:
278 /** deprecated: use get() */ 278 /** deprecated: use get() */
279 SkGlyphCache* getCache() const { return this->get(); } 279 SkGlyphCache* getCache() const { return this->get(); }
280 280 SkAutoGlyphCache() = default;
281 SkAutoGlyphCache(SkGlyphCache* cache) : INHERITED(cache) {} 281 SkAutoGlyphCache(SkGlyphCache* cache) : INHERITED(cache) {}
282 SkAutoGlyphCache(SkTypeface* typeface, const SkScalerContextEffects& effects , 282 SkAutoGlyphCache(SkTypeface* typeface, const SkScalerContextEffects& effects ,
283 const SkDescriptor* desc) 283 const SkDescriptor* desc)
284 : INHERITED(SkGlyphCache::DetachCache(typeface, effects, desc)) 284 : INHERITED(SkGlyphCache::DetachCache(typeface, effects, desc))
285 {} 285 {}
286 /** deprecated: always enables fake gamma */ 286 /** deprecated: always enables fake gamma */
287 SkAutoGlyphCache(const SkPaint& paint, 287 SkAutoGlyphCache(const SkPaint& paint,
288 const SkSurfaceProps* surfaceProps, 288 const SkSurfaceProps* surfaceProps,
289 const SkMatrix* matrix) 289 const SkMatrix* matrix)
290 : INHERITED(paint.detachCache(surfaceProps, 290 : INHERITED(paint.detachCache(surfaceProps,
(...skipping 15 matching lines...) Expand all
306 SkAutoGlyphCacheNoGamma(const SkPaint& paint, 306 SkAutoGlyphCacheNoGamma(const SkPaint& paint,
307 const SkSurfaceProps* surfaceProps, 307 const SkSurfaceProps* surfaceProps,
308 const SkMatrix* matrix) 308 const SkMatrix* matrix)
309 : SkAutoGlyphCache(paint, surfaceProps, SkPaint::kNone_ScalerContextFlag s, matrix) 309 : SkAutoGlyphCache(paint, surfaceProps, SkPaint::kNone_ScalerContextFlag s, matrix)
310 {} 310 {}
311 }; 311 };
312 #define SkAutoGlyphCache(...) SK_REQUIRE_LOCAL_VAR(SkAutoGlyphCache) 312 #define SkAutoGlyphCache(...) SK_REQUIRE_LOCAL_VAR(SkAutoGlyphCache)
313 #define SkAutoGlyphCacheNoGamma(...) SK_REQUIRE_LOCAL_VAR(SkAutoGlyphCacheNoGamm a) 313 #define SkAutoGlyphCacheNoGamma(...) SK_REQUIRE_LOCAL_VAR(SkAutoGlyphCacheNoGamm a)
314 314
315 #endif 315 #endif
OLDNEW
« no previous file with comments | « src/core/SkDescriptor.h ('k') | src/gpu/batches/GrAtlasTextBatch.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698