本文整理汇总了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();
}
示例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);
}
示例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;
}
}
示例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;
}
示例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);
}
示例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);
}
}
示例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
}
示例8: INHERITED
SkTableMaskFilter::SkTableMaskFilter(SkFlattenableReadBuffer& rb)
: INHERITED(rb) {
SkASSERT(256 == rb.getArrayCount());
rb.readByteArray(fTable);
}