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; |