Commit 643813e1 authored by Scott Violet's avatar Scott Violet Committed by Commit Bot

Revert "chromeos: makes resizes smoother with mash"

This reverts commit b805090b.

Reason for revert: This makes the mouse get stuck hidden on device.

Original change's description:
> chromeos: makes resizes smoother with mash
> 
> This contains two changes:
> 1. Adds call from ClientRoot to Compositor::OnChildResizing(). This ensures
>    that WindowTreeHost doesn't dispatch move events until the frame has been
>    activated.
> 2. Converts resetting of pointer moves lock from OnCompositingDidCommit()
>    to OnCompositingEnded(). OnCompositingDidCommit() seems to be called much
>    to earlier in the mash case, and results in jank when resizing.
> 
> BUG=929914
> TEST=none
> 
> Change-Id: I68d87d6e7f237f246c2fad6218d9da5356c98641
> Reviewed-on: https://chromium-review.googlesource.com/c/1467917
> Commit-Queue: Scott Violet <sky@chromium.org>
> Reviewed-by: Saman Sami <samans@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#631743}

TBR=sky@chromium.org,samans@chromium.org

Change-Id: Iaf103ed66885da652c7013fcc412b0269e10b303
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 929914
Reviewed-on: https://chromium-review.googlesource.com/c/1470935Reviewed-by: default avatarScott Violet <sky@chromium.org>
Commit-Queue: Scott Violet <sky@chromium.org>
Cr-Commit-Position: refs/heads/master@{#631803}
parent 88662d49
......@@ -129,7 +129,7 @@ class OverviewSessionTest : public AshTestBase {
void SetUp() override {
AshTestBase::SetUp();
Shell::Get()->aura_env()->set_throttle_input_on_resize_for_testing(false);
shelf_view_test_api_ = std::make_unique<ShelfViewTestAPI>(
GetPrimaryShelf()->GetShelfViewForTesting());
shelf_view_test_api_->SetAnimationDuration(1);
......
......@@ -92,7 +92,6 @@ class WindowServiceDelegateImplTest : public AshTestBase {
// AshTestBase:
void SetUp() override {
AshTestBase::SetUp();
Shell::Get()->aura_env()->set_throttle_input_on_resize_for_testing(false);
NonClientFrameViewAsh::use_empty_minimum_size_for_test_ = true;
top_level_ = CreateTestWindow(gfx::Rect(100, 100, 100, 100));
ASSERT_TRUE(top_level_);
......
......@@ -252,12 +252,6 @@ void ClientRoot::UpdateLocalSurfaceIdAndClientSurfaceEmbedder() {
window_->GetFrameSinkId(),
proxy_window->local_surface_id_allocation()->local_surface_id());
client_surface_embedder_->SetSurfaceId(surface_id);
// This triggers holding events until the frame has been activated. This
// ensures smooth resizes.
if (ShouldAssignLocalSurfaceId() && window_->GetHost())
window_->GetHost()->compositor()->OnChildResizing();
if (fallback_surface_info_) {
client_surface_embedder_->SetFallbackSurfaceInfo(*fallback_surface_info_);
fallback_surface_info_.reset();
......@@ -414,8 +408,6 @@ void ClientRoot::OnHostResized(aura::WindowTreeHost* host) {
void ClientRoot::OnFirstSurfaceActivation(
const viz::SurfaceInfo& surface_info) {
// TODO(sky): saman says the SetFallbackSurfaceInfo() should not be needed
// anymore.
ProxyWindow* proxy_window = ProxyWindow::GetMayBeNull(window_);
if (proxy_window->local_surface_id_allocation().has_value()) {
DCHECK(!fallback_surface_info_);
......
......@@ -140,9 +140,6 @@ WindowServiceTestSetup::WindowServiceTestSetup()
ui::InitializeContextFactoryForTests(enable_pixel_output, &context_factory,
&context_factory_private);
aura_test_helper_.SetUp(context_factory, context_factory_private);
// The resize throttle may interfere with tests, so disable it. If specific
// tests want the throttle, they can enable it.
aura::Env::GetInstance()->set_throttle_input_on_resize_for_testing(false);
scoped_capture_client_ = std::make_unique<wm::ScopedCaptureClient>(
aura_test_helper_.root_window());
service_ =
......
......@@ -540,7 +540,7 @@ void WindowTreeHost::MoveCursorToInternal(const gfx::Point& root_location,
dispatcher()->OnCursorMovedToRootLocation(root_location);
}
void WindowTreeHost::OnCompositingEnded(ui::Compositor* compositor) {
void WindowTreeHost::OnCompositingDidCommit(ui::Compositor* compositor) {
if (!holding_pointer_moves_)
return;
......
......@@ -341,7 +341,7 @@ class AURA_EXPORT WindowTreeHost : public ui::internal::InputMethodDelegate,
const gfx::Point& host_location);
// Overrided from CompositorObserver:
void OnCompositingEnded(ui::Compositor* compositor) override;
void OnCompositingDidCommit(ui::Compositor* compositor) override;
void OnCompositingChildResizing(ui::Compositor* compositor) override;
void OnCompositingShuttingDown(ui::Compositor* compositor) override;
......
......@@ -59,8 +59,8 @@ TEST_F(WindowTreeHostTest, HoldPointerMovesOnChildResizing) {
// effect of prioritizing the resize event above other operations in aura.
EXPECT_TRUE(dispatcher_api.HoldingPointerMoves());
// Wait for a CompositorFrame to be activated.
ui::DrawWaiterForTest::WaitForCompositingEnded(host()->compositor());
// Wait for a CompositorFrame to be submitted.
ui::DrawWaiterForTest::WaitForCompositingStarted(host()->compositor());
// Pointer moves should be routed normally after commit.
EXPECT_FALSE(dispatcher_api.HoldingPointerMoves());
......
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