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

Side by Side Diff: gm/colorfilterimagefilter.cpp

Issue 1782703002: sk_sp versions of newWithColorFilter and newWithLocalMatrix (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 9 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/perlinnoise.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 2012 Google Inc. 2 * Copyright 2012 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 "SkColorMatrixFilter.h" 10 #include "SkColorMatrixFilter.h"
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 SkRect r = SkRect::MakeWH(120, 120); 205 SkRect r = SkRect::MakeWH(120, 120);
206 206
207 canvas->translate(20, 20); 207 canvas->translate(20, 20);
208 for (int y = 0; y < shaders.count(); ++y) { 208 for (int y = 0; y < shaders.count(); ++y) {
209 SkShader* shader = shaders[y]; 209 SkShader* shader = shaders[y];
210 210
211 canvas->save(); 211 canvas->save();
212 for (int x = -1; x < filters.count(); ++x) { 212 for (int x = -1; x < filters.count(); ++x) {
213 SkColorFilter* filter = x >= 0 ? filters[x] : nullptr; 213 SkColorFilter* filter = x >= 0 ? filters[x] : nullptr;
214 214
215 paint.setShader(shader->newWithColorFilter(filter))->unref(); 215 paint.setShader(shader->makeWithColorFilter(filter));
216 canvas->drawRect(r, paint); 216 canvas->drawRect(r, paint);
217 canvas->translate(150, 0); 217 canvas->translate(150, 0);
218 } 218 }
219 canvas->restore(); 219 canvas->restore();
220 canvas->translate(0, 150); 220 canvas->translate(0, 150);
221 } 221 }
222 } 222 }
OLDNEW
« no previous file with comments | « no previous file | gm/perlinnoise.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698