| 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 460 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 471 void SetMutableProperties(uint32_t properties); | 471 void SetMutableProperties(uint32_t properties); |
| 472 uint32_t mutable_properties() const { return inputs_.mutable_properties; } | 472 uint32_t mutable_properties() const { return inputs_.mutable_properties; } |
| 473 | 473 |
| 474 bool HasActiveAnimationForTesting() const; | 474 bool HasActiveAnimationForTesting() const; |
| 475 | 475 |
| 476 void SetHasWillChangeTransformHint(bool has_will_change); | 476 void SetHasWillChangeTransformHint(bool has_will_change); |
| 477 bool has_will_change_transform_hint() const { | 477 bool has_will_change_transform_hint() const { |
| 478 return inputs_.has_will_change_transform_hint; | 478 return inputs_.has_will_change_transform_hint; |
| 479 } | 479 } |
| 480 | 480 |
| 481 void SetPreferredRasterScale(float preferred_raster_scale); | 481 // The preferred raster bounds are the ideal resolution at which to raster the |
| 482 bool has_preferred_raster_scale() { | 482 // contents of this Layer's bitmap. This may not be the same size as the Layer |
| 483 return inputs_.has_preferred_raster_scale; | 483 // bounds, in cases where the contents have an "intrinsic" size that differs. |
| 484 // Consider for example an image with a given intrinsic size that is being |
| 485 // scaled into a Layer of a different size. |
| 486 void SetPreferredRasterBounds(const gfx::Size& preferred_Raster_bounds); |
| 487 bool has_preferred_raster_bounds() const { |
| 488 return inputs_.has_preferred_raster_bounds; |
| 484 } | 489 } |
| 485 float preferred_raster_scale() const { | 490 const gfx::Size& preferred_raster_bounds() const { |
| 486 return inputs_.preferred_raster_scale; | 491 return inputs_.preferred_raster_bounds; |
| 487 } | 492 } |
| 488 void ClearPreferredRasterScale(); | 493 void ClearPreferredRasterBounds(); |
| 489 | 494 |
| 490 AnimationHost* GetAnimationHost() const; | 495 AnimationHost* GetAnimationHost() const; |
| 491 | 496 |
| 492 ElementListType GetElementTypeForAnimation() const; | 497 ElementListType GetElementTypeForAnimation() const; |
| 493 | 498 |
| 494 // Tests in remote mode need to explicitly set the layer id so it matches the | 499 // Tests in remote mode need to explicitly set the layer id so it matches the |
| 495 // layer id for the corresponding Layer on the engine. | 500 // layer id for the corresponding Layer on the engine. |
| 496 void SetLayerIdForTesting(int id); | 501 void SetLayerIdForTesting(int id); |
| 497 | 502 |
| 498 protected: | 503 protected: |
| (...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 673 LayerStickyPositionConstraint sticky_position_constraint; | 678 LayerStickyPositionConstraint sticky_position_constraint; |
| 674 | 679 |
| 675 ElementId element_id; | 680 ElementId element_id; |
| 676 | 681 |
| 677 uint32_t mutable_properties; | 682 uint32_t mutable_properties; |
| 678 | 683 |
| 679 Layer* scroll_parent; | 684 Layer* scroll_parent; |
| 680 Layer* clip_parent; | 685 Layer* clip_parent; |
| 681 | 686 |
| 682 bool has_will_change_transform_hint : 1; | 687 bool has_will_change_transform_hint : 1; |
| 683 bool has_preferred_raster_scale : 1; | 688 bool has_preferred_raster_bounds : 1; |
| 684 | 689 |
| 685 bool hide_layer_and_subtree : 1; | 690 bool hide_layer_and_subtree : 1; |
| 686 | 691 |
| 687 // The following elements can not and are not serialized. | 692 // The following elements can not and are not serialized. |
| 688 LayerClient* client; | 693 LayerClient* client; |
| 689 base::Closure did_scroll_callback; | 694 base::Closure did_scroll_callback; |
| 690 std::vector<std::unique_ptr<CopyOutputRequest>> copy_requests; | 695 std::vector<std::unique_ptr<CopyOutputRequest>> copy_requests; |
| 691 | 696 |
| 692 float preferred_raster_scale; | 697 gfx::Size preferred_raster_bounds; |
| 693 }; | 698 }; |
| 694 | 699 |
| 695 Layer* parent_; | 700 Layer* parent_; |
| 696 | 701 |
| 697 // Layer instances have a weak pointer to their LayerTreeHost. | 702 // Layer instances have a weak pointer to their LayerTreeHost. |
| 698 // This pointer value is nil when a Layer is not in a tree and is | 703 // This pointer value is nil when a Layer is not in a tree and is |
| 699 // updated via SetLayerTreeHost() if a layer moves between trees. | 704 // updated via SetLayerTreeHost() if a layer moves between trees. |
| 700 LayerTreeHost* layer_tree_host_; | 705 LayerTreeHost* layer_tree_host_; |
| 701 LayerTree* layer_tree_; | 706 LayerTree* layer_tree_; |
| 702 | 707 |
| (...skipping 26 matching lines...) Expand all Loading... |
| 729 // These all act like draw properties, so don't need push properties. | 734 // These all act like draw properties, so don't need push properties. |
| 730 gfx::Rect visible_layer_rect_; | 735 gfx::Rect visible_layer_rect_; |
| 731 size_t num_unclipped_descendants_; | 736 size_t num_unclipped_descendants_; |
| 732 | 737 |
| 733 DISALLOW_COPY_AND_ASSIGN(Layer); | 738 DISALLOW_COPY_AND_ASSIGN(Layer); |
| 734 }; | 739 }; |
| 735 | 740 |
| 736 } // namespace cc | 741 } // namespace cc |
| 737 | 742 |
| 738 #endif // CC_LAYERS_LAYER_H_ | 743 #endif // CC_LAYERS_LAYER_H_ |
| OLD | NEW |