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

Unified Diff: gm/perspshaders.cpp

Issue 1793303002: Reland of "more shader-->sp conversions (patchset #5 id:80001 of https://codereview.chromium… (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: make pictureRef a value, so its clearer what's going on 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 59fab47fc8ed2d5c66b76d7f3bab373a7f87687f..a29ef52f460305dff7d1f01febf1b0d07c820f27 100644
--- a/gm/perspshaders.cpp
+++ b/gm/perspshaders.cpp
@@ -46,9 +46,8 @@ protected:
SK_ColorBLUE, SK_ColorYELLOW,
kCellSize/10);
- fBitmapShader.reset(SkShader::CreateBitmapShader(fBitmap,
- SkShader::kClamp_TileMode,
- SkShader::kClamp_TileMode));
+ fBitmapShader = SkShader::MakeBitmapShader(fBitmap, SkShader::kClamp_TileMode,
+ SkShader::kClamp_TileMode);
SkPoint pts1[] = {
{ 0, 0 },
{ SkIntToScalar(kCellSize), SkIntToScalar(kCellSize) }
@@ -62,12 +61,10 @@ protected:
};
static const SkScalar pos[] = { 0, 0.25f, 0.5f, 0.75f, SK_Scalar1 };
- 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));
+ 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);
fPerspMatrix.reset();
fPerspMatrix.setPerspY(SK_Scalar1 / 50);
@@ -160,9 +157,9 @@ private:
bool fDoAA;
SkPath fPath;
- SkAutoTUnref<SkShader> fBitmapShader;
- SkAutoTUnref<SkShader> fLinearGrad1;
- SkAutoTUnref<SkShader> fLinearGrad2;
+ sk_sp<SkShader> fBitmapShader;
+ sk_sp<SkShader> fLinearGrad1;
+ sk_sp<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