diff options
author | sergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-12-26 21:54:14 +0000 |
---|---|---|
committer | sergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-12-26 21:54:14 +0000 |
commit | f443fd332bc2dc60db853d114d05019545854c6b (patch) | |
tree | 32a60b92561ec95aa75b71c3505a46e051800702 /cc/output | |
parent | 4dc28ef632b1b8f76726b895234ba9e68dbfae6c (diff) | |
download | chromium_src-f443fd332bc2dc60db853d114d05019545854c6b.zip chromium_src-f443fd332bc2dc60db853d114d05019545854c6b.tar.gz chromium_src-f443fd332bc2dc60db853d114d05019545854c6b.tar.bz2 |
Pass cancelable callback to gpu::ContextSupport::SignalQuery() in GLRenderer
Previously GLRenderer was creating a CancelableCallback when executing
a readback request, but still was passing the non-cancelable closure
to gpu::ContextSupport::SignalQuery(). This leads to crashes when
GLRendeder is destroyed while there are pending readback requests.
R=ccameron@chromium.org
Review URL: https://codereview.chromium.org/121333002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@242561 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/output')
-rw-r--r-- | cc/output/gl_renderer.cc | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/cc/output/gl_renderer.cc b/cc/output/gl_renderer.cc index 6fac3bb..5f443ee 100644 --- a/cc/output/gl_renderer.cc +++ b/cc/output/gl_renderer.cc @@ -2384,13 +2384,16 @@ void GLRenderer::DoGetFramebufferPixels( // Save the finished_callback so it can be cancelled. pending_async_read_pixels_.front()->finished_read_pixels_callback.Reset( finished_callback); + base::Closure cancelable_callback = + pending_async_read_pixels_.front()-> + finished_read_pixels_callback.callback(); // Save the buffer to verify the callbacks happen in the expected order. pending_async_read_pixels_.front()->buffer = buffer; if (is_async) { GLC(gl_, gl_->EndQueryEXT(GL_ASYNC_PIXEL_PACK_COMPLETED_CHROMIUM)); - context_support_->SignalQuery(query, finished_callback); + context_support_->SignalQuery(query, cancelable_callback); } else { resource_provider_->Finish(); finished_callback.Run(); |