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

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

Issue 1506253002: Remove no-op code in SkAlphaRuns::add (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Delete the meaningless line instead 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 | « no previous file | 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 #ifndef SkAntiRun_DEFINED 10 #ifndef SkAntiRun_DEFINED
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 edge of the current span round to the same super-sampled x value , 64 edge of the current span round to the same super-sampled x value ,
65 I might overflow to 256 with this add, hence the funny subtract (crud). 65 I might overflow to 256 with this add, hence the funny subtract (crud).
66 */ 66 */
67 unsigned tmp = alpha[x] + startAlpha; 67 unsigned tmp = alpha[x] + startAlpha;
68 SkASSERT(tmp <= 256); 68 SkASSERT(tmp <= 256);
69 alpha[x] = SkToU8(tmp - (tmp >> 8)); // was (tmp >> 7), but that seems wrong if we're trying to catch 256 69 alpha[x] = SkToU8(tmp - (tmp >> 8)); // was (tmp >> 7), but that seems wrong if we're trying to catch 256
70 70
71 runs += x + 1; 71 runs += x + 1;
72 alpha += x + 1; 72 alpha += x + 1;
73 x = 0; 73 x = 0;
74 lastAlpha += x; // we don't want the +1
75 SkDEBUGCODE(this->validate();) 74 SkDEBUGCODE(this->validate();)
76 } 75 }
77 76
78 if (middleCount) { 77 if (middleCount) {
79 SkAlphaRuns::Break(runs, alpha, x, middleCount); 78 SkAlphaRuns::Break(runs, alpha, x, middleCount);
80 alpha += x; 79 alpha += x;
81 runs += x; 80 runs += x;
82 x = 0; 81 x = 0;
83 do { 82 do {
84 alpha[0] = SkToU8(alpha[0] + maxValue); 83 alpha[0] = SkToU8(alpha[0] + maxValue);
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 x -= n; 182 x -= n;
184 } 183 }
185 } 184 }
186 185
187 private: 186 private:
188 SkDEBUGCODE(int fWidth;) 187 SkDEBUGCODE(int fWidth;)
189 SkDEBUGCODE(void validate() const;) 188 SkDEBUGCODE(void validate() const;)
190 }; 189 };
191 190
192 #endif 191 #endif
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698