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

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

Issue 12378053: Move Mailbox from cc to gpu, and its traits to gpu/ipc (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ios hate Created 7 years, 10 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/mailbox.h ('k') | gpu/command_buffer_common.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/common/mailbox.cc
diff --git a/gpu/command_buffer/common/mailbox.cc b/gpu/command_buffer/common/mailbox.cc
new file mode 100644
index 0000000000000000000000000000000000000000..c47a9fdb2bc82ac42174069a1c5e09223e437c03
--- /dev/null
+++ b/gpu/command_buffer/common/mailbox.cc
@@ -0,0 +1,30 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "../common/mailbox.h"
+
+#include <string.h>
+
+#include "../common/logging.h"
+
+namespace gpu {
+
+Mailbox::Mailbox() {
+ memset(name, 0, sizeof(name));
+}
+
+bool Mailbox::IsZero() const {
+ for (size_t i = 0; i < arraysize(name); ++i) {
+ if (name[i])
+ return false;
+ }
+ return true;
+}
+
+void Mailbox::SetName(const int8* n) {
+ GPU_DCHECK(IsZero() || !memcmp(name, n, sizeof(name)));
+ memcpy(name, n, sizeof(name));
+}
+
+} // namespace gpu
« no previous file with comments | « gpu/command_buffer/common/mailbox.h ('k') | gpu/command_buffer_common.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698