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

Unified Diff: Source/core/paint/LayerPainter.cpp

Issue 705303004: Remove clipRect parameter from LayerPainter::applyRoundedRectClips(). (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/paint/LayerPainter.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/paint/LayerPainter.cpp
diff --git a/Source/core/paint/LayerPainter.cpp b/Source/core/paint/LayerPainter.cpp
index 00cc876b99e5ce5539f685e02b4cb98c4bc3ca06..86842ad35eead80ace4cc7c88d5f0a75001f252a 100644
--- a/Source/core/paint/LayerPainter.cpp
+++ b/Source/core/paint/LayerPainter.cpp
@@ -101,8 +101,8 @@ void LayerPainter::paintLayer(GraphicsContext* context, const LayerPaintingInfo&
if (needsToClip(paintingInfo, clipRect)) {
clipRecorder = adoptPtr(new ClipRecorder(m_renderLayer.parent(), context, DisplayItem::ClipLayerParent, clipRect));
-
- LayerPainter(*m_renderLayer.parent()).applyRoundedRectClips(paintingInfo, context, clipRect, paintFlags, *clipRecorder);
+ if (clipRect.hasRadius())
+ LayerPainter(*m_renderLayer.parent()).applyRoundedRectClips(paintingInfo, context, paintFlags, *clipRecorder);
}
}
@@ -295,7 +295,8 @@ void LayerPainter::paintLayerContents(GraphicsContext* context, const LayerPaint
if (needsToClip(localPaintingInfo, backgroundRect)) {
clipRecorder = adoptPtr(new ClipRecorder(&m_renderLayer, context, DisplayItem::ClipLayerFilter, backgroundRect));
- applyRoundedRectClips(localPaintingInfo, context, backgroundRect, paintFlags, *clipRecorder);
+ if (backgroundRect.hasRadius())
+ applyRoundedRectClips(localPaintingInfo, context, paintFlags, *clipRecorder);
}
// Subsequent code should not clip to the dirty rect, since we've already
@@ -393,12 +394,8 @@ bool LayerPainter::needsToClip(const LayerPaintingInfo& localPaintingInfo, const
return clipRect.rect() != localPaintingInfo.paintDirtyRect || clipRect.hasRadius();
}
-void LayerPainter::applyRoundedRectClips(const LayerPaintingInfo& localPaintingInfo, GraphicsContext* context, const ClipRect& clipRect,
- PaintLayerFlags paintFlags, ClipRecorder& clipRecorder, BorderRadiusClippingRule rule)
+void LayerPainter::applyRoundedRectClips(const LayerPaintingInfo& localPaintingInfo, GraphicsContext* context, PaintLayerFlags paintFlags, ClipRecorder& clipRecorder, BorderRadiusClippingRule rule)
{
- if (!clipRect.hasRadius())
- return;
-
// If the clip rect has been tainted by a border radius, then we have to walk up our layer chain applying the clips from
// any layers with overflow. The condition for being able to apply these clips is that the overflow object be in our
// containing block chain so we check that also.
@@ -526,7 +523,8 @@ void LayerPainter::paintOverflowControlsForFragments(const LayerFragments& layer
if (needsToClip(localPaintingInfo, fragment.backgroundRect)) {
clipRecorder = adoptPtr(new ClipRecorder(&m_renderLayer, context, DisplayItem::ClipLayerOverflowControls, fragment.backgroundRect));
- applyRoundedRectClips(localPaintingInfo, context, fragment.backgroundRect, paintFlags, *clipRecorder);
+ if (fragment.backgroundRect.hasRadius())
+ applyRoundedRectClips(localPaintingInfo, context, paintFlags, *clipRecorder);
}
if (RenderLayerScrollableArea* scrollableArea = m_renderLayer.scrollableArea())
scrollableArea->paintOverflowControls(context, roundedIntPoint(toPoint(fragment.layerBounds.location() - m_renderLayer.renderBoxLocation() + subPixelAccumulationIfNeeded(localPaintingInfo.subPixelAccumulation, m_renderLayer.compositingState()))), pixelSnappedIntRect(fragment.backgroundRect.rect()), true);
@@ -714,7 +712,8 @@ void LayerPainter::paintFragmentWithPhase(PaintPhase phase, const LayerFragment&
}
clipRecorder = adoptPtr(new ClipRecorder(&m_renderLayer, context, clipType, clipRect));
- applyRoundedRectClips(paintingInfo, context, clipRect, paintFlags, *clipRecorder, clippingRule);
+ if (clipRect.hasRadius())
+ applyRoundedRectClips(paintingInfo, context, paintFlags, *clipRecorder, clippingRule);
}
PaintInfo paintInfo(context, pixelSnappedIntRect(clipRect.rect()), phase, paintBehavior, paintingRootForRenderer, 0, paintingInfo.rootLayer->renderer());
@@ -755,7 +754,8 @@ void LayerPainter::paintForegroundForFragments(const LayerFragments& layerFragme
OwnPtr<ClipRecorder> clipRecorder;
if (shouldClip && needsToClip(localPaintingInfo, layerFragments[0].foregroundRect)) {
clipRecorder = adoptPtr(new ClipRecorder(&m_renderLayer, context, DisplayItem::ClipLayerForeground, layerFragments[0].foregroundRect));
- applyRoundedRectClips(localPaintingInfo, context, layerFragments[0].foregroundRect, paintFlags, *clipRecorder);
+ if (layerFragments[0].foregroundRect.hasRadius())
+ applyRoundedRectClips(localPaintingInfo, context, paintFlags, *clipRecorder);
clipState = HasClipped;
}
@@ -843,11 +843,8 @@ void LayerPainter::paintTransformedLayerIntoFragments(GraphicsContext* context,
}
OwnPtr<ClipRecorder> clipRecorder;
- if (needsToClip(paintingInfo, clipRect)) {
+ if (needsToClip(paintingInfo, clipRect))
clipRecorder = adoptPtr(new ClipRecorder(m_renderLayer.parent(), context, DisplayItem::ClipLayerFragmentParent, clipRect));
- // FIXME: why should we have to deal with rounded rect clips here at all?
- LayerPainter(*m_renderLayer.parent()).applyRoundedRectClips(paintingInfo, context, clipRect, paintFlags, *clipRecorder);
- }
paintLayerByApplyingTransform(context, paintingInfo, paintFlags, fragment.paginationOffset);
}
« no previous file with comments | « Source/core/paint/LayerPainter.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698