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

Unified Diff: gm/composeshader.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: gm/composeshader.cpp
diff --git a/gm/composeshader.cpp b/gm/composeshader.cpp
index 421641c3560e373a7efe3908d0b2ddf908a1b9a0..efcfe79afe5abd97dfeae770507e54444aa40972 100644
--- a/gm/composeshader.cpp
+++ b/gm/composeshader.cpp
@@ -30,9 +30,8 @@ static sk_sp<SkShader> make_shader(SkXfermode::Mode mode) {
colors[1] = SkColorSetARGB(0x80, 0, 0, 0);
auto shaderB = SkGradientShader::MakeLinear(pts, colors, nullptr, 2, SkShader::kClamp_TileMode);
- SkAutoTUnref<SkXfermode> xfer(SkXfermode::Create(mode));
-
- return SkShader::MakeComposeShader(std::move(shaderA), std::move(shaderB), xfer);
+ return SkShader::MakeComposeShader(std::move(shaderA), std::move(shaderB),
+ SkXfermode::Make(mode));
}
class ComposeShaderGM : public skiagm::GM {
@@ -176,7 +175,7 @@ protected:
}
void onDraw(SkCanvas* canvas) override {
- SkAutoTUnref<SkXfermode> xfer(SkXfermode::Create(SkXfermode::kDstOver_Mode));
+ auto xfer(SkXfermode::Make(SkXfermode::kDstOver_Mode));
sk_sp<SkShader> shaders[] = {
// gradient should appear over color bitmap

Powered by Google App Engine
This is Rietveld 408576698