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

Unified Diff: bench/PatchBench.cpp

Issue 1798133003: Revert of Finish conversion to sk_sp<SkShader> (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 | « bench/ImageFilterCollapse.cpp ('k') | bench/PatchGridBench.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: bench/PatchBench.cpp
diff --git a/bench/PatchBench.cpp b/bench/PatchBench.cpp
index 5d7451a0c449331033132a4cca2a771f7b45bea9..6f51b4593ab192eacb061e1653a628835f00370c 100644
--- a/bench/PatchBench.cpp
+++ b/bench/PatchBench.cpp
@@ -69,15 +69,16 @@
}
// override this method to change the shader
- virtual sk_sp<SkShader> createShader() {
+ virtual SkShader* createShader() {
const SkColor colors[] = {
SK_ColorRED, SK_ColorCYAN, SK_ColorGREEN, SK_ColorWHITE,
SK_ColorMAGENTA, SK_ColorBLUE, SK_ColorYELLOW,
};
const SkPoint pts[] = { { 200.f / 4.f, 0.f }, { 3.f * 200.f / 4, 200.f } };
- return SkGradientShader::MakeLinear(pts, colors, nullptr, SK_ARRAY_COUNT(colors),
- SkShader::kMirror_TileMode);
+ return SkGradientShader::CreateLinear(pts, colors, nullptr,
+ SK_ARRAY_COUNT(colors),
+ SkShader::kMirror_TileMode);
}
protected:
@@ -114,7 +115,7 @@
switch (fVertexMode) {
case kTexCoords_VertexMode:
case kBoth_VertexMode:
- fPaint.setShader(this->createShader());
+ fPaint.setShader(this->createShader())->unref();
break;
default:
fPaint.setShader(nullptr);
« no previous file with comments | « bench/ImageFilterCollapse.cpp ('k') | bench/PatchGridBench.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698