OLD | NEW |
1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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_IMPL_H_ | 5 #ifndef CC_LAYER_IMPL_H_ |
6 #define CC_LAYER_IMPL_H_ | 6 #define CC_LAYER_IMPL_H_ |
7 | 7 |
8 #include <public/WebFilterOperations.h> | 8 #include <public/WebFilterOperations.h> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 25 matching lines...) Expand all Loading... |
36 class LayerTreeHostImpl; | 36 class LayerTreeHostImpl; |
37 class LayerTreeImpl; | 37 class LayerTreeImpl; |
38 class QuadSink; | 38 class QuadSink; |
39 class Renderer; | 39 class Renderer; |
40 class ScrollbarAnimationController; | 40 class ScrollbarAnimationController; |
41 class ScrollbarLayerImpl; | 41 class ScrollbarLayerImpl; |
42 class Layer; | 42 class Layer; |
43 | 43 |
44 struct AppendQuadsData; | 44 struct AppendQuadsData; |
45 | 45 |
46 class CC_EXPORT LayerImpl : public LayerAnimationControllerClient { | 46 class CC_EXPORT LayerImpl : LayerAnimationControllerObserver { |
47 public: | 47 public: |
48 typedef ScopedPtrVector<LayerImpl> LayerList; | 48 typedef ScopedPtrVector<LayerImpl> LayerList; |
49 | 49 |
50 static scoped_ptr<LayerImpl> create(LayerTreeImpl* treeImpl, int id) | 50 static scoped_ptr<LayerImpl> create(LayerTreeImpl* treeImpl, int id) |
51 { | 51 { |
52 return make_scoped_ptr(new LayerImpl(treeImpl, id)); | 52 return make_scoped_ptr(new LayerImpl(treeImpl, id)); |
53 } | 53 } |
54 | 54 |
55 virtual ~LayerImpl(); | 55 virtual ~LayerImpl(); |
56 | 56 |
57 // LayerAnimationControllerClient implementation. | 57 int id() const; |
58 virtual int id() const OVERRIDE; | 58 |
59 virtual void setOpacityFromAnimation(float) OVERRIDE; | 59 // LayerAnimationControllerObserver implementation. |
60 virtual float opacity() const OVERRIDE; | 60 virtual void OnOpacityAnimated(float) OVERRIDE; |
61 virtual void setTransformFromAnimation(const gfx::Transform&) OVERRIDE; | 61 virtual void OnTransformAnimated(const gfx::Transform&) OVERRIDE; |
62 virtual const gfx::Transform& transform() const OVERRIDE; | |
63 | 62 |
64 // Tree structure. | 63 // Tree structure. |
65 LayerImpl* parent() { return m_parent; } | 64 LayerImpl* parent() { return m_parent; } |
66 const LayerImpl* parent() const { return m_parent; } | 65 const LayerImpl* parent() const { return m_parent; } |
67 const LayerList& children() const { return m_children; } | 66 const LayerList& children() const { return m_children; } |
68 void addChild(scoped_ptr<LayerImpl>); | 67 void addChild(scoped_ptr<LayerImpl>); |
69 scoped_ptr<LayerImpl> removeChild(LayerImpl* child); | 68 scoped_ptr<LayerImpl> removeChild(LayerImpl* child); |
70 void removeAllChildren(); | 69 void removeAllChildren(); |
71 | 70 |
72 void setMaskLayer(scoped_ptr<LayerImpl>); | 71 void setMaskLayer(scoped_ptr<LayerImpl>); |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 void setFilter(const skia::RefPtr<SkImageFilter>&); | 123 void setFilter(const skia::RefPtr<SkImageFilter>&); |
125 skia::RefPtr<SkImageFilter> filter() const { return m_filter; } | 124 skia::RefPtr<SkImageFilter> filter() const { return m_filter; } |
126 | 125 |
127 void setMasksToBounds(bool); | 126 void setMasksToBounds(bool); |
128 bool masksToBounds() const { return m_masksToBounds; } | 127 bool masksToBounds() const { return m_masksToBounds; } |
129 | 128 |
130 void setContentsOpaque(bool); | 129 void setContentsOpaque(bool); |
131 bool contentsOpaque() const { return m_contentsOpaque; } | 130 bool contentsOpaque() const { return m_contentsOpaque; } |
132 | 131 |
133 void setOpacity(float); | 132 void setOpacity(float); |
| 133 float opacity() const; |
134 bool opacityIsAnimating() const; | 134 bool opacityIsAnimating() const; |
135 | 135 |
136 void setPosition(const gfx::PointF&); | 136 void setPosition(const gfx::PointF&); |
137 const gfx::PointF& position() const { return m_position; } | 137 const gfx::PointF& position() const { return m_position; } |
138 | 138 |
139 void setIsContainerForFixedPositionLayers(bool isContainerForFixedPositionLa
yers) { m_isContainerForFixedPositionLayers = isContainerForFixedPositionLayers;
} | 139 void setIsContainerForFixedPositionLayers(bool isContainerForFixedPositionLa
yers) { m_isContainerForFixedPositionLayers = isContainerForFixedPositionLayers;
} |
140 bool isContainerForFixedPositionLayers() const { return m_isContainerForFixe
dPositionLayers; } | 140 bool isContainerForFixedPositionLayers() const { return m_isContainerForFixe
dPositionLayers; } |
141 | 141 |
142 void setFixedToContainerLayer(bool fixedToContainerLayer = true) { m_fixedTo
ContainerLayer = fixedToContainerLayer;} | 142 void setFixedToContainerLayer(bool fixedToContainerLayer = true) { m_fixedTo
ContainerLayer = fixedToContainerLayer;} |
143 bool fixedToContainerLayer() const { return m_fixedToContainerLayer; } | 143 bool fixedToContainerLayer() const { return m_fixedToContainerLayer; } |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
232 | 232 |
233 void setDrawCheckerboardForMissingTiles(bool checkerboard) { m_drawCheckerbo
ardForMissingTiles = checkerboard; } | 233 void setDrawCheckerboardForMissingTiles(bool checkerboard) { m_drawCheckerbo
ardForMissingTiles = checkerboard; } |
234 bool drawCheckerboardForMissingTiles() const; | 234 bool drawCheckerboardForMissingTiles() const; |
235 | 235 |
236 InputHandlerClient::ScrollStatus tryScroll(const gfx::PointF& screenSpacePoi
nt, InputHandlerClient::ScrollInputType) const; | 236 InputHandlerClient::ScrollStatus tryScroll(const gfx::PointF& screenSpacePoi
nt, InputHandlerClient::ScrollInputType) const; |
237 | 237 |
238 bool doubleSided() const { return m_doubleSided; } | 238 bool doubleSided() const { return m_doubleSided; } |
239 void setDoubleSided(bool); | 239 void setDoubleSided(bool); |
240 | 240 |
241 void setTransform(const gfx::Transform&); | 241 void setTransform(const gfx::Transform&); |
| 242 const gfx::Transform& transform() const; |
242 bool transformIsAnimating() const; | 243 bool transformIsAnimating() const; |
243 | 244 |
244 const gfx::RectF& updateRect() const { return m_updateRect; } | 245 const gfx::RectF& updateRect() const { return m_updateRect; } |
245 void setUpdateRect(const gfx::RectF& updateRect) { m_updateRect = updateRect
; } | 246 void setUpdateRect(const gfx::RectF& updateRect) { m_updateRect = updateRect
; } |
246 | 247 |
247 std::string layerTreeAsText() const; | 248 std::string layerTreeAsText() const; |
248 virtual base::DictionaryValue* layerTreeAsJson() const; | 249 virtual base::DictionaryValue* layerTreeAsJson() const; |
249 | 250 |
250 void setStackingOrderChanged(bool); | 251 void setStackingOrderChanged(bool); |
251 | 252 |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
381 #ifndef NDEBUG | 382 #ifndef NDEBUG |
382 bool m_betweenWillDrawAndDidDraw; | 383 bool m_betweenWillDrawAndDidDraw; |
383 #endif | 384 #endif |
384 | 385 |
385 // Rect indicating what was repainted/updated during update. | 386 // Rect indicating what was repainted/updated during update. |
386 // Note that plugin layers bypass this and leave it empty. | 387 // Note that plugin layers bypass this and leave it empty. |
387 // Uses layer's content space. | 388 // Uses layer's content space. |
388 gfx::RectF m_updateRect; | 389 gfx::RectF m_updateRect; |
389 | 390 |
390 // Manages animations for this layer. | 391 // Manages animations for this layer. |
391 scoped_ptr<LayerAnimationController> m_layerAnimationController; | 392 scoped_refptr<LayerAnimationController> m_layerAnimationController; |
392 | 393 |
393 // Manages scrollbars for this layer | 394 // Manages scrollbars for this layer |
394 scoped_ptr<ScrollbarAnimationController> m_scrollbarAnimationController; | 395 scoped_ptr<ScrollbarAnimationController> m_scrollbarAnimationController; |
395 | 396 |
396 // Group of properties that need to be computed based on the layer tree | 397 // Group of properties that need to be computed based on the layer tree |
397 // hierarchy before layers can be drawn. | 398 // hierarchy before layers can be drawn. |
398 DrawProperties<LayerImpl, RenderSurfaceImpl> m_drawProperties; | 399 DrawProperties<LayerImpl, RenderSurfaceImpl> m_drawProperties; |
399 | 400 |
400 DISALLOW_COPY_AND_ASSIGN(LayerImpl); | 401 DISALLOW_COPY_AND_ASSIGN(LayerImpl); |
401 }; | 402 }; |
402 | 403 |
403 } | 404 } |
404 | 405 |
405 #endif // CC_LAYER_IMPL_H_ | 406 #endif // CC_LAYER_IMPL_H_ |
OLD | NEW |