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

Side by Side Diff: services/gfx/compositor/compositor_engine.h

Issue 1749063002: Mozart: Improve internal scene graph representation. (Closed) Base URL: git@github.com:domokit/mojo.git@moz-0
Patch Set: avoid unnecessary hashtable lookups 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/BUILD.gn ('k') | services/gfx/compositor/compositor_engine.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_GFX_COMPOSITOR_COMPOSITOR_H_ 5 #ifndef SERVICES_GFX_COMPOSITOR_COMPOSITOR_H_
6 #define SERVICES_GFX_COMPOSITOR_COMPOSITOR_H_ 6 #define SERVICES_GFX_COMPOSITOR_COMPOSITOR_H_
7 7
8 #include <unordered_map> 8 #include <unordered_map>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 void OnOutputError(const base::WeakPtr<RendererState>& renderer_state_weak); 98 void OnOutputError(const base::WeakPtr<RendererState>& renderer_state_weak);
99 void OnOutputUpdateRequest( 99 void OnOutputUpdateRequest(
100 const base::WeakPtr<RendererState>& renderer_state_weak, 100 const base::WeakPtr<RendererState>& renderer_state_weak,
101 const mojo::gfx::composition::FrameInfo& frame_info); 101 const mojo::gfx::composition::FrameInfo& frame_info);
102 void OnOutputSnapshotRequest( 102 void OnOutputSnapshotRequest(
103 const base::WeakPtr<RendererState>& renderer_state_weak, 103 const base::WeakPtr<RendererState>& renderer_state_weak,
104 const mojo::gfx::composition::FrameInfo& frame_info); 104 const mojo::gfx::composition::FrameInfo& frame_info);
105 void OnPresentScene(const base::WeakPtr<SceneState>& scene_state_weak, 105 void OnPresentScene(const base::WeakPtr<SceneState>& scene_state_weak,
106 int64_t presentation_time); 106 int64_t presentation_time);
107 107
108 SceneDef* ResolveSceneReference( 108 base::WeakPtr<SceneDef> ResolveSceneReference(
109 mojo::gfx::composition::SceneToken* scene_token); 109 const mojo::gfx::composition::SceneToken& scene_token);
110 void SendResourceUnavailable(SceneState* scene_state, uint32_t resource_id); 110 void SendResourceUnavailable(SceneState* scene_state, uint32_t resource_id);
111 111
112 SceneState* FindScene(uint32_t scene_token); 112 SceneState* FindScene(uint32_t scene_token);
113 113
114 bool IsSceneStateRegisteredDebug(SceneState* scene_state) { 114 bool IsSceneStateRegisteredDebug(SceneState* scene_state) {
115 return scene_state && FindScene(scene_state->scene_token()->value); 115 return scene_state && FindScene(scene_state->scene_token()->value);
116 } 116 }
117 bool IsRendererStateRegisteredDebug(RendererState* renderer_state) { 117 bool IsRendererStateRegisteredDebug(RendererState* renderer_state) {
118 return renderer_state && 118 return renderer_state &&
119 std::any_of(renderers_.begin(), renderers_.end(), 119 std::any_of(renderers_.begin(), renderers_.end(),
120 [renderer_state](RendererState* other) { 120 [renderer_state](RendererState* other) {
121 return renderer_state == other; 121 return renderer_state == other;
122 }); 122 });
123 } 123 }
124 124
125 uint32_t next_scene_token_value_ = 1u; 125 uint32_t next_scene_token_value_ = 1u;
126 uint32_t next_renderer_id_ = 1u; 126 uint32_t next_renderer_id_ = 1u;
127 std::unordered_map<uint32_t, SceneState*> scenes_by_token_; 127 std::unordered_map<uint32_t, SceneState*> scenes_by_token_;
128 std::vector<RendererState*> renderers_; 128 std::vector<RendererState*> renderers_;
129 129
130 base::WeakPtrFactory<CompositorEngine> weak_factory_; 130 base::WeakPtrFactory<CompositorEngine> weak_factory_;
131 131
132 DISALLOW_COPY_AND_ASSIGN(CompositorEngine); 132 DISALLOW_COPY_AND_ASSIGN(CompositorEngine);
133 }; 133 };
134 134
135 } // namespace compositor 135 } // namespace compositor
136 136
137 #endif // SERVICES_GFX_COMPOSITOR_COMPOSITOR_H_ 137 #endif // SERVICES_GFX_COMPOSITOR_COMPOSITOR_H_
OLDNEW
« no previous file with comments | « services/gfx/compositor/BUILD.gn ('k') | services/gfx/compositor/compositor_engine.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698