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 "SkBlurMaskFilter.h" | 9 #include "SkBlurMaskFilter.h" |
10 #include "SkCanvas.h" | 10 #include "SkCanvas.h" |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 | 79 |
80 // TODO: add a color filter to better match what is seen in the wild | 80 // TODO: add a color filter to better match what is seen in the wild |
81 info.fPaintBits = /* SkLayerDrawLooper::kColorFilter_Bit |*/ | 81 info.fPaintBits = /* SkLayerDrawLooper::kColorFilter_Bit |*/ |
82 SkLayerDrawLooper::kMaskFilter_Bit; | 82 SkLayerDrawLooper::kMaskFilter_Bit; |
83 info.fColorMode = SkXfermode::kDst_Mode; | 83 info.fColorMode = SkXfermode::kDst_Mode; |
84 info.fOffset.set(xOff, 0); | 84 info.fOffset.set(xOff, 0); |
85 info.fPostTranslate = false; | 85 info.fPostTranslate = false; |
86 | 86 |
87 SkPaint* paint = looperBuilder.addLayer(info); | 87 SkPaint* paint = looperBuilder.addLayer(info); |
88 | 88 |
89 SkMaskFilter* mf = SkBlurMaskFilter::Create(kNormal_SkBlurStyle, | 89 paint->setMaskFilter(SkBlurMaskFilter::Make(kNormal_SkBlurStyle, sigma, |
90 sigma, | 90 SkBlurMaskFilter::kHighQuali
ty_BlurFlag)); |
91 SkBlurMaskFilter::kHighQuali
ty_BlurFlag); | |
92 paint->setMaskFilter(mf)->unref(); | |
93 | 91 |
94 //----------------------------------------------- | 92 //----------------------------------------------- |
95 info.fPaintBits = 0; | 93 info.fPaintBits = 0; |
96 info.fOffset.set(0, 0); | 94 info.fOffset.set(0, 0); |
97 | 95 |
98 paint = looperBuilder.addLayer(info); | 96 paint = looperBuilder.addLayer(info); |
99 return looperBuilder.detach(); | 97 return looperBuilder.detach(); |
100 } | 98 } |
101 | 99 |
102 typedef Benchmark INHERITED; | 100 typedef Benchmark INHERITED; |
103 }; | 101 }; |
104 | 102 |
105 DEF_BENCH(return new RectoriBench();) | 103 DEF_BENCH(return new RectoriBench();) |
OLD | NEW |