Index: gpu/command_buffer/common/sync_token.h |
diff --git a/gpu/command_buffer/common/sync_token.h b/gpu/command_buffer/common/sync_token.h |
index cceb44e6c0277af142a99e009ebeeffc4ae3a2a3..7e4873e00f9b2489820061e4ae26e55e372c2c4c 100644 |
--- a/gpu/command_buffer/common/sync_token.h |
+++ b/gpu/command_buffer/common/sync_token.h |
@@ -45,10 +45,21 @@ struct GPU_EXPORT SyncToken { |
release_count_ = release_count; |
} |
+ void Clear() { |
+ verified_flush_ = false; |
+ namespace_id_ = CommandBufferNamespace::INVALID; |
+ command_buffer_id_ = 0; |
+ release_count_ = 0; |
+ } |
+ |
void SetVerifyFlush() { |
verified_flush_ = true; |
} |
+ bool HasData() const { |
+ return namespace_id_ != CommandBufferNamespace::INVALID; |
+ } |
+ |
int8_t* GetData() { return reinterpret_cast<int8_t*>(this); } |
const int8_t* GetConstData() const { |
@@ -70,6 +81,20 @@ struct GPU_EXPORT SyncToken { |
(release_count_ < other.release_count())))); |
} |
+ bool operator!=(const SyncToken& other) const { |
+ return verified_flush_ != other.verified_flush() && |
dcheng
2015/10/27 19:09:28
Shouldn't this be || instead of &&?
Otherwise, th
David Yen
2015/10/28 22:03:43
Yes this had broken some unittests. I updated it t
|
+ namespace_id_ != other.namespace_id() && |
+ command_buffer_id_ != other.command_buffer_id() && |
+ release_count_ != other.release_count(); |
+ } |
+ |
+ bool operator==(const SyncToken& other) const { |
+ return verified_flush_ == other.verified_flush() && |
+ namespace_id_ == other.namespace_id() && |
+ command_buffer_id_ == other.command_buffer_id() && |
+ release_count_ == other.release_count(); |
+ } |
+ |
private: |
bool verified_flush_; |
CommandBufferNamespace namespace_id_; |