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

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

Issue 2369793002: WIP: Propagate SurfaceID up window tree hierarchy
Patch Set: Fix input events: EventDispatcher ignores container windows Created 4 years, 3 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/server_window_surface_manager.h ('k') | services/ui/ws/window_finder.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/ui/ws/server_window_surface_manager.cc
diff --git a/services/ui/ws/server_window_surface_manager.cc b/services/ui/ws/server_window_surface_manager.cc
index 0bb6277aee68c82f68ce37f93dd7a0eebe830245..147d2c23a9fe40968cfe6349caaa5111c80d258f 100644
--- a/services/ui/ws/server_window_surface_manager.cc
+++ b/services/ui/ws/server_window_surface_manager.cc
@@ -4,7 +4,7 @@
#include "services/ui/ws/server_window_surface_manager.h"
-#include "services/ui/surfaces/surfaces_state.h"
+#include "services/ui/surfaces/display_compositor.h"
#include "services/ui/ws/server_window.h"
#include "services/ui/ws/server_window_delegate.h"
#include "services/ui/ws/server_window_surface.h"
@@ -14,9 +14,11 @@ namespace ws {
ServerWindowSurfaceManager::ServerWindowSurfaceManager(ServerWindow* window)
: window_(window),
+ frame_sink_id_(window->id().client_id, window->id().window_id),
waiting_for_initial_frames_(
window_->properties().count(ui::mojom::kWaitForUnderlay_Property) >
0) {
+ surface_sequence_generator_.set_frame_sink_id(frame_sink_id_);
}
ServerWindowSurfaceManager::~ServerWindowSurfaceManager() {
@@ -39,11 +41,33 @@ void ServerWindowSurfaceManager::CreateSurface(
mojom::SurfaceType surface_type,
mojo::InterfaceRequest<mojom::Surface> request,
mojom::SurfaceClientPtr client) {
+ cc::FrameSinkId id = frame_sink_id_;
+ // TODO(fsamuel): For non-default surfaces let's give them a unique ID that's
+ // different.
+ if (surface_type != mojom::SurfaceType::DEFAULT) {
+ // TODO(fsamuel): HUGE HACK!
+ id = cc::FrameSinkId(
+ 100000000,
+ window_->delegate()->GetDisplayCompositor()->next_client_id());
+ }
+
std::unique_ptr<ServerWindowSurface> surface(
- new ServerWindowSurface(this, std::move(request), std::move(client)));
+ new ServerWindowSurface(this, id, std::move(request), std::move(client)));
type_to_surface_map_[surface_type] = std::move(surface);
}
+cc::SurfaceSequence ServerWindowSurfaceManager::CreateSurfaceSequence() {
+ return surface_sequence_generator_.CreateSurfaceSequence();
+}
+
+void ServerWindowSurfaceManager::SatisfySurfaceSequence(
+ const cc::SurfaceSequence& sequence) {
+ std::vector<uint32_t> sequences;
+ sequences.push_back(sequence.sequence);
+ window_->delegate()->GetDisplayCompositor()->manager()->
+ DidSatisfySequences(sequence.frame_sink_id, &sequences);
+}
+
ServerWindowSurface* ServerWindowSurfaceManager::GetDefaultSurface() const {
return GetSurfaceByType(mojom::SurfaceType::DEFAULT);
}
@@ -68,7 +92,7 @@ bool ServerWindowSurfaceManager::HasAnySurface() const {
}
cc::SurfaceManager* ServerWindowSurfaceManager::GetSurfaceManager() {
- return window()->delegate()->GetSurfacesState()->manager();
+ return window()->delegate()->GetDisplayCompositor()->manager();
}
bool ServerWindowSurfaceManager::IsSurfaceReadyAndNonEmpty(
« no previous file with comments | « services/ui/ws/server_window_surface_manager.h ('k') | services/ui/ws/window_finder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698