Commit 0bfec541 authored by Juanmi Huertas's avatar Juanmi Huertas Committed by Commit Bot

Only disable deferral when it is enabled

We only have to disable deferral when it is enable to avoid issues with
stack or with performance having to recreate resources and play the
matrix transformations all over again.

Bug: 1003124, 1001142, 997735
Change-Id: Ib5b60c89b1218dd50c0b97914c08ca921683435a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1808276Reviewed-by: default avatarFernando Serboncini <fserb@chromium.org>
Commit-Queue: Juanmi Huertas <juanmihd@chromium.org>
Cr-Commit-Position: refs/heads/master@{#697741}
parent fafde9fb
...@@ -443,15 +443,19 @@ bool Canvas2DLayerBridge::WritePixels(const SkImageInfo& orig_info, ...@@ -443,15 +443,19 @@ bool Canvas2DLayerBridge::WritePixels(const SkImageInfo& orig_info,
return false; return false;
} }
// WritePixels is not supported by deferral. Since we are directly rendering, if (is_deferral_enabled_) {
// we can't do deferral on top of the canvas. Disable deferral completely. // WritePixels is not supported by deferral. Since we are directly
last_recording_ = nullptr; // rendering, we can't do deferral on top of the canvas. Disable deferral
is_deferral_enabled_ = false; // completely.
have_recorded_draw_commands_ = false; last_recording_ = nullptr;
recorder_.reset(); is_deferral_enabled_ = false;
// install the current matrix/clip stack onto the immediate canvas have_recorded_draw_commands_ = false;
if (GetOrCreateResourceProvider()) { recorder_.reset();
resource_host_->RestoreCanvasMatrixClipStack(ResourceProvider()->Canvas()); // install the current matrix/clip stack onto the immediate canvas
if (GetOrCreateResourceProvider()) {
resource_host_->RestoreCanvasMatrixClipStack(
ResourceProvider()->Canvas());
}
} }
ResourceProvider()->WritePixels(orig_info, pixels, row_bytes, x, y); ResourceProvider()->WritePixels(orig_info, pixels, row_bytes, x, y);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment