OLD | NEW |
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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 } | 55 } |
56 | 56 |
57 const SkPixmap* SkARGB32_Blitter::justAnOpaqueColor(uint32_t* value) { | 57 const SkPixmap* SkARGB32_Blitter::justAnOpaqueColor(uint32_t* value) { |
58 if (255 == fSrcA) { | 58 if (255 == fSrcA) { |
59 *value = fPMColor; | 59 *value = fPMColor; |
60 return &fDevice; | 60 return &fDevice; |
61 } | 61 } |
62 return nullptr; | 62 return nullptr; |
63 } | 63 } |
64 | 64 |
65 #if defined _WIN32 && _MSC_VER >= 1300 // disable warning : local variable used
without having been initialized | 65 #if defined _WIN32 // disable warning : local variable used without having been
initialized |
66 #pragma warning ( push ) | 66 #pragma warning ( push ) |
67 #pragma warning ( disable : 4701 ) | 67 #pragma warning ( disable : 4701 ) |
68 #endif | 68 #endif |
69 | 69 |
70 void SkARGB32_Blitter::blitH(int x, int y, int width) { | 70 void SkARGB32_Blitter::blitH(int x, int y, int width) { |
71 SkASSERT(x >= 0 && y >= 0 && x + width <= fDevice.width()); | 71 SkASSERT(x >= 0 && y >= 0 && x + width <= fDevice.width()); |
72 | 72 |
73 uint32_t* device = fDevice.writable_addr32(x, y); | 73 uint32_t* device = fDevice.writable_addr32(x, y); |
74 SkBlitRow::Color32(device, device, width, fPMColor); | 74 SkBlitRow::Color32(device, device, width, fPMColor); |
75 } | 75 } |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
245 uint32_t* device = fDevice.writable_addr32(x, y); | 245 uint32_t* device = fDevice.writable_addr32(x, y); |
246 uint32_t color = fPMColor; | 246 uint32_t color = fPMColor; |
247 size_t rowBytes = fDevice.rowBytes(); | 247 size_t rowBytes = fDevice.rowBytes(); |
248 | 248 |
249 while (--height >= 0) { | 249 while (--height >= 0) { |
250 SkBlitRow::Color32(device, device, width, color); | 250 SkBlitRow::Color32(device, device, width, color); |
251 device = (uint32_t*)((char*)device + rowBytes); | 251 device = (uint32_t*)((char*)device + rowBytes); |
252 } | 252 } |
253 } | 253 } |
254 | 254 |
255 #if defined _WIN32 && _MSC_VER >= 1300 | 255 #if defined _WIN32 |
256 #pragma warning ( pop ) | 256 #pragma warning ( pop ) |
257 #endif | 257 #endif |
258 | 258 |
259 /////////////////////////////////////////////////////////////////////// | 259 /////////////////////////////////////////////////////////////////////// |
260 | 260 |
261 void SkARGB32_Black_Blitter::blitAntiH(int x, int y, const SkAlpha antialias[], | 261 void SkARGB32_Black_Blitter::blitAntiH(int x, int y, const SkAlpha antialias[], |
262 const int16_t runs[]) { | 262 const int16_t runs[]) { |
263 uint32_t* device = fDevice.writable_addr32(x, y); | 263 uint32_t* device = fDevice.writable_addr32(x, y); |
264 SkPMColor black = (SkPMColor)(SK_A32_MASK << SK_A32_SHIFT); | 264 SkPMColor black = (SkPMColor)(SK_A32_MASK << SK_A32_SHIFT); |
265 | 265 |
(...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
676 SkBlitRow::Proc32 proc = (255 == alpha) ? fProc32 : fProc32Blend; | 676 SkBlitRow::Proc32 proc = (255 == alpha) ? fProc32 : fProc32Blend; |
677 do { | 677 do { |
678 shaderContext->shadeSpan(x, y, span, 1); | 678 shaderContext->shadeSpan(x, y, span, 1); |
679 proc(device, span, 1, alpha); | 679 proc(device, span, 1, alpha); |
680 y += 1; | 680 y += 1; |
681 device = (uint32_t*)((char*)device + deviceRB); | 681 device = (uint32_t*)((char*)device + deviceRB); |
682 } while (--height > 0); | 682 } while (--height > 0); |
683 } | 683 } |
684 } | 684 } |
685 } | 685 } |
OLD | NEW |