Chromium Code Reviews| Index: Source/core/paint/InlinePainter.cpp |
| diff --git a/Source/core/paint/InlinePainter.cpp b/Source/core/paint/InlinePainter.cpp |
| index bcbe040b8e0f38611a26d5f989ab4ad9305c5c99..56e79ff0d49092581a0bf0be2b6f7d1c55ffa8a0 100644 |
| --- a/Source/core/paint/InlinePainter.cpp |
| +++ b/Source/core/paint/InlinePainter.cpp |
| @@ -29,6 +29,20 @@ void InlinePainter::paint(const PaintInfo& paintInfo, const LayoutPoint& paintOf |
| LineBoxListPainter(*m_layoutInline.lineBoxes()).paint(&m_layoutInline, paintInfo, paintOffset); |
| } |
| +LayoutRect InlinePainter::outlinePaintRect(const LayoutPoint& paintOffset) const |
| +{ |
| + const ComputedStyle& style = m_layoutInline.styleRef(); |
| + int outlineOutset; |
|
chrishtr
2015/06/04 17:08:12
Why does linesVisualOverflowBoundingBox() not alre
fs
2015/06/05 10:19:52
Hmm, yes... the inflate(outlineSize) in LayoutInli
|
| + if (style.outlineStyleIsAuto()) |
| + outlineOutset = GraphicsContext::focusRingOutsetExtent(style.outlineOffset(), style.outlineWidth()); |
| + else |
| + outlineOutset = style.outlineSize(); |
| + LayoutRect outlineRect = m_layoutInline.linesVisualOverflowBoundingBox(); |
| + outlineRect.inflate(outlineOutset); |
| + outlineRect.moveBy(paintOffset); |
| + return outlineRect; |
| +} |
| + |
| void InlinePainter::paintOutline(const PaintInfo& paintInfo, const LayoutPoint& paintOffset) |
| { |
| const ComputedStyle& styleToUse = m_layoutInline.styleRef(); |
| @@ -39,11 +53,8 @@ void InlinePainter::paintOutline(const PaintInfo& paintInfo, const LayoutPoint& |
| if (LayoutTheme::theme().shouldDrawDefaultFocusRing(&m_layoutInline)) { |
| Vector<LayoutRect> focusRingRects; |
| m_layoutInline.addFocusRingRects(focusRingRects, paintOffset); |
| - LayoutRect focusRingBoundingRect; |
| - for (const auto& rect : focusRingRects) |
| - focusRingBoundingRect.unite(rect); |
| - LayoutObjectDrawingRecorder recorder(*paintInfo.context, m_layoutInline, paintInfo.phase, focusRingBoundingRect); |
| + LayoutObjectDrawingRecorder recorder(*paintInfo.context, m_layoutInline, paintInfo.phase, outlinePaintRect(paintOffset)); |
| if (recorder.canUseCachedDrawing()) |
| return; |
| @@ -70,16 +81,7 @@ void InlinePainter::paintOutline(const PaintInfo& paintInfo, const LayoutPoint& |
| Color outlineColor = m_layoutInline.resolveColor(styleToUse, CSSPropertyOutlineColor); |
| bool useTransparencyLayer = outlineColor.hasAlpha(); |
| - int outlineWidth = styleToUse.outlineWidth(); |
| - LayoutRect bounds; |
| - for (const auto& rect : rects) { |
| - LayoutRect rectCopy(rect); |
| - rectCopy.expand(LayoutSize(outlineWidth, outlineWidth)); |
| - bounds.unite(rectCopy); |
| - } |
| - bounds.moveBy(paintOffset); |
| - |
| - LayoutObjectDrawingRecorder recorder(*paintInfo.context, m_layoutInline, paintInfo.phase, bounds); |
| + LayoutObjectDrawingRecorder recorder(*paintInfo.context, m_layoutInline, paintInfo.phase, outlinePaintRect(paintOffset)); |
| if (recorder.canUseCachedDrawing()) |
| return; |