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 #include "SkBitmap.h" | 10 #include "SkBitmap.h" |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 } | 56 } |
57 else | 57 else |
58 { | 58 { |
59 int left_edge = cx - maskLeft; | 59 int left_edge = cx - maskLeft; |
60 SkASSERT(left_edge >= 0); | 60 SkASSERT(left_edge >= 0); |
61 int rite_edge = clip.fRight - maskLeft; | 61 int rite_edge = clip.fRight - maskLeft; |
62 SkASSERT(rite_edge > left_edge); | 62 SkASSERT(rite_edge > left_edge); |
63 | 63 |
64 int left_mask = 0xFF >> (left_edge & 7); | 64 int left_mask = 0xFF >> (left_edge & 7); |
65 int rite_mask = 0xFF << (8 - (rite_edge & 7)); | 65 int rite_mask = 0xFF << (8 - (rite_edge & 7)); |
| 66 rite_mask &= 0xFF; // only want low-8 bits of mask |
66 int full_runs = (rite_edge >> 3) - ((left_edge + 7) >> 3); | 67 int full_runs = (rite_edge >> 3) - ((left_edge + 7) >> 3); |
67 | 68 |
68 // check for empty right mask, so we don't read off the end (or go slowe
r than we need to) | 69 // check for empty right mask, so we don't read off the end (or go slowe
r than we need to) |
69 if (rite_mask == 0) | 70 if (rite_mask == 0) |
70 { | 71 { |
71 SkASSERT(full_runs >= 0); | 72 SkASSERT(full_runs >= 0); |
72 full_runs -= 1; | 73 full_runs -= 1; |
73 rite_mask = 0xFF; | 74 rite_mask = 0xFF; |
74 } | 75 } |
75 if (left_mask == 0xFF) | 76 if (left_mask == 0xFF) |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 } | 121 } |
121 } | 122 } |
122 } | 123 } |
123 | 124 |
124 #undef SK_BLITBWMASK_NAME | 125 #undef SK_BLITBWMASK_NAME |
125 #undef SK_BLITBWMASK_ARGS | 126 #undef SK_BLITBWMASK_ARGS |
126 #undef SK_BLITBWMASK_BLIT8 | 127 #undef SK_BLITBWMASK_BLIT8 |
127 #undef SK_BLITBWMASK_GETADDR | 128 #undef SK_BLITBWMASK_GETADDR |
128 #undef SK_BLITBWMASK_DEVTYPE | 129 #undef SK_BLITBWMASK_DEVTYPE |
129 #undef SK_BLITBWMASK_DOROWSETUP | 130 #undef SK_BLITBWMASK_DOROWSETUP |
OLD | NEW |