Chromium Code Reviews| 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 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 211 virtual ScrollbarLayerImplBase* ToScrollbarLayer(); | 211 virtual ScrollbarLayerImplBase* ToScrollbarLayer(); |
| 212 | 212 |
| 213 // Returns true if this layer has content to draw. | 213 // Returns true if this layer has content to draw. |
| 214 void SetDrawsContent(bool draws_content); | 214 void SetDrawsContent(bool draws_content); |
| 215 bool DrawsContent() const { return draws_content_; } | 215 bool DrawsContent() const { return draws_content_; } |
| 216 | 216 |
| 217 int NumDescendantsThatDrawContent() const; | 217 int NumDescendantsThatDrawContent() const; |
| 218 void SetHideLayerAndSubtree(bool hide); | 218 void SetHideLayerAndSubtree(bool hide); |
| 219 bool hide_layer_and_subtree() const { return hide_layer_and_subtree_; } | 219 bool hide_layer_and_subtree() const { return hide_layer_and_subtree_; } |
| 220 | 220 |
| 221 bool force_render_surface() const { return force_render_surface_; } | |
| 222 void SetForceRenderSurface(bool force) { force_render_surface_ = force; } | |
| 223 | |
| 224 void SetTransformOrigin(const gfx::Point3F& transform_origin); | 221 void SetTransformOrigin(const gfx::Point3F& transform_origin); |
| 225 gfx::Point3F transform_origin() const { return transform_origin_; } | 222 gfx::Point3F transform_origin() const { return transform_origin_; } |
| 226 | 223 |
| 227 void SetBackgroundColor(SkColor background_color); | 224 void SetBackgroundColor(SkColor background_color); |
| 228 SkColor background_color() const { return background_color_; } | 225 SkColor background_color() const { return background_color_; } |
| 229 // If contents_opaque(), return an opaque color else return a | 226 // If contents_opaque(), return an opaque color else return a |
| 230 // non-opaque color. Tries to return background_color(), if possible. | 227 // non-opaque color. Tries to return background_color(), if possible. |
| 231 SkColor SafeOpaqueBackgroundColor() const; | 228 SkColor SafeOpaqueBackgroundColor() const; |
| 232 | 229 |
| 233 void SetFilters(const FilterOperations& filters); | 230 void SetFilters(const FilterOperations& filters); |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 293 bool use_parent_backface_visibility() const { | 290 bool use_parent_backface_visibility() const { |
| 294 return use_parent_backface_visibility_; | 291 return use_parent_backface_visibility_; |
| 295 } | 292 } |
| 296 | 293 |
| 297 bool ShowDebugBorders() const; | 294 bool ShowDebugBorders() const; |
| 298 | 295 |
| 299 // These invalidate the host's render surface layer list. The caller | 296 // These invalidate the host's render surface layer list. The caller |
| 300 // is responsible for calling set_needs_update_draw_properties on the tree | 297 // is responsible for calling set_needs_update_draw_properties on the tree |
| 301 // so that its list can be recreated. | 298 // so that its list can be recreated. |
| 302 void CreateRenderSurface(); | 299 void CreateRenderSurface(); |
| 303 void ClearRenderSurface(); | 300 void ClearRenderSurface(); |
|
danakj
2014/08/26 18:06:13
Same Q re {Create,Clear} vs SetActive
awoloszyn
2014/08/28 19:31:43
Done.
| |
| 304 void ClearRenderSurfaceLayerList(); | 301 void ClearRenderSurfaceLayerList(); |
| 302 void SetRenderSurfaceActive(bool active); | |
| 303 bool ShouldHaveRenderSurface() { return render_surface_; } | |
| 304 void SetShouldHaveRenderSurface(bool should_have_render_surface); | |
| 305 | 305 |
| 306 DrawProperties<LayerImpl>& draw_properties() { | 306 DrawProperties<LayerImpl>& draw_properties() { |
| 307 return draw_properties_; | 307 return draw_properties_; |
| 308 } | 308 } |
| 309 const DrawProperties<LayerImpl>& draw_properties() const { | 309 const DrawProperties<LayerImpl>& draw_properties() const { |
| 310 return draw_properties_; | 310 return draw_properties_; |
| 311 } | 311 } |
| 312 | 312 |
| 313 // The following are shortcut accessors to get various information from | 313 // The following are shortcut accessors to get various information from |
| 314 // draw_properties_ | 314 // draw_properties_ |
| (...skipping 28 matching lines...) Expand all Loading... | |
| 343 LayerImpl* render_target() { | 343 LayerImpl* render_target() { |
| 344 DCHECK(!draw_properties_.render_target || | 344 DCHECK(!draw_properties_.render_target || |
| 345 draw_properties_.render_target->render_surface()); | 345 draw_properties_.render_target->render_surface()); |
| 346 return draw_properties_.render_target; | 346 return draw_properties_.render_target; |
| 347 } | 347 } |
| 348 const LayerImpl* render_target() const { | 348 const LayerImpl* render_target() const { |
| 349 DCHECK(!draw_properties_.render_target || | 349 DCHECK(!draw_properties_.render_target || |
| 350 draw_properties_.render_target->render_surface()); | 350 draw_properties_.render_target->render_surface()); |
| 351 return draw_properties_.render_target; | 351 return draw_properties_.render_target; |
| 352 } | 352 } |
| 353 RenderSurfaceImpl* render_surface() const { | 353 RenderSurfaceImpl* render_surface() const { return active_render_surface_; } |
| 354 return draw_properties_.render_surface.get(); | |
| 355 } | |
| 356 int num_unclipped_descendants() const { | 354 int num_unclipped_descendants() const { |
| 357 return draw_properties_.num_unclipped_descendants; | 355 return draw_properties_.num_unclipped_descendants; |
| 358 } | 356 } |
| 359 | 357 |
| 360 // The client should be responsible for setting bounds, content bounds and | 358 // The client should be responsible for setting bounds, content bounds and |
| 361 // contents scale to appropriate values. LayerImpl doesn't calculate any of | 359 // contents scale to appropriate values. LayerImpl doesn't calculate any of |
| 362 // them from the other values. | 360 // them from the other values. |
| 363 | 361 |
| 364 void SetBounds(const gfx::Size& bounds); | 362 void SetBounds(const gfx::Size& bounds); |
| 365 gfx::Size bounds() const; | 363 gfx::Size bounds() const; |
| (...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 622 // Tracks if drawing-related properties have changed since last redraw. | 620 // Tracks if drawing-related properties have changed since last redraw. |
| 623 bool layer_property_changed_ : 1; | 621 bool layer_property_changed_ : 1; |
| 624 | 622 |
| 625 bool masks_to_bounds_ : 1; | 623 bool masks_to_bounds_ : 1; |
| 626 bool contents_opaque_ : 1; | 624 bool contents_opaque_ : 1; |
| 627 bool is_root_for_isolated_group_ : 1; | 625 bool is_root_for_isolated_group_ : 1; |
| 628 bool use_parent_backface_visibility_ : 1; | 626 bool use_parent_backface_visibility_ : 1; |
| 629 bool draw_checkerboard_for_missing_tiles_ : 1; | 627 bool draw_checkerboard_for_missing_tiles_ : 1; |
| 630 bool draws_content_ : 1; | 628 bool draws_content_ : 1; |
| 631 bool hide_layer_and_subtree_ : 1; | 629 bool hide_layer_and_subtree_ : 1; |
| 632 bool force_render_surface_ : 1; | |
| 633 | 630 |
| 634 // Cache transform_'s invertibility. | 631 // Cache transform_'s invertibility. |
| 635 bool transform_is_invertible_ : 1; | 632 bool transform_is_invertible_ : 1; |
| 636 | 633 |
| 637 // Set for the layer that other layers are fixed to. | 634 // Set for the layer that other layers are fixed to. |
| 638 bool is_container_for_fixed_position_layers_ : 1; | 635 bool is_container_for_fixed_position_layers_ : 1; |
| 639 Region non_fast_scrollable_region_; | 636 Region non_fast_scrollable_region_; |
| 640 Region touch_event_handler_region_; | 637 Region touch_event_handler_region_; |
| 641 SkColor background_color_; | 638 SkColor background_color_; |
| 642 | 639 |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 696 | 693 |
| 697 scoped_ptr<ScrollbarSet> scrollbars_; | 694 scoped_ptr<ScrollbarSet> scrollbars_; |
| 698 | 695 |
| 699 ScopedPtrVector<CopyOutputRequest> copy_requests_; | 696 ScopedPtrVector<CopyOutputRequest> copy_requests_; |
| 700 | 697 |
| 701 // Group of properties that need to be computed based on the layer tree | 698 // Group of properties that need to be computed based on the layer tree |
| 702 // hierarchy before layers can be drawn. | 699 // hierarchy before layers can be drawn. |
| 703 DrawProperties<LayerImpl> draw_properties_; | 700 DrawProperties<LayerImpl> draw_properties_; |
| 704 | 701 |
| 705 scoped_refptr<base::debug::ConvertableToTraceFormat> debug_info_; | 702 scoped_refptr<base::debug::ConvertableToTraceFormat> debug_info_; |
| 706 | 703 scoped_ptr<RenderSurfaceImpl> render_surface_; |
| 704 RenderSurfaceImpl* active_render_surface_; | |
| 707 DISALLOW_COPY_AND_ASSIGN(LayerImpl); | 705 DISALLOW_COPY_AND_ASSIGN(LayerImpl); |
| 708 }; | 706 }; |
| 709 | 707 |
| 710 } // namespace cc | 708 } // namespace cc |
| 711 | 709 |
| 712 #endif // CC_LAYERS_LAYER_IMPL_H_ | 710 #endif // CC_LAYERS_LAYER_IMPL_H_ |
| OLD | NEW |