Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1531)

Unified Diff: Source/core/paint/DeprecatedPaintLayerPainter.cpp

Issue 1294233004: Subtree caching implementation in blink-core (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Unittest Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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;

Powered by Google App Engine
This is Rietveld 408576698