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

Unified Diff: bench/ColorCubeBench.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/AlternatingColorPatternBench.cpp ('k') | bench/GameBench.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: bench/ColorCubeBench.cpp
diff --git a/bench/ColorCubeBench.cpp b/bench/ColorCubeBench.cpp
index 9f6bd001ff00b5b972dad83acce4d87f65ea7386..6c5a16d6a212bf03d362408ef71742dcb0fb7dc7 100644
--- a/bench/ColorCubeBench.cpp
+++ b/bench/ColorCubeBench.cpp
@@ -48,13 +48,13 @@
}
private:
- static sk_sp<SkShader> MakeLinear(const SkISize& size) {
+ static SkShader* MakeLinear(const SkISize& size) {
const SkPoint pts[2] = {
{ 0, 0 },
{ SkIntToScalar(size.width()), SkIntToScalar(size.height()) }
};
static const SkColor colors[] = { SK_ColorYELLOW, SK_ColorBLUE };
- return SkGradientShader::MakeLinear(
+ return SkGradientShader::CreateLinear(
pts, colors, nullptr, 2, SkShader::kRepeat_TileMode, 0, &SkMatrix::I());
}
@@ -64,9 +64,11 @@
canvas.clear(0x00000000);
SkPaint paint;
paint.setAntiAlias(true);
- paint.setShader(MakeLinear(fSize));
+ SkShader* shader = MakeLinear(fSize);
+ paint.setShader(shader);
SkRect r = { 0, 0, SkIntToScalar(fSize.width()), SkIntToScalar(fSize.height()) };
canvas.drawRect(r, paint);
+ shader->unref();
}
void makeCubeData() {
« no previous file with comments | « bench/AlternatingColorPatternBench.cpp ('k') | bench/GameBench.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698