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

Unified Diff: gm/vertices.cpp

Issue 1820303002: Revert of switch colorfilters to sk_sp (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/tileimagefilter.cpp ('k') | gyp/skia_for_android_framework_defines.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/vertices.cpp
diff --git a/gm/vertices.cpp b/gm/vertices.cpp
index 9c4ccc16bb33d04b3bffb4c790f73fd67188b0bf..177dc43c2b7bc83b4d7838defc0cea3bc405cb52 100644
--- a/gm/vertices.cpp
+++ b/gm/vertices.cpp
@@ -26,17 +26,17 @@
return SkShader::MakeColorShader(SK_ColorBLUE);
}
-static sk_sp<SkColorFilter> make_color_filter() {
- return SkColorFilter::MakeModeFilter(0xFFAABBCC, SkXfermode::kDarken_Mode);
+static SkColorFilter* make_color_filter() {
+ return SkColorFilter::CreateModeFilter(0xFFAABBCC, SkXfermode::kDarken_Mode);
}
class VerticesGM : public skiagm::GM {
- SkPoint fPts[9];
- SkPoint fTexs[9];
- SkColor fColors[9];
- sk_sp<SkShader> fShader1;
- sk_sp<SkShader> fShader2;
- sk_sp<SkColorFilter> fColorFilter;
+ SkPoint fPts[9];
+ SkPoint fTexs[9];
+ SkColor fColors[9];
+ sk_sp<SkShader> fShader1;
+ sk_sp<SkShader> fShader2;
+ SkAutoTUnref<SkColorFilter> fColorFilter;
public:
VerticesGM() {}
@@ -60,7 +60,7 @@
fShader1 = make_shader1(w, h);
fShader2 = make_shader2();
- fColorFilter = make_color_filter();
+ fColorFilter.reset(make_color_filter());
SkRandom rand;
for (size_t i = 0; i < SK_ARRAY_COUNT(fColors); ++i) {
@@ -85,11 +85,11 @@
};
const struct {
- const SkColor* fColors;
- const SkPoint* fTexs;
- const sk_sp<SkShader>& fShader;
- const sk_sp<SkColorFilter>& fColorFilter;
- uint8_t fAlpha;
+ const SkColor* fColors;
+ const SkPoint* fTexs;
+ const sk_sp<SkShader>& fShader;
+ SkColorFilter* fColorFilter;
+ uint8_t fAlpha;
} rec[] = {
{ fColors, nullptr, fShader1, nullptr , 0xFF },
{ nullptr, fTexs , fShader1, nullptr , 0xFF },
« no previous file with comments | « gm/tileimagefilter.cpp ('k') | gyp/skia_for_android_framework_defines.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698