Commit 57f139f6 authored by danakj's avatar danakj Committed by Commit Bot

Don't change compositor visibility when RenderWidget is frozen.

A frozen RenderWidget must still be made visible when the RenderView
is made visible (background tab becoming foreground) because RenderView
reads the RenderWidget to determine the Page visibility (even though we
have IPCs to the RenderView telling it what to use~~!).

This is bad but we can't leave us crashing in Canary so avoid chaning
compositor visibility even though the RenderWidget is changing, and the
compositor's will catch up when unfreezing.

R=ajwong@chromium.org, piman@chromium.org

Change-Id: Idbc81efacd331c227d01ad61e182ccdf98bf2c42
Bug: 896836
Reviewed-on: https://chromium-review.googlesource.com/c/1340864
Commit-Queue: danakj <danakj@chromium.org>
Reviewed-by: default avatarAntoine Labour <piman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#609389}
parent 8e7b749e
......@@ -806,9 +806,10 @@ void RenderWidget::OnWasHidden() {
void RenderWidget::OnWasShown(base::TimeTicks show_request_timestamp,
bool was_evicted) {
TRACE_EVENT0("renderer", "RenderWidget::OnWasShown");
// TODO(crbug.com/896836): CHECK to try track down why we make a frame sink
// for a RenderWidget without a main frame.
CHECK(!is_frozen_);
// TODO(danakj): Nothing should happen ideally if the RenderWidget is frozen!
// It's not visible! However.. the RenderView needs to see it as visible in
// order to make the Page visible /o\ so this is hard. We need to detangle
// page visibility from the main widget. https://crbug.com/419087
was_shown_time_ = base::TimeTicks::Now();
// See OnWasHidden
......@@ -2260,7 +2261,15 @@ void RenderWidget::SetHidden(bool hidden) {
if (render_widget_scheduling_state_)
render_widget_scheduling_state_->SetHidden(hidden);
layer_tree_view_->SetVisible(!is_hidden_);
// When the RenderWidget is frozen, visibility of the compositor is overridden
// to always be hidden to prevent it from using resources that are not needed.
// Unfortunately the main RenderWidget for a RenderView must be marked visible
// even if the RenderView has a proxy main frame (and the RenderWidget is
// frozen), in order for the RenderView to use the visibility signal from the
// RenderWidget. This is bad. But we don't need to show the compositor to
// satisfy that requirement.
if (!is_frozen_)
layer_tree_view_->SetVisible(!is_hidden_);
}
void RenderWidget::DidToggleFullscreen() {
......
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