| 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_LAYER_IMPL_H_ | 5 #ifndef CC_LAYERS_LAYER_IMPL_H_ |
| 6 #define CC_LAYERS_LAYER_IMPL_H_ | 6 #define CC_LAYERS_LAYER_IMPL_H_ |
| 7 | 7 |
| 8 #include <set> | 8 #include <set> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 293 } | 293 } |
| 294 | 294 |
| 295 bool ShowDebugBorders() const; | 295 bool ShowDebugBorders() const; |
| 296 | 296 |
| 297 // These invalidate the host's render surface layer list. The caller | 297 // These invalidate the host's render surface layer list. The caller |
| 298 // is responsible for calling set_needs_update_draw_properties on the tree | 298 // is responsible for calling set_needs_update_draw_properties on the tree |
| 299 // so that its list can be recreated. | 299 // so that its list can be recreated. |
| 300 void CreateRenderSurface(); | 300 void CreateRenderSurface(); |
| 301 void ClearRenderSurface(); | 301 void ClearRenderSurface(); |
| 302 void ClearRenderSurfaceLayerList(); | 302 void ClearRenderSurfaceLayerList(); |
| 303 void SetRenderSurfaceActive(bool active); |
| 304 bool ShouldHaveRenderSurface() { return (render_surface_); } |
| 305 void SetShouldHaveRenderSurface(bool should_have_render_surface); |
| 303 | 306 |
| 304 DrawProperties<LayerImpl>& draw_properties() { | 307 DrawProperties<LayerImpl>& draw_properties() { |
| 305 return draw_properties_; | 308 return draw_properties_; |
| 306 } | 309 } |
| 307 const DrawProperties<LayerImpl>& draw_properties() const { | 310 const DrawProperties<LayerImpl>& draw_properties() const { |
| 308 return draw_properties_; | 311 return draw_properties_; |
| 309 } | 312 } |
| 310 | 313 |
| 311 // The following are shortcut accessors to get various information from | 314 // The following are shortcut accessors to get various information from |
| 312 // draw_properties_ | 315 // draw_properties_ |
| (...skipping 28 matching lines...) Expand all Loading... |
| 341 LayerImpl* render_target() { | 344 LayerImpl* render_target() { |
| 342 DCHECK(!draw_properties_.render_target || | 345 DCHECK(!draw_properties_.render_target || |
| 343 draw_properties_.render_target->render_surface()); | 346 draw_properties_.render_target->render_surface()); |
| 344 return draw_properties_.render_target; | 347 return draw_properties_.render_target; |
| 345 } | 348 } |
| 346 const LayerImpl* render_target() const { | 349 const LayerImpl* render_target() const { |
| 347 DCHECK(!draw_properties_.render_target || | 350 DCHECK(!draw_properties_.render_target || |
| 348 draw_properties_.render_target->render_surface()); | 351 draw_properties_.render_target->render_surface()); |
| 349 return draw_properties_.render_target; | 352 return draw_properties_.render_target; |
| 350 } | 353 } |
| 351 RenderSurfaceImpl* render_surface() const { | 354 RenderSurfaceImpl* render_surface() const { return active_render_surface_; } |
| 352 return draw_properties_.render_surface.get(); | |
| 353 } | |
| 354 int num_unclipped_descendants() const { | 355 int num_unclipped_descendants() const { |
| 355 return draw_properties_.num_unclipped_descendants; | 356 return draw_properties_.num_unclipped_descendants; |
| 356 } | 357 } |
| 357 | 358 |
| 358 // The client should be responsible for setting bounds, content bounds and | 359 // The client should be responsible for setting bounds, content bounds and |
| 359 // contents scale to appropriate values. LayerImpl doesn't calculate any of | 360 // contents scale to appropriate values. LayerImpl doesn't calculate any of |
| 360 // them from the other values. | 361 // them from the other values. |
| 361 | 362 |
| 362 void SetBounds(const gfx::Size& bounds); | 363 void SetBounds(const gfx::Size& bounds); |
| 363 void SetTemporaryImplBounds(const gfx::SizeF& bounds); | 364 void SetTemporaryImplBounds(const gfx::SizeF& bounds); |
| (...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 697 | 698 |
| 698 scoped_ptr<ScrollbarSet> scrollbars_; | 699 scoped_ptr<ScrollbarSet> scrollbars_; |
| 699 | 700 |
| 700 ScopedPtrVector<CopyOutputRequest> copy_requests_; | 701 ScopedPtrVector<CopyOutputRequest> copy_requests_; |
| 701 | 702 |
| 702 // Group of properties that need to be computed based on the layer tree | 703 // Group of properties that need to be computed based on the layer tree |
| 703 // hierarchy before layers can be drawn. | 704 // hierarchy before layers can be drawn. |
| 704 DrawProperties<LayerImpl> draw_properties_; | 705 DrawProperties<LayerImpl> draw_properties_; |
| 705 | 706 |
| 706 scoped_refptr<base::debug::ConvertableToTraceFormat> debug_info_; | 707 scoped_refptr<base::debug::ConvertableToTraceFormat> debug_info_; |
| 707 | 708 scoped_ptr<RenderSurfaceImpl> render_surface_; |
| 709 RenderSurfaceImpl* active_render_surface_; |
| 708 DISALLOW_COPY_AND_ASSIGN(LayerImpl); | 710 DISALLOW_COPY_AND_ASSIGN(LayerImpl); |
| 709 }; | 711 }; |
| 710 | 712 |
| 711 } // namespace cc | 713 } // namespace cc |
| 712 | 714 |
| 713 #endif // CC_LAYERS_LAYER_IMPL_H_ | 715 #endif // CC_LAYERS_LAYER_IMPL_H_ |
| OLD | NEW |