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(); }
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); } } }