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

Side by Side Diff: sky/engine/core/rendering/compositing/CompositedLayerMapping.h

Issue 689283003: Remove scroll corners and resizers. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 1 month 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, 2010, 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 2009, 2010, 2011 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 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 virtual bool isTrackingPaintInvalidations() const override; 158 virtual bool isTrackingPaintInvalidations() const override;
159 159
160 #if ENABLE(ASSERT) 160 #if ENABLE(ASSERT)
161 virtual void verifyNotPainting() override; 161 virtual void verifyNotPainting() override;
162 #endif 162 #endif
163 163
164 LayoutRect contentsBox() const; 164 LayoutRect contentsBox() const;
165 165
166 GraphicsLayer* layerForHorizontalScrollbar() const { return m_layerForHorizo ntalScrollbar.get(); } 166 GraphicsLayer* layerForHorizontalScrollbar() const { return m_layerForHorizo ntalScrollbar.get(); }
167 GraphicsLayer* layerForVerticalScrollbar() const { return m_layerForVertical Scrollbar.get(); } 167 GraphicsLayer* layerForVerticalScrollbar() const { return m_layerForVertical Scrollbar.get(); }
168 GraphicsLayer* layerForScrollCorner() const { return m_layerForScrollCorner. get(); }
169 168
170 // Returns true if the overflow controls cannot be positioned within this 169 // Returns true if the overflow controls cannot be positioned within this
171 // CLM's internal hierarchy without incorrectly stacking under some 170 // CLM's internal hierarchy without incorrectly stacking under some
172 // scrolling content. If this returns true, these controls must be 171 // scrolling content. If this returns true, these controls must be
173 // repositioned in the graphics layer tree to ensure that they stack above 172 // repositioned in the graphics layer tree to ensure that they stack above
174 // scrolling content. 173 // scrolling content.
175 bool needsToReparentOverflowControls() const; 174 bool needsToReparentOverflowControls() const;
176 175
177 // Removes the overflow controls host layer from its parent and positions it 176 // Removes the overflow controls host layer from its parent and positions it
178 // so that it can be inserted as a sibling to this CLM without changing 177 // so that it can be inserted as a sibling to this CLM without changing
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 PassOwnPtr<GraphicsLayer> createGraphicsLayer(CompositingReasons); 230 PassOwnPtr<GraphicsLayer> createGraphicsLayer(CompositingReasons);
232 bool toggleScrollbarLayerIfNeeded(OwnPtr<GraphicsLayer>&, bool needsLayer, C ompositingReasons); 231 bool toggleScrollbarLayerIfNeeded(OwnPtr<GraphicsLayer>&, bool needsLayer, C ompositingReasons);
233 232
234 RenderLayerModelObject* renderer() const { return m_owningLayer.renderer(); } 233 RenderLayerModelObject* renderer() const { return m_owningLayer.renderer(); }
235 RenderLayerCompositor* compositor() const { return m_owningLayer.compositor( ); } 234 RenderLayerCompositor* compositor() const { return m_owningLayer.compositor( ); }
236 235
237 void updateInternalHierarchy(); 236 void updateInternalHierarchy();
238 void updatePaintingPhases(); 237 void updatePaintingPhases();
239 bool updateClippingLayers(bool needsAncestorClip, bool needsDescendantClip); 238 bool updateClippingLayers(bool needsAncestorClip, bool needsDescendantClip);
240 bool updateChildTransformLayer(bool needsChildTransformLayer); 239 bool updateChildTransformLayer(bool needsChildTransformLayer);
241 bool updateOverflowControlsLayers(bool needsHorizontalScrollbarLayer, bool n eedsVerticalScrollbarLayer, bool needsScrollCornerLayer, bool needsAncestorClip) ; 240 bool updateOverflowControlsLayers(bool needsHorizontalScrollbarLayer, bool n eedsVerticalScrollbarLayer, bool needsAncestorClip);
242 bool updateForegroundLayer(bool needsForegroundLayer); 241 bool updateForegroundLayer(bool needsForegroundLayer);
243 bool updateBackgroundLayer(bool needsBackgroundLayer); 242 bool updateBackgroundLayer(bool needsBackgroundLayer);
244 bool updateMaskLayer(bool needsMaskLayer); 243 bool updateMaskLayer(bool needsMaskLayer);
245 bool updateClippingMaskLayers(bool needsChildClippingMaskLayer); 244 bool updateClippingMaskLayers(bool needsChildClippingMaskLayer);
246 bool requiresHorizontalScrollbarLayer() const { return m_owningLayer.scrolla bleArea() && m_owningLayer.scrollableArea()->horizontalScrollbar(); } 245 bool requiresHorizontalScrollbarLayer() const { return m_owningLayer.scrolla bleArea() && m_owningLayer.scrollableArea()->horizontalScrollbar(); }
247 bool requiresVerticalScrollbarLayer() const { return m_owningLayer.scrollabl eArea() && m_owningLayer.scrollableArea()->verticalScrollbar(); } 246 bool requiresVerticalScrollbarLayer() const { return m_owningLayer.scrollabl eArea() && m_owningLayer.scrollableArea()->verticalScrollbar(); }
248 bool requiresScrollCornerLayer() const { return m_owningLayer.scrollableArea () && !m_owningLayer.scrollableArea()->scrollCornerAndResizerRect().isEmpty(); }
249 bool updateScrollingLayers(bool scrollingLayers); 247 bool updateScrollingLayers(bool scrollingLayers);
250 void updateScrollParent(RenderLayer*); 248 void updateScrollParent(RenderLayer*);
251 void updateClipParent(); 249 void updateClipParent();
252 bool updateSquashingLayers(bool needsSquashingLayers); 250 bool updateSquashingLayers(bool needsSquashingLayers);
253 void updateDrawsContent(); 251 void updateDrawsContent();
254 void updateChildrenTransform(); 252 void updateChildrenTransform();
255 void updateCompositedBounds(); 253 void updateCompositedBounds();
256 254
257 // Also sets subpixelAccumulation on the layer. 255 // Also sets subpixelAccumulation on the layer.
258 void computeBoundsOfOwningLayer(const RenderLayer* compositedAncestor, IntRe ct& localCompositingBounds, IntRect& compositingBoundsRelativeToCompositedAncest or, LayoutPoint& offsetFromCompositedAncestor, IntPoint& snappedOffsetFromCompos itedAncestor); 256 void computeBoundsOfOwningLayer(const RenderLayer* compositedAncestor, IntRe ct& localCompositingBounds, IntRect& compositingBoundsRelativeToCompositedAncest or, LayoutPoint& offsetFromCompositedAncestor, IntPoint& snappedOffsetFromCompos itedAncestor);
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
305 // + m_ancestorClippingLayer [OPTIONAL] 303 // + m_ancestorClippingLayer [OPTIONAL]
306 // + m_graphicsLayer 304 // + m_graphicsLayer
307 // + m_childContainmentLayer [OPTIONAL] <-OR-> m_scrollingLayer [OPTI ONAL] <-OR-> m_childTransformLayer 305 // + m_childContainmentLayer [OPTIONAL] <-OR-> m_scrollingLayer [OPTI ONAL] <-OR-> m_childTransformLayer
308 // | + m_scrollingContents Layer [Present iff m_scrollingLayer is present] 306 // | + m_scrollingContents Layer [Present iff m_scrollingLayer is present]
309 // | + m_scrollingBlock SelectionLayer [Present iff m_scrollingLayer is present] 307 // | + m_scrollingBlock SelectionLayer [Present iff m_scrollingLayer is present]
310 // | 308 // |
311 // + m_overflowControlsClippingLayer [OPTIONAL] // *The overflow cont rols may need to be repositioned in the 309 // + m_overflowControlsClippingLayer [OPTIONAL] // *The overflow cont rols may need to be repositioned in the
312 // + m_overflowControlsHostLayer // graphics layer tr ee by the RLC to ensure that they stack 310 // + m_overflowControlsHostLayer // graphics layer tr ee by the RLC to ensure that they stack
313 // + m_layerForVerticalScrollbar // above scrolling c ontent. 311 // + m_layerForVerticalScrollbar // above scrolling c ontent.
314 // + m_layerForHorizontalScrollbar 312 // + m_layerForHorizontalScrollbar
315 // + m_layerForScrollCorner
316 // 313 //
317 // We need an ancestor clipping layer if our clipping ancestor is not our an cestor in the 314 // We need an ancestor clipping layer if our clipping ancestor is not our an cestor in the
318 // clipping tree. Here's what that might look like. 315 // clipping tree. Here's what that might look like.
319 // 316 //
320 // Let A = the clipping ancestor, 317 // Let A = the clipping ancestor,
321 // B = the clip descendant, and 318 // B = the clip descendant, and
322 // SC = the stacking context that is the ancestor of A and B in the stac king tree. 319 // SC = the stacking context that is the ancestor of A and B in the stac king tree.
323 // 320 //
324 // SC 321 // SC
325 // + A = m_graphicsLayer 322 // + A = m_graphicsLayer
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
368 // + frame scrolling layer 365 // + frame scrolling layer
369 // + root content layer 366 // + root content layer
370 // 367 //
371 // With the hierarchy set up like this, the root content layer is able to sc roll without affecting 368 // With the hierarchy set up like this, the root content layer is able to sc roll without affecting
372 // the background layer (or paint invalidation). 369 // the background layer (or paint invalidation).
373 OwnPtr<GraphicsLayer> m_foregroundLayer; // Only used in cases where we need to draw the foreground separately. 370 OwnPtr<GraphicsLayer> m_foregroundLayer; // Only used in cases where we need to draw the foreground separately.
374 OwnPtr<GraphicsLayer> m_backgroundLayer; // Only used in cases where we need to draw the background separately. 371 OwnPtr<GraphicsLayer> m_backgroundLayer; // Only used in cases where we need to draw the background separately.
375 372
376 OwnPtr<GraphicsLayer> m_layerForHorizontalScrollbar; 373 OwnPtr<GraphicsLayer> m_layerForHorizontalScrollbar;
377 OwnPtr<GraphicsLayer> m_layerForVerticalScrollbar; 374 OwnPtr<GraphicsLayer> m_layerForVerticalScrollbar;
378 OwnPtr<GraphicsLayer> m_layerForScrollCorner;
379 375
380 // This layer exists to simplify the reparenting of overflow control that is occasionally required 376 // This layer exists to simplify the reparenting of overflow control that is occasionally required
381 // to ensure that scrollbars appear above scrolling content. 377 // to ensure that scrollbars appear above scrolling content.
382 OwnPtr<GraphicsLayer> m_overflowControlsHostLayer; 378 OwnPtr<GraphicsLayer> m_overflowControlsHostLayer;
383 379
384 // The reparented overflow controls sometimes need to be clipped by a non-an cestor. In just the same 380 // The reparented overflow controls sometimes need to be clipped by a non-an cestor. In just the same
385 // way we need an ancestor clipping layer to clip this CLM's internal hierar chy, we add another layer 381 // way we need an ancestor clipping layer to clip this CLM's internal hierar chy, we add another layer
386 // to clip the overflow controls. It would be possible to make m_overflowCon trolsHostLayer be 382 // to clip the overflow controls. It would be possible to make m_overflowCon trolsHostLayer be
387 // responsible for applying this clip, but that could require repositioning all of the overflow 383 // responsible for applying this clip, but that could require repositioning all of the overflow
388 // controls since the this clip may apply an offset. By using a separate lay er, the overflow controls 384 // controls since the this clip may apply an offset. By using a separate lay er, the overflow controls
(...skipping 29 matching lines...) Expand all
418 unsigned m_pendingUpdateScope : 2; 414 unsigned m_pendingUpdateScope : 2;
419 unsigned m_requiresOwnBackingStoreForIntrinsicReasons : 1; 415 unsigned m_requiresOwnBackingStoreForIntrinsicReasons : 1;
420 unsigned m_requiresOwnBackingStoreForAncestorReasons : 1; 416 unsigned m_requiresOwnBackingStoreForAncestorReasons : 1;
421 unsigned m_backgroundLayerPaintsFixedRootBackground : 1; 417 unsigned m_backgroundLayerPaintsFixedRootBackground : 1;
422 unsigned m_scrollingContentsAreEmpty : 1; 418 unsigned m_scrollingContentsAreEmpty : 1;
423 }; 419 };
424 420
425 } // namespace blink 421 } // namespace blink
426 422
427 #endif // CompositedLayerMapping_h 423 #endif // CompositedLayerMapping_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698