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

Unified Diff: gm/xfermodes3.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/xfermodes2.cpp ('k') | tests/BitmapHeapTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/xfermodes3.cpp
diff --git a/gm/xfermodes3.cpp b/gm/xfermodes3.cpp
index 8c24bf72d1abb80f823d95df71c51445da7b4fe4..4cd05df5c40c4f436209393f67b33d3bbe8750c1 100644
--- a/gm/xfermodes3.cpp
+++ b/gm/xfermodes3.cpp
@@ -185,21 +185,17 @@ private:
SkMatrix lm;
lm.setScale(SkIntToScalar(kCheckSize), SkIntToScalar(kCheckSize));
- fBGShader.reset(SkShader::CreateBitmapShader(bg,
- SkShader::kRepeat_TileMode,
- SkShader::kRepeat_TileMode,
- &lm));
+ fBGShader = SkShader::MakeBitmapShader(bg, SkShader::kRepeat_TileMode,
+ SkShader::kRepeat_TileMode, &lm);
SkPaint bmpPaint;
- static const SkPoint kCenter = { SkIntToScalar(kSize) / 2, SkIntToScalar(kSize) / 2 };
- static const SkColor kColors[] = { SK_ColorTRANSPARENT, 0x80800000,
- 0xF020F060, SK_ColorWHITE };
- bmpPaint.setShader(SkGradientShader::CreateRadial(kCenter,
- 3 * SkIntToScalar(kSize) / 4,
- kColors,
- nullptr,
- SK_ARRAY_COUNT(kColors),
- SkShader::kRepeat_TileMode))->unref();
+ const SkPoint kCenter = { SkIntToScalar(kSize) / 2, SkIntToScalar(kSize) / 2 };
+ const SkColor kColors[] = {
+ SK_ColorTRANSPARENT, 0x80800000, 0xF020F060, SK_ColorWHITE
+ };
+ bmpPaint.setShader(SkGradientShader::MakeRadial(kCenter, 3 * SkIntToScalar(kSize) / 4,
+ kColors, nullptr, SK_ARRAY_COUNT(kColors),
+ SkShader::kRepeat_TileMode));
SkBitmap bmp;
bmp.allocN32Pixels(kSize, kSize);
@@ -210,9 +206,8 @@ private:
7 * SkIntToScalar(kSize) / 8, 7 * SkIntToScalar(kSize) / 8};
bmpCanvas.drawRect(rect, bmpPaint);
- fBmpShader.reset(SkShader::CreateBitmapShader(bmp,
- SkShader::kClamp_TileMode,
- SkShader::kClamp_TileMode));
+ fBmpShader = SkShader::MakeBitmapShader(bmp, SkShader::kClamp_TileMode,
+ SkShader::kClamp_TileMode);
}
enum {
@@ -221,8 +216,8 @@ private:
kTestsPerRow = 15,
};
- SkAutoTUnref<SkShader> fBGShader;
- SkAutoTUnref<SkShader> fBmpShader;
+ sk_sp<SkShader> fBGShader;
+ sk_sp<SkShader> fBmpShader;
typedef GM INHERITED;
};
« no previous file with comments | « gm/xfermodes2.cpp ('k') | tests/BitmapHeapTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698