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

Unified Diff: include/core/SkTextBlob.h

Issue 2236013002: update textblob api to use sk_sp (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « include/core/SkCanvas.h ('k') | src/core/SkTextBlob.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/core/SkTextBlob.h
diff --git a/include/core/SkTextBlob.h b/include/core/SkTextBlob.h
index 3c5d87359aac99a8fc3288d7a3c4ece76a940cf0..1addb6f9142e11b7252ec3a534f50b571bfee44e 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.
« no previous file with comments | « include/core/SkCanvas.h ('k') | src/core/SkTextBlob.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698