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

Unified Diff: gm/perspshaders.cpp

Issue 1790353002: Revert of more shader-->sp conversions (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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/patch.cpp ('k') | gm/pictureimagegenerator.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/perspshaders.cpp
diff --git a/gm/perspshaders.cpp b/gm/perspshaders.cpp
index a29ef52f460305dff7d1f01febf1b0d07c820f27..59fab47fc8ed2d5c66b76d7f3bab373a7f87687f 100644
--- a/gm/perspshaders.cpp
+++ b/gm/perspshaders.cpp
@@ -46,8 +46,9 @@
SK_ColorBLUE, SK_ColorYELLOW,
kCellSize/10);
- fBitmapShader = SkShader::MakeBitmapShader(fBitmap, SkShader::kClamp_TileMode,
- SkShader::kClamp_TileMode);
+ fBitmapShader.reset(SkShader::CreateBitmapShader(fBitmap,
+ SkShader::kClamp_TileMode,
+ SkShader::kClamp_TileMode));
SkPoint pts1[] = {
{ 0, 0 },
{ SkIntToScalar(kCellSize), SkIntToScalar(kCellSize) }
@@ -61,10 +62,12 @@
};
static const SkScalar pos[] = { 0, 0.25f, 0.5f, 0.75f, SK_Scalar1 };
- fLinearGrad1 = SkGradientShader::MakeLinear(pts1, colors, pos, SK_ARRAY_COUNT(colors),
- SkShader::kClamp_TileMode);
- fLinearGrad2 = SkGradientShader::MakeLinear(pts2, colors, pos, SK_ARRAY_COUNT(colors),
- SkShader::kClamp_TileMode);
+ fLinearGrad1.reset(SkGradientShader::CreateLinear(pts1, colors, pos,
+ SK_ARRAY_COUNT(colors),
+ SkShader::kClamp_TileMode));
+ fLinearGrad2.reset(SkGradientShader::CreateLinear(pts2, colors, pos,
+ SK_ARRAY_COUNT(colors),
+ SkShader::kClamp_TileMode));
fPerspMatrix.reset();
fPerspMatrix.setPerspY(SK_Scalar1 / 50);
@@ -157,9 +160,9 @@
bool fDoAA;
SkPath fPath;
- sk_sp<SkShader> fBitmapShader;
- sk_sp<SkShader> fLinearGrad1;
- sk_sp<SkShader> fLinearGrad2;
+ SkAutoTUnref<SkShader> fBitmapShader;
+ SkAutoTUnref<SkShader> fLinearGrad1;
+ SkAutoTUnref<SkShader> fLinearGrad2;
SkMatrix fPerspMatrix;
SkAutoTUnref<SkImage> fImage;
SkBitmap fBitmap;
« no previous file with comments | « gm/patch.cpp ('k') | gm/pictureimagegenerator.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698