aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/utils
diff options
context:
space:
mode:
authorGravatar fmalita <fmalita@chromium.org>2016-09-13 10:00:23 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-09-13 10:00:23 -0700
commit37283c28aa5bea2204c18956e74f83b238d7a891 (patch)
tree6ac125088f1df0c6d9380e323e873c72c8416b0b /src/utils
parentec44099979acd3e83ad93a15dbd9301856a90572 (diff)
Use sk_sp text blob APIs
SkTextBlobBuilder::build() -> make() SkAutoTUnref<const SkTextBlob> -> sk_sp<SkTextBlob> drawTextBlob(const SkTextBlob*) -> drawTextBlob(const sk_sp<SkTextBlob>&) BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2335493005 Review-Url: https://codereview.chromium.org/2335493005
Diffstat (limited to 'src/utils')
-rw-r--r--src/utils/SkLua.cpp3
-rw-r--r--src/utils/SkTextBox.cpp4
2 files changed, 3 insertions, 4 deletions
diff --git a/src/utils/SkLua.cpp b/src/utils/SkLua.cpp
index 8ea9eee5fc..117cb8af83 100644
--- a/src/utils/SkLua.cpp
+++ b/src/utils/SkLua.cpp
@@ -2076,8 +2076,7 @@ static int lsk_newTextBlob(lua_State* L) {
box.setText(text, strlen(text), paint);
SkScalar newBottom;
- SkAutoTUnref<SkTextBlob> blob(box.snapshotTextBlob(&newBottom));
- push_ref<SkTextBlob>(L, blob);
+ push_ref<SkTextBlob>(L, box.snapshotTextBlob(&newBottom));
SkLua(L).pushScalar(newBottom);
return 2;
}
diff --git a/src/utils/SkTextBox.cpp b/src/utils/SkTextBox.cpp
index d237f4513c..bc2e2217d9 100644
--- a/src/utils/SkTextBox.cpp
+++ b/src/utils/SkTextBox.cpp
@@ -292,11 +292,11 @@ public:
}
};
-SkTextBlob* SkTextBox::snapshotTextBlob(SkScalar* computedBottom) const {
+sk_sp<SkTextBlob> SkTextBox::snapshotTextBlob(SkScalar* computedBottom) const {
TextBlobVisitor visitor;
SkScalar newB = this->visit(visitor, fText, fLen, *fPaint);
if (computedBottom) {
*computedBottom = newB;
}
- return (SkTextBlob*)visitor.fBuilder.build();
+ return visitor.fBuilder.make();
}