aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrAAConvexPathRenderer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gpu/GrAAConvexPathRenderer.cpp')
-rw-r--r--src/gpu/GrAAConvexPathRenderer.cpp15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/gpu/GrAAConvexPathRenderer.cpp b/src/gpu/GrAAConvexPathRenderer.cpp
index 60749d81c0..657dfc1ee2 100644
--- a/src/gpu/GrAAConvexPathRenderer.cpp
+++ b/src/gpu/GrAAConvexPathRenderer.cpp
@@ -22,9 +22,11 @@ namespace {
struct Segment {
enum {
- kLine,
- kQuad
+ // These enum values are assumed in member functions below.
+ kLine = 0,
+ kQuad = 1,
} fType;
+
// line uses one pt, quad uses 2 pts
GrPoint fPts[2];
// normal to edge ending at each pt
@@ -34,13 +36,16 @@ struct Segment {
GrVec fMid;
int countPoints() {
- return (kLine == fType) ? 1 : 2;
+ GR_STATIC_ASSERT(0 == kLine && 1 == kQuad);
+ return fType + 1;
}
const SkPoint& endPt() const {
- return (kLine == fType) ? fPts[0] : fPts[1];
+ GR_STATIC_ASSERT(0 == kLine && 1 == kQuad);
+ return fPts[fType];
};
const SkPoint& endNorm() const {
- return (kLine == fType) ? fNorms[0] : fNorms[1];
+ GR_STATIC_ASSERT(0 == kLine && 1 == kQuad);
+ return fNorms[fType];
};
};