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

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

Issue 2453013002: Mus: Remove dependency on ServerWindowCompositorFrameSink from FrameGenerator (Closed)
Patch Set: Rebased 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 c8f09cb774751f3bacd0b479c6decfc6458551de..b90e51a78d64e4b5c824821db864fa685fbc1a14 100644
--- a/services/ui/ws/window_server.cc
+++ b/services/ui/ws/window_server.cc
@@ -16,6 +16,7 @@
#include "services/ui/ws/gpu_service_proxy.h"
#include "services/ui/ws/operation.h"
#include "services/ui/ws/server_window.h"
+#include "services/ui/ws/server_window_compositor_frame_sink_manager.h"
#include "services/ui/ws/user_activity_monitor.h"
#include "services/ui/ws/window_coordinate_conversions.h"
#include "services/ui/ws/window_manager_access_policy.h"
@@ -803,17 +804,26 @@ void WindowServer::OnSurfaceCreated(const cc::SurfaceId& surface_id,
float device_scale_factor) {
WindowId window_id(
WindowIdFromTransportId(surface_id.frame_sink_id().client_id()));
- mojom::CompositorFrameSinkType surface_type(
+ mojom::CompositorFrameSinkType compositor_frame_sink_type(
static_cast<mojom::CompositorFrameSinkType>(
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::CompositorFrameSinkType::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())
+ if (!window)
+ return;
+
+ // Cache the last submitted surface ID in the window server.
+ // DisplayCompositorFrameSink may submit a CompositorFrame without
+ // creating a CompositorFrameSinkManager.
+ window->GetOrCreateCompositorFrameSinkManager()->SetLatestSurfaceInfo(
+ compositor_frame_sink_type, surface_id, frame_size);
+
+ // We only care about propagating default surface IDs.
+ // TODO(fsamuel, sadrul): we should get rid of CompositorFrameSinkTypes.
+ if (compositor_frame_sink_type != mojom::CompositorFrameSinkType::DEFAULT ||
+ !window->parent()) {
return;
+ }
WindowTree* window_tree = GetTreeWithId(window->parent()->id().client_id);
if (window_tree) {
window_tree->ProcessWindowSurfaceChanged(window, surface_id, frame_size,
« no previous file with comments | « services/ui/ws/server_window_compositor_frame_sink_manager_test_api.cc ('k') | services/ui/ws/window_server_test_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698