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 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
249 sk_sp<SkPicture> pic; | 249 sk_sp<SkPicture> pic; |
250 | 250 |
251 { | 251 { |
252 SkPictureRecorder rec; | 252 SkPictureRecorder rec; |
253 | 253 |
254 SkCanvas* c = rec.beginRecording(10, 10); | 254 SkCanvas* c = rec.beginRecording(10, 10); |
255 c->drawRect(SkRect::MakeWH(10, 10), blackFill); | 255 c->drawRect(SkRect::MakeWH(10, 10), blackFill); |
256 pic = rec.finishRecordingAsPicture(); | 256 pic = rec.finishRecordingAsPicture(); |
257 } | 257 } |
258 | 258 |
259 SkAutoTUnref<SkImageFilter> pif(SkPictureImageFilter::Create(pic.get()))
; | 259 sk_sp<SkImageFilter> pif(SkPictureImageFilter::Make(pic)); |
260 | 260 |
261 SkTArray<SkPaint> pifPaints; | 261 SkTArray<SkPaint> pifPaints; |
262 create_paints(pif, &pifPaints); | 262 create_paints(pif.get(), &pifPaints); |
263 | 263 |
264 //----------- | 264 //----------- |
265 // Paints with a SkImageSource as a source | 265 // Paints with a SkImageSource as a source |
266 | 266 |
267 auto surface(SkSurface::MakeRasterN32Premul(10, 10)); | 267 auto surface(SkSurface::MakeRasterN32Premul(10, 10)); |
268 { | 268 { |
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); |
(...skipping 54 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 |