Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(371)

Unified Diff: cc/surfaces/surface_manager.h

Issue 2144733005: [WIP] cc: Plumb SurfaceId from clients Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Ensure only SurfaceFactoy and tests can update hierarchy Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/surfaces/surface_id_allocator.cc ('k') | cc/surfaces/surface_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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,
« no previous file with comments | « cc/surfaces/surface_id_allocator.cc ('k') | cc/surfaces/surface_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698