OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009 Apple Inc. All rights reserved. | 2 * Copyright (C) 2009 Apple 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 |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 GraphicsLayer* fixedRootBackgroundLayer() const; | 116 GraphicsLayer* fixedRootBackgroundLayer() const; |
117 void setNeedsUpdateFixedBackground() { m_needsUpdateFixedBackground = true; } | 117 void setNeedsUpdateFixedBackground() { m_needsUpdateFixedBackground = true; } |
118 | 118 |
119 // Issue paint invalidations of the appropriate layers when the given Layer | 119 // Issue paint invalidations of the appropriate layers when the given Layer |
120 // starts or stops being composited. | 120 // starts or stops being composited. |
121 void paintInvalidationOnCompositingChange(PaintLayer*); | 121 void paintInvalidationOnCompositingChange(PaintLayer*); |
122 | 122 |
123 void fullyInvalidatePaint(); | 123 void fullyInvalidatePaint(); |
124 | 124 |
125 PaintLayer* rootLayer() const; | 125 PaintLayer* rootLayer() const; |
| 126 |
| 127 GraphicsLayer* containerLayer() const { return m_containerLayer.get(); } |
| 128 GraphicsLayer* frameScrollLayer() const { return m_scrollLayer.get(); } |
| 129 GraphicsLayer* rootContentLayer() const { return m_rootContentLayer.get(); } |
| 130 GraphicsLayer* layerForHorizontalScrollbar() const { |
| 131 return m_layerForHorizontalScrollbar.get(); |
| 132 } |
| 133 GraphicsLayer* layerForVerticalScrollbar() const { |
| 134 return m_layerForVerticalScrollbar.get(); |
| 135 } |
| 136 GraphicsLayer* layerForScrollCorner() const { |
| 137 return m_layerForScrollCorner.get(); |
| 138 } |
| 139 |
| 140 // In root layer scrolling mode, returns the LayoutView's main GraphicsLayer. |
| 141 // In non-RLS mode, returns the outermost PaintLayerCompositor layer. |
126 GraphicsLayer* rootGraphicsLayer() const; | 142 GraphicsLayer* rootGraphicsLayer() const; |
127 GraphicsLayer* frameScrollLayer() const; | 143 |
| 144 // In root layer scrolling mode, this is the LayoutView's scroll layer. |
| 145 // In non-RLS mode, this is the same as frameScrollLayer(). |
128 GraphicsLayer* scrollLayer() const; | 146 GraphicsLayer* scrollLayer() const; |
129 GraphicsLayer* containerLayer() const; | |
130 GraphicsLayer* rootContentLayer() const; | |
131 | 147 |
132 enum RootLayerAttachment { | 148 enum RootLayerAttachment { |
133 RootLayerUnattached, | 149 RootLayerUnattached, |
134 RootLayerAttachedViaChromeClient, | 150 RootLayerAttachedViaChromeClient, |
135 RootLayerAttachedViaEnclosingFrame | 151 RootLayerAttachedViaEnclosingFrame |
136 }; | 152 }; |
137 | 153 |
138 RootLayerAttachment getRootLayerAttachment() const { | 154 RootLayerAttachment getRootLayerAttachment() const { |
139 return m_rootLayerAttachment; | 155 return m_rootLayerAttachment; |
140 } | 156 } |
(...skipping 17 matching lines...) Expand all Loading... |
158 void frameViewDidChangeLocation(const IntPoint& contentsOffset); | 174 void frameViewDidChangeLocation(const IntPoint& contentsOffset); |
159 void frameViewDidChangeSize(); | 175 void frameViewDidChangeSize(); |
160 void frameViewDidScroll(); | 176 void frameViewDidScroll(); |
161 void frameViewScrollbarsExistenceDidChange(); | 177 void frameViewScrollbarsExistenceDidChange(); |
162 void rootFixedBackgroundsChanged(); | 178 void rootFixedBackgroundsChanged(); |
163 | 179 |
164 bool scrollingLayerDidChange(PaintLayer*); | 180 bool scrollingLayerDidChange(PaintLayer*); |
165 | 181 |
166 std::unique_ptr<JSONObject> layerTreeAsJSON(LayerTreeFlags) const; | 182 std::unique_ptr<JSONObject> layerTreeAsJSON(LayerTreeFlags) const; |
167 | 183 |
168 GraphicsLayer* layerForHorizontalScrollbar() const { | |
169 return m_layerForHorizontalScrollbar.get(); | |
170 } | |
171 GraphicsLayer* layerForVerticalScrollbar() const { | |
172 return m_layerForVerticalScrollbar.get(); | |
173 } | |
174 GraphicsLayer* layerForScrollCorner() const { | |
175 return m_layerForScrollCorner.get(); | |
176 } | |
177 | |
178 void setTracksRasterInvalidations(bool); | 184 void setTracksRasterInvalidations(bool); |
179 | 185 |
180 String debugName(const GraphicsLayer*) const override; | 186 String debugName(const GraphicsLayer*) const override; |
181 DocumentLifecycle& lifecycle() const; | 187 DocumentLifecycle& lifecycle() const; |
182 | 188 |
183 void updatePotentialCompositingReasonsFromStyle(PaintLayer*); | 189 void updatePotentialCompositingReasonsFromStyle(PaintLayer*); |
184 | 190 |
185 // Whether the layer could ever be composited. | 191 // Whether the layer could ever be composited. |
186 bool canBeComposited(const PaintLayer*) const; | 192 bool canBeComposited(const PaintLayer*) const; |
187 | 193 |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
240 | 246 |
241 void updateContainerSizes(); | 247 void updateContainerSizes(); |
242 | 248 |
243 // Checks the given graphics layer against the compositor's horizontal and | 249 // Checks the given graphics layer against the compositor's horizontal and |
244 // vertical scrollbar graphics layers, returning the associated Scrollbar | 250 // vertical scrollbar graphics layers, returning the associated Scrollbar |
245 // instance if any, else nullptr. | 251 // instance if any, else nullptr. |
246 Scrollbar* graphicsLayerToScrollbar(const GraphicsLayer*) const; | 252 Scrollbar* graphicsLayerToScrollbar(const GraphicsLayer*) const; |
247 | 253 |
248 bool isMainFrame() const; | 254 bool isMainFrame() const; |
249 VisualViewport& visualViewport() const; | 255 VisualViewport& visualViewport() const; |
| 256 GraphicsLayer* parentForContentLayers() const; |
250 | 257 |
251 LayoutView& m_layoutView; | 258 LayoutView& m_layoutView; |
252 std::unique_ptr<GraphicsLayer> m_rootContentLayer; | |
253 | 259 |
254 CompositingReasonFinder m_compositingReasonFinder; | 260 CompositingReasonFinder m_compositingReasonFinder; |
255 | 261 |
256 CompositingUpdateType m_pendingUpdateType; | 262 CompositingUpdateType m_pendingUpdateType; |
257 | 263 |
258 bool m_hasAcceleratedCompositing; | 264 bool m_hasAcceleratedCompositing; |
259 bool m_compositing; | 265 bool m_compositing; |
260 | 266 |
261 // The root layer doesn't composite if it's a non-scrollable frame. | 267 // The root layer doesn't composite if it's a non-scrollable frame. |
262 // So, after a layout we set this dirty bit to know that we need | 268 // So, after a layout we set this dirty bit to know that we need |
263 // to recompute whether the root layer should composite even if | 269 // to recompute whether the root layer should composite even if |
264 // none of its descendants composite. | 270 // none of its descendants composite. |
265 // FIXME: Get rid of all the callers of setCompositingModeEnabled | 271 // FIXME: Get rid of all the callers of setCompositingModeEnabled |
266 // except the one in updateIfNeeded, then rename this to | 272 // except the one in updateIfNeeded, then rename this to |
267 // m_compositingDirty. | 273 // m_compositingDirty. |
268 bool m_rootShouldAlwaysCompositeDirty; | 274 bool m_rootShouldAlwaysCompositeDirty; |
269 bool m_needsUpdateFixedBackground; | 275 bool m_needsUpdateFixedBackground; |
270 bool m_isTrackingRasterInvalidations; // Used for testing. | 276 bool m_isTrackingRasterInvalidations; // Used for testing. |
271 bool m_inOverlayFullscreenVideo; | 277 bool m_inOverlayFullscreenVideo; |
272 | 278 |
273 RootLayerAttachment m_rootLayerAttachment; | 279 RootLayerAttachment m_rootLayerAttachment; |
274 bool m_pendingChromeClientAttachment; | 280 bool m_pendingChromeClientAttachment; |
275 | 281 |
276 // Enclosing container layer, which clips for iframe content | 282 // Outermost layer, holds overflow controls and the container layer |
| 283 std::unique_ptr<GraphicsLayer> m_overflowControlsHostLayer; |
| 284 |
| 285 // Clips for iframe content |
277 std::unique_ptr<GraphicsLayer> m_containerLayer; | 286 std::unique_ptr<GraphicsLayer> m_containerLayer; |
| 287 |
| 288 // Scrolls with the FrameView |
278 std::unique_ptr<GraphicsLayer> m_scrollLayer; | 289 std::unique_ptr<GraphicsLayer> m_scrollLayer; |
279 | 290 |
280 // Enclosing layer for overflow controls and the clipping layer | 291 // Innermost layer, parent of LayoutView main GraphicsLayer |
281 std::unique_ptr<GraphicsLayer> m_overflowControlsHostLayer; | 292 std::unique_ptr<GraphicsLayer> m_rootContentLayer; |
282 | 293 |
283 // Layers for overflow controls | 294 // Layers for overflow controls |
284 std::unique_ptr<GraphicsLayer> m_layerForHorizontalScrollbar; | 295 std::unique_ptr<GraphicsLayer> m_layerForHorizontalScrollbar; |
285 std::unique_ptr<GraphicsLayer> m_layerForVerticalScrollbar; | 296 std::unique_ptr<GraphicsLayer> m_layerForVerticalScrollbar; |
286 std::unique_ptr<GraphicsLayer> m_layerForScrollCorner; | 297 std::unique_ptr<GraphicsLayer> m_layerForScrollCorner; |
287 }; | 298 }; |
288 | 299 |
289 } // namespace blink | 300 } // namespace blink |
290 | 301 |
291 #endif // PaintLayerCompositor_h | 302 #endif // PaintLayerCompositor_h |
OLD | NEW |