OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 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 "SkBlurImageFilter.h" | 9 #include "SkBlurImageFilter.h" |
10 #include "SkDropShadowImageFilter.h" | 10 #include "SkDropShadowImageFilter.h" |
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
291 canvas->drawLine(0, | 291 canvas->drawLine(0, |
292 i*SkIntToScalar(kTileHeight), | 292 i*SkIntToScalar(kTileHeight), |
293 SkIntToScalar((SK_ARRAY_COUNT(gDrawMthds) + kNumXtr
aCols)*kTileWidth), | 293 SkIntToScalar((SK_ARRAY_COUNT(gDrawMthds) + kNumXtr
aCols)*kTileWidth), |
294 i*SkIntToScalar(kTileHeight), | 294 i*SkIntToScalar(kTileHeight), |
295 blackFill); | 295 blackFill); |
296 } | 296 } |
297 // vertical separators | 297 // vertical separators |
298 for (int i = 0; i < (int)SK_ARRAY_COUNT(gDrawMthds) + kNumXtraCols; ++i)
{ | 298 for (int i = 0; i < (int)SK_ARRAY_COUNT(gDrawMthds) + kNumXtraCols; ++i)
{ |
299 canvas->drawLine(SkIntToScalar(i * kTileWidth), | 299 canvas->drawLine(SkIntToScalar(i * kTileWidth), |
300 0, | 300 0, |
301 SkIntToScalar(i * kTileWidth), | 301 SkIntToScalar(i * kTileWidth), |
302 SkIntToScalar(paints.count() * kTileWidth), | 302 SkIntToScalar(paints.count() * kTileWidth), |
303 blackFill); | 303 blackFill); |
304 } | 304 } |
305 | 305 |
306 // A column of saveLayers with PictureImageFilters | 306 // A column of saveLayers with PictureImageFilters |
307 for (int i = 0; i < pifPaints.count(); ++i) { | 307 for (int i = 0; i < pifPaints.count(); ++i) { |
308 draw_savelayer_with_paint(SkIPoint::Make(0, i*kTileHeight), | 308 draw_savelayer_with_paint(SkIPoint::Make(0, i*kTileHeight), |
309 canvas, pifPaints[i]); | 309 canvas, pifPaints[i]); |
310 } | 310 } |
311 | 311 |
312 // A column of saveLayers with BitmapSources | 312 // A column of saveLayers with BitmapSources |
313 for (int i = 0; i < pifPaints.count(); ++i) { | 313 for (int i = 0; i < pifPaints.count(); ++i) { |
314 draw_savelayer_with_paint(SkIPoint::Make(kTileWidth, i*kTileHeight), | 314 draw_savelayer_with_paint(SkIPoint::Make(kTileWidth, i*kTileHeight), |
315 canvas, bmsPaints[i]); | 315 canvas, bmsPaints[i]); |
316 } | 316 } |
317 | 317 |
318 // Multiple columns with different geometry | 318 // Multiple columns with different geometry |
319 for (int i = 0; i < (int)SK_ARRAY_COUNT(gDrawMthds); ++i) { | 319 for (int i = 0; i < (int)SK_ARRAY_COUNT(gDrawMthds); ++i) { |
320 for (int j = 0; j < paints.count(); ++j) { | 320 for (int j = 0; j < paints.count(); ++j) { |
321 draw_geom_with_paint(*gDrawMthds[i], | 321 draw_geom_with_paint(*gDrawMthds[i], |
322 SkIPoint::Make((i+kNumXtraCols) * kTileWidt
h, j*kTileHeight), | 322 SkIPoint::Make((i+kNumXtraCols) * kTileWidt
h, j*kTileHeight), |
323 canvas, paints[j]); | 323 canvas, paints[j]); |
324 } | 324 } |
325 } | 325 } |
326 | 326 |
327 } | 327 } |
328 | 328 |
329 private: | 329 private: |
330 typedef GM INHERITED; | 330 typedef GM INHERITED; |
331 }; | 331 }; |
332 | 332 |
333 ////////////////////////////////////////////////////////////////////////////// | 333 ////////////////////////////////////////////////////////////////////////////// |
334 | 334 |
335 DEF_GM(return new ImageFilterFastBoundGM;) | 335 DEF_GM(return new ImageFilterFastBoundGM;) |
336 } | 336 } |
OLD | NEW |