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 <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 21 matching lines...) Expand all Loading... |
32 uint32_t target, | 32 uint32_t target, |
33 const gfx::Size& size_in_pixels, | 33 const gfx::Size& size_in_pixels, |
34 bool is_overlay_candidate); | 34 bool is_overlay_candidate); |
35 TextureMailbox(SharedBitmap* shared_bitmap, const gfx::Size& size_in_pixels); | 35 TextureMailbox(SharedBitmap* shared_bitmap, const gfx::Size& size_in_pixels); |
36 | 36 |
37 ~TextureMailbox(); | 37 ~TextureMailbox(); |
38 | 38 |
39 bool IsValid() const { return IsTexture() || IsSharedMemory(); } | 39 bool IsValid() const { return IsTexture() || IsSharedMemory(); } |
40 bool IsTexture() const { return !mailbox_holder_.mailbox.IsZero(); } | 40 bool IsTexture() const { return !mailbox_holder_.mailbox.IsZero(); } |
41 bool IsSharedMemory() const { return shared_bitmap_ != NULL; } | 41 bool IsSharedMemory() const { return shared_bitmap_ != NULL; } |
42 bool HasSyncToken() const { return mailbox_holder_.sync_token.HasData(); } | |
43 | |
44 int8_t* GetSyncTokenData() { return mailbox_holder_.sync_token.GetData(); } | |
45 | 42 |
46 bool Equals(const TextureMailbox&) const; | 43 bool Equals(const TextureMailbox&) const; |
47 | 44 |
48 const gpu::Mailbox& mailbox() const { return mailbox_holder_.mailbox; } | 45 const gpu::Mailbox& mailbox() const { return mailbox_holder_.mailbox; } |
49 const int8_t* name() const { return mailbox().name; } | 46 const int8_t* name() const { return mailbox().name; } |
50 uint32_t target() const { return mailbox_holder_.texture_target; } | 47 uint32_t target() const { return mailbox_holder_.texture_target; } |
51 const gpu::SyncToken& sync_token() const { | 48 const gpu::SyncToken& sync_token() const { |
52 return mailbox_holder_.sync_token; | 49 return mailbox_holder_.sync_token; |
53 } | 50 } |
54 void set_sync_token(const gpu::SyncToken& sync_token) { | 51 void set_sync_token(const gpu::SyncToken& sync_token) { |
(...skipping 16 matching lines...) Expand all Loading... |
71 gpu::MailboxHolder mailbox_holder_; | 68 gpu::MailboxHolder mailbox_holder_; |
72 SharedBitmap* shared_bitmap_; | 69 SharedBitmap* shared_bitmap_; |
73 gfx::Size size_in_pixels_; | 70 gfx::Size size_in_pixels_; |
74 bool is_overlay_candidate_; | 71 bool is_overlay_candidate_; |
75 bool nearest_neighbor_; | 72 bool nearest_neighbor_; |
76 }; | 73 }; |
77 | 74 |
78 } // namespace cc | 75 } // namespace cc |
79 | 76 |
80 #endif // CC_RESOURCES_TEXTURE_MAILBOX_H_ | 77 #endif // CC_RESOURCES_TEXTURE_MAILBOX_H_ |
OLD | NEW |