OLD | NEW |
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_GRAPH_SNAPSHOT_H_ | 5 #ifndef SERVICES_GFX_COMPOSITOR_GRAPH_SNAPSHOT_H_ |
6 #define SERVICES_GFX_COMPOSITOR_GRAPH_SNAPSHOT_H_ | 6 #define SERVICES_GFX_COMPOSITOR_GRAPH_SNAPSHOT_H_ |
7 | 7 |
8 #include <iosfwd> | 8 #include <iosfwd> |
9 #include <memory> | 9 #include <memory> |
10 #include <unordered_map> | 10 #include <unordered_map> |
11 #include <unordered_set> | 11 #include <unordered_set> |
12 | 12 |
13 #include "base/macros.h" | 13 #include "base/macros.h" |
14 #include "base/memory/ref_counted.h" | 14 #include "base/memory/ref_counted.h" |
15 #include "mojo/services/geometry/interfaces/geometry.mojom.h" | 15 #include "mojo/services/geometry/interfaces/geometry.mojom.h" |
| 16 #include "mojo/services/gfx/composition/interfaces/hit_tests.mojom.h" |
16 #include "mojo/services/gfx/composition/interfaces/scheduling.mojom.h" | 17 #include "mojo/services/gfx/composition/interfaces/scheduling.mojom.h" |
17 | 18 |
18 namespace compositor { | 19 namespace compositor { |
19 | 20 |
20 class NodeDef; | 21 class NodeDef; |
21 class SceneDef; | 22 class SceneDef; |
22 class SceneContent; | 23 class SceneContent; |
23 class SceneNodeDef; | 24 class SceneNodeDef; |
24 class RenderFrame; | 25 class RenderFrame; |
25 | 26 |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 // Returns true if the snapshot has a dependency on content from the | 63 // Returns true if the snapshot has a dependency on content from the |
63 // specified scene. | 64 // specified scene. |
64 bool HasDependency(const SceneDef* scene) const; | 65 bool HasDependency(const SceneDef* scene) const; |
65 | 66 |
66 // Creates a frame for rendering. | 67 // Creates a frame for rendering. |
67 // Only valid if |!is_blocked()|. | 68 // Only valid if |!is_blocked()|. |
68 std::shared_ptr<RenderFrame> CreateFrame( | 69 std::shared_ptr<RenderFrame> CreateFrame( |
69 const mojo::Rect& viewport, | 70 const mojo::Rect& viewport, |
70 const mojo::gfx::composition::FrameInfo& frame_info) const; | 71 const mojo::gfx::composition::FrameInfo& frame_info) const; |
71 | 72 |
| 73 // Performs a hit test at the specified point, populating the result. |
| 74 // Only valid if |!is_blocked()|. |
| 75 void HitTest(const mojo::Point& point, |
| 76 mojo::gfx::composition::HitTestResult* result) const; |
| 77 |
72 // Returns true if the specified node was blocked from rendering. | 78 // Returns true if the specified node was blocked from rendering. |
73 // Only valid if |!is_blocked()|. | 79 // Only valid if |!is_blocked()|. |
74 bool IsNodeBlocked(const NodeDef* node) const; | 80 bool IsNodeBlocked(const NodeDef* node) const; |
75 | 81 |
76 // Gets the scene content which was resolved by following a scene node link. | 82 // Gets the scene content which was resolved by following a scene node link. |
77 // Only valid if |!is_blocked()|. | 83 // Only valid if |!is_blocked()|. |
78 const SceneContent* GetResolvedSceneContent( | 84 const SceneContent* GetResolvedSceneContent( |
79 const SceneNodeDef* scene_node) const; | 85 const SceneNodeDef* scene_node) const; |
80 | 86 |
81 private: | 87 private: |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 std::ostream* const block_log_; | 153 std::ostream* const block_log_; |
148 scoped_refptr<Snapshot> snapshot_; | 154 scoped_refptr<Snapshot> snapshot_; |
149 const SceneContent* cycle_ = nullptr; // point where a cycle was detected | 155 const SceneContent* cycle_ = nullptr; // point where a cycle was detected |
150 | 156 |
151 DISALLOW_COPY_AND_ASSIGN(SnapshotBuilder); | 157 DISALLOW_COPY_AND_ASSIGN(SnapshotBuilder); |
152 }; | 158 }; |
153 | 159 |
154 } // namespace compositor | 160 } // namespace compositor |
155 | 161 |
156 #endif // SERVICES_GFX_COMPOSITOR_GRAPH_SNAPSHOT_H_ | 162 #endif // SERVICES_GFX_COMPOSITOR_GRAPH_SNAPSHOT_H_ |
OLD | NEW |