| Index: cc/surfaces/surface_manager.h
|
| diff --git a/cc/surfaces/surface_manager.h b/cc/surfaces/surface_manager.h
|
| index 6261fb363c3953701547d6bde52267c439c9800c..e649ec1a7c446d7c07e91e154060a63222e269bc 100644
|
| --- a/cc/surfaces/surface_manager.h
|
| +++ b/cc/surfaces/surface_manager.h
|
| @@ -13,6 +13,7 @@
|
| #include <unordered_set>
|
| #include <vector>
|
|
|
| +#include "base/gtest_prod_util.h"
|
| #include "base/macros.h"
|
| #include "base/observer_list.h"
|
| #include "base/threading/thread_checker.h"
|
| @@ -27,6 +28,10 @@ class CompositorFrame;
|
| class Surface;
|
| class SurfaceFactoryClient;
|
|
|
| +namespace test {
|
| +class SurfaceDisplayOutputSurfaceTest;
|
| +}
|
| +
|
| class CC_SURFACES_EXPORT SurfaceManager {
|
| public:
|
| SurfaceManager();
|
| @@ -54,11 +59,28 @@ class CC_SURFACES_EXPORT SurfaceManager {
|
| // id namespace.
|
| void DidSatisfySequences(uint32_t client_id, std::vector<uint32_t>* sequence);
|
|
|
| - void RegisterSurfaceClientId(uint32_t client_id);
|
| + // Associates a |source| with a particular namespace. That namespace and
|
| + // any children of that namespace with valid clients can potentially use
|
| + // that |source|.
|
| + void RegisterBeginFrameSource(BeginFrameSource* source, uint32_t client_id);
|
| + void UnregisterBeginFrameSource(BeginFrameSource* source);
|
|
|
| - // Invalidate a namespace that might still have associated sequences,
|
| - // possibly because a renderer process has crashed.
|
| - void InvalidateSurfaceClientId(uint32_t client_id);
|
| + private:
|
| + FRIEND_TEST_ALL_PREFIXES(SurfaceManagerTest, SingleClients);
|
| + FRIEND_TEST_ALL_PREFIXES(SurfaceManagerTest, MultipleDisplays);
|
| + friend class SurfaceManagerOrderingTest;
|
| + friend class SurfaceFactory;
|
| + friend class test::SurfaceDisplayOutputSurfaceTest;
|
| + friend class FakeSurfaceFactoryClient;
|
| +
|
| + // Register a relationship between two clients. This relationship means
|
| + // that surfaces from the child client will be displayed in the parent.
|
| + // Children are allowed to use any begin frame source that their parent can
|
| + // use.
|
| + void RegisterSurfaceNamespaceHierarchy(uint32_t parent_namespace,
|
| + uint32_t child_namespace);
|
| + void UnregisterSurfaceNamespaceHierarchy(uint32_t parent_namespace,
|
| + uint32_t child_namespace);
|
|
|
| // SurfaceFactoryClient, hierarchy, and BeginFrameSource can be registered
|
| // and unregistered in any order with respect to each other.
|
| @@ -73,26 +95,9 @@ class CC_SURFACES_EXPORT SurfaceManager {
|
| // Caller guarantees the client is alive between register/unregister.
|
| // Reregistering the same namespace when a previous client is active is not
|
| // valid.
|
| - void RegisterSurfaceFactoryClient(uint32_t client_id,
|
| - SurfaceFactoryClient* client);
|
| - void UnregisterSurfaceFactoryClient(uint32_t client_id);
|
| + void RegisterClient(uint32_t client_id, SurfaceFactoryClient* client);
|
| + void UnregisterClient(uint32_t client_id);
|
|
|
| - // Associates a |source| with a particular namespace. That namespace and
|
| - // any children of that namespace with valid clients can potentially use
|
| - // that |source|.
|
| - void RegisterBeginFrameSource(BeginFrameSource* source, uint32_t client_id);
|
| - void UnregisterBeginFrameSource(BeginFrameSource* source);
|
| -
|
| - // Register a relationship between two namespaces. This relationship means
|
| - // that surfaces from the child namespace will be displayed in the parent.
|
| - // Children are allowed to use any begin frame source that their parent can
|
| - // use.
|
| - void RegisterSurfaceNamespaceHierarchy(uint32_t parent_namespace,
|
| - uint32_t child_namespace);
|
| - void UnregisterSurfaceNamespaceHierarchy(uint32_t parent_namespace,
|
| - uint32_t child_namespace);
|
| -
|
| - private:
|
| void RecursivelyAttachBeginFrameSource(uint32_t client_id,
|
| BeginFrameSource* source);
|
| void RecursivelyDetachBeginFrameSource(uint32_t client_id,
|
|
|