| 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 11 matching lines...) Expand all Loading... |
| 22 kLine_Type, | 22 kLine_Type, |
| 23 kQuad_Type, | 23 kQuad_Type, |
| 24 kCubic_Type | 24 kCubic_Type |
| 25 }; | 25 }; |
| 26 | 26 |
| 27 SkEdge* fNext; | 27 SkEdge* fNext; |
| 28 SkEdge* fPrev; | 28 SkEdge* fPrev; |
| 29 | 29 |
| 30 SkFixed fX; | 30 SkFixed fX; |
| 31 SkFixed fDX; | 31 SkFixed fDX; |
| 32 float fFirstXf; // only used for trapezoidal renderer |
| 33 float fFirstYf; // only used for trapezoidal renderer |
| 32 int32_t fFirstY; | 34 int32_t fFirstY; |
| 33 int32_t fLastY; | 35 int32_t fLastY; |
| 34 int8_t fCurveCount; // only used by kQuad(+) and kCubic(-) | 36 int8_t fCurveCount; // only used by kQuad(+) and kCubic(-) |
| 35 uint8_t fCurveShift; // appled to all Dx/DDx/DDDx except for fCubicDShift
exception | 37 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 | 38 uint8_t fCubicDShift; // applied to fCDx and fCDy only in cubic |
| 37 int8_t fWinding; // 1 or -1 | 39 int8_t fWinding; // 1 or -1 |
| 38 | 40 |
| 39 int setLine(const SkPoint& p0, const SkPoint& p1, const SkIRect* clip, int s
hiftUp); | 41 int setLine(const SkPoint& p0, const SkPoint& p1, const SkIRect* clip, int s
hiftUp); |
| 40 // call this version if you know you don't have a clip | 42 // call this version if you know you don't have a clip |
| 41 inline int setLine(const SkPoint& p0, const SkPoint& p1, int shiftUp); | 43 inline int setLine(const SkPoint& p0, const SkPoint& p1, int shiftUp); |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 | 117 |
| 116 // are we a zero-height line? | 118 // are we a zero-height line? |
| 117 if (top == bot) { | 119 if (top == bot) { |
| 118 return 0; | 120 return 0; |
| 119 } | 121 } |
| 120 | 122 |
| 121 SkFixed slope = SkFDot6Div(x1 - x0, y1 - y0); | 123 SkFixed slope = SkFDot6Div(x1 - x0, y1 - y0); |
| 122 const SkFDot6 dy = SkEdge_Compute_DY(top, y0); | 124 const SkFDot6 dy = SkEdge_Compute_DY(top, y0); |
| 123 | 125 |
| 124 fX = SkFDot6ToFixed(x0 + SkFixedMul(slope, dy)); // + SK_Fixed1/2 | 126 fX = SkFDot6ToFixed(x0 + SkFixedMul(slope, dy)); // + SK_Fixed1/2 |
| 127 fFirstXf = winding < 0 ? p1.fX : p0.fX; |
| 125 fDX = slope; | 128 fDX = slope; |
| 126 fFirstY = top; | 129 fFirstY = top; |
| 130 fFirstYf = static_cast<float>(top); |
| 127 fLastY = bot - 1; | 131 fLastY = bot - 1; |
| 128 fCurveCount = 0; | 132 fCurveCount = 0; |
| 129 fWinding = SkToS8(winding); | 133 fWinding = SkToS8(winding); |
| 130 fCurveShift = 0; | 134 fCurveShift = 0; |
| 131 return 1; | 135 return 1; |
| 132 } | 136 } |
| 133 | 137 |
| 134 | 138 |
| 135 #endif | 139 #endif |
| OLD | NEW |