void SkBlurDrawLooper::flatten(SkFlattenableWriteBuffer& buffer) {
    buffer.writeScalar(fDx);
    buffer.writeScalar(fDy);
    buffer.write32(fBlurColor);
    buffer.writeFlattenable(fBlur);
    buffer.writeFlattenable(fColorFilter);
    buffer.write32(fBlurFlags);
}
Exemplo n.º 2
0
void SkDashPathEffect::flatten(SkFlattenableWriteBuffer& buffer)
{
    SkASSERT(fInitialDashLength >= 0);

    buffer.write32(fCount);
    buffer.write32(fInitialDashIndex);
    buffer.writeScalar(fInitialDashLength);
    buffer.writeScalar(fIntervalLength);
    buffer.write32(fScaleToFit);
    buffer.writeMul4(fIntervals, fCount * sizeof(fIntervals[0]));
}
void SkImageRef_ashmem::flatten(SkFlattenableWriteBuffer& buffer) const {
    this->INHERITED::flatten(buffer);
    const char* uri = getURI();
    if (uri) {
        size_t len = strlen(uri);
        buffer.write32(len);
        buffer.writePad(uri, len);
    } else {
        buffer.write32(0);
    }
}
Exemplo n.º 4
0
void SkFlipPixelRef::flatten(SkFlattenableWriteBuffer& buffer) const {
    this->INHERITED::flatten(buffer);
    
    buffer.write32(fSize);
    // only need to write page0
    buffer.writePad(fPage0, fSize);
}
Exemplo n.º 5
0
void SkBlurMaskFilterImpl::flatten(SkFlattenableWriteBuffer& buffer)
{
    this->INHERITED::flatten(buffer);
    buffer.writeScalar(fRadius);
    buffer.write32(fBlurStyle);
    buffer.write32(fBlurFlags);
}
void SkAvoidXfermode::flatten(SkFlattenableWriteBuffer& buffer)
{
    this->INHERITED::flatten(buffer);

    buffer.write32(fOpColor);
    buffer.write32(fDistMul);
    buffer.write8(fMode);
}
Exemplo n.º 7
0
void SkColorShader::flatten(SkFlattenableWriteBuffer& buffer) {
    this->INHERITED::flatten(buffer);
    buffer.write8(fInheritColor);
    if (fInheritColor) {
        return;
    }
    buffer.write32(fColor);
}
Exemplo n.º 8
0
void SkImageRef::flatten(SkFlattenableWriteBuffer& buffer) const {
    this->INHERITED::flatten(buffer);

    buffer.write8(fConfig);
    buffer.write8(fSampleSize);
    size_t length = fStream->getLength();
    buffer.write32(length);
    fStream->rewind();
    buffer.readFromStream(fStream, length);
}
Exemplo n.º 9
0
void SkGroupShape::flatten(SkFlattenableWriteBuffer& buffer) const {
    this->INHERITED::flatten(buffer);

    int count = fList.count();
    buffer.write32(count);
    const Rec* rec = fList.begin();
    const Rec* stop = fList.end();
    while (rec < stop) {
        buffer.writeFlattenable(rec->fShape);
        if (rec->fMatrixRef) {
            char storage[SkMatrix::kMaxFlattenSize];
            uint32_t size = rec->fMatrixRef->flatten(storage);
            buffer.write32(size);
            buffer.writePad(storage, size);
        } else {
            buffer.write32(0);
        }
        rec += 1;
    }
}
Exemplo n.º 10
0
void SkMallocPixelRef::flatten(SkFlattenableWriteBuffer& buffer) const {
    this->INHERITED::flatten(buffer);

    buffer.write32(fSize);
    buffer.writePad(fStorage, fSize);
    if (fCTable) {
        buffer.writeBool(true);
        fCTable->flatten(buffer);
    } else {
        buffer.writeBool(false);
    }
}
void SkMallocPixelRef::flatten(SkFlattenableWriteBuffer& buffer) const {
    this->INHERITED::flatten(buffer);

    buffer.write32(fRB);

    // TODO: replace this bulk write with a chunky one that can trim off any
    // trailing bytes on each scanline (in case rowbytes > width*size)
    size_t size = this->info().getSafeSize(fRB);
    buffer.writeByteArray(fStorage, size);
    buffer.writeBool(fCTable != NULL);
    if (fCTable) {
        fCTable->writeToBuffer(buffer);
    }
}
void SkMergeImageFilter::flatten(SkFlattenableWriteBuffer& buffer) {
    this->INHERITED::flatten(buffer);

    int storedCount = fCount;
    if (fModes) {
        // negative count signals we have modes
        storedCount = -storedCount;
    }
    buffer.write32(storedCount);

    if (fCount) {
        for (int i = 0; i < fCount; ++i) {
            buffer.writeFlattenable(fFilters[i]);
        }
        if (fModes) {
            buffer.write(fModes, fCount * sizeof(fModes[0]));
        }
    }
}
Exemplo n.º 13
0
void SkLayerRasterizer::flatten(SkFlattenableWriteBuffer& buffer)
{
    this->INHERITED::flatten(buffer);

    buffer.write32(fLayers.count());

    SkDeque::Iter                   iter(fLayers);
    const SkLayerRasterizer_Rec*    rec;

    while ((rec = (const SkLayerRasterizer_Rec*)iter.next()) != NULL)
    {
#if 0
        rec->fPaint.flatten(buffer);
#else
        paint_write(rec->fPaint, buffer);
#endif
        buffer.writeScalar(rec->fOffset.fX);
        buffer.writeScalar(rec->fOffset.fY);
    }
}
 virtual void flatten(SkFlattenableWriteBuffer& buffer) {
     buffer.write32(fMul);
     buffer.write32(fAdd);
 }
 virtual void flatten(SkFlattenableWriteBuffer& buffer) {
     buffer.write32(fPMColor);
 }
 virtual void flatten(SkFlattenableWriteBuffer& buffer) {
     this->INHERITED::flatten(buffer);
     buffer.write32(fColor);
     buffer.write32(fMode);
 }
 virtual void flatten(SkFlattenableWriteBuffer& buffer) {
     this->INHERITED::flatten(buffer);
     buffer.write32(fMul);
     buffer.write32(fAdd);
 }
void SkPixelXorXfermode::flatten(SkFlattenableWriteBuffer& wb) {
    this->INHERITED::flatten(wb);
    wb.write32(fOpColor);
}
Exemplo n.º 19
0
 virtual void flatten(SkFlattenableWriteBuffer& buffer) {
     this->INHERITED::flatten(buffer);
     buffer.write32(fSrcCoeff);
     buffer.write32(fDstCoeff);
 }
Exemplo n.º 20
0
 virtual void flatten(SkFlattenableWriteBuffer& b) {
 //    this->INHERITED::flatten(b);  How can we know if this is legal????
     b.write32(SkScalarToFixed(fExp));
 }