OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
11 * documentation and/or other materials provided with the distribution. | 11 * documentation and/or other materials provided with the distribution. |
12 * | 12 * |
13 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND AN
Y | 13 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND AN
Y |
14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | 14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
15 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | 15 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
16 * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR AN
Y | 16 * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR AN
Y |
17 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | 17 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
18 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | 18 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
19 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND O
N | 19 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND O
N |
20 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 20 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
21 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | 21 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
22 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 22 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
23 */ | 23 */ |
24 | 24 |
25 #ifndef CCLayerTreeHostImpl_h | 25 #ifndef CCLayerTreeHostImpl_h |
26 #define CCLayerTreeHostImpl_h | 26 #define CCLayerTreeHostImpl_h |
27 | 27 |
| 28 #include "Color.h" |
28 #include "LayerRendererChromium.h" | 29 #include "LayerRendererChromium.h" |
29 #include "cc/CCAnimationEvents.h" | 30 #include "cc/CCAnimationEvents.h" |
30 #include "cc/CCInputHandler.h" | 31 #include "cc/CCInputHandler.h" |
31 #include "cc/CCLayerSorter.h" | 32 #include "cc/CCLayerSorter.h" |
32 #include "cc/CCLayerTreeHost.h" | 33 #include "cc/CCLayerTreeHost.h" |
33 #include "cc/CCLayerTreeHostCommon.h" | 34 #include "cc/CCLayerTreeHostCommon.h" |
34 #include "cc/CCRenderPass.h" | 35 #include "cc/CCRenderPass.h" |
35 #include <wtf/PassOwnPtr.h> | 36 #include <wtf/PassOwnPtr.h> |
36 #include <wtf/RefPtr.h> | 37 #include <wtf/RefPtr.h> |
37 | 38 |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 | 132 |
132 void setViewportSize(const IntSize&); | 133 void setViewportSize(const IntSize&); |
133 | 134 |
134 void setPageScaleFactorAndLimits(float pageScale, float minPageScale, float
maxPageScale); | 135 void setPageScaleFactorAndLimits(float pageScale, float minPageScale, float
maxPageScale); |
135 float pageScale() const { return m_pageScale; } | 136 float pageScale() const { return m_pageScale; } |
136 | 137 |
137 PassOwnPtr<CCScrollAndScaleSet> processScrollDeltas(); | 138 PassOwnPtr<CCScrollAndScaleSet> processScrollDeltas(); |
138 | 139 |
139 void startPageScaleAnimation(const IntSize& tragetPosition, bool useAnchor,
float scale, double durationSec); | 140 void startPageScaleAnimation(const IntSize& tragetPosition, bool useAnchor,
float scale, double durationSec); |
140 | 141 |
| 142 const Color& backgroundColor() const { return m_backgroundColor; } |
| 143 void setBackgroundColor(const Color& color) { m_backgroundColor = color; } |
| 144 |
141 bool needsAnimateLayers() const { return m_needsAnimateLayers; } | 145 bool needsAnimateLayers() const { return m_needsAnimateLayers; } |
142 void setNeedsAnimateLayers() { m_needsAnimateLayers = true; } | 146 void setNeedsAnimateLayers() { m_needsAnimateLayers = true; } |
143 | 147 |
144 void setNeedsRedraw(); | 148 void setNeedsRedraw(); |
145 | 149 |
146 protected: | 150 protected: |
147 CCLayerTreeHostImpl(const CCSettings&, CCLayerTreeHostImplClient*); | 151 CCLayerTreeHostImpl(const CCSettings&, CCLayerTreeHostImplClient*); |
148 | 152 |
149 void animatePageScale(double monotonicTime); | 153 void animatePageScale(double monotonicTime); |
150 void animateGestures(double monotonicTime); | 154 void animateGestures(double monotonicTime); |
(...skipping 26 matching lines...) Expand all Loading... |
177 CCLayerImpl* m_scrollLayerImpl; | 181 CCLayerImpl* m_scrollLayerImpl; |
178 CCSettings m_settings; | 182 CCSettings m_settings; |
179 IntSize m_viewportSize; | 183 IntSize m_viewportSize; |
180 bool m_visible; | 184 bool m_visible; |
181 | 185 |
182 float m_pageScale; | 186 float m_pageScale; |
183 float m_pageScaleDelta; | 187 float m_pageScaleDelta; |
184 float m_sentPageScaleDelta; | 188 float m_sentPageScaleDelta; |
185 float m_minPageScale, m_maxPageScale; | 189 float m_minPageScale, m_maxPageScale; |
186 | 190 |
| 191 Color m_backgroundColor; |
| 192 |
187 // If this is true, it is necessary to traverse the layer tree ticking the a
nimators. | 193 // If this is true, it is necessary to traverse the layer tree ticking the a
nimators. |
188 bool m_needsAnimateLayers; | 194 bool m_needsAnimateLayers; |
189 bool m_pinchGestureActive; | 195 bool m_pinchGestureActive; |
190 IntPoint m_previousPinchAnchor; | 196 IntPoint m_previousPinchAnchor; |
191 | 197 |
192 OwnPtr<CCPageScaleAnimation> m_pageScaleAnimation; | 198 OwnPtr<CCPageScaleAnimation> m_pageScaleAnimation; |
193 OwnPtr<CCActiveGestureAnimation> m_activeGestureAnimation; | 199 OwnPtr<CCActiveGestureAnimation> m_activeGestureAnimation; |
194 | 200 |
195 // This is used for ticking animations slowly when hidden. | 201 // This is used for ticking animations slowly when hidden. |
196 OwnPtr<CCLayerTreeHostImplTimeSourceAdapter> m_timeSourceClientAdapter; | 202 OwnPtr<CCLayerTreeHostImplTimeSourceAdapter> m_timeSourceClientAdapter; |
197 | 203 |
198 CCLayerSorter m_layerSorter; | 204 CCLayerSorter m_layerSorter; |
199 | 205 |
200 FloatRect m_rootDamageRect; | 206 FloatRect m_rootDamageRect; |
201 }; | 207 }; |
202 | 208 |
203 }; | 209 }; |
204 | 210 |
205 #endif | 211 #endif |
OLD | NEW |