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

Unified Diff: gm/aarectmodes.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 | « no previous file | gm/bigmatrix.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/aarectmodes.cpp
diff --git a/gm/aarectmodes.cpp b/gm/aarectmodes.cpp
index fb5145bc5f840dd049614c3df05d9fc3a4f9ac63..badd1ae450c6299b9ce08d49fa26b879eb9348f2 100644
--- a/gm/aarectmodes.cpp
+++ b/gm/aarectmodes.cpp
@@ -107,7 +107,7 @@ static SkScalar drawCell(SkCanvas* canvas, SkXfermode* mode,
return H;
}
-static SkShader* make_bg_shader() {
+static sk_sp<SkShader> make_bg_shader() {
SkBitmap bm;
bm.allocN32Pixels(2, 2);
*bm.getAddr32(0, 0) = *bm.getAddr32(1, 1) = 0xFFFFFFFF;
@@ -115,12 +115,8 @@ static SkShader* make_bg_shader() {
0xCF, 0xCE);
const SkMatrix m = SkMatrix::MakeScale(SkIntToScalar(6), SkIntToScalar(6));
- SkShader* s = SkShader::CreateBitmapShader(bm,
- SkShader::kRepeat_TileMode,
- SkShader::kRepeat_TileMode,
- &m);
-
- return s;
+ return SkShader::MakeBitmapShader(bm, SkShader::kRepeat_TileMode, SkShader::kRepeat_TileMode,
+ &m);
}
namespace skiagm {
@@ -129,7 +125,7 @@ namespace skiagm {
SkPaint fBGPaint;
public:
AARectModesGM () {
- fBGPaint.setShader(make_bg_shader())->unref();
+ fBGPaint.setShader(make_bg_shader());
}
protected:
« no previous file with comments | « no previous file | gm/bigmatrix.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698