本文整理汇总了C++中SkMask::rowWordsLCD方法的典型用法代码示例。如果您正苦于以下问题:C++ SkMask::rowWordsLCD方法的具体用法?C++ SkMask::rowWordsLCD怎么用?C++ SkMask::rowWordsLCD使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SkMask
的用法示例。
在下文中一共展示了SkMask::rowWordsLCD方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SkASSERT
void SkARGB32_Opaque_Blitter::blitMask(const SkMask& mask,
const SkIRect& clip) {
SkASSERT(mask.fBounds.contains(clip));
if (mask.fFormat == SkMask::kBW_Format) {
SkARGB32_BlitBW(fDevice, mask, clip, fPMColor);
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;
}
int x = clip.fLeft;
int y = clip.fTop;
int width = clip.width();
int height = clip.height();
#if defined(SK_SUPPORT_LCDTEXT)
const bool lcdMode = mask.fFormat == SkMask::kHorizontalLCD_Format;
const bool verticalLCDMode = mask.fFormat == SkMask::kVerticalLCD_Format;
// In LCD mode the masks have either an extra couple of rows or columns on the edges.
if (lcdMode || verticalLCDMode) {
int widthAdjustment, heightAdjustment;
const uint32_t* alpha32;
uint32_t* device = adjustForSubpixelClip(mask, clip, fDevice, &widthAdjustment, &heightAdjustment, &alpha32);
width += widthAdjustment;
height += heightAdjustment;
unsigned devRB = fDevice.rowBytes() - (width << 2);
unsigned alphaExtraRowWords = mask.rowWordsLCD() - width;
SkPMColor srcColor = fPMColor;
do {
unsigned w = width;
do {
const uint32_t alphaPixel = *alpha32++;
const uint32_t originalPixel = *device;
*device++ = BlendLCDPixelWithOpaqueColor(alphaPixel, originalPixel, srcColor);
} while (--w != 0);
device = (uint32_t*)((char*)device + devRB);
alpha32 += alphaExtraRowWords;
} while (--height != 0);
return;
}
#endif
fBlitMaskProc(fDevice.getAddr32(x, y), fDevice.rowBytes(),
SkBitmap::kARGB_8888_Config,
mask.getAddr(x, y), mask.fRowBytes, fColor, width, height);
}