OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 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 "SkCanvas.h" | 9 #include "SkCanvas.h" |
10 #include "SkColorFilter.h" | 10 #include "SkColorFilter.h" |
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
224 }; | 224 }; |
225 | 225 |
226 SkColorFilter* cf = SkColorFilter::CreateModeFilter(SK_ColorRED, | 226 SkColorFilter* cf = SkColorFilter::CreateModeFilter(SK_ColorRED, |
227 SkXfermode::kSrcIn_Mode); | 227 SkXfermode::kSrcIn_Mode); |
228 SkImageFilter* filters[] = { | 228 SkImageFilter* filters[] = { |
229 NULL, | 229 NULL, |
230 IdentityImageFilter::Create(), | 230 IdentityImageFilter::Create(), |
231 FailImageFilter::Create(), | 231 FailImageFilter::Create(), |
232 SkColorFilterImageFilter::Create(cf), | 232 SkColorFilterImageFilter::Create(cf), |
233 SkBlurImageFilter::Create(12.0f, 0.0f), | 233 SkBlurImageFilter::Create(12.0f, 0.0f), |
234 SkDropShadowImageFilter::Create(10.0f, 5.0f, 3.0f, 3.0f, SK_ColorBLU
E), | 234 SkDropShadowImageFilter::Create(10.0f, 5.0f, 3.0f, 3.0f, SK_ColorBLU
E, |
| 235 SkDropShadowImageFilter::kDrawShadowAndForeground_ShadowMode), |
235 }; | 236 }; |
236 cf->unref(); | 237 cf->unref(); |
237 | 238 |
238 SkRect r = SkRect::MakeWH(SkIntToScalar(64), SkIntToScalar(64)); | 239 SkRect r = SkRect::MakeWH(SkIntToScalar(64), SkIntToScalar(64)); |
239 SkScalar MARGIN = SkIntToScalar(16); | 240 SkScalar MARGIN = SkIntToScalar(16); |
240 SkScalar DX = r.width() + MARGIN; | 241 SkScalar DX = r.width() + MARGIN; |
241 SkScalar DY = r.height() + MARGIN; | 242 SkScalar DY = r.height() + MARGIN; |
242 | 243 |
243 canvas->translate(MARGIN, MARGIN); | 244 canvas->translate(MARGIN, MARGIN); |
244 for (size_t i = 0; i < SK_ARRAY_COUNT(drawProc); ++i) { | 245 for (size_t i = 0; i < SK_ARRAY_COUNT(drawProc); ++i) { |
(...skipping 14 matching lines...) Expand all Loading... |
259 } | 260 } |
260 | 261 |
261 private: | 262 private: |
262 typedef GM INHERITED; | 263 typedef GM INHERITED; |
263 }; | 264 }; |
264 | 265 |
265 /////////////////////////////////////////////////////////////////////////////// | 266 /////////////////////////////////////////////////////////////////////////////// |
266 | 267 |
267 static skiagm::GM* MyFactory(void*) { return new ImageFiltersBaseGM; } | 268 static skiagm::GM* MyFactory(void*) { return new ImageFiltersBaseGM; } |
268 static skiagm::GMRegistry reg(MyFactory); | 269 static skiagm::GMRegistry reg(MyFactory); |
OLD | NEW |