| 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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 // this class. | 58 // this class. |
| 59 class CC_EXPORT Layer : public base::RefCounted<Layer> { | 59 class CC_EXPORT Layer : public base::RefCounted<Layer> { |
| 60 public: | 60 public: |
| 61 using LayerListType = LayerList; | 61 using LayerListType = LayerList; |
| 62 using LayerIdMap = std::unordered_map<int, scoped_refptr<Layer>>; | 62 using LayerIdMap = std::unordered_map<int, scoped_refptr<Layer>>; |
| 63 | 63 |
| 64 enum LayerIdLabels { | 64 enum LayerIdLabels { |
| 65 INVALID_ID = -1, | 65 INVALID_ID = -1, |
| 66 }; | 66 }; |
| 67 | 67 |
| 68 enum LayerMaskType { |
| 69 NOT_MASK = 0, |
| 70 MULTI_TEXTURE_MASK, |
| 71 SINGLE_TEXTURE_MASK, |
| 72 }; |
| 73 |
| 68 static scoped_refptr<Layer> Create(); | 74 static scoped_refptr<Layer> Create(); |
| 69 | 75 |
| 70 int id() const { return inputs_.layer_id; } | 76 int id() const { return inputs_.layer_id; } |
| 71 | 77 |
| 72 Layer* RootLayer(); | 78 Layer* RootLayer(); |
| 73 Layer* parent() { return parent_; } | 79 Layer* parent() { return parent_; } |
| 74 const Layer* parent() const { return parent_; } | 80 const Layer* parent() const { return parent_; } |
| 75 void AddChild(scoped_refptr<Layer> child); | 81 void AddChild(scoped_refptr<Layer> child); |
| 76 void InsertChild(scoped_refptr<Layer> child, size_t index); | 82 void InsertChild(scoped_refptr<Layer> child, size_t index); |
| 77 void ReplaceChild(Layer* reference, scoped_refptr<Layer> new_layer); | 83 void ReplaceChild(Layer* reference, scoped_refptr<Layer> new_layer); |
| (...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 305 // This is only virtual for tests. | 311 // This is only virtual for tests. |
| 306 // TODO(awoloszyn): Remove this once we no longer need it for tests | 312 // TODO(awoloszyn): Remove this once we no longer need it for tests |
| 307 virtual bool DrawsContent() const; | 313 virtual bool DrawsContent() const; |
| 308 | 314 |
| 309 // This methods typically need to be overwritten by derived classes. | 315 // This methods typically need to be overwritten by derived classes. |
| 310 // TODO(chrishtr): Blink no longer resizes anything during paint. We can | 316 // TODO(chrishtr): Blink no longer resizes anything during paint. We can |
| 311 // remove this. | 317 // remove this. |
| 312 virtual void SavePaintProperties(); | 318 virtual void SavePaintProperties(); |
| 313 // Returns true iff anything was updated that needs to be committed. | 319 // Returns true iff anything was updated that needs to be committed. |
| 314 virtual bool Update(); | 320 virtual bool Update(); |
| 315 virtual void SetIsMask(bool is_mask) {} | 321 virtual void SetLayerMaskType(Layer::LayerMaskType type) {} |
| 316 virtual bool IsSuitableForGpuRasterization() const; | 322 virtual bool IsSuitableForGpuRasterization() const; |
| 317 | 323 |
| 318 virtual std::unique_ptr<base::trace_event::ConvertableToTraceFormat> | 324 virtual std::unique_ptr<base::trace_event::ConvertableToTraceFormat> |
| 319 TakeDebugInfo(); | 325 TakeDebugInfo(); |
| 320 virtual void didUpdateMainThreadScrollingReasons(); | 326 virtual void didUpdateMainThreadScrollingReasons(); |
| 321 | 327 |
| 322 void SetLayerClient(LayerClient* client) { inputs_.client = client; } | 328 void SetLayerClient(LayerClient* client) { inputs_.client = client; } |
| 323 | 329 |
| 324 virtual bool IsSnapped(); | 330 virtual bool IsSnapped(); |
| 325 | 331 |
| (...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 657 // These all act like draw properties, so don't need push properties. | 663 // These all act like draw properties, so don't need push properties. |
| 658 gfx::Rect visible_layer_rect_; | 664 gfx::Rect visible_layer_rect_; |
| 659 size_t num_unclipped_descendants_; | 665 size_t num_unclipped_descendants_; |
| 660 | 666 |
| 661 DISALLOW_COPY_AND_ASSIGN(Layer); | 667 DISALLOW_COPY_AND_ASSIGN(Layer); |
| 662 }; | 668 }; |
| 663 | 669 |
| 664 } // namespace cc | 670 } // namespace cc |
| 665 | 671 |
| 666 #endif // CC_LAYERS_LAYER_H_ | 672 #endif // CC_LAYERS_LAYER_H_ |
| OLD | NEW |