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/memory/shared_memory.h" | 10 #include "base/memory/shared_memory.h" |
11 #include "cc/base/cc_export.h" | |
12 #include "gpu/command_buffer/common/mailbox_holder.h" | 11 #include "gpu/command_buffer/common/mailbox_holder.h" |
13 #include "ui/gfx/geometry/size.h" | 12 #include "ui/gfx/geometry/size.h" |
14 | 13 |
15 namespace cc { | 14 namespace cc { |
16 class SharedBitmap; | 15 class SharedBitmap; |
17 | 16 |
18 // TODO(skaslev, danakj) Rename this class more apropriately since now it | 17 // TODO(skaslev, danakj) Rename this class more apropriately since now it |
19 // can hold a shared memory resource as well as a texture mailbox. | 18 // can hold a shared memory resource as well as a texture mailbox. |
20 class CC_EXPORT TextureMailbox { | 19 class TextureMailbox { |
21 public: | 20 public: |
22 TextureMailbox(); | 21 TextureMailbox(); |
23 explicit TextureMailbox(const gpu::MailboxHolder& mailbox_holder); | 22 explicit TextureMailbox(const gpu::MailboxHolder& mailbox_holder); |
24 TextureMailbox(const gpu::Mailbox& mailbox, uint32 target, uint32 sync_point); | 23 TextureMailbox(const gpu::Mailbox& mailbox, uint32 target, uint32 sync_point); |
25 TextureMailbox(SharedBitmap* shared_bitmap, const gfx::Size& size); | 24 TextureMailbox(SharedBitmap* shared_bitmap, const gfx::Size& size); |
26 | 25 |
27 ~TextureMailbox(); | 26 ~TextureMailbox(); |
28 | 27 |
29 bool IsValid() const { return IsTexture() || IsSharedMemory(); } | 28 bool IsValid() const { return IsTexture() || IsSharedMemory(); } |
30 bool IsTexture() const { return !mailbox_holder_.mailbox.IsZero(); } | 29 bool IsTexture() const { return !mailbox_holder_.mailbox.IsZero(); } |
(...skipping 24 matching lines...) Expand all Loading... |
55 gpu::MailboxHolder mailbox_holder_; | 54 gpu::MailboxHolder mailbox_holder_; |
56 SharedBitmap* shared_bitmap_; | 55 SharedBitmap* shared_bitmap_; |
57 gfx::Size shared_memory_size_; | 56 gfx::Size shared_memory_size_; |
58 bool allow_overlay_; | 57 bool allow_overlay_; |
59 bool nearest_neighbor_; | 58 bool nearest_neighbor_; |
60 }; | 59 }; |
61 | 60 |
62 } // namespace cc | 61 } // namespace cc |
63 | 62 |
64 #endif // CC_RESOURCES_TEXTURE_MAILBOX_H_ | 63 #endif // CC_RESOURCES_TEXTURE_MAILBOX_H_ |
OLD | NEW |