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

Unified Diff: content/test/layouttest_support.cc

Issue 2075343003: Use a cc::Display for layout tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@mailbox-test
Patch Set: Created 4 years, 6 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 | « content/renderer/render_thread_impl.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/test/layouttest_support.cc
diff --git a/content/test/layouttest_support.cc b/content/test/layouttest_support.cc
index 8ced6323768bd09f45dc04cb4ba5f5c83c6b828c..5de7d764d646861fcacde5830748d76dfeec48be 100644
--- a/content/test/layouttest_support.cc
+++ b/content/test/layouttest_support.cc
@@ -12,6 +12,7 @@
#include "base/memory/ptr_util.h"
#include "base/strings/string_util.h"
#include "build/build_config.h"
+#include "cc/test/pixel_test_delegating_output_surface.h"
#include "components/scheduler/test/renderer_scheduler_test_support.h"
#include "components/test_runner/test_common.h"
#include "components/test_runner/web_frame_test_proxy.h"
@@ -19,6 +20,7 @@
#include "content/browser/bluetooth/bluetooth_adapter_factory_wrapper.h"
#include "content/browser/renderer_host/render_process_host_impl.h"
#include "content/browser/renderer_host/render_widget_host_impl.h"
+#include "content/common/gpu/client/context_provider_command_buffer.h"
#include "content/common/site_isolation_policy.h"
#include "content/public/common/page_state.h"
#include "content/public/renderer/renderer_gamepad_provider.h"
@@ -177,12 +179,43 @@ void SetMockDeviceOrientationData(const WebDeviceOrientationData& data) {
class LayoutTestDependenciesImpl : public LayoutTestDependencies {
public:
std::unique_ptr<cc::OutputSurface> CreateOutputSurface(
- uint32_t output_surface_id,
- scoped_refptr<cc::ContextProvider> context_provider,
- scoped_refptr<cc::ContextProvider> worker_context_provider) override {
+ scoped_refptr<gpu::GpuChannelHost> gpu_channel,
+ scoped_refptr<cc::ContextProvider> compositor_context_provider,
+ scoped_refptr<cc::ContextProvider> worker_context_provider,
+ CompositorDependencies* deps) override {
+ // This is for an offscreen context for the compositor. So the default
+ // framebuffer doesn't need alpha, depth, stencil, antialiasing.
+ gpu::gles2::ContextCreationAttribHelper attributes;
+ attributes.alpha_size = -1;
+ attributes.depth_size = 0;
+ attributes.stencil_size = 0;
+ attributes.samples = 0;
+ attributes.sample_buffers = 0;
+ attributes.bind_generates_resource = false;
+ attributes.lose_context_when_out_of_memory = true;
+ const bool automatic_flushes = false;
+ const bool support_locking = false;
+
+ scoped_refptr<cc::ContextProvider> display_context_provider(
+ new ContextProviderCommandBuffer(
+ std::move(gpu_channel), gpu::GPU_STREAM_DEFAULT,
+ gpu::GpuStreamPriority::NORMAL, gpu::kNullSurfaceHandle,
+ GURL(
+ "chrome://gpu/LayoutTestDependenciesImpl::CreateOutputSurface"),
+ gl::PreferIntegratedGpu, automatic_flushes, support_locking,
+ gpu::SharedMemoryLimits(), attributes, nullptr,
+ command_buffer_metrics::OFFSCREEN_CONTEXT_FOR_TESTING));
+
+ return base::MakeUnique<cc::PixelTestDelegatingOutputSurface>(
+ std::move(compositor_context_provider),
+ std::move(worker_context_provider), std::move(display_context_provider),
+ deps->GetSharedBitmapManager(), deps->GetGpuMemoryBufferManager(),
+ false, !deps->GetCompositorImplThreadTaskRunner());
+ /*
return base::MakeUnique<MailboxOutputSurface>(
output_surface_id, std::move(context_provider),
std::move(worker_context_provider));
+ */
piman 2016/06/20 16:45:07 nit: remove
danakj 2016/06/20 23:21:00 Done.
}
};
« no previous file with comments | « content/renderer/render_thread_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698