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_LAYER_H_ | 5 #ifndef CC_LAYER_H_ |
6 #define CC_LAYER_H_ | 6 #define CC_LAYER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 class ScrollbarLayer; | 44 class ScrollbarLayer; |
45 struct AnimationEvent; | 45 struct AnimationEvent; |
46 struct RenderingStats; | 46 struct RenderingStats; |
47 | 47 |
48 // Base class for composited layers. Special layer types are derived from | 48 // Base class for composited layers. Special layer types are derived from |
49 // this class. | 49 // this class. |
50 class CC_EXPORT Layer : public base::RefCounted<Layer>, | 50 class CC_EXPORT Layer : public base::RefCounted<Layer>, |
51 public LayerAnimationValueObserver { | 51 public LayerAnimationValueObserver { |
52 public: | 52 public: |
53 typedef std::vector<scoped_refptr<Layer> > LayerList; | 53 typedef std::vector<scoped_refptr<Layer> > LayerList; |
| 54 enum LayerIdLabels { |
| 55 PINCH_ZOOM_ROOT_SCROLL_LAYER_ID = -2, |
| 56 INVALID_ID = -1, |
| 57 }; |
54 | 58 |
55 static scoped_refptr<Layer> Create(); | 59 static scoped_refptr<Layer> Create(); |
56 | 60 |
57 int id() const { return layer_id_; } | 61 int id() const { return layer_id_; } |
58 | 62 |
59 Layer* RootLayer(); | 63 Layer* RootLayer(); |
60 Layer* parent() { return parent_; } | 64 Layer* parent() { return parent_; } |
61 const Layer* parent() const { return parent_; } | 65 const Layer* parent() const { return parent_; } |
62 void AddChild(scoped_refptr<Layer> child); | 66 void AddChild(scoped_refptr<Layer> child); |
63 void InsertChild(scoped_refptr<Layer> child, size_t index); | 67 void InsertChild(scoped_refptr<Layer> child, size_t index); |
(...skipping 25 matching lines...) Expand all Loading... |
89 void SetMaskLayer(Layer* mask_layer); | 93 void SetMaskLayer(Layer* mask_layer); |
90 Layer* mask_layer() { return mask_layer_.get(); } | 94 Layer* mask_layer() { return mask_layer_.get(); } |
91 const Layer* mask_layer() const { return mask_layer_.get(); } | 95 const Layer* mask_layer() const { return mask_layer_.get(); } |
92 | 96 |
93 virtual void SetNeedsDisplayRect(const gfx::RectF& dirty_rect); | 97 virtual void SetNeedsDisplayRect(const gfx::RectF& dirty_rect); |
94 void SetNeedsDisplay() { SetNeedsDisplayRect(gfx::RectF(bounds())); } | 98 void SetNeedsDisplay() { SetNeedsDisplayRect(gfx::RectF(bounds())); } |
95 | 99 |
96 void SetOpacity(float opacity); | 100 void SetOpacity(float opacity); |
97 float opacity() const { return opacity_; } | 101 float opacity() const { return opacity_; } |
98 bool OpacityIsAnimating() const; | 102 bool OpacityIsAnimating() const; |
| 103 virtual bool OpacityCanAnimateOnImplThread() const; |
99 | 104 |
100 void SetFilters(const WebKit::WebFilterOperations& filters); | 105 void SetFilters(const WebKit::WebFilterOperations& filters); |
101 const WebKit::WebFilterOperations& filters() const { return filters_; } | 106 const WebKit::WebFilterOperations& filters() const { return filters_; } |
102 | 107 |
103 void SetFilter(const skia::RefPtr<SkImageFilter>& filter); | 108 void SetFilter(const skia::RefPtr<SkImageFilter>& filter); |
104 skia::RefPtr<SkImageFilter> filter() const { return filter_; } | 109 skia::RefPtr<SkImageFilter> filter() const { return filter_; } |
105 | 110 |
106 // Background filters are filters applied to what is behind this layer, when | 111 // Background filters are filters applied to what is behind this layer, when |
107 // they are viewed through non-opaque regions in this layer. They are used | 112 // they are viewed through non-opaque regions in this layer. They are used |
108 // through the WebLayer interface, and are not exposed to HTML. | 113 // through the WebLayer interface, and are not exposed to HTML. |
(...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
474 WebKit::WebLayerScrollClient* layer_scroll_client_; | 479 WebKit::WebLayerScrollClient* layer_scroll_client_; |
475 | 480 |
476 DrawProperties<Layer, RenderSurface> draw_properties_; | 481 DrawProperties<Layer, RenderSurface> draw_properties_; |
477 | 482 |
478 DISALLOW_COPY_AND_ASSIGN(Layer); | 483 DISALLOW_COPY_AND_ASSIGN(Layer); |
479 }; | 484 }; |
480 | 485 |
481 } // namespace cc | 486 } // namespace cc |
482 | 487 |
483 #endif // CC_LAYER_H_ | 488 #endif // CC_LAYER_H_ |
OLD | NEW |