本文整理汇总了C++中SkFlattenableReadBuffer::read方法的典型用法代码示例。如果您正苦于以下问题:C++ SkFlattenableReadBuffer::read方法的具体用法?C++ SkFlattenableReadBuffer::read怎么用?C++ SkFlattenableReadBuffer::read使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SkFlattenableReadBuffer
的用法示例。
在下文中一共展示了SkFlattenableReadBuffer::read方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: INHERITED
SkFlipPixelRef::SkFlipPixelRef(SkFlattenableReadBuffer& buffer)
: INHERITED(buffer, NULL) {
fSize = buffer.readU32();
fStorage = sk_malloc_throw(fSize << 1);
fPage0 = fStorage;
fPage1 = (char*)fStorage + fSize;
buffer.read(fPage0, fSize);
}
示例2: INHERITED
SkShader::SkShader(SkFlattenableReadBuffer& buffer)
: INHERITED(buffer), fLocalMatrix(NULL) {
if (buffer.readBool()) {
SkMatrix matrix;
buffer.read(&matrix, sizeof(matrix));
setLocalMatrix(matrix);
}
SkDEBUGCODE(fInSession = false;)
}
示例3: INHERITED
SkImageRef::SkImageRef(SkFlattenableReadBuffer& buffer)
: INHERITED(buffer, &gImageRefMutex), fErrorInDecoding(false) {
fConfig = (SkBitmap::Config)buffer.readU8();
fSampleSize = buffer.readU8();
size_t length = buffer.readU32();
fStream = SkNEW_ARGS(SkMemoryStream, (length));
buffer.read((void*)fStream->getMemoryBase(), length);
fPrev = fNext = NULL;
}
示例4: 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;
}
}
示例5: INHERITED
SkMergeImageFilter::SkMergeImageFilter(SkFlattenableReadBuffer& buffer) : INHERITED(buffer) {
int storedCount = buffer.readS32();
this->initAlloc(SkAbs32(storedCount), storedCount < 0);
for (int i = 0; i < fCount; ++i) {
fFilters[i] = (SkImageFilter*)buffer.readFlattenable();
}
if (fModes) {
SkASSERT(storedCount < 0);
buffer.read(fModes, fCount * sizeof(fModes[0]));
} else {
SkASSERT(storedCount >= 0);
}
}
示例6: INHERITED
SkImageRef_ashmem::SkImageRef_ashmem(SkFlattenableReadBuffer& buffer)
: INHERITED(buffer) {
fRec.fFD = -1;
fRec.fAddr = NULL;
fRec.fSize = 0;
fRec.fPinned = false;
fCT = NULL;
size_t length = buffer.readU32();
if (length) {
char* buf = (char*) malloc(length);
buffer.read(buf, length);
setURI(buf, length);
}
this->useDefaultMutex(); // we don't need/want the shared imageref mutex
}
示例7: INHERITED
SkGroupShape::SkGroupShape(SkFlattenableReadBuffer& buffer) : INHERITED(buffer){
int count = buffer.readS32();
for (int i = 0; i < count; i++) {
SkShape* shape = reinterpret_cast<SkShape*>(buffer.readFlattenable());
SkMatrixRef* mr = NULL;
uint32_t size = buffer.readS32();
if (size) {
char storage[SkMatrix::kMaxFlattenSize];
buffer.read(storage, SkAlign4(size));
mr = SkNEW(SkMatrixRef);
mr->unflatten(storage);
}
if (shape) {
this->appendShape(shape, mr)->unref();
}
SkSafeUnref(mr);
}
}
示例8: INHERITED
SkRectShape::SkRectShape(SkFlattenableReadBuffer& buffer) : INHERITED(buffer) {
buffer.read(&fBounds, sizeof(fBounds));
buffer.read(&fRadii, sizeof(fRadii));
}
示例9: SkMaskFilter
SkEmbossMaskFilter::SkEmbossMaskFilter(SkFlattenableReadBuffer& buffer)
: SkMaskFilter(buffer) {
buffer.read(&fLight, sizeof(fLight));
SkASSERT(fLight.fPad == 0); // for the font-cache lookup to be clean
fBlurRadius = buffer.readScalar();
}