本文整理汇总了C++中SkFlattenableReadBuffer::readBool方法的典型用法代码示例。如果您正苦于以下问题:C++ SkFlattenableReadBuffer::readBool方法的具体用法?C++ SkFlattenableReadBuffer::readBool怎么用?C++ SkFlattenableReadBuffer::readBool使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SkFlattenableReadBuffer
的用法示例。
在下文中一共展示了SkFlattenableReadBuffer::readBool方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: INHERITED
SkLayerDrawLooper::SkLayerDrawLooper(SkFlattenableReadBuffer& buffer)
: INHERITED(buffer),
fRecs(NULL),
fCount(0),
fCurrRec(NULL) {
int count = buffer.readInt();
for (int i = 0; i < count; i++) {
LayerInfo info;
info.fPaintBits = buffer.readInt();
info.fColorMode = (SkXfermode::Mode)buffer.readInt();
info.fOffset.fX = buffer.readScalar();
info.fOffset.fY = buffer.readScalar();
info.fPostTranslate = buffer.readBool();
this->addLayer(info)->unflatten(buffer);
}
SkASSERT(count == fCount);
// we're in reverse order, so fix it now
fRecs = Rec::Reverse(fRecs);
#ifdef SK_DEBUG
{
Rec* rec = fRecs;
int n = 0;
while (rec) {
rec = rec->fNext;
n += 1;
}
SkASSERT(count == n);
}
#endif
}
示例2: INHERITED
SkLayerDrawLooper::SkLayerDrawLooper(SkFlattenableReadBuffer& buffer)
: INHERITED(buffer),
fRecs(NULL),
fTopRec(NULL),
fCount(0),
fCurrRec(NULL) {
int count = buffer.readInt();
for (int i = 0; i < count; i++) {
LayerInfo info;
info.fFlagsMask = buffer.readInt();
info.fPaintBits = buffer.readInt();
info.fColorMode = (SkXfermode::Mode)buffer.readInt();
buffer.readPoint(&info.fOffset);
info.fPostTranslate = buffer.readBool();
buffer.readPaint(this->addLayerOnTop(info));
}
SkASSERT(count == fCount);
#ifdef SK_DEBUG
{
Rec* rec = fRecs;
int n = 0;
while (rec) {
rec = rec->fNext;
n += 1;
}
SkASSERT(count == n);
}
#endif
}
示例3: CropRect
SkImageFilter::SkImageFilter(int inputCount, SkFlattenableReadBuffer& buffer) {
fInputCount = buffer.readInt();
if (buffer.validate((fInputCount >= 0) && ((inputCount < 0) || (fInputCount == inputCount)))) {
fInputs = new SkImageFilter*[fInputCount];
for (int i = 0; i < fInputCount; i++) {
if (buffer.readBool()) {
fInputs[i] = buffer.readImageFilter();
} else {
fInputs[i] = NULL;
}
if (!buffer.isValid()) {
fInputCount = i; // Do not use fInputs past that point in the destructor
break;
}
}
SkRect rect;
buffer.readRect(&rect);
if (buffer.isValid() && buffer.validate(SkIsValidRect(rect))) {
uint32_t flags = buffer.readUInt();
fCropRect = CropRect(rect, flags);
}
} else {
fInputCount = 0;
fInputs = NULL;
}
}
示例4: INHERITED
SkShader::SkShader(SkFlattenableReadBuffer& buffer)
: INHERITED(buffer), fLocalMatrix(NULL) {
if (buffer.readBool()) {
SkMatrix matrix;
SkReadMatrix(&buffer, &matrix);
setLocalMatrix(matrix);
}
SkDEBUGCODE(fInSession = false;)
}
示例5: fInputCount
SkImageFilter::SkImageFilter(SkFlattenableReadBuffer& buffer)
: fInputCount(buffer.readInt()), fInputs(new SkImageFilter*[fInputCount]) {
for (int i = 0; i < fInputCount; i++) {
if (buffer.readBool()) {
fInputs[i] = static_cast<SkImageFilter*>(buffer.readFlattenable());
} else {
fInputs[i] = NULL;
}
}
}
示例6: INHERITED
SkShader::SkShader(SkFlattenableReadBuffer& buffer)
: INHERITED(buffer) {
if (buffer.readBool()) {
buffer.readMatrix(&fLocalMatrix);
} else {
fLocalMatrix.reset();
}
SkDEBUGCODE(fInSetContext = false;)
}
示例7: 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);
}
示例8: 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;
}
}
示例9: INHERITED
SkPixelRef::SkPixelRef(SkFlattenableReadBuffer& buffer, SkBaseMutex* mutex)
: INHERITED(buffer) {
this->setMutex(mutex);
fPixels = NULL;
fColorTable = NULL; // we do not track ownership of this
fLockCount = 0;
fGenerationID = 0; // signal to rebuild
fIsImmutable = buffer.readBool();
fPreLocked = false;
}
示例10: INHERITED
SkBlendImageFilter::SkBlendImageFilter(SkFlattenableReadBuffer& buffer)
: INHERITED(buffer)
{
fMode = (SkBlendImageFilter::Mode) buffer.readInt();
fBackground = buffer.readFlattenableT<SkImageFilter>();
if (buffer.readBool()) {
fForeground = buffer.readFlattenableT<SkImageFilter>();
} else {
fForeground = NULL;
}
}
示例11:
SkPixelRef::SkPixelRef(SkFlattenableReadBuffer& buffer, SkMutex* mutex) {
if (NULL == mutex) {
mutex = &gPixelRefMutex;
}
fMutex = mutex;
fPixels = NULL;
fColorTable = NULL; // we do not track ownership of this
fLockCount = 0;
fGenerationID = 0; // signal to rebuild
fIsImmutable = buffer.readBool();
}
示例12: INHERITED
SkMallocPixelRef::SkMallocPixelRef(SkFlattenableReadBuffer& buffer)
: INHERITED(buffer, NULL) {
fSize = buffer.readU32();
fStorage = sk_malloc_throw(fSize);
buffer.read(fStorage, fSize);
if (buffer.readBool()) {
fCTable = SkNEW_ARGS(SkColorTable, (buffer));
} else {
fCTable = NULL;
}
}
示例13: 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;
}
示例14: INHERITED
SkMatrixConvolutionImageFilter::SkMatrixConvolutionImageFilter(SkFlattenableReadBuffer& buffer) : INHERITED(buffer) {
fKernelSize.fWidth = buffer.readInt();
fKernelSize.fHeight = buffer.readInt();
uint32_t size = fKernelSize.fWidth * fKernelSize.fHeight;
fKernel = SkNEW_ARRAY(SkScalar, size);
SkDEBUGCODE(uint32_t readSize = )buffer.readScalarArray(fKernel);
SkASSERT(readSize == size);
fGain = buffer.readScalar();
fBias = buffer.readScalar();
fTarget.fX = buffer.readInt();
fTarget.fY = buffer.readInt();
fTileMode = (TileMode) buffer.readInt();
fConvolveAlpha = buffer.readBool();
}
示例15: 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);
}