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

Unified Diff: cc/test/test_delegating_output_surface.h

Issue 2161323002: cc: Make LayerTreeHostImpl unittests use a delegating output surface. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: display-lthi-tests: . 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/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 ed22b4bfe2d81c496b8ffe5a0bb1fbffe1fad09b..8f4d34a80c76592894130ee416c2e49bb78ead60 100644
--- a/cc/test/test_delegating_output_surface.h
+++ b/cc/test/test_delegating_output_surface.h
@@ -19,16 +19,22 @@
namespace cc {
class TestDelegatingOutputSurface : public OutputSurface,
- public SurfaceFactoryClient {
+ public SurfaceFactoryClient,
+ public DisplayClient {
public:
TestDelegatingOutputSurface(
scoped_refptr<ContextProvider> compositor_context_provider,
scoped_refptr<ContextProvider> worker_context_provider,
- std::unique_ptr<Display> display,
- bool context_shared_with_compositor,
- bool allow_force_reclaim_resources);
+ std::unique_ptr<OutputSurface> display_output_surface,
+ SharedBitmapManager* shared_bitmap_manager,
+ gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager,
+ const RendererSettings& renderer_settings,
+ base::SingleThreadTaskRunner* task_runner,
+ bool synchronous_composite);
~TestDelegatingOutputSurface() override;
+ Display* display() const { return display_.get(); }
+
// OutputSurface implementation.
bool BindToClient(OutputSurfaceClient* client) override;
void DetachFromClient() override;
@@ -41,14 +47,13 @@ class TestDelegatingOutputSurface : public OutputSurface,
void ReturnResources(const ReturnedResourceArray& resources) override;
void SetBeginFrameSource(BeginFrameSource* begin_frame_source) override;
+ // DisplayClient implementation.
+ void DisplayOutputSurfaceLost() override;
+ void DisplaySetMemoryPolicy(const ManagedMemoryPolicy& policy) override;
+
private:
void DrawCallback(SurfaceDrawStatus);
- class PixelTestDisplayClient : public DisplayClient {
- void DisplayOutputSurfaceLost() override {}
- void DisplaySetMemoryPolicy(const ManagedMemoryPolicy& policy) override {}
- };
-
// TODO(danakj): These don't to be stored in unique_ptrs when OutputSurface
// is owned/destroyed on the compositor thread.
std::unique_ptr<SurfaceManager> surface_manager_;
@@ -58,10 +63,11 @@ class TestDelegatingOutputSurface : public OutputSurface,
// Uses surface_manager_.
std::unique_ptr<SurfaceFactory> surface_factory_;
- PixelTestDisplayClient display_client_;
// Uses surface_manager_.
std::unique_ptr<Display> display_;
+ bool bound_ = false;
+
base::WeakPtrFactory<TestDelegatingOutputSurface> weak_ptrs_;
};
« 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