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

Unified Diff: cc/test/test_delegating_output_surface.h

Issue 2193293004: cc: Make LayerTreeTests use a DelegatingRenderer and Display. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: display-layertreetest: withperftestsfix Created 4 years, 4 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/test/test_context_provider.cc ('k') | cc/test/test_delegating_output_surface.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/test/test_delegating_output_surface.h
diff --git a/cc/test/test_delegating_output_surface.h b/cc/test/test_delegating_output_surface.h
index 25ccb12356548aac1ad70e222fc42d892b10429c..f5ac2944d91690340fdef84def374803b3c06e12 100644
--- a/cc/test/test_delegating_output_surface.h
+++ b/cc/test/test_delegating_output_surface.h
@@ -17,13 +17,24 @@
#include "cc/surfaces/surface_manager.h"
namespace cc {
-
class CopyOutputRequest;
+class TestDelegatingOutputSurfaceClient {
+ public:
+ virtual ~TestDelegatingOutputSurfaceClient() {}
+
+ virtual void DisplayReceivedCompositorFrame(const CompositorFrame& frame) = 0;
+ virtual void DisplayWillDrawAndSwap(bool will_draw_and_swap,
+ const RenderPassList& render_passes) = 0;
+ virtual void DisplayDidDrawAndSwap() = 0;
+};
+
class TestDelegatingOutputSurface : public OutputSurface,
public SurfaceFactoryClient,
public DisplayClient {
public:
+ // Pass true for |force_disable_reclaim_resources| to act like the Display
+ // is out-of-process and can't return resources synchronously.
TestDelegatingOutputSurface(
scoped_refptr<ContextProvider> compositor_context_provider,
scoped_refptr<ContextProvider> worker_context_provider,
@@ -32,9 +43,14 @@ class TestDelegatingOutputSurface : public OutputSurface,
gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager,
const RendererSettings& renderer_settings,
base::SingleThreadTaskRunner* task_runner,
- bool synchronous_composite);
+ bool synchronous_composite,
+ bool force_disable_reclaim_resources);
~TestDelegatingOutputSurface() override;
+ void SetClient(TestDelegatingOutputSurfaceClient* client) {
+ test_client_ = client;
+ }
+
Display* display() const { return display_.get(); }
// Will be submitted with the next SwapBuffers.
@@ -55,9 +71,12 @@ class TestDelegatingOutputSurface : public OutputSurface,
// DisplayClient implementation.
void DisplayOutputSurfaceLost() override;
void DisplaySetMemoryPolicy(const ManagedMemoryPolicy& policy) override;
+ void DisplayWillDrawAndSwap(bool will_draw_and_swap,
+ const RenderPassList& render_passes) override;
+ void DisplayDidDrawAndSwap() override;
private:
- void DrawCallback(bool synchronous);
+ void DidDrawCallback(bool synchronous);
// TODO(danakj): These don't to be stored in unique_ptrs when OutputSurface
// is owned/destroyed on the compositor thread.
@@ -72,6 +91,7 @@ class TestDelegatingOutputSurface : public OutputSurface,
std::unique_ptr<Display> display_;
bool bound_ = false;
+ TestDelegatingOutputSurfaceClient* test_client_ = nullptr;
std::vector<std::unique_ptr<CopyOutputRequest>> copy_requests_;
« no previous file with comments | « cc/test/test_context_provider.cc ('k') | cc/test/test_delegating_output_surface.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698