Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(265)

Side by Side Diff: gm/localmatriximagefilter.cpp

Issue 1852743002: Update SkBlurImageFilter to sk_sp (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Update to ToT & address code review comments Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « gm/imagefilterstransformed.cpp ('k') | gm/spritebitmap.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2015 Google Inc. 2 * Copyright 2015 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 "SkBlurImageFilter.h" 10 #include "SkBlurImageFilter.h"
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 58
59 paint.setStyle(SkPaint::kFill_Style); 59 paint.setStyle(SkPaint::kFill_Style);
60 paint.setImageFilter(filter); 60 paint.setImageFilter(filter);
61 canvas->drawImage(image, 0, 0, &paint); 61 canvas->drawImage(image, 0, 0, &paint);
62 } 62 }
63 63
64 void onDraw(SkCanvas* canvas) override { 64 void onDraw(SkCanvas* canvas) override {
65 sk_sp<SkImage> image0(make_image(canvas)); 65 sk_sp<SkImage> image0(make_image(canvas));
66 66
67 const ImageFilterFactory factories[] = { 67 const ImageFilterFactory factories[] = {
68 IFCCast([]{ return SkBlurImageFilter::Create(8, 8); }), 68 IFCCast([]{ return SkBlurImageFilter::Make(8, 8, nullptr).release(); }),
69 IFCCast([]{ return SkDilateImageFilter::Create(8, 8); }), 69 IFCCast([]{ return SkDilateImageFilter::Create(8, 8); }),
70 IFCCast([]{ return SkErodeImageFilter::Create(8, 8); }), 70 IFCCast([]{ return SkErodeImageFilter::Create(8, 8); }),
71 IFCCast([]{ return SkOffsetImageFilter::Make(8, 8, nullptr).release( ); }), 71 IFCCast([]{ return SkOffsetImageFilter::Make(8, 8, nullptr).release( ); }),
72 }; 72 };
73 73
74 const SkMatrix matrices[] = { 74 const SkMatrix matrices[] = {
75 SkMatrix::MakeScale(SK_ScalarHalf, SK_ScalarHalf), 75 SkMatrix::MakeScale(SK_ScalarHalf, SK_ScalarHalf),
76 SkMatrix::MakeScale(2, 2), 76 SkMatrix::MakeScale(2, 2),
77 SkMatrix::MakeTrans(10, 10) 77 SkMatrix::MakeTrans(10, 10)
78 }; 78 };
(...skipping 13 matching lines...) Expand all
92 } 92 }
93 canvas->restore(); 93 canvas->restore();
94 canvas->translate(0, spacer); 94 canvas->translate(0, spacer);
95 } 95 }
96 } 96 }
97 97
98 private: 98 private:
99 typedef GM INHERITED; 99 typedef GM INHERITED;
100 }; 100 };
101 DEF_GM( return new LocalMatrixImageFilterGM; ) 101 DEF_GM( return new LocalMatrixImageFilterGM; )
OLDNEW
« no previous file with comments | « gm/imagefilterstransformed.cpp ('k') | gm/spritebitmap.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698