Example #1
0
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);
}
Example #2
0
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;
}
Example #3
0
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);
}
Example #4
0
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);
}
Example #5
0
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);
}
Example #6
0
void ReplayingCanvas::drawRRect(const SkRRect& rrect, const SkPaint& paint)
{
    AutoReplayer replayer(this);
    this->SkCanvas::drawRRect(rrect, paint);
}
Example #7
0
void ReplayingCanvas::onClipRegion(const SkRegion& region, SkRegion::Op op)
{
    AutoReplayer replayer(this);
    this->SkCanvas::onClipRegion(region, op);
}
Example #8
0
void ReplayingCanvas::didConcat(const SkMatrix& matrix)
{
    AutoReplayer replayer(this);
    this->SkCanvas::didConcat(matrix);
}
Example #9
0
void ReplayingCanvas::beginCommentGroup(const char* description)
{
    AutoReplayer replayer(this);
    this->SkCanvas::beginCommentGroup(description);
}
Example #10
0
void ReplayingCanvas::onClipRRect(const SkRRect& rrect, SkRegion::Op op, ClipEdgeStyle edgeStyle)
{
    AutoReplayer replayer(this);
    this->SkCanvas::onClipRRect(rrect, op, edgeStyle);
}
Example #11
0
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);
}
Example #12
0
void ReplayingCanvas::drawData(const void* data, size_t length)
{
    AutoReplayer replayer(this);
    this->SkCanvas::drawData(data, length);
}
Example #13
0
void ReplayingCanvas::drawSprite(const SkBitmap& bitmap, int left, int top, const SkPaint* paint)
{
    AutoReplayer replayer(this);
    this->SkCanvas::drawSprite(bitmap, left, top, paint);
}
Example #14
0
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);
}
Example #15
0
void ReplayingCanvas::drawBitmapMatrix(const SkBitmap& bitmap, const SkMatrix& m, const SkPaint* paint)
{
    AutoReplayer replayer(this);
    this->SkCanvas::drawBitmapMatrix(bitmap, m, paint);
}
Example #16
0
void ReplayingCanvas::onPushCull(const SkRect& cullRect)
{
    AutoReplayer replayer(this);
    this->SkCanvas::onPushCull(cullRect);
}
Example #17
0
void ReplayingCanvas::addComment(const char* keyword, const char* value)
{
    AutoReplayer replayer(this);
    this->SkCanvas::addComment(keyword, value);
}
Example #18
0
void ReplayingCanvas::onPopCull()
{
    AutoReplayer replayer(this);
    this->SkCanvas::onPopCull();
}
Example #19
0
void ReplayingCanvas::endCommentGroup()
{
    AutoReplayer replayer(this);
    this->SkCanvas::endCommentGroup();
}
Example #20
0
void ReplayingCanvas::onClipPath(const SkPath& path, SkRegion::Op op, ClipEdgeStyle edgeStyle)
{
    AutoReplayer replayer(this);
    this->SkCanvas::onClipPath(path, op, edgeStyle);
}
Example #21
0
void ReplayingCanvas::willRestore()
{
    AutoReplayer replayer(this);
    this->SkCanvas::willRestore();
}
Example #22
0
void ReplayingCanvas::onDrawPicture(const SkPicture* picture, const SkMatrix* matrix, const SkPaint* paint)
{
    AutoReplayer replayer(this);
    this->SkCanvas::onDrawPicture(picture, matrix, paint);
}
Example #23
0
void ReplayingCanvas::drawPaint(const SkPaint& paint)
{
    AutoReplayer replayer(this);
    this->SkCanvas::drawPaint(paint);
}
Example #24
0
void ReplayingCanvas::onDrawDRRect(const SkRRect& outer, const SkRRect& inner, const SkPaint& paint)
{
    AutoReplayer replayer(this);
    this->SkCanvas::onDrawDRRect(outer, inner, paint);
}
Example #25
0
void ReplayingCanvas::drawBitmap(const SkBitmap& bitmap, SkScalar left, SkScalar top, const SkPaint* paint)
{
    AutoReplayer replayer(this);
    this->SkCanvas::drawBitmap(bitmap, left, top, paint);
}
Example #26
0
void ReplayingCanvas::clear(SkColor color)
{
    AutoReplayer replayer(this);
    this->SkCanvas::clear(color);
}
Example #27
0
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);
}
Example #28
0
void ReplayingCanvas::drawPoints(PointMode mode, size_t count, const SkPoint pts[], const SkPaint& paint)
{
    AutoReplayer replayer(this);
    this->SkCanvas::drawPoints(mode, count, pts, paint);
}
Example #29
0
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);
}