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

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

Issue 2194273002: Fix border radius on composited children. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Super hacky patch Created 4 years, 2 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, 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 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
258 void destroyGraphicsLayers(); 258 void destroyGraphicsLayers();
259 259
260 std::unique_ptr<GraphicsLayer> createGraphicsLayer(CompositingReasons, Squas hingDisallowedReasons = SquashingDisallowedReasonsNone); 260 std::unique_ptr<GraphicsLayer> createGraphicsLayer(CompositingReasons, Squas hingDisallowedReasons = SquashingDisallowedReasonsNone);
261 bool toggleScrollbarLayerIfNeeded(std::unique_ptr<GraphicsLayer>&, bool need sLayer, CompositingReasons); 261 bool toggleScrollbarLayerIfNeeded(std::unique_ptr<GraphicsLayer>&, bool need sLayer, CompositingReasons);
262 262
263 LayoutBoxModelObject* layoutObject() const { return m_owningLayer.layoutObje ct(); } 263 LayoutBoxModelObject* layoutObject() const { return m_owningLayer.layoutObje ct(); }
264 PaintLayerCompositor* compositor() const { return m_owningLayer.compositor() ; } 264 PaintLayerCompositor* compositor() const { return m_owningLayer.compositor() ; }
265 265
266 void updateInternalHierarchy(); 266 void updateInternalHierarchy();
267 void updatePaintingPhases(); 267 void updatePaintingPhases();
268 bool updateClippingLayers(bool needsAncestorClip, bool needsDescendantClip); 268 bool updateClippingLayers(bool needsAncestorClip, bool needsAncestorClipping Mask, bool needsDescendantClip);
269 bool updateChildTransformLayer(bool needsChildTransformLayer); 269 bool updateChildTransformLayer(bool needsChildTransformLayer);
270 bool updateOverflowControlsLayers(bool needsHorizontalScrollbarLayer, bool n eedsVerticalScrollbarLayer, bool needsScrollCornerLayer, bool needsAncestorClip) ; 270 bool updateOverflowControlsLayers(bool needsHorizontalScrollbarLayer, bool n eedsVerticalScrollbarLayer, bool needsScrollCornerLayer, bool needsAncestorClip) ;
271 bool updateForegroundLayer(bool needsForegroundLayer); 271 bool updateForegroundLayer(bool needsForegroundLayer);
272 bool updateBackgroundLayer(bool needsBackgroundLayer); 272 bool updateBackgroundLayer(bool needsBackgroundLayer);
273 bool updateMaskLayer(bool needsMaskLayer); 273 bool updateMaskLayer(bool needsMaskLayer);
274 void updateChildClippingMaskLayer(bool needsChildClippingMaskLayer); 274 void updateChildClippingMaskLayer(bool needsChildClippingMaskLayer);
275 bool requiresHorizontalScrollbarLayer() const { return m_owningLayer.getScro llableArea() && m_owningLayer.getScrollableArea()->horizontalScrollbar(); } 275 bool requiresHorizontalScrollbarLayer() const { return m_owningLayer.getScro llableArea() && m_owningLayer.getScrollableArea()->horizontalScrollbar(); }
276 bool requiresVerticalScrollbarLayer() const { return m_owningLayer.getScroll ableArea() && m_owningLayer.getScrollableArea()->verticalScrollbar(); } 276 bool requiresVerticalScrollbarLayer() const { return m_owningLayer.getScroll ableArea() && m_owningLayer.getScrollableArea()->verticalScrollbar(); }
277 bool requiresScrollCornerLayer() const { return m_owningLayer.getScrollableA rea() && !m_owningLayer.getScrollableArea()->scrollCornerAndResizerRect().isEmpt y(); } 277 bool requiresScrollCornerLayer() const { return m_owningLayer.getScrollableA rea() && !m_owningLayer.getScrollableArea()->scrollCornerAndResizerRect().isEmpt y(); }
278 bool updateScrollingLayers(bool scrollingLayers); 278 bool updateScrollingLayers(bool scrollingLayers);
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
323 // Computes the background clip rect for the given squashed layer, up to any containing layer that is squashed into the 323 // Computes the background clip rect for the given squashed layer, up to any containing layer that is squashed into the
324 // same squashing layer and contains this squashed layer's clipping ancestor . 324 // same squashing layer and contains this squashed layer's clipping ancestor .
325 // The clip rect is returned in the coordinate space of the given squashed l ayer. 325 // The clip rect is returned in the coordinate space of the given squashed l ayer.
326 // If there is no such containing layer, returns the infinite rect. 326 // If there is no such containing layer, returns the infinite rect.
327 // FIXME: unify this code with the code that sets up m_ancestorClippingLayer . They are doing very similar things. 327 // FIXME: unify this code with the code that sets up m_ancestorClippingLayer . They are doing very similar things.
328 static IntRect localClipRectForSquashedLayer(const PaintLayer& referenceLaye r, const GraphicsLayerPaintInfo&, const Vector<GraphicsLayerPaintInfo>& layers) ; 328 static IntRect localClipRectForSquashedLayer(const PaintLayer& referenceLaye r, const GraphicsLayerPaintInfo&, const Vector<GraphicsLayerPaintInfo>& layers) ;
329 329
330 // Return true if |m_owningLayer|'s compositing ancestor is not a descendant (inclusive) of the 330 // Return true if |m_owningLayer|'s compositing ancestor is not a descendant (inclusive) of the
331 // clipping container for |m_owningLayer|. 331 // clipping container for |m_owningLayer|.
332 bool owningLayerClippedByLayerNotAboveCompositedAncestor(const PaintLayer* s crollParent); 332 bool owningLayerClippedByLayerNotAboveCompositedAncestor(const PaintLayer* s crollParent);
333 // Return true if |m_owningLayer|'s compositing ancestor is not a descendant (inclusive) of the
334 // clipping container for |m_owningLayer| and that clipping container has bo rder radius.
335 bool owningLayerMaskedByLayerNotAboveCompositedAncestor(const PaintLayer* sc rollParent);
336
333 337
334 const PaintLayer* scrollParent(); 338 const PaintLayer* scrollParent();
335 339
336 // Clear the groupedMapping entry on the layer at the given index, only if t hat layer does 340 // Clear the groupedMapping entry on the layer at the given index, only if t hat layer does
337 // not appear earlier in the set of layers for this object. 341 // not appear earlier in the set of layers for this object.
338 bool invalidateLayerIfNoPrecedingEntry(size_t); 342 bool invalidateLayerIfNoPrecedingEntry(size_t);
339 343
340 PaintLayer& m_owningLayer; 344 PaintLayer& m_owningLayer;
341 345
342 // The hierarchy of layers that is maintained by the CompositedLayerMapping looks like this: 346 // The hierarchy of layers that is maintained by the CompositedLayerMapping looks like this:
(...skipping 23 matching lines...) Expand all
366 // ... 370 // ...
367 // | 371 // |
368 // + B = m_ancestorClippingLayer [+] 372 // + B = m_ancestorClippingLayer [+]
369 // + m_graphicsLayer 373 // + m_graphicsLayer
370 // + ... 374 // + ...
371 // 375 //
372 // In this case B is clipped by another layer that doesn't happen to be its ancestor: A. 376 // In this case B is clipped by another layer that doesn't happen to be its ancestor: A.
373 // So we create an ancestor clipping layer for B, [+], which ensures that B is clipped 377 // So we create an ancestor clipping layer for B, [+], which ensures that B is clipped
374 // as if it had been A's descendant. 378 // as if it had been A's descendant.
375 std::unique_ptr<GraphicsLayer> m_ancestorClippingLayer; // Only used if we a re clipped by an ancestor which is not a stacking context. 379 std::unique_ptr<GraphicsLayer> m_ancestorClippingLayer; // Only used if we a re clipped by an ancestor which is not a stacking context.
380 std::unique_ptr<GraphicsLayer> m_ancestorClippingMaskLayer; // Only used is there is an m_ancestorClippingLayer that also needs to apply a border radius mas k.
376 std::unique_ptr<GraphicsLayer> m_graphicsLayer; 381 std::unique_ptr<GraphicsLayer> m_graphicsLayer;
377 std::unique_ptr<GraphicsLayer> m_childContainmentLayer; // Only used if we h ave clipping on a stacking context with compositing children. 382 std::unique_ptr<GraphicsLayer> m_childContainmentLayer; // Only used if we h ave clipping on a stacking context with compositing children.
378 std::unique_ptr<GraphicsLayer> m_childTransformLayer; // Only used if we hav e perspective. 383 std::unique_ptr<GraphicsLayer> m_childTransformLayer; // Only used if we hav e perspective.
379 std::unique_ptr<GraphicsLayer> m_scrollingLayer; // Only used if the layer i s using composited scrolling. 384 std::unique_ptr<GraphicsLayer> m_scrollingLayer; // Only used if the layer i s using composited scrolling.
380 std::unique_ptr<GraphicsLayer> m_scrollingContentsLayer; // Only used if the layer is using composited scrolling. 385 std::unique_ptr<GraphicsLayer> m_scrollingContentsLayer; // Only used if the layer is using composited scrolling.
381 386
382 // This layer is also added to the hierarchy by the RLB, but in a different way than 387 // This layer is also added to the hierarchy by the RLB, but in a different way than
383 // the layers above. It's added to m_graphicsLayer as its mask layer (natura lly) if 388 // the layers above. It's added to m_graphicsLayer as its mask layer (natura lly) if
384 // we have a mask, and isn't part of the typical hierarchy (it has no childr en). 389 // we have a mask, and isn't part of the typical hierarchy (it has no childr en).
385 std::unique_ptr<GraphicsLayer> m_maskLayer; // Only used if we have a mask. 390 std::unique_ptr<GraphicsLayer> m_maskLayer; // Only used if we have a mask.
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
466 471
467 // Keep track of whether the background is painted onto the scrolling conten ts layer for invalidations. 472 // Keep track of whether the background is painted onto the scrolling conten ts layer for invalidations.
468 unsigned m_backgroundPaintsOntoScrollingContentsLayer : 1; 473 unsigned m_backgroundPaintsOntoScrollingContentsLayer : 1;
469 474
470 friend class CompositedLayerMappingTest; 475 friend class CompositedLayerMappingTest;
471 }; 476 };
472 477
473 } // namespace blink 478 } // namespace blink
474 479
475 #endif // CompositedLayerMapping_h 480 #endif // CompositedLayerMapping_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698