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

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

Issue 1902893002: cc: Move calculation of content rect to RenderSurfaceImpl class (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@targetid
Patch Set: fix error Created 4 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
« no previous file with comments | « no previous file | 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 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 // RenderSurface that is being drawn for the current frame. It could still be 110 // RenderSurface that is being drawn for the current frame. It could still be
111 // drawn to as a target, but its output will not be a part of any other 111 // drawn to as a target, but its output will not be a part of any other
112 // surface. 112 // surface.
113 bool contributes_to_drawn_surface() const { 113 bool contributes_to_drawn_surface() const {
114 return contributes_to_drawn_surface_; 114 return contributes_to_drawn_surface_;
115 } 115 }
116 void set_contributes_to_drawn_surface(bool contributes_to_drawn_surface) { 116 void set_contributes_to_drawn_surface(bool contributes_to_drawn_surface) {
117 contributes_to_drawn_surface_ = contributes_to_drawn_surface; 117 contributes_to_drawn_surface_ = contributes_to_drawn_surface;
118 } 118 }
119 119
120 void SetContentRect(const gfx::Rect& content_rect); 120 void CalculateContentRectFromAccumulatedContentRect(int max_texture_size);
121 void SetContentRectToViewport();
122 void SetContentRectForTesting(const gfx::Rect& rect);
121 gfx::Rect content_rect() const { return draw_properties_.content_rect; } 123 gfx::Rect content_rect() const { return draw_properties_.content_rect; }
122 124
123 void ClearAccumulatedContentRect(); 125 void ClearAccumulatedContentRect();
124 void AccumulateContentRectFromContributingLayer( 126 void AccumulateContentRectFromContributingLayer(
125 LayerImpl* contributing_layer); 127 LayerImpl* contributing_layer);
126 void AccumulateContentRectFromContributingRenderSurface( 128 void AccumulateContentRectFromContributingRenderSurface(
127 RenderSurfaceImpl* contributing_surface); 129 RenderSurfaceImpl* contributing_surface);
128 130
129 gfx::Rect accumulated_content_rect() const { 131 gfx::Rect accumulated_content_rect() const {
130 return accumulated_content_rect_; 132 return accumulated_content_rect_;
(...skipping 29 matching lines...) Expand all
160 float debug_border_width, 162 float debug_border_width,
161 LayerImpl* mask_layer, 163 LayerImpl* mask_layer,
162 AppendQuadsData* append_quads_data, 164 AppendQuadsData* append_quads_data,
163 RenderPassId render_pass_id); 165 RenderPassId render_pass_id);
164 166
165 int TransformTreeIndex() const; 167 int TransformTreeIndex() const;
166 int ClipTreeIndex() const; 168 int ClipTreeIndex() const;
167 int EffectTreeIndex() const; 169 int EffectTreeIndex() const;
168 170
169 private: 171 private:
172 void SetContentRect(const gfx::Rect& content_rect);
173 gfx::Rect CalculateClippedAccumulatedContentRect();
174
170 LayerImpl* owning_layer_; 175 LayerImpl* owning_layer_;
171 176
172 // Container for properties that render surfaces need to compute before they 177 // Container for properties that render surfaces need to compute before they
173 // can be drawn. 178 // can be drawn.
174 struct DrawProperties { 179 struct DrawProperties {
175 DrawProperties(); 180 DrawProperties();
176 ~DrawProperties(); 181 ~DrawProperties();
177 182
178 float draw_opacity; 183 float draw_opacity;
179 184
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 int target_render_surface_layer_index_history_; 224 int target_render_surface_layer_index_history_;
220 size_t current_layer_index_history_; 225 size_t current_layer_index_history_;
221 226
222 friend class LayerIterator; 227 friend class LayerIterator;
223 228
224 DISALLOW_COPY_AND_ASSIGN(RenderSurfaceImpl); 229 DISALLOW_COPY_AND_ASSIGN(RenderSurfaceImpl);
225 }; 230 };
226 231
227 } // namespace cc 232 } // namespace cc
228 #endif // CC_LAYERS_RENDER_SURFACE_IMPL_H_ 233 #endif // CC_LAYERS_RENDER_SURFACE_IMPL_H_
OLDNEW
« no previous file with comments | « no previous file | cc/layers/render_surface_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698