OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2006 The Android Open Source Project | 2 * Copyright 2006 The Android Open Source Project |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 | 8 |
9 #ifndef SkEdge_DEFINED | 9 #ifndef SkEdge_DEFINED |
10 #define SkEdge_DEFINED | 10 #define SkEdge_DEFINED |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 } | 61 } |
62 #endif | 62 #endif |
63 }; | 63 }; |
64 | 64 |
65 struct SkQuadraticEdge : public SkEdge { | 65 struct SkQuadraticEdge : public SkEdge { |
66 SkFixed fQx, fQy; | 66 SkFixed fQx, fQy; |
67 SkFixed fQDx, fQDy; | 67 SkFixed fQDx, fQDy; |
68 SkFixed fQDDx, fQDDy; | 68 SkFixed fQDDx, fQDDy; |
69 SkFixed fQLastX, fQLastY; | 69 SkFixed fQLastX, fQLastY; |
70 | 70 |
| 71 bool setQuadraticWithoutUpdate(const SkPoint pts[3], int shiftUp); |
71 int setQuadratic(const SkPoint pts[3], int shiftUp); | 72 int setQuadratic(const SkPoint pts[3], int shiftUp); |
72 int updateQuadratic(); | 73 int updateQuadratic(); |
73 }; | 74 }; |
74 | 75 |
75 struct SkCubicEdge : public SkEdge { | 76 struct SkCubicEdge : public SkEdge { |
76 SkFixed fCx, fCy; | 77 SkFixed fCx, fCy; |
77 SkFixed fCDx, fCDy; | 78 SkFixed fCDx, fCDy; |
78 SkFixed fCDDx, fCDDy; | 79 SkFixed fCDDx, fCDDy; |
79 SkFixed fCDDDx, fCDDDy; | 80 SkFixed fCDDDx, fCDDDy; |
80 SkFixed fCLastX, fCLastY; | 81 SkFixed fCLastX, fCLastY; |
81 | 82 |
| 83 bool setCubicWithoutUpdate(const SkPoint pts[4], int shiftUp); |
82 int setCubic(const SkPoint pts[4], int shiftUp); | 84 int setCubic(const SkPoint pts[4], int shiftUp); |
83 int updateCubic(); | 85 int updateCubic(); |
84 }; | 86 }; |
85 | 87 |
86 int SkEdge::setLine(const SkPoint& p0, const SkPoint& p1, int shift) { | 88 int SkEdge::setLine(const SkPoint& p0, const SkPoint& p1, int shift) { |
87 SkFDot6 x0, y0, x1, y1; | 89 SkFDot6 x0, y0, x1, y1; |
88 | 90 |
89 { | 91 { |
90 #ifdef SK_RASTERIZE_EVEN_ROUNDING | 92 #ifdef SK_RASTERIZE_EVEN_ROUNDING |
91 x0 = SkScalarRoundToFDot6(p0.fX, shift); | 93 x0 = SkScalarRoundToFDot6(p0.fX, shift); |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 fX = SkFDot6ToFixed(x0 + SkFixedMul(slope, dy)); // + SK_Fixed1/2 | 125 fX = SkFDot6ToFixed(x0 + SkFixedMul(slope, dy)); // + SK_Fixed1/2 |
124 fDX = slope; | 126 fDX = slope; |
125 fFirstY = top; | 127 fFirstY = top; |
126 fLastY = bot - 1; | 128 fLastY = bot - 1; |
127 fCurveCount = 0; | 129 fCurveCount = 0; |
128 fWinding = SkToS8(winding); | 130 fWinding = SkToS8(winding); |
129 fCurveShift = 0; | 131 fCurveShift = 0; |
130 return 1; | 132 return 1; |
131 } | 133 } |
132 | 134 |
133 | |
134 #endif | 135 #endif |
OLD | NEW |