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

Side by Side Diff: components/mus/public/cpp/lib/view_surface.cc

Issue 1344573002: Mandoline: Rename components/view_manager to components/mus (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased 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
1 // Copyright 2015 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "components/view_manager/public/cpp/view_surface.h" 5 #include "components/mus/public/cpp/view_surface.h"
6 6
7 #include "components/view_manager/public/cpp/view_surface_client.h" 7 #include "components/mus/public/cpp/view_surface_client.h"
8 #include "mojo/converters/surfaces/surfaces_type_converters.h" 8 #include "mojo/converters/surfaces/surfaces_type_converters.h"
9 9
10 namespace mojo { 10 namespace mojo {
11 11
12 ViewSurface::~ViewSurface() { 12 ViewSurface::~ViewSurface() {}
13 }
14 13
15 void ViewSurface::BindToThread() { 14 void ViewSurface::BindToThread() {
16 DCHECK(!bound_to_thread_); 15 DCHECK(!bound_to_thread_);
17 bound_to_thread_ = true; 16 bound_to_thread_ = true;
18 surface_.Bind(surface_info_.Pass()); 17 surface_.Bind(surface_info_.Pass());
19 client_binding_.Bind(client_request_.Pass()); 18 client_binding_.Bind(client_request_.Pass());
20 } 19 }
21 20
22 void ViewSurface::SubmitCompositorFrame(mojo::CompositorFramePtr frame) { 21 void ViewSurface::SubmitCompositorFrame(mojo::CompositorFramePtr frame) {
23 DCHECK(bound_to_thread_); 22 DCHECK(bound_to_thread_);
24 if (!surface_) 23 if (!surface_)
25 return; 24 return;
26 surface_->SubmitCompositorFrame(frame.Pass(), mojo::Closure()); 25 surface_->SubmitCompositorFrame(frame.Pass(), mojo::Closure());
27 } 26 }
28 27
29 ViewSurface::ViewSurface( 28 ViewSurface::ViewSurface(
30 mojo::InterfacePtrInfo<mojo::Surface> surface_info, 29 mojo::InterfacePtrInfo<mojo::Surface> surface_info,
31 mojo::InterfaceRequest<mojo::SurfaceClient> client_request) 30 mojo::InterfaceRequest<mojo::SurfaceClient> client_request)
32 : client_(nullptr), 31 : client_(nullptr),
33 surface_info_(surface_info.Pass()), 32 surface_info_(surface_info.Pass()),
34 client_request_(client_request.Pass()), 33 client_request_(client_request.Pass()),
35 client_binding_(this), 34 client_binding_(this),
36 bound_to_thread_(false) { 35 bound_to_thread_(false) {}
37 }
38 36
39 void ViewSurface::ReturnResources( 37 void ViewSurface::ReturnResources(
40 mojo::Array<mojo::ReturnedResourcePtr> resources) { 38 mojo::Array<mojo::ReturnedResourcePtr> resources) {
41 if (!client_) 39 if (!client_)
42 return; 40 return;
43 client_->OnResourcesReturned(this, resources.Pass()); 41 client_->OnResourcesReturned(this, resources.Pass());
44 } 42 }
45 43
46 } // namespace mojo 44 } // namespace mojo
OLDNEW
« no previous file with comments | « components/mus/public/cpp/lib/view_private.cc ('k') | components/mus/public/cpp/lib/view_tree_client_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698