update textblob api to use sk_sp
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2236013002
NOTREECHECKS=True
Review-Url: https://codereview.chromium.org/2236013002
diff --git a/include/core/SkTextBlob.h b/include/core/SkTextBlob.h
index 3c5d873..1addb6f 100644
--- a/include/core/SkTextBlob.h
+++ b/include/core/SkTextBlob.h
@@ -43,7 +43,11 @@
* @return A new SkTextBlob representing the serialized data, or NULL if the buffer is
* invalid.
*/
- static const SkTextBlob* CreateFromBuffer(SkReadBuffer&);
+ static sk_sp<SkTextBlob> MakeFromBuffer(SkReadBuffer&);
+
+ static const SkTextBlob* CreateFromBuffer(SkReadBuffer& buffer) {
+ return MakeFromBuffer(buffer).release();
+ }
enum GlyphPositioning {
kDefault_Positioning = 0, // Default glyph advances -- zero scalars per glyph.
@@ -99,7 +103,11 @@
* Returns an immutable SkTextBlob for the current runs/glyphs. The builder is reset and
* can be reused.
*/
- const SkTextBlob* build();
+ sk_sp<SkTextBlob> make();
+
+ const SkTextBlob* build() {
+ return this->make().release();
+ }
/**
* Glyph and position buffers associated with a run.