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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 | SkLayerDrawLooper::kColorFilter_Bit; | 59 | SkLayerDrawLooper::kColorFilter_Bit; |
60 info.fColorMode = SkXfermode::kSrc_Mode; | 60 info.fColorMode = SkXfermode::kSrc_Mode; |
61 info.fOffset = SkPoint::Make(SkIntToScalar(-1), SkIntToScalar(0)); | 61 info.fOffset = SkPoint::Make(SkIntToScalar(-1), SkIntToScalar(0)); |
62 info.fPostTranslate = false; | 62 info.fPostTranslate = false; |
63 SkPaint* paint = looperBuilder.addLayerOnTop(info); | 63 SkPaint* paint = looperBuilder.addLayerOnTop(info); |
64 SkMaskFilter* maskFilter = SkBlurMaskFilter::Create( | 64 SkMaskFilter* maskFilter = SkBlurMaskFilter::Create( |
65 kNormal_SkBlurStyle, | 65 kNormal_SkBlurStyle, |
66 SkBlurMask::ConvertRadiusToSigma(SK_ScalarHalf), | 66 SkBlurMask::ConvertRadiusToSigma(SK_ScalarHalf), |
67 SkBlurMaskFilter::kHighQuality_BlurFlag); | 67 SkBlurMaskFilter::kHighQuality_BlurFlag); |
68 paint->setMaskFilter(maskFilter)->unref(); | 68 paint->setMaskFilter(maskFilter)->unref(); |
69 SkColorFilter* colorFilter = SkColorFilter::CreateModeFilter(SK_Colo
rLTGRAY, | 69 SkColorFilter* colorFilter = SkColorFilter::CreateModeFilter( |
| 70 sk_tool_utils::color_to_565(SK_ColorLTGRAY), |
70 SkXfermode::kSrcIn_Mode); | 71 SkXfermode::kSrcIn_Mode); |
71 paint->setColorFilter(colorFilter)->unref(); | 72 paint->setColorFilter(colorFilter)->unref(); |
72 paint->setColor(SK_ColorGRAY); | 73 paint->setColor(sk_tool_utils::color_to_565(SK_ColorGRAY)); |
73 } | 74 } |
74 { | 75 { |
75 SkLayerDrawLooper::LayerInfo info; | 76 SkLayerDrawLooper::LayerInfo info; |
76 looperBuilder.addLayerOnTop(info); | 77 looperBuilder.addLayerOnTop(info); |
77 } | 78 } |
78 SkPaint paint; | 79 SkPaint paint; |
79 canvas->drawRect(fRRect.rect(), paint); | 80 canvas->drawRect(fRRect.rect(), paint); |
80 | 81 |
81 paint.setLooper(looperBuilder.detachLooper())->unref(); | 82 paint.setLooper(looperBuilder.detachLooper())->unref(); |
82 paint.setColor(SK_ColorCYAN); | 83 paint.setColor(SK_ColorCYAN); |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 // TODO(scroggo): Disabled in an attempt to rememdy | 181 // TODO(scroggo): Disabled in an attempt to rememdy |
181 // https://code.google.com/p/skia/issues/detail?id=1801 ('Win7 Test bots all fai
ling GenerateGMs: | 182 // https://code.google.com/p/skia/issues/detail?id=1801 ('Win7 Test bots all fai
ling GenerateGMs: |
182 // ran wrong number of tests') | 183 // ran wrong number of tests') |
183 //DEF_GM(return new BlurRoundRectGM(600, 5514, 6);) | 184 //DEF_GM(return new BlurRoundRectGM(600, 5514, 6);) |
184 | 185 |
185 // Rounded rect with two opposite corners with large radii, the other two | 186 // Rounded rect with two opposite corners with large radii, the other two |
186 // small. | 187 // small. |
187 DEF_GM(return new BlurRoundRectGM(100, 100);) | 188 DEF_GM(return new BlurRoundRectGM(100, 100);) |
188 | 189 |
189 DEF_GM(return new SimpleBlurRoundRectGM();) | 190 DEF_GM(return new SimpleBlurRoundRectGM();) |
OLD | NEW |