| 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(); } |
| 42 | 45 |
| 43 bool Equals(const TextureMailbox&) const; | 46 bool Equals(const TextureMailbox&) const; |
| 44 | 47 |
| 45 const gpu::Mailbox& mailbox() const { return mailbox_holder_.mailbox; } | 48 const gpu::Mailbox& mailbox() const { return mailbox_holder_.mailbox; } |
| 46 const int8_t* name() const { return mailbox().name; } | 49 const int8_t* name() const { return mailbox().name; } |
| 47 uint32_t target() const { return mailbox_holder_.texture_target; } | 50 uint32_t target() const { return mailbox_holder_.texture_target; } |
| 48 const gpu::SyncToken& sync_token() const { | 51 const gpu::SyncToken& sync_token() const { |
| 49 return mailbox_holder_.sync_token; | 52 return mailbox_holder_.sync_token; |
| 50 } | 53 } |
| 51 void set_sync_token(const gpu::SyncToken& sync_token) { | 54 void set_sync_token(const gpu::SyncToken& sync_token) { |
| (...skipping 16 matching lines...) Expand all Loading... |
| 68 gpu::MailboxHolder mailbox_holder_; | 71 gpu::MailboxHolder mailbox_holder_; |
| 69 SharedBitmap* shared_bitmap_; | 72 SharedBitmap* shared_bitmap_; |
| 70 gfx::Size size_in_pixels_; | 73 gfx::Size size_in_pixels_; |
| 71 bool is_overlay_candidate_; | 74 bool is_overlay_candidate_; |
| 72 bool nearest_neighbor_; | 75 bool nearest_neighbor_; |
| 73 }; | 76 }; |
| 74 | 77 |
| 75 } // namespace cc | 78 } // namespace cc |
| 76 | 79 |
| 77 #endif // CC_RESOURCES_TEXTURE_MAILBOX_H_ | 80 #endif // CC_RESOURCES_TEXTURE_MAILBOX_H_ |
| OLD | NEW |