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

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: Just a name change 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..bb34d47a47f4638065a00ee3a094da650215b575 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 {
greggman 2012/11/29 02:18:18 CommandsIssuedQuery already handles this case does
+ 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.
+ 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_TASKS_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;

Powered by Google App Engine
This is Rietveld 408576698