Index: Source/core/paint/InlinePainter.cpp |
diff --git a/Source/core/paint/InlinePainter.cpp b/Source/core/paint/InlinePainter.cpp |
index 3fd2a23950103acd6e260ed7c168edd433971a16..73a8e1f763bf26c436b818c7ec032e81ba2c2900 100644 |
--- a/Source/core/paint/InlinePainter.cpp |
+++ b/Source/core/paint/InlinePainter.cpp |
@@ -51,23 +51,27 @@ void InlinePainter::paintOutline(const PaintInfo& paintInfo, const LayoutPoint& |
return; |
if (styleToUse.outlineStyleIsAuto()) { |
- if (LayoutTheme::theme().shouldDrawDefaultFocusRing(&m_layoutInline)) { |
- Vector<LayoutRect> focusRingRects; |
- m_layoutInline.addFocusRingRects(focusRingRects, paintOffset); |
+ if (!LayoutTheme::theme().shouldDrawDefaultFocusRing(&m_layoutInline)) |
+ return; |
+ if (LayoutObjectDrawingRecorder::useCachedDrawingIfPossible(*paintInfo.context, m_layoutInline, paintInfo.phase)) |
+ return; |
- LayoutObjectDrawingRecorder recorder(*paintInfo.context, m_layoutInline, paintInfo.phase, outlinePaintRect(focusRingRects, LayoutPoint())); |
- if (recorder.canUseCachedDrawing()) |
- return; |
+ Vector<LayoutRect> focusRingRects; |
+ m_layoutInline.addFocusRingRects(focusRingRects, paintOffset); |
- // Only paint the focus ring by hand if the theme isn't able to draw the focus ring. |
- ObjectPainter(m_layoutInline).paintFocusRing(paintInfo, styleToUse, focusRingRects); |
- } |
+ LayoutObjectDrawingRecorder recorder(*paintInfo.context, m_layoutInline, paintInfo.phase, outlinePaintRect(focusRingRects, LayoutPoint())); |
+ // Only paint the focus ring by hand if the theme isn't able to draw the focus ring. |
+ ObjectPainter(m_layoutInline).paintFocusRing(paintInfo, styleToUse, focusRingRects); |
return; |
} |
if (styleToUse.outlineStyle() == BNONE) |
return; |
+ GraphicsContext* graphicsContext = paintInfo.context; |
+ if (LayoutObjectDrawingRecorder::useCachedDrawingIfPossible(*graphicsContext, m_layoutInline, paintInfo.phase)) |
+ return; |
+ |
Vector<LayoutRect> rects; |
rects.append(LayoutRect()); |
@@ -82,11 +86,7 @@ void InlinePainter::paintOutline(const PaintInfo& paintInfo, const LayoutPoint& |
Color outlineColor = m_layoutInline.resolveColor(styleToUse, CSSPropertyOutlineColor); |
bool useTransparencyLayer = outlineColor.hasAlpha(); |
- LayoutObjectDrawingRecorder recorder(*paintInfo.context, m_layoutInline, paintInfo.phase, outlinePaintRect(rects, paintOffset)); |
- if (recorder.canUseCachedDrawing()) |
- return; |
- |
- GraphicsContext* graphicsContext = paintInfo.context; |
+ LayoutObjectDrawingRecorder recorder(*graphicsContext, m_layoutInline, paintInfo.phase, outlinePaintRect(rects, paintOffset)); |
if (useTransparencyLayer) { |
graphicsContext->beginLayer(static_cast<float>(outlineColor.alpha()) / 255); |
outlineColor = Color(outlineColor.red(), outlineColor.green(), outlineColor.blue()); |