本文整理汇总了C++中SkFlattenableReadBuffer::readScalar方法的典型用法代码示例。如果您正苦于以下问题:C++ SkFlattenableReadBuffer::readScalar方法的具体用法?C++ SkFlattenableReadBuffer::readScalar怎么用?C++ SkFlattenableReadBuffer::readScalar使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SkFlattenableReadBuffer
的用法示例。
在下文中一共展示了SkFlattenableReadBuffer::readScalar方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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);
}
示例2: INHERITED
SkBicubicImageFilter::SkBicubicImageFilter(SkFlattenableReadBuffer& buffer) : INHERITED(buffer) {
SkDEBUGCODE(bool success =) buffer.readScalarArray(fCoefficients, 16);
SkASSERT(success);
fScale.fWidth = buffer.readScalar();
fScale.fHeight = buffer.readScalar();
buffer.validate(SkScalarIsFinite(fScale.fWidth) &&
SkScalarIsFinite(fScale.fHeight) &&
(fScale.fWidth >= 0) &&
(fScale.fHeight >= 0));
}
示例3: SkDEBUGF
SkPath1DPathEffect::SkPath1DPathEffect(SkFlattenableReadBuffer& buffer) {
fAdvance = buffer.readScalar();
if (fAdvance > 0) {
fPath.unflatten(buffer);
fInitialOffset = buffer.readScalar();
fStyle = (Style) buffer.readU8();
} else {
SkDEBUGF(("SkPath1DPathEffect can't use advance <= 0\n"));
// Make Coverity happy.
fInitialOffset = 0;
fStyle = kStyleCount;
}
}
示例4: 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
}
示例5: 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
示例6: SkMaskFilter
SkBlurMaskFilterImpl::SkBlurMaskFilterImpl(SkFlattenableReadBuffer& buffer) : SkMaskFilter(buffer)
{
fRadius = buffer.readScalar();
fBlurStyle = (SkBlurMaskFilter::BlurStyle)buffer.readS32();
fBlurFlags = buffer.readU32() & SkBlurMaskFilter::kAll_BlurFlag;
SkASSERT(fRadius >= 0);
SkASSERT((unsigned)fBlurStyle < SkBlurMaskFilter::kBlurStyleCount);
}
示例7:
SkBlurDrawLooper::SkBlurDrawLooper(SkFlattenableReadBuffer& buffer)
{
fDx = buffer.readScalar();
fDy = buffer.readScalar();
fBlurColor = buffer.readU32();
fBlur = static_cast<SkMaskFilter*>(buffer.readFlattenable());
fColorFilter = static_cast<SkColorFilter*>(buffer.readFlattenable());
fBlurFlags = buffer.readU32() & kAll_BlurFlag;
}
示例8: INHERITED
SkBlurDrawLooper::SkBlurDrawLooper(SkFlattenableReadBuffer& buffer)
: INHERITED(buffer) {
fDx = buffer.readScalar();
fDy = buffer.readScalar();
fBlurColor = buffer.readColor();
fBlur = buffer.readMaskFilter();
fColorFilter = buffer.readColorFilter();
fBlurFlags = buffer.readUInt() & kAll_BlurFlag;
}
示例9: 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
}
示例10: paint_read
static void paint_read(SkPaint* paint, SkFlattenableReadBuffer& buffer)
{
paint->setAntiAlias(buffer.readBool());
paint->setStyle((SkPaint::Style)buffer.readU8());
paint->setAlpha(buffer.readU8());
if (paint->getStyle() != SkPaint::kFill_Style)
{
paint->setStrokeWidth(buffer.readScalar());
paint->setStrokeMiter(buffer.readScalar());
paint->setStrokeCap((SkPaint::Cap)buffer.readU8());
paint->setStrokeJoin((SkPaint::Join)buffer.readU8());
}
paint->setMaskFilter((SkMaskFilter*)buffer.readFlattenable())->safeUnref();
paint->setPathEffect((SkPathEffect*)buffer.readFlattenable())->safeUnref();
paint->setRasterizer((SkRasterizer*)buffer.readFlattenable())->safeUnref();
paint->setXfermode((SkXfermode*)buffer.readFlattenable())->safeUnref();
}
示例11: SkRasterizer
SkLayerRasterizer::SkLayerRasterizer(SkFlattenableReadBuffer& buffer)
: SkRasterizer(buffer), fLayers(sizeof(SkLayerRasterizer_Rec))
{
int count = buffer.readS32();
for (int i = 0; i < count; i++)
{
SkLayerRasterizer_Rec* rec = (SkLayerRasterizer_Rec*)fLayers.push_back();
#if 0
new (&rec->fPaint) SkPaint(buffer);
#else
new (&rec->fPaint) SkPaint;
paint_read(&rec->fPaint, buffer);
#endif
rec->fOffset.fX = buffer.readScalar();
rec->fOffset.fY = buffer.readScalar();
}
}
示例12: INHERITED
SkRectShape::SkRectShape(SkFlattenableReadBuffer& buffer) : INHERITED(buffer) {
buffer.readRect(&fBounds);
fRadii.fWidth = buffer.readScalar();
fRadii.fHeight = buffer.readScalar();
}
示例13:
SkCornerPathEffect::SkCornerPathEffect(SkFlattenableReadBuffer& buffer)
{
fRadius = buffer.readScalar();
}
示例14: INHERITED
SkDownSampleImageFilter::SkDownSampleImageFilter(SkFlattenableReadBuffer& buffer) : INHERITED(buffer) {
fScale = buffer.readScalar();
}
示例15: INHERITED
SkBlurImageFilter::SkBlurImageFilter(SkFlattenableReadBuffer& buffer)
: INHERITED(buffer) {
fSigma.fWidth = buffer.readScalar();
fSigma.fHeight = buffer.readScalar();
}