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

Side by Side Diff: bench/GameBench.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/ColorCubeBench.cpp ('k') | bench/GradientBench.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 2012 Google Inc. 2 * Copyright 2012 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 "SkCanvas.h" 9 #include "SkCanvas.h"
10 #include "SkPaint.h" 10 #include "SkPaint.h"
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 }; 132 };
133 uint16_t indices[6] = { 0, 1, 2, 0, 2, 3 }; 133 uint16_t indices[6] = { 0, 1, 2, 0, 2, 3 };
134 134
135 SkPaint p; 135 SkPaint p;
136 p.setColor(0xFF000000); 136 p.setColor(0xFF000000);
137 p.setFilterQuality(kLow_SkFilterQuality); 137 p.setFilterQuality(kLow_SkFilterQuality);
138 138
139 SkPaint p2; // for drawVertices path 139 SkPaint p2; // for drawVertices path
140 p2.setColor(0xFF000000); 140 p2.setColor(0xFF000000);
141 p2.setFilterQuality(kLow_SkFilterQuality); 141 p2.setFilterQuality(kLow_SkFilterQuality);
142 p2.setShader(SkShader::MakeBitmapShader(fAtlas, 142 p2.setShader(SkShader::CreateBitmapShader(fAtlas,
143 SkShader::kClamp_TileMode, 143 SkShader::kClamp_TileMode,
144 SkShader::kClamp_TileMode)); 144 SkShader::kClamp_TileMode))->u nref();
145 145
146 for (int i = 0; i < loops; ++i, ++fNumSaved) { 146 for (int i = 0; i < loops; ++i, ++fNumSaved) {
147 if (0 == i % kNumBeforeClear) { 147 if (0 == i % kNumBeforeClear) {
148 if (kPartial_Clear == fClear) { 148 if (kPartial_Clear == fClear) {
149 for (int j = 0; j < fNumSaved; ++j) { 149 for (int j = 0; j < fNumSaved; ++j) {
150 canvas->setMatrix(SkMatrix::I()); 150 canvas->setMatrix(SkMatrix::I());
151 mat.setTranslate(fSaved[j][0], fSaved[j][1]); 151 mat.setTranslate(fSaved[j][0], fSaved[j][1]);
152 152
153 if (kScale_Type == fType) { 153 if (kScale_Type == fType) {
154 mat.preScale(fSaved[j][2], fSaved[j][2]); 154 mat.preScale(fSaved[j][2], fSaved[j][2]);
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
316 // Full clear 316 // Full clear
317 DEF_BENCH(return new GameBench(GameBench::kScale_Type, GameBench::kFull_Clear);) 317 DEF_BENCH(return new GameBench(GameBench::kScale_Type, GameBench::kFull_Clear);)
318 DEF_BENCH(return new GameBench(GameBench::kTranslate_Type, GameBench::kFull_Clea r);) 318 DEF_BENCH(return new GameBench(GameBench::kTranslate_Type, GameBench::kFull_Clea r);)
319 DEF_BENCH(return new GameBench(GameBench::kTranslate_Type, GameBench::kFull_Clea r, true);) 319 DEF_BENCH(return new GameBench(GameBench::kTranslate_Type, GameBench::kFull_Clea r, true);)
320 DEF_BENCH(return new GameBench(GameBench::kRotate_Type, GameBench::kFull_Clear); ) 320 DEF_BENCH(return new GameBench(GameBench::kRotate_Type, GameBench::kFull_Clear); )
321 321
322 // Atlased 322 // Atlased
323 DEF_BENCH(return new GameBench(GameBench::kTranslate_Type, GameBench::kFull_Clea r, false, true);) 323 DEF_BENCH(return new GameBench(GameBench::kTranslate_Type, GameBench::kFull_Clea r, false, true);)
324 DEF_BENCH(return new GameBench( 324 DEF_BENCH(return new GameBench(
325 GameBench::kTranslate_Type, GameBench::kFull_Clear, fal se, true, true);) 325 GameBench::kTranslate_Type, GameBench::kFull_Clear, fal se, true, true);)
OLDNEW
« no previous file with comments | « bench/ColorCubeBench.cpp ('k') | bench/GradientBench.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698