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

Side by Side Diff: cc/layers/render_surface_impl.h

Issue 2834123002: cc: Replace render surface layer list with a render surface list (Closed)
Patch Set: Address review comments 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
« no previous file with comments | « cc/layers/layer_position_constraint_unittest.cc ('k') | cc/layers/render_surface_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_LAYERS_RENDER_SURFACE_IMPL_H_ 5 #ifndef CC_LAYERS_RENDER_SURFACE_IMPL_H_
6 #define CC_LAYERS_RENDER_SURFACE_IMPL_H_ 6 #define CC_LAYERS_RENDER_SURFACE_IMPL_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include <memory> 10 #include <memory>
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 } 97 }
98 98
99 void set_has_contributing_layer_that_escapes_clip( 99 void set_has_contributing_layer_that_escapes_clip(
100 bool contributing_layer_escapes_clip) { 100 bool contributing_layer_escapes_clip) {
101 has_contributing_layer_that_escapes_clip_ = contributing_layer_escapes_clip; 101 has_contributing_layer_that_escapes_clip_ = contributing_layer_escapes_clip;
102 } 102 }
103 bool has_contributing_layer_that_escapes_clip() const { 103 bool has_contributing_layer_that_escapes_clip() const {
104 return has_contributing_layer_that_escapes_clip_; 104 return has_contributing_layer_that_escapes_clip_;
105 } 105 }
106 106
107 void set_is_render_surface_list_member(bool is_render_surface_list_member) {
108 is_render_surface_list_member_ = is_render_surface_list_member;
109 }
110 bool is_render_surface_list_member() const {
111 return is_render_surface_list_member_;
112 }
113
107 void CalculateContentRectFromAccumulatedContentRect(int max_texture_size); 114 void CalculateContentRectFromAccumulatedContentRect(int max_texture_size);
108 void SetContentRectToViewport(); 115 void SetContentRectToViewport();
109 void SetContentRectForTesting(const gfx::Rect& rect); 116 void SetContentRectForTesting(const gfx::Rect& rect);
110 gfx::Rect content_rect() const { return draw_properties_.content_rect; } 117 gfx::Rect content_rect() const { return draw_properties_.content_rect; }
111 118
112 void ClearAccumulatedContentRect(); 119 void ClearAccumulatedContentRect();
113 void AccumulateContentRectFromContributingLayer( 120 void AccumulateContentRectFromContributingLayer(
114 LayerImpl* contributing_layer); 121 LayerImpl* contributing_layer);
115 void AccumulateContentRectFromContributingRenderSurface( 122 void AccumulateContentRectFromContributingRenderSurface(
116 RenderSurfaceImpl* contributing_surface); 123 RenderSurfaceImpl* contributing_surface);
117 124
118 gfx::Rect accumulated_content_rect() const { 125 gfx::Rect accumulated_content_rect() const {
119 return accumulated_content_rect_; 126 return accumulated_content_rect_;
120 } 127 }
121 128
129 void increment_num_contributors() { num_contributors_++; }
130 void decrement_num_contributors() {
131 num_contributors_--;
132 DCHECK_GE(num_contributors_, 0);
133 }
134 void reset_num_contributors() { num_contributors_ = 0; }
135 int num_contributors() const { return num_contributors_; }
136
122 const Occlusion& occlusion_in_content_space() const { 137 const Occlusion& occlusion_in_content_space() const {
123 return occlusion_in_content_space_; 138 return occlusion_in_content_space_;
124 } 139 }
125 void set_occlusion_in_content_space(const Occlusion& occlusion) { 140 void set_occlusion_in_content_space(const Occlusion& occlusion) {
126 occlusion_in_content_space_ = occlusion; 141 occlusion_in_content_space_ = occlusion;
127 } 142 }
128 143
129 LayerImplList& layer_list() { return layer_list_; }
130 void ClearLayerLists();
131
132 int id() const { return stable_effect_id_; } 144 int id() const { return stable_effect_id_; }
133 145
134 LayerImpl* MaskLayer(); 146 LayerImpl* MaskLayer();
135 bool HasMask() const; 147 bool HasMask() const;
136 148
137 const FilterOperations& Filters() const; 149 const FilterOperations& Filters() const;
138 const FilterOperations& BackgroundFilters() const; 150 const FilterOperations& BackgroundFilters() const;
139 gfx::PointF FiltersOrigin() const; 151 gfx::PointF FiltersOrigin() const;
140 gfx::Transform SurfaceScale() const; 152 gfx::Transform SurfaceScale() const;
141 153
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 gfx::Rect clip_rect; 209 gfx::Rect clip_rect;
198 210
199 // True if the surface needs to be clipped by clip_rect. 211 // True if the surface needs to be clipped by clip_rect.
200 bool is_clipped : 1; 212 bool is_clipped : 1;
201 }; 213 };
202 214
203 DrawProperties draw_properties_; 215 DrawProperties draw_properties_;
204 216
205 // Is used to calculate the content rect from property trees. 217 // Is used to calculate the content rect from property trees.
206 gfx::Rect accumulated_content_rect_; 218 gfx::Rect accumulated_content_rect_;
219 int num_contributors_;
207 // Is used to decide if the surface is clipped. 220 // Is used to decide if the surface is clipped.
208 bool has_contributing_layer_that_escapes_clip_ : 1; 221 bool has_contributing_layer_that_escapes_clip_ : 1;
209 bool surface_property_changed_ : 1; 222 bool surface_property_changed_ : 1;
210 bool ancestor_property_changed_ : 1; 223 bool ancestor_property_changed_ : 1;
211 224
212 bool contributes_to_drawn_surface_ : 1; 225 bool contributes_to_drawn_surface_ : 1;
226 bool is_render_surface_list_member_ : 1;
213 227
214 LayerImplList layer_list_;
215 Occlusion occlusion_in_content_space_; 228 Occlusion occlusion_in_content_space_;
216 229
217 // The nearest ancestor target surface that will contain the contents of this 230 // The nearest ancestor target surface that will contain the contents of this
218 // surface, and that ignores outside occlusion. This can point to itself. 231 // surface, and that ignores outside occlusion. This can point to itself.
219 const RenderSurfaceImpl* nearest_occlusion_immune_ancestor_; 232 const RenderSurfaceImpl* nearest_occlusion_immune_ancestor_;
220 233
221 std::unique_ptr<DamageTracker> damage_tracker_; 234 std::unique_ptr<DamageTracker> damage_tracker_;
222 235
223 DISALLOW_COPY_AND_ASSIGN(RenderSurfaceImpl); 236 DISALLOW_COPY_AND_ASSIGN(RenderSurfaceImpl);
224 }; 237 };
225 238
226 } // namespace cc 239 } // namespace cc
227 #endif // CC_LAYERS_RENDER_SURFACE_IMPL_H_ 240 #endif // CC_LAYERS_RENDER_SURFACE_IMPL_H_
OLDNEW
« no previous file with comments | « cc/layers/layer_position_constraint_unittest.cc ('k') | cc/layers/render_surface_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698