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