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

Side by Side Diff: cc/quads/render_pass.h

Issue 2873593002: Force use of and cache render surface. (Closed)
Patch Set: Calculate damage of |force_render_surface|. Created 3 years, 7 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
OLDNEW
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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 const gfx::Rect& damage_rect, 78 const gfx::Rect& damage_rect,
79 const gfx::Transform& transform_to_root_target); 79 const gfx::Transform& transform_to_root_target);
80 80
81 void SetAll(int id, 81 void SetAll(int id,
82 const gfx::Rect& output_rect, 82 const gfx::Rect& output_rect,
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 const FilterOperations& filters, 85 const FilterOperations& filters,
86 const FilterOperations& background_filters, 86 const FilterOperations& background_filters,
87 const gfx::ColorSpace& color_space, 87 const gfx::ColorSpace& color_space,
88 bool has_transparent_background); 88 bool has_transparent_background,
89 bool force_render_surface,
90 bool has_property_change_on_contributing_render_surface,
91 bool has_damage_on_surface_quad);
89 92
90 void AsValueInto(base::trace_event::TracedValue* dict) const; 93 void AsValueInto(base::trace_event::TracedValue* dict) const;
91 94
92 SharedQuadState* CreateAndAppendSharedQuadState(); 95 SharedQuadState* CreateAndAppendSharedQuadState();
93 96
94 template <typename DrawQuadType> 97 template <typename DrawQuadType>
95 DrawQuadType* CreateAndAppendDrawQuad() { 98 DrawQuadType* CreateAndAppendDrawQuad() {
96 return quad_list.AllocateAndConstruct<DrawQuadType>(); 99 return quad_list.AllocateAndConstruct<DrawQuadType>();
97 } 100 }
98 101
(...skipping 21 matching lines...) Expand all
120 // Post-processing filters, applied to the pixels showing through the 123 // Post-processing filters, applied to the pixels showing through the
121 // background of the render pass, from behind it. 124 // background of the render pass, from behind it.
122 FilterOperations background_filters; 125 FilterOperations background_filters;
123 126
124 // The color space into which content will be rendered for this render pass. 127 // The color space into which content will be rendered for this render pass.
125 gfx::ColorSpace color_space; 128 gfx::ColorSpace color_space;
126 129
127 // If false, the pixels in the render pass' texture are all opaque. 130 // If false, the pixels in the render pass' texture are all opaque.
128 bool has_transparent_background = true; 131 bool has_transparent_background = true;
129 132
133 // If true we might reuse the texture if there is no damage.
134 bool force_render_surface = false;
135 // A cumulated property changes from the contributing render surface. Not
136 // including property changes on itself.
137 bool has_property_change_on_contributing_render_surface = false;
weiliangc 2017/06/07 21:19:00 We should be able to just combine this and has_dam
wutao 2017/06/09 02:31:32 Nice!
138 // If true, indicates containing at least one surface quad with damage.
139 bool has_damage_on_surface_quad = false;
140
130 // If non-empty, the renderer should produce a copy of the render pass' 141 // If non-empty, the renderer should produce a copy of the render pass'
131 // contents as a bitmap, and give a copy of the bitmap to each callback in 142 // contents as a bitmap, and give a copy of the bitmap to each callback in
132 // this list. This property should not be serialized between compositors, as 143 // this list. This property should not be serialized between compositors, as
133 // it only makes sense in the root compositor. 144 // it only makes sense in the root compositor.
134 std::vector<std::unique_ptr<CopyOutputRequest>> copy_requests; 145 std::vector<std::unique_ptr<CopyOutputRequest>> copy_requests;
135 146
136 QuadList quad_list; 147 QuadList quad_list;
137 SharedQuadStateList shared_quad_state_list; 148 SharedQuadStateList shared_quad_state_list;
138 149
139 protected: 150 protected:
140 explicit RenderPass(size_t num_layers); 151 explicit RenderPass(size_t num_layers);
141 RenderPass(); 152 RenderPass();
142 RenderPass(size_t shared_quad_state_list_size, size_t quad_list_size); 153 RenderPass(size_t shared_quad_state_list_size, size_t quad_list_size);
143 154
144 private: 155 private:
145 template <typename DrawQuadType> 156 template <typename DrawQuadType>
146 DrawQuadType* CopyFromAndAppendTypedDrawQuad(const DrawQuad* quad) { 157 DrawQuadType* CopyFromAndAppendTypedDrawQuad(const DrawQuad* quad) {
147 return quad_list.AllocateAndCopyFrom(DrawQuadType::MaterialCast(quad)); 158 return quad_list.AllocateAndCopyFrom(DrawQuadType::MaterialCast(quad));
148 } 159 }
149 160
150 DISALLOW_COPY_AND_ASSIGN(RenderPass); 161 DISALLOW_COPY_AND_ASSIGN(RenderPass);
151 }; 162 };
152 163
153 using RenderPassList = std::vector<std::unique_ptr<RenderPass>>; 164 using RenderPassList = std::vector<std::unique_ptr<RenderPass>>;
154 165
155 } // namespace cc 166 } // namespace cc
156 167
157 #endif // CC_QUADS_RENDER_PASS_H_ 168 #endif // CC_QUADS_RENDER_PASS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698