本文整理汇总了C++中SkMask::getAddrLCD16方法的典型用法代码示例。如果您正苦于以下问题:C++ SkMask::getAddrLCD16方法的具体用法?C++ SkMask::getAddrLCD16怎么用?C++ SkMask::getAddrLCD16使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SkMask
的用法示例。
在下文中一共展示了SkMask::getAddrLCD16方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: blitMask
void SkRasterPipelineBlitter::blitMask(const SkMask& mask, const SkIRect& clip) {
if (mask.fFormat == SkMask::kBW_Format) {
// TODO: native BW masks?
return INHERITED::blitMask(mask, clip);
}
int x = clip.left();
for (int y = clip.top(); y < clip.bottom(); y++) {
auto dst = fDst.writable_addr(0,y);
SkRasterPipeline p;
p.extend(fShader);
p.extend(fColorFilter);
this->append_load_d(&p, dst);
p.extend(fXfermode);
switch (mask.fFormat) {
case SkMask::kA8_Format:
p.append<lerp_a8, lerp_a8_1>(mask.getAddr8(x,y)-x);
break;
case SkMask::kLCD16_Format:
p.append<lerp_lcd16, lerp_lcd16_1>(mask.getAddrLCD16(x,y)-x);
break;
default: break;
}
this->append_store(&p, dst);
p.run(x, clip.width());
}
}
示例2: blitMask
void SkRasterPipelineBlitter::blitMask(const SkMask& mask, const SkIRect& clip) {
if (mask.fFormat == SkMask::kBW_Format) {
// TODO: native BW masks?
return INHERITED::blitMask(mask, clip);
}
if (mask.fFormat == SkMask::kA8_Format && !fBlitMaskA8) {
SkRasterPipeline p(fAlloc);
p.extend(fColorPipeline);
if (fBlend == SkBlendMode::kSrcOver) {
p.append(SkRasterPipeline::scale_u8, &fMaskPtr);
this->append_load_d(&p);
this->append_blend(&p);
} else {
this->append_load_d(&p);
this->append_blend(&p);
p.append(SkRasterPipeline::lerp_u8, &fMaskPtr);
}
this->maybe_clamp(&p);
this->append_store(&p);
fBlitMaskA8 = p.compile();
}
if (mask.fFormat == SkMask::kLCD16_Format && !fBlitMaskLCD16) {
SkRasterPipeline p(fAlloc);
p.extend(fColorPipeline);
this->append_load_d(&p);
this->append_blend(&p);
p.append(SkRasterPipeline::lerp_565, &fMaskPtr);
this->maybe_clamp(&p);
this->append_store(&p);
fBlitMaskLCD16 = p.compile();
}
int x = clip.left();
for (int y = clip.top(); y < clip.bottom(); y++) {
fDstPtr = fDst.writable_addr(0,y);
this->maybe_shade(x,y,clip.width());
switch (mask.fFormat) {
case SkMask::kA8_Format:
fMaskPtr = mask.getAddr8(x,y)-x;
fBlitMaskA8(x,y,clip.width());
break;
case SkMask::kLCD16_Format:
fMaskPtr = mask.getAddrLCD16(x,y)-x;
fBlitMaskLCD16(x,y,clip.width());
break;
default:
// TODO
break;
}
}
}
示例3: while
static void blitmask_lcd16(const SkBitmap& device, const SkMask& mask,
const SkIRect& clip, SkPMColor srcColor) {
int x = clip.fLeft;
int y = clip.fTop;
int width = clip.width();
int height = clip.height();
SkPMColor* dstRow = device.getAddr32(x, y);
const uint16_t* srcRow = mask.getAddrLCD16(x, y);
do {
blit_lcd16_opaque(dstRow, srcRow, srcColor, width);
dstRow = (SkPMColor*)((char*)dstRow + device.rowBytes());
srcRow = (const uint16_t*)((const char*)srcRow + mask.fRowBytes);
} while (--height != 0);
}