本文整理汇总了C++中SkRegion::writeToMemory方法的典型用法代码示例。如果您正苦于以下问题:C++ SkRegion::writeToMemory方法的具体用法?C++ SkRegion::writeToMemory怎么用?C++ SkRegion::writeToMemory使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SkRegion
的用法示例。
在下文中一共展示了SkRegion::writeToMemory方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: onDrawRegion
void SkPipeCanvas::onDrawRegion(const SkRegion& region, const SkPaint& paint) {
size_t size = region.writeToMemory(nullptr);
unsigned extra = 0;
if (fits_in(size, 24)) {
extra = SkToUInt(size);
}
SkPipeWriter writer(this);
writer.write32(pack_verb(SkPipeVerb::kDrawRegion, extra));
if (0 == extra) {
writer.write32(size);
}
SkAutoSMalloc<2048> storage(size);
region.writeToMemory(storage.get());
write_pad(&writer, storage.get(), size);
write_paint(writer, paint, kGeometry_PaintUsage);
}
示例2: onClipRegion
void SkGPipeCanvas::onClipRegion(const SkRegion& region, SkRegion::Op rgnOp) {
NOTIFY_SETUP(this);
if (this->needOpBytes(region.writeToMemory(nullptr))) {
this->writeOp(kClipRegion_DrawOp, 0, rgnOp);
fWriter.writeRegion(region);
}
this->INHERITED::onClipRegion(region, rgnOp);
}
示例3: onDrawRegion
void SkPictureRecord::onDrawRegion(const SkRegion& region, const SkPaint& paint) {
// op + paint index + region
size_t regionBytes = region.writeToMemory(nullptr);
size_t size = 2 * kUInt32Size + regionBytes;
size_t initialOffset = this->addDraw(DRAW_REGION, &size);
this->addPaint(paint);
fWriter.writeRegion(region);
this->validate(initialOffset, size);
}
示例4: recordClipRegion
size_t SkPictureRecord::recordClipRegion(const SkRegion& region, SkClipOp op) {
// op + clip params + region
size_t size = 2 * kUInt32Size + region.writeToMemory(nullptr);
// recordRestoreOffsetPlaceholder doesn't always write an offset
if (!fRestoreOffsetStack.isEmpty()) {
// + restore offset
size += kUInt32Size;
}
size_t initialOffset = this->addDraw(CLIP_REGION, &size);
this->addRegion(region);
this->addInt(ClipParams_pack(op, false));
size_t offset = this->recordRestoreOffsetPlaceholder(op);
this->validate(initialOffset, size);
return offset;
}