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

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: Don't mark non-self-painting layers for needsRepaint 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
« no previous file with comments | « Source/core/paint/DeprecatedPaintLayer.cpp ('k') | Source/core/paint/DisplayItemListPaintTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/paint/DeprecatedPaintLayerPainter.cpp
diff --git a/Source/core/paint/DeprecatedPaintLayerPainter.cpp b/Source/core/paint/DeprecatedPaintLayerPainter.cpp
index 147ee2bcfa65a675054f2529135f113f17262f58..6a2eb381fb7e51f35c1847292dfb8ec9204d8345 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() && !m_paintLayer.layoutObject()->hasBackdropFilter())
return;
+ if (!needsRepaint && SubsequenceRecorder::useCachedSubsequenceIfPossible(*context, *m_paintLayer.layoutObject()))
+ return;
+ SubsequenceRecorder subsequenceRecorder(*context, *m_paintLayer.layoutObject());
+
if (m_paintLayer.paintsWithTransparency(paintingInfo.globalPaintFlags()))
paintFlags |= PaintLayerHaveTransparency;
« no previous file with comments | « Source/core/paint/DeprecatedPaintLayer.cpp ('k') | Source/core/paint/DisplayItemListPaintTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698