本文整理汇总了C++中SkFlattenableReadBuffer::readInt方法的典型用法代码示例。如果您正苦于以下问题:C++ SkFlattenableReadBuffer::readInt方法的具体用法?C++ SkFlattenableReadBuffer::readInt怎么用?C++ SkFlattenableReadBuffer::readInt使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SkFlattenableReadBuffer
的用法示例。
在下文中一共展示了SkFlattenableReadBuffer::readInt方法的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
SkMorphologyImageFilter::SkMorphologyImageFilter(SkFlattenableReadBuffer& buffer)
: INHERITED(1, buffer) {
fRadius.fWidth = buffer.readInt();
fRadius.fHeight = buffer.readInt();
buffer.validate((fRadius.fWidth >= 0) &&
(fRadius.fHeight >= 0));
}
示例3: 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
}
示例4: 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();
}
示例5: 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();
}
示例6: 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;
}
}
示例7: INHERITED
SkDisplacementMapEffect::SkDisplacementMapEffect(SkFlattenableReadBuffer& buffer)
: INHERITED(buffer)
{
fXChannelSelector = (SkDisplacementMapEffect::ChannelSelectorType) buffer.readInt();
fYChannelSelector = (SkDisplacementMapEffect::ChannelSelectorType) buffer.readInt();
fScale = buffer.readScalar();
}
开发者ID:IllusionRom-deprecated,项目名称:android_platform_external_chromium_org_third_party_skia_src,代码行数:7,代码来源:SkDisplacementMapEffect.cpp
示例8: INHERITED
SkMatrixConvolutionImageFilter::SkMatrixConvolutionImageFilter(SkFlattenableReadBuffer& buffer)
: INHERITED(1, buffer) {
// We need to be able to read at most SK_MaxS32 bytes, so divide that
// by the size of a scalar to know how many scalars we can read.
static const int32_t kMaxSize = SK_MaxS32 / sizeof(SkScalar);
fKernelSize.fWidth = buffer.readInt();
fKernelSize.fHeight = buffer.readInt();
if ((fKernelSize.fWidth >= 1) && (fKernelSize.fHeight >= 1) &&
// Make sure size won't be larger than a signed int,
// which would still be extremely large for a kernel,
// but we don't impose a hard limit for kernel size
(kMaxSize / fKernelSize.fWidth >= fKernelSize.fHeight)) {
size_t size = fKernelSize.fWidth * fKernelSize.fHeight;
fKernel = SkNEW_ARRAY(SkScalar, size);
SkDEBUGCODE(bool success =) buffer.readScalarArray(fKernel, size);
SkASSERT(success);
} else {
示例9: 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);
}
示例10: 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;
}
}
}
示例11: 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;
}
}
示例12: 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;
}
示例13: fHeap
SkPathHeap::SkPathHeap(SkFlattenableReadBuffer& buffer)
: fHeap(kPathCount * sizeof(SkPath)) {
const int count = buffer.readInt();
fPaths.setCount(count);
SkPath** ptr = fPaths.begin();
SkPath* p = (SkPath*)fHeap.allocThrow(count * sizeof(SkPath));
for (int i = 0; i < count; i++) {
new (p) SkPath;
buffer.readPath(p);
*ptr++ = p; // record the pointer
p++; // move to the next storage location
}
}
示例14: 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);
}
}
示例15: CompositeImageFilter
explicit CompositeImageFilter(SkFlattenableReadBuffer& buffer)
: SkImageFilter(buffer)
{
m_mode = (SkXfermode::Mode) buffer.readInt();
}
开发者ID:IllusionRom-deprecated,项目名称:android_platform_external_chromium_org_third_party_WebKit,代码行数:5,代码来源:FEComposite.cpp