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 "SkColorFilter.h" | 9 #include "SkColorFilter.h" |
10 | 10 |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 SkAutoTUnref<SkColorFilter> cf( | 126 SkAutoTUnref<SkColorFilter> cf( |
127 SkColorFilter::CreateModeFilter(SK_ColorMAGENTA, SkXfermode::kSrcIn_
Mode)); | 127 SkColorFilter::CreateModeFilter(SK_ColorMAGENTA, SkXfermode::kSrcIn_
Mode)); |
128 SkAutoTUnref<SkImageFilter> cfif(SkColorFilterImageFilter::Create(cf.get
())); | 128 SkAutoTUnref<SkImageFilter> cfif(SkColorFilterImageFilter::Create(cf.get
())); |
129 SkImageFilter::CropRect cropRect(SkRect::Make(SkIRect::MakeXYWH(10, 10,
44, 44)), | 129 SkImageFilter::CropRect cropRect(SkRect::Make(SkIRect::MakeXYWH(10, 10,
44, 44)), |
130 SkImageFilter::CropRect::kHasAll_CropEd
ge); | 130 SkImageFilter::CropRect::kHasAll_CropEd
ge); |
131 SkImageFilter::CropRect bogusRect(SkRect::Make(SkIRect::MakeXYWH(-100, -
100, 10, 10)), | 131 SkImageFilter::CropRect bogusRect(SkRect::Make(SkIRect::MakeXYWH(-100, -
100, 10, 10)), |
132 SkImageFilter::CropRect::kHasAll_CropE
dge); | 132 SkImageFilter::CropRect::kHasAll_CropE
dge); |
133 | 133 |
134 SkImageFilter* filters[] = { | 134 SkImageFilter* filters[] = { |
135 NULL, | 135 NULL, |
136 new SkDropShadowImageFilter(7.0f, 0.0f, 0.0f, 3.0f, SK_ColorBLUE), | 136 SkDropShadowImageFilter::Create(7.0f, 0.0f, 0.0f, 3.0f, SK_ColorBLUE
), |
137 new SkDropShadowImageFilter(0.0f, 7.0f, 3.0f, 0.0f, SK_ColorBLUE), | 137 SkDropShadowImageFilter::Create(0.0f, 7.0f, 3.0f, 0.0f, SK_ColorBLUE
), |
138 new SkDropShadowImageFilter(7.0f, 7.0f, 3.0f, 3.0f, SK_ColorBLUE), | 138 SkDropShadowImageFilter::Create(7.0f, 7.0f, 3.0f, 3.0f, SK_ColorBLUE
), |
139 new SkDropShadowImageFilter(7.0f, 7.0f, 3.0f, 3.0f, SK_ColorBLUE, cf
if), | 139 SkDropShadowImageFilter::Create(7.0f, 7.0f, 3.0f, 3.0f, SK_ColorBLUE
, cfif), |
140 new SkDropShadowImageFilter(7.0f, 7.0f, 3.0f, 3.0f, SK_ColorBLUE, NU
LL, &cropRect), | 140 SkDropShadowImageFilter::Create(7.0f, 7.0f, 3.0f, 3.0f, SK_ColorBLUE
, NULL, &cropRect), |
141 new SkDropShadowImageFilter(7.0f, 7.0f, 3.0f, 3.0f, SK_ColorBLUE, NU
LL, &bogusRect), | 141 SkDropShadowImageFilter::Create(7.0f, 7.0f, 3.0f, 3.0f, SK_ColorBLUE
, NULL, &bogusRect), |
142 }; | 142 }; |
143 | 143 |
144 SkRect r = SkRect::MakeWH(SkIntToScalar(64), SkIntToScalar(64)); | 144 SkRect r = SkRect::MakeWH(SkIntToScalar(64), SkIntToScalar(64)); |
145 SkScalar MARGIN = SkIntToScalar(16); | 145 SkScalar MARGIN = SkIntToScalar(16); |
146 SkScalar DX = r.width() + MARGIN; | 146 SkScalar DX = r.width() + MARGIN; |
147 SkScalar DY = r.height() + MARGIN; | 147 SkScalar DY = r.height() + MARGIN; |
148 | 148 |
149 canvas->translate(MARGIN, MARGIN); | 149 canvas->translate(MARGIN, MARGIN); |
150 for (size_t j = 0; j < SK_ARRAY_COUNT(drawProc); ++j) { | 150 for (size_t j = 0; j < SK_ARRAY_COUNT(drawProc); ++j) { |
151 canvas->save(); | 151 canvas->save(); |
(...skipping 11 matching lines...) Expand all Loading... |
163 } | 163 } |
164 | 164 |
165 private: | 165 private: |
166 typedef GM INHERITED; | 166 typedef GM INHERITED; |
167 }; | 167 }; |
168 | 168 |
169 /////////////////////////////////////////////////////////////////////////////// | 169 /////////////////////////////////////////////////////////////////////////////// |
170 | 170 |
171 static skiagm::GM* MyFactory(void*) { return new DropShadowImageFilterGM; } | 171 static skiagm::GM* MyFactory(void*) { return new DropShadowImageFilterGM; } |
172 static skiagm::GMRegistry reg(MyFactory); | 172 static skiagm::GMRegistry reg(MyFactory); |
OLD | NEW |