OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 Google Inc. |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 #include "SkBenchmark.h" | 8 #include "SkBenchmark.h" |
9 #include "SkBitmap.h" | 9 #include "SkBitmap.h" |
10 #include "SkPaint.h" | 10 #include "SkPaint.h" |
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
335 } | 335 } |
336 r.set(SkIntToScalar(x), 0, SkIntToScalar(x+1), SkIntToScalar(h))
; | 336 r.set(SkIntToScalar(x), 0, SkIntToScalar(x+1), SkIntToScalar(h))
; |
337 canvas.drawRect(r, p); | 337 canvas.drawRect(r, p); |
338 } | 338 } |
339 } | 339 } |
340 } | 340 } |
341 | 341 |
342 private: | 342 private: |
343 typedef BitmapBench INHERITED; | 343 typedef BitmapBench INHERITED; |
344 }; | 344 }; |
345 static SkBenchmark* Fact0(void* p) { return new BitmapBench(p, false, SkBitmap::
kARGB_8888_Config); } | 345 |
346 static SkBenchmark* Fact1(void* p) { return new BitmapBench(p, true, SkBitmap::k
ARGB_8888_Config); } | 346 DEF_BENCH( return new BitmapBench(p, false, SkBitmap::kARGB_8888_Config); ) |
347 static SkBenchmark* Fact2(void* p) { return new BitmapBench(p, true, SkBitmap::k
RGB_565_Config); } | 347 DEF_BENCH( return new BitmapBench(p, true, SkBitmap::kARGB_8888_Config); ) |
348 static SkBenchmark* Fact3(void* p) { return new BitmapBench(p, false, SkBitmap::
kARGB_4444_Config); } | 348 DEF_BENCH( return new BitmapBench(p, true, SkBitmap::kRGB_565_Config); ) |
349 static SkBenchmark* Fact4(void* p) { return new BitmapBench(p, true, SkBitmap::k
ARGB_4444_Config); } | 349 DEF_BENCH( return new BitmapBench(p, false, SkBitmap::kARGB_4444_Config); ) |
350 static SkBenchmark* Fact5(void* p) { return new BitmapBench(p, false, SkBitmap::
kIndex8_Config); } | 350 DEF_BENCH( return new BitmapBench(p, true, SkBitmap::kARGB_4444_Config); ) |
351 static SkBenchmark* Fact6(void* p) { return new BitmapBench(p, true, SkBitmap::k
Index8_Config); } | 351 DEF_BENCH( return new BitmapBench(p, false, SkBitmap::kIndex8_Config); ) |
352 static SkBenchmark* Fact7(void* p) { return new BitmapBench(p, true, SkBitmap::k
ARGB_8888_Config, true, true); } | 352 DEF_BENCH( return new BitmapBench(p, true, SkBitmap::kIndex8_Config); ) |
353 static SkBenchmark* Fact8(void* p) { return new BitmapBench(p, true, SkBitmap::k
ARGB_8888_Config, true, false); } | 353 DEF_BENCH( return new BitmapBench(p, true, SkBitmap::kARGB_8888_Config, true, tr
ue); ) |
| 354 DEF_BENCH( return new BitmapBench(p, true, SkBitmap::kARGB_8888_Config, true, fa
lse); ) |
354 | 355 |
355 // scale filter -> S32_opaque_D32_filter_DX_{SSE2,SSSE3} and Fact9 is also for S
32_D16_filter_DX_SSE2 | 356 // scale filter -> S32_opaque_D32_filter_DX_{SSE2,SSSE3} and Fact9 is also for S
32_D16_filter_DX_SSE2 |
356 static SkBenchmark* Fact9(void* p) { return new FilterBitmapBench(p, false, SkBi
tmap::kARGB_8888_Config, false, false, -1, -1, true, false, true); } | 357 DEF_BENCH( return new FilterBitmapBench(p, false, SkBitmap::kARGB_8888_Config, f
alse, false, -1, -1, true, false, true); ) |
357 static SkBenchmark* Fact10(void* p) { return new FilterBitmapBench(p, true, SkBi
tmap::kARGB_8888_Config, false, false, -1, -1, true, false, true); } | 358 DEF_BENCH( return new FilterBitmapBench(p, true, SkBitmap::kARGB_8888_Config, fa
lse, false, -1, -1, true, false, true); ) |
358 static SkBenchmark* Fact11(void* p) { return new FilterBitmapBench(p, true, SkBi
tmap::kARGB_8888_Config, true, true, -1, -1, true, false, true); } | 359 DEF_BENCH( return new FilterBitmapBench(p, true, SkBitmap::kARGB_8888_Config, tr
ue, true, -1, -1, true, false, true); ) |
359 static SkBenchmark* Fact12(void* p) { return new FilterBitmapBench(p, true, SkBi
tmap::kARGB_8888_Config, true, false, -1, -1, true, false, true); } | 360 DEF_BENCH( return new FilterBitmapBench(p, true, SkBitmap::kARGB_8888_Config, tr
ue, false, -1, -1, true, false, true); ) |
360 | 361 |
361 // scale rotate filter -> S32_opaque_D32_filter_DXDY_{SSE2,SSSE3} | 362 // scale rotate filter -> S32_opaque_D32_filter_DXDY_{SSE2,SSSE3} |
362 static SkBenchmark* Fact13(void* p) { return new FilterBitmapBench(p, false, SkB
itmap::kARGB_8888_Config, false, false, -1, -1, true, true, true); } | 363 DEF_BENCH( return new FilterBitmapBench(p, false, SkBitmap::kARGB_8888_Config, f
alse, false, -1, -1, true, true, true); ) |
363 static SkBenchmark* Fact14(void* p) { return new FilterBitmapBench(p, true, SkBi
tmap::kARGB_8888_Config, false, false, -1, -1, true, true, true); } | 364 DEF_BENCH( return new FilterBitmapBench(p, true, SkBitmap::kARGB_8888_Config, fa
lse, false, -1, -1, true, true, true); ) |
364 static SkBenchmark* Fact15(void* p) { return new FilterBitmapBench(p, true, SkBi
tmap::kARGB_8888_Config, true, true, -1, -1, true, true, true); } | 365 DEF_BENCH( return new FilterBitmapBench(p, true, SkBitmap::kARGB_8888_Config, tr
ue, true, -1, -1, true, true, true); ) |
365 static SkBenchmark* Fact16(void* p) { return new FilterBitmapBench(p, true, SkBi
tmap::kARGB_8888_Config, true, false, -1, -1, true, true, true); } | 366 DEF_BENCH( return new FilterBitmapBench(p, true, SkBitmap::kARGB_8888_Config, tr
ue, false, -1, -1, true, true, true); ) |
366 | 367 |
367 // source alpha tests -> S32A_Opaque_BlitRow32_{arm,neon} | 368 // source alpha tests -> S32A_Opaque_BlitRow32_{arm,neon} |
368 static SkBenchmark* Fact17(void* p) { return new SourceAlphaBitmapBench(p, Sourc
eAlphaBitmapBench::kOpaque_SourceAlpha, SkBitmap::kARGB_8888_Config); } | 369 DEF_BENCH( return new SourceAlphaBitmapBench(p, SourceAlphaBitmapBench::kOpaque_
SourceAlpha, SkBitmap::kARGB_8888_Config); ) |
369 static SkBenchmark* Fact18(void* p) { return new SourceAlphaBitmapBench(p, Sourc
eAlphaBitmapBench::kTransparent_SourceAlpha, SkBitmap::kARGB_8888_Config); } | 370 DEF_BENCH( return new SourceAlphaBitmapBench(p, SourceAlphaBitmapBench::kTranspa
rent_SourceAlpha, SkBitmap::kARGB_8888_Config); ) |
370 static SkBenchmark* Fact19(void* p) { return new SourceAlphaBitmapBench(p, Sourc
eAlphaBitmapBench::kTwoStripes_SourceAlpha, SkBitmap::kARGB_8888_Config); } | 371 DEF_BENCH( return new SourceAlphaBitmapBench(p, SourceAlphaBitmapBench::kTwoStri
pes_SourceAlpha, SkBitmap::kARGB_8888_Config); ) |
371 static SkBenchmark* Fact20(void* p) { return new SourceAlphaBitmapBench(p, Sourc
eAlphaBitmapBench::kThreeStripes_SourceAlpha, SkBitmap::kARGB_8888_Config); } | 372 DEF_BENCH( return new SourceAlphaBitmapBench(p, SourceAlphaBitmapBench::kThreeSt
ripes_SourceAlpha, SkBitmap::kARGB_8888_Config); ) |
372 | |
373 static BenchRegistry gReg0(Fact0); | |
374 static BenchRegistry gReg1(Fact1); | |
375 static BenchRegistry gReg2(Fact2); | |
376 static BenchRegistry gReg3(Fact3); | |
377 static BenchRegistry gReg4(Fact4); | |
378 static BenchRegistry gReg5(Fact5); | |
379 static BenchRegistry gReg6(Fact6); | |
380 static BenchRegistry gReg7(Fact7); | |
381 static BenchRegistry gReg8(Fact8); | |
382 | |
383 static BenchRegistry gReg9(Fact9); | |
384 static BenchRegistry gReg10(Fact10); | |
385 static BenchRegistry gReg11(Fact11); | |
386 static BenchRegistry gReg12(Fact12); | |
387 | |
388 static BenchRegistry gReg13(Fact13); | |
389 static BenchRegistry gReg14(Fact14); | |
390 static BenchRegistry gReg15(Fact15); | |
391 static BenchRegistry gReg16(Fact16); | |
392 | |
393 static BenchRegistry gReg17(Fact17); | |
394 static BenchRegistry gReg18(Fact18); | |
395 static BenchRegistry gReg19(Fact19); | |
396 static BenchRegistry gReg20(Fact20); | |
OLD | NEW |