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

Side by Side Diff: samplecode/SamplePatch.cpp

Issue 1553743002: change factory to method, to parallel pattern in imagefilters (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 11 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 | « include/core/SkShader.h ('k') | src/core/SkLocalMatrixShader.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 2011 Google Inc. 2 * Copyright 2011 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 "SampleCode.h" 8 #include "SampleCode.h"
9 #include "SkAnimTimer.h" 9 #include "SkAnimTimer.h"
10 #include "SkView.h" 10 #include "SkView.h"
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after
299 paint.setStrokeWidth(SkIntToScalar(5)); 299 paint.setStrokeWidth(SkIntToScalar(5));
300 canvas->drawPoints(SkCanvas::kPoints_PointMode, SK_ARRAY_COUNT(fPts), fP ts, paint); 300 canvas->drawPoints(SkCanvas::kPoints_PointMode, SK_ARRAY_COUNT(fPts), fP ts, paint);
301 301
302 canvas->translate(0, SkIntToScalar(300)); 302 canvas->translate(0, SkIntToScalar(300));
303 303
304 paint.setAntiAlias(false); 304 paint.setAntiAlias(false);
305 paint.setShader(fShader1); 305 paint.setShader(fShader1);
306 if (true) { 306 if (true) {
307 SkMatrix m; 307 SkMatrix m;
308 m.setSkew(1, 0); 308 m.setSkew(1, 0);
309 SkShader* s = SkShader::CreateLocalMatrixShader(paint.getShader(), m ); 309 SkShader* s = paint.getShader()->newWithLocalMatrix(m);
310 paint.setShader(s)->unref(); 310 paint.setShader(s)->unref();
311 } 311 }
312 if (true) { 312 if (true) {
313 SkMatrix m; 313 SkMatrix m;
314 m.setRotate(fAngle); 314 m.setRotate(fAngle);
315 SkShader* s = SkShader::CreateLocalMatrixShader(paint.getShader(), m ); 315 SkShader* s = paint.getShader()->newWithLocalMatrix(m);
316 paint.setShader(s)->unref(); 316 paint.setShader(s)->unref();
317 } 317 }
318 patch.setBounds(fSize1.fX, fSize1.fY); 318 patch.setBounds(fSize1.fX, fSize1.fY);
319 drawpatches(canvas, paint, nu, nv, &patch); 319 drawpatches(canvas, paint, nu, nv, &patch);
320 } 320 }
321 321
322 bool onAnimate(const SkAnimTimer& timer) override { 322 bool onAnimate(const SkAnimTimer& timer) override {
323 fAngle = timer.scaled(60, 360); 323 fAngle = timer.scaled(60, 360);
324 return true; 324 return true;
325 } 325 }
(...skipping 26 matching lines...) Expand all
352 } 352 }
353 353
354 private: 354 private:
355 typedef SampleView INHERITED; 355 typedef SampleView INHERITED;
356 }; 356 };
357 357
358 ////////////////////////////////////////////////////////////////////////////// 358 //////////////////////////////////////////////////////////////////////////////
359 359
360 static SkView* MyFactory() { return new PatchView; } 360 static SkView* MyFactory() { return new PatchView; }
361 static SkViewRegister reg(MyFactory); 361 static SkViewRegister reg(MyFactory);
OLDNEW
« no previous file with comments | « include/core/SkShader.h ('k') | src/core/SkLocalMatrixShader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698