| 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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 Layer* child_at(size_t index) { return inputs_.children[index].get(); } | 90 Layer* child_at(size_t index) { return inputs_.children[index].get(); } |
| 91 | 91 |
| 92 // This requests the layer and its subtree be rendered and given to the | 92 // This requests the layer and its subtree be rendered and given to the |
| 93 // callback. If the copy is unable to be produced (the layer is destroyed | 93 // callback. If the copy is unable to be produced (the layer is destroyed |
| 94 // first), then the callback is called with a nullptr/empty result. If the | 94 // first), then the callback is called with a nullptr/empty result. If the |
| 95 // request's source property is set, any prior uncommitted requests having the | 95 // request's source property is set, any prior uncommitted requests having the |
| 96 // same source will be aborted. | 96 // same source will be aborted. |
| 97 void RequestCopyOfOutput(std::unique_ptr<CopyOutputRequest> request); | 97 void RequestCopyOfOutput(std::unique_ptr<CopyOutputRequest> request); |
| 98 bool HasCopyRequest() const { return !inputs_.copy_requests.empty(); } | 98 bool HasCopyRequest() const { return !inputs_.copy_requests.empty(); } |
| 99 | 99 |
| 100 void SetSubtreeHasCopyRequest(bool subtree_has_copy_request); |
| 101 bool SubtreeHasCopyRequest() const; |
| 102 |
| 100 void TakeCopyRequests( | 103 void TakeCopyRequests( |
| 101 std::vector<std::unique_ptr<CopyOutputRequest>>* requests); | 104 std::vector<std::unique_ptr<CopyOutputRequest>>* requests); |
| 102 | 105 |
| 103 virtual void SetBackgroundColor(SkColor background_color); | 106 virtual void SetBackgroundColor(SkColor background_color); |
| 104 SkColor background_color() const { return inputs_.background_color; } | 107 SkColor background_color() const { return inputs_.background_color; } |
| 105 void SetSafeOpaqueBackgroundColor(SkColor background_color); | 108 void SetSafeOpaqueBackgroundColor(SkColor background_color); |
| 106 // If contents_opaque(), return an opaque color else return a | 109 // If contents_opaque(), return an opaque color else return a |
| 107 // non-opaque color. Tries to return background_color(), if possible. | 110 // non-opaque color. Tries to return background_color(), if possible. |
| 108 SkColor SafeOpaqueBackgroundColor() const; | 111 SkColor SafeOpaqueBackgroundColor() const; |
| 109 | 112 |
| (...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 394 void set_visible_layer_rect(const gfx::Rect& rect) { | 397 void set_visible_layer_rect(const gfx::Rect& rect) { |
| 395 visible_layer_rect_ = rect; | 398 visible_layer_rect_ = rect; |
| 396 } | 399 } |
| 397 | 400 |
| 398 // This is for tracking damage. | 401 // This is for tracking damage. |
| 399 void SetSubtreePropertyChanged(); | 402 void SetSubtreePropertyChanged(); |
| 400 bool subtree_property_changed() const { return subtree_property_changed_; } | 403 bool subtree_property_changed() const { return subtree_property_changed_; } |
| 401 | 404 |
| 402 void SetMayContainVideo(bool yes); | 405 void SetMayContainVideo(bool yes); |
| 403 | 406 |
| 404 int num_copy_requests_in_target_subtree(); | 407 bool has_copy_requests_in_target_subtree(); |
| 405 | 408 |
| 406 void SetElementId(ElementId id); | 409 void SetElementId(ElementId id); |
| 407 ElementId element_id() const { return inputs_.element_id; } | 410 ElementId element_id() const { return inputs_.element_id; } |
| 408 | 411 |
| 409 void SetMutableProperties(uint32_t properties); | 412 void SetMutableProperties(uint32_t properties); |
| 410 uint32_t mutable_properties() const { return inputs_.mutable_properties; } | 413 uint32_t mutable_properties() const { return inputs_.mutable_properties; } |
| 411 | 414 |
| 412 bool HasTickingAnimationForTesting() const; | 415 bool HasTickingAnimationForTesting() const; |
| 413 | 416 |
| 414 void SetHasWillChangeTransformHint(bool has_will_change); | 417 void SetHasWillChangeTransformHint(bool has_will_change); |
| (...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 620 gfx::Vector2dF offset_to_transform_parent_; | 623 gfx::Vector2dF offset_to_transform_parent_; |
| 621 bool should_flatten_transform_from_property_tree_ : 1; | 624 bool should_flatten_transform_from_property_tree_ : 1; |
| 622 bool draws_content_ : 1; | 625 bool draws_content_ : 1; |
| 623 bool use_local_transform_for_backface_visibility_ : 1; | 626 bool use_local_transform_for_backface_visibility_ : 1; |
| 624 bool should_check_backface_visibility_ : 1; | 627 bool should_check_backface_visibility_ : 1; |
| 625 bool force_render_surface_for_testing_ : 1; | 628 bool force_render_surface_for_testing_ : 1; |
| 626 bool subtree_property_changed_ : 1; | 629 bool subtree_property_changed_ : 1; |
| 627 bool may_contain_video_ : 1; | 630 bool may_contain_video_ : 1; |
| 628 bool is_scroll_clip_layer_ : 1; | 631 bool is_scroll_clip_layer_ : 1; |
| 629 bool needs_show_scrollbars_ : 1; | 632 bool needs_show_scrollbars_ : 1; |
| 633 // This value is valid only when LayerTreeHost::has_copy_request() is true |
| 634 bool subtree_has_copy_request_ : 1; |
| 630 SkColor safe_opaque_background_color_; | 635 SkColor safe_opaque_background_color_; |
| 631 std::unique_ptr<std::set<Layer*>> scroll_children_; | 636 std::unique_ptr<std::set<Layer*>> scroll_children_; |
| 632 | 637 |
| 633 std::unique_ptr<std::set<Layer*>> clip_children_; | 638 std::unique_ptr<std::set<Layer*>> clip_children_; |
| 634 | 639 |
| 635 PaintProperties paint_properties_; | 640 PaintProperties paint_properties_; |
| 636 | 641 |
| 637 // These all act like draw properties, so don't need push properties. | 642 // These all act like draw properties, so don't need push properties. |
| 638 gfx::Rect visible_layer_rect_; | 643 gfx::Rect visible_layer_rect_; |
| 639 size_t num_unclipped_descendants_; | 644 size_t num_unclipped_descendants_; |
| 640 | 645 |
| 641 DISALLOW_COPY_AND_ASSIGN(Layer); | 646 DISALLOW_COPY_AND_ASSIGN(Layer); |
| 642 }; | 647 }; |
| 643 | 648 |
| 644 } // namespace cc | 649 } // namespace cc |
| 645 | 650 |
| 646 #endif // CC_LAYERS_LAYER_H_ | 651 #endif // CC_LAYERS_LAYER_H_ |
| OLD | NEW |