OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 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 are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 25 matching lines...) Expand all Loading... |
36 #include "platform/geometry/FloatPoint.h" | 36 #include "platform/geometry/FloatPoint.h" |
37 #include "platform/geometry/FloatRect.h" | 37 #include "platform/geometry/FloatRect.h" |
38 #include "platform/geometry/IntSize.h" | 38 #include "platform/geometry/IntSize.h" |
39 #include "platform/graphics/GraphicsLayerClient.h" | 39 #include "platform/graphics/GraphicsLayerClient.h" |
40 #include "platform/scroll/ScrollableArea.h" | 40 #include "platform/scroll/ScrollableArea.h" |
41 #include "public/platform/WebScrollbar.h" | 41 #include "public/platform/WebScrollbar.h" |
42 #include "public/platform/WebSize.h" | 42 #include "public/platform/WebSize.h" |
43 #include <memory> | 43 #include <memory> |
44 | 44 |
45 namespace blink { | 45 namespace blink { |
46 class WebLayerTreeView; | |
47 class WebScrollbarLayer; | 46 class WebScrollbarLayer; |
| 47 class WebLayer; |
48 } | 48 } |
49 | 49 |
50 namespace blink { | 50 namespace blink { |
51 | 51 |
52 class FrameHost; | 52 class FrameHost; |
53 class GraphicsContext; | 53 class GraphicsContext; |
54 class GraphicsLayer; | 54 class GraphicsLayer; |
55 class IntRect; | 55 class IntRect; |
56 class IntSize; | 56 class IntSize; |
57 class LocalFrame; | 57 class LocalFrame; |
(...skipping 24 matching lines...) Expand all Loading... |
82 return m_rootTransformLayer.get(); | 82 return m_rootTransformLayer.get(); |
83 } | 83 } |
84 GraphicsLayer* containerLayer() | 84 GraphicsLayer* containerLayer() |
85 { | 85 { |
86 return m_innerViewportContainerLayer.get(); | 86 return m_innerViewportContainerLayer.get(); |
87 } | 87 } |
88 GraphicsLayer* scrollLayer() | 88 GraphicsLayer* scrollLayer() |
89 { | 89 { |
90 return m_innerViewportScrollLayer.get(); | 90 return m_innerViewportScrollLayer.get(); |
91 } | 91 } |
| 92 GraphicsLayer* pageScaleLayer() |
| 93 { |
| 94 return m_pageScaleLayer.get(); |
| 95 } |
| 96 GraphicsLayer* overscrollElasticityLayer() |
| 97 { |
| 98 return m_overscrollElasticityLayer.get(); |
| 99 } |
92 | 100 |
93 void initializeScrollbars(); | 101 void initializeScrollbars(); |
94 | 102 |
95 // Sets the location of the visual viewport relative to the outer viewport.
The | 103 // Sets the location of the visual viewport relative to the outer viewport.
The |
96 // coordinates are in partial CSS pixels. | 104 // coordinates are in partial CSS pixels. |
97 void setLocation(const FloatPoint&); | 105 void setLocation(const FloatPoint&); |
98 // FIXME: This should be called moveBy | 106 // FIXME: This should be called moveBy |
99 void move(const FloatPoint&); | 107 void move(const FloatPoint&); |
100 void move(const FloatSize&); | 108 void move(const FloatSize&); |
101 FloatPoint location() const { return m_offset; } | 109 FloatPoint location() const { return m_offset; } |
(...skipping 15 matching lines...) Expand all Loading... |
117 // Sets scale and location in one operation, preventing intermediate clampin
g. | 125 // Sets scale and location in one operation, preventing intermediate clampin
g. |
118 void setScaleAndLocation(float scale, const FloatPoint& location); | 126 void setScaleAndLocation(float scale, const FloatPoint& location); |
119 void setScale(float); | 127 void setScale(float); |
120 float scale() const { return m_scale; } | 128 float scale() const { return m_scale; } |
121 | 129 |
122 // Update scale factor, magnifying or minifying by magnifyDelta, centered ar
ound | 130 // Update scale factor, magnifying or minifying by magnifyDelta, centered ar
ound |
123 // the point specified by anchor in window coordinates. Returns false if pag
e | 131 // the point specified by anchor in window coordinates. Returns false if pag
e |
124 // scale factor is left unchanged. | 132 // scale factor is left unchanged. |
125 bool magnifyScaleAroundAnchor(float magnifyDelta, const FloatPoint& anchor); | 133 bool magnifyScaleAroundAnchor(float magnifyDelta, const FloatPoint& anchor); |
126 | 134 |
127 void registerLayersWithTreeView(WebLayerTreeView*) const; | 135 void setScrollLayerOnScrollbars(WebLayer*) const; |
128 void clearLayersForTreeView(WebLayerTreeView*) const; | |
129 | 136 |
130 // The portion of the unzoomed frame visible in the visual viewport, | 137 // The portion of the unzoomed frame visible in the visual viewport, |
131 // in partial CSS pixels. Relative to the main frame. | 138 // in partial CSS pixels. Relative to the main frame. |
132 FloatRect visibleRect() const; | 139 FloatRect visibleRect() const; |
133 | 140 |
134 // The viewport rect relative to the document origin, in partial CSS pixels. | 141 // The viewport rect relative to the document origin, in partial CSS pixels. |
135 // FIXME: This should be a DoubleRect since scroll offsets are now doubles. | 142 // FIXME: This should be a DoubleRect since scroll offsets are now doubles. |
136 FloatRect visibleRectInDocument() const; | 143 FloatRect visibleRectInDocument() const; |
137 | 144 |
138 // Convert the given rect in the main FrameView's coordinates into a rect | 145 // Convert the given rect in the main FrameView's coordinates into a rect |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
259 float m_scale; | 266 float m_scale; |
260 IntSize m_size; | 267 IntSize m_size; |
261 float m_topControlsAdjustment; | 268 float m_topControlsAdjustment; |
262 float m_maxPageScale; | 269 float m_maxPageScale; |
263 bool m_trackPinchZoomStatsForPage; | 270 bool m_trackPinchZoomStatsForPage; |
264 }; | 271 }; |
265 | 272 |
266 } // namespace blink | 273 } // namespace blink |
267 | 274 |
268 #endif // VisualViewport_h | 275 #endif // VisualViewport_h |
OLD | NEW |