| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |