| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2012 Google Inc. | 3 * Copyright 2012 Google Inc. |
| 4 * | 4 * |
| 5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
| 6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
| 7 */ | 7 */ |
| 8 | 8 |
| 9 #include "GrAAConvexPathRenderer.h" | 9 #include "GrAAConvexPathRenderer.h" |
| 10 | 10 |
| (...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 data->fStage = DegenerateTestData::kLine; | 196 data->fStage = DegenerateTestData::kLine; |
| 197 } | 197 } |
| 198 break; | 198 break; |
| 199 case DegenerateTestData::kLine: | 199 case DegenerateTestData::kLine: |
| 200 if (SkScalarAbs(data->fLineNormal.dot(pt) + data->fLineC) > kClose)
{ | 200 if (SkScalarAbs(data->fLineNormal.dot(pt) + data->fLineC) > kClose)
{ |
| 201 data->fStage = DegenerateTestData::kNonDegenerate; | 201 data->fStage = DegenerateTestData::kNonDegenerate; |
| 202 } | 202 } |
| 203 case DegenerateTestData::kNonDegenerate: | 203 case DegenerateTestData::kNonDegenerate: |
| 204 break; | 204 break; |
| 205 default: | 205 default: |
| 206 GrCrash("Unexpected degenerate test stage."); | 206 SkFAIL("Unexpected degenerate test stage."); |
| 207 } | 207 } |
| 208 } | 208 } |
| 209 | 209 |
| 210 static inline bool get_direction(const SkPath& path, const SkMatrix& m, SkPath::
Direction* dir) { | 210 static inline bool get_direction(const SkPath& path, const SkMatrix& m, SkPath::
Direction* dir) { |
| 211 if (!path.cheapComputeDirection(dir)) { | 211 if (!path.cheapComputeDirection(dir)) { |
| 212 return false; | 212 return false; |
| 213 } | 213 } |
| 214 // check whether m reverses the orientation | 214 // check whether m reverses the orientation |
| 215 SkASSERT(!m.hasPerspective()); | 215 SkASSERT(!m.hasPerspective()); |
| 216 SkScalar det2x2 = SkScalarMul(m.get(SkMatrix::kMScaleX), m.get(SkMatrix::kMS
caleY)) - | 216 SkScalar det2x2 = SkScalarMul(m.get(SkMatrix::kMScaleX), m.get(SkMatrix::kMS
caleY)) - |
| (...skipping 491 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 708 vOffset, // start vertex | 708 vOffset, // start vertex |
| 709 0, // start index | 709 0, // start index |
| 710 draw.fVertexCnt, | 710 draw.fVertexCnt, |
| 711 draw.fIndexCnt, | 711 draw.fIndexCnt, |
| 712 &devBounds); | 712 &devBounds); |
| 713 vOffset += draw.fVertexCnt; | 713 vOffset += draw.fVertexCnt; |
| 714 } | 714 } |
| 715 | 715 |
| 716 return true; | 716 return true; |
| 717 } | 717 } |
| OLD | NEW |