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/LocalFrame.h" | 7 #include "core/frame/LocalFrame.h" |
8 #include "core/layout/LayoutInline.h" | 8 #include "core/layout/LayoutInline.h" |
9 #include "core/layout/LayoutView.h" | 9 #include "core/layout/LayoutView.h" |
10 #include "core/paint/ClipPathClipper.h" | 10 #include "core/paint/ClipPathClipper.h" |
(...skipping 687 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
698 if (shouldClip && needsToClip(localPaintingInfo, layerFragments[0].foregroun
dRect)) { | 698 if (shouldClip && needsToClip(localPaintingInfo, layerFragments[0].foregroun
dRect)) { |
699 clipRecorder.emplace(context, *m_paintLayer.layoutObject(), DisplayItem:
:kClipLayerForeground, layerFragments[0].foregroundRect, &localPaintingInfo, lay
erFragments[0].paginationOffset, paintFlags); | 699 clipRecorder.emplace(context, *m_paintLayer.layoutObject(), DisplayItem:
:kClipLayerForeground, layerFragments[0].foregroundRect, &localPaintingInfo, lay
erFragments[0].paginationOffset, paintFlags); |
700 clipState = HasClipped; | 700 clipState = HasClipped; |
701 } | 701 } |
702 | 702 |
703 // We have to loop through every fragment multiple times, since we have to i
ssue paint invalidations in each specific phase in order for | 703 // We have to loop through every fragment multiple times, since we have to i
ssue paint invalidations in each specific phase in order for |
704 // interleaving of the fragments to work properly. | 704 // interleaving of the fragments to work properly. |
705 if (selectionOnly) { | 705 if (selectionOnly) { |
706 paintForegroundForFragmentsWithPhase(PaintPhaseSelection, layerFragments
, context, localPaintingInfo, paintFlags, clipState); | 706 paintForegroundForFragmentsWithPhase(PaintPhaseSelection, layerFragments
, context, localPaintingInfo, paintFlags, clipState); |
707 } else { | 707 } else { |
708 if (RuntimeEnabledFeatures::paintUnderInvalidationCheckingEnabled() || m
_paintLayer.needsPaintPhaseDescendantBlockBackgrounds()) { | 708 if (RuntimeEnabledFeatures::slimmingPaintUnderInvalidationCheckingEnable
d() || m_paintLayer.needsPaintPhaseDescendantBlockBackgrounds()) { |
709 size_t sizeBefore = context.getPaintController().newDisplayItemList(
).size(); | 709 size_t sizeBefore = context.getPaintController().newDisplayItemList(
).size(); |
710 paintForegroundForFragmentsWithPhase(PaintPhaseDescendantBlockBackgr
oundsOnly, layerFragments, context, localPaintingInfo, paintFlags, clipState); | 710 paintForegroundForFragmentsWithPhase(PaintPhaseDescendantBlockBackgr
oundsOnly, layerFragments, context, localPaintingInfo, paintFlags, clipState); |
711 // Don't set the empty flag if we are not painting the whole backgro
und. | 711 // Don't set the empty flag if we are not painting the whole backgro
und. |
712 if (!(paintFlags & PaintLayerPaintingSkipRootBackground)) { | 712 if (!(paintFlags & PaintLayerPaintingSkipRootBackground)) { |
713 bool phaseIsEmpty = context.getPaintController().newDisplayItemL
ist().size() == sizeBefore; | 713 bool phaseIsEmpty = context.getPaintController().newDisplayItemL
ist().size() == sizeBefore; |
714 DCHECK(phaseIsEmpty || m_paintLayer.needsPaintPhaseDescendantBlo
ckBackgrounds()); | 714 DCHECK(phaseIsEmpty || m_paintLayer.needsPaintPhaseDescendantBlo
ckBackgrounds()); |
715 m_paintLayer.setPreviousPaintPhaseDescendantBlockBackgroundsEmpt
y(phaseIsEmpty); | 715 m_paintLayer.setPreviousPaintPhaseDescendantBlockBackgroundsEmpt
y(phaseIsEmpty); |
716 } | 716 } |
717 } | 717 } |
718 | 718 |
719 if (RuntimeEnabledFeatures::paintUnderInvalidationCheckingEnabled() || m
_paintLayer.needsPaintPhaseFloat()) { | 719 if (RuntimeEnabledFeatures::slimmingPaintUnderInvalidationCheckingEnable
d() || m_paintLayer.needsPaintPhaseFloat()) { |
720 size_t sizeBefore = context.getPaintController().newDisplayItemList(
).size(); | 720 size_t sizeBefore = context.getPaintController().newDisplayItemList(
).size(); |
721 paintForegroundForFragmentsWithPhase(PaintPhaseFloat, layerFragments
, context, localPaintingInfo, paintFlags, clipState); | 721 paintForegroundForFragmentsWithPhase(PaintPhaseFloat, layerFragments
, context, localPaintingInfo, paintFlags, clipState); |
722 bool phaseIsEmpty = context.getPaintController().newDisplayItemList(
).size() == sizeBefore; | 722 bool phaseIsEmpty = context.getPaintController().newDisplayItemList(
).size() == sizeBefore; |
723 DCHECK(phaseIsEmpty || m_paintLayer.needsPaintPhaseFloat()); | 723 DCHECK(phaseIsEmpty || m_paintLayer.needsPaintPhaseFloat()); |
724 m_paintLayer.setPreviousPaintPhaseFloatEmpty(phaseIsEmpty); | 724 m_paintLayer.setPreviousPaintPhaseFloatEmpty(phaseIsEmpty); |
725 } | 725 } |
726 | 726 |
727 paintForegroundForFragmentsWithPhase(PaintPhaseForeground, layerFragment
s, context, localPaintingInfo, paintFlags, clipState); | 727 paintForegroundForFragmentsWithPhase(PaintPhaseForeground, layerFragment
s, context, localPaintingInfo, paintFlags, clipState); |
728 | 728 |
729 if (RuntimeEnabledFeatures::paintUnderInvalidationCheckingEnabled() || m
_paintLayer.needsPaintPhaseDescendantOutlines()) { | 729 if (RuntimeEnabledFeatures::slimmingPaintUnderInvalidationCheckingEnable
d() || m_paintLayer.needsPaintPhaseDescendantOutlines()) { |
730 size_t sizeBefore = context.getPaintController().newDisplayItemList(
).size(); | 730 size_t sizeBefore = context.getPaintController().newDisplayItemList(
).size(); |
731 paintForegroundForFragmentsWithPhase(PaintPhaseDescendantOutlinesOnl
y, layerFragments, context, localPaintingInfo, paintFlags, clipState); | 731 paintForegroundForFragmentsWithPhase(PaintPhaseDescendantOutlinesOnl
y, layerFragments, context, localPaintingInfo, paintFlags, clipState); |
732 bool phaseIsEmpty = context.getPaintController().newDisplayItemList(
).size() == sizeBefore; | 732 bool phaseIsEmpty = context.getPaintController().newDisplayItemList(
).size() == sizeBefore; |
733 DCHECK(phaseIsEmpty || m_paintLayer.needsPaintPhaseDescendantOutline
s()); | 733 DCHECK(phaseIsEmpty || m_paintLayer.needsPaintPhaseDescendantOutline
s()); |
734 m_paintLayer.setPreviousPaintPhaseDescendantOutlinesEmpty(phaseIsEmp
ty); | 734 m_paintLayer.setPreviousPaintPhaseDescendantOutlinesEmpty(phaseIsEmp
ty); |
735 } | 735 } |
736 } | 736 } |
737 } | 737 } |
738 | 738 |
739 void PaintLayerPainter::paintForegroundForFragmentsWithPhase(PaintPhase phase, | 739 void PaintLayerPainter::paintForegroundForFragmentsWithPhase(PaintPhase phase, |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
790 if (!m_paintLayer.containsDirtyOverlayScrollbars()) | 790 if (!m_paintLayer.containsDirtyOverlayScrollbars()) |
791 return; | 791 return; |
792 | 792 |
793 PaintLayerPaintingInfo paintingInfo(&m_paintLayer, LayoutRect(enclosingIntRe
ct(damageRect)), paintFlags, LayoutSize()); | 793 PaintLayerPaintingInfo paintingInfo(&m_paintLayer, LayoutRect(enclosingIntRe
ct(damageRect)), paintFlags, LayoutSize()); |
794 paintLayer(context, paintingInfo, PaintLayerPaintingOverlayScrollbars); | 794 paintLayer(context, paintingInfo, PaintLayerPaintingOverlayScrollbars); |
795 | 795 |
796 m_paintLayer.setContainsDirtyOverlayScrollbars(false); | 796 m_paintLayer.setContainsDirtyOverlayScrollbars(false); |
797 } | 797 } |
798 | 798 |
799 } // namespace blink | 799 } // namespace blink |
OLD | NEW |