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

Unified Diff: gm/patch.cpp

Issue 1789633002: more shader-->sp conversions (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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/ovals.cpp ('k') | gm/perspshaders.cpp » ('j') | gm/pictureshadertile.cpp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/patch.cpp
diff --git a/gm/patch.cpp b/gm/patch.cpp
index d9f6d57d6f940f4e232b188ef78073ab9787057c..5b661f4b7c65e910150cadff8d0c43db30a48b89 100644
--- a/gm/patch.cpp
+++ b/gm/patch.cpp
@@ -10,15 +10,15 @@
#include "SkGradientShader.h"
#include "SkPatchUtils.h"
-static SkShader* make_shader() {
+static sk_sp<SkShader> make_shader() {
const SkColor colors[] = {
SK_ColorRED, SK_ColorCYAN, SK_ColorGREEN, SK_ColorWHITE, SK_ColorMAGENTA, SK_ColorBLUE,
SK_ColorYELLOW,
};
const SkPoint pts[] = { { 100.f / 4.f, 0.f }, { 3.f * 100.f / 4.f, 100.f } };
- return SkGradientShader::CreateLinear(pts, colors, nullptr, SK_ARRAY_COUNT(colors),
- SkShader::kMirror_TileMode);
+ return SkGradientShader::MakeLinear(pts, colors, nullptr, SK_ARRAY_COUNT(colors),
+ SkShader::kMirror_TileMode);
}
static void draw_control_points(SkCanvas* canvas, const SkPoint cubics[12]) {
@@ -92,7 +92,7 @@ DEF_SIMPLE_GM(patch_primitive, canvas, 800, 800) {
SkXfermode::kModulate_Mode,
};
- SkAutoTUnref<SkShader> shader(make_shader());
+ sk_sp<SkShader> shader(make_shader());
canvas->save();
for (int y = 0; y < 3; y++) {
« no previous file with comments | « gm/ovals.cpp ('k') | gm/perspshaders.cpp » ('j') | gm/pictureshadertile.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698