Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(73)

Side by Side Diff: src/core/SkEdge.cpp

Issue 960353005: Use proper SkFDot6 instead of int (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: follow comments#6: int->SkFDot6 and remove other code Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/core/SkEdge.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
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 }
OLDNEW
« no previous file with comments | « src/core/SkEdge.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698