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

Unified Diff: gm/xfermodes2.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/xfermodes.cpp ('k') | gm/xfermodes3.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/xfermodes2.cpp
diff --git a/gm/xfermodes2.cpp b/gm/xfermodes2.cpp
index db48c03d20788118dc47aa5634c9d0dff3162854..397f4e1e2963a3f1cc3464af8911fff992bfea6a 100644
--- a/gm/xfermodes2.cpp
+++ b/gm/xfermodes2.cpp
@@ -99,10 +99,8 @@ private:
SkMatrix lm;
lm.setScale(SkIntToScalar(16), SkIntToScalar(16));
- fBG.reset(SkShader::CreateBitmapShader(bg,
- SkShader::kRepeat_TileMode,
- SkShader::kRepeat_TileMode,
- &lm));
+ fBG = SkShader::MakeBitmapShader(bg, SkShader::kRepeat_TileMode, SkShader::kRepeat_TileMode,
+ &lm);
SkBitmap srcBmp;
srcBmp.allocN32Pixels(kSize, kSize);
@@ -115,9 +113,8 @@ private:
pixels[kSize * y + x] = rowColor;
}
}
- fSrc.reset(SkShader::CreateBitmapShader(srcBmp,
- SkShader::kClamp_TileMode,
- SkShader::kClamp_TileMode));
+ fSrc = SkShader::MakeBitmapShader(srcBmp, SkShader::kClamp_TileMode,
+ SkShader::kClamp_TileMode);
SkBitmap dstBmp;
dstBmp.allocN32Pixels(kSize, kSize);
pixels = reinterpret_cast<SkPMColor*>(dstBmp.getPixels());
@@ -129,9 +126,8 @@ private:
pixels[kSize * y + x] = colColor;
}
}
- fDst.reset(SkShader::CreateBitmapShader(dstBmp,
- SkShader::kClamp_TileMode,
- SkShader::kClamp_TileMode));
+ fDst = SkShader::MakeBitmapShader(dstBmp, SkShader::kClamp_TileMode,
+ SkShader::kClamp_TileMode);
}
enum {
@@ -139,9 +135,9 @@ private:
kSize = 256 >> kShift,
};
- SkAutoTUnref<SkShader> fBG;
- SkAutoTUnref<SkShader> fSrc;
- SkAutoTUnref<SkShader> fDst;
+ sk_sp<SkShader> fBG;
+ sk_sp<SkShader> fSrc;
+ sk_sp<SkShader> fDst;
typedef GM INHERITED;
};
« no previous file with comments | « gm/xfermodes.cpp ('k') | gm/xfermodes3.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698