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

Unified Diff: gm/xfermodes3.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/xfermodes2.cpp ('k') | tests/BitmapHeapTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/xfermodes3.cpp
diff --git a/gm/xfermodes3.cpp b/gm/xfermodes3.cpp
index 4cd05df5c40c4f436209393f67b33d3bbe8750c1..8c24bf72d1abb80f823d95df71c51445da7b4fe4 100644
--- a/gm/xfermodes3.cpp
+++ b/gm/xfermodes3.cpp
@@ -185,17 +185,21 @@
SkMatrix lm;
lm.setScale(SkIntToScalar(kCheckSize), SkIntToScalar(kCheckSize));
- fBGShader = SkShader::MakeBitmapShader(bg, SkShader::kRepeat_TileMode,
- SkShader::kRepeat_TileMode, &lm);
+ fBGShader.reset(SkShader::CreateBitmapShader(bg,
+ SkShader::kRepeat_TileMode,
+ SkShader::kRepeat_TileMode,
+ &lm));
SkPaint bmpPaint;
- const SkPoint kCenter = { SkIntToScalar(kSize) / 2, SkIntToScalar(kSize) / 2 };
- const SkColor kColors[] = {
- SK_ColorTRANSPARENT, 0x80800000, 0xF020F060, SK_ColorWHITE
- };
- bmpPaint.setShader(SkGradientShader::MakeRadial(kCenter, 3 * SkIntToScalar(kSize) / 4,
- kColors, nullptr, SK_ARRAY_COUNT(kColors),
- SkShader::kRepeat_TileMode));
+ static const SkPoint kCenter = { SkIntToScalar(kSize) / 2, SkIntToScalar(kSize) / 2 };
+ static const SkColor kColors[] = { SK_ColorTRANSPARENT, 0x80800000,
+ 0xF020F060, SK_ColorWHITE };
+ bmpPaint.setShader(SkGradientShader::CreateRadial(kCenter,
+ 3 * SkIntToScalar(kSize) / 4,
+ kColors,
+ nullptr,
+ SK_ARRAY_COUNT(kColors),
+ SkShader::kRepeat_TileMode))->unref();
SkBitmap bmp;
bmp.allocN32Pixels(kSize, kSize);
@@ -206,8 +210,9 @@
7 * SkIntToScalar(kSize) / 8, 7 * SkIntToScalar(kSize) / 8};
bmpCanvas.drawRect(rect, bmpPaint);
- fBmpShader = SkShader::MakeBitmapShader(bmp, SkShader::kClamp_TileMode,
- SkShader::kClamp_TileMode);
+ fBmpShader.reset(SkShader::CreateBitmapShader(bmp,
+ SkShader::kClamp_TileMode,
+ SkShader::kClamp_TileMode));
}
enum {
@@ -216,8 +221,8 @@
kTestsPerRow = 15,
};
- sk_sp<SkShader> fBGShader;
- sk_sp<SkShader> fBmpShader;
+ SkAutoTUnref<SkShader> fBGShader;
+ SkAutoTUnref<SkShader> fBmpShader;
typedef GM INHERITED;
};
« no previous file with comments | « gm/xfermodes2.cpp ('k') | tests/BitmapHeapTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698