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

Side by Side Diff: bench/ImageFilterCollapse.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 unified diff | Download patch
« no previous file with comments | « bench/GradientBench.cpp ('k') | bench/PatchBench.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2014 Google Inc. 2 * Copyright 2014 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "Benchmark.h" 8 #include "Benchmark.h"
9 #include "SkBitmap.h" 9 #include "SkBitmap.h"
10 #include "SkCanvas.h" 10 #include "SkCanvas.h"
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 fBitmap.allocN32Pixels(W, H); 59 fBitmap.allocN32Pixels(W, H);
60 fBitmap.eraseColor(SK_ColorTRANSPARENT); 60 fBitmap.eraseColor(SK_ColorTRANSPARENT);
61 61
62 SkCanvas canvas(fBitmap); 62 SkCanvas canvas(fBitmap);
63 SkPaint paint; 63 SkPaint paint;
64 SkPoint pts[] = { {0, 0}, {SkIntToScalar(W), SkIntToScalar(H)} }; 64 SkPoint pts[] = { {0, 0}, {SkIntToScalar(W), SkIntToScalar(H)} };
65 SkColor colors[] = { 65 SkColor colors[] = {
66 SK_ColorBLACK, SK_ColorGREEN, SK_ColorCYAN, 66 SK_ColorBLACK, SK_ColorGREEN, SK_ColorCYAN,
67 SK_ColorRED, 0, SK_ColorBLUE, SK_ColorWHITE 67 SK_ColorRED, 0, SK_ColorBLUE, SK_ColorWHITE
68 }; 68 };
69 paint.setShader(SkGradientShader::MakeLinear(pts, colors, nullptr, SK_AR RAY_COUNT(colors), 69 SkAutoTUnref<SkShader> shader(SkGradientShader::CreateLinear(
70 SkShader::kClamp_TileMode)) ; 70 pts, colors, nullptr, SK_ARRAY_COUNT(colors), SkShader::kCla mp_TileMode
71 ));
72 paint.setShader(shader);
71 canvas.drawPaint(paint); 73 canvas.drawPaint(paint);
72 } 74 }
73 }; 75 };
74 76
75 class TableCollapseBench: public BaseImageFilterCollapseBench { 77 class TableCollapseBench: public BaseImageFilterCollapseBench {
76 public: 78 public:
77 virtual ~TableCollapseBench() {} 79 virtual ~TableCollapseBench() {}
78 80
79 protected: 81 protected:
80 virtual const char* onGetName() override { 82 virtual const char* onGetName() override {
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 doPreDraw(colorFilters, SK_ARRAY_COUNT(colorFilters)); 149 doPreDraw(colorFilters, SK_ARRAY_COUNT(colorFilters));
148 150
149 for(unsigned i = 0; i < SK_ARRAY_COUNT(colorFilters); i++) { 151 for(unsigned i = 0; i < SK_ARRAY_COUNT(colorFilters); i++) {
150 colorFilters[i]->unref(); 152 colorFilters[i]->unref();
151 } 153 }
152 } 154 }
153 }; 155 };
154 156
155 DEF_BENCH(return new TableCollapseBench;) 157 DEF_BENCH(return new TableCollapseBench;)
156 DEF_BENCH(return new MatrixCollapseBench;) 158 DEF_BENCH(return new MatrixCollapseBench;)
OLDNEW
« no previous file with comments | « bench/GradientBench.cpp ('k') | bench/PatchBench.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698