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

Unified 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, 12 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
Index: services/gfx/compositor/scene_impl.cc
diff --git a/services/gfx/compositor/scene_impl.cc b/services/gfx/compositor/scene_impl.cc
new file mode 100644
index 0000000000000000000000000000000000000000..91813e1cda9bfde8d99ee8c162d23e2912943157
--- /dev/null
+++ b/services/gfx/compositor/scene_impl.cc
@@ -0,0 +1,51 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "services/gfx/compositor/scene_impl.h"
+
+#include "base/bind.h"
+#include "base/bind_helpers.h"
+
+namespace compositor {
+
+SceneImpl::SceneImpl(
+ CompositorEngine* engine,
+ SceneState* state,
+ mojo::InterfaceRequest<mojo::gfx::composition::Scene> scene_request)
+ : engine_(engine),
+ state_(state),
+ scene_binding_(this, scene_request.Pass()) {}
+
+SceneImpl::~SceneImpl() {}
+
+void SceneImpl::SetListener(mojo::gfx::composition::SceneListenerPtr listener) {
+ engine_->SetListener(state_, listener.Pass());
+}
+
+void SceneImpl::Update(mojo::gfx::composition::SceneUpdatePtr update) {
+ engine_->Update(state_, update.Pass());
+}
+
+void SceneImpl::Publish(mojo::gfx::composition::SceneMetadataPtr metadata) {
+ engine_->Publish(state_, metadata.Pass());
+}
+
+void SceneImpl::GetScheduler(
+ mojo::InterfaceRequest<mojo::gfx::composition::SceneScheduler>
+ scheduler_request) {
+ scheduler_bindings_.AddBinding(this, scheduler_request.Pass());
+}
+
+static void RunScheduleFrameCallback(
+ const SceneImpl::ScheduleFrameCallback& callback,
+ mojo::gfx::composition::FrameInfoPtr info) {
+ callback.Run(info.Pass());
+}
+
+void SceneImpl::ScheduleFrame(const ScheduleFrameCallback& callback) {
+ engine_->ScheduleFrame(state_,
+ base::Bind(&RunScheduleFrameCallback, callback));
+}
+
+} // namespace compositor

Powered by Google App Engine
This is Rietveld 408576698