Commit ab4e5e2e authored by Jonathan Backer's avatar Jonathan Backer Committed by Commit Bot

Fix webkit layout tests with SkDDL

SendResults can't be called on GpuMain thread or we crash. This CL
calls it from display compositor thread after we've ensured that
the appropriate GL context is current.

Change-Id: Ifa5c2cffafb5cfa55e5b21b1b93b6f1bc8d6e1e1
Reviewed-on: https://chromium-review.googlesource.com/c/1351577
Commit-Queue: Jonathan Backer <backer@chromium.org>
Reviewed-by: default avatarweiliangc <weiliangc@chromium.org>
Cr-Commit-Position: refs/heads/master@{#611395}
parent be47a726
...@@ -556,6 +556,8 @@ void SkiaOutputSurfaceImpl::CopyOutput( ...@@ -556,6 +556,8 @@ void SkiaOutputSurfaceImpl::CopyOutput(
const gfx::Rect& copy_rect, const gfx::Rect& copy_rect,
std::unique_ptr<CopyOutputRequest> request) { std::unique_ptr<CopyOutputRequest> request) {
DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
if (!request->has_result_task_runner())
request->set_result_task_runner(base::ThreadTaskRunnerHandle::Get());
auto sequence_id = gpu_service_->skia_output_surface_sequence_id(); auto sequence_id = gpu_service_->skia_output_surface_sequence_id();
auto callback = base::BindOnce(&SkiaOutputSurfaceImplOnGpu::CopyOutput, auto callback = base::BindOnce(&SkiaOutputSurfaceImplOnGpu::CopyOutput,
base::Unretained(impl_on_gpu_.get()), id, base::Unretained(impl_on_gpu_.get()), id,
......
...@@ -292,6 +292,11 @@ void SkiaOutputSurfaceImplOnGpu::CopyOutput( ...@@ -292,6 +292,11 @@ void SkiaOutputSurfaceImplOnGpu::CopyOutput(
const gfx::Rect& copy_rect, const gfx::Rect& copy_rect,
std::unique_ptr<CopyOutputRequest> request) { std::unique_ptr<CopyOutputRequest> request) {
DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
if (!MakeCurrent()) {
request->SendResult(
std::make_unique<CopyOutputSkBitmapResult>(gfx::Rect(), SkBitmap()));
return;
}
// TODO(crbug.com/644851): Complete the implementation for all request types, // TODO(crbug.com/644851): Complete the implementation for all request types,
// scaling, etc. // scaling, etc.
......
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