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

Side by Side Diff: gm/strokes.cpp

Issue 1813553005: switch patheffects over to sk_sp (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: try to fix xpsdevice 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 | « gm/patheffects.cpp ('k') | gm/stroketext.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 "gm.h" 8 #include "gm.h"
9 #include "SkPath.h" 9 #include "SkPath.h"
10 #include "SkRandom.h" 10 #include "SkRandom.h"
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 strokePaint.setAlpha(255); 121 strokePaint.setAlpha(255);
122 strokePaint.setStrokeWidth(i ? 8.f : 10.f); 122 strokePaint.setStrokeWidth(i ? 8.f : 10.f);
123 strokePaint.setStrokeCap(i ? SkPaint::kSquare_Cap : SkPaint::kRound_ Cap); 123 strokePaint.setStrokeCap(i ? SkPaint::kSquare_Cap : SkPaint::kRound_ Cap);
124 canvas->save(); 124 canvas->save();
125 canvas->translate(10 + i * 100.f, 10); 125 canvas->translate(10 + i * 100.f, 10);
126 canvas->drawPath(fMoveHfPath, strokePaint); 126 canvas->drawPath(fMoveHfPath, strokePaint);
127 canvas->translate(0, 20); 127 canvas->translate(0, 20);
128 canvas->drawPath(fMoveZfPath, strokePaint); 128 canvas->drawPath(fMoveZfPath, strokePaint);
129 dashPaint = strokePaint; 129 dashPaint = strokePaint;
130 const SkScalar intervals[] = { 0, 10 }; 130 const SkScalar intervals[] = { 0, 10 };
131 dashPaint.setPathEffect(SkDashPathEffect::Create(intervals, 2, 0))-> unref(); 131 dashPaint.setPathEffect(SkDashPathEffect::Make(intervals, 2, 0));
132 SkPath fillPath; 132 SkPath fillPath;
133 dashPaint.getFillPath(fDashedfPath, &fillPath); 133 dashPaint.getFillPath(fDashedfPath, &fillPath);
134 canvas->translate(0, 20); 134 canvas->translate(0, 20);
135 canvas->drawPath(fDashedfPath, dashPaint); 135 canvas->drawPath(fDashedfPath, dashPaint);
136 canvas->translate(0, 20); 136 canvas->translate(0, 20);
137 canvas->drawPath(fRefPath[i * 2], fillPaint); 137 canvas->drawPath(fRefPath[i * 2], fillPaint);
138 strokePaint.setStrokeWidth(20); 138 strokePaint.setStrokeWidth(20);
139 strokePaint.setAlpha(127); 139 strokePaint.setAlpha(127);
140 canvas->translate(0, 50); 140 canvas->translate(0, 50);
141 canvas->drawPath(fMoveHfPath, strokePaint); 141 canvas->drawPath(fMoveHfPath, strokePaint);
(...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after
516 ////////////////////////////////////////////////////////////////////////////// 516 //////////////////////////////////////////////////////////////////////////////
517 517
518 DEF_GM( return new StrokesGM; ) 518 DEF_GM( return new StrokesGM; )
519 DEF_GM( return new Strokes2GM; ) 519 DEF_GM( return new Strokes2GM; )
520 DEF_GM( return new Strokes3GM; ) 520 DEF_GM( return new Strokes3GM; )
521 DEF_GM( return new Strokes4GM; ) 521 DEF_GM( return new Strokes4GM; )
522 DEF_GM( return new Strokes5GM; ) 522 DEF_GM( return new Strokes5GM; )
523 523
524 DEF_GM( return new ZeroLenStrokesGM; ) 524 DEF_GM( return new ZeroLenStrokesGM; )
525 DEF_GM( return new TeenyStrokesGM; ) 525 DEF_GM( return new TeenyStrokesGM; )
OLDNEW
« no previous file with comments | « gm/patheffects.cpp ('k') | gm/stroketext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698