Exemplo n.º 1
0
void ImageBuffer::resetRecordingToLayer( GraphicsContext* paintContext, const IntRect& r,
                                         CanvasLayerAndroid* canvasLayer) const
{
    SkPicture* canvasRecording = new SkPicture();
    SkPicture dstPicture(*canvasRecording);
    canvasLayer->setPicture(dstPicture);
    //canvasLayer->setRect(r);
    clearRecording();
}
Exemplo n.º 2
0
void CanvasLayer::copyRecordingToLayer(GraphicsContext* ctx, IntRect& r, int canvas_id)
{
    if(ctx)
    {
        SkPicture* canvasRecording = ctx->platformContext()->getRecordingPicture();
        SkPicture dstPicture(*canvasRecording);
        IntSize size = r.size();

        MutexLocker locker(s_mutex);
        CanvasLayerAndroid* gpuCanvas = CanvasLayer::getGpuCanvas(canvas_id);
        if(gpuCanvas)
        {
            gpuCanvas->setPicture(dstPicture, size);
        }
    }
}