Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(287)

Side by Side Diff: content/common/gpu/client/gl_helper.cc

Issue 14273026: cc: Make async readback path use async glRreadPixels. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« cc/output/gl_renderer.cc ('K') | « cc/trees/thread_proxy.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/common/gpu/client/gl_helper.h" 5 #include "content/common/gpu/client/gl_helper.h"
6 6
7 #include <queue> 7 #include <queue>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/debug/trace_event.h" 10 #include "base/debug/trace_event.h"
(...skipping 537 matching lines...) Expand 10 before | Expand all | Expand 10 after
548 0); 548 0);
549 request->buffer = context_->createBuffer(); 549 request->buffer = context_->createBuffer();
550 context_->bindBuffer(GL_PIXEL_PACK_TRANSFER_BUFFER_CHROMIUM, 550 context_->bindBuffer(GL_PIXEL_PACK_TRANSFER_BUFFER_CHROMIUM,
551 request->buffer); 551 request->buffer);
552 context_->bufferData(GL_PIXEL_PACK_TRANSFER_BUFFER_CHROMIUM, 552 context_->bufferData(GL_PIXEL_PACK_TRANSFER_BUFFER_CHROMIUM,
553 4 * size.GetArea(), 553 4 * size.GetArea(),
554 NULL, 554 NULL,
555 GL_STREAM_READ); 555 GL_STREAM_READ);
556 556
557 context_->readPixels(0, 0, size.width(), size.height(), 557 context_->readPixels(0, 0, size.width(), size.height(),
558 GL_RGBA, GL_UNSIGNED_BYTE, 0); 558 GL_RGBA, GL_UNSIGNED_BYTE, NULL);
559 context_->bindBuffer(GL_PIXEL_PACK_TRANSFER_BUFFER_CHROMIUM, 0); 559 context_->bindBuffer(GL_PIXEL_PACK_TRANSFER_BUFFER_CHROMIUM, 0);
560 context_->GetCommandBufferProxy()->SignalSyncPoint( 560 context_->GetCommandBufferProxy()->SignalSyncPoint(
561 context_->insertSyncPoint(), 561 context_->insertSyncPoint(),
562 base::Bind(&CopyTextureToImpl::ReadbackDone, AsWeakPtr(), request)); 562 base::Bind(&CopyTextureToImpl::ReadbackDone, AsWeakPtr(), request));
563 } 563 }
564 564
565 void GLHelper::CopyTextureToImpl::ReadbackTextureSync(WebGLId texture, 565 void GLHelper::CopyTextureToImpl::ReadbackTextureSync(WebGLId texture,
566 const gfx::Rect& src_rect, 566 const gfx::Rect& src_rect,
567 unsigned char* out) { 567 unsigned char* out) {
568 ScopedFramebuffer dst_framebuffer(context_, context_->createFramebuffer()); 568 ScopedFramebuffer dst_framebuffer(context_, context_->createFramebuffer());
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
739 context_->copyTexSubImage2D(GL_TEXTURE_2D, 0, 739 context_->copyTexSubImage2D(GL_TEXTURE_2D, 0,
740 rect.x(), rect.y(), 740 rect.x(), rect.y(),
741 rect.x(), rect.y(), 741 rect.x(), rect.y(),
742 rect.width(), rect.height()); 742 rect.width(), rect.height());
743 } 743 }
744 context_->flush(); 744 context_->flush();
745 } 745 }
746 } 746 }
747 747
748 } // namespace content 748 } // namespace content
OLDNEW
« cc/output/gl_renderer.cc ('K') | « cc/trees/thread_proxy.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698