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 #include "SkEdge.h" | 10 #include "SkEdge.h" |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 // are we a zero-height line? | 64 // are we a zero-height line? |
65 if (top == bot) { | 65 if (top == bot) { |
66 return 0; | 66 return 0; |
67 } | 67 } |
68 // are we completely above or below the clip? | 68 // are we completely above or below the clip? |
69 if (clip && (top >= clip->fBottom || bot <= clip->fTop)) { | 69 if (clip && (top >= clip->fBottom || bot <= clip->fTop)) { |
70 return 0; | 70 return 0; |
71 } | 71 } |
72 | 72 |
73 SkFixed slope = SkFDot6Div(x1 - x0, y1 - y0); | 73 SkFixed slope = SkFDot6Div(x1 - x0, y1 - y0); |
74 const int dy = SkEdge_Compute_DY(top, y0); | 74 const SkFDot6 dy = SkEdge_Compute_DY(top, y0); |
75 | 75 |
76 fX = SkFDot6ToFixed(x0 + SkFixedMul(slope, dy)); // + SK_Fixed1/2 | 76 fX = SkFDot6ToFixed(x0 + SkFixedMul(slope, dy)); // + SK_Fixed1/2 |
77 fDX = slope; | 77 fDX = slope; |
78 fFirstY = top; | 78 fFirstY = top; |
79 fLastY = bot - 1; | 79 fLastY = bot - 1; |
80 fCurveCount = 0; | 80 fCurveCount = 0; |
81 fWinding = SkToS8(winding); | 81 fWinding = SkToS8(winding); |
82 fCurveShift = 0; | 82 fCurveShift = 0; |
83 | 83 |
84 if (clip) { | 84 if (clip) { |
(...skipping 20 matching lines...) Expand all Loading... |
105 // SkASSERT(top >= fFirstY); | 105 // SkASSERT(top >= fFirstY); |
106 | 106 |
107 // are we a zero-height line? | 107 // are we a zero-height line? |
108 if (top == bot) | 108 if (top == bot) |
109 return 0; | 109 return 0; |
110 | 110 |
111 x0 >>= 10; | 111 x0 >>= 10; |
112 x1 >>= 10; | 112 x1 >>= 10; |
113 | 113 |
114 SkFixed slope = SkFDot6Div(x1 - x0, y1 - y0); | 114 SkFixed slope = SkFDot6Div(x1 - x0, y1 - y0); |
115 const int dy = SkEdge_Compute_DY(top, y0); | 115 const SkFDot6 dy = SkEdge_Compute_DY(top, y0); |
116 | 116 |
117 fX = SkFDot6ToFixed(x0 + SkFixedMul(slope, dy)); // + SK_Fixed1/2 | 117 fX = SkFDot6ToFixed(x0 + SkFixedMul(slope, dy)); // + SK_Fixed1/2 |
118 fDX = slope; | 118 fDX = slope; |
119 fFirstY = top; | 119 fFirstY = top; |
120 fLastY = bot - 1; | 120 fLastY = bot - 1; |
121 | 121 |
122 return 1; | 122 return 1; |
123 } | 123 } |
124 | 124 |
125 void SkEdge::chopLineWithClip(const SkIRect& clip) | 125 void SkEdge::chopLineWithClip(const SkIRect& clip) |
(...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
485 success = this->updateLine(oldx, oldy, newx, newy); | 485 success = this->updateLine(oldx, oldy, newx, newy); |
486 oldx = newx; | 486 oldx = newx; |
487 oldy = newy; | 487 oldy = newy; |
488 } while (count < 0 && !success); | 488 } while (count < 0 && !success); |
489 | 489 |
490 fCx = newx; | 490 fCx = newx; |
491 fCy = newy; | 491 fCy = newy; |
492 fCurveCount = SkToS8(count); | 492 fCurveCount = SkToS8(count); |
493 return success; | 493 return success; |
494 } | 494 } |
OLD | NEW |