| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| 170 LayerImpl* owning_layer_; | 174 LayerImpl* owning_layer_; |
| 171 | 175 |
| 172 // Container for properties that render surfaces need to compute before they | 176 // Container for properties that render surfaces need to compute before they |
| 173 // can be drawn. | 177 // can be drawn. |
| 174 struct DrawProperties { | 178 struct DrawProperties { |
| 175 DrawProperties(); | 179 DrawProperties(); |
| 176 ~DrawProperties(); | 180 ~DrawProperties(); |
| 177 | 181 |
| 178 float draw_opacity; | 182 float draw_opacity; |
| 179 | 183 |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 219 int target_render_surface_layer_index_history_; | 223 int target_render_surface_layer_index_history_; |
| 220 size_t current_layer_index_history_; | 224 size_t current_layer_index_history_; |
| 221 | 225 |
| 222 friend class LayerIterator; | 226 friend class LayerIterator; |
| 223 | 227 |
| 224 DISALLOW_COPY_AND_ASSIGN(RenderSurfaceImpl); | 228 DISALLOW_COPY_AND_ASSIGN(RenderSurfaceImpl); |
| 225 }; | 229 }; |
| 226 | 230 |
| 227 } // namespace cc | 231 } // namespace cc |
| 228 #endif // CC_LAYERS_RENDER_SURFACE_IMPL_H_ | 232 #endif // CC_LAYERS_RENDER_SURFACE_IMPL_H_ |
| OLD | NEW |