Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2010 The Chromium Authors. All rights reserved. | 1 // Copyright 2010 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_H_ | 5 #ifndef CC_LAYERS_LAYER_H_ |
| 6 #define CC_LAYERS_LAYER_H_ | 6 #define CC_LAYERS_LAYER_H_ |
| 7 | 7 |
| 8 #include <set> | 8 #include <set> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 313 // Floating point to match the LayerImpl version. | 313 // Floating point to match the LayerImpl version. |
| 314 return scroll_offset() + ScrollDelta(); | 314 return scroll_offset() + ScrollDelta(); |
| 315 } | 315 } |
| 316 | 316 |
| 317 void SetDoubleSided(bool double_sided); | 317 void SetDoubleSided(bool double_sided); |
| 318 bool double_sided() const { return double_sided_; } | 318 bool double_sided() const { return double_sided_; } |
| 319 | 319 |
| 320 void SetShouldFlattenTransform(bool flatten); | 320 void SetShouldFlattenTransform(bool flatten); |
| 321 bool should_flatten_transform() const { return should_flatten_transform_; } | 321 bool should_flatten_transform() const { return should_flatten_transform_; } |
| 322 | 322 |
| 323 void SetIs3dSorted(bool sorted); | 323 bool Is3dSorted() const { return sorting_context_id_ != 0; } |
| 324 bool is_3d_sorted() const { return is_3d_sorted_; } | |
| 325 | 324 |
| 326 void set_use_parent_backface_visibility(bool use) { | 325 void set_use_parent_backface_visibility(bool use) { |
| 327 use_parent_backface_visibility_ = use; | 326 use_parent_backface_visibility_ = use; |
| 328 } | 327 } |
| 329 bool use_parent_backface_visibility() const { | 328 bool use_parent_backface_visibility() const { |
| 330 return use_parent_backface_visibility_; | 329 return use_parent_backface_visibility_; |
| 331 } | 330 } |
| 332 | 331 |
| 333 virtual void SetLayerTreeHost(LayerTreeHost* host); | 332 virtual void SetLayerTreeHost(LayerTreeHost* host); |
| 334 | 333 |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 451 bool needs_push_properties() const { return needs_push_properties_; } | 450 bool needs_push_properties() const { return needs_push_properties_; } |
| 452 bool descendant_needs_push_properties() const { | 451 bool descendant_needs_push_properties() const { |
| 453 return num_dependents_need_push_properties_ > 0; | 452 return num_dependents_need_push_properties_ > 0; |
| 454 } | 453 } |
| 455 void reset_needs_push_properties_for_testing() { | 454 void reset_needs_push_properties_for_testing() { |
| 456 needs_push_properties_ = false; | 455 needs_push_properties_ = false; |
| 457 } | 456 } |
| 458 | 457 |
| 459 virtual void RunMicroBenchmark(MicroBenchmark* benchmark); | 458 virtual void RunMicroBenchmark(MicroBenchmark* benchmark); |
| 460 | 459 |
| 460 void Set3dSortingContextId(int id); | |
| 461 int sorting_context_id() const { return sorting_context_id_; } | |
| 462 | |
| 461 protected: | 463 protected: |
| 462 friend class LayerImpl; | 464 friend class LayerImpl; |
| 463 friend class TreeSynchronizer; | 465 friend class TreeSynchronizer; |
| 464 virtual ~Layer(); | 466 virtual ~Layer(); |
| 465 | 467 |
| 466 Layer(); | 468 Layer(); |
| 467 | 469 |
| 468 // These SetNeeds functions are in order of severity of update: | 470 // These SetNeeds functions are in order of severity of update: |
| 469 // | 471 // |
| 470 // Called when this layer has been modified in some way, but isn't sure | 472 // Called when this layer has been modified in some way, but isn't sure |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 523 gfx::RectF update_rect_; | 525 gfx::RectF update_rect_; |
| 524 | 526 |
| 525 scoped_refptr<Layer> mask_layer_; | 527 scoped_refptr<Layer> mask_layer_; |
| 526 | 528 |
| 527 int layer_id_; | 529 int layer_id_; |
| 528 | 530 |
| 529 // When true, the layer is about to perform an update. Any commit requests | 531 // When true, the layer is about to perform an update. Any commit requests |
| 530 // will be handled implicitly after the update completes. | 532 // will be handled implicitly after the update completes. |
| 531 bool ignore_set_needs_commit_; | 533 bool ignore_set_needs_commit_; |
| 532 | 534 |
| 535 // The rendering context ID, necessary for properly sorting 3D layers. | |
|
enne (OOO)
2014/06/17 00:46:04
This comment is also not that helpful. Maybe some
troyhildebrandt
2014/06/17 16:33:20
Done.
| |
| 536 int sorting_context_id_; | |
| 537 | |
| 533 private: | 538 private: |
| 534 friend class base::RefCounted<Layer>; | 539 friend class base::RefCounted<Layer>; |
| 535 | 540 |
| 536 void SetParent(Layer* layer); | 541 void SetParent(Layer* layer); |
| 537 bool DescendantIsFixedToContainerLayer() const; | 542 bool DescendantIsFixedToContainerLayer() const; |
| 538 | 543 |
| 539 // Returns the index of the child or -1 if not found. | 544 // Returns the index of the child or -1 if not found. |
| 540 int IndexOfChild(const Layer* reference); | 545 int IndexOfChild(const Layer* reference); |
| 541 | 546 |
| 542 // This should only be called from RemoveFromParent(). | 547 // This should only be called from RemoveFromParent(). |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 581 bool is_container_for_fixed_position_layers_ : 1; | 586 bool is_container_for_fixed_position_layers_ : 1; |
| 582 bool is_drawable_ : 1; | 587 bool is_drawable_ : 1; |
| 583 bool hide_layer_and_subtree_ : 1; | 588 bool hide_layer_and_subtree_ : 1; |
| 584 bool masks_to_bounds_ : 1; | 589 bool masks_to_bounds_ : 1; |
| 585 bool contents_opaque_ : 1; | 590 bool contents_opaque_ : 1; |
| 586 bool double_sided_ : 1; | 591 bool double_sided_ : 1; |
| 587 bool should_flatten_transform_ : 1; | 592 bool should_flatten_transform_ : 1; |
| 588 bool use_parent_backface_visibility_ : 1; | 593 bool use_parent_backface_visibility_ : 1; |
| 589 bool draw_checkerboard_for_missing_tiles_ : 1; | 594 bool draw_checkerboard_for_missing_tiles_ : 1; |
| 590 bool force_render_surface_ : 1; | 595 bool force_render_surface_ : 1; |
| 591 bool is_3d_sorted_ : 1; | |
| 592 bool transform_is_invertible_ : 1; | 596 bool transform_is_invertible_ : 1; |
| 593 Region non_fast_scrollable_region_; | 597 Region non_fast_scrollable_region_; |
| 594 Region touch_event_handler_region_; | 598 Region touch_event_handler_region_; |
| 595 gfx::PointF position_; | 599 gfx::PointF position_; |
| 596 SkColor background_color_; | 600 SkColor background_color_; |
| 597 float opacity_; | 601 float opacity_; |
| 598 SkXfermode::Mode blend_mode_; | 602 SkXfermode::Mode blend_mode_; |
| 599 FilterOperations filters_; | 603 FilterOperations filters_; |
| 600 FilterOperations background_filters_; | 604 FilterOperations background_filters_; |
| 601 LayerPositionConstraint position_constraint_; | 605 LayerPositionConstraint position_constraint_; |
| (...skipping 21 matching lines...) Expand all Loading... | |
| 623 DrawProperties<Layer> draw_properties_; | 627 DrawProperties<Layer> draw_properties_; |
| 624 | 628 |
| 625 PaintProperties paint_properties_; | 629 PaintProperties paint_properties_; |
| 626 | 630 |
| 627 DISALLOW_COPY_AND_ASSIGN(Layer); | 631 DISALLOW_COPY_AND_ASSIGN(Layer); |
| 628 }; | 632 }; |
| 629 | 633 |
| 630 } // namespace cc | 634 } // namespace cc |
| 631 | 635 |
| 632 #endif // CC_LAYERS_LAYER_H_ | 636 #endif // CC_LAYERS_LAYER_H_ |
| OLD | NEW |