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

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

Issue 1552963002: Initial checkin of the new Mozart compositor. (Closed) Base URL: git@github.com:domokit/mojo.git@moz-11
Patch Set: Created 4 years, 11 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 "services/gfx/compositor/scene_impl.h"
6
7 #include "base/bind.h"
8 #include "base/bind_helpers.h"
9
10 namespace compositor {
11
12 SceneImpl::SceneImpl(
13 CompositorEngine* engine,
14 SceneState* state,
15 mojo::InterfaceRequest<mojo::gfx::composition::Scene> scene_request)
16 : engine_(engine),
17 state_(state),
18 scene_binding_(this, scene_request.Pass()) {}
19
20 SceneImpl::~SceneImpl() {}
21
22 void SceneImpl::SetListener(mojo::gfx::composition::SceneListenerPtr listener) {
23 engine_->SetListener(state_, listener.Pass());
24 }
25
26 void SceneImpl::Update(mojo::gfx::composition::SceneUpdatePtr update) {
27 engine_->Update(state_, update.Pass());
28 }
29
30 void SceneImpl::Publish(mojo::gfx::composition::SceneMetadataPtr metadata) {
31 engine_->Publish(state_, metadata.Pass());
32 }
33
34 void SceneImpl::GetScheduler(
35 mojo::InterfaceRequest<mojo::gfx::composition::SceneScheduler>
36 scheduler_request) {
37 scheduler_bindings_.AddBinding(this, scheduler_request.Pass());
38 }
39
40 static void RunScheduleFrameCallback(
41 const SceneImpl::ScheduleFrameCallback& callback,
42 mojo::gfx::composition::FrameInfoPtr info) {
43 callback.Run(info.Pass());
44 }
45
46 void SceneImpl::ScheduleFrame(const ScheduleFrameCallback& callback) {
47 engine_->ScheduleFrame(state_,
48 base::Bind(&RunScheduleFrameCallback, callback));
49 }
50
51 } // namespace compositor
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698