Index: samplecode/SampleAll.cpp |
diff --git a/samplecode/SampleAll.cpp b/samplecode/SampleAll.cpp |
index d3be968ee7af39e0bc260bf58f5ecd5b7d6fe7e6..aa0826120038ef20f26560608c3bf5c8f1936f8c 100644 |
--- a/samplecode/SampleAll.cpp |
+++ b/samplecode/SampleAll.cpp |
@@ -382,7 +382,6 @@ protected: |
SkScalar sigma = SkBlurMask::ConvertRadiusToSigma(SkIntToScalar(12)/5); |
SkMaskFilter* embossFilter = SkEmbossMaskFilter::Create(sigma, light); |
- SkXfermode* xfermode = SkXfermode::Create(SkXfermode::kXor_Mode); |
auto lightingFilter = SkColorMatrixFilter::MakeLightingFilter( |
0xff89bc45, 0xff112233); |
@@ -404,7 +403,7 @@ protected: |
paint.setColor(SK_ColorGREEN); |
paint.setStrokeWidth(SkIntToScalar(10)); |
paint.setStyle(SkPaint::kStroke_Style); |
- paint.setXfermode(xfermode)->unref(); |
+ paint.setXfermode(SkXfermode::Make(SkXfermode::kXor_Mode)); |
paint.setColorFilter(lightingFilter); |
canvas->drawLine(start.fX, start.fY, stop.fX, stop.fY, paint); // should not be green |
paint.setXfermode(nullptr); |
@@ -505,8 +504,8 @@ protected: |
SkColor colors2[] = {SK_ColorBLACK, SkColorSetARGB(0x80, 0, 0, 0)}; |
auto shaderB = SkGradientShader::MakeLinear(pts, colors2, nullptr, |
2, SkShader::kClamp_TileMode); |
- SkAutoTUnref<SkXfermode> mode(SkXfermode::Create(SkXfermode::kDstIn_Mode)); |
- return SkShader::MakeComposeShader(shaderA, shaderB, mode); |
+ return SkShader::MakeComposeShader(std::move(shaderA), std::move(shaderB), |
+ SkXfermode::Make(SkXfermode::kDstIn_Mode)); |
} |
virtual void startTest() { |