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

Side by Side Diff: services/gfx/compositor/scene_impl.cc

Issue 1682113003: Mojo C++ bindings: Generate InterfaceHandle<> instead of InterfacePtr<>. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: rebase ontop of master, address trung's comments Created 4 years, 10 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
« no previous file with comments | « services/gfx/compositor/scene_impl.h ('k') | services/gles2/command_buffer_driver.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "services/gfx/compositor/scene_impl.h" 5 #include "services/gfx/compositor/scene_impl.h"
6 6
7 #include <utility>
8
7 #include "base/bind.h" 9 #include "base/bind.h"
8 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
9 11
10 namespace compositor { 12 namespace compositor {
11 namespace { 13 namespace {
12 void RunScheduleFrameCallback(const SceneImpl::ScheduleFrameCallback& callback, 14 void RunScheduleFrameCallback(const SceneImpl::ScheduleFrameCallback& callback,
13 mojo::gfx::composition::FrameInfoPtr info) { 15 mojo::gfx::composition::FrameInfoPtr info) {
14 callback.Run(info.Pass()); 16 callback.Run(info.Pass());
15 } 17 }
16 } // namespace 18 } // namespace
17 19
18 SceneImpl::SceneImpl( 20 SceneImpl::SceneImpl(
19 CompositorEngine* engine, 21 CompositorEngine* engine,
20 SceneState* state, 22 SceneState* state,
21 mojo::InterfaceRequest<mojo::gfx::composition::Scene> scene_request) 23 mojo::InterfaceRequest<mojo::gfx::composition::Scene> scene_request)
22 : engine_(engine), 24 : engine_(engine),
23 state_(state), 25 state_(state),
24 scene_binding_(this, scene_request.Pass()) {} 26 scene_binding_(this, scene_request.Pass()) {}
25 27
26 SceneImpl::~SceneImpl() {} 28 SceneImpl::~SceneImpl() {}
27 29
28 void SceneImpl::SetListener(mojo::gfx::composition::SceneListenerPtr listener) { 30 void SceneImpl::SetListener(
29 engine_->SetListener(state_, listener.Pass()); 31 mojo::InterfaceHandle<mojo::gfx::composition::SceneListener> listener) {
32 engine_->SetListener(state_, mojo::gfx::composition::SceneListenerPtr::Create(
33 std::move(listener)));
30 } 34 }
31 35
32 void SceneImpl::Update(mojo::gfx::composition::SceneUpdatePtr update) { 36 void SceneImpl::Update(mojo::gfx::composition::SceneUpdatePtr update) {
33 engine_->Update(state_, update.Pass()); 37 engine_->Update(state_, update.Pass());
34 } 38 }
35 39
36 void SceneImpl::Publish(mojo::gfx::composition::SceneMetadataPtr metadata) { 40 void SceneImpl::Publish(mojo::gfx::composition::SceneMetadataPtr metadata) {
37 engine_->Publish(state_, metadata.Pass()); 41 engine_->Publish(state_, metadata.Pass());
38 } 42 }
39 43
40 void SceneImpl::GetScheduler( 44 void SceneImpl::GetScheduler(
41 mojo::InterfaceRequest<mojo::gfx::composition::SceneScheduler> 45 mojo::InterfaceRequest<mojo::gfx::composition::SceneScheduler>
42 scheduler_request) { 46 scheduler_request) {
43 scheduler_bindings_.AddBinding(this, scheduler_request.Pass()); 47 scheduler_bindings_.AddBinding(this, scheduler_request.Pass());
44 } 48 }
45 49
46 void SceneImpl::ScheduleFrame(const ScheduleFrameCallback& callback) { 50 void SceneImpl::ScheduleFrame(const ScheduleFrameCallback& callback) {
47 engine_->ScheduleFrame(state_, 51 engine_->ScheduleFrame(state_,
48 base::Bind(&RunScheduleFrameCallback, callback)); 52 base::Bind(&RunScheduleFrameCallback, callback));
49 } 53 }
50 54
51 } // namespace compositor 55 } // namespace compositor
OLDNEW
« no previous file with comments | « services/gfx/compositor/scene_impl.h ('k') | services/gles2/command_buffer_driver.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698