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