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

Side by Side Diff: gm/imagefiltersclipped.cpp

Issue 1842793002: Switch SkLocalMatrixImageFilter and SkPaintImageFilter over to sk_sp (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Ooops 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 | gm/imagefiltersscaled.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 "sk_tool_utils.h" 8 #include "sk_tool_utils.h"
9 #include "SkBlurImageFilter.h" 9 #include "SkBlurImageFilter.h"
10 #include "SkColor.h" 10 #include "SkColor.h"
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 canvas->translate(0, r.height() + margin); 131 canvas->translate(0, r.height() + margin);
132 } 132 }
133 canvas->restore(); 133 canvas->restore();
134 134
135 for (size_t i = 0; i < SK_ARRAY_COUNT(filters); ++i) { 135 for (size_t i = 0; i < SK_ARRAY_COUNT(filters); ++i) {
136 SkSafeUnref(filters[i]); 136 SkSafeUnref(filters[i]);
137 } 137 }
138 138
139 SkPaint noisePaint; 139 SkPaint noisePaint;
140 noisePaint.setShader(noise); 140 noisePaint.setShader(noise);
141 SkAutoTUnref<SkImageFilter> rectFilter(SkPaintImageFilter::Create(noiseP aint)); 141 sk_sp<SkImageFilter> rectFilter(SkPaintImageFilter::Make(noisePaint));
142 canvas->translate(SK_ARRAY_COUNT(filters)*(r.width() + margin), 0); 142 canvas->translate(SK_ARRAY_COUNT(filters)*(r.width() + margin), 0);
143 for (int xOffset = 0; xOffset < 80; xOffset += 16) { 143 for (int xOffset = 0; xOffset < 80; xOffset += 16) {
144 bounds.fLeft = SkIntToScalar(xOffset); 144 bounds.fLeft = SkIntToScalar(xOffset);
145 draw_clipped_filter(canvas, rectFilter, 0, r, bounds); 145 draw_clipped_filter(canvas, rectFilter.get(), 0, r, bounds);
146 canvas->translate(0, r.height() + margin); 146 canvas->translate(0, r.height() + margin);
147 } 147 }
148 } 148 }
149 149
150 private: 150 private:
151 sk_sp<SkImage> fCheckerboard, fGradientCircle; 151 sk_sp<SkImage> fCheckerboard, fGradientCircle;
152 152
153 typedef GM INHERITED; 153 typedef GM INHERITED;
154 }; 154 };
155 155
156 ////////////////////////////////////////////////////////////////////////////// 156 //////////////////////////////////////////////////////////////////////////////
157 157
158 DEF_GM(return new ImageFiltersClippedGM;) 158 DEF_GM(return new ImageFiltersClippedGM;)
159 } 159 }
OLDNEW
« no previous file with comments | « no previous file | gm/imagefiltersscaled.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698