Commit b93c4031 authored by Vladimir Levin's avatar Vladimir Levin Committed by Commit Bot

[LayoutTests] Make display compositor pixel dumps also support threaded compositing.

If enable-threaded-compositing is specified (via a threaded virtual test,
or on the command line), along with the display compositor dumps, then
we don't need to synchronously composite frames. Instead we should rely
on surface synchronization to wait for frames to be submitted via
a scheduler.

R=piman@chromium.org, fsamuel@chromium.org

Bug: 667551
Change-Id: I05859b1ebe18cc59379514d604268940714250b0
Reviewed-on: https://chromium-review.googlesource.com/1026563Reviewed-by: default avatarFady Samuel <fsamuel@chromium.org>
Reviewed-by: default avatarAntoine Labour <piman@chromium.org>
Commit-Queue: vmpstr <vmpstr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#553885}
parent 947cebb4
...@@ -597,11 +597,19 @@ void BlinkTestController::OnInitiateCaptureDump(bool capture_navigation_history, ...@@ -597,11 +597,19 @@ void BlinkTestController::OnInitiateCaptureDump(bool capture_navigation_history,
switches::kEnableDisplayCompositorPixelDump)); switches::kEnableDisplayCompositorPixelDump));
waiting_for_pixel_results_ = true; waiting_for_pixel_results_ = true;
// Trigger compositing on all frames. auto* rwhv = main_window_->web_contents()->GetRenderWidgetHostView();
CompositeAllFrames(); // If we're running in threaded mode, then the frames will be produced via a
// scheduler elsewhere, all we need to do is to ensure that the surface is
// synchronized before we copy from it. In single threaded mode, we have to
// force each renderer to produce a frame.
if (base::CommandLine::ForCurrentProcess()->HasSwitch(
switches::kEnableThreadedCompositing)) {
rwhv->EnsureSurfaceSynchronizedForLayoutTest();
} else {
CompositeAllFrames();
}
// Enqueue a copy output request. // Enqueue a copy output request.
auto* rwhv = main_window_->web_contents()->GetRenderWidgetHostView();
rwhv->CopyFromSurface( rwhv->CopyFromSurface(
gfx::Rect(), gfx::Size(), gfx::Rect(), gfx::Size(),
base::BindOnce(&BlinkTestController::OnPixelDumpCaptured, base::BindOnce(&BlinkTestController::OnPixelDumpCaptured,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment