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

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

Issue 2430653002: Mus+Ash: Towards Unifying CompositorFrameSink terminology (Closed)
Patch Set: Fix bitmap_uploader 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 01de6021a8ed06c1b95be5dd8b4bc29e37ed9162..5f0e3b5465f1ae4bc9cdff4f95740b2e7384a7b3 100644
--- a/services/ui/ws/server_window_surface.cc
+++ b/services/ui/ws/server_window_surface.cc
@@ -20,8 +20,8 @@ namespace ws {
ServerWindowSurface::ServerWindowSurface(
ServerWindowSurfaceManager* manager,
const cc::FrameSinkId& frame_sink_id,
- mojo::InterfaceRequest<Surface> request,
- mojom::SurfaceClientPtr client)
+ cc::mojom::MojoCompositorFrameSinkRequest request,
+ cc::mojom::MojoCompositorFrameSinkClientPtr client)
: frame_sink_id_(frame_sink_id),
manager_(manager),
surface_factory_(frame_sink_id_, manager_->GetSurfaceManager(), this),
@@ -43,9 +43,11 @@ ServerWindowSurface::~ServerWindowSurface() {
surface_manager->InvalidateFrameSinkId(frame_sink_id_);
}
-void ServerWindowSurface::SubmitCompositorFrame(
- cc::CompositorFrame frame,
- const SubmitCompositorFrameCallback& callback) {
+void ServerWindowSurface::SetNeedsBeginFrame(bool needs_begin_frame) {
rjkroege 2016/10/20 21:33:18 if it works without it, then why is it needed? Wha
Fady Samuel 2016/10/20 23:04:10 We don't use unified BeginFrame in Mus yet. staraz
+ // TODO(fsamuel): Implement this.
+}
+
+void ServerWindowSurface::SubmitCompositorFrame(cc::CompositorFrame frame) {
gfx::Size frame_size =
frame.delegated_frame_data->render_pass_list[0]->output_rect.size();
// If the size of the CompostiorFrame has changed then destroy the existing
@@ -57,8 +59,10 @@ void ServerWindowSurface::SubmitCompositorFrame(
surface_factory_.Create(local_frame_id_);
}
may_contain_video_ = frame.metadata.may_contain_video;
- surface_factory_.SubmitCompositorFrame(local_frame_id_, std::move(frame),
- callback);
+ surface_factory_.SubmitCompositorFrame(
+ local_frame_id_, std::move(frame),
+ base::Bind(&ServerWindowSurface::DidReceiveCompositorFrameAck,
+ base::Unretained(this)));
last_submitted_frame_size_ = frame_size;
window()->delegate()->OnScheduleWindowPaint(window());
}
@@ -77,11 +81,17 @@ ServerWindow* ServerWindowSurface::window() {
return manager_->window();
}
+void ServerWindowSurface::DidReceiveCompositorFrameAck() {
rjkroege 2016/10/20 21:33:18 You are deleting ServerWindowSurface in a subseque
Fady Samuel 2016/10/20 23:04:10 Not quite. ServerWindowSurface => ServerWindowComp
+ if (!client_ || !base::MessageLoop::current())
+ return;
+ client_->DidReceiveCompositorFrameAck();
+}
+
void ServerWindowSurface::ReturnResources(
const cc::ReturnedResourceArray& resources) {
if (!client_ || !base::MessageLoop::current())
return;
- client_->ReturnResources(mojo::Array<cc::ReturnedResource>::From(resources));
+ client_->ReclaimResources(resources);
}
void ServerWindowSurface::SetBeginFrameSource(

Powered by Google App Engine
This is Rietveld 408576698