| 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 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 // This requests the layer and its subtree be rendered and given to the | 99 // This requests the layer and its subtree be rendered and given to the |
| 100 // callback. If the copy is unable to be produced (the layer is destroyed | 100 // callback. If the copy is unable to be produced (the layer is destroyed |
| 101 // first), then the callback is called with a nullptr/empty result. If the | 101 // first), then the callback is called with a nullptr/empty result. If the |
| 102 // request's source property is set, any prior uncommitted requests having the | 102 // request's source property is set, any prior uncommitted requests having the |
| 103 // same source will be aborted. | 103 // same source will be aborted. |
| 104 void RequestCopyOfOutput(std::unique_ptr<CopyOutputRequest> request); | 104 void RequestCopyOfOutput(std::unique_ptr<CopyOutputRequest> request); |
| 105 bool HasCopyRequest() const { | 105 bool HasCopyRequest() const { |
| 106 return !copy_requests_.empty(); | 106 return !copy_requests_.empty(); |
| 107 } | 107 } |
| 108 | 108 |
| 109 void TakeCopyRequests( |
| 110 std::vector<std::unique_ptr<CopyOutputRequest>>* requests); |
| 111 |
| 109 virtual void SetBackgroundColor(SkColor background_color); | 112 virtual void SetBackgroundColor(SkColor background_color); |
| 110 SkColor background_color() const { return background_color_; } | 113 SkColor background_color() const { return background_color_; } |
| 111 void SetSafeOpaqueBackgroundColor(SkColor background_color); | 114 void SetSafeOpaqueBackgroundColor(SkColor background_color); |
| 112 // If contents_opaque(), return an opaque color else return a | 115 // If contents_opaque(), return an opaque color else return a |
| 113 // non-opaque color. Tries to return background_color(), if possible. | 116 // non-opaque color. Tries to return background_color(), if possible. |
| 114 SkColor SafeOpaqueBackgroundColor() const; | 117 SkColor SafeOpaqueBackgroundColor() const; |
| 115 | 118 |
| 116 // A layer's bounds are in logical, non-page-scaled pixels (however, the | 119 // A layer's bounds are in logical, non-page-scaled pixels (however, the |
| 117 // root layer's bounds are in physical pixels). | 120 // root layer's bounds are in physical pixels). |
| 118 void SetBounds(const gfx::Size& bounds); | 121 void SetBounds(const gfx::Size& bounds); |
| (...skipping 561 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 680 // These all act like draw properties, so don't need push properties. | 683 // These all act like draw properties, so don't need push properties. |
| 681 gfx::Rect visible_layer_rect_; | 684 gfx::Rect visible_layer_rect_; |
| 682 size_t num_unclipped_descendants_; | 685 size_t num_unclipped_descendants_; |
| 683 | 686 |
| 684 DISALLOW_COPY_AND_ASSIGN(Layer); | 687 DISALLOW_COPY_AND_ASSIGN(Layer); |
| 685 }; | 688 }; |
| 686 | 689 |
| 687 } // namespace cc | 690 } // namespace cc |
| 688 | 691 |
| 689 #endif // CC_LAYERS_LAYER_H_ | 692 #endif // CC_LAYERS_LAYER_H_ |
| OLD | NEW |