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

Side by Side Diff: third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp

Issue 1584493002: Skip PaintPhaseDescendantOutlinesOnly if no descendent outlines in the layer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix multicol span issue Created 4 years, 11 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/paint/PaintLayerPainter.h" 5 #include "core/paint/PaintLayerPainter.h"
6 6
7 #include "core/frame/Settings.h" 7 #include "core/frame/Settings.h"
8 #include "core/layout/ClipPathOperation.h" 8 #include "core/layout/ClipPathOperation.h"
9 #include "core/layout/LayoutBlock.h" 9 #include "core/layout/LayoutBlock.h"
10 #include "core/layout/LayoutFrame.h" 10 #include "core/layout/LayoutFrame.h"
(...skipping 662 matching lines...) Expand 10 before | Expand all | Expand 10 after
673 } 673 }
674 674
675 // We have to loop through every fragment multiple times, since we have to i ssue paint invalidations in each specific phase in order for 675 // We have to loop through every fragment multiple times, since we have to i ssue paint invalidations in each specific phase in order for
676 // interleaving of the fragments to work properly. 676 // interleaving of the fragments to work properly.
677 paintForegroundForFragmentsWithPhase(selectionOnly ? PaintPhaseSelection : P aintPhaseDescendantBlockBackgroundsOnly, layerFragments, 677 paintForegroundForFragmentsWithPhase(selectionOnly ? PaintPhaseSelection : P aintPhaseDescendantBlockBackgroundsOnly, layerFragments,
678 context, localPaintingInfo, paintingRootForLayoutObject, paintFlags, cli pState); 678 context, localPaintingInfo, paintingRootForLayoutObject, paintFlags, cli pState);
679 679
680 if (!selectionOnly) { 680 if (!selectionOnly) {
681 paintForegroundForFragmentsWithPhase(PaintPhaseFloat, layerFragments, co ntext, localPaintingInfo, paintingRootForLayoutObject, paintFlags, clipState); 681 paintForegroundForFragmentsWithPhase(PaintPhaseFloat, layerFragments, co ntext, localPaintingInfo, paintingRootForLayoutObject, paintFlags, clipState);
682 paintForegroundForFragmentsWithPhase(PaintPhaseForeground, layerFragment s, context, localPaintingInfo, paintingRootForLayoutObject, paintFlags, clipStat e); 682 paintForegroundForFragmentsWithPhase(PaintPhaseForeground, layerFragment s, context, localPaintingInfo, paintingRootForLayoutObject, paintFlags, clipStat e);
683 paintForegroundForFragmentsWithPhase(PaintPhaseDescendantOutlinesOnly, l ayerFragments, context, localPaintingInfo, paintingRootForLayoutObject, paintFla gs, clipState); 683
684 if (m_paintLayer.needsPaintPhaseDescendantOutlines()) {
685 size_t displayItemListSizeBefore = context.paintController().newDisp layItemList().size();
686 paintForegroundForFragmentsWithPhase(PaintPhaseDescendantOutlinesOnl y, layerFragments, context, localPaintingInfo, paintingRootForLayoutObject, pain tFlags, clipState);
687 if (displayItemListSizeBefore == context.paintController().newDispla yItemList().size())
688 m_paintLayer.clearNeedsPaintPhaseDescendantOutlines();
689 }
684 } 690 }
685 } 691 }
686 692
687 void PaintLayerPainter::paintForegroundForFragmentsWithPhase(PaintPhase phase, c onst PaintLayerFragments& layerFragments, GraphicsContext& context, 693 void PaintLayerPainter::paintForegroundForFragmentsWithPhase(PaintPhase phase, c onst PaintLayerFragments& layerFragments, GraphicsContext& context,
688 const PaintLayerPaintingInfo& localPaintingInfo, LayoutObject* paintingRootF orLayoutObject, PaintLayerFlags paintFlags, ClipState clipState) 694 const PaintLayerPaintingInfo& localPaintingInfo, LayoutObject* paintingRootF orLayoutObject, PaintLayerFlags paintFlags, ClipState clipState)
689 { 695 {
690 bool needsScope = layerFragments.size() > 1; 696 bool needsScope = layerFragments.size() > 1;
691 for (auto& fragment : layerFragments) { 697 for (auto& fragment : layerFragments) {
692 if (!fragment.foregroundRect.isEmpty()) { 698 if (!fragment.foregroundRect.isEmpty()) {
693 Optional<ScopeRecorder> scopeRecorder; 699 Optional<ScopeRecorder> scopeRecorder;
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
741 if (!m_paintLayer.containsDirtyOverlayScrollbars()) 747 if (!m_paintLayer.containsDirtyOverlayScrollbars())
742 return; 748 return;
743 749
744 PaintLayerPaintingInfo paintingInfo(&m_paintLayer, LayoutRect(enclosingIntRe ct(damageRect)), paintFlags, LayoutSize(), paintingRoot); 750 PaintLayerPaintingInfo paintingInfo(&m_paintLayer, LayoutRect(enclosingIntRe ct(damageRect)), paintFlags, LayoutSize(), paintingRoot);
745 paintLayer(context, paintingInfo, PaintLayerPaintingOverlayScrollbars); 751 paintLayer(context, paintingInfo, PaintLayerPaintingOverlayScrollbars);
746 752
747 m_paintLayer.setContainsDirtyOverlayScrollbars(false); 753 m_paintLayer.setContainsDirtyOverlayScrollbars(false);
748 } 754 }
749 755
750 } // namespace blink 756 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698