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

Unified Diff: services/gfx/compositor/renderer_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/renderer_impl.h
diff --git a/services/gfx/compositor/renderer_impl.h b/services/gfx/compositor/renderer_impl.h
new file mode 100644
index 0000000000000000000000000000000000000000..d9fc09e4069eb42c5a6ef782241e728943810737
--- /dev/null
+++ b/services/gfx/compositor/renderer_impl.h
@@ -0,0 +1,54 @@
+// 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_RENDERER_IMPL_H_
+#define SERVICES_GFX_COMPOSITOR_RENDERER_IMPL_H_
+
+#include "base/callback.h"
+#include "base/macros.h"
+#include "mojo/common/binding_set.h"
+#include "mojo/public/cpp/bindings/binding.h"
+#include "mojo/services/gfx/composition/interfaces/renderers.mojom.h"
+#include "services/gfx/compositor/compositor_engine.h"
+#include "services/gfx/compositor/renderer_state.h"
+
+namespace compositor {
+
+// Renderer interface implementation.
+// This object is owned by its associated RendererState.
+class RendererImpl : public mojo::gfx::composition::Renderer,
+ public mojo::gfx::composition::HitTester {
+ public:
+ RendererImpl(CompositorEngine* engine,
+ RendererState* state,
+ mojo::InterfaceRequest<mojo::gfx::composition::Renderer>
+ renderer_request);
+ ~RendererImpl() override;
+
+ void set_connection_error_handler(const base::Closure& handler) {
+ renderer_binding_.set_connection_error_handler(handler);
+ }
+
+ private:
+ // |Renderer|:
+ void SetRootScene(mojo::gfx::composition::SceneTokenPtr scene_token,
+ uint32 scene_version,
+ mojo::RectPtr viewport) override;
+ void GetHitTester(mojo::InterfaceRequest<mojo::gfx::composition::HitTester>
+ hit_tester_request) override;
+
+ // |HitTester|:
+ void HitTest(mojo::PointPtr point, const HitTestCallback& callback) override;
+
+ CompositorEngine* const engine_;
+ RendererState* const state_;
abarth 2016/01/10 22:55:36 Consider const Foo& if these are non-nullable.
jeffbrown 2016/01/16 03:28:32 I need a non-const reference here. So the best I
+ mojo::Binding<mojo::gfx::composition::Renderer> renderer_binding_;
+ mojo::BindingSet<mojo::gfx::composition::HitTester> hit_tester_bindings;
+
+ DISALLOW_COPY_AND_ASSIGN(RendererImpl);
+};
+
+} // namespace compositor
+
+#endif // SERVICES_GFX_COMPOSITOR_RENDERER_IMPL_H_

Powered by Google App Engine
This is Rietveld 408576698