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

Side by Side Diff: services/ui/launcher/launcher_view_tree.h

Issue 1775143004: Mozart: Directly associate the renderer with the view tree. (Closed) Base URL: git@github.com:domokit/mojo.git@moz-1
Patch Set: Created 4 years, 9 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
« no previous file with comments | « services/gfx/compositor/renderer_state.cc ('k') | services/ui/launcher/launcher_view_tree.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef SERVICES_UI_LAUNCHER_VIEW_TREE_IMPL_H_ 5 #ifndef SERVICES_UI_LAUNCHER_VIEW_TREE_IMPL_H_
6 #define SERVICES_UI_LAUNCHER_VIEW_TREE_IMPL_H_ 6 #define SERVICES_UI_LAUNCHER_VIEW_TREE_IMPL_H_
7 7
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "mojo/public/cpp/bindings/binding.h" 10 #include "mojo/public/cpp/bindings/binding.h"
11 #include "mojo/services/gfx/composition/interfaces/compositor.mojom.h" 11 #include "mojo/services/gfx/composition/interfaces/compositor.mojom.h"
12 #include "mojo/services/native_viewport/interfaces/native_viewport.mojom.h" 12 #include "mojo/services/native_viewport/interfaces/native_viewport.mojom.h"
13 #include "mojo/services/ui/input/interfaces/input_dispatcher.mojom.h" 13 #include "mojo/services/ui/input/interfaces/input_dispatcher.mojom.h"
14 #include "mojo/services/ui/views/interfaces/view_manager.mojom.h" 14 #include "mojo/services/ui/views/interfaces/view_manager.mojom.h"
15 15
16 namespace launcher { 16 namespace launcher {
17 17
18 class LauncherViewTree : public mojo::ui::ViewTreeListener, 18 class LauncherViewTree : public mojo::ui::ViewTreeListener {
19 public mojo::gfx::composition::SceneListener {
20 public: 19 public:
21 LauncherViewTree(mojo::gfx::composition::Compositor* compositor, 20 LauncherViewTree(mojo::gfx::composition::Compositor* compositor,
22 mojo::ui::ViewManager* view_manager, 21 mojo::ui::ViewManager* view_manager,
23 mojo::ContextProviderPtr context_provider, 22 mojo::ContextProviderPtr context_provider,
24 mojo::ViewportMetricsPtr viewport_metrics, 23 mojo::ViewportMetricsPtr viewport_metrics,
25 const base::Closure& shutdown_callback); 24 const base::Closure& shutdown_callback);
26 25
27 ~LauncherViewTree() override; 26 ~LauncherViewTree() override;
28 27
29 void SetRoot(mojo::ui::ViewOwnerPtr owner); 28 void SetRoot(mojo::ui::ViewOwnerPtr owner);
30 void SetViewportMetrics(mojo::ViewportMetricsPtr viewport_metrics); 29 void SetViewportMetrics(mojo::ViewportMetricsPtr viewport_metrics);
31 void DispatchEvent(mojo::EventPtr event); 30 void DispatchEvent(mojo::EventPtr event);
32 31
33 private: 32 private:
34 // |SceneListener|:
35 void OnResourceUnavailable(
36 uint32_t resource_id,
37 const OnResourceUnavailableCallback& callback) override;
38
39 // |ViewTree|: 33 // |ViewTree|:
40 void OnLayout(const OnLayoutCallback& callback) override; 34 void OnLayout(const OnLayoutCallback& callback) override;
41 void OnRootUnavailable(uint32_t root_key, 35 void OnRootUnavailable(uint32_t root_key,
42 const OnRootUnavailableCallback& callback) override; 36 const OnRootUnavailableCallback& callback) override;
37 void OnRendererDied(const OnRendererDiedCallback& callback) override;
43 38
44 void OnRendererConnectionError();
45 void OnSceneConnectionError();
46 void OnViewTreeConnectionError(); 39 void OnViewTreeConnectionError();
47 void OnInputDispatcherConnectionError(); 40 void OnInputDispatcherConnectionError();
48 41
49 void OnSceneRegistered(mojo::gfx::composition::SceneTokenPtr scene_token);
50
51 void LayoutRoot(); 42 void LayoutRoot();
52 void OnLayoutResult(mojo::ui::ViewLayoutInfoPtr info); 43 void OnLayoutResult(mojo::ui::ViewLayoutInfoPtr info);
53 44
54 void SetRootScene();
55
56 void PublishFrame();
57
58 void Shutdown(); 45 void Shutdown();
59 46
60 mojo::gfx::composition::Compositor* compositor_; 47 mojo::gfx::composition::Compositor* compositor_;
61 mojo::ui::ViewManager* view_manager_; 48 mojo::ui::ViewManager* view_manager_;
62 49
63 mojo::ContextProviderPtr context_provider_; 50 mojo::ContextProviderPtr context_provider_;
64 mojo::ViewportMetricsPtr viewport_metrics_; 51 mojo::ViewportMetricsPtr viewport_metrics_;
65 base::Closure shutdown_callback_; 52 base::Closure shutdown_callback_;
66 53
67 mojo::Binding<mojo::gfx::composition::SceneListener> scene_listener_binding_;
68 mojo::Binding<mojo::ui::ViewTreeListener> view_tree_listener_binding_; 54 mojo::Binding<mojo::ui::ViewTreeListener> view_tree_listener_binding_;
69 55
70 mojo::gfx::composition::ScenePtr scene_; 56 ;
71 mojo::gfx::composition::SceneTokenPtr scene_token_;
72 uint32_t scene_version_ = 1u;
73
74 mojo::gfx::composition::RendererPtr renderer_;
75 mojo::ui::ViewTreePtr view_tree_; 57 mojo::ui::ViewTreePtr view_tree_;
76 mojo::ui::InputDispatcherPtr input_dispatcher_; 58 mojo::ui::InputDispatcherPtr input_dispatcher_;
77 59
78 uint32_t root_key_ = 0u; 60 uint32_t root_key_ = 0u;
79 bool root_was_set_ = false; 61 bool root_was_set_ = false;
80 mojo::ui::ViewLayoutInfoPtr root_layout_info_; 62 mojo::ui::ViewLayoutInfoPtr root_layout_info_;
81 63
82 DISALLOW_COPY_AND_ASSIGN(LauncherViewTree); 64 DISALLOW_COPY_AND_ASSIGN(LauncherViewTree);
83 }; 65 };
84 66
85 } // namespace launcher 67 } // namespace launcher
86 68
87 #endif // SERVICES_UI_LAUNCHER_VIEW_TREE_IMPL_H_ 69 #endif // SERVICES_UI_LAUNCHER_VIEW_TREE_IMPL_H_
OLDNEW
« no previous file with comments | « services/gfx/compositor/renderer_state.cc ('k') | services/ui/launcher/launcher_view_tree.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698