Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(8)

Side by Side Diff: third_party/WebKit/Source/core/layout/compositing/PaintLayerCompositor.h

Issue 2728273002: [RLS] Don't create PaintLayerCompositor layers. (Closed)
Patch Set: rebase Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 void updateRootLayerPosition(); 148 void updateRootLayerPosition();
133 149
134 // If the root scroller isn't the root layer then the PaintLayerCompositor 150 // If the root scroller isn't the root layer then the PaintLayerCompositor
135 // must disable clipping on its layers so that the root scroller can 151 // must disable clipping on its layers so that the root scroller can
136 // expand/shrink its clipping layer in response to browser controls and have 152 // expand/shrink its clipping layer in response to browser controls and have
137 // the result be visible. 153 // the result be visible.
138 void updateClippingOnCompositorLayers(); 154 void updateClippingOnCompositorLayers();
139 155
140 void setIsInWindow(bool); 156 void setIsInWindow(bool);
141 157
142 static PaintLayerCompositor* frameContentsCompositor(LayoutPart&); 158 static PaintLayerCompositor* frameContentsCompositor(LayoutPart&);
143 // Return true if the layers changed. 159 // Return true if the layers changed.
144 static bool attachFrameContentLayersToIframeLayer(LayoutPart&); 160 static bool attachFrameContentLayersToIframeLayer(LayoutPart&);
145 161
146 // Update the geometry of the layers used for clipping and scrolling in 162 // Update the geometry of the layers used for clipping and scrolling in
147 // frames. 163 // frames.
148 void frameViewDidChangeLocation(const IntPoint& contentsOffset); 164 void frameViewDidChangeLocation(const IntPoint& contentsOffset);
149 void frameViewDidChangeSize(); 165 void frameViewDidChangeSize();
150 void frameViewDidScroll(); 166 void frameViewDidScroll();
151 void frameViewScrollbarsExistenceDidChange(); 167 void frameViewScrollbarsExistenceDidChange();
152 void rootFixedBackgroundsChanged(); 168 void rootFixedBackgroundsChanged();
153 169
154 bool scrollingLayerDidChange(PaintLayer*); 170 bool scrollingLayerDidChange(PaintLayer*);
155 171
156 std::unique_ptr<JSONObject> layerTreeAsJSON(LayerTreeFlags) const; 172 std::unique_ptr<JSONObject> layerTreeAsJSON(LayerTreeFlags) const;
157 173
158 GraphicsLayer* layerForHorizontalScrollbar() const {
159 return m_layerForHorizontalScrollbar.get();
160 }
161 GraphicsLayer* layerForVerticalScrollbar() const {
162 return m_layerForVerticalScrollbar.get();
163 }
164 GraphicsLayer* layerForScrollCorner() const {
165 return m_layerForScrollCorner.get();
166 }
167
168 void setTracksRasterInvalidations(bool); 174 void setTracksRasterInvalidations(bool);
169 175
170 String debugName(const GraphicsLayer*) const override; 176 String debugName(const GraphicsLayer*) const override;
171 DocumentLifecycle& lifecycle() const; 177 DocumentLifecycle& lifecycle() const;
172 178
173 void updatePotentialCompositingReasonsFromStyle(PaintLayer*); 179 void updatePotentialCompositingReasonsFromStyle(PaintLayer*);
174 180
175 // Whether the layer could ever be composited. 181 // Whether the layer could ever be composited.
176 bool canBeComposited(const PaintLayer*) const; 182 bool canBeComposited(const PaintLayer*) const;
177 183
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
230 236
231 void updateContainerSizes(); 237 void updateContainerSizes();
232 238
233 // Checks the given graphics layer against the compositor's horizontal and 239 // Checks the given graphics layer against the compositor's horizontal and
234 // vertical scrollbar graphics layers, returning the associated Scrollbar 240 // vertical scrollbar graphics layers, returning the associated Scrollbar
235 // instance if any, else nullptr. 241 // instance if any, else nullptr.
236 Scrollbar* graphicsLayerToScrollbar(const GraphicsLayer*) const; 242 Scrollbar* graphicsLayerToScrollbar(const GraphicsLayer*) const;
237 243
238 bool isMainFrame() const; 244 bool isMainFrame() const;
239 VisualViewport& visualViewport() const; 245 VisualViewport& visualViewport() const;
246 GraphicsLayer* parentForContentLayers() const;
240 247
241 LayoutView& m_layoutView; 248 LayoutView& m_layoutView;
242 std::unique_ptr<GraphicsLayer> m_rootContentLayer;
243 249
244 CompositingReasonFinder m_compositingReasonFinder; 250 CompositingReasonFinder m_compositingReasonFinder;
245 251
246 CompositingUpdateType m_pendingUpdateType; 252 CompositingUpdateType m_pendingUpdateType;
247 253
248 bool m_hasAcceleratedCompositing; 254 bool m_hasAcceleratedCompositing;
249 bool m_compositing; 255 bool m_compositing;
250 256
251 // The root layer doesn't composite if it's a non-scrollable frame. 257 // The root layer doesn't composite if it's a non-scrollable frame.
252 // So, after a layout we set this dirty bit to know that we need 258 // So, after a layout we set this dirty bit to know that we need
253 // to recompute whether the root layer should composite even if 259 // to recompute whether the root layer should composite even if
254 // none of its descendants composite. 260 // none of its descendants composite.
255 // FIXME: Get rid of all the callers of setCompositingModeEnabled 261 // FIXME: Get rid of all the callers of setCompositingModeEnabled
256 // except the one in updateIfNeeded, then rename this to 262 // except the one in updateIfNeeded, then rename this to
257 // m_compositingDirty. 263 // m_compositingDirty.
258 bool m_rootShouldAlwaysCompositeDirty; 264 bool m_rootShouldAlwaysCompositeDirty;
259 bool m_needsUpdateFixedBackground; 265 bool m_needsUpdateFixedBackground;
260 bool m_isTrackingRasterInvalidations; // Used for testing. 266 bool m_isTrackingRasterInvalidations; // Used for testing.
261 bool m_inOverlayFullscreenVideo; 267 bool m_inOverlayFullscreenVideo;
262 268
263 enum RootLayerAttachment { 269 enum RootLayerAttachment {
264 RootLayerUnattached, 270 RootLayerUnattached,
265 RootLayerPendingAttachViaChromeClient, 271 RootLayerPendingAttachViaChromeClient,
266 RootLayerAttachedViaChromeClient, 272 RootLayerAttachedViaChromeClient,
267 RootLayerAttachedViaEnclosingFrame 273 RootLayerAttachedViaEnclosingFrame
268 }; 274 };
269 RootLayerAttachment m_rootLayerAttachment; 275 RootLayerAttachment m_rootLayerAttachment;
270 276
271 // Enclosing container layer, which clips for iframe content 277 // Outermost layer, holds overflow controls and the container layer
278 std::unique_ptr<GraphicsLayer> m_overflowControlsHostLayer;
279
280 // Clips for iframe content
272 std::unique_ptr<GraphicsLayer> m_containerLayer; 281 std::unique_ptr<GraphicsLayer> m_containerLayer;
282
283 // Scrolls with the FrameView
273 std::unique_ptr<GraphicsLayer> m_scrollLayer; 284 std::unique_ptr<GraphicsLayer> m_scrollLayer;
274 285
275 // Enclosing layer for overflow controls and the clipping layer 286 // Innermost layer, parent of LayoutView main GraphicsLayer
276 std::unique_ptr<GraphicsLayer> m_overflowControlsHostLayer; 287 std::unique_ptr<GraphicsLayer> m_rootContentLayer;
277 288
278 // Layers for overflow controls 289 // Layers for overflow controls
279 std::unique_ptr<GraphicsLayer> m_layerForHorizontalScrollbar; 290 std::unique_ptr<GraphicsLayer> m_layerForHorizontalScrollbar;
280 std::unique_ptr<GraphicsLayer> m_layerForVerticalScrollbar; 291 std::unique_ptr<GraphicsLayer> m_layerForVerticalScrollbar;
281 std::unique_ptr<GraphicsLayer> m_layerForScrollCorner; 292 std::unique_ptr<GraphicsLayer> m_layerForScrollCorner;
282 }; 293 };
283 294
284 } // namespace blink 295 } // namespace blink
285 296
286 #endif // PaintLayerCompositor_h 297 #endif // PaintLayerCompositor_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698