| 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 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 SkPoint verts[4] = { // for drawVertices path | 127 SkPoint verts[4] = { // for drawVertices path |
| 128 { 0, 0 }, | 128 { 0, 0 }, |
| 129 { 0, SkIntToScalar(height) }, | 129 { 0, SkIntToScalar(height) }, |
| 130 { SkIntToScalar(width), SkIntToScalar(height) }, | 130 { SkIntToScalar(width), SkIntToScalar(height) }, |
| 131 { SkIntToScalar(width), 0 } | 131 { SkIntToScalar(width), 0 } |
| 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.setFilterLevel(SkPaint::kLow_FilterLevel); | 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.setFilterLevel(SkPaint::kLow_FilterLevel); | 141 p2.setFilterQuality(kLow_SkFilterQuality); |
| 142 p2.setShader(SkShader::CreateBitmapShader(fAtlas, | 142 p2.setShader(SkShader::CreateBitmapShader(fAtlas, |
| 143 SkShader::kClamp_TileMode, | 143 SkShader::kClamp_TileMode, |
| 144 SkShader::kClamp_TileMode))->u
nref(); | 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]); |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 325 DEF_BENCH( return SkNEW_ARGS(GameBench, (GameBench::kTranslate_Type, | 325 DEF_BENCH( return SkNEW_ARGS(GameBench, (GameBench::kTranslate_Type, |
| 326 GameBench::kFull_Clear, true)); ) | 326 GameBench::kFull_Clear, true)); ) |
| 327 DEF_BENCH( return SkNEW_ARGS(GameBench, (GameBench::kRotate_Type, | 327 DEF_BENCH( return SkNEW_ARGS(GameBench, (GameBench::kRotate_Type, |
| 328 GameBench::kFull_Clear)); ) | 328 GameBench::kFull_Clear)); ) |
| 329 | 329 |
| 330 // Atlased | 330 // Atlased |
| 331 DEF_BENCH( return SkNEW_ARGS(GameBench, (GameBench::kTranslate_Type, | 331 DEF_BENCH( return SkNEW_ARGS(GameBench, (GameBench::kTranslate_Type, |
| 332 GameBench::kFull_Clear, false, true)
); ) | 332 GameBench::kFull_Clear, false, true)
); ) |
| 333 DEF_BENCH( return SkNEW_ARGS(GameBench, (GameBench::kTranslate_Type, | 333 DEF_BENCH( return SkNEW_ARGS(GameBench, (GameBench::kTranslate_Type, |
| 334 GameBench::kFull_Clear, false, true,
true)); ) | 334 GameBench::kFull_Clear, false, true,
true)); ) |
| OLD | NEW |