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

Unified Diff: gm/blurrect.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/bleed.cpp ('k') | gm/blurroundrect.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/blurrect.cpp
diff --git a/gm/blurrect.cpp b/gm/blurrect.cpp
index 55c592b6276c85008a2db9e71df1de0d1f94e358..0fe866feb2b60d26d7a7fd467d44e46df5dcf15d 100644
--- a/gm/blurrect.cpp
+++ b/gm/blurrect.cpp
@@ -58,7 +58,7 @@ static void draw_donut_skewed(SkCanvas* canvas, const SkRect& r, const SkPaint&
/*
* 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) }
@@ -74,10 +74,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);
}
typedef void (*PaintProc)(SkPaint*, SkScalar width);
@@ -123,7 +123,7 @@ protected:
paint.setAlpha(fAlpha);
SkPaint paintWithRadial = paint;
- paintWithRadial.setShader(MakeRadial())->unref();
+ paintWithRadial.setShader(MakeRadial());
static const Proc procs[] = {
fill_rect, draw_donut, draw_donut_skewed
« no previous file with comments | « gm/bleed.cpp ('k') | gm/blurroundrect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698