void SkARGB32_Blitter::blitMask(const SkMask& mask, const SkIRect& clip) { SkASSERT(mask.fBounds.contains(clip)); SkASSERT(fSrcA != 0xFF); if (fSrcA == 0) { return; } if (mask.fFormat == SkMask::kBW_Format) { SkARGB32_BlendBW(fDevice, mask, clip, fPMColor, SkAlpha255To256(255 - fSrcA)); return; } int x = clip.fLeft; int y = clip.fTop; int width = clip.width(); int height = clip.height(); uint32_t* device = fDevice.getAddr32(x, y); const uint8_t* alpha = mask.getAddr(x, y); uint32_t srcColor = fPMColor; unsigned devRB = fDevice.rowBytes() - (width << 2); unsigned maskRB = mask.fRowBytes - width; do { int w = width; do { unsigned aa = *alpha++; *device = SkBlendARGB32(srcColor, *device, aa); device += 1; } while (--w != 0); device = (uint32_t*)((char*)device + devRB); alpha += maskRB; } while (--height != 0); }
void SkARGB32_Blitter::blitMask(const SkMask& mask, const SkIRect& clip) { SkASSERT(mask.fBounds.contains(clip)); SkASSERT(fSrcA != 0xFF); if (fSrcA == 0) { return; } if (mask.fFormat == SkMask::kBW_Format) { SkARGB32_BlendBW(fDevice, mask, clip, fPMColor, SkAlpha255To256(255 - fSrcA)); return; } else if (SkMask::kARGB32_Format == mask.fFormat) { SkARGB32_Blit32(fDevice, mask, clip, fPMColor); return; } else if (SkMask::kLCD16_Format == mask.fFormat) { blitmask_lcd16(fDevice, mask, clip, fPMColor); return; } else if (SkMask::kLCD32_Format == mask.fFormat) { blitmask_lcd32(fDevice, mask, clip, fPMColor); return; } int x = clip.fLeft; int y = clip.fTop; fBlitMaskProc(fDevice.getAddr32(x, y), fDevice.rowBytes(), SkBitmap::kARGB_8888_Config, mask.getAddr(x, y), mask.fRowBytes, fColor, clip.width(), clip.height()); }
void SkARGB32_Blitter::blitMask(const SkMask& mask, const SkIRect& clip) { SkASSERT(mask.fBounds.contains(clip)); SkASSERT(fSrcA != 0xFF); if (fSrcA == 0) { return; } if (SkBlitMask::BlitColor(fDevice, mask, clip, fColor)) { return; } if (mask.fFormat == SkMask::kBW_Format) { SkARGB32_BlendBW(fDevice, mask, clip, fPMColor, SkAlpha255To256(255 - fSrcA)); } else if (SkMask::kARGB32_Format == mask.fFormat) { SkARGB32_Blit32(fDevice, mask, clip, fPMColor); } }