| 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 <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 417 void SetMutableProperties(uint32_t properties); | 417 void SetMutableProperties(uint32_t properties); |
| 418 uint32_t mutable_properties() const { return inputs_.mutable_properties; } | 418 uint32_t mutable_properties() const { return inputs_.mutable_properties; } |
| 419 | 419 |
| 420 bool HasTickingAnimationForTesting() const; | 420 bool HasTickingAnimationForTesting() const; |
| 421 | 421 |
| 422 void SetHasWillChangeTransformHint(bool has_will_change); | 422 void SetHasWillChangeTransformHint(bool has_will_change); |
| 423 bool has_will_change_transform_hint() const { | 423 bool has_will_change_transform_hint() const { |
| 424 return inputs_.has_will_change_transform_hint; | 424 return inputs_.has_will_change_transform_hint; |
| 425 } | 425 } |
| 426 | 426 |
| 427 // The preferred raster bounds are the ideal resolution at which to raster the | |
| 428 // contents of this Layer's bitmap. This may not be the same size as the Layer | |
| 429 // bounds, in cases where the contents have an "intrinsic" size that differs. | |
| 430 // Consider for example an image with a given intrinsic size that is being | |
| 431 // scaled into a Layer of a different size. | |
| 432 void SetPreferredRasterBounds(const gfx::Size& preferred_Raster_bounds); | |
| 433 bool has_preferred_raster_bounds() const { | |
| 434 return inputs_.has_preferred_raster_bounds; | |
| 435 } | |
| 436 const gfx::Size& preferred_raster_bounds() const { | |
| 437 return inputs_.preferred_raster_bounds; | |
| 438 } | |
| 439 void ClearPreferredRasterBounds(); | |
| 440 | |
| 441 MutatorHost* GetMutatorHost() const; | 427 MutatorHost* GetMutatorHost() const; |
| 442 | 428 |
| 443 ElementListType GetElementTypeForAnimation() const; | 429 ElementListType GetElementTypeForAnimation() const; |
| 444 | 430 |
| 445 void SetScrollbarsHiddenFromImplSide(bool hidden); | 431 void SetScrollbarsHiddenFromImplSide(bool hidden); |
| 446 | 432 |
| 447 const gfx::Rect& update_rect() const { return inputs_.update_rect; } | 433 const gfx::Rect& update_rect() const { return inputs_.update_rect; } |
| 448 | 434 |
| 449 LayerTreeHost* layer_tree_host() const { return layer_tree_host_; } | 435 LayerTreeHost* layer_tree_host() const { return layer_tree_host_; } |
| 450 | 436 |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 605 LayerStickyPositionConstraint sticky_position_constraint; | 591 LayerStickyPositionConstraint sticky_position_constraint; |
| 606 | 592 |
| 607 ElementId element_id; | 593 ElementId element_id; |
| 608 | 594 |
| 609 uint32_t mutable_properties; | 595 uint32_t mutable_properties; |
| 610 | 596 |
| 611 Layer* scroll_parent; | 597 Layer* scroll_parent; |
| 612 Layer* clip_parent; | 598 Layer* clip_parent; |
| 613 | 599 |
| 614 bool has_will_change_transform_hint : 1; | 600 bool has_will_change_transform_hint : 1; |
| 615 bool has_preferred_raster_bounds : 1; | |
| 616 | 601 |
| 617 bool hide_layer_and_subtree : 1; | 602 bool hide_layer_and_subtree : 1; |
| 618 | 603 |
| 619 // The following elements can not and are not serialized. | 604 // The following elements can not and are not serialized. |
| 620 LayerClient* client; | 605 LayerClient* client; |
| 621 base::Callback<void(const gfx::ScrollOffset&)> did_scroll_callback; | 606 base::Callback<void(const gfx::ScrollOffset&)> did_scroll_callback; |
| 622 std::vector<std::unique_ptr<CopyOutputRequest>> copy_requests; | 607 std::vector<std::unique_ptr<CopyOutputRequest>> copy_requests; |
| 623 | |
| 624 gfx::Size preferred_raster_bounds; | |
| 625 }; | 608 }; |
| 626 | 609 |
| 627 Layer* parent_; | 610 Layer* parent_; |
| 628 | 611 |
| 629 // Layer instances have a weak pointer to their LayerTreeHost. | 612 // Layer instances have a weak pointer to their LayerTreeHost. |
| 630 // This pointer value is nil when a Layer is not in a tree and is | 613 // This pointer value is nil when a Layer is not in a tree and is |
| 631 // updated via SetLayerTreeHost() if a layer moves between trees. | 614 // updated via SetLayerTreeHost() if a layer moves between trees. |
| 632 LayerTreeHost* layer_tree_host_; | 615 LayerTreeHost* layer_tree_host_; |
| 633 | 616 |
| 634 Inputs inputs_; | 617 Inputs inputs_; |
| (...skipping 25 matching lines...) Expand all Loading... |
| 660 // These all act like draw properties, so don't need push properties. | 643 // These all act like draw properties, so don't need push properties. |
| 661 gfx::Rect visible_layer_rect_; | 644 gfx::Rect visible_layer_rect_; |
| 662 size_t num_unclipped_descendants_; | 645 size_t num_unclipped_descendants_; |
| 663 | 646 |
| 664 DISALLOW_COPY_AND_ASSIGN(Layer); | 647 DISALLOW_COPY_AND_ASSIGN(Layer); |
| 665 }; | 648 }; |
| 666 | 649 |
| 667 } // namespace cc | 650 } // namespace cc |
| 668 | 651 |
| 669 #endif // CC_LAYERS_LAYER_H_ | 652 #endif // CC_LAYERS_LAYER_H_ |
| OLD | NEW |