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

Unified Diff: gpu/command_buffer/common/sync_token.h

Issue 1427543002: Modified old wait sync point functions to also accept new sync tokens. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix mock gpu video accelerator factory Created 5 years, 2 months 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/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_;

Powered by Google App Engine
This is Rietveld 408576698