Index: src/utils/SkLua.cpp |
diff --git a/src/utils/SkLua.cpp b/src/utils/SkLua.cpp |
index 4409e477e56d1fd37b02e464b292a50f2b7c9b1a..886f3d4ffd89bb4463edde1fb2df7d29fc21307c 100644 |
--- a/src/utils/SkLua.cpp |
+++ b/src/utils/SkLua.cpp |
@@ -925,7 +925,7 @@ |
} |
static int lpaint_setTypeface(lua_State* L) { |
- get_obj<SkPaint>(L, 1)->setTypeface(sk_ref_sp(get_ref<SkTypeface>(L, 2))); |
+ get_obj<SkPaint>(L, 1)->setTypeface(get_ref<SkTypeface>(L, 2)); |
return 0; |
} |
@@ -2049,12 +2049,13 @@ |
} |
} |
- sk_sp<SkTypeface> face(SkTypeface::MakeFromName(name, (SkTypeface::Style)style)); |
+ SkTypeface* face = SkTypeface::CreateFromName(name, |
+ (SkTypeface::Style)style); |
// SkDebugf("---- name <%s> style=%d, face=%p ref=%d\n", name, style, face, face->getRefCnt()); |
if (nullptr == face) { |
- face = SkTypeface::MakeDefault(); |
- } |
- push_ref(L, std::move(face)); |
+ face = SkTypeface::RefDefault(); |
+ } |
+ push_ref(L, face)->unref(); |
return 1; |
} |