OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2006 The Android Open Source Project | 3 * Copyright 2006 The Android Open Source Project |
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 | 9 |
10 #ifndef SkEdge_DEFINED | 10 #ifndef SkEdge_DEFINED |
(...skipping 18 matching lines...) Expand all Loading... |
29 | 29 |
30 SkFixed fX; | 30 SkFixed fX; |
31 SkFixed fDX; | 31 SkFixed fDX; |
32 int32_t fFirstY; | 32 int32_t fFirstY; |
33 int32_t fLastY; | 33 int32_t fLastY; |
34 int8_t fCurveCount; // only used by kQuad(+) and kCubic(-) | 34 int8_t fCurveCount; // only used by kQuad(+) and kCubic(-) |
35 uint8_t fCurveShift; // appled to all Dx/DDx/DDDx except for fCubicDShift
exception | 35 uint8_t fCurveShift; // appled to all Dx/DDx/DDDx except for fCubicDShift
exception |
36 uint8_t fCubicDShift; // applied to fCDx and fCDy only in cubic | 36 uint8_t fCubicDShift; // applied to fCDx and fCDy only in cubic |
37 int8_t fWinding; // 1 or -1 | 37 int8_t fWinding; // 1 or -1 |
38 | 38 |
39 int setLine(const SkPoint& p0, const SkPoint& p1, const SkIRect* clip, | 39 int setLine(const SkPoint& p0, const SkPoint& p1, const SkIRect* clip, int s
hiftUp); |
40 int shiftUp); | |
41 // call this version if you know you don't have a clip | 40 // call this version if you know you don't have a clip |
42 inline int setLine(const SkPoint& p0, const SkPoint& p1, int shiftUp); | 41 inline int setLine(const SkPoint& p0, const SkPoint& p1, int shiftUp); |
43 inline int updateLine(SkFixed ax, SkFixed ay, SkFixed bx, SkFixed by); | 42 inline int updateLine(SkFixed ax, SkFixed ay, SkFixed bx, SkFixed by); |
44 void chopLineWithClip(const SkIRect& clip); | 43 void chopLineWithClip(const SkIRect& clip); |
45 | 44 |
46 inline bool intersectsClip(const SkIRect& clip) const { | 45 inline bool intersectsClip(const SkIRect& clip) const { |
47 SkASSERT(fFirstY < clip.fBottom); | 46 SkASSERT(fFirstY < clip.fBottom); |
48 return fLastY >= clip.fTop; | 47 return fLastY >= clip.fTop; |
49 } | 48 } |
50 | 49 |
(...skipping 23 matching lines...) Expand all Loading... |
74 int updateQuadratic(); | 73 int updateQuadratic(); |
75 }; | 74 }; |
76 | 75 |
77 struct SkCubicEdge : public SkEdge { | 76 struct SkCubicEdge : public SkEdge { |
78 SkFixed fCx, fCy; | 77 SkFixed fCx, fCy; |
79 SkFixed fCDx, fCDy; | 78 SkFixed fCDx, fCDy; |
80 SkFixed fCDDx, fCDDy; | 79 SkFixed fCDDx, fCDDy; |
81 SkFixed fCDDDx, fCDDDy; | 80 SkFixed fCDDDx, fCDDDy; |
82 SkFixed fCLastX, fCLastY; | 81 SkFixed fCLastX, fCLastY; |
83 | 82 |
84 int setCubic(const SkPoint pts[4], const SkIRect* clip, int shiftUp); | 83 int setCubic(const SkPoint pts[4], int shiftUp); |
85 int updateCubic(); | 84 int updateCubic(); |
86 }; | 85 }; |
87 | 86 |
88 int SkEdge::setLine(const SkPoint& p0, const SkPoint& p1, int shift) { | 87 int SkEdge::setLine(const SkPoint& p0, const SkPoint& p1, int shift) { |
89 SkFDot6 x0, y0, x1, y1; | 88 SkFDot6 x0, y0, x1, y1; |
90 | 89 |
91 { | 90 { |
92 #ifdef SK_RASTERIZE_EVEN_ROUNDING | 91 #ifdef SK_RASTERIZE_EVEN_ROUNDING |
93 x0 = SkScalarRoundToFDot6(p0.fX, shift); | 92 x0 = SkScalarRoundToFDot6(p0.fX, shift); |
94 y0 = SkScalarRoundToFDot6(p0.fY, shift); | 93 y0 = SkScalarRoundToFDot6(p0.fY, shift); |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 fFirstY = top; | 126 fFirstY = top; |
128 fLastY = bot - 1; | 127 fLastY = bot - 1; |
129 fCurveCount = 0; | 128 fCurveCount = 0; |
130 fWinding = SkToS8(winding); | 129 fWinding = SkToS8(winding); |
131 fCurveShift = 0; | 130 fCurveShift = 0; |
132 return 1; | 131 return 1; |
133 } | 132 } |
134 | 133 |
135 | 134 |
136 #endif | 135 #endif |
OLD | NEW |