OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 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 #include "SkEdgeBuilder.h" | 8 #include "SkEdgeBuilder.h" |
9 #include "SkPath.h" | 9 #include "SkPath.h" |
10 #include "SkEdge.h" | 10 #include "SkEdge.h" |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 } | 57 } |
58 last->fLastY = last->fFirstY - 1; | 58 last->fLastY = last->fFirstY - 1; |
59 last->fFirstY = edge->fFirstY; | 59 last->fFirstY = edge->fFirstY; |
60 last->fWinding = edge->fWinding; | 60 last->fWinding = edge->fWinding; |
61 return kPartial_Combine; | 61 return kPartial_Combine; |
62 } | 62 } |
63 return kNo_Combine; | 63 return kNo_Combine; |
64 } | 64 } |
65 | 65 |
66 static bool vertical_line(const SkEdge* edge) { | 66 static bool vertical_line(const SkEdge* edge) { |
67 #ifdef SK_SUPPORT_LEGACY_VERTICAL_EDGE // this disables combining vertical over
lapping edges | |
68 return false; | |
69 #endif | |
70 return !edge->fDX && !edge->fCurveCount; | 67 return !edge->fDX && !edge->fCurveCount; |
71 } | 68 } |
72 | 69 |
73 void SkEdgeBuilder::addLine(const SkPoint pts[]) { | 70 void SkEdgeBuilder::addLine(const SkPoint pts[]) { |
74 SkEdge* edge = typedAllocThrow<SkEdge>(fAlloc); | 71 SkEdge* edge = typedAllocThrow<SkEdge>(fAlloc); |
75 if (edge->setLine(pts[0], pts[1], fShiftUp)) { | 72 if (edge->setLine(pts[0], pts[1], fShiftUp)) { |
76 if (vertical_line(edge) && fList.count()) { | 73 if (vertical_line(edge) && fList.count()) { |
77 Combine combine = CombineVertical(edge, *(fList.end() - 1)); | 74 Combine combine = CombineVertical(edge, *(fList.end() - 1)); |
78 if (kNo_Combine != combine) { | 75 if (kNo_Combine != combine) { |
79 if (kTotal_Combine == combine) { | 76 if (kTotal_Combine == combine) { |
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
330 } | 327 } |
331 default: | 328 default: |
332 SkDEBUGFAIL("unexpected verb"); | 329 SkDEBUGFAIL("unexpected verb"); |
333 break; | 330 break; |
334 } | 331 } |
335 } | 332 } |
336 } | 333 } |
337 fEdgeList = fList.begin(); | 334 fEdgeList = fList.begin(); |
338 return fList.count(); | 335 return fList.count(); |
339 } | 336 } |
OLD | NEW |