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

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

Issue 2275203002: Make command buffer commands and immediate data volatile (Closed)
Patch Set: std::copy->const_cast+memcpy Created 4 years, 3 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
« no previous file with comments | « gpu/command_buffer/common/gles2_cmd_utils.h ('k') | gpu/command_buffer/service/cmd_parser.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/common/mailbox.h
diff --git a/gpu/command_buffer/common/mailbox.h b/gpu/command_buffer/common/mailbox.h
index 94d63c53bbeb1af62096e4984ec11aee1f11df31..b592fa4d68f0602f31a0ed561a5b389b33218bd1 100644
--- a/gpu/command_buffer/common/mailbox.h
+++ b/gpu/command_buffer/common/mailbox.h
@@ -28,6 +28,12 @@ struct GPU_EXPORT Mailbox {
using Name = int8_t[GL_MAILBOX_SIZE_CHROMIUM];
Mailbox();
+
+ static Mailbox FromVolatile(const volatile Mailbox& other) {
+ // Because the copy constructor is trivial, const_cast is safe.
+ return const_cast<const Mailbox&>(other);
+ }
+
bool IsZero() const;
void SetZero();
void SetName(const int8_t* name);
« no previous file with comments | « gpu/command_buffer/common/gles2_cmd_utils.h ('k') | gpu/command_buffer/service/cmd_parser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698