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

Side by Side Diff: components/view_manager/public/cpp/lib/surface.cc

Issue 1281663002: Mandoline: Allow submitting CompositorFrames directly to mojo::Views (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased + added uip::Surface Created 5 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "components/view_manager/public/cpp/surface.h"
6
7 #include "components/view_manager/public/cpp/surface_client.h"
8 #include "mojo/converters/surfaces/surfaces_type_converters.h"
9
10 namespace uip {
11
12 Surface::~Surface() {
13 }
14
15 void Surface::BindToThread() {
16 DCHECK(!bound_to_thread_);
17 bound_to_thread_ = true;
18 surface_.Bind(surface_info_.Pass());
19 client_binding_.Bind(client_request_.Pass());
20 }
21
22 void Surface::SubmitCompositorFrame(mojo::CompositorFramePtr frame) {
23 DCHECK(bound_to_thread_);
24 surface_->SubmitCompositorFrame(frame.Pass(), mojo::Closure());
25 }
26
27 Surface::Surface(mojo::InterfacePtrInfo<mojo::Surface> surface_info,
28 mojo::InterfaceRequest<mojo::SurfaceClient> client_request)
29 : client_(nullptr),
30 surface_info_(surface_info.Pass()),
31 client_request_(client_request.Pass()),
32 client_binding_(this),
33 bound_to_thread_(false) {
34 }
35
36 void Surface::ReturnResources(
37 mojo::Array<mojo::ReturnedResourcePtr> resources) {
38 if (!client_)
39 return;
40 client_->OnResourcesReturned(this, resources.Pass());
41 }
42
43 } // namespace uip
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698