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

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

Issue 1321613002: Refactor ObjectPainter::paintOutline to take a paintOffset (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Remove ObjectPainter::outlineRectForSVG Created 5 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/paint/PartPainter.cpp ('k') | Source/core/paint/SVGContainerPainter.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/paint/ReplacedPainter.cpp
diff --git a/Source/core/paint/ReplacedPainter.cpp b/Source/core/paint/ReplacedPainter.cpp
index 6571e9cbda2b0db4bfa1ebb9a49069ce9781a8ad..40729601bc805b136c67100be6f07063dd86df05 100644
--- a/Source/core/paint/ReplacedPainter.cpp
+++ b/Source/core/paint/ReplacedPainter.cpp
@@ -23,10 +23,7 @@ void ReplacedPainter::paint(const PaintInfo& paintInfo, const LayoutPoint& paint
return;
LayoutPoint adjustedPaintOffset = paintOffset + m_layoutReplaced.location();
- LayoutRect paintRect(adjustedPaintOffset, m_layoutReplaced.size());
-
- LayoutRect visualOverflowRect(m_layoutReplaced.visualOverflowRect());
- visualOverflowRect.moveBy(adjustedPaintOffset);
+ LayoutRect borderRect(adjustedPaintOffset, m_layoutReplaced.size());
if (m_layoutReplaced.hasBoxDecorationBackground() && (paintInfo.phase == PaintPhaseForeground || paintInfo.phase == PaintPhaseSelection))
m_layoutReplaced.paintBoxDecorationBackground(paintInfo, adjustedPaintOffset);
@@ -41,7 +38,7 @@ void ReplacedPainter::paint(const PaintInfo& paintInfo, const LayoutPoint& paint
if (paintInfo.phase == PaintPhaseOutline || paintInfo.phase == PaintPhaseSelfOutline) {
if (m_layoutReplaced.styleRef().outlineWidth())
- ObjectPainter(m_layoutReplaced).paintOutline(paintInfo, paintRect, visualOverflowRect);
+ ObjectPainter(m_layoutReplaced).paintOutline(paintInfo, m_layoutReplaced.visualOverflowRect(), borderRect.size(), adjustedPaintOffset);
return;
}
@@ -59,13 +56,11 @@ void ReplacedPainter::paint(const PaintInfo& paintInfo, const LayoutPoint& paint
Optional<RoundedInnerRectClipper> clipper;
bool completelyClippedOut = false;
if (m_layoutReplaced.style()->hasBorderRadius()) {
- LayoutRect borderRect = LayoutRect(adjustedPaintOffset, m_layoutReplaced.size());
-
if (borderRect.isEmpty()) {
completelyClippedOut = true;
} else {
// Push a clip if we have a border radius, since we want to round the foreground content that gets painted.
- FloatRoundedRect roundedInnerRect = m_layoutReplaced.style()->getRoundedInnerBorderFor(paintRect,
+ FloatRoundedRect roundedInnerRect = m_layoutReplaced.style()->getRoundedInnerBorderFor(borderRect,
LayoutRectOutsets(
-(m_layoutReplaced.paddingTop() + m_layoutReplaced.borderTop()),
-(m_layoutReplaced.paddingRight() + m_layoutReplaced.borderRight()),
@@ -73,7 +68,7 @@ void ReplacedPainter::paint(const PaintInfo& paintInfo, const LayoutPoint& paint
-(m_layoutReplaced.paddingLeft() + m_layoutReplaced.borderLeft())),
true, true);
- clipper.emplace(m_layoutReplaced, paintInfo, paintRect, roundedInnerRect, ApplyToDisplayListIfEnabled);
+ clipper.emplace(m_layoutReplaced, paintInfo, borderRect, roundedInnerRect, ApplyToDisplayListIfEnabled);
}
}
« no previous file with comments | « Source/core/paint/PartPainter.cpp ('k') | Source/core/paint/SVGContainerPainter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698