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

Unified Diff: Source/core/paint/BlockPainter.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/layout/svg/LayoutSVGModelObject.cpp ('k') | Source/core/paint/ObjectPainter.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/paint/BlockPainter.cpp
diff --git a/Source/core/paint/BlockPainter.cpp b/Source/core/paint/BlockPainter.cpp
index fa3bd8fdc40e0f87b703d8c4106853eab75b144f..67e47d728d4653660b10202adb3818b0fe046815 100644
--- a/Source/core/paint/BlockPainter.cpp
+++ b/Source/core/paint/BlockPainter.cpp
@@ -162,15 +162,6 @@ void BlockPainter::paintAsInlineBlock(LayoutObject& layoutObject, const PaintInf
}
}
-static inline LayoutRect visualOverflowRectWithPaintOffset(const LayoutBlock& layoutBox, const LayoutPoint& paintOffset)
-{
- if (!RuntimeEnabledFeatures::slimmingPaintEnabled())
- return LayoutRect();
- LayoutRect bounds = layoutBox.visualOverflowRect();
- bounds.moveBy(paintOffset);
- return bounds;
-}
-
void BlockPainter::paintObject(const PaintInfo& paintInfo, const LayoutPoint& paintOffset)
{
const PaintPhase paintPhase = paintInfo.phase;
@@ -227,7 +218,7 @@ void BlockPainter::paintObject(const PaintInfo& paintInfo, const LayoutPoint& pa
// Don't paint focus ring for anonymous block continuation because the
// inline element having outline-style:auto paints the whole focus ring.
if (!m_layoutBlock.style()->outlineStyleIsAuto() || !m_layoutBlock.isAnonymousBlockContinuation())
- ObjectPainter(m_layoutBlock).paintOutline(paintInfo, LayoutRect(paintOffset, m_layoutBlock.size()), visualOverflowRectWithPaintOffset(m_layoutBlock, paintOffset));
+ ObjectPainter(m_layoutBlock).paintOutline(paintInfo, m_layoutBlock.visualOverflowRect(), m_layoutBlock.size(), paintOffset);
}
if (paintPhase == PaintPhaseOutline || paintPhase == PaintPhaseChildOutlines)
@@ -236,7 +227,9 @@ void BlockPainter::paintObject(const PaintInfo& paintInfo, const LayoutPoint& pa
// If the caret's node's layout object's containing block is this block, and the paint action is PaintPhaseForeground,
// then paint the caret.
if (paintPhase == PaintPhaseForeground && hasCaret() && !LayoutObjectDrawingRecorder::useCachedDrawingIfPossible(*paintInfo.context, m_layoutBlock, DisplayItem::Caret)) {
- LayoutObjectDrawingRecorder recorder(*paintInfo.context, m_layoutBlock, DisplayItem::Caret, visualOverflowRectWithPaintOffset(m_layoutBlock, paintOffset));
+ LayoutRect bounds = m_layoutBlock.visualOverflowRect();
+ bounds.moveBy(paintOffset);
+ LayoutObjectDrawingRecorder recorder(*paintInfo.context, m_layoutBlock, DisplayItem::Caret, bounds);
paintCarets(paintInfo, paintOffset);
}
}
« no previous file with comments | « Source/core/layout/svg/LayoutSVGModelObject.cpp ('k') | Source/core/paint/ObjectPainter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698