| 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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 } | 59 } |
| 60 | 60 |
| 61 int top = SkFDot6Round(y0); | 61 int top = SkFDot6Round(y0); |
| 62 int bot = SkFDot6Round(y1); | 62 int bot = SkFDot6Round(y1); |
| 63 | 63 |
| 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 (NULL != 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 int 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; |
| (...skipping 405 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 |