LEFT | RIGHT |
(no file at all) | |
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 #include "SkCoreBlitters.h" | 8 #include "SkCoreBlitters.h" |
9 #include "SkColorPriv.h" | 9 #include "SkColorPriv.h" |
10 #include "SkShader.h" | 10 #include "SkShader.h" |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 return; | 187 return; |
188 } | 188 } |
189 | 189 |
190 uint32_t* device = fDevice.getAddr32(x, y); | 190 uint32_t* device = fDevice.getAddr32(x, y); |
191 uint32_t color = fPMColor; | 191 uint32_t color = fPMColor; |
192 | 192 |
193 if (alpha != 255) { | 193 if (alpha != 255) { |
194 color = SkAlphaMulQ(color, SkAlpha255To256(alpha)); | 194 color = SkAlphaMulQ(color, SkAlpha255To256(alpha)); |
195 } | 195 } |
196 | 196 |
197 unsigned dst_scale = 255 - SkGetPackedA32(color); | 197 unsigned dst_scale = 256 - SkGetPackedA32(color); |
198 uint32_t rowBytes = fDevice.rowBytes(); | 198 uint32_t rowBytes = fDevice.rowBytes(); |
199 while (--height >= 0) { | 199 while (--height >= 0) { |
200 device[0] = color + SkAlphaMulQ(device[0], dst_scale); | 200 device[0] = color + SkAlphaMulQ(device[0], dst_scale); |
201 device = (uint32_t*)((char*)device + rowBytes); | 201 device = (uint32_t*)((char*)device + rowBytes); |
202 } | 202 } |
203 } | 203 } |
204 | 204 |
205 void SkARGB32_Blitter::blitRect(int x, int y, int width, int height) { | 205 void SkARGB32_Blitter::blitRect(int x, int y, int width, int height) { |
206 SkASSERT(x >= 0 && y >= 0 && x + width <= fDevice.width() && y + height <= f
Device.height()); | 206 SkASSERT(x >= 0 && y >= 0 && x + width <= fDevice.width() && y + height <= f
Device.height()); |
207 | 207 |
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
422 do { | 422 do { |
423 shader->shadeSpan(x, y, span, width); | 423 shader->shadeSpan(x, y, span, width); |
424 proc(dstRow, maskRow, span, width); | 424 proc(dstRow, maskRow, span, width); |
425 dstRow += dstRB; | 425 dstRow += dstRB; |
426 maskRow += maskRB; | 426 maskRow += maskRB; |
427 y += 1; | 427 y += 1; |
428 } while (--height > 0); | 428 } while (--height > 0); |
429 } | 429 } |
430 } | 430 } |
431 | 431 |
LEFT | RIGHT |