OLD | NEW |
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 663 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
674 } | 674 } |
675 | 675 |
676 // 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 // We have to loop through every fragment multiple times, since we have to i
ssue paint invalidations in each specific phase in order for |
677 // interleaving of the fragments to work properly. | 677 // interleaving of the fragments to work properly. |
678 paintForegroundForFragmentsWithPhase(selectionOnly ? PaintPhaseSelection : P
aintPhaseChildBlockBackgrounds, layerFragments, | 678 paintForegroundForFragmentsWithPhase(selectionOnly ? PaintPhaseSelection : P
aintPhaseChildBlockBackgrounds, layerFragments, |
679 context, localPaintingInfo, paintingRootForLayoutObject, paintFlags, cli
pState); | 679 context, localPaintingInfo, paintingRootForLayoutObject, paintFlags, cli
pState); |
680 | 680 |
681 if (!selectionOnly) { | 681 if (!selectionOnly) { |
682 paintForegroundForFragmentsWithPhase(PaintPhaseFloat, layerFragments, co
ntext, localPaintingInfo, paintingRootForLayoutObject, paintFlags, clipState); | 682 paintForegroundForFragmentsWithPhase(PaintPhaseFloat, layerFragments, co
ntext, localPaintingInfo, paintingRootForLayoutObject, paintFlags, clipState); |
683 paintForegroundForFragmentsWithPhase(PaintPhaseForeground, layerFragment
s, context, localPaintingInfo, paintingRootForLayoutObject, paintFlags, clipStat
e); | 683 paintForegroundForFragmentsWithPhase(PaintPhaseForeground, layerFragment
s, context, localPaintingInfo, paintingRootForLayoutObject, paintFlags, clipStat
e); |
684 paintForegroundForFragmentsWithPhase(PaintPhaseChildOutlines, layerFragm
ents, context, localPaintingInfo, paintingRootForLayoutObject, paintFlags, clipS
tate); | 684 |
| 685 if (m_paintLayer.needsPaintPhaseChildOutlines()) { |
| 686 size_t displayItemListSizeBefore = context.paintController().newDisp
layItemList().size(); |
| 687 paintForegroundForFragmentsWithPhase(PaintPhaseChildOutlines, layerF
ragments, context, localPaintingInfo, paintingRootForLayoutObject, paintFlags, c
lipState); |
| 688 if (displayItemListSizeBefore == context.paintController().newDispla
yItemList().size()) |
| 689 m_paintLayer.clearNeedsPaintPhaseChildOutlines(); |
| 690 } |
685 } | 691 } |
686 } | 692 } |
687 | 693 |
688 void PaintLayerPainter::paintForegroundForFragmentsWithPhase(PaintPhase phase, c
onst PaintLayerFragments& layerFragments, GraphicsContext& context, | 694 void PaintLayerPainter::paintForegroundForFragmentsWithPhase(PaintPhase phase, c
onst PaintLayerFragments& layerFragments, GraphicsContext& context, |
689 const PaintLayerPaintingInfo& localPaintingInfo, LayoutObject* paintingRootF
orLayoutObject, PaintLayerFlags paintFlags, ClipState clipState) | 695 const PaintLayerPaintingInfo& localPaintingInfo, LayoutObject* paintingRootF
orLayoutObject, PaintLayerFlags paintFlags, ClipState clipState) |
690 { | 696 { |
691 bool needsScope = layerFragments.size() > 1; | 697 bool needsScope = layerFragments.size() > 1; |
692 for (auto& fragment : layerFragments) { | 698 for (auto& fragment : layerFragments) { |
693 if (!fragment.foregroundRect.isEmpty()) { | 699 if (!fragment.foregroundRect.isEmpty()) { |
694 Optional<ScopeRecorder> scopeRecorder; | 700 Optional<ScopeRecorder> scopeRecorder; |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
742 if (!m_paintLayer.containsDirtyOverlayScrollbars()) | 748 if (!m_paintLayer.containsDirtyOverlayScrollbars()) |
743 return; | 749 return; |
744 | 750 |
745 PaintLayerPaintingInfo paintingInfo(&m_paintLayer, LayoutRect(enclosingIntRe
ct(damageRect)), paintFlags, LayoutSize(), paintingRoot); | 751 PaintLayerPaintingInfo paintingInfo(&m_paintLayer, LayoutRect(enclosingIntRe
ct(damageRect)), paintFlags, LayoutSize(), paintingRoot); |
746 paintLayer(context, paintingInfo, PaintLayerPaintingOverlayScrollbars); | 752 paintLayer(context, paintingInfo, PaintLayerPaintingOverlayScrollbars); |
747 | 753 |
748 m_paintLayer.setContainsDirtyOverlayScrollbars(false); | 754 m_paintLayer.setContainsDirtyOverlayScrollbars(false); |
749 } | 755 } |
750 | 756 |
751 } // namespace blink | 757 } // namespace blink |
OLD | NEW |