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

Unified Diff: gpu/command_buffer/service/query_manager.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: oops, did not mean to upload license.py 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/service/query_manager.cc
diff --git a/gpu/command_buffer/service/query_manager.cc b/gpu/command_buffer/service/query_manager.cc
index 8d85cffc033134d236bd14da66b26b35d7a47c16..af211782fab19fc828cf2c891ab56fd640fb2bda 100644
--- a/gpu/command_buffer/service/query_manager.cc
+++ b/gpu/command_buffer/service/query_manager.cc
@@ -195,6 +195,8 @@ class AsyncPixelTransfersCompletedQuery
base::subtle::MemoryBarrier();
sync->process_count = submit_count;
}
+ void MarkAsCompletedStage1(
+ uint32 submit_count, const AsyncMemoryParams& mem_params);
};
AsyncPixelTransfersCompletedQuery::AsyncPixelTransfersCompletedQuery(
@@ -218,6 +220,16 @@ bool AsyncPixelTransfersCompletedQuery::End(uint32 submit_count) {
mem_params.shm_data_offset = shm_offset();
mem_params.shm_data_size = sizeof(QuerySync);
+ manager()->decoder()->WaitForReadPixels(
+ base::Bind(&AsyncPixelTransfersCompletedQuery::MarkAsCompletedStage1,
+ this, submit_count, mem_params));
+ return AddToPendingTransferQueue(submit_count);
+}
+
+void AsyncPixelTransfersCompletedQuery::MarkAsCompletedStage1(
+ uint32 submit_count,
+ const AsyncMemoryParams& mem_params) {
+
// Ask AsyncPixelTransferDelegate to run completion callback after all
// previous async transfers are done. No guarantee that callback is run
// on the current thread.
@@ -225,8 +237,6 @@ bool AsyncPixelTransfersCompletedQuery::End(uint32 submit_count) {
mem_params,
base::Bind(AsyncPixelTransfersCompletedQuery::MarkAsCompletedThreadSafe,
submit_count));
-
- return AddToPendingTransferQueue(submit_count);
}
bool AsyncPixelTransfersCompletedQuery::Process() {

Powered by Google App Engine
This is Rietveld 408576698