aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu
diff options
context:
space:
mode:
authorGravatar bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-11-13 14:36:42 +0000
committerGravatar bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-11-13 14:36:42 +0000
commit30c174b9ce6b9777ee50ae0d0565a01b2a060f01 (patch)
tree1bf50f78e1c91cd38d9ab7be07a761ebbd1c7b60 /src/gpu
parent000e2fe221a4f882a1c5ca08ad01517efe091784 (diff)
Make SkPath cache the result of cheapComputeDirection.
Review URL: https://codereview.appspot.com/6810111 git-svn-id: http://skia.googlecode.com/svn/trunk@6394 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/gpu')
-rw-r--r--src/gpu/GrAAConvexPathRenderer.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/gpu/GrAAConvexPathRenderer.cpp b/src/gpu/GrAAConvexPathRenderer.cpp
index 4ac61639c0..ebfcd7bdc3 100644
--- a/src/gpu/GrAAConvexPathRenderer.cpp
+++ b/src/gpu/GrAAConvexPathRenderer.cpp
@@ -209,9 +209,7 @@ inline bool get_direction(const SkPath& path, const SkMatrix& m, SkPath::Directi
SkScalar det2x2 = SkScalarMul(m.get(SkMatrix::kMScaleX), m.get(SkMatrix::kMScaleY)) -
SkScalarMul(m.get(SkMatrix::kMSkewX), m.get(SkMatrix::kMSkewY));
if (det2x2 < 0) {
- GR_STATIC_ASSERT(0 == SkPath::kCW_Direction || 1 == SkPath::kCW_Direction);
- GR_STATIC_ASSERT(0 == SkPath::kCCW_Direction || 1 == SkPath::kCCW_Direction);
- *dir = static_cast<SkPath::Direction>(*dir ^ 0x1);
+ *dir = SkPath::OppositeDirection(*dir);
}
return true;
}
@@ -223,7 +221,7 @@ bool get_segments(const SkPath& path,
int* vCount,
int* iCount) {
SkPath::Iter iter(path, true);
- // This renderer overemphasises very thin path regions. We use the distance
+ // This renderer over-emphasizes very thin path regions. We use the distance
// to the path from the sample to compute coverage. Every pixel intersected
// by the path will be hit and the maximum distance is sqrt(2)/2. We don't
// notice that the sample may be close to a very thin area of the path and