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

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

Issue 1780933003: Use std::unique_ptr. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: once more, all together Created 4 years, 9 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/SkAdvancedTypefaceMetrics.cpp ('k') | src/core/SkSharedMutex.h » ('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 254 matching lines...) Expand 10 before | Expand all | Expand 10 after
265 SkChunkAlloc fGlyphAlloc; 265 SkChunkAlloc fGlyphAlloc;
266 266
267 SkAutoTArray<CharGlyphRec> fPackedUnicharIDToPackedGlyphID; 267 SkAutoTArray<CharGlyphRec> fPackedUnicharIDToPackedGlyphID;
268 268
269 // used to track (approx) how much ram is tied-up in this cache 269 // used to track (approx) how much ram is tied-up in this cache
270 size_t fMemoryUsed; 270 size_t fMemoryUsed;
271 271
272 AuxProcRec* fAuxProcList; 272 AuxProcRec* fAuxProcList;
273 }; 273 };
274 274
275 class SkAutoGlyphCache : public skstd::unique_ptr<SkGlyphCache, SkGlyphCache::At tachCacheFunctor> { 275 class SkAutoGlyphCache : public std::unique_ptr<SkGlyphCache, SkGlyphCache::Atta chCacheFunctor> {
276 public: 276 public:
277 /** deprecated: use get() */ 277 /** deprecated: use get() */
278 SkGlyphCache* getCache() const { return this->get(); } 278 SkGlyphCache* getCache() const { return this->get(); }
279 279
280 SkAutoGlyphCache(SkGlyphCache* cache) : INHERITED(cache) {} 280 SkAutoGlyphCache(SkGlyphCache* cache) : INHERITED(cache) {}
281 SkAutoGlyphCache(SkTypeface* typeface, const SkDescriptor* desc) 281 SkAutoGlyphCache(SkTypeface* typeface, const SkDescriptor* desc)
282 : INHERITED(SkGlyphCache::DetachCache(typeface, desc)) 282 : INHERITED(SkGlyphCache::DetachCache(typeface, desc))
283 {} 283 {}
284 /** deprecated: always enables fake gamma */ 284 /** deprecated: always enables fake gamma */
285 SkAutoGlyphCache(const SkPaint& paint, 285 SkAutoGlyphCache(const SkPaint& paint,
286 const SkSurfaceProps* surfaceProps, 286 const SkSurfaceProps* surfaceProps,
287 const SkMatrix* matrix) 287 const SkMatrix* matrix)
288 : INHERITED(paint.detachCache(surfaceProps, SkPaint::FakeGamma::On, matr ix)) 288 : INHERITED(paint.detachCache(surfaceProps, SkPaint::FakeGamma::On, matr ix))
289 {} 289 {}
290 SkAutoGlyphCache(const SkPaint& paint, 290 SkAutoGlyphCache(const SkPaint& paint,
291 const SkSurfaceProps* surfaceProps, 291 const SkSurfaceProps* surfaceProps,
292 SkPaint::FakeGamma fakeGamma, 292 SkPaint::FakeGamma fakeGamma,
293 const SkMatrix* matrix) 293 const SkMatrix* matrix)
294 : INHERITED(paint.detachCache(surfaceProps, fakeGamma, matrix)) 294 : INHERITED(paint.detachCache(surfaceProps, fakeGamma, matrix))
295 {} 295 {}
296 private: 296 private:
297 using INHERITED = skstd::unique_ptr<SkGlyphCache, SkGlyphCache::AttachCacheF unctor>; 297 using INHERITED = std::unique_ptr<SkGlyphCache, SkGlyphCache::AttachCacheFun ctor>;
298 }; 298 };
299 299
300 class SkAutoGlyphCacheNoGamma : public SkAutoGlyphCache { 300 class SkAutoGlyphCacheNoGamma : public SkAutoGlyphCache {
301 public: 301 public:
302 SkAutoGlyphCacheNoGamma(const SkPaint& paint, 302 SkAutoGlyphCacheNoGamma(const SkPaint& paint,
303 const SkSurfaceProps* surfaceProps, 303 const SkSurfaceProps* surfaceProps,
304 const SkMatrix* matrix) 304 const SkMatrix* matrix)
305 : SkAutoGlyphCache(paint, surfaceProps, SkPaint::FakeGamma::Off, matrix) 305 : SkAutoGlyphCache(paint, surfaceProps, SkPaint::FakeGamma::Off, matrix)
306 {} 306 {}
307 }; 307 };
308 #define SkAutoGlyphCache(...) SK_REQUIRE_LOCAL_VAR(SkAutoGlyphCache) 308 #define SkAutoGlyphCache(...) SK_REQUIRE_LOCAL_VAR(SkAutoGlyphCache)
309 #define SkAutoGlyphCacheNoGamma(...) SK_REQUIRE_LOCAL_VAR(SkAutoGlyphCacheNoGamm a) 309 #define SkAutoGlyphCacheNoGamma(...) SK_REQUIRE_LOCAL_VAR(SkAutoGlyphCacheNoGamm a)
310 310
311 #endif 311 #endif
OLDNEW
« no previous file with comments | « src/core/SkAdvancedTypefaceMetrics.cpp ('k') | src/core/SkSharedMutex.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698