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

Unified Diff: gpu/command_buffer/client/gles2_implementation.cc

Issue 16831004: Perform glReadPixels with PBOs in the gpu, if PBOs are available. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: use webglid where approperiate Created 7 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: gpu/command_buffer/client/gles2_implementation.cc
diff --git a/gpu/command_buffer/client/gles2_implementation.cc b/gpu/command_buffer/client/gles2_implementation.cc
index b78404093cafe612f50464d26a1e1993aab85158..f91bc0b6a6a196e6c531a568e7c9e64e33bdda1f 100644
--- a/gpu/command_buffer/client/gles2_implementation.cc
+++ b/gpu/command_buffer/client/gles2_implementation.cc
@@ -2229,8 +2229,7 @@ void GLES2Implementation::ReadPixels(
if (buffer && buffer->shm_id() != -1) {
helper_->ReadPixels(xoffset, yoffset, width, height, format, type,
buffer->shm_id(), buffer->shm_offset(),
- 0, 0);
- buffer->set_transfer_ready_token(helper_->InsertToken());
+ 0, 0, true);
CheckGLError();
}
return;
@@ -2262,7 +2261,8 @@ void GLES2Implementation::ReadPixels(
helper_->ReadPixels(
xoffset, yoffset, width, num_rows, format, type,
buffer.shm_id(), buffer.offset(),
- GetResultShmId(), GetResultShmOffset());
+ GetResultShmId(), GetResultShmOffset(),
+ false);
WaitForCmd();
if (*result != 0) {
// when doing a y-flip we have to iterate through top-to-bottom chunks
@@ -3174,26 +3174,27 @@ void GLES2Implementation::DeleteQueriesEXTHelper(
// TODO(gman): Consider making this faster by putting pending quereies
// on some queue to be removed when they are finished.
+ // TODO(hubbe): Consider using signalQuery callback to delete pending
+ // queries.
bool query_pending = false;
for (GLsizei ii = 0; ii < n; ++ii) {
QueryTracker::Query* query = query_tracker_->GetQuery(queries[ii]);
- if (query && query->Pending()) {
+ if (query && !query->CheckResultsAvailable(helper_)) {
query_pending = true;
break;
}
}
if (query_pending) {
+ helper_->Finish();
WaitForCmd();
}
for (GLsizei ii = 0; ii < n; ++ii) {
QueryTracker::Query* query = query_tracker_->GetQuery(queries[ii]);
- if (query && query->Pending()) {
- if (!query->CheckResultsAvailable(helper_)) {
- // Should only get here on context lost.
- MustBeContextLost();
- }
+ if (query && !query->CheckResultsAvailable(helper_)) {
+ // Should only get here on context lost.
+ MustBeContextLost();
}
query_tracker_->RemoveQuery(queries[ii], helper_->IsContextLost());
}

Powered by Google App Engine
This is Rietveld 408576698