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

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

Issue 2221103002: Analytic AntiAlias for Convex Shapes (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix alpha computation Created 4 years, 4 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
OLDNEW
1 /* 1 /*
2 * Copyright 2006 The Android Open Source Project 2 * Copyright 2006 The Android Open Source Project
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 8
9 #ifndef SkAntiRun_DEFINED 9 #ifndef SkAntiRun_DEFINED
10 #define SkAntiRun_DEFINED 10 #define SkAntiRun_DEFINED
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 x = 0; 72 x = 0;
73 SkDEBUGCODE(this->validate();) 73 SkDEBUGCODE(this->validate();)
74 } 74 }
75 75
76 if (middleCount) { 76 if (middleCount) {
77 SkAlphaRuns::Break(runs, alpha, x, middleCount); 77 SkAlphaRuns::Break(runs, alpha, x, middleCount);
78 alpha += x; 78 alpha += x;
79 runs += x; 79 runs += x;
80 x = 0; 80 x = 0;
81 do { 81 do {
82 alpha[0] = SkToU8(alpha[0] + maxValue); 82 alpha[0] = SkToU8(SkTMin<int>(0xFF, alpha[0] + maxValue));
reed1 2016/08/18 20:31:00 is this needed today, or just with your CL? If tod
liyuqian 2016/08/22 15:30:48 I don't think that the current supersampling algor
83 int n = runs[0]; 83 int n = runs[0];
84 SkASSERT(n <= middleCount); 84 SkASSERT(n <= middleCount);
85 alpha += n; 85 alpha += n;
86 runs += n; 86 runs += n;
87 middleCount -= n; 87 middleCount -= n;
88 } while (middleCount > 0); 88 } while (middleCount > 0);
89 SkDEBUGCODE(this->validate();) 89 SkDEBUGCODE(this->validate();)
90 lastAlpha = alpha; 90 lastAlpha = alpha;
91 } 91 }
92 92
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 x -= n; 181 x -= n;
182 } 182 }
183 } 183 }
184 184
185 private: 185 private:
186 SkDEBUGCODE(int fWidth;) 186 SkDEBUGCODE(int fWidth;)
187 SkDEBUGCODE(void validate() const;) 187 SkDEBUGCODE(void validate() const;)
188 }; 188 };
189 189
190 #endif 190 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698