Commit a3b4039f authored by danakj's avatar danakj Committed by Commit Bot

Generate a local surface ID on Webview when showing the RenderWidget

If a RenderWidget is started as hidden, it should generate a local
surface Id when it's shown. On Webview, the delegated_frame_host_
is null, which was preventing this from happening. Change the
conditional to still generate the local surface ID.

We got by with this bug because RenderWidgets for RenderFrames are
always started as visible, then hidden with a method call to the
RenderWidgetHostView. Future CLs remove this ping-ponging of visibility
states.

R=boliu@chromium.org

Bug: 419087, 745091
Change-Id: I7c7ffb49fde75c94b68ffb4e72b3a7676ac6d429
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1726872Reviewed-by: default avatarBo <boliu@chromium.org>
Commit-Queue: danakj <danakj@chromium.org>
Cr-Commit-Position: refs/heads/master@{#682391}
parent e9ddea61
......@@ -1508,9 +1508,9 @@ void RenderWidgetHostViewAndroid::ShowInternal() {
if (overscroll_controller_)
overscroll_controller_->Enable();
if (delegated_frame_host_ &&
(delegated_frame_host_->IsPrimarySurfaceEvicted() ||
!local_surface_id_allocator_.HasValidLocalSurfaceIdAllocation())) {
if ((delegated_frame_host_ &&
delegated_frame_host_->IsPrimarySurfaceEvicted()) ||
!local_surface_id_allocator_.HasValidLocalSurfaceIdAllocation()) {
ui::WindowAndroidCompositor* compositor =
view_.GetWindowAndroid() ? view_.GetWindowAndroid()->GetCompositor()
: nullptr;
......@@ -1521,7 +1521,9 @@ void RenderWidgetHostViewAndroid::ShowInternal() {
: cc::DeadlinePolicy::UseDefaultDeadline(),
base::nullopt);
// If we navigated while hidden, we need to update the fallback surface only
// after we've completed navigation, and embedded the new surface.
// after we've completed navigation, and embedded the new surface. The
// |delegated_frame_host_| is always valid when |navigation_while_hidden_|
// is set to true.
if (navigation_while_hidden_) {
navigation_while_hidden_ = false;
delegated_frame_host_->DidNavigate();
......
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