Index: mojo/cc/output_surface_mojo.cc |
diff --git a/mojo/cc/output_surface_mojo.cc b/mojo/cc/output_surface_mojo.cc |
index 5dbdde11dd4eb9dc57bb0e84ad4daa259bc37acb..340bae24db28fd2c491d00d4a2f0de263c79b94b 100644 |
--- a/mojo/cc/output_surface_mojo.cc |
+++ b/mojo/cc/output_surface_mojo.cc |
@@ -15,10 +15,11 @@ namespace mojo { |
OutputSurfaceMojo::OutputSurfaceMojo( |
OutputSurfaceMojoClient* client, |
const scoped_refptr<cc::ContextProvider>& context_provider, |
- ScopedMessagePipeHandle surface_handle) |
+ ScopedMessagePipeHandle compositor_frame_receiver_handle) |
: cc::OutputSurface(context_provider), |
output_surface_mojo_client_(client), |
- surface_handle_(surface_handle.Pass()), |
+ compositor_frame_receiver_handle_( |
+ compositor_frame_receiver_handle.Pass()), |
id_namespace_(0u), |
local_id_(0u) { |
capabilities_.delegated_rendering = true; |
@@ -38,32 +39,14 @@ void OutputSurfaceMojo::SetIdNamespace(uint32_t id_namespace) { |
} |
bool OutputSurfaceMojo::BindToClient(cc::OutputSurfaceClient* client) { |
- surface_.Bind(InterfacePtrInfo<Surface>(surface_handle_.Pass(), 0u)); |
- surface_->GetIdNamespace( |
- base::Bind(&OutputSurfaceMojo::SetIdNamespace, base::Unretained(this))); |
+ receiver_.Bind(InterfacePtrInfo<CompositorFrameReceiver>( |
+ compositor_frame_receiver_handle_.Pass(), 0u)); |
return cc::OutputSurface::BindToClient(client); |
} |
void OutputSurfaceMojo::SwapBuffers(cc::CompositorFrame* frame) { |
- gfx::Size frame_size = |
- frame->delegated_frame_data->render_pass_list.back()->output_rect.size(); |
- if (frame_size != surface_size_) { |
- if (local_id_ != 0u) { |
- surface_->DestroySurface(local_id_); |
- } |
- local_id_++; |
- surface_->CreateSurface(local_id_); |
- if (id_namespace_) { |
- cc::SurfaceId qualified_id(static_cast<uint64_t>(id_namespace_) << 32 | |
- local_id_); |
- output_surface_mojo_client_->DidCreateSurface(qualified_id); |
- } |
- surface_size_ = frame_size; |
- } |
- |
- surface_->SubmitFrame(local_id_, |
- CompositorFrame::From(*frame), |
- mojo::Closure()); |
+ receiver_->SubmitCompositorFrame(CompositorFrame::From(*frame), |
+ mojo::Closure()); |
client_->DidSwapBuffers(); |
client_->DidSwapBuffersComplete(); |