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

Unified Diff: src/pathops/SkPathWriter.cpp

Issue 14798004: path ops -- fix skp bugs (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/pathops/SkPathWriter.h ('k') | tests/PathOpsAngleTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/pathops/SkPathWriter.cpp
===================================================================
--- src/pathops/SkPathWriter.cpp (revision 9040)
+++ src/pathops/SkPathWriter.cpp (working copy)
@@ -4,7 +4,7 @@
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
-#include "SkPathOpsTypes.h"
+#include "SkPathOpsPoint.h"
#include "SkPathWriter.h"
// wrap path to keep track of whether the contour is initialized and non-empty
@@ -37,6 +37,11 @@
void SkPathWriter::cubicTo(const SkPoint& pt1, const SkPoint& pt2, const SkPoint& pt3) {
lineTo();
+ if (fEmpty && AlmostEqualUlps(fDefer[0], pt1) && AlmostEqualUlps(pt1, pt2)
+ && AlmostEqualUlps(pt2, pt3)) {
+ deferredLine(pt3);
+ return;
+ }
moveTo();
fDefer[1] = pt3;
nudge();
@@ -116,6 +121,10 @@
void SkPathWriter::quadTo(const SkPoint& pt1, const SkPoint& pt2) {
lineTo();
+ if (fEmpty && AlmostEqualUlps(fDefer[0], pt1) && AlmostEqualUlps(pt1, pt2)) {
+ deferredLine(pt2);
+ return;
+ }
moveTo();
fDefer[1] = pt2;
nudge();
« no previous file with comments | « src/pathops/SkPathWriter.h ('k') | tests/PathOpsAngleTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698