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" |
(...skipping 25 matching lines...) Expand all Loading... |
36 class CCLayerImpl : public CCLayerAnimationControllerClient { | 36 class CCLayerImpl : public CCLayerAnimationControllerClient { |
37 public: | 37 public: |
38 static PassOwnPtr<CCLayerImpl> create(int id) | 38 static PassOwnPtr<CCLayerImpl> create(int id) |
39 { | 39 { |
40 return adoptPtr(new CCLayerImpl(id)); | 40 return adoptPtr(new CCLayerImpl(id)); |
41 } | 41 } |
42 | 42 |
43 virtual ~CCLayerImpl(); | 43 virtual ~CCLayerImpl(); |
44 | 44 |
45 // CCLayerAnimationControllerClient implementation. | 45 // CCLayerAnimationControllerClient implementation. |
46 virtual int id() const OVERRIDE { return m_layerId; } | 46 virtual int id() const OVERRIDE; |
47 virtual void setOpacityFromAnimation(float) OVERRIDE; | 47 virtual void setOpacityFromAnimation(float) OVERRIDE; |
48 virtual float opacity() const OVERRIDE { return m_opacity; } | 48 virtual float opacity() const OVERRIDE; |
49 virtual void setTransformFromAnimation(const WebKit::WebTransformationMatrix
&) OVERRIDE; | 49 virtual void setTransformFromAnimation(const WebKit::WebTransformationMatrix
&) OVERRIDE; |
50 virtual const WebKit::WebTransformationMatrix& transform() const OVERRIDE {
return m_transform; } | 50 virtual const WebKit::WebTransformationMatrix& transform() const OVERRIDE; |
51 | 51 |
52 // Tree structure. | 52 // Tree structure. |
53 CCLayerImpl* parent() const { return m_parent; } | 53 CCLayerImpl* parent() const { return m_parent; } |
54 const Vector<OwnPtr<CCLayerImpl> >& children() const { return m_children; } | 54 const Vector<OwnPtr<CCLayerImpl> >& children() const { return m_children; } |
55 void addChild(PassOwnPtr<CCLayerImpl>); | 55 void addChild(PassOwnPtr<CCLayerImpl>); |
56 void removeFromParent(); | 56 void removeFromParent(); |
57 void removeAllChildren(); | 57 void removeAllChildren(); |
58 | 58 |
59 void setMaskLayer(PassOwnPtr<CCLayerImpl>); | 59 void setMaskLayer(PassOwnPtr<CCLayerImpl>); |
60 CCLayerImpl* maskLayer() const { return m_maskLayer.get(); } | 60 CCLayerImpl* maskLayer() const { return m_maskLayer.get(); } |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
225 | 225 |
226 std::string layerTreeAsText() const; | 226 std::string layerTreeAsText() const; |
227 | 227 |
228 void setStackingOrderChanged(bool); | 228 void setStackingOrderChanged(bool); |
229 | 229 |
230 bool layerPropertyChanged() const { return m_layerPropertyChanged || layerIs
AlwaysDamaged(); } | 230 bool layerPropertyChanged() const { return m_layerPropertyChanged || layerIs
AlwaysDamaged(); } |
231 bool layerSurfacePropertyChanged() const; | 231 bool layerSurfacePropertyChanged() const; |
232 | 232 |
233 void resetAllChangeTrackingForSubtree(); | 233 void resetAllChangeTrackingForSubtree(); |
234 | 234 |
235 virtual bool layerIsAlwaysDamaged() const { return false; } | 235 virtual bool layerIsAlwaysDamaged() const; |
236 | 236 |
237 CCLayerAnimationController* layerAnimationController() { return m_layerAnima
tionController.get(); } | 237 CCLayerAnimationController* layerAnimationController() { return m_layerAnima
tionController.get(); } |
238 | 238 |
239 virtual Region visibleContentOpaqueRegion() const; | 239 virtual Region visibleContentOpaqueRegion() const; |
240 | 240 |
241 // Indicates that the context previously used to render this layer | 241 // Indicates that the context previously used to render this layer |
242 // was lost and that a new one has been created. Won't be called | 242 // was lost and that a new one has been created. Won't be called |
243 // until the new context has been created successfully. | 243 // until the new context has been created successfully. |
244 virtual void didLoseContext(); | 244 virtual void didLoseContext(); |
245 | 245 |
(...skipping 16 matching lines...) Expand all Loading... |
262 private: | 262 private: |
263 void setParent(CCLayerImpl* parent) { m_parent = parent; } | 263 void setParent(CCLayerImpl* parent) { m_parent = parent; } |
264 friend class TreeSynchronizer; | 264 friend class TreeSynchronizer; |
265 void clearChildList(); // Warning: This does not preserve tree structure inv
ariants and so is only exposed to the tree synchronizer. | 265 void clearChildList(); // Warning: This does not preserve tree structure inv
ariants and so is only exposed to the tree synchronizer. |
266 | 266 |
267 void noteLayerPropertyChangedForSubtree(); | 267 void noteLayerPropertyChangedForSubtree(); |
268 | 268 |
269 // Note carefully this does not affect the current layer. | 269 // Note carefully this does not affect the current layer. |
270 void noteLayerPropertyChangedForDescendants(); | 270 void noteLayerPropertyChangedForDescendants(); |
271 | 271 |
272 virtual const char* layerTypeAsString() const { return "LayerChromium"; } | 272 virtual const char* layerTypeAsString() const; |
273 | 273 |
274 void dumpLayer(std::string*, int indent) const; | 274 void dumpLayer(std::string*, int indent) const; |
275 | 275 |
276 // Properties internal to CCLayerImpl | 276 // Properties internal to CCLayerImpl |
277 CCLayerImpl* m_parent; | 277 CCLayerImpl* m_parent; |
278 Vector<OwnPtr<CCLayerImpl> > m_children; | 278 Vector<OwnPtr<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 | 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 int m_maskLayerId; | 280 int m_maskLayerId; |
281 OwnPtr<CCLayerImpl> m_maskLayer; | 281 OwnPtr<CCLayerImpl> m_maskLayer; |
282 int m_replicaLayerId; // ditto | 282 int m_replicaLayerId; // ditto |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
382 | 382 |
383 // Manages scrollbars for this layer | 383 // Manages scrollbars for this layer |
384 OwnPtr<CCScrollbarAnimationController> m_scrollbarAnimationController; | 384 OwnPtr<CCScrollbarAnimationController> m_scrollbarAnimationController; |
385 }; | 385 }; |
386 | 386 |
387 void sortLayers(Vector<CCLayerImpl*>::iterator first, Vector<CCLayerImpl*>::iter
ator end, CCLayerSorter*); | 387 void sortLayers(Vector<CCLayerImpl*>::iterator first, Vector<CCLayerImpl*>::iter
ator end, CCLayerSorter*); |
388 | 388 |
389 } | 389 } |
390 | 390 |
391 #endif // CCLayerImpl_h | 391 #endif // CCLayerImpl_h |
OLD | NEW |