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

Unified Diff: mojo/cc/output_surface_mojo.cc

Issue 1281663002: Mandoline: Allow submitting CompositorFrames directly to mojo::Views (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Yet anther rebase (YAR!!!) Created 5 years, 4 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
« mandoline/ui/aura/surface_binding.cc ('K') | « mojo/cc/output_surface_mojo.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
« mandoline/ui/aura/surface_binding.cc ('K') | « mojo/cc/output_surface_mojo.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698