Commit 797dc685 authored by Chris Blume's avatar Chris Blume Committed by Commit Bot

services/ui/ to use default LSI

Previously, ParentLocalSurfaceIdAllocator would default to an invalid
LocalSurfaceId. A new LSI had to be explicitly allocated before the
normal behavior could use it.

With ParentLocalSurfaceIdAllocator now default initializing a valid LSI,
the various call sites no longer need to explicitly check for the
uninitialized state.

services/ui/ has some of those call sites.

BUG=837030

Change-Id: I1b82b0133de0ecc3e8fa71f5a40f25762732ccf3
Reviewed-on: https://chromium-review.googlesource.com/1038144
Commit-Queue: Chris Blume <cblume@chromium.org>
Reviewed-by: default avatarSadrul Chowdhury <sadrul@chromium.org>
Cr-Commit-Position: refs/heads/master@{#585927}
parent a719ba0b
...@@ -83,7 +83,6 @@ void ClientRoot::UpdateLocalSurfaceIdIfNecessary() { ...@@ -83,7 +83,6 @@ void ClientRoot::UpdateLocalSurfaceIdIfNecessary() {
// LocalSurfaceId is used. // LocalSurfaceId is used.
if (last_surface_size_in_pixels_ != size_in_pixels || if (last_surface_size_in_pixels_ != size_in_pixels ||
!server_window->local_surface_id().has_value() || !server_window->local_surface_id().has_value() ||
!server_window->local_surface_id()->is_valid() ||
last_device_scale_factor_ != window_->layer()->device_scale_factor()) { last_device_scale_factor_ != window_->layer()->device_scale_factor()) {
server_window->set_local_surface_id( server_window->set_local_surface_id(
parent_local_surface_id_allocator_.GenerateId()); parent_local_surface_id_allocator_.GenerateId());
......
...@@ -1225,7 +1225,7 @@ TEST_F(WindowTreeClientTest, DISABLED_SetWindowBounds) { ...@@ -1225,7 +1225,7 @@ TEST_F(WindowTreeClientTest, DISABLED_SetWindowBounds) {
wt_client2_->set_track_root_bounds_changes(true); wt_client2_->set_track_root_bounds_changes(true);
viz::ParentLocalSurfaceIdAllocator allocator; viz::ParentLocalSurfaceIdAllocator allocator;
viz::LocalSurfaceId local_surface_id = allocator.GenerateId(); viz::LocalSurfaceId local_surface_id = allocator.GetCurrentLocalSurfaceId();
wt1()->SetWindowBounds(10, window_1_1, gfx::Rect(0, 0, 100, 100), wt1()->SetWindowBounds(10, window_1_1, gfx::Rect(0, 0, 100, 100),
local_surface_id); local_surface_id);
ASSERT_TRUE(wt_client1()->WaitForChangeCompleted(10)); ASSERT_TRUE(wt_client1()->WaitForChangeCompleted(10));
......
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