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


C++ SkFlattenableReadBuffer::getArrayCount方法代码示例

本文整理汇总了C++中SkFlattenableReadBuffer::getArrayCount方法的典型用法代码示例。如果您正苦于以下问题:C++ SkFlattenableReadBuffer::getArrayCount方法的具体用法?C++ SkFlattenableReadBuffer::getArrayCount怎么用?C++ SkFlattenableReadBuffer::getArrayCount使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SkFlattenableReadBuffer的用法示例。


在下文中一共展示了SkFlattenableReadBuffer::getArrayCount方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: INHERITED

SkGradientShaderBase::SkGradientShaderBase(SkFlattenableReadBuffer& buffer) :
    INHERITED(buffer) {
    fCacheAlpha = 256;

    fMapper = buffer.readFlattenableT<SkUnitMapper>();

    fCache16 = fCache16Storage = NULL;
    fCache32 = NULL;
    fCache32PixelRef = NULL;

    int colorCount = fColorCount = buffer.getArrayCount();
    if (colorCount > kColorStorageCount) {
        size_t size = sizeof(SkColor) + sizeof(SkPMColor) + sizeof(Rec);
        fOrigColors = (SkColor*)sk_malloc_throw(size * colorCount);
    } else {
        fOrigColors = fStorage;
    }
    buffer.readColorArray(fOrigColors);

    fTileMode = (TileMode)buffer.readUInt();
    fTileProc = gTileProcs[fTileMode];
    fRecs = (Rec*)(fOrigColors + colorCount);
    if (colorCount > 2) {
        Rec* recs = fRecs;
        recs[0].fPos = 0;
        for (int i = 1; i < colorCount; i++) {
            recs[i].fPos = buffer.readInt();
            recs[i].fScale = buffer.readUInt();
        }
    }
    buffer.readMatrix(&fPtsToUnit);
    this->initCommon();
}
开发者ID:mikeaich,项目名称:releases-mozilla-central,代码行数:33,代码来源:SkGradientShader.cpp

示例2: INHERITED

SkDashPathEffect::SkDashPathEffect(SkFlattenableReadBuffer& buffer) : INHERITED(buffer) {
    fInitialDashIndex = buffer.readInt();
    fInitialDashLength = buffer.readScalar();
    fIntervalLength = buffer.readScalar();
    fScaleToFit = buffer.readBool();

    fCount = buffer.getArrayCount();
    fIntervals = (SkScalar*)sk_malloc_throw(sizeof(SkScalar) * fCount);
    buffer.readScalarArray(fIntervals);
}
开发者ID:killvxk,项目名称:KUI,代码行数:10,代码来源:SkDashPathEffect.cpp

示例3: INHERITED

SkMergeImageFilter::SkMergeImageFilter(SkFlattenableReadBuffer& buffer) : INHERITED(buffer) {
    bool hasModes = buffer.readBool();
    if (hasModes) {
        this->initAllocModes();
        SkASSERT(buffer.getArrayCount() == countInputs() * sizeof(fModes[0]));
        buffer.readByteArray(fModes);
    } else {
        fModes = 0;
    }
}
开发者ID:ConradIrwin,项目名称:gecko-dev,代码行数:10,代码来源:SkMergeImageFilter.cpp

示例4: INHERITED

SkImageRef::SkImageRef(SkFlattenableReadBuffer& buffer)
        : INHERITED(buffer, &gImageRefMutex), fErrorInDecoding(false) {
    fConfig = (SkBitmap::Config)buffer.readUInt();
    fSampleSize = buffer.readInt();
    fDoDither = buffer.readBool();

    size_t length = buffer.getArrayCount();
    fStream = SkNEW_ARGS(SkMemoryStream, (length));
    buffer.readByteArray((void*)fStream->getMemoryBase());

    fPrev = fNext = NULL;
    fFactory = NULL;
}
开发者ID:Cue,项目名称:skia,代码行数:13,代码来源:SkImageRef.cpp

示例5: INHERITED

SkMallocPixelRef::SkMallocPixelRef(SkFlattenableReadBuffer& buffer)
        : INHERITED(buffer, NULL) {
    fSize = buffer.getArrayCount();
    fStorage = sk_malloc_throw(fSize);
    buffer.readByteArray(fStorage);
    if (buffer.readBool()) {
        fCTable = buffer.readFlattenableT<SkColorTable>();
    } else {
        fCTable = NULL;
    }
    fOwnPixels = true;

    this->setPreLocked(fStorage, fCTable);
}
开发者ID:AshishNamdev,项目名称:mozilla-central,代码行数:14,代码来源:SkMallocPixelRef.cpp

示例6: INHERITED

SkMergeImageFilter::SkMergeImageFilter(SkFlattenableReadBuffer& buffer) : INHERITED(buffer) {
    int storedCount = buffer.readInt();
    this->initAlloc(SkAbs32(storedCount), storedCount < 0);

    for (int i = 0; i < fCount; ++i) {
        fFilters[i] = buffer.readFlattenableT<SkImageFilter>();
    }

    if (fModes) {
        SkASSERT(storedCount < 0);
        SkASSERT(buffer.getArrayCount() == fCount * sizeof(fModes[0]));
        buffer.readByteArray(fModes);
    } else {
        SkASSERT(storedCount >= 0);
    }
}
开发者ID:AshishNamdev,项目名称:mozilla-central,代码行数:16,代码来源:SkTestImageFilters.cpp

示例7: SkMaskFilter

SkEmbossMaskFilter::SkEmbossMaskFilter(SkFlattenableReadBuffer& buffer)
    : SkMaskFilter(buffer) {
    SkASSERT(buffer.getArrayCount() == sizeof(Light));
    buffer.readByteArray(&fLight);
    SkASSERT(fLight.fPad == 0); // for the font-cache lookup to be clean
    fBlurSigma = buffer.readScalar();
#ifndef DELETE_THIS_CODE_WHEN_SKPS_ARE_REBUILT_AT_V13_AND_ALL_OTHER_INSTANCES_TOO
    // Fixing this must be done in two stages. When the skps are recaptured in V13,
    // remove the ConvertRadiusToSigma but retain the absolute value.
    // At the same time, switch the code in flatten to write a positive value.
    // When the skps are captured in V14 the absolute value can be removed.
    if (fBlurSigma > 0) {
        fBlurSigma = SkBlurMask::ConvertRadiusToSigma(fBlurSigma);
    } else {
        fBlurSigma = -fBlurSigma;
    }
#endif
}
开发者ID:shuowen,项目名称:kalpa,代码行数:18,代码来源:SkEmbossMaskFilter.cpp

示例8: INHERITED

SkTableMaskFilter::SkTableMaskFilter(SkFlattenableReadBuffer& rb)
        : INHERITED(rb) {
    SkASSERT(256 == rb.getArrayCount());
    rb.readByteArray(fTable);
}
开发者ID:Cue,项目名称:skia,代码行数:5,代码来源:SkTableMaskFilter.cpp


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