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

Unified Diff: services/gfx/compositor/scene_impl.h

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.h
diff --git a/services/gfx/compositor/scene_impl.h b/services/gfx/compositor/scene_impl.h
new file mode 100644
index 0000000000000000000000000000000000000000..a7def23436a577b25d6062202f8b83b7d14b0fec
--- /dev/null
+++ b/services/gfx/compositor/scene_impl.h
@@ -0,0 +1,55 @@
+// 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.
+
+#ifndef SERVICES_GFX_COMPOSITOR_SCENE_IMPL_H_
+#define SERVICES_GFX_COMPOSITOR_SCENE_IMPL_H_
+
+#include "base/macros.h"
+#include "mojo/common/binding_set.h"
+#include "mojo/public/cpp/bindings/binding.h"
+#include "mojo/services/gfx/composition/interfaces/scenes.mojom.h"
+#include "mojo/services/gfx/composition/interfaces/scheduling.mojom.h"
+#include "services/gfx/compositor/compositor_engine.h"
+#include "services/gfx/compositor/scene_state.h"
+
+namespace compositor {
+
+// Scene interface implementation.
+// This object is owned by its associated SceneState.
+class SceneImpl : public mojo::gfx::composition::Scene,
+ public mojo::gfx::composition::SceneScheduler {
+ public:
+ SceneImpl(
+ CompositorEngine* engine,
+ SceneState* state,
+ mojo::InterfaceRequest<mojo::gfx::composition::Scene> scene_request);
+ ~SceneImpl() override;
+
+ void set_connection_error_handler(const base::Closure& handler) {
+ scene_binding_.set_connection_error_handler(handler);
+ }
+
+ private:
+ // |Scene|:
+ void SetListener(mojo::gfx::composition::SceneListenerPtr listener) override;
+ void Update(mojo::gfx::composition::SceneUpdatePtr update) override;
+ void Publish(mojo::gfx::composition::SceneMetadataPtr metadata) override;
+ void GetScheduler(
+ mojo::InterfaceRequest<mojo::gfx::composition::SceneScheduler>
+ scheduler_request) override;
+
+ // |SceneScheduler|:
+ void ScheduleFrame(const ScheduleFrameCallback& callback) override;
+
+ CompositorEngine* const engine_;
+ SceneState* const state_;
+ mojo::Binding<mojo::gfx::composition::Scene> scene_binding_;
+ mojo::BindingSet<mojo::gfx::composition::SceneScheduler> scheduler_bindings_;
+
+ DISALLOW_COPY_AND_ASSIGN(SceneImpl);
+};
+
+} // namespace compositor
+
+#endif // SERVICES_GFX_COMPOSITOR_SCENE_IMPL_H_

Powered by Google App Engine
This is Rietveld 408576698