Index: Source/core/paint/DeprecatedPaintLayerPainter.cpp |
diff --git a/Source/core/paint/DeprecatedPaintLayerPainter.cpp b/Source/core/paint/DeprecatedPaintLayerPainter.cpp |
index 2f5156751e7f103a59518343cbc82251c37479d3..1b317da518dc942cd6652c8ae96bfb32fb79d23d 100644 |
--- a/Source/core/paint/DeprecatedPaintLayerPainter.cpp |
+++ b/Source/core/paint/DeprecatedPaintLayerPainter.cpp |
@@ -26,6 +26,7 @@ |
#include "platform/graphics/paint/ClipPathRecorder.h" |
#include "platform/graphics/paint/ClipRecorder.h" |
#include "platform/graphics/paint/CompositingDisplayItem.h" |
+#include "platform/graphics/paint/SubsequenceRecorder.h" |
#include "platform/graphics/paint/Transform3DDisplayItem.h" |
#include "wtf/Optional.h" |
@@ -68,8 +69,13 @@ void DeprecatedPaintLayerPainter::paintLayer(GraphicsContext* context, const Dep |
} |
// Non self-painting leaf layers don't need to be painted as their layoutObject() should properly paint itself. |
- if (!m_paintLayer.isSelfPaintingLayer() && !m_paintLayer.hasSelfPaintingLayerDescendant()) |
+ if (!m_paintLayer.isSelfPaintingLayer() && !m_paintLayer.hasSelfPaintingLayerDescendant()) { |
+ ASSERT(!m_paintLayer.needsRepaint()); |
return; |
+ } |
+ |
+ bool needsRepaint = m_paintLayer.needsRepaint(); |
+ m_paintLayer.clearNeedsRepaint(); |
if (shouldSuppressPaintingLayer(&m_paintLayer)) |
return; |
@@ -78,6 +84,10 @@ void DeprecatedPaintLayerPainter::paintLayer(GraphicsContext* context, const Dep |
if (!m_paintLayer.layoutObject()->opacity()) |
return; |
+ if (!needsRepaint && SubsequenceRecorder::useCachedSubsequenceIfPossible(*context, *m_paintLayer.layoutObject())) |
chrishtr
2015/08/27 04:29:48
Why aren't you checking for being a stacking conte
Xianzhu
2015/08/27 16:38:02
Adding condition for stacking context seems just t
|
+ return; |
+ SubsequenceRecorder subsequenceRecorder(*context, *m_paintLayer.layoutObject()); |
+ |
if (m_paintLayer.paintsWithTransparency(paintingInfo.globalPaintFlags())) |
paintFlags |= PaintLayerHaveTransparency; |