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

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: . 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_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() { num_contributors_--; }
jaydasika 2017/04/28 18:27:18 Add a DCHECK here for num_contributors_ >= 0 after
ajuma 2017/04/28 21:11:21 Done.
131 void reset_num_contributors() { num_contributors_ = 0; }
132 int num_contributors() const { return num_contributors_; }
133
122 const Occlusion& occlusion_in_content_space() const { 134 const Occlusion& occlusion_in_content_space() const {
123 return occlusion_in_content_space_; 135 return occlusion_in_content_space_;
124 } 136 }
125 void set_occlusion_in_content_space(const Occlusion& occlusion) { 137 void set_occlusion_in_content_space(const Occlusion& occlusion) {
126 occlusion_in_content_space_ = occlusion; 138 occlusion_in_content_space_ = occlusion;
127 } 139 }
128 140
129 LayerImplList& layer_list() { return layer_list_; }
130 void ClearLayerLists();
131
132 int id() const { return stable_effect_id_; } 141 int id() const { return stable_effect_id_; }
133 142
134 LayerImpl* MaskLayer(); 143 LayerImpl* MaskLayer();
135 bool HasMask() const; 144 bool HasMask() const;
136 145
137 const FilterOperations& Filters() const; 146 const FilterOperations& Filters() const;
138 const FilterOperations& BackgroundFilters() const; 147 const FilterOperations& BackgroundFilters() const;
139 gfx::PointF FiltersOrigin() const; 148 gfx::PointF FiltersOrigin() const;
140 gfx::Transform SurfaceScale() const; 149 gfx::Transform SurfaceScale() const;
141 150
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 gfx::Rect clip_rect; 206 gfx::Rect clip_rect;
198 207
199 // True if the surface needs to be clipped by clip_rect. 208 // True if the surface needs to be clipped by clip_rect.
200 bool is_clipped : 1; 209 bool is_clipped : 1;
201 }; 210 };
202 211
203 DrawProperties draw_properties_; 212 DrawProperties draw_properties_;
204 213
205 // Is used to calculate the content rect from property trees. 214 // Is used to calculate the content rect from property trees.
206 gfx::Rect accumulated_content_rect_; 215 gfx::Rect accumulated_content_rect_;
216 int num_contributors_;
207 // Is used to decide if the surface is clipped. 217 // Is used to decide if the surface is clipped.
208 bool has_contributing_layer_that_escapes_clip_ : 1; 218 bool has_contributing_layer_that_escapes_clip_ : 1;
209 bool surface_property_changed_ : 1; 219 bool surface_property_changed_ : 1;
210 bool ancestor_property_changed_ : 1; 220 bool ancestor_property_changed_ : 1;
211 221
212 bool contributes_to_drawn_surface_ : 1; 222 bool contributes_to_drawn_surface_ : 1;
223 bool is_render_surface_list_member_ : 1;
213 224
214 LayerImplList layer_list_;
215 Occlusion occlusion_in_content_space_; 225 Occlusion occlusion_in_content_space_;
216 226
217 // The nearest ancestor target surface that will contain the contents of this 227 // The nearest ancestor target surface that will contain the contents of this
218 // surface, and that ignores outside occlusion. This can point to itself. 228 // surface, and that ignores outside occlusion. This can point to itself.
219 const RenderSurfaceImpl* nearest_occlusion_immune_ancestor_; 229 const RenderSurfaceImpl* nearest_occlusion_immune_ancestor_;
220 230
221 std::unique_ptr<DamageTracker> damage_tracker_; 231 std::unique_ptr<DamageTracker> damage_tracker_;
222 232
223 DISALLOW_COPY_AND_ASSIGN(RenderSurfaceImpl); 233 DISALLOW_COPY_AND_ASSIGN(RenderSurfaceImpl);
224 }; 234 };
225 235
226 } // namespace cc 236 } // namespace cc
227 #endif // CC_LAYERS_RENDER_SURFACE_IMPL_H_ 237 #endif // CC_LAYERS_RENDER_SURFACE_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698