OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_SERVICE_MAILBOX_MANAGER_H_ | 5 #ifndef GPU_COMMAND_BUFFER_SERVICE_MAILBOX_MANAGER_H_ |
6 #define GPU_COMMAND_BUFFER_SERVICE_MAILBOX_MANAGER_H_ | 6 #define GPU_COMMAND_BUFFER_SERVICE_MAILBOX_MANAGER_H_ |
7 | 7 |
8 #include <functional> | 8 #include <functional> |
9 #include <map> | 9 #include <map> |
10 | 10 |
11 #include "base/memory/linked_ptr.h" | 11 #include "base/memory/linked_ptr.h" |
12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
13 #include "crypto/hmac.h" | 13 #include "crypto/hmac.h" |
14 #include "gpu/command_buffer/common/constants.h" | 14 #include "gpu/command_buffer/common/constants.h" |
15 #include "gpu/gpu_export.h" | 15 #include "gpu/gpu_export.h" |
16 | 16 |
17 // From gl2/gl2ext.h. | 17 // From gl2/gl2ext.h. |
18 #ifndef GL_MAILBOX_SIZE_CHROMIUM | 18 #ifndef GL_MAILBOX_SIZE_CHROMIUM |
19 #define GL_MAILBOX_SIZE_CHROMIUM 64 | 19 #define GL_MAILBOX_SIZE_CHROMIUM 64 |
20 #endif | 20 #endif |
21 | 21 |
22 typedef signed char GLbyte; | 22 typedef signed char GLbyte; |
23 | 23 |
24 namespace gpu { | 24 namespace gpu { |
| 25 |
| 26 struct Mailbox; |
| 27 |
25 namespace gles2 { | 28 namespace gles2 { |
26 | 29 |
27 class TextureDefinition; | 30 class TextureDefinition; |
28 class TextureManager; | 31 class TextureManager; |
29 | 32 |
30 // Identifies a mailbox where a texture definition can be stored for | 33 // Identifies a mailbox where a texture definition can be stored for |
31 // transferring textures between contexts that are not in the same context | 34 // transferring textures between contexts that are not in the same context |
32 // group. It is a random key signed with a hash of a private key. | 35 // group. It is a random key signed with a hash of a private key. |
33 struct GPU_EXPORT MailboxName { | 36 struct GPU_EXPORT MailboxName { |
34 MailboxName(); | 37 MailboxName(); |
| 38 explicit MailboxName(const ::gpu::Mailbox& mailbox); |
35 GLbyte key[GL_MAILBOX_SIZE_CHROMIUM / 2]; | 39 GLbyte key[GL_MAILBOX_SIZE_CHROMIUM / 2]; |
36 GLbyte signature[GL_MAILBOX_SIZE_CHROMIUM / 2]; | 40 GLbyte signature[GL_MAILBOX_SIZE_CHROMIUM / 2]; |
37 }; | 41 }; |
38 | 42 |
39 // Manages resources scoped beyond the context or context group level. | 43 // Manages resources scoped beyond the context or context group level. |
40 class GPU_EXPORT MailboxManager : public base::RefCounted<MailboxManager> { | 44 class GPU_EXPORT MailboxManager : public base::RefCounted<MailboxManager> { |
41 public: | 45 public: |
42 MailboxManager(); | 46 MailboxManager(); |
43 | 47 |
44 // Generate a unique mailbox name signed with the manager's private key. | 48 // Generate a unique mailbox name signed with the manager's private key. |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 TextureDefinitionMap textures_; | 100 TextureDefinitionMap textures_; |
97 | 101 |
98 DISALLOW_COPY_AND_ASSIGN(MailboxManager); | 102 DISALLOW_COPY_AND_ASSIGN(MailboxManager); |
99 }; | 103 }; |
100 } // namespage gles2 | 104 } // namespage gles2 |
101 } // namespace gpu | 105 } // namespace gpu |
102 | 106 |
103 #endif // GPU_COMMAND_BUFFER_SERVICE_MAILBOX_MANAGER_H_ | 107 #endif // GPU_COMMAND_BUFFER_SERVICE_MAILBOX_MANAGER_H_ |
104 | 108 |
105 | 109 |
OLD | NEW |