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

Unified Diff: gpu/command_buffer/service/query_manager.cc

Issue 11412232: gpu: Add async upload functions. (Closed) Base URL: http://git.chromium.org/chromium/src.git@ASYNC_uploads
Patch Set: Rebase. Created 8 years, 1 month 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 45a3a56dba1de2c17937358e4975b9e2ce322acf..61a8d7f55c68794ff38eccdd011005c3cef5f54c 100644
--- a/gpu/command_buffer/service/query_manager.cc
+++ b/gpu/command_buffer/service/query_manager.cc
@@ -162,6 +162,52 @@ void CommandLatencyQuery::Destroy(bool /* have_context */) {
CommandLatencyQuery::~CommandLatencyQuery() {
}
+class AsyncPixelTransfersCompletedQuery : public QueryManager::Query {
+ public:
+ AsyncPixelTransfersCompletedQuery(
+ QueryManager* manager, GLenum target, int32 shm_id, uint32 shm_offset);
+
+ virtual bool Begin() OVERRIDE;
+ virtual bool End(uint32 submit_count) OVERRIDE;
+ virtual bool Process() OVERRIDE;
+ virtual void Destroy(bool have_context) OVERRIDE;
+
+ protected:
+ virtual ~AsyncPixelTransfersCompletedQuery();
+};
+
+AsyncPixelTransfersCompletedQuery::AsyncPixelTransfersCompletedQuery(
+ QueryManager* manager, GLenum target, int32 shm_id, uint32 shm_offset)
+ : Query(manager, target, shm_id, shm_offset) {
+}
+
+bool AsyncPixelTransfersCompletedQuery::Begin() {
+ return true;
+}
+
+bool AsyncPixelTransfersCompletedQuery::End(uint32 submit_count) {
+ // TODO(epenner): Mark completion via an async task.
+ // TODO(epenner): This will be a boolean to start, indicating
+ // completion of all tasks in the query. We could change this
+ // to return a count of tasks completed instead.
+ MarkAsPending(submit_count);
+ return MarkAsCompleted(1);
+}
+
+bool AsyncPixelTransfersCompletedQuery::Process() {
+ NOTREACHED();
+ return true;
+}
+
+void AsyncPixelTransfersCompletedQuery::Destroy(bool /* have_context */) {
+ if (!IsDeleted()) {
+ MarkAsDeleted();
+ }
+}
+
+AsyncPixelTransfersCompletedQuery::~AsyncPixelTransfersCompletedQuery() {
+}
+
class GetErrorQuery : public QueryManager::Query {
public:
GetErrorQuery(
@@ -248,6 +294,10 @@ QueryManager::Query* QueryManager::CreateQuery(
case GL_LATENCY_QUERY_CHROMIUM:
query = new CommandLatencyQuery(this, target, shm_id, shm_offset);
break;
+ case GL_ASYNC_PIXEL_TRANSFERS_COMPLETED_CHROMIUM:
+ query = new AsyncPixelTransfersCompletedQuery(
+ this, target, shm_id, shm_offset);
+ break;
case GL_GET_ERROR_QUERY_CHROMIUM:
query = new GetErrorQuery(this, target, shm_id, shm_offset);
break;
« no previous file with comments | « gpu/command_buffer/service/gles2_cmd_validation_implementation_autogen.h ('k') | third_party/khronos/GLES2/gl2chromium.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698