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

Unified Diff: Source/core/paint/ObjectPainter.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/ObjectPainter.h ('k') | Source/core/paint/PartPainter.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/paint/ObjectPainter.cpp
diff --git a/Source/core/paint/ObjectPainter.cpp b/Source/core/paint/ObjectPainter.cpp
index 2d43a1d15aa113439344e85312e0f0589606f9b2..3e96ff3dd80573bd7b68ca47a84bda586d44ee73 100644
--- a/Source/core/paint/ObjectPainter.cpp
+++ b/Source/core/paint/ObjectPainter.cpp
@@ -16,13 +16,6 @@
namespace blink {
-LayoutRect ObjectPainter::outlineBounds(const LayoutRect& objectBounds, const ComputedStyle& style)
-{
- LayoutRect outlineBounds(objectBounds);
- outlineBounds.inflate(style.outlineOutsetExtent());
- return outlineBounds;
-}
-
void ObjectPainter::paintFocusRing(const PaintInfo& paintInfo, const ComputedStyle& style, const Vector<LayoutRect>& focusRingRects)
{
ASSERT(style.outlineStyleIsAuto());
@@ -32,7 +25,7 @@ void ObjectPainter::paintFocusRing(const PaintInfo& paintInfo, const ComputedSty
paintInfo.context->drawFocusRing(focusRingIntRects, style.outlineWidth(), style.outlineOffset(), m_layoutObject.resolveColor(style, CSSPropertyOutlineColor));
}
-void ObjectPainter::paintOutline(const PaintInfo& paintInfo, const LayoutRect& objectBounds, const LayoutRect& visualOverflowBounds)
+void ObjectPainter::paintOutline(const PaintInfo& paintInfo, const LayoutRect& visualOverflowRect, const LayoutSize& objectSize, const LayoutPoint& paintOffset)
{
const ComputedStyle& styleToUse = m_layoutObject.styleRef();
if (!styleToUse.hasOutline())
@@ -41,13 +34,15 @@ void ObjectPainter::paintOutline(const PaintInfo& paintInfo, const LayoutRect& o
if (LayoutObjectDrawingRecorder::useCachedDrawingIfPossible(*paintInfo.context, m_layoutObject, paintInfo.phase))
return;
+ LayoutRect visualOverflowBounds(visualOverflowRect);
+ visualOverflowBounds.moveBy(paintOffset);
LayoutObjectDrawingRecorder recorder(*paintInfo.context, m_layoutObject, paintInfo.phase, visualOverflowBounds);
if (styleToUse.outlineStyleIsAuto()) {
if (LayoutTheme::theme().shouldDrawDefaultFocusRing(&m_layoutObject)) {
// Only paint the focus ring by hand if the theme isn't able to draw the focus ring.
Vector<LayoutRect> focusRingRects;
- m_layoutObject.addOutlineRects(focusRingRects, objectBounds.location());
+ m_layoutObject.addOutlineRects(focusRingRects, paintOffset);
paintFocusRing(paintInfo, styleToUse, focusRingRects);
}
return;
@@ -56,7 +51,8 @@ void ObjectPainter::paintOutline(const PaintInfo& paintInfo, const LayoutRect& o
if (styleToUse.outlineStyle() == BNONE)
return;
- LayoutRect inner(pixelSnappedIntRect(objectBounds));
+ LayoutRect inner(paintOffset, objectSize);
+ inner = LayoutRect(pixelSnappedIntRect(inner));
inner.inflate(styleToUse.outlineOffset());
LayoutRect outer(inner);
« no previous file with comments | « Source/core/paint/ObjectPainter.h ('k') | Source/core/paint/PartPainter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698