本文整理汇总了C++中SkPixmap::shiftPerPixel方法的典型用法代码示例。如果您正苦于以下问题:C++ SkPixmap::shiftPerPixel方法的具体用法?C++ SkPixmap::shiftPerPixel怎么用?C++ SkPixmap::shiftPerPixel使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SkPixmap
的用法示例。
在下文中一共展示了SkPixmap::shiftPerPixel方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: blitH
void SkRasterPipelineBlitter::blitH(int x, int y, int w) {
fDstPtr = fDst.writable_addr(0,y);
if (fCanMemsetInBlitH) {
switch (fDst.shiftPerPixel()) {
case 0: memset ((uint8_t *)fDstPtr + x, fMemsetColor, w); return;
case 1: sk_memset16((uint16_t*)fDstPtr + x, fMemsetColor, w); return;
case 2: sk_memset32((uint32_t*)fDstPtr + x, fMemsetColor, w); return;
case 3: sk_memset64((uint64_t*)fDstPtr + x, fMemsetColor, w); return;
default: break;
}
}
if (!fBlitH) {
SkRasterPipeline p(fAlloc);
p.extend(fColorPipeline);
if (fBlend == SkBlendMode::kSrcOver
&& fDst.info().colorType() == kRGBA_8888_SkColorType
&& !fDst.colorSpace()
&& fDst.info().alphaType() != kUnpremul_SkAlphaType
&& fDitherRate == 0.0f) {
p.append(SkRasterPipeline::srcover_rgba_8888, &fDstPtr);
} else {
if (fBlend != SkBlendMode::kSrc) {
this->append_load_d(&p);
this->append_blend(&p);
this->maybe_clamp(&p);
}
this->append_store(&p);
}
fBlitH = p.compile();
}
this->maybe_shade(x,y,w);
fBlitH(x,y,w);
}
示例2: blitH
void SkRasterPipelineBlitter::blitH(int x, int y, int w) {
fDstPtr = fDst.writable_addr(0,y);
fCurrentY = y;
if (fCanMemsetInBlitH) {
switch (fDst.shiftPerPixel()) {
case 0: memset ((uint8_t *)fDstPtr + x, fMemsetColor, w); return;
case 1: sk_memset16((uint16_t*)fDstPtr + x, fMemsetColor, w); return;
case 2: sk_memset32((uint32_t*)fDstPtr + x, fMemsetColor, w); return;
case 3: sk_memset64((uint64_t*)fDstPtr + x, fMemsetColor, w); return;
default: break;
}
}
auto& p = fBlitH;
if (p.empty()) {
p.extend(fShader);
if (fBlend != SkBlendMode::kSrc) {
this->append_load_d(&p);
this->append_blend(&p);
this->maybe_clamp(&p);
}
this->append_store(&p);
}
p.run(x,w);
}