Exemplo n.º 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);
}
Exemplo n.º 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;
}
Exemplo n.º 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);
}
Exemplo n.º 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);
}
Exemplo n.º 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);
}
Exemplo n.º 6
0
void ReplayingCanvas::drawRRect(const SkRRect& rrect, const SkPaint& paint)
{
    AutoReplayer replayer(this);
    this->SkCanvas::drawRRect(rrect, paint);
}
Exemplo n.º 7
0
void ReplayingCanvas::onClipRegion(const SkRegion& region, SkRegion::Op op)
{
    AutoReplayer replayer(this);
    this->SkCanvas::onClipRegion(region, op);
}
Exemplo n.º 8
0
void ReplayingCanvas::didConcat(const SkMatrix& matrix)
{
    AutoReplayer replayer(this);
    this->SkCanvas::didConcat(matrix);
}
Exemplo n.º 9
0
void ReplayingCanvas::beginCommentGroup(const char* description)
{
    AutoReplayer replayer(this);
    this->SkCanvas::beginCommentGroup(description);
}
Exemplo n.º 10
0
void ReplayingCanvas::onClipRRect(const SkRRect& rrect, SkRegion::Op op, ClipEdgeStyle edgeStyle)
{
    AutoReplayer replayer(this);
    this->SkCanvas::onClipRRect(rrect, op, edgeStyle);
}
Exemplo n.º 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);
}
Exemplo n.º 12
0
void ReplayingCanvas::drawData(const void* data, size_t length)
{
    AutoReplayer replayer(this);
    this->SkCanvas::drawData(data, length);
}
Exemplo n.º 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);
}
Exemplo n.º 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);
}
Exemplo n.º 15
0
void ReplayingCanvas::drawBitmapMatrix(const SkBitmap& bitmap, const SkMatrix& m, const SkPaint* paint)
{
    AutoReplayer replayer(this);
    this->SkCanvas::drawBitmapMatrix(bitmap, m, paint);
}
Exemplo n.º 16
0
void ReplayingCanvas::onPushCull(const SkRect& cullRect)
{
    AutoReplayer replayer(this);
    this->SkCanvas::onPushCull(cullRect);
}
Exemplo n.º 17
0
void ReplayingCanvas::addComment(const char* keyword, const char* value)
{
    AutoReplayer replayer(this);
    this->SkCanvas::addComment(keyword, value);
}
Exemplo n.º 18
0
void ReplayingCanvas::onPopCull()
{
    AutoReplayer replayer(this);
    this->SkCanvas::onPopCull();
}
Exemplo n.º 19
0
void ReplayingCanvas::endCommentGroup()
{
    AutoReplayer replayer(this);
    this->SkCanvas::endCommentGroup();
}
Exemplo n.º 20
0
void ReplayingCanvas::onClipPath(const SkPath& path, SkRegion::Op op, ClipEdgeStyle edgeStyle)
{
    AutoReplayer replayer(this);
    this->SkCanvas::onClipPath(path, op, edgeStyle);
}
Exemplo n.º 21
0
void ReplayingCanvas::willRestore()
{
    AutoReplayer replayer(this);
    this->SkCanvas::willRestore();
}
Exemplo n.º 22
0
void ReplayingCanvas::onDrawPicture(const SkPicture* picture, const SkMatrix* matrix, const SkPaint* paint)
{
    AutoReplayer replayer(this);
    this->SkCanvas::onDrawPicture(picture, matrix, paint);
}
Exemplo n.º 23
0
void ReplayingCanvas::drawPaint(const SkPaint& paint)
{
    AutoReplayer replayer(this);
    this->SkCanvas::drawPaint(paint);
}
Exemplo n.º 24
0
void ReplayingCanvas::onDrawDRRect(const SkRRect& outer, const SkRRect& inner, const SkPaint& paint)
{
    AutoReplayer replayer(this);
    this->SkCanvas::onDrawDRRect(outer, inner, paint);
}
Exemplo n.º 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);
}
Exemplo n.º 26
0
void ReplayingCanvas::clear(SkColor color)
{
    AutoReplayer replayer(this);
    this->SkCanvas::clear(color);
}
Exemplo n.º 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);
}
Exemplo n.º 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);
}
Exemplo n.º 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);
}