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

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

Issue 2414683003: Mus+Ash: propagate Surface ID to parents (Closed)
Patch Set: Removed stale comment 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
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..4a3898f398455c3e1bc671b3f4b2c4b2fc0915b4 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,27 @@ 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;
+ for (auto& pair : tree_map_) {
+ pair.second->ProcessWindowSurfaceCreated(window, surface_id, frame_size,
sky 2016/10/14 20:55:46 Only the owner of window->parent() cares about thi
Fady Samuel 2016/10/14 21:32:48 Done.
+ device_scale_factor);
+ }
+}
+
void WindowServer::OnActiveUserIdChanged(const UserId& previously_active_id,
const UserId& active_id) {
if (IsUserInHighContrastMode(previously_active_id) ==

Powered by Google App Engine
This is Rietveld 408576698