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

Unified Diff: samplecode/SampleShaders.cpp

Issue 1832223002: switch xfermodes over to sk_sp (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase 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
Index: samplecode/SampleShaders.cpp
diff --git a/samplecode/SampleShaders.cpp b/samplecode/SampleShaders.cpp
index 2ea6f0a68fecbd71d5cffc115df6fab9a88aaa6e..608199da4419b81a2c8a9dc7f806407090d7b9c5 100644
--- a/samplecode/SampleShaders.cpp
+++ b/samplecode/SampleShaders.cpp
@@ -32,11 +32,10 @@ static sk_sp<SkShader> make_bitmapfade(const SkBitmap& bm) {
auto shaderA = SkGradientShader::MakeLinear(pts, colors, nullptr, 2, SkShader::kClamp_TileMode);
auto shaderB = SkShader::MakeBitmapShader(bm,
- SkShader::kClamp_TileMode, SkShader::kClamp_TileMode);
+ SkShader::kClamp_TileMode, SkShader::kClamp_TileMode);
- SkAutoTUnref<SkXfermode> mode(SkXfermode::Create(SkXfermode::kDstIn_Mode));
-
- return SkShader::MakeComposeShader(std::move(shaderB), std::move(shaderA), mode);
+ return SkShader::MakeComposeShader(std::move(shaderB), std::move(shaderA),
+ SkXfermode::Make(SkXfermode::kDstIn_Mode));
}
class ShaderView : public SampleView {
@@ -62,9 +61,8 @@ public:
colors[1] = SkColorSetARGB(0x80, 0, 0, 0);
auto shaderB = SkGradientShader::MakeLinear(pts, colors, nullptr, 2, SkShader::kClamp_TileMode);
- SkAutoTUnref<SkXfermode> mode(SkXfermode::Create(SkXfermode::kDstIn_Mode));
-
- fShader = SkShader::MakeComposeShader(std::move(shaderA), std::move(shaderB), mode);
+ fShader = SkShader::MakeComposeShader(std::move(shaderA), std::move(shaderB),
+ SkXfermode::Make(SkXfermode::kDstIn_Mode));
}
protected:

Powered by Google App Engine
This is Rietveld 408576698