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 | 5 |
6 #ifndef LayerChromium_h | 6 #ifndef LayerChromium_h |
7 #define LayerChromium_h | 7 #define LayerChromium_h |
8 | 8 |
9 #if USE(ACCELERATED_COMPOSITING) | 9 #if USE(ACCELERATED_COMPOSITING) |
10 | 10 |
(...skipping 10 matching lines...) Expand all Loading... |
21 #include <wtf/OwnPtr.h> | 21 #include <wtf/OwnPtr.h> |
22 #include <wtf/PassOwnPtr.h> | 22 #include <wtf/PassOwnPtr.h> |
23 #include <wtf/PassRefPtr.h> | 23 #include <wtf/PassRefPtr.h> |
24 #include <wtf/RefCounted.h> | 24 #include <wtf/RefCounted.h> |
25 #include <wtf/Vector.h> | 25 #include <wtf/Vector.h> |
26 #include <wtf/text/StringHash.h> | 26 #include <wtf/text/StringHash.h> |
27 #include <wtf/text/WTFString.h> | 27 #include <wtf/text/WTFString.h> |
28 | 28 |
29 namespace WebKit { | 29 namespace WebKit { |
30 class WebAnimationDelegate; | 30 class WebAnimationDelegate; |
| 31 class WebLayerScrollClient; |
31 } | 32 } |
32 | 33 |
33 namespace WebCore { | 34 namespace WebCore { |
34 | 35 |
35 class CCActiveAnimation; | 36 class CCActiveAnimation; |
36 struct CCAnimationEvent; | 37 struct CCAnimationEvent; |
37 class CCLayerAnimationDelegate; | 38 class CCLayerAnimationDelegate; |
38 class CCLayerImpl; | 39 class CCLayerImpl; |
39 class CCLayerTreeHost; | 40 class CCLayerTreeHost; |
40 class CCTextureUpdateQueue; | 41 class CCTextureUpdateQueue; |
41 class ScrollbarLayerChromium; | 42 class ScrollbarLayerChromium; |
42 struct CCAnimationEvent; | 43 struct CCAnimationEvent; |
43 struct CCRenderingStats; | 44 struct CCRenderingStats; |
44 | 45 |
45 // Delegate for handling scroll input for a LayerChromium. | |
46 class LayerChromiumScrollDelegate { | |
47 public: | |
48 virtual void didScroll(const IntSize&) = 0; | |
49 | |
50 protected: | |
51 virtual ~LayerChromiumScrollDelegate() { } | |
52 }; | |
53 | |
54 // Base class for composited layers. Special layer types are derived from | 46 // Base class for composited layers. Special layer types are derived from |
55 // this class. | 47 // this class. |
56 class LayerChromium : public RefCounted<LayerChromium>, public CCLayerAnimationC
ontrollerClient { | 48 class LayerChromium : public RefCounted<LayerChromium>, public CCLayerAnimationC
ontrollerClient { |
57 public: | 49 public: |
58 static PassRefPtr<LayerChromium> create(); | 50 static PassRefPtr<LayerChromium> create(); |
59 | 51 |
60 virtual ~LayerChromium(); | 52 virtual ~LayerChromium(); |
61 | 53 |
62 // CCLayerAnimationControllerClient implementation | 54 // CCLayerAnimationControllerClient implementation |
63 virtual int id() const OVERRIDE { return m_layerId; } | 55 virtual int id() const OVERRIDE { return m_layerId; } |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 void setMaxScrollPosition(const IntSize&); | 134 void setMaxScrollPosition(const IntSize&); |
143 const IntSize& maxScrollPosition() const { return m_maxScrollPosition; } | 135 const IntSize& maxScrollPosition() const { return m_maxScrollPosition; } |
144 | 136 |
145 void setScrollable(bool); | 137 void setScrollable(bool); |
146 bool scrollable() const { return m_scrollable; } | 138 bool scrollable() const { return m_scrollable; } |
147 void setShouldScrollOnMainThread(bool); | 139 void setShouldScrollOnMainThread(bool); |
148 void setHaveWheelEventHandlers(bool); | 140 void setHaveWheelEventHandlers(bool); |
149 const Region& nonFastScrollableRegion() { return m_nonFastScrollableRegion;
} | 141 const Region& nonFastScrollableRegion() { return m_nonFastScrollableRegion;
} |
150 void setNonFastScrollableRegion(const Region&); | 142 void setNonFastScrollableRegion(const Region&); |
151 void setNonFastScrollableRegionChanged() { m_nonFastScrollableRegionChanged
= true; } | 143 void setNonFastScrollableRegionChanged() { m_nonFastScrollableRegionChanged
= true; } |
152 void setLayerScrollDelegate(LayerChromiumScrollDelegate* layerScrollDelegate
) { m_layerScrollDelegate = layerScrollDelegate; } | 144 void setLayerScrollClient(WebKit::WebLayerScrollClient* layerScrollClient) {
m_layerScrollClient = layerScrollClient; } |
153 void scrollBy(const IntSize&); | |
154 | 145 |
155 void setDrawCheckerboardForMissingTiles(bool); | 146 void setDrawCheckerboardForMissingTiles(bool); |
156 bool drawCheckerboardForMissingTiles() const { return m_drawCheckerboardForM
issingTiles; } | 147 bool drawCheckerboardForMissingTiles() const { return m_drawCheckerboardForM
issingTiles; } |
157 | 148 |
158 bool forceRenderSurface() const { return m_forceRenderSurface; } | 149 bool forceRenderSurface() const { return m_forceRenderSurface; } |
159 void setForceRenderSurface(bool); | 150 void setForceRenderSurface(bool); |
160 | 151 |
161 IntSize scrollDelta() const { return IntSize(); } | 152 IntSize scrollDelta() const { return IntSize(); } |
162 | 153 |
163 float pageScaleDelta() const { return 1; } | 154 float pageScaleDelta() const { return 1; } |
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
363 WebKit::WebTransformationMatrix m_drawTransform; | 354 WebKit::WebTransformationMatrix m_drawTransform; |
364 WebKit::WebTransformationMatrix m_screenSpaceTransform; | 355 WebKit::WebTransformationMatrix m_screenSpaceTransform; |
365 bool m_drawTransformIsAnimating; | 356 bool m_drawTransformIsAnimating; |
366 bool m_screenSpaceTransformIsAnimating; | 357 bool m_screenSpaceTransformIsAnimating; |
367 | 358 |
368 // Uses target surface space. | 359 // Uses target surface space. |
369 IntRect m_drawableContentRect; | 360 IntRect m_drawableContentRect; |
370 float m_contentsScale; | 361 float m_contentsScale; |
371 | 362 |
372 WebKit::WebAnimationDelegate* m_layerAnimationDelegate; | 363 WebKit::WebAnimationDelegate* m_layerAnimationDelegate; |
373 LayerChromiumScrollDelegate* m_layerScrollDelegate; | 364 WebKit::WebLayerScrollClient* m_layerScrollClient; |
374 }; | 365 }; |
375 | 366 |
376 void sortLayers(Vector<RefPtr<LayerChromium> >::iterator, Vector<RefPtr<LayerChr
omium> >::iterator, void*); | 367 void sortLayers(Vector<RefPtr<LayerChromium> >::iterator, Vector<RefPtr<LayerChr
omium> >::iterator, void*); |
377 | 368 |
378 } | 369 } |
379 #endif // USE(ACCELERATED_COMPOSITING) | 370 #endif // USE(ACCELERATED_COMPOSITING) |
380 | 371 |
381 #endif | 372 #endif |
OLD | NEW |