Index: Source/core/paint/ImagePainter.cpp |
diff --git a/Source/core/paint/ImagePainter.cpp b/Source/core/paint/ImagePainter.cpp |
index 47af0238c4a18cf6fc96a1230bffff6e54eb4cb3..f8686b94b77140e159bad336c4a18dd34e1b9504 100644 |
--- a/Source/core/paint/ImagePainter.cpp |
+++ b/Source/core/paint/ImagePainter.cpp |
@@ -58,11 +58,11 @@ void ImagePainter::paintAreaElementFocusRing(const PaintInfo& paintInfo) |
if (!outlineWidth) |
return; |
- IntRect focusRect = m_layoutImage.absoluteContentBox(); |
+ if (LayoutObjectDrawingRecorder::useCachedDrawingIfPossible(*paintInfo.context, m_layoutImage, paintInfo.phase)) |
+ return; |
+ IntRect focusRect = m_layoutImage.absoluteContentBox(); |
LayoutObjectDrawingRecorder drawingRecorder(*paintInfo.context, m_layoutImage, paintInfo.phase, focusRect); |
- if (drawingRecorder.canUseCachedDrawing()) |
- return; |
// FIXME: Clip path instead of context when Skia pathops is ready. |
// https://crbug.com/251206 |
@@ -85,28 +85,26 @@ void ImagePainter::paintReplaced(const PaintInfo& paintInfo, const LayoutPoint& |
if (!m_layoutImage.imageResource()->hasImage()) { |
if (paintInfo.phase == PaintPhaseSelection) |
return; |
- |
if (cWidth > 2 && cHeight > 2) { |
+ if (LayoutObjectDrawingRecorder::useCachedDrawingIfPossible(*context, m_layoutImage, paintInfo.phase)) |
+ return; |
// Draw an outline rect where the image should be. |
IntRect paintRect = pixelSnappedIntRect(LayoutRect(paintOffset.x() + m_layoutImage.borderLeft() + m_layoutImage.paddingLeft(), paintOffset.y() + m_layoutImage.borderTop() + m_layoutImage.paddingTop(), cWidth, cHeight)); |
- |
LayoutObjectDrawingRecorder drawingRecorder(*context, m_layoutImage, paintInfo.phase, paintRect); |
- if (drawingRecorder.canUseCachedDrawing()) |
- return; |
context->setStrokeStyle(SolidStroke); |
context->setStrokeColor(Color::lightGray); |
context->setFillColor(Color::transparent); |
context->drawRect(paintRect); |
} |
} else if (cWidth > 0 && cHeight > 0) { |
+ if (LayoutObjectDrawingRecorder::useCachedDrawingIfPossible(*context, m_layoutImage, paintInfo.phase)) |
+ return; |
LayoutRect contentRect = m_layoutImage.contentBoxRect(); |
contentRect.moveBy(paintOffset); |
LayoutRect paintRect = m_layoutImage.replacedContentRect(); |
paintRect.moveBy(paintOffset); |
LayoutObjectDrawingRecorder drawingRecorder(*context, m_layoutImage, paintInfo.phase, contentRect); |
- if (drawingRecorder.canUseCachedDrawing()) |
- return; |
bool clip = !contentRect.contains(paintRect); |
if (clip) { |
context->save(); |