Commit f1d68ed3 authored by Sadrul Habib Chowdhury's avatar Sadrul Habib Chowdhury Committed by Commit Bot

views/win: Re-enable Display swap without touching cc.

Reset the size of the viz::Display directly to the original size, instead
of triggering a size-change in the layer-compositor (cc) too, when a resize
operation ends without actually resizing the window on Windows.

BUG=821987

Change-Id: I97c6e76fd52b46d782a172fc54bb7cf9a0e0a1d6
Reviewed-on: https://chromium-review.googlesource.com/1006518Reviewed-by: default avatarAntoine Labour <piman@chromium.org>
Commit-Queue: Sadrul Chowdhury <sadrul@chromium.org>
Cr-Commit-Position: refs/heads/master@{#550031}
parent 06be32b6
...@@ -336,9 +336,15 @@ void Compositor::ScheduleRedrawRect(const gfx::Rect& damage_rect) { ...@@ -336,9 +336,15 @@ void Compositor::ScheduleRedrawRect(const gfx::Rect& damage_rect) {
} }
void Compositor::DisableSwapUntilResize() { void Compositor::DisableSwapUntilResize() {
DCHECK(context_factory_private_);
context_factory_private_->ResizeDisplay(this, gfx::Size()); context_factory_private_->ResizeDisplay(this, gfx::Size());
} }
void Compositor::ReenableSwap() {
DCHECK(context_factory_private_);
context_factory_private_->ResizeDisplay(this, size_);
}
void Compositor::SetLatencyInfo(const ui::LatencyInfo& latency_info) { void Compositor::SetLatencyInfo(const ui::LatencyInfo& latency_info) {
std::unique_ptr<cc::SwapPromise> swap_promise( std::unique_ptr<cc::SwapPromise> swap_promise(
new cc::LatencyInfoSwapPromise(latency_info)); new cc::LatencyInfoSwapPromise(latency_info));
......
...@@ -260,6 +260,7 @@ class COMPOSITOR_EXPORT Compositor : public cc::LayerTreeHostClient, ...@@ -260,6 +260,7 @@ class COMPOSITOR_EXPORT Compositor : public cc::LayerTreeHostClient,
// Finishes all outstanding rendering and disables swapping on this surface // Finishes all outstanding rendering and disables swapping on this surface
// until it is resized. // until it is resized.
void DisableSwapUntilResize(); void DisableSwapUntilResize();
void ReenableSwap();
void SetLatencyInfo(const LatencyInfo& latency_info); void SetLatencyInfo(const LatencyInfo& latency_info);
......
...@@ -969,13 +969,8 @@ void DesktopWindowTreeHostWin::HandleWindowSizeUnchanged() { ...@@ -969,13 +969,8 @@ void DesktopWindowTreeHostWin::HandleWindowSizeUnchanged() {
// changed (can occur on Windows 10 when snapping a window to the side of // changed (can occur on Windows 10 when snapping a window to the side of
// the screen). In that case do a resize to the current size to reenable // the screen). In that case do a resize to the current size to reenable
// swaps. // swaps.
// TODO(ccameron): This will violate surface invariants. if (compositor())
if (compositor()) { compositor()->ReenableSwap();
compositor()->SetScaleAndSize(
compositor()->device_scale_factor(),
message_handler_->GetClientAreaBounds().size(),
window()->GetLocalSurfaceId());
}
} }
void DesktopWindowTreeHostWin::HandleWindowScaleFactorChanged( void DesktopWindowTreeHostWin::HandleWindowScaleFactorChanged(
......
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