Index: Source/core/paint/LayoutObjectDrawingRecorder.h |
diff --git a/Source/core/paint/LayoutObjectDrawingRecorder.h b/Source/core/paint/LayoutObjectDrawingRecorder.h |
index d94ccbcc4d5123d9b60a20000de9e02ab042c949..cd79523f73d4eafbec90f131847e5889286f5cae 100644 |
--- a/Source/core/paint/LayoutObjectDrawingRecorder.h |
+++ b/Source/core/paint/LayoutObjectDrawingRecorder.h |
@@ -19,6 +19,18 @@ class GraphicsContext; |
// Convenience wrapper of DrawingRecorder for LayoutObject painters. |
class LayoutObjectDrawingRecorder final { |
public: |
+ static bool useCachedDrawingIfPossible(GraphicsContext& context, const LayoutObject& layoutObject, DisplayItem::Type displayItemType) |
+ { |
+ if (layoutObject.fullPaintInvalidationReason() == PaintInvalidationDelayedFull) |
+ return false; |
+ return DrawingRecorder::useCachedDrawingIfPossible(context, layoutObject, displayItemType); |
+ } |
+ |
+ static bool useCachedDrawingIfPossible(GraphicsContext& context, const LayoutObject& layoutObject, PaintPhase phase) |
+ { |
+ return useCachedDrawingIfPossible(context, layoutObject, DisplayItem::paintPhaseToDrawingType(phase)); |
+ } |
+ |
LayoutObjectDrawingRecorder(GraphicsContext& context, const LayoutObject& layoutObject, DisplayItem::Type displayItemType, const FloatRect& clip) |
{ |
// We may paint a delayed-invalidation object before it's actually invalidated. |
@@ -33,8 +45,6 @@ public: |
LayoutObjectDrawingRecorder(GraphicsContext& context, const LayoutObject& layoutObject, DisplayItem::Type type, const LayoutRect& clip) |
: LayoutObjectDrawingRecorder(context, layoutObject, type, pixelSnappedIntRect(clip)) { } |
- bool canUseCachedDrawing() const { return m_drawingRecorder->canUseCachedDrawing(); } |
- |
#if ENABLE(ASSERT) |
void setUnderInvalidationCheckingMode(DrawingDisplayItem::UnderInvalidationCheckingMode mode) { m_drawingRecorder->setUnderInvalidationCheckingMode(mode); } |
#endif |