当前位置: 首页>>代码示例>>C++>>正文


C++ SkWriteBuffer::writeFlattenable方法代码示例

本文整理汇总了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();
}
开发者ID:BertiKarsunke,项目名称:skia,代码行数:8,代码来源:SkFlattenableSerialization.cpp

示例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());
}
开发者ID:davidleen,项目名称:skia,代码行数:12,代码来源:SkImageFilter.cpp

示例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();
}
开发者ID:zwdsjl,项目名称:skia,代码行数:12,代码来源:ColorFilterTest.cpp

示例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.
}
开发者ID:Just-D,项目名称:skia,代码行数:13,代码来源:DashPathEffectTest.cpp

示例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);
}
开发者ID:HansMuller,项目名称:skia,代码行数:22,代码来源:SkPictureData.cpp

示例6: flatten

void SkColorFilterShader::flatten(SkWriteBuffer& buffer) const {
    buffer.writeFlattenable(fShader.get());
    buffer.writeFlattenable(fFilter.get());
}
开发者ID:03050903,项目名称:skia,代码行数:4,代码来源:SkColorFilterShader.cpp

示例7: flatten

void SkColorFilterImageFilter::flatten(SkWriteBuffer& buffer) const {
    this->INHERITED::flatten(buffer);
    buffer.writeFlattenable(fColorFilter.get());
}
开发者ID:blizardxsi,项目名称:123,代码行数:4,代码来源:SkColorFilterImageFilter.cpp

示例8: Flatten

 static void Flatten(SkWriteBuffer& buffer, const SkFlattenable& flattenable) {
     buffer.writeFlattenable(&flattenable);
 }
开发者ID:Nazi-Nigger,项目名称:gecko-dev,代码行数:3,代码来源:SkGPipeWrite.cpp

示例9: flatten

void SkComposeShader::flatten(SkWriteBuffer& buffer) const {
    buffer.writeFlattenable(fShaderA.get());
    buffer.writeFlattenable(fShaderB.get());
    buffer.writeFlattenable(fMode.get());
}
开发者ID:AHPlankton,项目名称:skia,代码行数:5,代码来源:SkComposeShader.cpp

示例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);
}
开发者ID:Crawping,项目名称:chromium_extract,代码行数:7,代码来源:SkPathEffect.cpp

示例11: flatten

 void flatten(SkWriteBuffer& buffer) const override {
     buffer.writeFlattenable(fCompoundDrawable.get());
     buffer.writeFlattenable(fIntDrawable.get());
     buffer.writeFlattenable(fDrawable.get());
 }
开发者ID:android,项目名称:platform_external_skia,代码行数:5,代码来源:FlattenDrawableTest.cpp

示例12: Flatten

 static void Flatten(SkWriteBuffer& buffer, const SkShader& shader) {
     buffer.writeFlattenable(&shader);
 }
开发者ID:Adenilson,项目名称:skia,代码行数:3,代码来源:BitmapHeapTest.cpp

示例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);
}
开发者ID:CodeSpeaker,项目名称:gecko-dev,代码行数:8,代码来源:SkPathEffect.cpp

示例14: flatten

void SkOpPE::flatten(SkWriteBuffer& buffer) const {
    buffer.writeFlattenable(fOne.get());
    buffer.writeFlattenable(fTwo.get());
    buffer.write32(fOp);
}
开发者ID:google,项目名称:skia,代码行数:5,代码来源:SkOpPathEffect.cpp

示例15: flatten

void SkNormalMapSourceImpl::flatten(SkWriteBuffer& buf) const {
    this->INHERITED::flatten(buf);

    buf.writeFlattenable(fMapShader.get());
    buf.writeMatrix(fInvCTM);
}
开发者ID:alphan102,项目名称:gecko-dev,代码行数:6,代码来源:SkNormalMapSource.cpp


注:本文中的SkWriteBuffer::writeFlattenable方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。