add legacy pathop enums; fix uninitialized warning
authorcaryclark <caryclark@google.com>
Thu, 26 Mar 2015 16:05:12 +0000 (09:05 -0700)
committerCommit bot <commit-bot@chromium.org>
Thu, 26 Mar 2015 16:05:12 +0000 (09:05 -0700)
R=reed@google.com
BUG=skia:3588
NOTREECHECKS=true
NOTRY=true
NOPRESUBMIT=true

Review URL: https://codereview.chromium.org/1034073004

include/pathops/SkPathOps.h
src/pathops/SkPathOpsTSect.h

index 61a7076..a729e6f 100644 (file)
 class SkPath;
 struct SkRect;
 
+
+// FIXME: remove this once the define in src/skia/SkUserConfig.h lands
+#ifndef SK_SUPPORT_LEGACY_PATHOP_ENUMS
+#define SK_SUPPORT_LEGACY_PATHOP_ENUMS
+#endif
+
 // FIXME: move everything below into the SkPath class
 /**
   *  The logical operations that can be performed when combining two paths.
@@ -24,6 +30,14 @@ enum SkPathOp {
     kUnion_SkPathOp,              //!< union (inclusive-or) the two paths
     kXOR_SkPathOp,                //!< exclusive-or the two paths
     kReverseDifference_SkPathOp,  //!< subtract the first path from the op path
+
+#ifdef SK_SUPPORT_LEGACY_PATHOP_ENUMS
+    kDifference_PathOp = 0,     //!< subtract the op path from the first path
+    kIntersect_PathOp,          //!< intersect the two paths
+    kUnion_PathOp,              //!< union (inclusive-or) the two paths
+    kXOR_PathOp,                //!< exclusive-or the two paths
+    kReverseDifference_PathOp,  //!< subtract the first path from the op path
+#endif
 };
 
 /** Set this path to the result of applying the Op to this path and the
index 5f2730a..b709a60 100644 (file)
@@ -1022,7 +1022,7 @@ SkTSpan<TCurve>* SkTSect<TCurve>::extractCoincident(SkTSect* sect2, SkTSpan<TCur
     }
     // march outwards to find limit of coincidence from here to previous and next spans
     double startT = first->fStartT;
-    double oppStartT;
+    double oppStartT SK_INIT_TO_AVOID_WARNING;
     double oppEndT SK_INIT_TO_AVOID_WARNING;
     SkTSpan<TCurve>* prev = first->fPrev;
     SkASSERT(first->fCoinStart.isCoincident());