Chromium Code Reviews| 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..c8fcc0f0e6d751a4ae1a5546fa7566af99895044 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 AsyncTasksCompletedQuery : public QueryManager::Query { |
|
reveman
2012/11/30 03:10:20
AsyncPixelTransfersCompletedQuery?
epennerAtGoogle
2012/11/30 04:14:22
Done.
|
| + public: |
| + AsyncTasksCompletedQuery( |
| + 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 ~AsyncTasksCompletedQuery(); |
| +}; |
| + |
| +AsyncTasksCompletedQuery::AsyncTasksCompletedQuery( |
| + QueryManager* manager, GLenum target, int32 shm_id, uint32 shm_offset) |
| + : Query(manager, target, shm_id, shm_offset) { |
| +} |
| + |
| +bool AsyncTasksCompletedQuery::Begin() { |
| + return true; |
| +} |
| + |
| +bool AsyncTasksCompletedQuery::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. |
|
reveman
2012/11/30 03:10:20
The actual completion of the query will be the ind
epennerAtGoogle
2012/11/30 04:14:22
I was thinking it could return the number of trans
reveman
2012/11/30 10:03:00
I think that's good for now.
|
| + MarkAsPending(submit_count); |
| + return MarkAsCompleted(1); |
| +} |
| + |
| +bool AsyncTasksCompletedQuery::Process() { |
| + NOTREACHED(); |
| + return true; |
| +} |
| + |
| +void AsyncTasksCompletedQuery::Destroy(bool /* have_context */) { |
| + if (!IsDeleted()) { |
| + MarkAsDeleted(); |
| + } |
| +} |
| + |
| +AsyncTasksCompletedQuery::~AsyncTasksCompletedQuery() { |
| +} |
| + |
| class GetErrorQuery : public QueryManager::Query { |
| public: |
| GetErrorQuery( |
| @@ -248,6 +294,9 @@ 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 AsyncTasksCompletedQuery(this, target, shm_id, shm_offset); |
| + break; |
| case GL_GET_ERROR_QUERY_CHROMIUM: |
| query = new GetErrorQuery(this, target, shm_id, shm_offset); |
| break; |