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

Unified Diff: gm/bleed.cpp

Issue 1776973003: partial switch over to sp usage of shaders (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: move into lua container 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/bitmaprect.cpp ('k') | gm/blurrect.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/bleed.cpp
diff --git a/gm/bleed.cpp b/gm/bleed.cpp
index 1a96fdbfec5bd4247091ef83ae2d41c2ac9aa06b..5a0416293887e072770f05b13c409ef9ceeabd40 100644
--- a/gm/bleed.cpp
+++ b/gm/bleed.cpp
@@ -277,13 +277,13 @@ static bool make_ringed_oversized_alpha_texture_bitmap(GrContext* ctx, TestPixel
ctx, result, width, height, kAlpha_8_GrPixelConfig, kZero, kOne, k3Q, kHalf, k1Q);
}
-static SkShader* make_shader() {
+static sk_sp<SkShader> make_shader() {
static const SkPoint pts[] = { {0, 0}, {20, 20} };
static const SkColor colors[] = { SK_ColorGREEN, SK_ColorYELLOW };
- return SkGradientShader::CreateLinear(pts, colors, nullptr, 2, SkShader::kMirror_TileMode);
+ return SkGradientShader::MakeLinear(pts, colors, nullptr, 2, SkShader::kMirror_TileMode);
}
-static SkShader* make_null_shader() { return nullptr; }
+static sk_sp<SkShader> make_null_shader() { return nullptr; }
enum BleedTest {
kUseBitmap_BleedTest,
@@ -300,7 +300,7 @@ enum BleedTest {
const struct {
const char* fName;
bool (*fPixelMaker)(GrContext*, TestPixels* result, int width, int height);
- SkShader* (*fShaderMaker)();
+ sk_sp<SkShader> (*fShaderMaker)();
} gBleedRec[] = {
{ "bleed", make_ringed_color_bitmap, make_null_shader },
{ "bleed_texture_bmp", make_ringed_oversized_color_texture_bitmap, make_null_shader },
@@ -468,7 +468,7 @@ protected:
return;
}
- fShader.reset(gBleedRec[fBT].fShaderMaker());
+ fShader = gBleedRec[fBT].fShaderMaker();
canvas->clear(SK_ColorGRAY);
SkTDArray<SkMatrix> matrices;
@@ -582,13 +582,13 @@ private:
static const int kSmallTextureSize = 6;
static const int kMaxTileSize = 32;
- bool fCreatedPixels;
- TestPixels fBigTestPixels;
- TestPixels fSmallTestPixels;
+ bool fCreatedPixels;
+ TestPixels fBigTestPixels;
+ TestPixels fSmallTestPixels;
- SkAutoTUnref<SkShader> fShader;
+ sk_sp<SkShader> fShader;
- const BleedTest fBT;
+ const BleedTest fBT;
typedef GM INHERITED;
};
« no previous file with comments | « gm/bitmaprect.cpp ('k') | gm/blurrect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698