OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 CC_SURFACES_SURFACE_MANAGER_H_ | 5 #ifndef CC_SURFACES_SURFACE_MANAGER_H_ |
6 #define CC_SURFACES_SURFACE_MANAGER_H_ | 6 #define CC_SURFACES_SURFACE_MANAGER_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <list> | 10 #include <list> |
11 #include <memory> | 11 #include <memory> |
12 #include <unordered_map> | 12 #include <unordered_map> |
13 #include <unordered_set> | 13 #include <unordered_set> |
14 #include <vector> | 14 #include <vector> |
15 | 15 |
16 #include "base/macros.h" | 16 #include "base/macros.h" |
17 #include "base/observer_list.h" | 17 #include "base/observer_list.h" |
18 #include "base/threading/thread_checker.h" | 18 #include "base/threading/thread_checker.h" |
19 #include "cc/surfaces/frame_sink_id.h" | 19 #include "cc/surfaces/frame_sink_id.h" |
20 #include "cc/surfaces/surface_id.h" | 20 #include "cc/surfaces/surface_id.h" |
21 #include "cc/surfaces/surface_observer.h" | 21 #include "cc/surfaces/surface_observer.h" |
| 22 #include "cc/surfaces/surface_ref.h" |
22 #include "cc/surfaces/surface_sequence.h" | 23 #include "cc/surfaces/surface_sequence.h" |
23 #include "cc/surfaces/surfaces_export.h" | 24 #include "cc/surfaces/surfaces_export.h" |
24 | 25 |
25 namespace cc { | 26 namespace cc { |
26 class BeginFrameSource; | 27 class BeginFrameSource; |
27 class CompositorFrame; | 28 class CompositorFrame; |
28 class Surface; | 29 class Surface; |
29 class SurfaceFactoryClient; | 30 class SurfaceFactoryClient; |
30 | 31 |
31 class CC_SURFACES_EXPORT SurfaceManager { | 32 class CC_SURFACES_EXPORT SurfaceManager { |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 // that surfaces from the child namespace will be displayed in the parent. | 114 // that surfaces from the child namespace will be displayed in the parent. |
114 // Children are allowed to use any begin frame source that their parent can | 115 // Children are allowed to use any begin frame source that their parent can |
115 // use. | 116 // use. |
116 void RegisterFrameSinkHierarchy(const FrameSinkId& parent_frame_sink_id, | 117 void RegisterFrameSinkHierarchy(const FrameSinkId& parent_frame_sink_id, |
117 const FrameSinkId& child_frame_sink_id); | 118 const FrameSinkId& child_frame_sink_id); |
118 void UnregisterFrameSinkHierarchy(const FrameSinkId& parent_frame_sink_id, | 119 void UnregisterFrameSinkHierarchy(const FrameSinkId& parent_frame_sink_id, |
119 const FrameSinkId& child_frame_sink_id); | 120 const FrameSinkId& child_frame_sink_id); |
120 | 121 |
121 const SurfaceId& GetRootSurfaceId() { return kRootSurfaceId; } | 122 const SurfaceId& GetRootSurfaceId() { return kRootSurfaceId; } |
122 | 123 |
| 124 SurfaceRefPtr NewSurfaceRef(const SurfaceId& surface_id, |
| 125 float scale, |
| 126 const gfx::Size& size); |
| 127 |
123 private: | 128 private: |
124 void RecursivelyAttachBeginFrameSource(const FrameSinkId& frame_sink_id, | 129 void RecursivelyAttachBeginFrameSource(const FrameSinkId& frame_sink_id, |
125 BeginFrameSource* source); | 130 BeginFrameSource* source); |
126 void RecursivelyDetachBeginFrameSource(const FrameSinkId& frame_sink_id, | 131 void RecursivelyDetachBeginFrameSource(const FrameSinkId& frame_sink_id, |
127 BeginFrameSource* source); | 132 BeginFrameSource* source); |
128 // Returns true if |child namespace| is or has |search_frame_sink_id| as a | 133 // Returns true if |child namespace| is or has |search_frame_sink_id| as a |
129 // child. | 134 // child. |
130 bool ChildContains(const FrameSinkId& child_frame_sink_id, | 135 bool ChildContains(const FrameSinkId& child_frame_sink_id, |
131 const FrameSinkId& search_frame_sink_id) const; | 136 const FrameSinkId& search_frame_sink_id) const; |
132 | 137 |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
192 // Root SurfaceId that references display root surfaces. There is no Surface | 197 // Root SurfaceId that references display root surfaces. There is no Surface |
193 // with this id, it's for bookkeeping purposes only. | 198 // with this id, it's for bookkeeping purposes only. |
194 const SurfaceId kRootSurfaceId; | 199 const SurfaceId kRootSurfaceId; |
195 | 200 |
196 DISALLOW_COPY_AND_ASSIGN(SurfaceManager); | 201 DISALLOW_COPY_AND_ASSIGN(SurfaceManager); |
197 }; | 202 }; |
198 | 203 |
199 } // namespace cc | 204 } // namespace cc |
200 | 205 |
201 #endif // CC_SURFACES_SURFACE_MANAGER_H_ | 206 #endif // CC_SURFACES_SURFACE_MANAGER_H_ |
OLD | NEW |