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

Unified Diff: content/test/layouttest_support.cc

Issue 2962073002: OOPIF support for layout test pixel dumps.
Patch Set: Rebasing on top of 8bc8e844008b (still works locally). Created 3 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
Index: content/test/layouttest_support.cc
diff --git a/content/test/layouttest_support.cc b/content/test/layouttest_support.cc
index cf5b1b2c4e95ad68d4460dc3ff230f2d26652f9a..ed95e3d57fcf01736c284931153a4976f609e763 100644
--- a/content/test/layouttest_support.cc
+++ b/content/test/layouttest_support.cc
@@ -290,28 +290,18 @@ namespace {
// Invokes a callback on commit (on the main thread) to obtain the output
// surface that should be used, then asks that output surface to submit the copy
// request at SwapBuffers time.
+// DO NOT SUBMIT - clean this up / do this right...
class CopyRequestSwapPromise : public cc::SwapPromise {
public:
using FindLayerTreeFrameSinkCallback =
base::Callback<viz::TestLayerTreeFrameSink*()>;
- CopyRequestSwapPromise(
- std::unique_ptr<cc::CopyOutputRequest> request,
- FindLayerTreeFrameSinkCallback find_layer_tree_frame_sink_callback)
- : copy_request_(std::move(request)),
- find_layer_tree_frame_sink_callback_(
- std::move(find_layer_tree_frame_sink_callback)) {}
+ CopyRequestSwapPromise(std::unique_ptr<cc::CopyOutputRequest> request)
+ : copy_request_(std::move(request)) {}
// cc::SwapPromise implementation.
- void OnCommit() override {
- layer_tree_frame_sink_from_commit_ =
- find_layer_tree_frame_sink_callback_.Run();
- DCHECK(layer_tree_frame_sink_from_commit_);
- }
+ void OnCommit() override { copy_request_->SendEmptyResult(); }
void DidActivate() override {}
- void WillSwap(cc::CompositorFrameMetadata*) override {
- layer_tree_frame_sink_from_commit_->RequestCopyOfOutput(
- std::move(copy_request_));
- }
+ void WillSwap(cc::CompositorFrameMetadata*) override {}
void DidSwap() override {}
DidNotSwapAction DidNotSwap(DidNotSwapReason r) override {
// The compositor should always swap in layout test mode.
@@ -322,8 +312,6 @@ class CopyRequestSwapPromise : public cc::SwapPromise {
private:
std::unique_ptr<cc::CopyOutputRequest> copy_request_;
- FindLayerTreeFrameSinkCallback find_layer_tree_frame_sink_callback_;
- viz::TestLayerTreeFrameSink* layer_tree_frame_sink_from_commit_ = nullptr;
};
} // namespace
@@ -331,43 +319,6 @@ class CopyRequestSwapPromise : public cc::SwapPromise {
class LayoutTestDependenciesImpl : public LayoutTestDependencies,
public viz::TestLayerTreeFrameSinkClient {
public:
- std::unique_ptr<cc::LayerTreeFrameSink> CreateLayerTreeFrameSink(
- int32_t routing_id,
- scoped_refptr<gpu::GpuChannelHost> gpu_channel,
- scoped_refptr<cc::ContextProvider> compositor_context_provider,
- scoped_refptr<cc::ContextProvider> worker_context_provider,
- gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager,
- CompositorDependencies* deps) override {
- // This could override the GpuChannel for a LayerTreeFrameSink that was
- // previously being created but in that case the old GpuChannel would be
- // lost as would the LayerTreeFrameSink.
- gpu_channel_ = gpu_channel;
-
- auto* task_runner = deps->GetCompositorImplThreadTaskRunner().get();
- bool synchronous_composite = !task_runner;
- if (!task_runner)
- task_runner = base::ThreadTaskRunnerHandle::Get().get();
-
- cc::RendererSettings renderer_settings;
- base::CommandLine* cmd = base::CommandLine::ForCurrentProcess();
- renderer_settings.enable_color_correct_rendering =
- base::FeatureList::IsEnabled(features::kColorCorrectRendering);
- renderer_settings.allow_antialiasing &=
- !cmd->HasSwitch(cc::switches::kDisableCompositedAntialiasing);
- renderer_settings.highp_threshold_min = 2048;
-
- constexpr bool disable_display_vsync = false;
- constexpr double refresh_rate = 60.0;
- auto layer_tree_frame_sink = base::MakeUnique<viz::TestLayerTreeFrameSink>(
- std::move(compositor_context_provider),
- std::move(worker_context_provider), nullptr /* shared_bitmap_manager */,
- gpu_memory_buffer_manager, renderer_settings, task_runner,
- synchronous_composite, disable_display_vsync, refresh_rate);
- layer_tree_frame_sink->SetClient(this);
- layer_tree_frame_sinks_[routing_id] = layer_tree_frame_sink.get();
- return std::move(layer_tree_frame_sink);
- }
-
std::unique_ptr<cc::SwapPromise> RequestCopyOfOutput(
int32_t routing_id,
std::unique_ptr<cc::CopyOutputRequest> request) override {
@@ -375,13 +326,7 @@ class LayoutTestDependenciesImpl : public LayoutTestDependencies,
// may not have been created yet. Instead, we wait until OnCommit to find
// the currently active LayerTreeFrameSink for the given RenderWidget
// routing_id.
- return base::MakeUnique<CopyRequestSwapPromise>(
- std::move(request),
- base::Bind(
- &LayoutTestDependenciesImpl::FindLayerTreeFrameSink,
- // |this| will still be valid, because its lifetime is tied to
- // RenderThreadImpl, which outlives layout test execution.
- base::Unretained(this), routing_id));
+ return base::MakeUnique<CopyRequestSwapPromise>(std::move(request));
}
// TestLayerTreeFrameSinkClient implementation.
« no previous file with comments | « content/shell/test_runner/web_test_delegate.h ('k') | third_party/WebKit/LayoutTests/FlagExpectations/site-per-process » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698