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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 | SkLayerDrawLooper::kColorFilter_Bit; | 47 | SkLayerDrawLooper::kColorFilter_Bit; |
48 info.fColorMode = SkXfermode::kSrc_Mode; | 48 info.fColorMode = SkXfermode::kSrc_Mode; |
49 info.fOffset = SkPoint::Make(SkIntToScalar(-1), SkIntToScalar(0)); | 49 info.fOffset = SkPoint::Make(SkIntToScalar(-1), SkIntToScalar(0)); |
50 info.fPostTranslate = false; | 50 info.fPostTranslate = false; |
51 SkPaint* paint = looperBuilder.addLayerOnTop(info); | 51 SkPaint* paint = looperBuilder.addLayerOnTop(info); |
52 SkMaskFilter* maskFilter = SkBlurMaskFilter::Create( | 52 SkMaskFilter* maskFilter = SkBlurMaskFilter::Create( |
53 kNormal_SkBlurStyle, | 53 kNormal_SkBlurStyle, |
54 SkBlurMask::ConvertRadiusToSigma(SK_ScalarHalf), | 54 SkBlurMask::ConvertRadiusToSigma(SK_ScalarHalf), |
55 SkBlurMaskFilter::kHighQuality_BlurFlag); | 55 SkBlurMaskFilter::kHighQuality_BlurFlag); |
56 paint->setMaskFilter(maskFilter)->unref(); | 56 paint->setMaskFilter(maskFilter)->unref(); |
57 SkColorFilter* colorFilter = SkColorFilter::CreateModeFilter(SK_Colo
rLTGRAY, | 57 paint->setColorFilter(SkColorFilter::MakeModeFilter(SK_ColorLTGRAY, |
58 SkXfermode::kSrcIn_Mode); | 58 SkXfermode::kSrc
In_Mode)); |
59 paint->setColorFilter(colorFilter)->unref(); | |
60 paint->setColor(SK_ColorGRAY); | 59 paint->setColor(SK_ColorGRAY); |
61 } | 60 } |
62 { | 61 { |
63 SkLayerDrawLooper::LayerInfo info; | 62 SkLayerDrawLooper::LayerInfo info; |
64 looperBuilder.addLayerOnTop(info); | 63 looperBuilder.addLayerOnTop(info); |
65 } | 64 } |
66 SkPaint dullPaint; | 65 SkPaint dullPaint; |
67 dullPaint.setAntiAlias(true); | 66 dullPaint.setAntiAlias(true); |
68 | 67 |
69 SkPaint loopedPaint; | 68 SkPaint loopedPaint; |
(...skipping 14 matching lines...) Expand all Loading... |
84 typedef Benchmark INHERITED; | 83 typedef Benchmark INHERITED; |
85 }; | 84 }; |
86 | 85 |
87 // Create one with dimensions/rounded corners based on the skp | 86 // Create one with dimensions/rounded corners based on the skp |
88 DEF_BENCH(return new BlurRoundRectBench(600, 5514, 6);) | 87 DEF_BENCH(return new BlurRoundRectBench(600, 5514, 6);) |
89 // Same radii, much smaller rectangle | 88 // Same radii, much smaller rectangle |
90 DEF_BENCH(return new BlurRoundRectBench(100, 100, 6);) | 89 DEF_BENCH(return new BlurRoundRectBench(100, 100, 6);) |
91 // Other radii options | 90 // Other radii options |
92 DEF_BENCH(return new BlurRoundRectBench(100, 100, 30);) | 91 DEF_BENCH(return new BlurRoundRectBench(100, 100, 30);) |
93 DEF_BENCH(return new BlurRoundRectBench(100, 100, 90);) | 92 DEF_BENCH(return new BlurRoundRectBench(100, 100, 90);) |
OLD | NEW |