| 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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 const gfx::Rect& damage_rect, | 83 const gfx::Rect& damage_rect, |
| 84 const gfx::Transform& transform_to_root_target); | 84 const gfx::Transform& transform_to_root_target); |
| 85 | 85 |
| 86 void SetAll(RenderPassId id, | 86 void SetAll(RenderPassId id, |
| 87 const gfx::Rect& output_rect, | 87 const gfx::Rect& output_rect, |
| 88 const gfx::Rect& damage_rect, | 88 const gfx::Rect& damage_rect, |
| 89 const gfx::Transform& transform_to_root_target, | 89 const gfx::Transform& transform_to_root_target, |
| 90 const FilterOperations& filters, | 90 const FilterOperations& filters, |
| 91 const FilterOperations& background_filters, | 91 const FilterOperations& background_filters, |
| 92 const gfx::ColorSpace& color_space, | 92 const gfx::ColorSpace& color_space, |
| 93 bool has_transparent_background); | 93 bool has_transparent_background, |
| 94 bool cache_render_pass, |
| 95 bool has_damage_from_contributing_content); |
| 94 | 96 |
| 95 void AsValueInto(base::trace_event::TracedValue* dict) const; | 97 void AsValueInto(base::trace_event::TracedValue* dict) const; |
| 96 | 98 |
| 97 SharedQuadState* CreateAndAppendSharedQuadState(); | 99 SharedQuadState* CreateAndAppendSharedQuadState(); |
| 98 | 100 |
| 99 template <typename DrawQuadType> | 101 template <typename DrawQuadType> |
| 100 DrawQuadType* CreateAndAppendDrawQuad() { | 102 DrawQuadType* CreateAndAppendDrawQuad() { |
| 101 return quad_list.AllocateAndConstruct<DrawQuadType>(); | 103 return quad_list.AllocateAndConstruct<DrawQuadType>(); |
| 102 } | 104 } |
| 103 | 105 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 125 // Post-processing filters, applied to the pixels showing through the | 127 // Post-processing filters, applied to the pixels showing through the |
| 126 // background of the render pass, from behind it. | 128 // background of the render pass, from behind it. |
| 127 FilterOperations background_filters; | 129 FilterOperations background_filters; |
| 128 | 130 |
| 129 // The color space into which content will be rendered for this render pass. | 131 // The color space into which content will be rendered for this render pass. |
| 130 gfx::ColorSpace color_space; | 132 gfx::ColorSpace color_space; |
| 131 | 133 |
| 132 // If false, the pixels in the render pass' texture are all opaque. | 134 // If false, the pixels in the render pass' texture are all opaque. |
| 133 bool has_transparent_background = true; | 135 bool has_transparent_background = true; |
| 134 | 136 |
| 137 // If true we might reuse the texture if there is no damage. |
| 138 bool cache_render_pass = false; |
| 139 // Indicates whether there is accumulated damage from contributing render |
| 140 // surface or layer or surface quad. Not including property changes on itself. |
| 141 bool has_damage_from_contributing_content = false; |
| 142 |
| 135 // If non-empty, the renderer should produce a copy of the render pass' | 143 // If non-empty, the renderer should produce a copy of the render pass' |
| 136 // contents as a bitmap, and give a copy of the bitmap to each callback in | 144 // contents as a bitmap, and give a copy of the bitmap to each callback in |
| 137 // this list. This property should not be serialized between compositors, as | 145 // this list. This property should not be serialized between compositors, as |
| 138 // it only makes sense in the root compositor. | 146 // it only makes sense in the root compositor. |
| 139 std::vector<std::unique_ptr<viz::CopyOutputRequest>> copy_requests; | 147 std::vector<std::unique_ptr<viz::CopyOutputRequest>> copy_requests; |
| 140 | 148 |
| 141 QuadList quad_list; | 149 QuadList quad_list; |
| 142 SharedQuadStateList shared_quad_state_list; | 150 SharedQuadStateList shared_quad_state_list; |
| 143 | 151 |
| 144 protected: | 152 protected: |
| 145 explicit RenderPass(size_t num_layers); | 153 explicit RenderPass(size_t num_layers); |
| 146 RenderPass(); | 154 RenderPass(); |
| 147 RenderPass(size_t shared_quad_state_list_size, size_t quad_list_size); | 155 RenderPass(size_t shared_quad_state_list_size, size_t quad_list_size); |
| 148 | 156 |
| 149 private: | 157 private: |
| 150 template <typename DrawQuadType> | 158 template <typename DrawQuadType> |
| 151 DrawQuadType* CopyFromAndAppendTypedDrawQuad(const DrawQuad* quad) { | 159 DrawQuadType* CopyFromAndAppendTypedDrawQuad(const DrawQuad* quad) { |
| 152 return quad_list.AllocateAndCopyFrom(DrawQuadType::MaterialCast(quad)); | 160 return quad_list.AllocateAndCopyFrom(DrawQuadType::MaterialCast(quad)); |
| 153 } | 161 } |
| 154 | 162 |
| 155 DISALLOW_COPY_AND_ASSIGN(RenderPass); | 163 DISALLOW_COPY_AND_ASSIGN(RenderPass); |
| 156 }; | 164 }; |
| 157 | 165 |
| 158 using RenderPassList = std::vector<std::unique_ptr<RenderPass>>; | 166 using RenderPassList = std::vector<std::unique_ptr<RenderPass>>; |
| 159 | 167 |
| 160 } // namespace cc | 168 } // namespace cc |
| 161 | 169 |
| 162 #endif // CC_QUADS_RENDER_PASS_H_ | 170 #endif // CC_QUADS_RENDER_PASS_H_ |
| OLD | NEW |