Commit 6b92159e authored by Peng Huang's avatar Peng Huang Committed by Commit Bot

Fix crashes in SkiaRenderer::PrepareRenderPassOverlay()

When SkiaRenderer::PrepareRenderPassOverlay() is preparing the
render pass overlay, current_frame()->current_render_pass could be
used. However it is nullptr, then crash happens. Fix the problem by
setting it to current_frame()->root_render_pass.

Bug: 1147583
Change-Id: I3b67ba792631b3ad24e927edab609563f1cbc0a5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2533014
Commit-Queue: Peng Huang <penghuang@chromium.org>
Reviewed-by: default avatarVasiliy Telezhnikov <vasilyt@chromium.org>
Cr-Commit-Position: refs/heads/master@{#826434}
parent 4fd17bfd
......@@ -7,6 +7,7 @@
#include <string>
#include <utility>
#include "base/auto_reset.h"
#include "base/bind.h"
#include "base/bits.h"
#include "base/command_line.h"
......@@ -2607,6 +2608,15 @@ void SkiaRenderer::PrepareRenderPassOverlay(CALayerOverlay* overlay) {
DCHECK(batched_quads_.empty());
DCHECK(overlay->rpdq);
// The |current_render_pass| could be used for caculating destination
// color space or clipping rect for backdrop filters. However
// the |current_render_pass| is nullptr during ScheduleOverlays(), since all
// overlay quads should be in the |root_render_pass|, before they are promoted
// to overlays, so set the |root_render_pass| to the |current_render_pass|.
DCHECK(!current_frame()->current_render_pass);
base::AutoReset<const AggregatedRenderPass*> auto_reset(
&current_frame()->current_render_pass, current_frame()->root_render_pass);
auto* const quad = overlay->rpdq;
overlay->rpdq = nullptr;
gfx::Transform target_to_device =
......
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