Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(161)

Side by Side Diff: cc/layers/layer.h

Issue 1122393003: CC: Plumb LayerSettings parameter for cc::Layer construction. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Re-work Android LayerSettings. Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 <set> 8 #include <set>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 51
52 namespace cc { 52 namespace cc {
53 53
54 class Animation; 54 class Animation;
55 class AnimationDelegate; 55 class AnimationDelegate;
56 struct AnimationEvent; 56 struct AnimationEvent;
57 class CopyOutputRequest; 57 class CopyOutputRequest;
58 class LayerAnimationEventObserver; 58 class LayerAnimationEventObserver;
59 class LayerClient; 59 class LayerClient;
60 class LayerImpl; 60 class LayerImpl;
61 class LayerSettings;
61 class LayerTreeHost; 62 class LayerTreeHost;
62 class LayerTreeHostCommon; 63 class LayerTreeHostCommon;
63 class LayerTreeImpl; 64 class LayerTreeImpl;
64 class PriorityCalculator; 65 class PriorityCalculator;
65 class RenderingStatsInstrumentation; 66 class RenderingStatsInstrumentation;
66 class ResourceUpdateQueue; 67 class ResourceUpdateQueue;
67 class ScrollbarLayerInterface; 68 class ScrollbarLayerInterface;
68 class SimpleEnclosedRegion; 69 class SimpleEnclosedRegion;
69 struct AnimationEvent; 70 struct AnimationEvent;
70 template <typename LayerType> 71 template <typename LayerType>
71 class OcclusionTracker; 72 class OcclusionTracker;
72 73
73 // Base class for composited layers. Special layer types are derived from 74 // Base class for composited layers. Special layer types are derived from
74 // this class. 75 // this class.
75 class CC_EXPORT Layer : public base::RefCounted<Layer>, 76 class CC_EXPORT Layer : public base::RefCounted<Layer>,
76 public LayerAnimationValueObserver, 77 public LayerAnimationValueObserver,
77 public LayerAnimationValueProvider { 78 public LayerAnimationValueProvider {
78 public: 79 public:
79 typedef RenderSurfaceLayerList RenderSurfaceListType; 80 typedef RenderSurfaceLayerList RenderSurfaceListType;
80 typedef LayerList LayerListType; 81 typedef LayerList LayerListType;
81 typedef RenderSurface RenderSurfaceType; 82 typedef RenderSurface RenderSurfaceType;
82 83
83 enum LayerIdLabels { 84 enum LayerIdLabels {
84 INVALID_ID = -1, 85 INVALID_ID = -1,
85 }; 86 };
86 87
87 static scoped_refptr<Layer> Create(); 88 static scoped_refptr<Layer> Create(const LayerSettings& settings);
88 89
89 int id() const { return layer_id_; } 90 int id() const { return layer_id_; }
90 91
91 Layer* RootLayer(); 92 Layer* RootLayer();
92 Layer* parent() { return parent_; } 93 Layer* parent() { return parent_; }
93 const Layer* parent() const { return parent_; } 94 const Layer* parent() const { return parent_; }
94 void AddChild(scoped_refptr<Layer> child); 95 void AddChild(scoped_refptr<Layer> child);
95 void InsertChild(scoped_refptr<Layer> child, size_t index); 96 void InsertChild(scoped_refptr<Layer> child, size_t index);
96 void ReplaceChild(Layer* reference, scoped_refptr<Layer> new_layer); 97 void ReplaceChild(Layer* reference, scoped_refptr<Layer> new_layer);
97 void RemoveFromParent(); 98 void RemoveFromParent();
(...skipping 468 matching lines...) Expand 10 before | Expand all | Expand 10 after
566 567
567 int num_layer_or_descendants_with_input_handler() { 568 int num_layer_or_descendants_with_input_handler() {
568 return num_layer_or_descendants_with_input_handler_; 569 return num_layer_or_descendants_with_input_handler_;
569 } 570 }
570 571
571 protected: 572 protected:
572 friend class LayerImpl; 573 friend class LayerImpl;
573 friend class TreeSynchronizer; 574 friend class TreeSynchronizer;
574 ~Layer() override; 575 ~Layer() override;
575 576
576 Layer(); 577 explicit Layer(const LayerSettings& settings);
577 578
578 // These SetNeeds functions are in order of severity of update: 579 // These SetNeeds functions are in order of severity of update:
579 // 580 //
580 // Called when this layer has been modified in some way, but isn't sure 581 // Called when this layer has been modified in some way, but isn't sure
581 // that it needs a commit yet. It needs CalcDrawProperties and UpdateLayers 582 // that it needs a commit yet. It needs CalcDrawProperties and UpdateLayers
582 // before it knows whether or not a commit is required. 583 // before it knows whether or not a commit is required.
583 void SetNeedsUpdate(); 584 void SetNeedsUpdate();
584 // Called when a property has been modified in a way that the layer 585 // Called when a property has been modified in a way that the layer
585 // knows immediately that a commit is required. This implies SetNeedsUpdate 586 // knows immediately that a commit is required. This implies SetNeedsUpdate
586 // as well as SetNeedsPushProperties to push that property. 587 // as well as SetNeedsPushProperties to push that property.
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
774 775
775 std::vector<FrameTimingRequest> frame_timing_requests_; 776 std::vector<FrameTimingRequest> frame_timing_requests_;
776 bool frame_timing_requests_dirty_; 777 bool frame_timing_requests_dirty_;
777 778
778 DISALLOW_COPY_AND_ASSIGN(Layer); 779 DISALLOW_COPY_AND_ASSIGN(Layer);
779 }; 780 };
780 781
781 } // namespace cc 782 } // namespace cc
782 783
783 #endif // CC_LAYERS_LAYER_H_ 784 #endif // CC_LAYERS_LAYER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698