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

Unified Diff: gm/blurroundrect.cpp

Issue 1776973003: partial switch over to sp usage of shaders (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: move into lua container 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 | « gm/blurrect.cpp ('k') | gm/bmpfilterqualityrepeat.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/blurroundrect.cpp
diff --git a/gm/blurroundrect.cpp b/gm/blurroundrect.cpp
index c3cdb66673e19e3bde2ec4bf6aa1812cbd19fe7a..ef20e25860708b5da20c65d533333c3bfbb9bcd5 100644
--- a/gm/blurroundrect.cpp
+++ b/gm/blurroundrect.cpp
@@ -92,7 +92,7 @@ private:
/*
* Spits out a dummy gradient to test blur with shader on paint
*/
-static SkShader* MakeRadial() {
+static sk_sp<SkShader> MakeRadial() {
SkPoint pts[2] = {
{ 0, 0 },
{ SkIntToScalar(100), SkIntToScalar(100) }
@@ -108,10 +108,10 @@ static SkShader* MakeRadial() {
SkScalarAve(pts[0].fY, pts[1].fY));
center1.set(SkScalarInterp(pts[0].fX, pts[1].fX, SkIntToScalar(3)/5),
SkScalarInterp(pts[0].fY, pts[1].fY, SkIntToScalar(1)/4));
- return SkGradientShader::CreateTwoPointConical(center1, (pts[1].fX - pts[0].fX) / 7,
- center0, (pts[1].fX - pts[0].fX) / 2,
- colors, pos, SK_ARRAY_COUNT(colors), tm,
- 0, &scale);
+ return SkGradientShader::MakeTwoPointConical(center1, (pts[1].fX - pts[0].fX) / 7,
+ center0, (pts[1].fX - pts[0].fX) / 2,
+ colors, pos, SK_ARRAY_COUNT(colors), tm,
+ 0, &scale);
}
// Simpler blurred RR test cases where all the radii are the same.
@@ -153,7 +153,7 @@ protected:
bool useRadial = SkToBool(k);
if (useRadial) {
- paint.setShader(MakeRadial())->unref();
+ paint.setShader(MakeRadial());
}
SkRRect rrect;
« no previous file with comments | « gm/blurrect.cpp ('k') | gm/bmpfilterqualityrepeat.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698