OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 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 #include "Benchmark.h" | 7 #include "Benchmark.h" |
8 #include "SkCanvas.h" | 8 #include "SkCanvas.h" |
9 #include "SkColorCubeFilter.h" | 9 #include "SkColorCubeFilter.h" |
10 #include "SkGradientShader.h" | 10 #include "SkGradientShader.h" |
(...skipping 13 matching lines...) Expand all Loading... |
24 | 24 |
25 ~ColorCubeBench() { | 25 ~ColorCubeBench() { |
26 SkSafeUnref(fCubeData); | 26 SkSafeUnref(fCubeData); |
27 } | 27 } |
28 | 28 |
29 protected: | 29 protected: |
30 const char* onGetName() override { | 30 const char* onGetName() override { |
31 return "colorcube"; | 31 return "colorcube"; |
32 } | 32 } |
33 | 33 |
34 void onPreDraw() override { | 34 void onDelayedSetup() override { |
35 if (!SkToBool(fCubeData)) { | 35 if (!SkToBool(fCubeData)) { |
36 this->makeCubeData(); | 36 this->makeCubeData(); |
37 this->make_bitmap(); | 37 this->make_bitmap(); |
38 } | 38 } |
39 } | 39 } |
40 | 40 |
41 void onDraw(const int loops, SkCanvas* canvas) override { | 41 void onDraw(const int loops, SkCanvas* canvas) override { |
42 this->test(loops, canvas); | 42 this->test(loops, canvas); |
43 } | 43 } |
44 | 44 |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 canvas->drawBitmap(fBitmap, 0, 0, &paint); | 102 canvas->drawBitmap(fBitmap, 0, 0, &paint); |
103 } | 103 } |
104 } | 104 } |
105 | 105 |
106 typedef Benchmark INHERITED; | 106 typedef Benchmark INHERITED; |
107 }; | 107 }; |
108 | 108 |
109 /////////////////////////////////////////////////////////////////////////////// | 109 /////////////////////////////////////////////////////////////////////////////// |
110 | 110 |
111 DEF_BENCH( return new ColorCubeBench(); ) | 111 DEF_BENCH( return new ColorCubeBench(); ) |
OLD | NEW |