aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--include/gpu/GrTypes.h18
-rw-r--r--src/gpu/GrDefaultPathRenderer.cpp26
2 files changed, 5 insertions, 39 deletions
diff --git a/include/gpu/GrTypes.h b/include/gpu/GrTypes.h
index a19918bf20..7382a2d75a 100644
--- a/include/gpu/GrTypes.h
+++ b/include/gpu/GrTypes.h
@@ -593,24 +593,6 @@ static inline bool GrIsFillInverted(GrPathFill fill) {
return gIsFillInverted[fill];
}
-/**
- * Hints provided about a path's convexity (or lack thereof).
- */
-enum GrConvexHint {
- kNone_ConvexHint, //<! No hint about convexity
- // of the path
- kConvex_ConvexHint, //<! Path is one convex piece
- kNonOverlappingConvexPieces_ConvexHint, //<! Multiple convex pieces,
- // pieces are known to be
- // disjoint
- kSameWindingConvexPieces_ConvexHint, //<! Multiple convex pieces,
- // may or may not intersect,
- // either all wind cw or all
- // wind ccw.
- kConcave_ConvexHint //<! Path is known to be
- // concave
-};
-
///////////////////////////////////////////////////////////////////////////////
// opaque type for 3D API object handles
diff --git a/src/gpu/GrDefaultPathRenderer.cpp b/src/gpu/GrDefaultPathRenderer.cpp
index 6ea04591cd..51cbde02cf 100644
--- a/src/gpu/GrDefaultPathRenderer.cpp
+++ b/src/gpu/GrDefaultPathRenderer.cpp
@@ -162,30 +162,14 @@ GR_STATIC_CONST_SAME_STENCIL(gDirectToStencil,
////////////////////////////////////////////////////////////////////////////////
// Helpers for drawPath
-static GrConvexHint getConvexHint(const SkPath& path) {
- return path.isConvex() ? kConvex_ConvexHint : kConcave_ConvexHint;
-}
-
#define STENCIL_OFF 0 // Always disable stencil (even when needed)
-static inline bool single_pass_path(const GrDrawTarget& target,
- const GrPath& path,
- GrPathFill fill) {
+static inline bool single_pass_path(const GrPath& path, GrPathFill fill) {
#if STENCIL_OFF
return true;
#else
- if (kEvenOdd_PathFill == fill) {
- GrConvexHint hint = getConvexHint(path);
- return hint == kConvex_ConvexHint ||
- hint == kNonOverlappingConvexPieces_ConvexHint;
- } else if (kWinding_PathFill == fill) {
- GrConvexHint hint = getConvexHint(path);
- return hint == kConvex_ConvexHint ||
- hint == kNonOverlappingConvexPieces_ConvexHint ||
- (hint == kSameWindingConvexPieces_ConvexHint &&
- !target.drawWillReadDst() &&
- !target.getDrawState().isDitherState());
-
+ if (kEvenOdd_PathFill == fill || kWinding_PathFill == fill) {
+ return path.isConvex();
}
return false;
#endif
@@ -194,7 +178,7 @@ static inline bool single_pass_path(const GrDrawTarget& target,
bool GrDefaultPathRenderer::requiresStencilPass(const GrDrawTarget* target,
const GrPath& path,
GrPathFill fill) const {
- return !single_pass_path(*target, path, fill);
+ return !single_pass_path(path, fill);
}
void GrDefaultPathRenderer::pathWillClear() {
@@ -420,7 +404,7 @@ void GrDefaultPathRenderer::onDrawPath(GrDrawState::StageMask stageMask,
lastPassIsBounds = false;
drawFace[0] = GrDrawState::kBoth_DrawFace;
} else {
- if (single_pass_path(*fTarget, *fPath, fFill)) {
+ if (single_pass_path(*fPath, fFill)) {
passCount = 1;
if (stencilOnly) {
passes[0] = &gDirectToStencil;