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 "gm.h" | 8 #include "gm.h" |
9 #include "SkBlurMask.h" | 9 #include "SkBlurMask.h" |
10 #include "SkBlurMaskFilter.h" | 10 #include "SkBlurMaskFilter.h" |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 | SkLayerDrawLooper::kColorFilter_Bit; | 53 | SkLayerDrawLooper::kColorFilter_Bit; |
54 info.fColorMode = SkXfermode::kSrc_Mode; | 54 info.fColorMode = SkXfermode::kSrc_Mode; |
55 info.fOffset = SkPoint::Make(SkIntToScalar(-1), SkIntToScalar(0)); | 55 info.fOffset = SkPoint::Make(SkIntToScalar(-1), SkIntToScalar(0)); |
56 info.fPostTranslate = false; | 56 info.fPostTranslate = false; |
57 SkPaint* paint = looperBuilder.addLayerOnTop(info); | 57 SkPaint* paint = looperBuilder.addLayerOnTop(info); |
58 SkMaskFilter* maskFilter = SkBlurMaskFilter::Create( | 58 SkMaskFilter* maskFilter = SkBlurMaskFilter::Create( |
59 kNormal_SkBlurStyle, | 59 kNormal_SkBlurStyle, |
60 SkBlurMask::ConvertRadiusToSigma(SK_ScalarHalf), | 60 SkBlurMask::ConvertRadiusToSigma(SK_ScalarHalf), |
61 SkBlurMaskFilter::kHighQuality_BlurFlag); | 61 SkBlurMaskFilter::kHighQuality_BlurFlag); |
62 paint->setMaskFilter(maskFilter)->unref(); | 62 paint->setMaskFilter(maskFilter)->unref(); |
63 paint->setColorFilter(SkColorFilter::MakeModeFilter( | 63 SkColorFilter* colorFilter = SkColorFilter::CreateModeFilter( |
64 sk_tool_utils::color_to_565(SK_ColorLTGRAY), | 64 sk_tool_utils::color_to_565(SK_ColorLTGRAY), |
65 SkXfermode::kSrcIn_Mode)); | 65 SkXfermode::kSrcIn_Mode); |
| 66 paint->setColorFilter(colorFilter)->unref(); |
66 paint->setColor(sk_tool_utils::color_to_565(SK_ColorGRAY)); | 67 paint->setColor(sk_tool_utils::color_to_565(SK_ColorGRAY)); |
67 } | 68 } |
68 { | 69 { |
69 SkLayerDrawLooper::LayerInfo info; | 70 SkLayerDrawLooper::LayerInfo info; |
70 looperBuilder.addLayerOnTop(info); | 71 looperBuilder.addLayerOnTop(info); |
71 } | 72 } |
72 SkPaint paint; | 73 SkPaint paint; |
73 canvas->drawRect(fRRect.rect(), paint); | 74 canvas->drawRect(fRRect.rect(), paint); |
74 | 75 |
75 paint.setLooper(looperBuilder.detach()); | 76 paint.setLooper(looperBuilder.detach()); |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 // TODO(scroggo): Disabled in an attempt to rememdy | 176 // TODO(scroggo): Disabled in an attempt to rememdy |
176 // https://code.google.com/p/skia/issues/detail?id=1801 ('Win7 Test bots all fai
ling GenerateGMs: | 177 // https://code.google.com/p/skia/issues/detail?id=1801 ('Win7 Test bots all fai
ling GenerateGMs: |
177 // ran wrong number of tests') | 178 // ran wrong number of tests') |
178 //DEF_GM(return new BlurRoundRectGM(600, 5514, 6);) | 179 //DEF_GM(return new BlurRoundRectGM(600, 5514, 6);) |
179 | 180 |
180 // Rounded rect with two opposite corners with large radii, the other two | 181 // Rounded rect with two opposite corners with large radii, the other two |
181 // small. | 182 // small. |
182 DEF_GM(return new BlurRoundRectGM(100, 100);) | 183 DEF_GM(return new BlurRoundRectGM(100, 100);) |
183 | 184 |
184 DEF_GM(return new SimpleBlurRoundRectGM();) | 185 DEF_GM(return new SimpleBlurRoundRectGM();) |
OLD | NEW |