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

Side by Side Diff: gm/imagealphathreshold.cpp

Issue 1847053004: Update SkAlphaThresholdFilter to sk_sp (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix sample app 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 | « no previous file | include/effects/SkAlphaThresholdFilter.h » ('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 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 "SkAlphaThresholdFilter.h" 9 #include "SkAlphaThresholdFilter.h"
10 #include "SkRandom.h" 10 #include "SkRandom.h"
(...skipping 17 matching lines...) Expand all
28 } 28 }
29 29
30 SkPaint create_filter_paint() { 30 SkPaint create_filter_paint() {
31 SkIRect rects[2]; 31 SkIRect rects[2];
32 rects[0] = SkIRect::MakeXYWH(0, 150, WIDTH, HEIGHT - 300); 32 rects[0] = SkIRect::MakeXYWH(0, 150, WIDTH, HEIGHT - 300);
33 rects[1] = SkIRect::MakeXYWH(150, 0, WIDTH - 300, HEIGHT); 33 rects[1] = SkIRect::MakeXYWH(150, 0, WIDTH - 300, HEIGHT);
34 SkRegion region; 34 SkRegion region;
35 region.setRects(rects, 2); 35 region.setRects(rects, 2);
36 36
37 SkPaint paint; 37 SkPaint paint;
38 paint.setImageFilter(SkAlphaThresholdFilter::Create(region, 0.2f, 0.7f))->un ref(); 38 paint.setImageFilter(SkAlphaThresholdFilter::Make(region, 0.2f, 0.7f, nullpt r));
39 return paint; 39 return paint;
40 } 40 }
41 41
42 }; 42 };
43 43
44 namespace skiagm { 44 namespace skiagm {
45 45
46 class ImageAlphaThresholdGM : public GM { 46 class ImageAlphaThresholdGM : public GM {
47 public: 47 public:
48 ImageAlphaThresholdGM() { 48 ImageAlphaThresholdGM() {
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 private: 110 private:
111 typedef GM INHERITED; 111 typedef GM INHERITED;
112 }; 112 };
113 113
114 ////////////////////////////////////////////////////////////////////////////// 114 //////////////////////////////////////////////////////////////////////////////
115 115
116 DEF_GM(return new ImageAlphaThresholdGM();) 116 DEF_GM(return new ImageAlphaThresholdGM();)
117 DEF_GM(return new ImageAlphaThresholdSurfaceGM();) 117 DEF_GM(return new ImageAlphaThresholdSurfaceGM();)
118 118
119 } 119 }
OLDNEW
« no previous file with comments | « no previous file | include/effects/SkAlphaThresholdFilter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698