| 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 CCLayerImpl_h | 5 #ifndef CCLayerImpl_h |
| 6 #define CCLayerImpl_h | 6 #define CCLayerImpl_h |
| 7 | 7 |
| 8 #include "CCInputHandler.h" | 8 #include "CCInputHandler.h" |
| 9 #include "CCLayerAnimationController.h" | 9 #include "CCLayerAnimationController.h" |
| 10 #include "CCRenderSurface.h" | 10 #include "CCRenderSurface.h" |
| 11 #include "CCResourceProvider.h" | 11 #include "CCResourceProvider.h" |
| 12 #include "CCSharedQuadState.h" | 12 #include "CCSharedQuadState.h" |
| 13 #include "FloatRect.h" | 13 #include "FloatRect.h" |
| 14 #include "IntRect.h" | 14 #include "IntRect.h" |
| 15 #include "Region.h" | 15 #include "Region.h" |
| 16 #include "SkColor.h" | 16 #include "SkColor.h" |
| 17 #include "cc/own_ptr_vector.h" |
| 17 #include <public/WebFilterOperations.h> | 18 #include <public/WebFilterOperations.h> |
| 18 #include <public/WebTransformationMatrix.h> | 19 #include <public/WebTransformationMatrix.h> |
| 19 #include <string> | 20 #include <string> |
| 20 #include <wtf/OwnPtr.h> | 21 #include <wtf/OwnPtr.h> |
| 21 #include <wtf/PassRefPtr.h> | 22 #include <wtf/PassRefPtr.h> |
| 22 #include <wtf/RefCounted.h> | 23 #include <wtf/RefCounted.h> |
| 23 | 24 |
| 24 namespace cc { | 25 namespace cc { |
| 25 | 26 |
| 26 class CCLayerSorter; | 27 class CCLayerSorter; |
| (...skipping 17 matching lines...) Expand all Loading... |
| 44 | 45 |
| 45 // CCLayerAnimationControllerClient implementation. | 46 // CCLayerAnimationControllerClient implementation. |
| 46 virtual int id() const OVERRIDE { return m_layerId; } | 47 virtual int id() const OVERRIDE { return m_layerId; } |
| 47 virtual void setOpacityFromAnimation(float) OVERRIDE; | 48 virtual void setOpacityFromAnimation(float) OVERRIDE; |
| 48 virtual float opacity() const OVERRIDE { return m_opacity; } | 49 virtual float opacity() const OVERRIDE { return m_opacity; } |
| 49 virtual void setTransformFromAnimation(const WebKit::WebTransformationMatrix
&) OVERRIDE; | 50 virtual void setTransformFromAnimation(const WebKit::WebTransformationMatrix
&) OVERRIDE; |
| 50 virtual const WebKit::WebTransformationMatrix& transform() const OVERRIDE {
return m_transform; } | 51 virtual const WebKit::WebTransformationMatrix& transform() const OVERRIDE {
return m_transform; } |
| 51 | 52 |
| 52 // Tree structure. | 53 // Tree structure. |
| 53 CCLayerImpl* parent() const { return m_parent; } | 54 CCLayerImpl* parent() const { return m_parent; } |
| 54 const Vector<OwnPtr<CCLayerImpl> >& children() const { return m_children; } | 55 const OwnPtrVector<CCLayerImpl>& children() const { return m_children; } |
| 55 void addChild(PassOwnPtr<CCLayerImpl>); | 56 void addChild(PassOwnPtr<CCLayerImpl>); |
| 56 void removeFromParent(); | 57 void removeFromParent(); |
| 57 void removeAllChildren(); | 58 void removeAllChildren(); |
| 58 | 59 |
| 59 void setMaskLayer(PassOwnPtr<CCLayerImpl>); | 60 void setMaskLayer(PassOwnPtr<CCLayerImpl>); |
| 60 CCLayerImpl* maskLayer() const { return m_maskLayer.get(); } | 61 CCLayerImpl* maskLayer() const { return m_maskLayer.get(); } |
| 61 | 62 |
| 62 void setReplicaLayer(PassOwnPtr<CCLayerImpl>); | 63 void setReplicaLayer(PassOwnPtr<CCLayerImpl>); |
| 63 CCLayerImpl* replicaLayer() const { return m_replicaLayer.get(); } | 64 CCLayerImpl* replicaLayer() const { return m_replicaLayer.get(); } |
| 64 | 65 |
| (...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 268 | 269 |
| 269 // Note carefully this does not affect the current layer. | 270 // Note carefully this does not affect the current layer. |
| 270 void noteLayerPropertyChangedForDescendants(); | 271 void noteLayerPropertyChangedForDescendants(); |
| 271 | 272 |
| 272 virtual const char* layerTypeAsString() const { return "LayerChromium"; } | 273 virtual const char* layerTypeAsString() const { return "LayerChromium"; } |
| 273 | 274 |
| 274 void dumpLayer(std::string*, int indent) const; | 275 void dumpLayer(std::string*, int indent) const; |
| 275 | 276 |
| 276 // Properties internal to CCLayerImpl | 277 // Properties internal to CCLayerImpl |
| 277 CCLayerImpl* m_parent; | 278 CCLayerImpl* m_parent; |
| 278 Vector<OwnPtr<CCLayerImpl> > m_children; | 279 OwnPtrVector<CCLayerImpl> m_children; |
| 279 // m_maskLayer can be temporarily stolen during tree sync, we need this ID t
o confirm newly assigned layer is still the previous one | 280 // m_maskLayer can be temporarily stolen during tree sync, we need this ID t
o confirm newly assigned layer is still the previous one |
| 280 int m_maskLayerId; | 281 int m_maskLayerId; |
| 281 OwnPtr<CCLayerImpl> m_maskLayer; | 282 OwnPtr<CCLayerImpl> m_maskLayer; |
| 282 int m_replicaLayerId; // ditto | 283 int m_replicaLayerId; // ditto |
| 283 OwnPtr<CCLayerImpl> m_replicaLayer; | 284 OwnPtr<CCLayerImpl> m_replicaLayer; |
| 284 int m_layerId; | 285 int m_layerId; |
| 285 CCLayerTreeHostImpl* m_layerTreeHostImpl; | 286 CCLayerTreeHostImpl* m_layerTreeHostImpl; |
| 286 | 287 |
| 287 // Properties synchronized from the associated LayerChromium. | 288 // Properties synchronized from the associated LayerChromium. |
| 288 FloatPoint m_anchorPoint; | 289 FloatPoint m_anchorPoint; |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 382 | 383 |
| 383 // Manages scrollbars for this layer | 384 // Manages scrollbars for this layer |
| 384 OwnPtr<CCScrollbarAnimationController> m_scrollbarAnimationController; | 385 OwnPtr<CCScrollbarAnimationController> m_scrollbarAnimationController; |
| 385 }; | 386 }; |
| 386 | 387 |
| 387 void sortLayers(Vector<CCLayerImpl*>::iterator first, Vector<CCLayerImpl*>::iter
ator end, CCLayerSorter*); | 388 void sortLayers(Vector<CCLayerImpl*>::iterator first, Vector<CCLayerImpl*>::iter
ator end, CCLayerSorter*); |
| 388 | 389 |
| 389 } | 390 } |
| 390 | 391 |
| 391 #endif // CCLayerImpl_h | 392 #endif // CCLayerImpl_h |
| OLD | NEW |