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

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

Issue 1503423003: ubsan shift fixes (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: add cast to work around win compiler Created 5 years 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/SkBitmapProcState_matrixProcs.cpp ('k') | src/core/SkEdge.cpp » ('j') | 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 #ifndef SkEdge_DEFINED 10 #ifndef SkEdge_DEFINED
11 #define SkEdge_DEFINED 11 #define SkEdge_DEFINED
12 12
13 #include "SkRect.h" 13 #include "SkRect.h"
14 #include "SkFDot6.h" 14 #include "SkFDot6.h"
15 #include "SkMath.h" 15 #include "SkMath.h"
16 16
17 // This correctly favors the lower-pixel when y0 is on a 1/2 pixel boundary 17 // This correctly favors the lower-pixel when y0 is on a 1/2 pixel boundary
18 #define SkEdge_Compute_DY(top, y0) ((top << 6) + 32 - (y0)) 18 #define SkEdge_Compute_DY(top, y0) (SkLeftShift(top, 6) + 32 - (y0))
19 19
20 struct SkEdge { 20 struct SkEdge {
21 enum Type { 21 enum Type {
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;
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 fFirstY = top; 126 fFirstY = top;
127 fLastY = bot - 1; 127 fLastY = bot - 1;
128 fCurveCount = 0; 128 fCurveCount = 0;
129 fWinding = SkToS8(winding); 129 fWinding = SkToS8(winding);
130 fCurveShift = 0; 130 fCurveShift = 0;
131 return 1; 131 return 1;
132 } 132 }
133 133
134 134
135 #endif 135 #endif
OLDNEW
« no previous file with comments | « src/core/SkBitmapProcState_matrixProcs.cpp ('k') | src/core/SkEdge.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698