OLD | NEW |
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 Loading... |
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 Loading... |
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);) |
OLD | NEW |