From 6a280a50eddc30c6b2a090d9e8e7df78afe7a457 Mon Sep 17 00:00:00 2001 From: Adrienne Walker Date: Mon, 1 May 2017 13:45:01 -0700 Subject: Expose resetForNextPicture in SkNoDrawCanvas SkRecorder has some private Skia behavior with the way it handles an SkNoDrawCanvas that is not exposed. In particular, it's able to create an arbitrary SkIRect device clip at construction time. This is a performance optimization when reusing SkNoDrawCanvas across multiple recordings instead of reconstructing a new canvas every time. https://codereview.chromium.org/2768143002 is trying to implement another version of SkPictureBuilder/SkRecorder and so wants to be able to use similar SkNoDrawCanvas behavior. Change-Id: I0ac5f0eef8f0548cefd7354062311667cf448b07 Reviewed-on: https://skia-review.googlesource.com/11320 Reviewed-by: Mike Reed Reviewed-by: Mike Klein Commit-Queue: Mike Klein --- src/utils/SkDeferredCanvas.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/utils/SkDeferredCanvas.cpp') diff --git a/src/utils/SkDeferredCanvas.cpp b/src/utils/SkDeferredCanvas.cpp index 975f496d3b..a98d4b7387 100644 --- a/src/utils/SkDeferredCanvas.cpp +++ b/src/utils/SkDeferredCanvas.cpp @@ -63,7 +63,8 @@ void SkDeferredCanvas::reset(SkCanvas* canvas) { } fRecs.reset(); if (canvas) { - this->resetForNextPicture(SkIRect::MakeSize(canvas->getBaseLayerSize())); + this->resetCanvas(canvas->getBaseLayerSize().width(), + canvas->getBaseLayerSize().height()); fCanvas = canvas; } } -- cgit v1.2.3