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 "TextStream.h" | 17 #include "TextStream.h" |
18 #include <public/WebFilterOperations.h> | 18 #include <public/WebFilterOperations.h> |
19 #include <public/WebTransformationMatrix.h> | 19 #include <public/WebTransformationMatrix.h> |
20 #include <wtf/OwnPtr.h> | 20 #include <wtf/OwnPtr.h> |
21 #include <wtf/PassRefPtr.h> | 21 #include <wtf/PassRefPtr.h> |
22 #include <wtf/RefCounted.h> | 22 #include <wtf/RefCounted.h> |
23 #include <wtf/text/WTFString.h> | 23 #include <wtf/text/WTFString.h> |
24 | 24 |
25 namespace WebCore { | 25 namespace WebCore { |
26 | 26 |
27 class CCLayerSorter; | 27 class CCLayerSorter; |
28 class CCLayerTreeHostImpl; | 28 class CCLayerTreeHostImpl; |
| 29 class CCQuadSink; |
29 class CCRenderer; | 30 class CCRenderer; |
30 class CCQuadSink; | |
31 class CCScrollbarAnimationController; | 31 class CCScrollbarAnimationController; |
32 class CCScrollbarLayerImpl; | 32 class CCScrollbarLayerImpl; |
33 class LayerChromium; | 33 class LayerChromium; |
34 | 34 |
| 35 struct CCAppendQuadsData; |
| 36 |
35 class CCLayerImpl : public CCLayerAnimationControllerClient { | 37 class CCLayerImpl : public CCLayerAnimationControllerClient { |
36 public: | 38 public: |
37 static PassOwnPtr<CCLayerImpl> create(int id) | 39 static PassOwnPtr<CCLayerImpl> create(int id) |
38 { | 40 { |
39 return adoptPtr(new CCLayerImpl(id)); | 41 return adoptPtr(new CCLayerImpl(id)); |
40 } | 42 } |
41 | 43 |
42 virtual ~CCLayerImpl(); | 44 virtual ~CCLayerImpl(); |
43 | 45 |
44 // CCLayerAnimationControllerClient implementation. | 46 // CCLayerAnimationControllerClient implementation. |
(...skipping 22 matching lines...) Expand all Loading... |
67 | 69 |
68 CCLayerTreeHostImpl* layerTreeHostImpl() const { return m_layerTreeHostImpl;
} | 70 CCLayerTreeHostImpl* layerTreeHostImpl() const { return m_layerTreeHostImpl;
} |
69 void setLayerTreeHostImpl(CCLayerTreeHostImpl* hostImpl) { m_layerTreeHostIm
pl = hostImpl; } | 71 void setLayerTreeHostImpl(CCLayerTreeHostImpl* hostImpl) { m_layerTreeHostIm
pl = hostImpl; } |
70 | 72 |
71 PassOwnPtr<CCSharedQuadState> createSharedQuadState() const; | 73 PassOwnPtr<CCSharedQuadState> createSharedQuadState() const; |
72 // willDraw must be called before appendQuads. If willDraw is called, | 74 // willDraw must be called before appendQuads. If willDraw is called, |
73 // didDraw is guaranteed to be called before another willDraw or before | 75 // didDraw is guaranteed to be called before another willDraw or before |
74 // the layer is destroyed. To enforce this, any class that overrides | 76 // the layer is destroyed. To enforce this, any class that overrides |
75 // willDraw/didDraw must call the base class version. | 77 // willDraw/didDraw must call the base class version. |
76 virtual void willDraw(CCResourceProvider*); | 78 virtual void willDraw(CCResourceProvider*); |
77 virtual void appendQuads(CCQuadSink&, bool& hadMissingTiles) { } | 79 virtual void appendQuads(CCQuadSink&, CCAppendQuadsData&) { } |
78 virtual void didDraw(CCResourceProvider*); | 80 virtual void didDraw(CCResourceProvider*); |
79 | 81 |
80 virtual CCResourceProvider::ResourceId contentsResourceId() const; | 82 virtual CCResourceProvider::ResourceId contentsResourceId() const; |
81 | 83 |
82 // Returns true if this layer has content to draw. | 84 // Returns true if this layer has content to draw. |
83 void setDrawsContent(bool); | 85 void setDrawsContent(bool); |
84 bool drawsContent() const { return m_drawsContent; } | 86 bool drawsContent() const { return m_drawsContent; } |
85 | 87 |
86 bool forceRenderSurface() const { return m_forceRenderSurface; } | 88 bool forceRenderSurface() const { return m_forceRenderSurface; } |
87 void setForceRenderSurface(bool force) { m_forceRenderSurface = force; } | 89 void setForceRenderSurface(bool force) { m_forceRenderSurface = force; } |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
246 | 248 |
247 CCScrollbarLayerImpl* horizontalScrollbarLayer() const; | 249 CCScrollbarLayerImpl* horizontalScrollbarLayer() const; |
248 void setHorizontalScrollbarLayer(CCScrollbarLayerImpl*); | 250 void setHorizontalScrollbarLayer(CCScrollbarLayerImpl*); |
249 | 251 |
250 CCScrollbarLayerImpl* verticalScrollbarLayer() const; | 252 CCScrollbarLayerImpl* verticalScrollbarLayer() const; |
251 void setVerticalScrollbarLayer(CCScrollbarLayerImpl*); | 253 void setVerticalScrollbarLayer(CCScrollbarLayerImpl*); |
252 | 254 |
253 protected: | 255 protected: |
254 explicit CCLayerImpl(int); | 256 explicit CCLayerImpl(int); |
255 | 257 |
256 void appendDebugBorderQuad(CCQuadSink&, const CCSharedQuadState*) const; | 258 void appendDebugBorderQuad(CCQuadSink&, const CCSharedQuadState*, CCAppendQu
adsData&) const; |
257 | 259 |
258 virtual void dumpLayerProperties(TextStream&, int indent) const; | 260 virtual void dumpLayerProperties(TextStream&, int indent) const; |
259 static void writeIndent(TextStream&, int indent); | 261 static void writeIndent(TextStream&, int indent); |
260 | 262 |
261 private: | 263 private: |
262 void setParent(CCLayerImpl* parent) { m_parent = parent; } | 264 void setParent(CCLayerImpl* parent) { m_parent = parent; } |
263 friend class TreeSynchronizer; | 265 friend class TreeSynchronizer; |
264 void clearChildList(); // Warning: This does not preserve tree structure inv
ariants and so is only exposed to the tree synchronizer. | 266 void clearChildList(); // Warning: This does not preserve tree structure inv
ariants and so is only exposed to the tree synchronizer. |
265 | 267 |
266 void noteLayerPropertyChangedForSubtree(); | 268 void noteLayerPropertyChangedForSubtree(); |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
381 | 383 |
382 // Manages scrollbars for this layer | 384 // Manages scrollbars for this layer |
383 OwnPtr<CCScrollbarAnimationController> m_scrollbarAnimationController; | 385 OwnPtr<CCScrollbarAnimationController> m_scrollbarAnimationController; |
384 }; | 386 }; |
385 | 387 |
386 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*); |
387 | 389 |
388 } | 390 } |
389 | 391 |
390 #endif // CCLayerImpl_h | 392 #endif // CCLayerImpl_h |
OLD | NEW |