| 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 "SkBenchmark.h" | 8 #include "SkBenchmark.h" |
| 9 #include "SkCanvas.h" | 9 #include "SkCanvas.h" |
| 10 #include "SkPaint.h" | 10 #include "SkPaint.h" |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 SkPoint uvs[4] = { | 200 SkPoint uvs[4] = { |
| 201 { SkIntToScalar(src.fLeft), SkIntToScalar(src.fBottom)
}, | 201 { SkIntToScalar(src.fLeft), SkIntToScalar(src.fBottom)
}, |
| 202 { SkIntToScalar(src.fLeft), SkIntToScalar(src.fTop) }, | 202 { SkIntToScalar(src.fLeft), SkIntToScalar(src.fTop) }, |
| 203 { SkIntToScalar(src.fRight), SkIntToScalar(src.fTop) }, | 203 { SkIntToScalar(src.fRight), SkIntToScalar(src.fTop) }, |
| 204 { SkIntToScalar(src.fRight), SkIntToScalar(src.fBottom)
}, | 204 { SkIntToScalar(src.fRight), SkIntToScalar(src.fBottom)
}, |
| 205 }; | 205 }; |
| 206 canvas->drawVertices(SkCanvas::kTriangles_VertexMode, | 206 canvas->drawVertices(SkCanvas::kTriangles_VertexMode, |
| 207 4, verts, uvs, NULL, NULL, | 207 4, verts, uvs, NULL, NULL, |
| 208 indices, 6, p2); | 208 indices, 6, p2); |
| 209 } else { | 209 } else { |
| 210 canvas->drawBitmapRect(fAtlas, &src, dst, &p); | 210 canvas->drawBitmapRect(fAtlas, &src, dst, &p, |
| 211 SkCanvas::kBleed_DrawBitmapRectFlag); |
| 211 } | 212 } |
| 212 } else { | 213 } else { |
| 213 canvas->drawBitmapRect(fCheckerboard, NULL, dst, &p); | 214 canvas->drawBitmapRect(fCheckerboard, NULL, dst, &p); |
| 214 } | 215 } |
| 215 } | 216 } |
| 216 } | 217 } |
| 217 | 218 |
| 218 private: | 219 private: |
| 219 static const int kCheckerboardWidth = 64; | 220 static const int kCheckerboardWidth = 64; |
| 220 static const int kCheckerboardHeight = 128; | 221 static const int kCheckerboardHeight = 128; |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 338 DEF_BENCH( return SkNEW_ARGS(GameBench, (p, GameBench::kTranslate_Type, | 339 DEF_BENCH( return SkNEW_ARGS(GameBench, (p, GameBench::kTranslate_Type, |
| 339 GameBench::kFull_Clear, true)); ) | 340 GameBench::kFull_Clear, true)); ) |
| 340 DEF_BENCH( return SkNEW_ARGS(GameBench, (p, GameBench::kRotate_Type, | 341 DEF_BENCH( return SkNEW_ARGS(GameBench, (p, GameBench::kRotate_Type, |
| 341 GameBench::kFull_Clear)); ) | 342 GameBench::kFull_Clear)); ) |
| 342 | 343 |
| 343 // Atlased | 344 // Atlased |
| 344 DEF_BENCH( return SkNEW_ARGS(GameBench, (p, GameBench::kTranslate_Type, | 345 DEF_BENCH( return SkNEW_ARGS(GameBench, (p, GameBench::kTranslate_Type, |
| 345 GameBench::kFull_Clear, false, true)
); ) | 346 GameBench::kFull_Clear, false, true)
); ) |
| 346 DEF_BENCH( return SkNEW_ARGS(GameBench, (p, GameBench::kTranslate_Type, | 347 DEF_BENCH( return SkNEW_ARGS(GameBench, (p, GameBench::kTranslate_Type, |
| 347 GameBench::kFull_Clear, false, true,
true)); ) | 348 GameBench::kFull_Clear, false, true,
true)); ) |
| OLD | NEW |