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

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

Issue 2388753003: Introduce cc::LocalFrameId and use in SurfaceFactory (Closed)
Patch Set: Fix exo_unittests 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/server_window_surface.cc
diff --git a/services/ui/ws/server_window_surface.cc b/services/ui/ws/server_window_surface.cc
index 9228115e629289bc083cc8718f4d90c24c1051d3..eeb88372c3f89b5fd970f9a97daf16bed76453c8 100644
--- a/services/ui/ws/server_window_surface.cc
+++ b/services/ui/ws/server_window_surface.cc
@@ -24,7 +24,6 @@ ServerWindowSurface::ServerWindowSurface(
mojom::SurfaceClientPtr client)
: frame_sink_id_(frame_sink_id),
manager_(manager),
- surface_id_allocator_(frame_sink_id_),
surface_factory_(frame_sink_id_, manager_->GetSurfaceManager(), this),
client_(std::move(client)),
binding_(this, std::move(request)) {
@@ -50,7 +49,7 @@ void ServerWindowSurface::SubmitCompositorFrame(
frame.delegated_frame_data->render_pass_list[0]->output_rect.size();
// If the size of the CompostiorFrame has changed then destroy the existing
// Surface and create a new one of the appropriate size.
- if (surface_id_.is_null() || frame_size != last_submitted_frame_size_) {
+ if (local_frame_id_.is_null() || frame_size != last_submitted_frame_size_) {
// Rendering of the topmost frame happens in two phases. First the frame
// is generated and submitted, and a later date it is actually drawn.
// During the time the frame is generated and drawn we can't destroy the
@@ -58,22 +57,26 @@ void ServerWindowSurface::SubmitCompositorFrame(
// this we schedule destruction via the delegate. The delegate will call
// us back when we're not waiting on a frame to be drawn (which may be
// synchronously).
- if (!surface_id_.is_null()) {
- surfaces_scheduled_for_destruction_.insert(surface_id_);
+ if (!local_frame_id_.is_null()) {
+ surfaces_scheduled_for_destruction_.insert(local_frame_id_);
window()->delegate()->ScheduleSurfaceDestruction(window());
}
- surface_id_ = surface_id_allocator_.GenerateId();
- surface_factory_.Create(surface_id_);
+ local_frame_id_ = surface_id_allocator_.GenerateId();
+ surface_factory_.Create(local_frame_id_);
}
may_contain_video_ = frame.metadata.may_contain_video;
- surface_factory_.SubmitCompositorFrame(surface_id_, std::move(frame),
+ surface_factory_.SubmitCompositorFrame(local_frame_id_, std::move(frame),
callback);
last_submitted_frame_size_ = frame_size;
window()->delegate()->OnScheduleWindowPaint(window());
}
+cc::SurfaceId ServerWindowSurface::GetSurfaceId() const {
+ return cc::SurfaceId(frame_sink_id_, local_frame_id_);
+}
+
void ServerWindowSurface::DestroySurfacesScheduledForDestruction() {
- std::set<cc::SurfaceId> surfaces;
+ std::set<cc::LocalFrameId> surfaces;
surfaces.swap(surfaces_scheduled_for_destruction_);
for (auto& id : surfaces)
surface_factory_.Destroy(id);

Powered by Google App Engine
This is Rietveld 408576698