本文整理汇总了C++中SkWriteBuffer::writeFlattenable方法的典型用法代码示例。如果您正苦于以下问题:C++ SkWriteBuffer::writeFlattenable方法的具体用法?C++ SkWriteBuffer::writeFlattenable怎么用?C++ SkWriteBuffer::writeFlattenable使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SkWriteBuffer
的用法示例。
在下文中一共展示了SkWriteBuffer::writeFlattenable方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SkValidatingSerializeFlattenable
SkData* SkValidatingSerializeFlattenable(SkFlattenable* flattenable) {
SkWriteBuffer writer;
writer.writeFlattenable(flattenable);
size_t size = writer.bytesWritten();
auto data = SkData::MakeUninitialized(size);
writer.writeToMemory(data->writable_data());
return data.release();
}
示例2: flatten
void SkImageFilter::flatten(SkWriteBuffer& buffer) const {
buffer.writeInt(fInputCount);
for (int i = 0; i < fInputCount; i++) {
SkImageFilter* input = this->getInput(i);
buffer.writeBool(input != nullptr);
if (input != nullptr) {
buffer.writeFlattenable(input);
}
}
buffer.writeRect(fCropRect.rect());
buffer.writeUInt(fCropRect.flags());
}
示例3: rb
static sk_sp<SkColorFilter> reincarnate_colorfilter(SkFlattenable* obj) {
SkWriteBuffer wb;
wb.writeFlattenable(obj);
size_t size = wb.bytesWritten();
SkAutoSMalloc<1024> storage(size);
// make a copy into storage
wb.writeToMemory(storage.get());
SkReadBuffer rb(storage.get(), size);
return rb.readColorFilter();
}
示例4: dash
DEF_TEST(DashPathEffectTest_crbug_348821, r) {
SkScalar intervals[] = { 1.76934361e+36f, 2.80259693e-45f }; // Values from bug.
const int count = 2;
SkScalar phase = SK_ScalarInfinity; // Used to force the bad fInitialDashLength = -1 path.
SkAutoTUnref<SkDashPathEffect> dash(SkDashPathEffect::Create(intervals, count, phase));
// nullptr -> refuses to work with flattening framework.
REPORTER_ASSERT(r, dash->getFactory() != nullptr);
SkWriteBuffer buffer;
buffer.writeFlattenable(dash);
REPORTER_ASSERT(r, buffer.bytesWritten() > 12); // We'd write 12 if broken, >=40 if not.
}
示例5: flatten
void SkPictureData::flatten(SkWriteBuffer& buffer) const {
write_tag_size(buffer, SK_PICT_READER_TAG, fOpData->size());
buffer.writeByteArray(fOpData->bytes(), fOpData->size());
if (fPictureCount > 0) {
write_tag_size(buffer, SK_PICT_PICTURE_TAG, fPictureCount);
for (int i = 0; i < fPictureCount; i++) {
fPictureRefs[i]->flatten(buffer);
}
}
if (fDrawableCount > 0) {
write_tag_size(buffer, SK_PICT_DRAWABLE_TAG, fDrawableCount);
for (int i = 0; i < fDrawableCount; i++) {
buffer.writeFlattenable(fDrawableRefs[i]);
}
}
// Write this picture playback's data into a writebuffer
this->flattenToBuffer(buffer);
buffer.write32(SK_PICT_EOF_TAG);
}
示例6: flatten
void SkColorFilterShader::flatten(SkWriteBuffer& buffer) const {
buffer.writeFlattenable(fShader.get());
buffer.writeFlattenable(fFilter.get());
}
示例7: flatten
void SkColorFilterImageFilter::flatten(SkWriteBuffer& buffer) const {
this->INHERITED::flatten(buffer);
buffer.writeFlattenable(fColorFilter.get());
}
示例8: Flatten
static void Flatten(SkWriteBuffer& buffer, const SkFlattenable& flattenable) {
buffer.writeFlattenable(&flattenable);
}
示例9: flatten
void SkComposeShader::flatten(SkWriteBuffer& buffer) const {
buffer.writeFlattenable(fShaderA.get());
buffer.writeFlattenable(fShaderB.get());
buffer.writeFlattenable(fMode.get());
}
示例10: flatten
/*
Format: [oe0-factory][pe1-factory][pe0-size][pe0-data][pe1-data]
*/
void SkPairPathEffect::flatten(SkWriteBuffer& buffer) const {
buffer.writeFlattenable(fPE0);
buffer.writeFlattenable(fPE1);
}
示例11: flatten
void flatten(SkWriteBuffer& buffer) const override {
buffer.writeFlattenable(fCompoundDrawable.get());
buffer.writeFlattenable(fIntDrawable.get());
buffer.writeFlattenable(fDrawable.get());
}
示例12: Flatten
static void Flatten(SkWriteBuffer& buffer, const SkShader& shader) {
buffer.writeFlattenable(&shader);
}
示例13: flatten
/*
Format: [oe0-factory][pe1-factory][pe0-size][pe0-data][pe1-data]
*/
void SkPairPathEffect::flatten(SkWriteBuffer& buffer) const {
this->INHERITED::flatten(buffer);
buffer.writeFlattenable(fPE0);
buffer.writeFlattenable(fPE1);
}
示例14: flatten
void SkOpPE::flatten(SkWriteBuffer& buffer) const {
buffer.writeFlattenable(fOne.get());
buffer.writeFlattenable(fTwo.get());
buffer.write32(fOp);
}
示例15: flatten
void SkNormalMapSourceImpl::flatten(SkWriteBuffer& buf) const {
this->INHERITED::flatten(buf);
buf.writeFlattenable(fMapShader.get());
buf.writeMatrix(fInvCTM);
}