Commit e222aca9 authored by kylechar's avatar kylechar Committed by Commit Bot

Fix SkiaOutputSurfaceImpl crash

There are occasional crashes accessing an empty
|overdraw_surface_recorder_|. Even if |show_overdraw_feedback| is true
creation of the recorded can fail, so using that bool to guard access
isn't correct. Check if the recorded exists before accessing it instead.

Also unconditionally reset |nway_canvas_| since it can be created even
if recorder creation fails.

Bug: 1143631
Change-Id: Ie00eeb11d84eedd589f7d99e62bbb80ab3d16bc9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2521050
Commit-Queue: kylechar <kylechar@chromium.org>
Reviewed-by: default avatarPeng Huang <penghuang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#824654}
parent 3ac23c8d
......@@ -579,13 +579,13 @@ void SkiaOutputSurfaceImpl::EndPaint(base::OnceClosure on_finished) {
// Draw on the root render pass.
current_buffer_modified_ = true;
sk_sp<SkDeferredDisplayList> overdraw_ddl;
if (debug_settings_->show_overdraw_feedback) {
if (overdraw_surface_recorder_) {
overdraw_ddl = overdraw_surface_recorder_->detach();
DCHECK(overdraw_ddl);
overdraw_canvas_.reset();
nway_canvas_.reset();
overdraw_surface_recorder_.reset();
}
nway_canvas_.reset();
auto task = base::BindOnce(
&SkiaOutputSurfaceImplOnGpu::FinishPaintCurrentFrame,
......
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