Lines Matching refs:buffer
45 static SkPoint unflatten_point(SkReader32& buffer) {
47 retval.fX = buffer.readScalar();
48 retval.fY = buffer.readScalar();
353 Gradient_Shader::Gradient_Shader(SkFlattenableReadBuffer& buffer) :
354 INHERITED(buffer) {
357 fMapper = static_cast<SkUnitMapper*>(buffer.readFlattenable());
363 int colorCount = fColorCount = buffer.readU32();
370 buffer.read(fOrigColors, colorCount * sizeof(SkColor));
372 fTileMode = (TileMode)buffer.readU8();
379 recs[i].fPos = buffer.readS32();
380 recs[i].fScale = buffer.readU32();
383 SkReadMatrix(&buffer, &fPtsToUnit);
407 void Gradient_Shader::flatten(SkFlattenableWriteBuffer& buffer) {
408 this->INHERITED::flatten(buffer);
409 buffer.writeFlattenable(fMapper);
410 buffer.write32(fColorCount);
411 buffer.writeMul4(fOrigColors, fColorCount * sizeof(SkColor));
412 buffer.write8(fTileMode);
416 buffer.write32(recs[i].fPos);
417 buffer.write32(recs[i].fScale);
420 SkWriteMatrix(&buffer, fPtsToUnit);
759 int32_t* buffer = storage.get();
761 *buffer++ = fColorCount;
762 memcpy(buffer, fOrigColors, fColorCount * sizeof(SkColor));
763 buffer += fColorCount;
766 *buffer++ = fRecs[i].fPos;
769 SkASSERT(buffer - storage.get() == count);
852 static SkFlattenable* CreateProc(SkFlattenableReadBuffer& buffer) {
853 return SkNEW_ARGS(Linear_Gradient, (buffer));
856 virtual void flatten(SkFlattenableWriteBuffer& buffer) SK_OVERRIDE {
857 this->INHERITED::flatten(buffer);
858 buffer.writeScalar(fStart.fX);
859 buffer.writeScalar(fStart.fY);
860 buffer.writeScalar(fEnd.fX);
861 buffer.writeScalar(fEnd.fY);
867 Linear_Gradient(SkFlattenableReadBuffer& buffer)
868 : Gradient_Shader(buffer),
869 fStart(unflatten_point(buffer)),
870 fEnd(unflatten_point(buffer)) {
1517 static SkFlattenable* CreateProc(SkFlattenableReadBuffer& buffer) {
1518 return SkNEW_ARGS(Radial_Gradient, (buffer));
1521 virtual void flatten(SkFlattenableWriteBuffer& buffer) SK_OVERRIDE {
1522 this->INHERITED::flatten(buffer);
1523 buffer.writeScalar(fCenter.fX);
1524 buffer.writeScalar(fCenter.fY);
1525 buffer.writeScalar(fRadius);
1529 Radial_Gradient(SkFlattenableReadBuffer& buffer)
1530 : Gradient_Shader(buffer),
1531 fCenter(unflatten_point(buffer)),
1532 fRadius(buffer.readScalar()) {
2052 static SkFlattenable* CreateProc(SkFlattenableReadBuffer& buffer) {
2053 return SkNEW_ARGS(Two_Point_Radial_Gradient, (buffer));
2056 virtual void flatten(SkFlattenableWriteBuffer& buffer) SK_OVERRIDE {
2057 this->INHERITED::flatten(buffer);
2058 buffer.writeScalar(fCenter1.fX);
2059 buffer.writeScalar(fCenter1.fY);
2060 buffer.writeScalar(fCenter2.fX);
2061 buffer.writeScalar(fCenter2.fY);
2062 buffer.writeScalar(fRadius1);
2063 buffer.writeScalar(fRadius2);
2067 Two_Point_Radial_Gradient(SkFlattenableReadBuffer& buffer)
2068 : Gradient_Shader(buffer),
2069 fCenter1(unflatten_point(buffer)),
2070 fCenter2(unflatten_point(buffer)),
2071 fRadius1(buffer.readScalar()),
2072 fRadius2(buffer.readScalar()) {
2141 static SkFlattenable* CreateProc(SkFlattenableReadBuffer& buffer) {
2142 return SkNEW_ARGS(Sweep_Gradient, (buffer));
2145 virtual void flatten(SkFlattenableWriteBuffer& buffer) SK_OVERRIDE {
2146 this->INHERITED::flatten(buffer);
2147 buffer.writeScalar(fCenter.fX);
2148 buffer.writeScalar(fCenter.fY);
2152 Sweep_Gradient(SkFlattenableReadBuffer& buffer)
2153 : Gradient_Shader(buffer),
2154 fCenter(unflatten_point(buffer)) {