SkCanvas::SaveLayerStrategy ReplayingCanvas::willSaveLayer(const SkRect* bounds, const SkPaint* paint, SaveFlags flags) { AutoReplayer replayer(this); // We're about to create a layer and we have not cleared the device yet. // Let's clear now, so it has effect on all layers. if (m_stepCount < m_fromStep) this->SkCanvas::clear(SkColorSetARGB(255, 255, 255, 255)); // FIXME: fill with nine patch instead. return this->SkCanvas::willSaveLayer(bounds, paint, flags); }
bool RecordPictureRenderer::render(const SkString* path, SkBitmap** out) { SkAutoTUnref<SkPicture> replayer(this->createPicture()); SkCanvas* recorder = replayer->beginRecording(this->getViewWidth(), this->getViewHeight(), this->recordFlags()); this->scaleToScaleFactor(recorder); fPicture->draw(recorder); replayer->endRecording(); if (path != NULL) { // Record the new picture as a new SKP with PNG encoded bitmaps. SkString skpPath(*path); // ".skp" was removed from 'path' before being passed in here. skpPath.append(".skp"); SkFILEWStream stream(skpPath.c_str()); replayer->serialize(&stream, &encode_bitmap_to_data); return true; } return false; }
void ReplayingCanvas::onDrawPosTextH(const void* text, size_t byteLength, const SkScalar xpos[], SkScalar constY, const SkPaint& paint) { AutoReplayer replayer(this); this->SkCanvas::onDrawPosTextH(text, byteLength, xpos, constY, paint); }
void ReplayingCanvas::onDrawTextOnPath(const void* text, size_t byteLength, const SkPath& path, const SkMatrix* matrix, const SkPaint& paint) { AutoReplayer replayer(this); this->SkCanvas::onDrawTextOnPath(text, byteLength, path, matrix, paint); }
void ReplayingCanvas::drawBitmapRectToRect(const SkBitmap& bitmap, const SkRect* src, const SkRect& dst, const SkPaint* paint, DrawBitmapRectFlags flags) { AutoReplayer replayer(this); this->SkCanvas::drawBitmapRectToRect(bitmap, src, dst, paint, flags); }
void ReplayingCanvas::drawRRect(const SkRRect& rrect, const SkPaint& paint) { AutoReplayer replayer(this); this->SkCanvas::drawRRect(rrect, paint); }
void ReplayingCanvas::onClipRegion(const SkRegion& region, SkRegion::Op op) { AutoReplayer replayer(this); this->SkCanvas::onClipRegion(region, op); }
void ReplayingCanvas::didConcat(const SkMatrix& matrix) { AutoReplayer replayer(this); this->SkCanvas::didConcat(matrix); }
void ReplayingCanvas::beginCommentGroup(const char* description) { AutoReplayer replayer(this); this->SkCanvas::beginCommentGroup(description); }
void ReplayingCanvas::onClipRRect(const SkRRect& rrect, SkRegion::Op op, ClipEdgeStyle edgeStyle) { AutoReplayer replayer(this); this->SkCanvas::onClipRRect(rrect, op, edgeStyle); }
void ReplayingCanvas::drawVertices(VertexMode vmode, int vertexCount, const SkPoint vertices[], const SkPoint texs[], const SkColor colors[], SkXfermode* xmode, const uint16_t indices[], int indexCount, const SkPaint& paint) { AutoReplayer replayer(this); this->SkCanvas::drawVertices(vmode, vertexCount, vertices, texs, colors, xmode, indices, indexCount, paint); }
void ReplayingCanvas::drawData(const void* data, size_t length) { AutoReplayer replayer(this); this->SkCanvas::drawData(data, length); }
void ReplayingCanvas::drawSprite(const SkBitmap& bitmap, int left, int top, const SkPaint* paint) { AutoReplayer replayer(this); this->SkCanvas::drawSprite(bitmap, left, top, paint); }
void ReplayingCanvas::drawBitmapNine(const SkBitmap& bitmap, const SkIRect& center, const SkRect& dst, const SkPaint* paint) { AutoReplayer replayer(this); this->SkCanvas::drawBitmapNine(bitmap, center, dst, paint); }
void ReplayingCanvas::drawBitmapMatrix(const SkBitmap& bitmap, const SkMatrix& m, const SkPaint* paint) { AutoReplayer replayer(this); this->SkCanvas::drawBitmapMatrix(bitmap, m, paint); }
void ReplayingCanvas::onPushCull(const SkRect& cullRect) { AutoReplayer replayer(this); this->SkCanvas::onPushCull(cullRect); }
void ReplayingCanvas::addComment(const char* keyword, const char* value) { AutoReplayer replayer(this); this->SkCanvas::addComment(keyword, value); }
void ReplayingCanvas::onPopCull() { AutoReplayer replayer(this); this->SkCanvas::onPopCull(); }
void ReplayingCanvas::endCommentGroup() { AutoReplayer replayer(this); this->SkCanvas::endCommentGroup(); }
void ReplayingCanvas::onClipPath(const SkPath& path, SkRegion::Op op, ClipEdgeStyle edgeStyle) { AutoReplayer replayer(this); this->SkCanvas::onClipPath(path, op, edgeStyle); }
void ReplayingCanvas::willRestore() { AutoReplayer replayer(this); this->SkCanvas::willRestore(); }
void ReplayingCanvas::onDrawPicture(const SkPicture* picture, const SkMatrix* matrix, const SkPaint* paint) { AutoReplayer replayer(this); this->SkCanvas::onDrawPicture(picture, matrix, paint); }
void ReplayingCanvas::drawPaint(const SkPaint& paint) { AutoReplayer replayer(this); this->SkCanvas::drawPaint(paint); }
void ReplayingCanvas::onDrawDRRect(const SkRRect& outer, const SkRRect& inner, const SkPaint& paint) { AutoReplayer replayer(this); this->SkCanvas::onDrawDRRect(outer, inner, paint); }
void ReplayingCanvas::drawBitmap(const SkBitmap& bitmap, SkScalar left, SkScalar top, const SkPaint* paint) { AutoReplayer replayer(this); this->SkCanvas::drawBitmap(bitmap, left, top, paint); }
void ReplayingCanvas::clear(SkColor color) { AutoReplayer replayer(this); this->SkCanvas::clear(color); }
void ReplayingCanvas::onDrawText(const void* text, size_t byteLength, SkScalar x, SkScalar y, const SkPaint& paint) { AutoReplayer replayer(this); this->SkCanvas::onDrawText(text, byteLength, x, y, paint); }
void ReplayingCanvas::drawPoints(PointMode mode, size_t count, const SkPoint pts[], const SkPaint& paint) { AutoReplayer replayer(this); this->SkCanvas::drawPoints(mode, count, pts, paint); }
void ReplayingCanvas::onDrawPosText(const void* text, size_t byteLength, const SkPoint pos[], const SkPaint& paint) { AutoReplayer replayer(this); this->SkCanvas::onDrawPosText(text, byteLength, pos, paint); }