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 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
269 SkPaint p; | 269 SkPaint p; |
270 SkCanvas* temp = surface->getCanvas(); | 270 SkCanvas* temp = surface->getCanvas(); |
271 temp->clear(SK_ColorYELLOW); | 271 temp->clear(SK_ColorYELLOW); |
272 p.setColor(SK_ColorBLUE); | 272 p.setColor(SK_ColorBLUE); |
273 temp->drawRect(SkRect::MakeLTRB(5, 5, 10, 10), p); | 273 temp->drawRect(SkRect::MakeLTRB(5, 5, 10, 10), p); |
274 p.setColor(SK_ColorGREEN); | 274 p.setColor(SK_ColorGREEN); |
275 temp->drawRect(SkRect::MakeLTRB(5, 0, 10, 5), p); | 275 temp->drawRect(SkRect::MakeLTRB(5, 0, 10, 5), p); |
276 } | 276 } |
277 | 277 |
278 sk_sp<SkImage> image(surface->makeImageSnapshot()); | 278 sk_sp<SkImage> image(surface->makeImageSnapshot()); |
279 SkAutoTUnref<SkImageFilter> imageSource(SkImageSource::Create(image.get(
))); | 279 sk_sp<SkImageFilter> imageSource(SkImageSource::Make(std::move(image))); |
280 | 280 |
281 SkTArray<SkPaint> bmsPaints; | 281 SkTArray<SkPaint> bmsPaints; |
282 create_paints(imageSource, &bmsPaints); | 282 create_paints(imageSource.get(), &bmsPaints); |
283 | 283 |
284 //----------- | 284 //----------- |
285 SkASSERT(paints.count() == kNumVertTiles); | 285 SkASSERT(paints.count() == kNumVertTiles); |
286 SkASSERT(paints.count() == pifPaints.count()); | 286 SkASSERT(paints.count() == pifPaints.count()); |
287 SkASSERT(paints.count() == bmsPaints.count()); | 287 SkASSERT(paints.count() == bmsPaints.count()); |
288 | 288 |
289 // horizontal separators | 289 // horizontal separators |
290 for (int i = 1; i < paints.count(); ++i) { | 290 for (int i = 1; i < paints.count(); ++i) { |
291 canvas->drawLine(0, | 291 canvas->drawLine(0, |
292 i*SkIntToScalar(kTileHeight), | 292 i*SkIntToScalar(kTileHeight), |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 |