OLD | NEW |
---|---|
(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 #ifndef SERVICES_GFX_COMPOSITOR_RENDERER_IMPL_H_ | |
6 #define SERVICES_GFX_COMPOSITOR_RENDERER_IMPL_H_ | |
7 | |
8 #include "base/callback.h" | |
9 #include "base/macros.h" | |
10 #include "mojo/common/binding_set.h" | |
11 #include "mojo/public/cpp/bindings/binding.h" | |
12 #include "mojo/services/gfx/composition/interfaces/renderers.mojom.h" | |
13 #include "services/gfx/compositor/compositor_engine.h" | |
14 #include "services/gfx/compositor/renderer_state.h" | |
15 | |
16 namespace compositor { | |
17 | |
18 // Renderer interface implementation. | |
19 // This object is owned by its associated RendererState. | |
20 class RendererImpl : public mojo::gfx::composition::Renderer, | |
21 public mojo::gfx::composition::HitTester { | |
22 public: | |
23 RendererImpl(CompositorEngine* engine, | |
24 RendererState* state, | |
25 mojo::InterfaceRequest<mojo::gfx::composition::Renderer> | |
26 renderer_request); | |
27 ~RendererImpl() override; | |
28 | |
29 void set_connection_error_handler(const base::Closure& handler) { | |
30 renderer_binding_.set_connection_error_handler(handler); | |
31 } | |
32 | |
33 private: | |
34 // |Renderer|: | |
35 void SetRootScene(mojo::gfx::composition::SceneTokenPtr scene_token, | |
36 uint32 scene_version, | |
37 mojo::RectPtr viewport) override; | |
38 void GetHitTester(mojo::InterfaceRequest<mojo::gfx::composition::HitTester> | |
39 hit_tester_request) override; | |
40 | |
41 // |HitTester|: | |
42 void HitTest(mojo::PointPtr point, const HitTestCallback& callback) override; | |
43 | |
44 CompositorEngine* const engine_; | |
45 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
| |
46 mojo::Binding<mojo::gfx::composition::Renderer> renderer_binding_; | |
47 mojo::BindingSet<mojo::gfx::composition::HitTester> hit_tester_bindings; | |
48 | |
49 DISALLOW_COPY_AND_ASSIGN(RendererImpl); | |
50 }; | |
51 | |
52 } // namespace compositor | |
53 | |
54 #endif // SERVICES_GFX_COMPOSITOR_RENDERER_IMPL_H_ | |
OLD | NEW |