OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_SCENE_CONTENT_H_ | 5 #ifndef SERVICES_GFX_COMPOSITOR_GRAPH_SCENE_CONTENT_H_ |
6 #define SERVICES_GFX_COMPOSITOR_GRAPH_SCENE_CONTENT_H_ | 6 #define SERVICES_GFX_COMPOSITOR_GRAPH_SCENE_CONTENT_H_ |
7 | 7 |
8 #include <iosfwd> | 8 #include <iosfwd> |
9 #include <unordered_map> | 9 #include <unordered_map> |
10 | 10 |
11 #include "base/macros.h" | 11 #include "base/macros.h" |
12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
13 #include "base/memory/weak_ptr.h" | 13 #include "base/memory/weak_ptr.h" |
14 #include "mojo/services/gfx/composition/interfaces/hit_tests.mojom.h" | 14 #include "mojo/services/gfx/composition/interfaces/hit_tests.mojom.h" |
15 #include "mojo/services/gfx/composition/interfaces/scenes.mojom.h" | 15 #include "mojo/services/gfx/composition/interfaces/scenes.mojom.h" |
16 #include "services/gfx/compositor/graph/node_def.h" | 16 #include "services/gfx/compositor/graph/node_def.h" |
17 #include "services/gfx/compositor/graph/resource_def.h" | 17 #include "services/gfx/compositor/graph/resource_def.h" |
18 #include "services/gfx/compositor/graph/scene_label.h" | 18 #include "services/gfx/compositor/graph/scene_label.h" |
19 | 19 |
20 class SkCanvas; | 20 class SkCanvas; |
21 struct SkPoint; | 21 struct SkPoint; |
22 class SkMatrix; | 22 class SkMatrix44; |
23 | 23 |
24 namespace compositor { | 24 namespace compositor { |
25 | 25 |
26 class SceneContentBuilder; | 26 class SceneContentBuilder; |
27 class SceneDef; | 27 class SceneDef; |
28 | 28 |
29 // Represents the content of a particular published version of a scene. | 29 // Represents the content of a particular published version of a scene. |
30 // | 30 // |
31 // Holds a resource and node table which describes the content of a | 31 // Holds a resource and node table which describes the content of a |
32 // scene as it was when a particular version was published. Only the | 32 // scene as it was when a particular version was published. Only the |
(...skipping 25 matching lines...) Expand all Loading... |
58 void RecordPicture(const Snapshot* snapshot, SkCanvas* canvas) const; | 58 void RecordPicture(const Snapshot* snapshot, SkCanvas* canvas) const; |
59 | 59 |
60 // Performs a hit test at the specified point. | 60 // Performs a hit test at the specified point. |
61 // The |scene_point| is the hit tested point in the scene's coordinate space. | 61 // The |scene_point| is the hit tested point in the scene's coordinate space. |
62 // The |global_to_scene_transform| is the accumulated transform from the | 62 // The |global_to_scene_transform| is the accumulated transform from the |
63 // global coordinate space to the scene's coordinate space. | 63 // global coordinate space to the scene's coordinate space. |
64 // Provides hit information for the scene in |out_scene_hit| if any. | 64 // Provides hit information for the scene in |out_scene_hit| if any. |
65 // Returns true if the search was terminated by an opaque hit. | 65 // Returns true if the search was terminated by an opaque hit. |
66 bool HitTest(const Snapshot* snapshot, | 66 bool HitTest(const Snapshot* snapshot, |
67 const SkPoint& scene_point, | 67 const SkPoint& scene_point, |
68 const SkMatrix& global_to_scene_transform, | 68 const SkMatrix44& global_to_scene_transform, |
69 mojo::gfx::composition::SceneHitPtr* out_scene_hit) const; | 69 mojo::gfx::composition::SceneHitPtr* out_scene_hit) const; |
70 | 70 |
71 // Gets the requested resource, never null because it must be present. | 71 // Gets the requested resource, never null because it must be present. |
72 const ResourceDef* GetResource(uint32_t resource_id, | 72 const ResourceDef* GetResource(uint32_t resource_id, |
73 ResourceDef::Type resource_type) const; | 73 ResourceDef::Type resource_type) const; |
74 | 74 |
75 // Gets the requested node, never null because it must be present. | 75 // Gets the requested node, never null because it must be present. |
76 const NodeDef* GetNode(uint32_t node_id) const; | 76 const NodeDef* GetNode(uint32_t node_id) const; |
77 | 77 |
78 // Gets the root node if it exists, otherwise returns nullptr. | 78 // Gets the root node if it exists, otherwise returns nullptr. |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 bool AddNode(const NodeDef* node); | 127 bool AddNode(const NodeDef* node); |
128 | 128 |
129 scoped_refptr<SceneContent> content_; | 129 scoped_refptr<SceneContent> content_; |
130 const SceneDef* scene_; | 130 const SceneDef* scene_; |
131 std::ostream& err_; | 131 std::ostream& err_; |
132 }; | 132 }; |
133 | 133 |
134 } // namespace compositor | 134 } // namespace compositor |
135 | 135 |
136 #endif // SERVICES_GFX_COMPOSITOR_GRAPH_SCENE_CONTENT_H_ | 136 #endif // SERVICES_GFX_COMPOSITOR_GRAPH_SCENE_CONTENT_H_ |
OLD | NEW |