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

Side by Side Diff: gm/dashcircle.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/bug530095.cpp ('k') | gm/dashcubics.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 2016 Google Inc. 2 * Copyright 2016 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 "SkDashPathEffect.h" 10 #include "SkDashPathEffect.h"
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 SkPaint p; 61 SkPaint p;
62 p.setAntiAlias(true); 62 p.setAntiAlias(true);
63 p.setStyle(SkPaint::kStroke_Style); 63 p.setStyle(SkPaint::kStroke_Style);
64 p.setStrokeWidth(10); 64 p.setStrokeWidth(10);
65 SkScalar intervals[4]; 65 SkScalar intervals[4];
66 int intervalCount = dashExample.length; 66 int intervalCount = dashExample.length;
67 SkScalar dashLength = circumference / wedge / dashUnits; 67 SkScalar dashLength = circumference / wedge / dashUnits;
68 for (int index = 0; index < dashExample.length; ++index) { 68 for (int index = 0; index < dashExample.length; ++index) {
69 intervals[index] = dashExample.pattern[index] * dashLength; 69 intervals[index] = dashExample.pattern[index] * dashLength;
70 } 70 }
71 p.setPathEffect(SkDashPathEffect::Create(intervals, intervalCount, 0 ))->unref(); 71 p.setPathEffect(SkDashPathEffect::Make(intervals, intervalCount, 0)) ;
72 canvas->drawPath(circle, p); 72 canvas->drawPath(circle, p);
73 canvas->translate(0, radius * 2 + 50); 73 canvas->translate(0, radius * 2 + 50);
74 } 74 }
75 canvas->restore(); 75 canvas->restore();
76 canvas->translate(radius * 2 + 50, 0); 76 canvas->translate(radius * 2 + 50, 0);
77 } 77 }
78 } 78 }
OLDNEW
« no previous file with comments | « gm/bug530095.cpp ('k') | gm/dashcubics.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698