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

Unified Diff: src/utils/SkLua.cpp

Issue 1852743002: Update SkBlurImageFilter to sk_sp (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Update to ToT & address code review comments Created 4 years, 9 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 | « src/effects/SkDropShadowImageFilter.cpp ('k') | tests/ImageFilterTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/utils/SkLua.cpp
diff --git a/src/utils/SkLua.cpp b/src/utils/SkLua.cpp
index 9af5bfd84e6fe38bced97df729a7eb113c032f65..9369a6bd9db4ed9425e32d5eb5a205c787fb6603 100644
--- a/src/utils/SkLua.cpp
+++ b/src/utils/SkLua.cpp
@@ -1963,11 +1963,11 @@ static int lsk_newDocumentPDF(lua_State* L) {
static int lsk_newBlurImageFilter(lua_State* L) {
SkScalar sigmaX = lua2scalar_def(L, 1, 0);
SkScalar sigmaY = lua2scalar_def(L, 2, 0);
- SkImageFilter* imf = SkBlurImageFilter::Create(sigmaX, sigmaY);
- if (nullptr == imf) {
+ sk_sp<SkImageFilter> imf(SkBlurImageFilter::Make(sigmaX, sigmaY, nullptr));
+ if (!imf) {
lua_pushnil(L);
} else {
- push_ref(L, imf)->unref();
+ push_ref(L, std::move(imf));
}
return 1;
}
@@ -1982,7 +1982,8 @@ static int lsk_newLinearGradient(lua_State* L) {
SkPoint pts[] = { { x0, y0 }, { x1, y1 } };
SkColor colors[] = { c0, c1 };
- auto s = SkGradientShader::MakeLinear(pts, colors, nullptr, 2, SkShader::kClamp_TileMode);
+ sk_sp<SkShader> s(SkGradientShader::MakeLinear(pts, colors, nullptr, 2,
+ SkShader::kClamp_TileMode));
if (!s) {
lua_pushnil(L);
} else {
« no previous file with comments | « src/effects/SkDropShadowImageFilter.cpp ('k') | tests/ImageFilterTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698