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 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
215 virtual ScrollbarLayerImplBase* ToScrollbarLayer(); | 215 virtual ScrollbarLayerImplBase* ToScrollbarLayer(); |
216 | 216 |
217 // Returns true if this layer has content to draw. | 217 // Returns true if this layer has content to draw. |
218 void SetDrawsContent(bool draws_content); | 218 void SetDrawsContent(bool draws_content); |
219 bool DrawsContent() const { return draws_content_; } | 219 bool DrawsContent() const { return draws_content_; } |
220 | 220 |
221 int NumDescendantsThatDrawContent() const; | 221 int NumDescendantsThatDrawContent() const; |
222 void SetHideLayerAndSubtree(bool hide); | 222 void SetHideLayerAndSubtree(bool hide); |
223 bool hide_layer_and_subtree() const { return hide_layer_and_subtree_; } | 223 bool hide_layer_and_subtree() const { return hide_layer_and_subtree_; } |
224 | 224 |
225 bool force_render_surface() const { return force_render_surface_; } | |
226 void SetForceRenderSurface(bool force) { force_render_surface_ = force; } | |
227 | |
228 void SetTransformOrigin(const gfx::Point3F& transform_origin); | 225 void SetTransformOrigin(const gfx::Point3F& transform_origin); |
229 gfx::Point3F transform_origin() const { return transform_origin_; } | 226 gfx::Point3F transform_origin() const { return transform_origin_; } |
230 | 227 |
231 void SetBackgroundColor(SkColor background_color); | 228 void SetBackgroundColor(SkColor background_color); |
232 SkColor background_color() const { return background_color_; } | 229 SkColor background_color() const { return background_color_; } |
233 // If contents_opaque(), return an opaque color else return a | 230 // If contents_opaque(), return an opaque color else return a |
234 // non-opaque color. Tries to return background_color(), if possible. | 231 // non-opaque color. Tries to return background_color(), if possible. |
235 SkColor SafeOpaqueBackgroundColor() const; | 232 SkColor SafeOpaqueBackgroundColor() const; |
236 | 233 |
237 void SetFilters(const FilterOperations& filters); | 234 void SetFilters(const FilterOperations& filters); |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
296 } | 293 } |
297 bool use_parent_backface_visibility() const { | 294 bool use_parent_backface_visibility() const { |
298 return use_parent_backface_visibility_; | 295 return use_parent_backface_visibility_; |
299 } | 296 } |
300 | 297 |
301 bool ShowDebugBorders() const; | 298 bool ShowDebugBorders() const; |
302 | 299 |
303 // These invalidate the host's render surface layer list. The caller | 300 // These invalidate the host's render surface layer list. The caller |
304 // is responsible for calling set_needs_update_draw_properties on the tree | 301 // is responsible for calling set_needs_update_draw_properties on the tree |
305 // so that its list can be recreated. | 302 // so that its list can be recreated. |
306 void CreateRenderSurface(); | |
307 void ClearRenderSurface(); | |
308 void ClearRenderSurfaceLayerList(); | 303 void ClearRenderSurfaceLayerList(); |
| 304 void SetHasRenderSurface(bool has_render_surface); |
| 305 |
| 306 RenderSurfaceImpl* render_surface() const { return render_surface_.get(); } |
309 | 307 |
310 DrawProperties<LayerImpl>& draw_properties() { | 308 DrawProperties<LayerImpl>& draw_properties() { |
311 return draw_properties_; | 309 return draw_properties_; |
312 } | 310 } |
313 const DrawProperties<LayerImpl>& draw_properties() const { | 311 const DrawProperties<LayerImpl>& draw_properties() const { |
314 return draw_properties_; | 312 return draw_properties_; |
315 } | 313 } |
316 | 314 |
317 // The following are shortcut accessors to get various information from | 315 // The following are shortcut accessors to get various information from |
318 // draw_properties_ | 316 // draw_properties_ |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
350 LayerImpl* render_target() { | 348 LayerImpl* render_target() { |
351 DCHECK(!draw_properties_.render_target || | 349 DCHECK(!draw_properties_.render_target || |
352 draw_properties_.render_target->render_surface()); | 350 draw_properties_.render_target->render_surface()); |
353 return draw_properties_.render_target; | 351 return draw_properties_.render_target; |
354 } | 352 } |
355 const LayerImpl* render_target() const { | 353 const LayerImpl* render_target() const { |
356 DCHECK(!draw_properties_.render_target || | 354 DCHECK(!draw_properties_.render_target || |
357 draw_properties_.render_target->render_surface()); | 355 draw_properties_.render_target->render_surface()); |
358 return draw_properties_.render_target; | 356 return draw_properties_.render_target; |
359 } | 357 } |
360 RenderSurfaceImpl* render_surface() const { | 358 |
361 return draw_properties_.render_surface.get(); | |
362 } | |
363 int num_unclipped_descendants() const { | 359 int num_unclipped_descendants() const { |
364 return draw_properties_.num_unclipped_descendants; | 360 return draw_properties_.num_unclipped_descendants; |
365 } | 361 } |
366 | 362 |
367 // The client should be responsible for setting bounds, content bounds and | 363 // The client should be responsible for setting bounds, content bounds and |
368 // contents scale to appropriate values. LayerImpl doesn't calculate any of | 364 // contents scale to appropriate values. LayerImpl doesn't calculate any of |
369 // them from the other values. | 365 // them from the other values. |
370 | 366 |
371 void SetBounds(const gfx::Size& bounds); | 367 void SetBounds(const gfx::Size& bounds); |
372 gfx::Size bounds() const; | 368 gfx::Size bounds() const; |
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
640 // Tracks if drawing-related properties have changed since last redraw. | 636 // Tracks if drawing-related properties have changed since last redraw. |
641 bool layer_property_changed_ : 1; | 637 bool layer_property_changed_ : 1; |
642 | 638 |
643 bool masks_to_bounds_ : 1; | 639 bool masks_to_bounds_ : 1; |
644 bool contents_opaque_ : 1; | 640 bool contents_opaque_ : 1; |
645 bool is_root_for_isolated_group_ : 1; | 641 bool is_root_for_isolated_group_ : 1; |
646 bool use_parent_backface_visibility_ : 1; | 642 bool use_parent_backface_visibility_ : 1; |
647 bool draw_checkerboard_for_missing_tiles_ : 1; | 643 bool draw_checkerboard_for_missing_tiles_ : 1; |
648 bool draws_content_ : 1; | 644 bool draws_content_ : 1; |
649 bool hide_layer_and_subtree_ : 1; | 645 bool hide_layer_and_subtree_ : 1; |
650 bool force_render_surface_ : 1; | |
651 | 646 |
652 // Cache transform_'s invertibility. | 647 // Cache transform_'s invertibility. |
653 bool transform_is_invertible_ : 1; | 648 bool transform_is_invertible_ : 1; |
654 | 649 |
655 // Set for the layer that other layers are fixed to. | 650 // Set for the layer that other layers are fixed to. |
656 bool is_container_for_fixed_position_layers_ : 1; | 651 bool is_container_for_fixed_position_layers_ : 1; |
657 Region non_fast_scrollable_region_; | 652 Region non_fast_scrollable_region_; |
658 Region touch_event_handler_region_; | 653 Region touch_event_handler_region_; |
659 SkColor background_color_; | 654 SkColor background_color_; |
660 | 655 |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
714 | 709 |
715 scoped_ptr<ScrollbarSet> scrollbars_; | 710 scoped_ptr<ScrollbarSet> scrollbars_; |
716 | 711 |
717 ScopedPtrVector<CopyOutputRequest> copy_requests_; | 712 ScopedPtrVector<CopyOutputRequest> copy_requests_; |
718 | 713 |
719 // Group of properties that need to be computed based on the layer tree | 714 // Group of properties that need to be computed based on the layer tree |
720 // hierarchy before layers can be drawn. | 715 // hierarchy before layers can be drawn. |
721 DrawProperties<LayerImpl> draw_properties_; | 716 DrawProperties<LayerImpl> draw_properties_; |
722 | 717 |
723 scoped_refptr<base::debug::ConvertableToTraceFormat> debug_info_; | 718 scoped_refptr<base::debug::ConvertableToTraceFormat> debug_info_; |
724 | 719 scoped_ptr<RenderSurfaceImpl> render_surface_; |
725 DISALLOW_COPY_AND_ASSIGN(LayerImpl); | 720 DISALLOW_COPY_AND_ASSIGN(LayerImpl); |
726 }; | 721 }; |
727 | 722 |
728 } // namespace cc | 723 } // namespace cc |
729 | 724 |
730 #endif // CC_LAYERS_LAYER_IMPL_H_ | 725 #endif // CC_LAYERS_LAYER_IMPL_H_ |
OLD | NEW |