2012-08-27 14:11:33 +00:00
|
|
|
/*
|
|
|
|
* Copyright 2012 Google Inc.
|
|
|
|
*
|
|
|
|
* Use of this source code is governed by a BSD-style license that can be
|
|
|
|
* found in the LICENSE file.
|
|
|
|
*/
|
2012-03-27 13:23:51 +00:00
|
|
|
#include "SkPath.h"
|
|
|
|
|
2012-09-14 14:19:30 +00:00
|
|
|
// region-inspired approach
|
2012-03-27 13:23:51 +00:00
|
|
|
void contourBounds(const SkPath& path, SkTDArray<SkRect>& boundsArray);
|
|
|
|
void simplify(const SkPath& path, bool asFill, SkPath& simple);
|
2012-09-14 14:19:30 +00:00
|
|
|
|
|
|
|
// contour outer edge walking approach
|
|
|
|
#ifndef DEFINE_SHAPE_OP
|
|
|
|
// FIXME: namespace testing doesn't allow global enums like this
|
|
|
|
#define DEFINE_SHAPE_OP
|
|
|
|
enum ShapeOp {
|
|
|
|
kDifference_Op,
|
|
|
|
kIntersect_Op,
|
|
|
|
kUnion_Op,
|
2012-11-09 22:14:19 +00:00
|
|
|
kXor_Op,
|
2012-11-10 02:01:26 +00:00
|
|
|
kShapeOp_Count
|
2012-09-14 14:19:30 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
enum ShapeOpMask {
|
|
|
|
kWinding_Mask = -1,
|
|
|
|
kNo_Mask = 0,
|
|
|
|
kEvenOdd_Mask = 1
|
|
|
|
};
|
|
|
|
#endif
|
|
|
|
|
|
|
|
void operate(const SkPath& one, const SkPath& two, ShapeOp op, SkPath& result);
|
2012-05-23 18:09:25 +00:00
|
|
|
void simplifyx(const SkPath& path, SkPath& simple);
|
2012-03-27 13:23:51 +00:00
|
|
|
|
2012-07-23 12:14:49 +00:00
|
|
|
// FIXME: remove this section once debugging is complete
|
|
|
|
extern const bool gRunTestsInOneThread;
|
|
|
|
#ifdef SK_DEBUG
|
|
|
|
extern int gDebugMaxWindSum;
|
|
|
|
extern int gDebugMaxWindValue;
|
|
|
|
#endif
|