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 CC_LAYER_TREE_HOST_IMPL_H_ | 5 #ifndef CC_LAYER_TREE_HOST_IMPL_H_ |
6 #define CC_LAYER_TREE_HOST_IMPL_H_ | 6 #define CC_LAYER_TREE_HOST_IMPL_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/time.h" | 10 #include "base/time.h" |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 | 93 |
94 // Apply the scroll offset in layout space to the offset of the pinch-zoom v
iewport. The viewport cannot be | 94 // Apply the scroll offset in layout space to the offset of the pinch-zoom v
iewport. The viewport cannot be |
95 // scrolled outside of the layout viewport bounds. Returns the component of
the scroll that is un-applied due to | 95 // scrolled outside of the layout viewport bounds. Returns the component of
the scroll that is un-applied due to |
96 // this constraint. | 96 // this constraint. |
97 gfx::Vector2dF applyScroll(const gfx::Vector2dF&); | 97 gfx::Vector2dF applyScroll(const gfx::Vector2dF&); |
98 | 98 |
99 // The implTransform goes from the origin of the unzoomedDeviceViewport to t
he | 99 // The implTransform goes from the origin of the unzoomedDeviceViewport to t
he |
100 // origin of the zoomedDeviceViewport. | 100 // origin of the zoomedDeviceViewport. |
101 // | 101 // |
102 // implTransform = S[pageScale] * Tr[-zoomedDeviceViewportOffset] | 102 // implTransform = S[pageScale] * Tr[-zoomedDeviceViewportOffset] |
103 WebKit::WebTransformationMatrix implTransform(bool pageScalePinchZoomEnabled
) const; | 103 gfx::Transform implTransform(bool pageScalePinchZoomEnabled) const; |
104 | 104 |
105 private: | 105 private: |
106 float m_pageScaleFactor; | 106 float m_pageScaleFactor; |
107 float m_pageScaleDelta; | 107 float m_pageScaleDelta; |
108 float m_sentPageScaleDelta; | 108 float m_sentPageScaleDelta; |
109 float m_maxPageScaleFactor; | 109 float m_maxPageScaleFactor; |
110 float m_minPageScaleFactor; | 110 float m_minPageScaleFactor; |
111 float m_deviceScaleFactor; | 111 float m_deviceScaleFactor; |
112 | 112 |
113 gfx::Vector2dF m_zoomedViewportOffset; | 113 gfx::Vector2dF m_zoomedViewportOffset; |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
221 void setViewportSize(const gfx::Size& layoutViewportSize, const gfx::Size& d
eviceViewportSize); | 221 void setViewportSize(const gfx::Size& layoutViewportSize, const gfx::Size& d
eviceViewportSize); |
222 const gfx::Size& layoutViewportSize() const { return m_layoutViewportSize; } | 222 const gfx::Size& layoutViewportSize() const { return m_layoutViewportSize; } |
223 | 223 |
224 float deviceScaleFactor() const { return m_deviceScaleFactor; } | 224 float deviceScaleFactor() const { return m_deviceScaleFactor; } |
225 void setDeviceScaleFactor(float); | 225 void setDeviceScaleFactor(float); |
226 | 226 |
227 float pageScaleFactor() const; | 227 float pageScaleFactor() const; |
228 void setPageScaleFactorAndLimits(float pageScaleFactor, float minPageScaleFa
ctor, float maxPageScaleFactor); | 228 void setPageScaleFactorAndLimits(float pageScaleFactor, float minPageScaleFa
ctor, float maxPageScaleFactor); |
229 | 229 |
230 scoped_ptr<ScrollAndScaleSet> processScrollDeltas(); | 230 scoped_ptr<ScrollAndScaleSet> processScrollDeltas(); |
231 WebKit::WebTransformationMatrix implTransform() const; | 231 gfx::Transform implTransform() const; |
232 | 232 |
233 void startPageScaleAnimation(gfx::Vector2d targetOffset, bool useAnchor, flo
at scale, base::TimeDelta duration); | 233 void startPageScaleAnimation(gfx::Vector2d targetOffset, bool useAnchor, flo
at scale, base::TimeDelta duration); |
234 | 234 |
235 SkColor backgroundColor() const { return m_backgroundColor; } | 235 SkColor backgroundColor() const { return m_backgroundColor; } |
236 void setBackgroundColor(SkColor color) { m_backgroundColor = color; } | 236 void setBackgroundColor(SkColor color) { m_backgroundColor = color; } |
237 | 237 |
238 bool hasTransparentBackground() const { return m_hasTransparentBackground; } | 238 bool hasTransparentBackground() const { return m_hasTransparentBackground; } |
239 void setHasTransparentBackground(bool transparent) { m_hasTransparentBackgro
und = transparent; } | 239 void setHasTransparentBackground(bool transparent) { m_hasTransparentBackgro
und = transparent; } |
240 | 240 |
241 bool needsAnimateLayers() const { return m_needsAnimateLayers; } | 241 bool needsAnimateLayers() const { return m_needsAnimateLayers; } |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
370 | 370 |
371 size_t m_numImplThreadScrolls; | 371 size_t m_numImplThreadScrolls; |
372 size_t m_numMainThreadScrolls; | 372 size_t m_numMainThreadScrolls; |
373 | 373 |
374 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl); | 374 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl); |
375 }; | 375 }; |
376 | 376 |
377 } // namespace cc | 377 } // namespace cc |
378 | 378 |
379 #endif // CC_LAYER_TREE_HOST_IMPL_H_ | 379 #endif // CC_LAYER_TREE_HOST_IMPL_H_ |
OLD | NEW |