| Index: cc/output/gl_renderer.cc
|
| diff --git a/cc/output/gl_renderer.cc b/cc/output/gl_renderer.cc
|
| index d7a7ceaf7bd6aa39879859f55fc804aebe50683e..07585d97976757dd6e43c4aee7b23d8a3106617f 100644
|
| --- a/cc/output/gl_renderer.cc
|
| +++ b/cc/output/gl_renderer.cc
|
| @@ -2307,6 +2307,14 @@ void GLRenderer::DoGetFramebufferPixels(
|
| NULL,
|
| GL_STREAM_READ));
|
|
|
| + WebKit::WebGLId query = 0;
|
| + if (is_async) {
|
| + query = context_->createQueryEXT();
|
| + GLC(context_, context_->beginQueryEXT(
|
| + GL_ASYNC_PIXEL_TRANSFERS_COMPLETED_CHROMIUM,
|
| + query));
|
| + }
|
| +
|
| GLC(context_,
|
| context_->readPixels(window_rect.x(),
|
| window_rect.y(),
|
| @@ -2332,6 +2340,7 @@ void GLRenderer::DoGetFramebufferPixels(
|
| base::Unretained(this),
|
| cleanup_callback,
|
| buffer,
|
| + query,
|
| dest_pixels,
|
| window_rect.size());
|
| // Save the finished_callback so it can be cancelled.
|
| @@ -2342,10 +2351,11 @@ void GLRenderer::DoGetFramebufferPixels(
|
| pending_async_read_pixels_.front()->buffer = buffer;
|
|
|
| if (is_async) {
|
| - unsigned sync_point = context_->insertSyncPoint();
|
| - SyncPointHelper::SignalSyncPoint(
|
| + GLC(context_, context_->endQueryEXT(
|
| + GL_ASYNC_PIXEL_TRANSFERS_COMPLETED_CHROMIUM));
|
| + SyncPointHelper::SignalQuery(
|
| context_,
|
| - sync_point,
|
| + query,
|
| finished_callback);
|
| } else {
|
| resource_provider_->Finish();
|
| @@ -2358,10 +2368,15 @@ void GLRenderer::DoGetFramebufferPixels(
|
| void GLRenderer::FinishedReadback(
|
| const AsyncGetFramebufferPixelsCleanupCallback& cleanup_callback,
|
| unsigned source_buffer,
|
| + unsigned query,
|
| uint8* dest_pixels,
|
| gfx::Size size) {
|
| DCHECK(!pending_async_read_pixels_.empty());
|
|
|
| + if (query != 0) {
|
| + GLC(context_, context_->deleteQueryEXT(query));
|
| + }
|
| +
|
| PendingAsyncReadPixels* current_read = pending_async_read_pixels_.back();
|
| // Make sure we service the readbacks in order.
|
| DCHECK_EQ(source_buffer, current_read->buffer);
|
|
|