Lines Matching refs:buffer
146 static void paint_read(SkPaint* paint, SkFlattenableReadBuffer& buffer) {
147 paint->setAntiAlias(buffer.readBool());
148 paint->setStyle((SkPaint::Style)buffer.readU8());
149 paint->setAlpha(buffer.readU8());
152 paint->setStrokeWidth(buffer.readScalar());
153 paint->setStrokeMiter(buffer.readScalar());
154 paint->setStrokeCap((SkPaint::Cap)buffer.readU8());
155 paint->setStrokeJoin((SkPaint::Join)buffer.readU8());
158 SkSafeUnref(paint->setMaskFilter((SkMaskFilter*)buffer.readFlattenable()));
159 SkSafeUnref(paint->setPathEffect((SkPathEffect*)buffer.readFlattenable()));
160 SkSafeUnref(paint->setRasterizer((SkRasterizer*)buffer.readFlattenable()));
161 SkSafeUnref(paint->setXfermode((SkXfermode*)buffer.readFlattenable()));
164 static void paint_write(const SkPaint& paint, SkFlattenableWriteBuffer& buffer) {
165 buffer.writeBool(paint.isAntiAlias());
166 buffer.write8(paint.getStyle());
167 buffer.write8(paint.getAlpha());
170 buffer.writeScalar(paint.getStrokeWidth());
171 buffer.writeScalar(paint.getStrokeMiter());
172 buffer.write8(paint.getStrokeCap());
173 buffer.write8(paint.getStrokeJoin());
176 buffer.writeFlattenable(paint.getMaskFilter());
177 buffer.writeFlattenable(paint.getPathEffect());
178 buffer.writeFlattenable(paint.getRasterizer());
179 buffer.writeFlattenable(paint.getXfermode());
182 SkLayerRasterizer::SkLayerRasterizer(SkFlattenableReadBuffer& buffer)
183 : SkRasterizer(buffer), fLayers(sizeof(SkLayerRasterizer_Rec)) {
184 int count = buffer.readS32();
190 new (&rec->fPaint) SkPaint(buffer);
193 paint_read(&rec->fPaint, buffer);
195 rec->fOffset.fX = buffer.readScalar();
196 rec->fOffset.fY = buffer.readScalar();
200 void SkLayerRasterizer::flatten(SkFlattenableWriteBuffer& buffer) {
201 this->INHERITED::flatten(buffer);
203 buffer.write32(fLayers.count());
210 rec->fPaint.flatten(buffer);
212 paint_write(rec->fPaint, buffer);
214 buffer.writeScalar(rec->fOffset.fX);
215 buffer.writeScalar(rec->fOffset.fY);
219 SkFlattenable* SkLayerRasterizer::CreateProc(SkFlattenableReadBuffer& buffer) {
220 return SkNEW_ARGS(SkLayerRasterizer, (buffer));