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

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

Issue 2781483006: cc : Compute render surface is_clipped outside property tree building (Closed)
Patch Set: . Created 3 years, 8 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 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 // RenderSurface that is being drawn for the current frame. It could still be 91 // RenderSurface that is being drawn for the current frame. It could still be
92 // drawn to as a target, but its output will not be a part of any other 92 // drawn to as a target, but its output will not be a part of any other
93 // surface. 93 // surface.
94 bool contributes_to_drawn_surface() const { 94 bool contributes_to_drawn_surface() const {
95 return contributes_to_drawn_surface_; 95 return contributes_to_drawn_surface_;
96 } 96 }
97 void set_contributes_to_drawn_surface(bool contributes_to_drawn_surface) { 97 void set_contributes_to_drawn_surface(bool contributes_to_drawn_surface) {
98 contributes_to_drawn_surface_ = contributes_to_drawn_surface; 98 contributes_to_drawn_surface_ = contributes_to_drawn_surface;
99 } 99 }
100 100
101 void set_has_contributing_layer_that_escapes_clip(
102 bool contributing_layer_escapes_clip) {
103 has_contributing_layer_that_escapes_clip_ = contributing_layer_escapes_clip;
104 }
105 bool has_contributing_layer_that_escapes_clip() const {
106 return has_contributing_layer_that_escapes_clip_;
107 }
108
101 void CalculateContentRectFromAccumulatedContentRect(int max_texture_size); 109 void CalculateContentRectFromAccumulatedContentRect(int max_texture_size);
102 void SetContentRectToViewport(); 110 void SetContentRectToViewport();
103 void SetContentRectForTesting(const gfx::Rect& rect); 111 void SetContentRectForTesting(const gfx::Rect& rect);
104 gfx::Rect content_rect() const { return draw_properties_.content_rect; } 112 gfx::Rect content_rect() const { return draw_properties_.content_rect; }
105 113
106 void ClearAccumulatedContentRect(); 114 void ClearAccumulatedContentRect();
107 void AccumulateContentRectFromContributingLayer( 115 void AccumulateContentRectFromContributingLayer(
108 LayerImpl* contributing_layer); 116 LayerImpl* contributing_layer);
109 void AccumulateContentRectFromContributingRenderSurface( 117 void AccumulateContentRectFromContributingRenderSurface(
110 RenderSurfaceImpl* contributing_surface); 118 RenderSurfaceImpl* contributing_surface);
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 gfx::Rect clip_rect; 196 gfx::Rect clip_rect;
189 197
190 // True if the surface needs to be clipped by clip_rect. 198 // True if the surface needs to be clipped by clip_rect.
191 bool is_clipped : 1; 199 bool is_clipped : 1;
192 }; 200 };
193 201
194 DrawProperties draw_properties_; 202 DrawProperties draw_properties_;
195 203
196 // Is used to calculate the content rect from property trees. 204 // Is used to calculate the content rect from property trees.
197 gfx::Rect accumulated_content_rect_; 205 gfx::Rect accumulated_content_rect_;
206 // Is used to decide if the surface is clipped.
207 bool has_contributing_layer_that_escapes_clip_ : 1;
198 bool surface_property_changed_ : 1; 208 bool surface_property_changed_ : 1;
199 bool ancestor_property_changed_ : 1; 209 bool ancestor_property_changed_ : 1;
200 210
201 bool contributes_to_drawn_surface_ : 1; 211 bool contributes_to_drawn_surface_ : 1;
202 212
203 LayerImplList layer_list_; 213 LayerImplList layer_list_;
204 Occlusion occlusion_in_content_space_; 214 Occlusion occlusion_in_content_space_;
205 215
206 // The nearest ancestor target surface that will contain the contents of this 216 // The nearest ancestor target surface that will contain the contents of this
207 // surface, and that ignores outside occlusion. This can point to itself. 217 // surface, and that ignores outside occlusion. This can point to itself.
208 const RenderSurfaceImpl* nearest_occlusion_immune_ancestor_; 218 const RenderSurfaceImpl* nearest_occlusion_immune_ancestor_;
209 219
210 std::unique_ptr<DamageTracker> damage_tracker_; 220 std::unique_ptr<DamageTracker> damage_tracker_;
211 221
212 // For LayerIteratorActions 222 // For LayerIteratorActions
213 int target_render_surface_layer_index_history_; 223 int target_render_surface_layer_index_history_;
214 size_t current_layer_index_history_; 224 size_t current_layer_index_history_;
215 225
216 friend class LayerIterator; 226 friend class LayerIterator;
217 227
218 DISALLOW_COPY_AND_ASSIGN(RenderSurfaceImpl); 228 DISALLOW_COPY_AND_ASSIGN(RenderSurfaceImpl);
219 }; 229 };
220 230
221 } // namespace cc 231 } // namespace cc
222 #endif // CC_LAYERS_RENDER_SURFACE_IMPL_H_ 232 #endif // CC_LAYERS_RENDER_SURFACE_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698