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 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 }; | 191 }; |
192 | 192 |
193 SkColorFilter* cf = SkColorFilter::CreateModeFilter(SK_ColorRED, | 193 SkColorFilter* cf = SkColorFilter::CreateModeFilter(SK_ColorRED, |
194 SkXfermode::kSrcIn_Mode); | 194 SkXfermode::kSrcIn_Mode); |
195 SkImageFilter* filters[] = { | 195 SkImageFilter* filters[] = { |
196 NULL, | 196 NULL, |
197 IdentityImageFilter::Create(), | 197 IdentityImageFilter::Create(), |
198 FailImageFilter::Create(), | 198 FailImageFilter::Create(), |
199 SkColorFilterImageFilter::Create(cf), | 199 SkColorFilterImageFilter::Create(cf), |
200 SkBlurImageFilter::Create(12.0f, 0.0f), | 200 SkBlurImageFilter::Create(12.0f, 0.0f), |
201 SkDropShadowImageFilter::Create(10.0f, 5.0f, 3.0f, SK_ColorBLUE), | 201 SkDropShadowImageFilter::Create(10.0f, 5.0f, 3.0f, 3.0f, SK_ColorBLU
E), |
202 }; | 202 }; |
203 cf->unref(); | 203 cf->unref(); |
204 | 204 |
205 SkRect r = SkRect::MakeWH(SkIntToScalar(64), SkIntToScalar(64)); | 205 SkRect r = SkRect::MakeWH(SkIntToScalar(64), SkIntToScalar(64)); |
206 SkScalar MARGIN = SkIntToScalar(16); | 206 SkScalar MARGIN = SkIntToScalar(16); |
207 SkScalar DX = r.width() + MARGIN; | 207 SkScalar DX = r.width() + MARGIN; |
208 SkScalar DY = r.height() + MARGIN; | 208 SkScalar DY = r.height() + MARGIN; |
209 | 209 |
210 canvas->translate(MARGIN, MARGIN); | 210 canvas->translate(MARGIN, MARGIN); |
211 for (size_t i = 0; i < SK_ARRAY_COUNT(drawProc); ++i) { | 211 for (size_t i = 0; i < SK_ARRAY_COUNT(drawProc); ++i) { |
(...skipping 14 matching lines...) Expand all Loading... |
226 } | 226 } |
227 | 227 |
228 private: | 228 private: |
229 typedef GM INHERITED; | 229 typedef GM INHERITED; |
230 }; | 230 }; |
231 | 231 |
232 /////////////////////////////////////////////////////////////////////////////// | 232 /////////////////////////////////////////////////////////////////////////////// |
233 | 233 |
234 static skiagm::GM* MyFactory(void*) { return new ImageFiltersBaseGM; } | 234 static skiagm::GM* MyFactory(void*) { return new ImageFiltersBaseGM; } |
235 static skiagm::GMRegistry reg(MyFactory); | 235 static skiagm::GMRegistry reg(MyFactory); |
OLD | NEW |