OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 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 "SkBlurMask.h" | 9 #include "SkBlurMask.h" |
10 #include "SkBlurMaskFilter.h" | 10 #include "SkBlurMaskFilter.h" |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 paint->setColor(SK_ColorGRAY); | 60 paint->setColor(SK_ColorGRAY); |
61 } | 61 } |
62 { | 62 { |
63 SkLayerDrawLooper::LayerInfo info; | 63 SkLayerDrawLooper::LayerInfo info; |
64 looperBuilder.addLayerOnTop(info); | 64 looperBuilder.addLayerOnTop(info); |
65 } | 65 } |
66 SkPaint dullPaint; | 66 SkPaint dullPaint; |
67 dullPaint.setAntiAlias(true); | 67 dullPaint.setAntiAlias(true); |
68 | 68 |
69 SkPaint loopedPaint; | 69 SkPaint loopedPaint; |
70 loopedPaint.setLooper(looperBuilder.detachLooper())->unref(); | 70 loopedPaint.setLooper(looperBuilder.detach()); |
71 loopedPaint.setAntiAlias(true); | 71 loopedPaint.setAntiAlias(true); |
72 loopedPaint.setColor(SK_ColorCYAN); | 72 loopedPaint.setColor(SK_ColorCYAN); |
73 | 73 |
74 for (int i = 0; i < loops; i++) { | 74 for (int i = 0; i < loops; i++) { |
75 canvas->drawRect(fRRect.rect(), dullPaint); | 75 canvas->drawRect(fRRect.rect(), dullPaint); |
76 canvas->drawRRect(fRRect, loopedPaint); | 76 canvas->drawRRect(fRRect, loopedPaint); |
77 } | 77 } |
78 } | 78 } |
79 | 79 |
80 private: | 80 private: |
81 SkString fName; | 81 SkString fName; |
82 SkRRect fRRect; | 82 SkRRect fRRect; |
83 | 83 |
84 typedef Benchmark INHERITED; | 84 typedef Benchmark INHERITED; |
85 }; | 85 }; |
86 | 86 |
87 // Create one with dimensions/rounded corners based on the skp | 87 // Create one with dimensions/rounded corners based on the skp |
88 DEF_BENCH(return new BlurRoundRectBench(600, 5514, 6);) | 88 DEF_BENCH(return new BlurRoundRectBench(600, 5514, 6);) |
89 // Same radii, much smaller rectangle | 89 // Same radii, much smaller rectangle |
90 DEF_BENCH(return new BlurRoundRectBench(100, 100, 6);) | 90 DEF_BENCH(return new BlurRoundRectBench(100, 100, 6);) |
91 // Other radii options | 91 // Other radii options |
92 DEF_BENCH(return new BlurRoundRectBench(100, 100, 30);) | 92 DEF_BENCH(return new BlurRoundRectBench(100, 100, 30);) |
93 DEF_BENCH(return new BlurRoundRectBench(100, 100, 90);) | 93 DEF_BENCH(return new BlurRoundRectBench(100, 100, 90);) |
OLD | NEW |