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

Unified Diff: src/core/SkTextBlob.cpp

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/SkTextBlob.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkTextBlob.cpp
diff --git a/src/core/SkTextBlob.cpp b/src/core/SkTextBlob.cpp
index 1cbb2b6d6dabc9750c620b98cd1c8ec64c5adc84..3c7345f9a04df85e8b816fc21b7dbddaeff40d64 100644
--- a/src/core/SkTextBlob.cpp
+++ b/src/core/SkTextBlob.cpp
@@ -246,7 +246,7 @@ void SkTextBlob::flatten(SkWriteBuffer& buffer) const {
SkASSERT(0 == runCount);
}
-const SkTextBlob* SkTextBlob::CreateFromBuffer(SkReadBuffer& reader) {
+sk_sp<SkTextBlob> SkTextBlob::MakeFromBuffer(SkReadBuffer& reader) {
int runCount = reader.read32();
if (runCount < 0) {
return nullptr;
@@ -290,7 +290,7 @@ const SkTextBlob* SkTextBlob::CreateFromBuffer(SkReadBuffer& reader) {
}
}
- return blobBuilder.build();
+ return blobBuilder.make();
}
unsigned SkTextBlob::ScalarsPerGlyph(GlyphPositioning pos) {
@@ -613,7 +613,7 @@ const SkTextBlobBuilder::RunBuffer& SkTextBlobBuilder::allocRunPos(const SkPaint
return fCurrentRunBuffer;
}
-const SkTextBlob* SkTextBlobBuilder::build() {
+sk_sp<SkTextBlob> SkTextBlobBuilder::make() {
SkASSERT((fRunCount > 0) == (nullptr != fStorage.get()));
this->updateDeferredBounds();
@@ -624,7 +624,7 @@ const SkTextBlob* SkTextBlobBuilder::build() {
fStorage.realloc(fStorageUsed);
}
- const SkTextBlob* blob = new (fStorage.release()) SkTextBlob(fRunCount, fBounds);
+ SkTextBlob* blob = new (fStorage.release()) SkTextBlob(fRunCount, fBounds);
SkDEBUGCODE(const_cast<SkTextBlob*>(blob)->fStorageSize = fStorageSize;)
SkDEBUGCODE(
@@ -644,5 +644,5 @@ const SkTextBlob* SkTextBlobBuilder::build() {
fLastRun = 0;
fBounds.setEmpty();
- return blob;
+ return sk_sp<SkTextBlob>(blob);
}
« no previous file with comments | « include/core/SkTextBlob.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698