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

Side by Side Diff: src/effects/gradients/SkClampRange.h

Issue 886473003: add more checks for computing clamp counts, remove dead code (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: update comment on overflow test Created 5 years, 10 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 | « no previous file | src/effects/gradients/SkClampRange.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 * 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
(...skipping 17 matching lines...) Expand all
28 struct SkClampRange { 28 struct SkClampRange {
29 int fCount0; // count for fV0 29 int fCount0; // count for fV0
30 int fCount1; // count for interpolating (fV0...fV1) 30 int fCount1; // count for interpolating (fV0...fV1)
31 int fCount2; // count for fV1 31 int fCount2; // count for fV1
32 SkGradFixed fFx1; // initial fx value for the fCount1 range. 32 SkGradFixed fFx1; // initial fx value for the fCount1 range.
33 // only valid if fCount1 > 0 33 // only valid if fCount1 > 0
34 int fV0, fV1; 34 int fV0, fV1;
35 35
36 void init(SkGradFixed fx, SkGradFixed dx, int count, int v0, int v1); 36 void init(SkGradFixed fx, SkGradFixed dx, int count, int v0, int v1);
37 37
38 void validate(int count) const {
39 #ifdef SK_DEBUG
40 SkASSERT(fCount0 >= 0);
41 SkASSERT(fCount1 >= 0);
42 SkASSERT(fCount2 >= 0);
43 SkASSERT(fCount0 + fCount1 + fCount2 == count);
44 #endif
45 }
46
38 private: 47 private:
39 void initFor1(SkGradFixed fx); 48 void initFor1(SkGradFixed fx);
40 }; 49 };
41 50
42 #endif 51 #endif
OLDNEW
« no previous file with comments | « no previous file | src/effects/gradients/SkClampRange.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698