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

Unified Diff: cc/test/layer_tree_pixel_test.cc

Issue 2208693003: Revert of cc: Make LayerTreeTests use a DelegatingRenderer and Display. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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/layer_tree_pixel_test.h ('k') | cc/test/layer_tree_test.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/test/layer_tree_pixel_test.cc
diff --git a/cc/test/layer_tree_pixel_test.cc b/cc/test/layer_tree_pixel_test.cc
index ae31dbad86bd32ba81e14da9971ebb4429601c2e..901bff97a3474154b7ea7d0c160e972f69a919f7 100644
--- a/cc/test/layer_tree_pixel_test.cc
+++ b/cc/test/layer_tree_pixel_test.cc
@@ -37,49 +37,27 @@
LayerTreePixelTest::~LayerTreePixelTest() {}
-std::unique_ptr<TestDelegatingOutputSurface>
- LayerTreePixelTest::CreateDelegatingOutputSurface(
- scoped_refptr<ContextProvider>,
- scoped_refptr<ContextProvider>) {
+void LayerTreePixelTest::InitializeSettings(LayerTreeSettings* settings) {
+ // The PixelTestDelegatingOutputSurface will provide a BeginFrameSource.
+ settings->use_output_surface_begin_frame_source = true;
+}
+
+std::unique_ptr<OutputSurface> LayerTreePixelTest::CreateOutputSurface() {
+ // Always test Webview shenanigans.
+ gfx::Size surface_expansion_size(40, 60);
+
scoped_refptr<TestInProcessContextProvider> compositor_context_provider;
scoped_refptr<TestInProcessContextProvider> worker_context_provider;
+ scoped_refptr<TestInProcessContextProvider> display_context_provider;
+ std::unique_ptr<PixelTestOutputSurface> display_output_surface;
if (test_type_ == PIXEL_TEST_GL) {
compositor_context_provider = new TestInProcessContextProvider(nullptr);
worker_context_provider =
new TestInProcessContextProvider(compositor_context_provider.get());
- }
- bool synchronous_composite =
- !HasImplThread() &&
- !layer_tree_host()->settings().single_thread_proxy_scheduler;
- // Allow resource reclaiming for partial raster tests to get back
- // resources from the Display.
- bool force_disable_reclaim_resources = false;
- auto delegating_output_surface =
- base::MakeUnique<TestDelegatingOutputSurface>(
- compositor_context_provider, std::move(worker_context_provider),
- CreateDisplayOutputSurface(compositor_context_provider),
- shared_bitmap_manager(), gpu_memory_buffer_manager(),
- RendererSettings(), ImplThreadTaskRunner(), synchronous_composite,
- force_disable_reclaim_resources);
- delegating_output_surface->display()->SetEnlargePassTextureAmountForTesting(
- enlarge_texture_amount_);
- return delegating_output_surface;
-}
-
-std::unique_ptr<OutputSurface> LayerTreePixelTest::CreateDisplayOutputSurface(
- scoped_refptr<ContextProvider> compositor_context_provider) {
- // Always test Webview shenanigans.
- gfx::Size surface_expansion_size(40, 60);
-
- std::unique_ptr<PixelTestOutputSurface> display_output_surface;
- if (test_type_ == PIXEL_TEST_GL) {
+ display_context_provider = new TestInProcessContextProvider(nullptr);
bool flipped_output_surface = false;
display_output_surface = base::MakeUnique<PixelTestOutputSurface>(
- // Pixel tests use a separate context for the Display to more closely
- // mimic texture transport from the renderer process to the Display
- // compositor.
- make_scoped_refptr(new TestInProcessContextProvider(nullptr)), nullptr,
- flipped_output_surface);
+ std::move(display_context_provider), nullptr, flipped_output_surface);
} else {
std::unique_ptr<PixelTestSoftwareOutputDevice> software_output_device(
new PixelTestSoftwareOutputDevice);
@@ -88,7 +66,20 @@
std::move(software_output_device));
}
display_output_surface->set_surface_expansion_size(surface_expansion_size);
- return std::move(display_output_surface);
+
+ auto* task_runner = ImplThreadTaskRunner();
+ bool synchronous_composite =
+ !HasImplThread() &&
+ !layer_tree_host()->settings().single_thread_proxy_scheduler;
+ auto delegating_output_surface =
+ base::MakeUnique<TestDelegatingOutputSurface>(
+ std::move(compositor_context_provider),
+ std::move(worker_context_provider), std::move(display_output_surface),
+ shared_bitmap_manager(), gpu_memory_buffer_manager(),
+ RendererSettings(), task_runner, synchronous_composite);
+ delegating_output_surface->display()->SetEnlargePassTextureAmountForTesting(
+ enlarge_texture_amount_);
+ return std::move(delegating_output_surface);
}
std::unique_ptr<CopyOutputRequest>
« no previous file with comments | « cc/test/layer_tree_pixel_test.h ('k') | cc/test/layer_tree_test.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698