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

Unified Diff: services/ui/ws/window_tree.cc

Issue 2414683003: Mus+Ash: propagate Surface ID to parents (Closed)
Patch Set: Don't follow null surface_info Created 4 years, 2 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 | « services/ui/ws/window_tree.h ('k') | services/ui/ws/window_tree_client_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/ui/ws/window_tree.cc
diff --git a/services/ui/ws/window_tree.cc b/services/ui/ws/window_tree.cc
index d79f72f7a68572bf2cda8fafefaf1ecfe0765e0d..9a99c46247d728c2c067b90a236bd52b880dd6f4 100644
--- a/services/ui/ws/window_tree.cc
+++ b/services/ui/ws/window_tree.cc
@@ -20,6 +20,7 @@
#include "services/ui/ws/platform_display.h"
#include "services/ui/ws/server_window.h"
#include "services/ui/ws/server_window_observer.h"
+#include "services/ui/ws/server_window_surface_manager.h"
#include "services/ui/ws/user_display_manager.h"
#include "services/ui/ws/window_manager_display_root.h"
#include "services/ui/ws/window_manager_state.h"
@@ -756,6 +757,26 @@ void WindowTree::ProcessTransientWindowRemoved(
transient_client_window_id.id);
}
+void WindowTree::ProcessWindowSurfaceChanged(ServerWindow* window,
+ const cc::SurfaceId& surface_id,
+ const gfx::Size& frame_size,
+ float device_scale_factor) {
+ ServerWindow* parent_window = window->parent();
+ ClientWindowId client_window_id, parent_client_window_id;
+ if (!IsWindowKnown(window, &client_window_id) ||
+ !IsWindowKnown(parent_window, &parent_client_window_id) ||
+ !created_window_map_.count(parent_window->id())) {
+ return;
+ }
+
+ ServerWindowSurfaceManager* surface_manager =
+ window->GetOrCreateSurfaceManager();
+ ServerWindowSurface* surface = surface_manager->GetDefaultSurface();
+ cc::SurfaceSequence sequence = surface->CreateSurfaceSequence();
+ client()->OnWindowSurfaceChanged(client_window_id.id, surface_id, sequence,
+ frame_size, device_scale_factor);
+}
+
void WindowTree::SendToPointerWatcher(const ui::Event& event,
ServerWindow* target_window) {
if (!EventMatchesPointerWatcher(event))
@@ -1339,6 +1360,15 @@ void WindowTree::AttachSurface(Id transport_window_id,
window->CreateSurface(type, std::move(surface), std::move(client));
}
+void WindowTree::OnWindowSurfaceDetached(Id transport_window_id,
+ const cc::SurfaceSequence& sequence) {
+ ServerWindow* window =
+ GetWindowByClientId(ClientWindowId(transport_window_id));
+ if (!window)
+ return;
+ window_server_->GetDisplayCompositor()->ReturnSurfaceReference(sequence);
+}
+
void WindowTree::SetWindowTextInputState(Id transport_window_id,
mojo::TextInputStatePtr state) {
ServerWindow* window =
« no previous file with comments | « services/ui/ws/window_tree.h ('k') | services/ui/ws/window_tree_client_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698