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

Side by Side Diff: src/core/SkPath.cpp

Issue 1720953002: allow move/zero-line/close to draw caps (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: remove extra friend Created 4 years, 10 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/SkPath.h ('k') | src/core/SkStroke.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 2006 The Android Open Source Project 2 * Copyright 2006 The Android Open Source Project
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 "SkBuffer.h" 8 #include "SkBuffer.h"
9 #include "SkCubicClipper.h" 9 #include "SkCubicClipper.h"
10 #include "SkErrorInternals.h" 10 #include "SkErrorInternals.h"
(...skipping 1166 matching lines...) Expand 10 before | Expand all | Expand 10 after
1177 *verbs == kQuad_Verb || 1177 *verbs == kQuad_Verb ||
1178 *verbs == kConic_Verb || 1178 *verbs == kConic_Verb ||
1179 *verbs == kCubic_Verb) { 1179 *verbs == kCubic_Verb) {
1180 return false; 1180 return false;
1181 } 1181 }
1182 ++verbs; 1182 ++verbs;
1183 } 1183 }
1184 return true; 1184 return true;
1185 } 1185 }
1186 1186
1187 bool SkPath::isZeroLength() const {
1188 int count = fPathRef->countPoints();
1189 if (count < 2) {
1190 return true;
1191 }
1192 const SkPoint* pts = fPathRef.get()->points();
1193 const SkPoint& first = *pts;
1194 for (int index = 1; index < count; ++index) {
1195 if (first != pts[index]) {
1196 return false;
1197 }
1198 }
1199 return true;
1200 }
1201
1187 void SkPath::addRoundRect(const SkRect& rect, SkScalar rx, SkScalar ry, 1202 void SkPath::addRoundRect(const SkRect& rect, SkScalar rx, SkScalar ry,
1188 Direction dir) { 1203 Direction dir) {
1189 assert_known_direction(dir); 1204 assert_known_direction(dir);
1190 1205
1191 if (rx < 0 || ry < 0) { 1206 if (rx < 0 || ry < 0) {
1192 SkErrorInternals::SetError( kInvalidArgument_SkError, 1207 SkErrorInternals::SetError( kInvalidArgument_SkError,
1193 "I got %f and %f as radii to SkPath::AddRoun dRect, " 1208 "I got %f and %f as radii to SkPath::AddRoun dRect, "
1194 "but negative radii are not allowed.", 1209 "but negative radii are not allowed.",
1195 SkScalarToDouble(rx), SkScalarToDouble(ry) ) ; 1210 SkScalarToDouble(rx), SkScalarToDouble(ry) ) ;
1196 return; 1211 return;
(...skipping 2013 matching lines...) Expand 10 before | Expand all | Expand 10 after
3210 } 3225 }
3211 } while (!done); 3226 } while (!done);
3212 return SkToBool(tangents.count()) ^ isInverse; 3227 return SkToBool(tangents.count()) ^ isInverse;
3213 } 3228 }
3214 3229
3215 int SkPath::ConvertConicToQuads(const SkPoint& p0, const SkPoint& p1, const SkPo int& p2, 3230 int SkPath::ConvertConicToQuads(const SkPoint& p0, const SkPoint& p1, const SkPo int& p2,
3216 SkScalar w, SkPoint pts[], int pow2) { 3231 SkScalar w, SkPoint pts[], int pow2) {
3217 const SkConic conic(p0, p1, p2, w); 3232 const SkConic conic(p0, p1, p2, w);
3218 return conic.chopIntoQuadsPOW2(pts, pow2); 3233 return conic.chopIntoQuadsPOW2(pts, pow2);
3219 } 3234 }
OLDNEW
« no previous file with comments | « include/core/SkPath.h ('k') | src/core/SkStroke.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698