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

Unified Diff: third_party/WebKit/Source/core/paint/LayerClipRecorder.cpp

Issue 2194273002: Fix border radius on composited children. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update the comment on why we say an empty div can paint Created 4 years 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/paint/LayerClipRecorder.cpp
diff --git a/third_party/WebKit/Source/core/paint/LayerClipRecorder.cpp b/third_party/WebKit/Source/core/paint/LayerClipRecorder.cpp
index bd8878a302b1dba1b02acd1c370850ad6cce395d..3d85217b81a1340f8fb9dac6d3d884ab67248c9f 100644
--- a/third_party/WebKit/Source/core/paint/LayerClipRecorder.cpp
+++ b/third_party/WebKit/Source/core/paint/LayerClipRecorder.cpp
@@ -15,24 +15,22 @@
namespace blink {
-LayerClipRecorder::LayerClipRecorder(
- GraphicsContext& graphicsContext,
- const LayoutBoxModelObject& layoutObject,
- DisplayItem::Type clipType,
- const ClipRect& clipRect,
- const PaintLayerPaintingInfo* localPaintingInfo,
- const LayoutPoint& fragmentOffset,
- PaintLayerFlags paintFlags,
- BorderRadiusClippingRule rule)
+LayerClipRecorder::LayerClipRecorder(GraphicsContext& graphicsContext,
+ const LayoutBoxModelObject& layoutObject,
+ DisplayItem::Type clipType,
+ const ClipRect& clipRect,
+ const PaintLayer* clipRoot,
+ const LayoutPoint& fragmentOffset,
+ PaintLayerFlags paintFlags,
+ BorderRadiusClippingRule rule)
: m_graphicsContext(graphicsContext),
m_layoutObject(layoutObject),
m_clipType(clipType) {
IntRect snappedClipRect = pixelSnappedIntRect(clipRect.rect());
Vector<FloatRoundedRect> roundedRects;
- if (localPaintingInfo && clipRect.hasRadius()) {
- collectRoundedRectClips(*layoutObject.layer(), *localPaintingInfo,
- graphicsContext, fragmentOffset, paintFlags, rule,
- roundedRects);
+ if (clipRoot && clipRect.hasRadius()) {
+ collectRoundedRectClips(*layoutObject.layer(), clipRoot, graphicsContext,
+ fragmentOffset, paintFlags, rule, roundedRects);
}
m_graphicsContext.getPaintController().createAndAppend<ClipDisplayItem>(
@@ -58,7 +56,7 @@ static bool inContainingBlockChain(PaintLayer* startLayer,
void LayerClipRecorder::collectRoundedRectClips(
PaintLayer& paintLayer,
- const PaintLayerPaintingInfo& localPaintingInfo,
+ const PaintLayer* clipRoot,
GraphicsContext& context,
const LayoutPoint& fragmentOffset,
PaintLayerFlags paintFlags,
@@ -79,14 +77,15 @@ void LayerClipRecorder::collectRoundedRectClips(
// is properly clipped so that it can in turn clip the scrolled contents in
// the compositor.
if (layer->needsCompositedScrolling() &&
- !(paintFlags & PaintLayerPaintingChildClippingMaskPhase))
+ !(paintFlags & PaintLayerPaintingChildClippingMaskPhase ||
+ paintFlags & PaintLayerPaintingAncestorClippingMaskPhase))
break;
if (layer->layoutObject()->hasOverflowClip() &&
layer->layoutObject()->style()->hasBorderRadius() &&
inContainingBlockChain(&paintLayer, layer)) {
LayoutPoint delta(fragmentOffset);
- layer->convertToLayerCoords(localPaintingInfo.rootLayer, delta);
+ layer->convertToLayerCoords(clipRoot, delta);
// The PaintLayer's size is pixel-snapped if it is a LayoutBox. We can't
// use a pre-snapped border rect for clipping, since
@@ -99,7 +98,7 @@ void LayerClipRecorder::collectRoundedRectClips(
LayoutRect(delta, size)));
}
- if (layer == localPaintingInfo.rootLayer)
+ if (layer == clipRoot)
break;
}
}
« no previous file with comments | « third_party/WebKit/Source/core/paint/LayerClipRecorder.h ('k') | third_party/WebKit/Source/core/paint/PaintLayerClipper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698