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

Side by Side Diff: trunk/src/core/SkBlitBWMaskTemplate.h

Issue 13044012: fix mask error for BW text, where I forgot to look at just the low-8 bits (Closed) Base URL: http://skia.googlecode.com/svn/
Patch Set: Created 7 years, 9 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 | Annotate | Revision Log
« 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 #include "SkBitmap.h" 10 #include "SkBitmap.h"
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
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