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

Side by Side Diff: src/effects/gradients/SkClampRange.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/SkUtils.cpp ('k') | src/effects/gradients/SkGradientShaderPriv.h » ('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 * Copyright 2011 Google Inc. 2 * Copyright 2011 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #ifndef SkClampRange_DEFINED 8 #ifndef SkClampRange_DEFINED
9 #define SkClampRange_DEFINED 9 #define SkClampRange_DEFINED
10 10
11 #include "SkFixed.h" 11 #include "SkFixed.h"
12 #include "SkScalar.h" 12 #include "SkScalar.h"
13 13
14 #define SkGradFixed SkFixed3232 14 #define SkGradFixed SkFixed3232
15 #define SkScalarToGradFixed SkScalarToFixed3232 15 #define SkScalarToGradFixed(x) SkScalarToFixed3232(x)
16 #define SkFixedToGradFixed SkFixedToFixed3232 16 #define SkFixedToGradFixed(x) SkFixedToFixed3232(x)
17 #define SkGradFixedToFixed(x) (SkFixed)((x) >> 16) 17 #define SkGradFixedToFixed(x) (SkFixed)((x) >> 16)
18 #define kFracMax_SkGradFixed 0xFFFFFFFFLL 18 #define kFracMax_SkGradFixed 0xFFFFFFFFLL
19 19
20 /** 20 /**
21 * Iteration fixed fx by dx, clamping as you go to [0..kFracMax_SkGradFixed], t his class 21 * Iteration fixed fx by dx, clamping as you go to [0..kFracMax_SkGradFixed], t his class
22 * computes the (up to) 3 spans there are: 22 * computes the (up to) 3 spans there are:
23 * 23 *
24 * range0: use constant value V0 24 * range0: use constant value V0
25 * range1: iterate as usual fx += dx 25 * range1: iterate as usual fx += dx
26 * range2: use constant value V1 26 * range2: use constant value V1
(...skipping 15 matching lines...) Expand all
42 SkASSERT(fCount2 >= 0); 42 SkASSERT(fCount2 >= 0);
43 SkASSERT(fCount0 + fCount1 + fCount2 == count); 43 SkASSERT(fCount0 + fCount1 + fCount2 == count);
44 #endif 44 #endif
45 } 45 }
46 46
47 private: 47 private:
48 void initFor1(SkGradFixed fx); 48 void initFor1(SkGradFixed fx);
49 }; 49 };
50 50
51 #endif 51 #endif
OLDNEW
« no previous file with comments | « src/core/SkUtils.cpp ('k') | src/effects/gradients/SkGradientShaderPriv.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698