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 CC_RESOURCES_TEXTURE_MAILBOX_H_ | 5 #ifndef CC_RESOURCES_TEXTURE_MAILBOX_H_ |
6 #define CC_RESOURCES_TEXTURE_MAILBOX_H_ | 6 #define CC_RESOURCES_TEXTURE_MAILBOX_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 10 matching lines...) Expand all Loading... |
21 public: | 21 public: |
22 TextureMailbox(); | 22 TextureMailbox(); |
23 explicit TextureMailbox(const std::string& mailbox_name); | 23 explicit TextureMailbox(const std::string& mailbox_name); |
24 explicit TextureMailbox(const gpu::Mailbox& mailbox_name); | 24 explicit TextureMailbox(const gpu::Mailbox& mailbox_name); |
25 TextureMailbox(const gpu::Mailbox& mailbox_name, | 25 TextureMailbox(const gpu::Mailbox& mailbox_name, |
26 unsigned sync_point); | 26 unsigned sync_point); |
27 TextureMailbox(const gpu::Mailbox& mailbox_name, | 27 TextureMailbox(const gpu::Mailbox& mailbox_name, |
28 unsigned texture_target, | 28 unsigned texture_target, |
29 unsigned sync_point); | 29 unsigned sync_point); |
30 TextureMailbox(base::SharedMemory* shared_memory, | 30 TextureMailbox(base::SharedMemory* shared_memory, |
31 gfx::Size size); | 31 const gfx::Size& size); |
32 | 32 |
33 ~TextureMailbox(); | 33 ~TextureMailbox(); |
34 | 34 |
35 bool IsValid() const { return IsTexture() || IsSharedMemory(); } | 35 bool IsValid() const { return IsTexture() || IsSharedMemory(); } |
36 bool IsTexture() const { return !name_.IsZero(); } | 36 bool IsTexture() const { return !name_.IsZero(); } |
37 bool IsSharedMemory() const { return shared_memory_ != NULL; } | 37 bool IsSharedMemory() const { return shared_memory_ != NULL; } |
38 | 38 |
39 bool Equals(const TextureMailbox&) const; | 39 bool Equals(const TextureMailbox&) const; |
40 bool ContainsMailbox(const gpu::Mailbox&) const; | 40 bool ContainsMailbox(const gpu::Mailbox&) const; |
41 bool ContainsHandle(base::SharedMemoryHandle handle) const; | 41 bool ContainsHandle(base::SharedMemoryHandle handle) const; |
(...skipping 16 matching lines...) Expand all Loading... |
58 gpu::Mailbox name_; | 58 gpu::Mailbox name_; |
59 unsigned target_; | 59 unsigned target_; |
60 unsigned sync_point_; | 60 unsigned sync_point_; |
61 base::SharedMemory* shared_memory_; | 61 base::SharedMemory* shared_memory_; |
62 gfx::Size shared_memory_size_; | 62 gfx::Size shared_memory_size_; |
63 }; | 63 }; |
64 | 64 |
65 } // namespace cc | 65 } // namespace cc |
66 | 66 |
67 #endif // CC_RESOURCES_TEXTURE_MAILBOX_H_ | 67 #endif // CC_RESOURCES_TEXTURE_MAILBOX_H_ |
OLD | NEW |