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

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

Issue 1601103006: Add SkPath::isLastContourClosed() (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: isClosed -> isLastContourClosed; add braces 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/SkPath.h ('k') | tests/PathTest.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 300 matching lines...) Expand 10 before | Expand all | Expand 10 after
311 this->resetFields(); 311 this->resetFields();
312 } 312 }
313 313
314 void SkPath::rewind() { 314 void SkPath::rewind() {
315 SkDEBUGCODE(this->validate();) 315 SkDEBUGCODE(this->validate();)
316 316
317 SkPathRef::Rewind(&fPathRef); 317 SkPathRef::Rewind(&fPathRef);
318 this->resetFields(); 318 this->resetFields();
319 } 319 }
320 320
321 bool SkPath::isLastContourClosed() const {
322 int verbCount = fPathRef->countVerbs();
323 if (0 == verbCount) {
324 return false;
325 }
326 return kClose_Verb == fPathRef->atVerb(verbCount - 1);
327 }
328
321 bool SkPath::isLine(SkPoint line[2]) const { 329 bool SkPath::isLine(SkPoint line[2]) const {
322 int verbCount = fPathRef->countVerbs(); 330 int verbCount = fPathRef->countVerbs();
323 331
324 if (2 == verbCount) { 332 if (2 == verbCount) {
325 SkASSERT(kMove_Verb == fPathRef->atVerb(0)); 333 SkASSERT(kMove_Verb == fPathRef->atVerb(0));
326 if (kLine_Verb == fPathRef->atVerb(1)) { 334 if (kLine_Verb == fPathRef->atVerb(1)) {
327 SkASSERT(2 == fPathRef->countPoints()); 335 SkASSERT(2 == fPathRef->countPoints());
328 if (line) { 336 if (line) {
329 const SkPoint* pts = fPathRef->points(); 337 const SkPoint* pts = fPathRef->points();
330 line[0] = pts[0]; 338 line[0] = pts[0];
(...skipping 2753 matching lines...) Expand 10 before | Expand all | Expand 10 after
3084 } 3092 }
3085 } while (!done); 3093 } while (!done);
3086 return SkToBool(tangents.count()) ^ isInverse; 3094 return SkToBool(tangents.count()) ^ isInverse;
3087 } 3095 }
3088 3096
3089 int SkPath::ConvertConicToQuads(const SkPoint& p0, const SkPoint& p1, const SkPo int& p2, 3097 int SkPath::ConvertConicToQuads(const SkPoint& p0, const SkPoint& p1, const SkPo int& p2,
3090 SkScalar w, SkPoint pts[], int pow2) { 3098 SkScalar w, SkPoint pts[], int pow2) {
3091 const SkConic conic(p0, p1, p2, w); 3099 const SkConic conic(p0, p1, p2, w);
3092 return conic.chopIntoQuadsPOW2(pts, pow2); 3100 return conic.chopIntoQuadsPOW2(pts, pow2);
3093 } 3101 }
OLDNEW
« no previous file with comments | « include/core/SkPath.h ('k') | tests/PathTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698