Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(171)

Unified Diff: ui/aura/mus/window_tree_client.cc

Issue 2780043002: Aura-Mus: Allocate a LocalSurfaceId on size change (Closed)
Patch Set: Cleanup Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/aura/mus/window_port_mus.cc ('k') | ui/aura/mus/window_tree_client_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/aura/mus/window_tree_client.cc
diff --git a/ui/aura/mus/window_tree_client.cc b/ui/aura/mus/window_tree_client.cc
index 99fb274e43a700fe2286c691d61c31274689f408..21332451bfa77dd56112fd5ad1fe9d2b5749ece9 100644
--- a/ui/aura/mus/window_tree_client.cc
+++ b/ui/aura/mus/window_tree_client.cc
@@ -479,7 +479,8 @@ WindowMus* WindowTreeClient::NewWindowFromWindowData(
window->Init(ui::LAYER_NOT_DRAWN);
SetLocalPropertiesFromServerProperties(window_mus, window_data);
window_mus->SetBoundsFromServer(
- gfx::ConvertRectToDIP(ScaleFactorForDisplay(window), window_data.bounds));
+ gfx::ConvertRectToDIP(ScaleFactorForDisplay(window), window_data.bounds),
+ base::nullopt);
if (parent)
parent->AddChildFromServer(window_port_mus_ptr);
if (window_data.visible)
@@ -606,8 +607,10 @@ void WindowTreeClient::SetWindowBoundsFromServer(
return;
}
- window->SetBoundsFromServer(gfx::ConvertRectToDIP(
- ScaleFactorForDisplay(window->GetWindow()), revert_bounds_in_pixels));
+ window->SetBoundsFromServer(
+ gfx::ConvertRectToDIP(ScaleFactorForDisplay(window->GetWindow()),
+ revert_bounds_in_pixels),
+ local_surface_id);
}
void WindowTreeClient::SetWindowVisibleFromServer(WindowMus* window,
@@ -630,12 +633,16 @@ void WindowTreeClient::ScheduleInFlightBoundsChange(
WindowMus* window,
const gfx::Rect& old_bounds,
const gfx::Rect& new_bounds) {
- // TODO(fsamuel): Allocate a new LocalSurfaceId on size change.
const uint32_t change_id =
ScheduleInFlightChange(base::MakeUnique<InFlightBoundsChange>(
- this, window, old_bounds, base::nullopt));
+ this, window, old_bounds, window->GetLocalSurfaceId()));
+ base::Optional<cc::LocalSurfaceId> local_surface_id;
+ if ((window->window_mus_type() == WindowMusType::TOP_LEVEL_IN_WM ||
+ window->window_mus_type() == WindowMusType::EMBED_IN_OWNER)) {
+ local_surface_id = window->GetOrAllocateLocalSurfaceId(new_bounds.size());
+ }
tree_->SetWindowBounds(change_id, window->server_id(), new_bounds,
- base::nullopt);
+ local_surface_id);
}
void WindowTreeClient::OnWindowMusCreated(WindowMus* window) {
« no previous file with comments | « ui/aura/mus/window_port_mus.cc ('k') | ui/aura/mus/window_tree_client_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698