Commit 880f62b8 authored by Fady Samuel's avatar Fady Samuel Committed by Commit Bot

Surface Synchronization: Simplify RenderWidgetHostViewAura

RenderWidgetHostViewAura had a SyncSurfaceProperties and
SynchronizeVisualProperties. The only difference is
SynchronizeVisualProperties took an optional LocalSurfaceId and
updated the ParentLocalSurfaceIdAllocator using that Id if specified.
If unspecified, it allocated a new ID.

This CL merges SyncSurfaceProperties into SynchronizeVisualProperties
thereby making the code a tiny bit easier to understand.

Bug: 672962
Change-Id: I902f6d86b37a2a4d33bef00b4e30014d2c15f20c
Reviewed-on: https://chromium-review.googlesource.com/1106237Reviewed-by: default avatarSaman Sami <samans@chromium.org>
Commit-Queue: Fady Samuel <fsamuel@chromium.org>
Cr-Commit-Position: refs/heads/master@{#568529}
parent 0a52618c
......@@ -1540,7 +1540,8 @@ void RenderWidgetHostViewAura::OnDeviceScaleFactorChanged(
if (!window_->GetRootWindow())
return;
SyncSurfaceProperties(cc::DeadlinePolicy::UseDefaultDeadline());
SynchronizeVisualProperties(cc::DeadlinePolicy::UseDefaultDeadline(),
window_->GetLocalSurfaceId());
device_scale_factor_ = new_device_scale_factor;
const display::Display display =
......@@ -2023,7 +2024,15 @@ bool RenderWidgetHostViewAura::SynchronizeVisualProperties(
DCHECK(window_);
window_->UpdateLocalSurfaceIdFromEmbeddedClient(
child_allocated_local_surface_id);
return SyncSurfaceProperties(deadline_policy);
if (IsLocalSurfaceIdAllocationSuppressed())
return false;
if (delegated_frame_host_) {
delegated_frame_host_->EmbedSurface(window_->GetLocalSurfaceId(),
window_->bounds().size(),
deadline_policy);
}
return host()->SynchronizeVisualProperties();
}
ui::InputMethod* RenderWidgetHostViewAura::GetInputMethod() const {
......@@ -2151,7 +2160,8 @@ void RenderWidgetHostViewAura::InternalSetBounds(const gfx::Rect& rect) {
if (!in_bounds_changed_)
window_->SetBounds(rect);
SyncSurfaceProperties(cc::DeadlinePolicy::UseDefaultDeadline());
SynchronizeVisualProperties(cc::DeadlinePolicy::UseDefaultDeadline(),
window_->GetLocalSurfaceId());
#if defined(OS_WIN)
UpdateLegacyWin();
......@@ -2161,19 +2171,6 @@ void RenderWidgetHostViewAura::InternalSetBounds(const gfx::Rect& rect) {
#endif
}
bool RenderWidgetHostViewAura::SyncSurfaceProperties(
const cc::DeadlinePolicy& deadline_policy) {
if (IsLocalSurfaceIdAllocationSuppressed())
return false;
if (delegated_frame_host_) {
delegated_frame_host_->EmbedSurface(window_->GetLocalSurfaceId(),
window_->bounds().size(),
deadline_policy);
}
return host()->SynchronizeVisualProperties();
}
#if defined(OS_WIN)
void RenderWidgetHostViewAura::UpdateLegacyWin() {
if (legacy_window_destroyed_ || !GetHostWindowHWND())
......@@ -2482,7 +2479,8 @@ void RenderWidgetHostViewAura::DidNavigate() {
// The first navigation does not need a new LocalSurfaceID. The renderer can
// use the ID that was already provided.
if (is_first_navigation_) {
SyncSurfaceProperties(cc::DeadlinePolicy::UseExistingDeadline());
SynchronizeVisualProperties(cc::DeadlinePolicy::UseExistingDeadline(),
window_->GetLocalSurfaceId());
} else {
SynchronizeVisualProperties(cc::DeadlinePolicy::UseExistingDeadline(),
base::nullopt);
......
......@@ -468,9 +468,6 @@ class CONTENT_EXPORT RenderWidgetHostViewAura
// space is required by the aura::Window.
void InternalSetBounds(const gfx::Rect& rect);
// Handles propagation of surface properties when they are changed.
bool SyncSurfaceProperties(const cc::DeadlinePolicy& deadline_policy);
#if defined(OS_WIN)
// Creates and/or updates the legacy dummy window which corresponds to
// the bounds of the webcontents. It is needed for accessibility and
......
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