Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(131)

Side by Side Diff: cc/resources/texture_mailbox.h

Issue 2651793007: Implemented StructTraits for cc::TextureMailbox (Closed)
Patch Set: c Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « cc/resources/DEPS ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
11 #include <string> 11 #include <string>
12 12
13 #include "base/memory/shared_memory.h" 13 #include "base/memory/shared_memory.h"
14 #include "cc/base/cc_export.h" 14 #include "cc/base/cc_export.h"
15 #include "gpu/command_buffer/common/mailbox_holder.h" 15 #include "gpu/command_buffer/common/mailbox_holder.h"
16 #include "mojo/public/cpp/bindings/struct_traits.h"
16 #include "ui/gfx/color_space.h" 17 #include "ui/gfx/color_space.h"
17 #include "ui/gfx/geometry/size.h" 18 #include "ui/gfx/geometry/size.h"
18 19
19 namespace cc { 20 namespace cc {
21
22 namespace mojom {
23 class TextureMailboxDataView;
24 }
25
20 class SharedBitmap; 26 class SharedBitmap;
21 27
22 // TODO(skaslev, danakj) Rename this class more apropriately since now it 28 // TODO(skaslev, danakj) Rename this class more apropriately since now it
23 // can hold a shared memory resource as well as a texture mailbox. 29 // can hold a shared memory resource as well as a texture mailbox.
24 class CC_EXPORT TextureMailbox { 30 class CC_EXPORT TextureMailbox {
25 public: 31 public:
26 TextureMailbox(); 32 TextureMailbox();
27 TextureMailbox(const TextureMailbox& other); 33 TextureMailbox(const TextureMailbox& other);
28 explicit TextureMailbox(const gpu::MailboxHolder& mailbox_holder); 34 explicit TextureMailbox(const gpu::MailboxHolder& mailbox_holder);
29 TextureMailbox(const gpu::Mailbox& mailbox, 35 TextureMailbox(const gpu::Mailbox& mailbox,
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 void set_is_backed_by_surface_texture(bool value) { 92 void set_is_backed_by_surface_texture(bool value) {
87 is_backed_by_surface_texture_ = value; 93 is_backed_by_surface_texture_ = value;
88 } 94 }
89 95
90 bool wants_promotion_hint() const { return wants_promotion_hint_; } 96 bool wants_promotion_hint() const { return wants_promotion_hint_; }
91 97
92 void set_wants_promotion_hint(bool value) { wants_promotion_hint_ = value; } 98 void set_wants_promotion_hint(bool value) { wants_promotion_hint_ = value; }
93 #endif 99 #endif
94 100
95 private: 101 private:
102 friend struct mojo::StructTraits<mojom::TextureMailboxDataView,
103 TextureMailbox>;
104
96 gpu::MailboxHolder mailbox_holder_; 105 gpu::MailboxHolder mailbox_holder_;
97 SharedBitmap* shared_bitmap_; 106 SharedBitmap* shared_bitmap_;
98 gfx::Size size_in_pixels_; 107 gfx::Size size_in_pixels_;
99 bool is_overlay_candidate_; 108 bool is_overlay_candidate_;
100 #if defined(OS_ANDROID) 109 #if defined(OS_ANDROID)
101 bool is_backed_by_surface_texture_; 110 bool is_backed_by_surface_texture_;
102 bool wants_promotion_hint_; 111 bool wants_promotion_hint_;
103 #endif 112 #endif
104 bool secure_output_only_; 113 bool secure_output_only_;
105 bool nearest_neighbor_; 114 bool nearest_neighbor_;
106 gfx::ColorSpace color_space_; 115 gfx::ColorSpace color_space_;
107 }; 116 };
108 117
109 } // namespace cc 118 } // namespace cc
110 119
111 #endif // CC_RESOURCES_TEXTURE_MAILBOX_H_ 120 #endif // CC_RESOURCES_TEXTURE_MAILBOX_H_
OLDNEW
« no previous file with comments | « cc/resources/DEPS ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698