OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef GPU_COMMAND_BUFFER_MAILBOX_H_ | 5 #ifndef GPU_COMMAND_BUFFER_MAILBOX_H_ |
6 #define GPU_COMMAND_BUFFER_MAILBOX_H_ | 6 #define GPU_COMMAND_BUFFER_MAILBOX_H_ |
7 | 7 |
8 #include <string.h> | 8 #include <string.h> |
9 | 9 |
10 #include "gpu/command_buffer/common/types.h" | 10 #include "gpu/command_buffer/common/types.h" |
11 #include "gpu/gpu_export.h" | 11 #include "gpu/gpu_export.h" |
12 | 12 |
13 // From gl2/gl2ext.h. | |
14 #ifndef GL_MAILBOX_SIZE_CHROMIUM | |
15 #define GL_MAILBOX_SIZE_CHROMIUM 64 | |
16 #endif | |
17 | |
18 namespace gpu { | 13 namespace gpu { |
19 | 14 |
20 struct GPU_EXPORT Mailbox { | 15 struct GPU_EXPORT Mailbox { |
21 Mailbox(); | 16 Mailbox(); |
22 bool IsZero() const; | 17 bool IsZero() const; |
23 void SetZero(); | 18 void SetZero(); |
24 void SetName(const int8* name); | 19 void SetName(const int8* name); |
25 int8 name[GL_MAILBOX_SIZE_CHROMIUM]; | 20 int8 name[64]; |
26 bool operator<(const Mailbox& other) const { | 21 bool operator<(const Mailbox& other) const { |
27 return memcmp(this, &other, sizeof other) < 0; | 22 return memcmp(this, &other, sizeof other) < 0; |
28 } | 23 } |
29 bool operator==(const Mailbox& other) const { | 24 bool operator==(const Mailbox& other) const { |
30 return memcmp(this, &other, sizeof other) == 0; | 25 return memcmp(this, &other, sizeof other) == 0; |
31 } | 26 } |
32 bool operator!=(const Mailbox& other) const { | 27 bool operator!=(const Mailbox& other) const { |
33 return !operator==(other); | 28 return !operator==(other); |
34 } | 29 } |
35 }; | 30 }; |
36 | 31 |
37 } // namespace gpu | 32 } // namespace gpu |
38 | 33 |
39 #endif // GPU_COMMAND_BUFFER_MAILBOX_H_ | 34 #endif // GPU_COMMAND_BUFFER_MAILBOX_H_ |
40 | 35 |
OLD | NEW |