Lines Matching refs:buffer
156 static void paint_read(SkPaint* paint, SkFlattenableReadBuffer& buffer)
158 paint->setAntiAlias(buffer.readBool());
159 paint->setStyle((SkPaint::Style)buffer.readU8());
160 paint->setAlpha(buffer.readU8());
164 paint->setStrokeWidth(buffer.readScalar());
165 paint->setStrokeMiter(buffer.readScalar());
166 paint->setStrokeCap((SkPaint::Cap)buffer.readU8());
167 paint->setStrokeJoin((SkPaint::Join)buffer.readU8());
170 paint->setMaskFilter((SkMaskFilter*)buffer.readFlattenable())->safeUnref();
171 paint->setPathEffect((SkPathEffect*)buffer.readFlattenable())->safeUnref();
172 paint->setRasterizer((SkRasterizer*)buffer.readFlattenable())->safeUnref();
173 paint->setXfermode((SkXfermode*)buffer.readFlattenable())->safeUnref();
176 static void paint_write(const SkPaint& paint, SkFlattenableWriteBuffer& buffer)
178 buffer.writeBool(paint.isAntiAlias());
179 buffer.write8(paint.getStyle());
180 buffer.write8(paint.getAlpha());
184 buffer.writeScalar(paint.getStrokeWidth());
185 buffer.writeScalar(paint.getStrokeMiter());
186 buffer.write8(paint.getStrokeCap());
187 buffer.write8(paint.getStrokeJoin());
190 buffer.writeFlattenable(paint.getMaskFilter());
191 buffer.writeFlattenable(paint.getPathEffect());
192 buffer.writeFlattenable(paint.getRasterizer());
193 buffer.writeFlattenable(paint.getXfermode());
196 SkLayerRasterizer::SkLayerRasterizer(SkFlattenableReadBuffer& buffer)
197 : SkRasterizer(buffer), fLayers(sizeof(SkLayerRasterizer_Rec))
199 int count = buffer.readS32();
206 new (&rec->fPaint) SkPaint(buffer);
209 paint_read(&rec->fPaint, buffer);
211 rec->fOffset.fX = buffer.readScalar();
212 rec->fOffset.fY = buffer.readScalar();
216 void SkLayerRasterizer::flatten(SkFlattenableWriteBuffer& buffer)
218 this->INHERITED::flatten(buffer);
220 buffer.write32(fLayers.count());
228 rec->fPaint.flatten(buffer);
230 paint_write(rec->fPaint, buffer);
232 buffer.writeScalar(rec->fOffset.fX);
233 buffer.writeScalar(rec->fOffset.fY);
237 SkFlattenable* SkLayerRasterizer::CreateProc(SkFlattenableReadBuffer& buffer)
239 return SkNEW_ARGS(SkLayerRasterizer, (buffer));