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 "SkBlurDrawLooper.h" | 9 #include "SkBlurDrawLooper.h" |
10 #include "SkBlurMask.h" | 10 #include "SkBlurMask.h" |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 | 43 |
44 { | 44 { |
45 // AA | 45 // AA |
46 SkPaint p; | 46 SkPaint p; |
47 p.setColor(SK_ColorWHITE); | 47 p.setColor(SK_ColorWHITE); |
48 p.setAntiAlias(true); | 48 p.setAntiAlias(true); |
49 fPaints.push_back(p); | 49 fPaints.push_back(p); |
50 } | 50 } |
51 | 51 |
52 { | 52 { |
| 53 // AA with translucent |
| 54 SkPaint p; |
| 55 p.setColor(SK_ColorWHITE); |
| 56 p.setAntiAlias(true); |
| 57 p.setAlpha(0x66); |
| 58 fPaints.push_back(p); |
| 59 } |
| 60 |
| 61 { |
53 // AA with mask filter | 62 // AA with mask filter |
54 SkPaint p; | 63 SkPaint p; |
55 p.setColor(SK_ColorWHITE); | 64 p.setColor(SK_ColorWHITE); |
56 p.setAntiAlias(true); | 65 p.setAntiAlias(true); |
57 SkMaskFilter* mf = SkBlurMaskFilter::Create( | 66 SkMaskFilter* mf = SkBlurMaskFilter::Create( |
58 SkBlurMaskFilter::kNormal_BlurStyle, | 67 SkBlurMaskFilter::kNormal_BlurStyle, |
59 SkBlurMask::ConvertRadiusToSigma(SkIntToScala
r(5)), | 68 SkBlurMask::ConvertRadiusToSigma(SkIntToScala
r(5)), |
60 SkBlurMaskFilter::kHighQuality_BlurFlag); | 69 SkBlurMaskFilter::kHighQuality_BlurFlag); |
61 p.setMaskFilter(mf)->unref(); | 70 p.setMaskFilter(mf)->unref(); |
62 fPaints.push_back(p); | 71 fPaints.push_back(p); |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 // AA with stroke style | 110 // AA with stroke style |
102 SkPaint p; | 111 SkPaint p; |
103 p.setColor(SK_ColorWHITE); | 112 p.setColor(SK_ColorWHITE); |
104 p.setAntiAlias(true); | 113 p.setAntiAlias(true); |
105 p.setStyle(SkPaint::kStroke_Style); | 114 p.setStyle(SkPaint::kStroke_Style); |
106 p.setStrokeWidth(SkIntToScalar(3)); | 115 p.setStrokeWidth(SkIntToScalar(3)); |
107 fPaints.push_back(p); | 116 fPaints.push_back(p); |
108 } | 117 } |
109 | 118 |
110 { | 119 { |
| 120 // AA with bevel-stroke style |
| 121 SkPaint p; |
| 122 p.setColor(SK_ColorWHITE); |
| 123 p.setAntiAlias(true); |
| 124 p.setStyle(SkPaint::kStroke_Style); |
| 125 p.setStrokeJoin(SkPaint::kBevel_Join); |
| 126 p.setStrokeWidth(SkIntToScalar(3)); |
| 127 fPaints.push_back(p); |
| 128 } |
| 129 |
| 130 { |
| 131 // AA with round-stroke style |
| 132 SkPaint p; |
| 133 p.setColor(SK_ColorWHITE); |
| 134 p.setAntiAlias(true); |
| 135 p.setStyle(SkPaint::kStroke_Style); |
| 136 p.setStrokeJoin(SkPaint::kRound_Join); |
| 137 p.setStrokeWidth(SkIntToScalar(3)); |
| 138 fPaints.push_back(p); |
| 139 } |
| 140 |
| 141 { |
111 // AA with stroke style, width = 0 | 142 // AA with stroke style, width = 0 |
112 SkPaint p; | 143 SkPaint p; |
113 p.setColor(SK_ColorWHITE); | 144 p.setColor(SK_ColorWHITE); |
114 p.setAntiAlias(true); | 145 p.setAntiAlias(true); |
115 p.setStyle(SkPaint::kStroke_Style); | 146 p.setStyle(SkPaint::kStroke_Style); |
116 fPaints.push_back(p); | 147 fPaints.push_back(p); |
117 } | 148 } |
118 | 149 |
119 { | 150 { |
| 151 // AA with stroke style, width wider than rect width and/or height |
| 152 SkPaint p; |
| 153 p.setColor(SK_ColorWHITE); |
| 154 p.setAntiAlias(true); |
| 155 p.setStyle(SkPaint::kStroke_Style); |
| 156 p.setStrokeWidth(SkIntToScalar(40)); |
| 157 fPaints.push_back(p); |
| 158 } |
| 159 |
| 160 { |
120 // AA with stroke and fill style | 161 // AA with stroke and fill style |
121 SkPaint p; | 162 SkPaint p; |
122 p.setColor(SK_ColorWHITE); | 163 p.setColor(SK_ColorWHITE); |
123 p.setAntiAlias(true); | 164 p.setAntiAlias(true); |
124 p.setStyle(SkPaint::kStrokeAndFill_Style); | 165 p.setStyle(SkPaint::kStrokeAndFill_Style); |
125 p.setStrokeWidth(SkIntToScalar(2)); | 166 p.setStrokeWidth(SkIntToScalar(2)); |
126 fPaints.push_back(p); | 167 fPaints.push_back(p); |
127 } | 168 } |
128 } | 169 } |
129 | 170 |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
251 | 292 |
252 typedef GM INHERITED; | 293 typedef GM INHERITED; |
253 }; | 294 }; |
254 | 295 |
255 ////////////////////////////////////////////////////////////////////////////// | 296 ////////////////////////////////////////////////////////////////////////////// |
256 | 297 |
257 static GM* MyFactory(void*) { return new RectsGM; } | 298 static GM* MyFactory(void*) { return new RectsGM; } |
258 static GMRegistry reg(MyFactory); | 299 static GMRegistry reg(MyFactory); |
259 | 300 |
260 } | 301 } |
OLD | NEW |