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

Side by Side Diff: gm/imagefilterscropexpand.cpp

Issue 1858813002: Update SkColorFilterImageFilter to sk_sp (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: update to ToT 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/imagefiltersbase.cpp ('k') | gm/imagefilterscropped.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 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 "SkCanvas.h" 9 #include "SkCanvas.h"
10 #include "SkColorFilter.h" 10 #include "SkColorFilter.h"
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 68
69 SkPaint paint; 69 SkPaint paint;
70 canvas->translate(MARGIN, MARGIN); 70 canvas->translate(MARGIN, MARGIN);
71 for (int outset = -15; outset <= 20; outset += 5) { 71 for (int outset = -15; outset <= 20; outset += 5) {
72 canvas->save(); 72 canvas->save();
73 SkRect rect = cropRect.rect(); 73 SkRect rect = cropRect.rect();
74 rect.outset(SkIntToScalar(outset), 74 rect.outset(SkIntToScalar(outset),
75 SkIntToScalar(outset)); 75 SkIntToScalar(outset));
76 SkImageFilter::CropRect bigRect(rect, SkImageFilter::CropRect::kHasA ll_CropEdge); 76 SkImageFilter::CropRect bigRect(rect, SkImageFilter::CropRect::kHasA ll_CropEdge);
77 77
78 Draw(canvas, checkerboard, rect, 78 Draw(canvas, checkerboard, rect, SkColorFilterImageFilter::Make(cfAl phaTrans,
79 sk_sp<SkImageFilter>(SkColorFilterImageFilter::Create(cfAlphaTr ans.get(), 79 noop Cropped,
80 noopCropp ed.get(), 80 &big Rect));
81 &bigRect) ));
82 81
83 Draw(canvas, checkerboard, rect, SkBlurImageFilter::Make(0.3f, 0.3f, 82 Draw(canvas, checkerboard, rect, SkBlurImageFilter::Make(0.3f, 0.3f,
84 noopCropped , 83 noopCropped ,
85 &bigRect)); 84 &bigRect));
86 85
87 Draw(canvas, checkerboard, rect, SkBlurImageFilter::Make(8.0f, 8.0f, 86 Draw(canvas, checkerboard, rect, SkBlurImageFilter::Make(8.0f, 8.0f,
88 noopCropped , 87 noopCropped ,
89 &bigRect)); 88 &bigRect));
90 89
91 Draw(canvas, checkerboard, rect, SkDilateImageFilter::Make(2, 2, 90 Draw(canvas, checkerboard, rect, SkDilateImageFilter::Make(2, 2,
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 188
190 canvas->translate(SkIntToScalar(80), 0); 189 canvas->translate(SkIntToScalar(80), 0);
191 } 190 }
192 191
193 typedef GM INHERITED; 192 typedef GM INHERITED;
194 }; 193 };
195 194
196 /////////////////////////////////////////////////////////////////////////////// 195 ///////////////////////////////////////////////////////////////////////////////
197 196
198 DEF_GM( return new ImageFiltersCropExpandGM; ) 197 DEF_GM( return new ImageFiltersCropExpandGM; )
OLDNEW
« no previous file with comments | « gm/imagefiltersbase.cpp ('k') | gm/imagefilterscropped.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698