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/FrameView.h" | 7 #include "core/frame/FrameView.h" |
8 #include "core/frame/Settings.h" | 8 #include "core/frame/Settings.h" |
9 #include "core/layout/ClipPathOperation.h" | 9 #include "core/layout/ClipPathOperation.h" |
10 #include "core/layout/LayoutBlock.h" | 10 #include "core/layout/LayoutBlock.h" |
(...skipping 649 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
660 bool shouldClip = localPaintingInfo.clipToDirtyRect && layerFragments.size()
== 1 && !layerFragments[0].foregroundRect.isEmpty(); | 660 bool shouldClip = localPaintingInfo.clipToDirtyRect && layerFragments.size()
== 1 && !layerFragments[0].foregroundRect.isEmpty(); |
661 ClipState clipState = HasNotClipped; | 661 ClipState clipState = HasNotClipped; |
662 Optional<LayerClipRecorder> clipRecorder; | 662 Optional<LayerClipRecorder> clipRecorder; |
663 if (shouldClip && needsToClip(localPaintingInfo, layerFragments[0].foregroun
dRect)) { | 663 if (shouldClip && needsToClip(localPaintingInfo, layerFragments[0].foregroun
dRect)) { |
664 clipRecorder.emplace(context, *m_paintLayer.layoutObject(), DisplayItem:
:ClipLayerForeground, layerFragments[0].foregroundRect, &localPaintingInfo, laye
rFragments[0].paginationOffset, paintFlags); | 664 clipRecorder.emplace(context, *m_paintLayer.layoutObject(), DisplayItem:
:ClipLayerForeground, layerFragments[0].foregroundRect, &localPaintingInfo, laye
rFragments[0].paginationOffset, paintFlags); |
665 clipState = HasClipped; | 665 clipState = HasClipped; |
666 } | 666 } |
667 | 667 |
668 // We have to loop through every fragment multiple times, since we have to i
ssue paint invalidations in each specific phase in order for | 668 // We have to loop through every fragment multiple times, since we have to i
ssue paint invalidations in each specific phase in order for |
669 // interleaving of the fragments to work properly. | 669 // interleaving of the fragments to work properly. |
670 paintForegroundForFragmentsWithPhase(selectionOnly ? PaintPhaseSelection : P
aintPhaseDescendantBlockBackgroundsOnly, | 670 if (selectionOnly) { |
671 layerFragments, context, localPaintingInfo, paintFlags, clipState); | 671 paintForegroundForFragmentsWithPhase(PaintPhaseSelection, layerFragments
, context, localPaintingInfo, paintFlags, clipState); |
672 | 672 } else { |
673 if (!selectionOnly) { | 673 if (m_paintLayer.needsPaintPhaseDescendantBlockBackgrounds()) |
| 674 paintForegroundForFragmentsWithPhase(PaintPhaseDescendantBlockBackgr
oundsOnly, layerFragments, context, localPaintingInfo, paintFlags, clipState); |
674 if (m_paintLayer.needsPaintPhaseFloat()) | 675 if (m_paintLayer.needsPaintPhaseFloat()) |
675 paintForegroundForFragmentsWithPhase(PaintPhaseFloat, layerFragments
, context, localPaintingInfo, paintFlags, clipState); | 676 paintForegroundForFragmentsWithPhase(PaintPhaseFloat, layerFragments
, context, localPaintingInfo, paintFlags, clipState); |
676 paintForegroundForFragmentsWithPhase(PaintPhaseForeground, layerFragment
s, context, localPaintingInfo, paintFlags, clipState); | 677 paintForegroundForFragmentsWithPhase(PaintPhaseForeground, layerFragment
s, context, localPaintingInfo, paintFlags, clipState); |
677 if (m_paintLayer.needsPaintPhaseDescendantOutlines()) | 678 if (m_paintLayer.needsPaintPhaseDescendantOutlines()) |
678 paintForegroundForFragmentsWithPhase(PaintPhaseDescendantOutlinesOnl
y, layerFragments, context, localPaintingInfo, paintFlags, clipState); | 679 paintForegroundForFragmentsWithPhase(PaintPhaseDescendantOutlinesOnl
y, layerFragments, context, localPaintingInfo, paintFlags, clipState); |
679 } | 680 } |
680 } | 681 } |
681 | 682 |
682 void PaintLayerPainter::paintForegroundForFragmentsWithPhase(PaintPhase phase, | 683 void PaintLayerPainter::paintForegroundForFragmentsWithPhase(PaintPhase phase, |
683 const PaintLayerFragments& layerFragments, GraphicsContext& context, | 684 const PaintLayerFragments& layerFragments, GraphicsContext& context, |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
737 if (!m_paintLayer.containsDirtyOverlayScrollbars()) | 738 if (!m_paintLayer.containsDirtyOverlayScrollbars()) |
738 return; | 739 return; |
739 | 740 |
740 PaintLayerPaintingInfo paintingInfo(&m_paintLayer, LayoutRect(enclosingIntRe
ct(damageRect)), paintFlags, LayoutSize()); | 741 PaintLayerPaintingInfo paintingInfo(&m_paintLayer, LayoutRect(enclosingIntRe
ct(damageRect)), paintFlags, LayoutSize()); |
741 paintLayer(context, paintingInfo, PaintLayerPaintingOverlayScrollbars); | 742 paintLayer(context, paintingInfo, PaintLayerPaintingOverlayScrollbars); |
742 | 743 |
743 m_paintLayer.setContainsDirtyOverlayScrollbars(false); | 744 m_paintLayer.setContainsDirtyOverlayScrollbars(false); |
744 } | 745 } |
745 | 746 |
746 } // namespace blink | 747 } // namespace blink |
OLD | NEW |