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

Unified Diff: services/ui/surfaces/display_compositor.h

Issue 2520513002: Add DisplayCompositorTest. (Closed)
Patch Set: Add non-exported base. Created 4 years 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_reference_manager.h ('k') | services/ui/surfaces/display_compositor.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/ui/surfaces/display_compositor.h
diff --git a/services/ui/surfaces/display_compositor.h b/services/ui/surfaces/display_compositor.h
index 950250de087f2d69bfe6ba422f540a298c40a18c..16c8c788e1631661bd0a174ca0718bd39c8f8ace 100644
--- a/services/ui/surfaces/display_compositor.h
+++ b/services/ui/surfaces/display_compositor.h
@@ -7,6 +7,10 @@
#include <stdint.h>
+#include <memory>
+#include <unordered_map>
+#include <vector>
+
#include "base/macros.h"
#include "base/threading/thread_checker.h"
#include "cc/ipc/display_compositor.mojom.h"
@@ -34,6 +38,10 @@ class SurfaceManager;
namespace ui {
+namespace test {
+class DisplayCompositorTest;
+}
+
class DisplayCompositorClient;
class GpuCompositorFrameSink;
@@ -80,6 +88,9 @@ class DisplayCompositor : public cc::SurfaceObserver,
bool destroy_compositor_frame_sink);
private:
+ friend class test::DisplayCompositorTest;
+
+ const cc::SurfaceId& GetRootSurfaceId() const;
// cc::SurfaceObserver implementation.
void OnSurfaceCreated(const cc::SurfaceId& surface_id,
@@ -101,6 +112,10 @@ class DisplayCompositor : public cc::SurfaceObserver,
gpu::ImageFactory* image_factory_;
cc::mojom::DisplayCompositorClientPtr client_;
+ // Will normally point to |manager_| as it provides the interface. For tests
+ // it will be swapped out with a mock implementation.
+ cc::SurfaceReferenceManager* reference_manager_;
+
// SurfaceIds that have temporary references from top level root so they
// aren't GC'd before DisplayCompositorClient can add a real reference. This
// is basically a collection of surface ids, for example:
« no previous file with comments | « cc/surfaces/surface_reference_manager.h ('k') | services/ui/surfaces/display_compositor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698