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

Unified Diff: services/ui/ws/window_server.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_server.h ('k') | services/ui/ws/window_tree.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/ui/ws/window_server.cc
diff --git a/services/ui/ws/window_server.cc b/services/ui/ws/window_server.cc
index ad3286e304cb863663784c32532c8a6f82abe32a..0a2da287787e25d1f4ce9b3d5de2feaccc5e57be 100644
--- a/services/ui/ws/window_server.cc
+++ b/services/ui/ws/window_server.cc
@@ -46,7 +46,7 @@ struct WindowServer::CurrentDragLoopState {
WindowServer::WindowServer(WindowServerDelegate* delegate)
: delegate_(delegate),
- display_compositor_(new DisplayCompositor()),
+ display_compositor_(new DisplayCompositor(this)),
next_client_id_(1),
display_manager_(new DisplayManager(this, &user_id_tracker_)),
current_operation_(nullptr),
@@ -799,6 +799,28 @@ void WindowServer::OnGpuChannelEstablished(
display->platform_display()->OnGpuChannelEstablished(gpu_channel_);
}
+void WindowServer::OnSurfaceCreated(const cc::SurfaceId& surface_id,
+ const gfx::Size& frame_size,
+ float device_scale_factor) {
+ WindowId window_id(
+ WindowIdFromTransportId(surface_id.frame_sink_id().client_id()));
+ mojom::SurfaceType surface_type(
+ static_cast<mojom::SurfaceType>(surface_id.frame_sink_id().sink_id()));
+ // We only care about propagating default surface IDs.
+ // TODO(fsamuel, sadrul): we should get rid of surface types.
+ if (surface_type != mojom::SurfaceType::DEFAULT)
+ return;
+ ServerWindow* window = GetWindow(window_id);
+ // If the window doesn't have a parent then we have nothing to propagate.
+ if (!window || !window->parent())
+ return;
+ WindowTree* window_tree = GetTreeWithId(window->parent()->id().client_id);
+ if (window_tree) {
+ window_tree->ProcessWindowSurfaceChanged(window, surface_id, frame_size,
+ device_scale_factor);
+ }
+}
+
void WindowServer::OnActiveUserIdChanged(const UserId& previously_active_id,
const UserId& active_id) {
if (IsUserInHighContrastMode(previously_active_id) ==
« no previous file with comments | « services/ui/ws/window_server.h ('k') | services/ui/ws/window_tree.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698