Commit 5b1e0dfc authored by kylechar's avatar kylechar Committed by Commit Bot

Add checks to find source of null requests

Somehow ReadPixelsContext::request is null once it reaches
OnRGBAReadbackDone() done. Add some checks to figure out how that can
happen.

Bug: 1048251
Change-Id: If74854b5b332b1af347647c4c1c234e995afa944
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2037846Reviewed-by: default avatarJonathan Backer <backer@chromium.org>
Commit-Queue: kylechar <kylechar@chromium.org>
Cr-Commit-Position: refs/heads/master@{#738563}
parent 5ed32961
......@@ -596,6 +596,8 @@ void SkiaOutputSurfaceImpl::CopyOutput(
const gfx::ColorSpace& color_space,
std::unique_ptr<CopyOutputRequest> request) {
DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
// TODO(crbug.com/1048251): Remove after finding source of null requests.
CHECK(request);
if (!request->has_result_task_runner())
request->set_result_task_runner(base::ThreadTaskRunnerHandle::Get());
......
......@@ -119,7 +119,10 @@ struct ReadPixelsContext {
: request(std::move(request)),
result_rect(result_rect),
color_space(color_space),
impl_on_gpu(impl_on_gpu) {}
impl_on_gpu(impl_on_gpu) {
// TODO(crbug.com/1048251): Remove after finding source of null requests.
CHECK(this->request);
}
std::unique_ptr<CopyOutputRequest> request;
gfx::Rect result_rect;
......@@ -255,6 +258,9 @@ void OnRGBAReadbackDone(
return;
}
// TODO(crbug.com/1048251): Remove after finding source of null requests.
CHECK(context->request);
DCHECK_EQ(1, async_result->count());
auto info = SkImageInfo::MakeN32Premul(context->result_rect.width(),
......@@ -1140,6 +1146,9 @@ void SkiaOutputSurfaceImplOnGpu::CopyOutput(
// TODO(crbug.com/898595): Do this on the GPU instead of CPU with Vulkan.
DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
// TODO(crbug.com/1048251): Remove after finding source of null requests.
CHECK(request);
// Clear |destroy_after_swap_| if we CopyOutput without SwapBuffers.
base::ScopedClosureRunner cleanup(
base::BindOnce([](std::vector<std::unique_ptr<SkDeferredDisplayList>>) {},
......
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