| 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> |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 #include "cc/surfaces/surfaces_export.h" | 29 #include "cc/surfaces/surfaces_export.h" |
| 30 | 30 |
| 31 #if DCHECK_IS_ON() | 31 #if DCHECK_IS_ON() |
| 32 #include <iosfwd> | 32 #include <iosfwd> |
| 33 #include <string> | 33 #include <string> |
| 34 #endif | 34 #endif |
| 35 | 35 |
| 36 namespace cc { | 36 namespace cc { |
| 37 class BeginFrameSource; | 37 class BeginFrameSource; |
| 38 class CompositorFrame; | 38 class CompositorFrame; |
| 39 class FrameSinkManagerClient; |
| 39 class Surface; | 40 class Surface; |
| 40 class SurfaceFactory; | 41 class SurfaceFactory; |
| 41 class SurfaceFactoryClient; | 42 class SurfaceFactoryClient; |
| 42 | 43 |
| 43 namespace test { | 44 namespace test { |
| 44 class CompositorFrameSinkSupportTest; | 45 class CompositorFrameSinkSupportTest; |
| 45 } | 46 } |
| 46 | 47 |
| 47 class CC_SURFACES_EXPORT SurfaceManager { | 48 class CC_SURFACES_EXPORT SurfaceManager { |
| 48 public: | 49 public: |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 void InvalidateFrameSinkId(const FrameSinkId& frame_sink_id); | 105 void InvalidateFrameSinkId(const FrameSinkId& frame_sink_id); |
| 105 | 106 |
| 106 // SurfaceFactoryClient, hierarchy, and BeginFrameSource can be registered | 107 // SurfaceFactoryClient, hierarchy, and BeginFrameSource can be registered |
| 107 // and unregistered in any order with respect to each other. | 108 // and unregistered in any order with respect to each other. |
| 108 // | 109 // |
| 109 // This happens in practice, e.g. the relationship to between ui::Compositor / | 110 // This happens in practice, e.g. the relationship to between ui::Compositor / |
| 110 // DelegatedFrameHost is known before ui::Compositor has a surface/client). | 111 // DelegatedFrameHost is known before ui::Compositor has a surface/client). |
| 111 // However, DelegatedFrameHost can register itself as a client before its | 112 // However, DelegatedFrameHost can register itself as a client before its |
| 112 // relationship with the ui::Compositor is known. | 113 // relationship with the ui::Compositor is known. |
| 113 | 114 |
| 114 // Associates a SurfaceFactoryClient with the surface id frame_sink_id it | 115 // Associates a FrameSinkManagerClient with the surface id frame_sink_id it |
| 115 // uses. | 116 // uses. |
| 116 // SurfaceFactoryClient and surface namespaces/allocators have a 1:1 mapping. | 117 // FrameSinkManagerClient and surface namespaces/allocators have a 1:1 |
| 117 // Caller guarantees the client is alive between register/unregister. | 118 // mapping. Caller guarantees the client is alive between register/unregister. |
| 118 // Reregistering the same namespace when a previous client is active is not | 119 // Reregistering the same namespace when a previous client is active is not |
| 119 // valid. | 120 // valid. |
| 120 void RegisterSurfaceFactoryClient(const FrameSinkId& frame_sink_id, | 121 void RegisterFrameSinkManagerClient(const FrameSinkId& frame_sink_id, |
| 121 SurfaceFactoryClient* client); | 122 FrameSinkManagerClient* client); |
| 122 void UnregisterSurfaceFactoryClient(const FrameSinkId& frame_sink_id); | 123 void UnregisterFrameSinkManagerClient(const FrameSinkId& frame_sink_id); |
| 123 | 124 |
| 124 // Associates a |source| with a particular namespace. That namespace and | 125 // Associates a |source| with a particular namespace. That namespace and |
| 125 // any children of that namespace with valid clients can potentially use | 126 // any children of that namespace with valid clients can potentially use |
| 126 // that |source|. | 127 // that |source|. |
| 127 void RegisterBeginFrameSource(BeginFrameSource* source, | 128 void RegisterBeginFrameSource(BeginFrameSource* source, |
| 128 const FrameSinkId& frame_sink_id); | 129 const FrameSinkId& frame_sink_id); |
| 129 void UnregisterBeginFrameSource(BeginFrameSource* source); | 130 void UnregisterBeginFrameSource(BeginFrameSource* source); |
| 130 | 131 |
| 131 // Register a relationship between two namespaces. This relationship means | 132 // Register a relationship between two namespaces. This relationship means |
| 132 // that surfaces from the child namespace will be displayed in the parent. | 133 // that surfaces from the child namespace will be displayed in the parent. |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 278 std::unique_ptr<SurfaceDependencyTracker> dependency_tracker_; | 279 std::unique_ptr<SurfaceDependencyTracker> dependency_tracker_; |
| 279 | 280 |
| 280 base::WeakPtrFactory<SurfaceManager> weak_factory_; | 281 base::WeakPtrFactory<SurfaceManager> weak_factory_; |
| 281 | 282 |
| 282 DISALLOW_COPY_AND_ASSIGN(SurfaceManager); | 283 DISALLOW_COPY_AND_ASSIGN(SurfaceManager); |
| 283 }; | 284 }; |
| 284 | 285 |
| 285 } // namespace cc | 286 } // namespace cc |
| 286 | 287 |
| 287 #endif // CC_SURFACES_SURFACE_MANAGER_H_ | 288 #endif // CC_SURFACES_SURFACE_MANAGER_H_ |
| OLD | NEW |