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

Unified Diff: third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp

Issue 1815293002: Revert of Skip PaintLayer empty paint phases if it previously painted nothing (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 9 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 | « third_party/WebKit/Source/core/paint/PaintLayer.cpp ('k') | third_party/WebKit/Source/core/paint/README.md » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp
diff --git a/third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp b/third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp
index aa1d504ac9e5ba8d7d4ccba55fc38356e4f80aa0..0a6252bb97619ba13f0f2ee27db062730789b882 100644
--- a/third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp
+++ b/third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp
@@ -212,42 +212,29 @@ static bool shouldCreateSubsequence(const PaintLayer& paintLayer, GraphicsContex
return true;
}
-static bool shouldRepaintSubsequence(PaintLayer& paintLayer, const PaintLayerPaintingInfo& paintingInfo, ShouldRespectOverflowClipType respectOverflowClip, const LayoutSize& subpixelAccumulation, bool& shouldClearEmptyPaintPhaseFlags)
+static bool shouldRepaintSubsequence(PaintLayer& paintLayer, const PaintLayerPaintingInfo& paintingInfo, ShouldRespectOverflowClipType respectOverflowClip, const LayoutSize& subpixelAccumulation)
{
bool needsRepaint = false;
- // We should set shouldResetEmptyPaintPhaseFlags if some previously unpainted objects may begin
- // to be painted, causing a previously empty paint phase to become non-empty.
-
// Repaint subsequence if the layer is marked for needing repaint.
- // We don't set needsResetEmptyPaintPhase here, but clear the empty paint phase flags
- // in PaintLayer::setNeedsPaintPhaseXXX(), to ensure that we won't clear
- // previousPaintPhaseXXXEmpty flags when unrelated things changed which won't
- // cause the paint phases to become non-empty.
if (paintLayer.needsRepaint())
needsRepaint = true;
// Repaint if layer's clip changes.
ClipRects& clipRects = paintLayer.clipper().paintingClipRects(paintingInfo.rootLayer, respectOverflowClip, subpixelAccumulation);
ClipRects* previousClipRects = paintLayer.previousPaintingClipRects();
- if (&clipRects != previousClipRects && (!previousClipRects || clipRects != *previousClipRects)) {
+ if (!needsRepaint && &clipRects != previousClipRects && (!previousClipRects || clipRects != *previousClipRects))
needsRepaint = true;
- shouldClearEmptyPaintPhaseFlags = true;
- }
paintLayer.setPreviousPaintingClipRects(clipRects);
// Repaint if previously the layer might be clipped by paintDirtyRect and paintDirtyRect changes.
- if (paintLayer.previousPaintResult() == PaintLayerPainter::MayBeClippedByPaintDirtyRect && paintLayer.previousPaintDirtyRect() != paintingInfo.paintDirtyRect) {
+ if (!needsRepaint && paintLayer.previousPaintResult() == PaintLayerPainter::MayBeClippedByPaintDirtyRect && paintLayer.previousPaintDirtyRect() != paintingInfo.paintDirtyRect)
needsRepaint = true;
- shouldClearEmptyPaintPhaseFlags = true;
- }
paintLayer.setPreviousPaintDirtyRect(paintingInfo.paintDirtyRect);
// Repaint if scroll offset accumulation changes.
- if (paintingInfo.scrollOffsetAccumulation != paintLayer.previousScrollOffsetAccumulationForPainting()) {
+ if (!needsRepaint && paintingInfo.scrollOffsetAccumulation != paintLayer.previousScrollOffsetAccumulationForPainting())
needsRepaint = true;
- shouldClearEmptyPaintPhaseFlags = true;
- }
paintLayer.setPreviousScrollOffsetAccumulationForPainting(paintingInfo.scrollOffsetAccumulation);
return needsRepaint;
@@ -291,20 +278,11 @@ PaintLayerPainter::PaintResult PaintLayerPainter::paintLayerContents(GraphicsCon
ShouldRespectOverflowClipType respectOverflowClip = shouldRespectOverflowClip(paintFlags, m_paintLayer.layoutObject());
Optional<SubsequenceRecorder> subsequenceRecorder;
- bool shouldClearEmptyPaintPhaseFlags = false;
if (shouldCreateSubsequence(m_paintLayer, context, paintingInfoArg, paintFlags)) {
- if (!shouldRepaintSubsequence(m_paintLayer, paintingInfoArg, respectOverflowClip, subpixelAccumulation, shouldClearEmptyPaintPhaseFlags)
+ if (!shouldRepaintSubsequence(m_paintLayer, paintingInfoArg, respectOverflowClip, subpixelAccumulation)
&& SubsequenceRecorder::useCachedSubsequenceIfPossible(context, m_paintLayer))
return result;
subsequenceRecorder.emplace(context, m_paintLayer);
- } else {
- shouldClearEmptyPaintPhaseFlags = true;
- }
-
- if (shouldClearEmptyPaintPhaseFlags) {
- m_paintLayer.setPreviousPaintPhaseDescendantOutlinesEmpty(false);
- m_paintLayer.setPreviousPaintPhaseFloatEmpty(false);
- m_paintLayer.setPreviousPaintPhaseDescendantBlockBackgroundsEmpty(false);
}
PaintLayerPaintingInfo paintingInfo = paintingInfoArg;
@@ -721,22 +699,13 @@ void PaintLayerPainter::paintForegroundForFragments(const PaintLayerFragments& l
if (selectionOnly) {
paintForegroundForFragmentsWithPhase(PaintPhaseSelection, layerFragments, context, localPaintingInfo, paintFlags, clipState);
} else {
- if (m_paintLayer.needsPaintPhaseDescendantBlockBackgrounds()) {
- size_t sizeBefore = context.getPaintController().newDisplayItemList().size();
+ if (m_paintLayer.needsPaintPhaseDescendantBlockBackgrounds())
paintForegroundForFragmentsWithPhase(PaintPhaseDescendantBlockBackgroundsOnly, layerFragments, context, localPaintingInfo, paintFlags, clipState);
- m_paintLayer.setPreviousPaintPhaseDescendantBlockBackgroundsEmpty(context.getPaintController().newDisplayItemList().size() == sizeBefore);
- }
- if (m_paintLayer.needsPaintPhaseFloat()) {
- size_t sizeBefore = context.getPaintController().newDisplayItemList().size();
+ if (m_paintLayer.needsPaintPhaseFloat())
paintForegroundForFragmentsWithPhase(PaintPhaseFloat, layerFragments, context, localPaintingInfo, paintFlags, clipState);
- m_paintLayer.setPreviousPaintPhaseFloatEmpty(context.getPaintController().newDisplayItemList().size() == sizeBefore);
- }
paintForegroundForFragmentsWithPhase(PaintPhaseForeground, layerFragments, context, localPaintingInfo, paintFlags, clipState);
- if (m_paintLayer.needsPaintPhaseDescendantOutlines()) {
- size_t sizeBefore = context.getPaintController().newDisplayItemList().size();
+ if (m_paintLayer.needsPaintPhaseDescendantOutlines())
paintForegroundForFragmentsWithPhase(PaintPhaseDescendantOutlinesOnly, layerFragments, context, localPaintingInfo, paintFlags, clipState);
- m_paintLayer.setPreviousPaintPhaseDescendantOutlinesEmpty(context.getPaintController().newDisplayItemList().size() == sizeBefore);
- }
}
}
« no previous file with comments | « third_party/WebKit/Source/core/paint/PaintLayer.cpp ('k') | third_party/WebKit/Source/core/paint/README.md » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698