OLD | NEW |
---|---|
1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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_QUADS_RENDER_PASS_H_ | 5 #ifndef CC_QUADS_RENDER_PASS_H_ |
6 #define CC_QUADS_RENDER_PASS_H_ | 6 #define CC_QUADS_RENDER_PASS_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include <utility> | 10 #include <utility> |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
80 const gfx::Rect& damage_rect, | 80 const gfx::Rect& damage_rect, |
81 const gfx::Transform& transform_to_root_target); | 81 const gfx::Transform& transform_to_root_target); |
82 | 82 |
83 void SetAll(RenderPassId id, | 83 void SetAll(RenderPassId id, |
84 const gfx::Rect& output_rect, | 84 const gfx::Rect& output_rect, |
85 const gfx::Rect& damage_rect, | 85 const gfx::Rect& damage_rect, |
86 const gfx::Transform& transform_to_root_target, | 86 const gfx::Transform& transform_to_root_target, |
87 const FilterOperations& filters, | 87 const FilterOperations& filters, |
88 const FilterOperations& background_filters, | 88 const FilterOperations& background_filters, |
89 const gfx::ColorSpace& color_space, | 89 const gfx::ColorSpace& color_space, |
90 bool has_transparent_background); | 90 bool has_transparent_background, |
91 bool cache_render_surface, | |
92 bool has_damage_from_contributing_content); | |
91 | 93 |
92 void AsValueInto(base::trace_event::TracedValue* dict) const; | 94 void AsValueInto(base::trace_event::TracedValue* dict) const; |
93 | 95 |
94 SharedQuadState* CreateAndAppendSharedQuadState(); | 96 SharedQuadState* CreateAndAppendSharedQuadState(); |
95 | 97 |
96 template <typename DrawQuadType> | 98 template <typename DrawQuadType> |
97 DrawQuadType* CreateAndAppendDrawQuad() { | 99 DrawQuadType* CreateAndAppendDrawQuad() { |
98 return quad_list.AllocateAndConstruct<DrawQuadType>(); | 100 return quad_list.AllocateAndConstruct<DrawQuadType>(); |
99 } | 101 } |
100 | 102 |
(...skipping 21 matching lines...) Expand all Loading... | |
122 // Post-processing filters, applied to the pixels showing through the | 124 // Post-processing filters, applied to the pixels showing through the |
123 // background of the render pass, from behind it. | 125 // background of the render pass, from behind it. |
124 FilterOperations background_filters; | 126 FilterOperations background_filters; |
125 | 127 |
126 // The color space into which content will be rendered for this render pass. | 128 // The color space into which content will be rendered for this render pass. |
127 gfx::ColorSpace color_space; | 129 gfx::ColorSpace color_space; |
128 | 130 |
129 // If false, the pixels in the render pass' texture are all opaque. | 131 // If false, the pixels in the render pass' texture are all opaque. |
130 bool has_transparent_background = true; | 132 bool has_transparent_background = true; |
131 | 133 |
134 // If true we might reuse the texture if there is no damage. | |
135 bool cache_render_surface = false; | |
136 // A cumulated damage from contributing render surface or layer or surface | |
vmpstr
2017/07/13 18:01:03
nit: Accumulated. Also, this comment isn't really
wutao
2017/07/14 00:02:53
Done.
| |
137 // quad. Not including property changes on itself. | |
138 bool has_damage_from_contributing_content = false; | |
139 | |
132 // If non-empty, the renderer should produce a copy of the render pass' | 140 // If non-empty, the renderer should produce a copy of the render pass' |
133 // contents as a bitmap, and give a copy of the bitmap to each callback in | 141 // contents as a bitmap, and give a copy of the bitmap to each callback in |
134 // this list. This property should not be serialized between compositors, as | 142 // this list. This property should not be serialized between compositors, as |
135 // it only makes sense in the root compositor. | 143 // it only makes sense in the root compositor. |
136 std::vector<std::unique_ptr<CopyOutputRequest>> copy_requests; | 144 std::vector<std::unique_ptr<CopyOutputRequest>> copy_requests; |
137 | 145 |
138 QuadList quad_list; | 146 QuadList quad_list; |
139 SharedQuadStateList shared_quad_state_list; | 147 SharedQuadStateList shared_quad_state_list; |
140 | 148 |
141 protected: | 149 protected: |
142 explicit RenderPass(size_t num_layers); | 150 explicit RenderPass(size_t num_layers); |
143 RenderPass(); | 151 RenderPass(); |
144 RenderPass(size_t shared_quad_state_list_size, size_t quad_list_size); | 152 RenderPass(size_t shared_quad_state_list_size, size_t quad_list_size); |
145 | 153 |
146 private: | 154 private: |
147 template <typename DrawQuadType> | 155 template <typename DrawQuadType> |
148 DrawQuadType* CopyFromAndAppendTypedDrawQuad(const DrawQuad* quad) { | 156 DrawQuadType* CopyFromAndAppendTypedDrawQuad(const DrawQuad* quad) { |
149 return quad_list.AllocateAndCopyFrom(DrawQuadType::MaterialCast(quad)); | 157 return quad_list.AllocateAndCopyFrom(DrawQuadType::MaterialCast(quad)); |
150 } | 158 } |
151 | 159 |
152 DISALLOW_COPY_AND_ASSIGN(RenderPass); | 160 DISALLOW_COPY_AND_ASSIGN(RenderPass); |
153 }; | 161 }; |
154 | 162 |
155 using RenderPassList = std::vector<std::unique_ptr<RenderPass>>; | 163 using RenderPassList = std::vector<std::unique_ptr<RenderPass>>; |
156 | 164 |
157 } // namespace cc | 165 } // namespace cc |
158 | 166 |
159 #endif // CC_QUADS_RENDER_PASS_H_ | 167 #endif // CC_QUADS_RENDER_PASS_H_ |
OLD | NEW |