Index: gpu/command_buffer/client/query_tracker.h |
diff --git a/gpu/command_buffer/client/query_tracker.h b/gpu/command_buffer/client/query_tracker.h |
index 9e7f501768b74a5bbfa4dccfb2bee6e153622dfa..ebb7856ad1cf5cd8fae2773a2897288784773ea6 100644 |
--- a/gpu/command_buffer/client/query_tracker.h |
+++ b/gpu/command_buffer/client/query_tracker.h |
@@ -102,6 +102,14 @@ class GLES2_IMPL_EXPORT QueryTracker { |
return info_.shm_offset; |
} |
+ uint32 serial() const { |
+ return serial_; |
+ } |
+ |
+ void set_serial(uint32 serial) { |
+ serial_ = serial; |
+ } |
+ |
void MarkAsActive() { |
state_ = kActive; |
++submit_count_; |
@@ -133,6 +141,10 @@ class GLES2_IMPL_EXPORT QueryTracker { |
uint32 GetResult() const; |
+ bool IsInternal() const { |
+ return serial_ != 0; |
+ } |
+ |
void Begin(GLES2Implementation* gl); |
void End(GLES2Implementation* gl); |
@@ -147,6 +159,7 @@ class GLES2_IMPL_EXPORT QueryTracker { |
uint32 submit_count_; |
int32 token_; |
bool flushed_; |
+ uint32 serial_; // Only used for internal queries, 0 means not internal. |
uint64 client_begin_time_us_; // Only used for latency query target. |
uint32 result_; |
}; |
@@ -155,12 +168,15 @@ class GLES2_IMPL_EXPORT QueryTracker { |
~QueryTracker(); |
Query* CreateQuery(GLuint id, GLenum target); |
+ Query* CreateInternalQuery(GLuint id, GLenum target); |
Query* GetQuery(GLuint id); |
void RemoveQuery(GLuint id); |
void Shrink(); |
void FreeCompletedQueries(); |
private: |
+ uint32 NextSerial(); |
+ |
typedef base::hash_map<GLuint, Query*> QueryMap; |
typedef std::list<Query*> QueryList; |
@@ -168,6 +184,8 @@ class GLES2_IMPL_EXPORT QueryTracker { |
QueryList removed_queries_; |
QuerySyncManager query_sync_manager_; |
+ uint32 next_serial_; |
+ |
DISALLOW_COPY_AND_ASSIGN(QueryTracker); |
}; |