diff options
author | reed <reed@google.com> | 2016-08-10 14:16:41 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-08-10 14:16:41 -0700 |
commit | 2ab9057b31ee92060b9769ea1adfada51c11c010 (patch) | |
tree | 9f6088aa17127d8b9385b2b5a40d757344074416 /include/core/SkTextBlob.h | |
parent | 568de46cb1ac9d5a996fb52c6cf85568415a14ea (diff) |
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
Diffstat (limited to 'include/core/SkTextBlob.h')
-rw-r--r-- | include/core/SkTextBlob.h | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/include/core/SkTextBlob.h b/include/core/SkTextBlob.h index 3c5d87359a..1addb6f914 100644 --- a/include/core/SkTextBlob.h +++ b/include/core/SkTextBlob.h @@ -43,7 +43,11 @@ public: * @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 @@ public: * 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. |