SkScalerContext to use smart pointers.
CQ_INCLUDE_TRYBOTS=master.client.skia:Test-Ubuntu-Clang-GCE-CPU-AVX2-x86_64-Debug-ASAN-Trybot;master.client.skia:Test-Ubuntu-Clang-GCE-CPU-AVX2-x86_64-Debug-MSAN-Trybot
Change-Id: I27a714388b8ded7dfc968e322b0a587205f575f1
Reviewed-on: https://skia-review.googlesource.com/3731
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Ben Wagner <bungeman@google.com>
diff --git a/src/core/SkGlyphCache.h b/src/core/SkGlyphCache.h
index e18b992..863b2c8 100644
--- a/src/core/SkGlyphCache.h
+++ b/src/core/SkGlyphCache.h
@@ -110,7 +110,7 @@
void dump() const;
- SkScalerContext* getScalerContext() const { return fScalerContext; }
+ SkScalerContext* getScalerContext() const { return fScalerContext.get(); }
/** Find a matching cache entry, and call proc() with it. If none is found create a new one.
If the proc() returns true, detach the cache and return it, otherwise leave it and return
@@ -195,8 +195,7 @@
PackedGlyphID fPackedGlyphID;
};
- // SkGlyphCache takes ownership of the scalercontext.
- SkGlyphCache(SkTypeface*, const SkDescriptor*, SkScalerContext*);
+ SkGlyphCache(const SkDescriptor*, std::unique_ptr<SkScalerContext>);
~SkGlyphCache();
// Return the SkGlyph* associated with MakeID. The id parameter is the
@@ -233,7 +232,7 @@
SkGlyphCache* fNext;
SkGlyphCache* fPrev;
const std::unique_ptr<SkDescriptor> fDesc;
- SkScalerContext* const fScalerContext;
+ const std::unique_ptr<SkScalerContext> fScalerContext;
SkPaint::FontMetrics fFontMetrics;
// Map from a combined GlyphID and sub-pixel position to a SkGlyph.