| 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 709 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 720 clipState = HasClipped; | 720 clipState = HasClipped; |
| 721 } | 721 } |
| 722 | 722 |
| 723 // We have to loop through every fragment multiple times, since we have to i
ssue paint invalidations in each specific phase in order for | 723 // We have to loop through every fragment multiple times, since we have to i
ssue paint invalidations in each specific phase in order for |
| 724 // interleaving of the fragments to work properly. | 724 // interleaving of the fragments to work properly. |
| 725 if (selectionOnly) { | 725 if (selectionOnly) { |
| 726 paintForegroundForFragmentsWithPhase(PaintPhaseSelection, layerFragments
, context, localPaintingInfo, paintFlags, clipState); | 726 paintForegroundForFragmentsWithPhase(PaintPhaseSelection, layerFragments
, context, localPaintingInfo, paintFlags, clipState); |
| 727 } else { | 727 } else { |
| 728 if (m_paintLayer.needsPaintPhaseDescendantBlockBackgrounds()) | 728 if (m_paintLayer.needsPaintPhaseDescendantBlockBackgrounds()) |
| 729 paintForegroundForFragmentsWithPhase(PaintPhaseDescendantBlockBackgr
oundsOnly, layerFragments, context, localPaintingInfo, paintFlags, clipState); | 729 paintForegroundForFragmentsWithPhase(PaintPhaseDescendantBlockBackgr
oundsOnly, layerFragments, context, localPaintingInfo, paintFlags, clipState); |
| 730 if (m_paintLayer.needsPaintPhaseFloat()) | 730 // TODO(wangxianzhu): Enable float empty-phase optimization after fixing
crbug.com/603910. |
| 731 paintForegroundForFragmentsWithPhase(PaintPhaseFloat, layerFragments
, context, localPaintingInfo, paintFlags, clipState); | 731 // if (m_paintLayer.needsPaintPhaseFloat()) |
| 732 paintForegroundForFragmentsWithPhase(PaintPhaseFloat, layerFragments, co
ntext, localPaintingInfo, paintFlags, clipState); |
| 732 paintForegroundForFragmentsWithPhase(PaintPhaseForeground, layerFragment
s, context, localPaintingInfo, paintFlags, clipState); | 733 paintForegroundForFragmentsWithPhase(PaintPhaseForeground, layerFragment
s, context, localPaintingInfo, paintFlags, clipState); |
| 733 if (m_paintLayer.needsPaintPhaseDescendantOutlines()) | 734 if (m_paintLayer.needsPaintPhaseDescendantOutlines()) |
| 734 paintForegroundForFragmentsWithPhase(PaintPhaseDescendantOutlinesOnl
y, layerFragments, context, localPaintingInfo, paintFlags, clipState); | 735 paintForegroundForFragmentsWithPhase(PaintPhaseDescendantOutlinesOnl
y, layerFragments, context, localPaintingInfo, paintFlags, clipState); |
| 735 } | 736 } |
| 736 } | 737 } |
| 737 | 738 |
| 738 void PaintLayerPainter::paintForegroundForFragmentsWithPhase(PaintPhase phase, | 739 void PaintLayerPainter::paintForegroundForFragmentsWithPhase(PaintPhase phase, |
| 739 const PaintLayerFragments& layerFragments, GraphicsContext& context, | 740 const PaintLayerFragments& layerFragments, GraphicsContext& context, |
| 740 const PaintLayerPaintingInfo& localPaintingInfo, PaintLayerFlags paintFlags,
ClipState clipState) | 741 const PaintLayerPaintingInfo& localPaintingInfo, PaintLayerFlags paintFlags,
ClipState clipState) |
| 741 { | 742 { |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 793 if (!m_paintLayer.containsDirtyOverlayScrollbars()) | 794 if (!m_paintLayer.containsDirtyOverlayScrollbars()) |
| 794 return; | 795 return; |
| 795 | 796 |
| 796 PaintLayerPaintingInfo paintingInfo(&m_paintLayer, LayoutRect(enclosingIntRe
ct(damageRect)), paintFlags, LayoutSize()); | 797 PaintLayerPaintingInfo paintingInfo(&m_paintLayer, LayoutRect(enclosingIntRe
ct(damageRect)), paintFlags, LayoutSize()); |
| 797 paintLayer(context, paintingInfo, PaintLayerPaintingOverlayScrollbars); | 798 paintLayer(context, paintingInfo, PaintLayerPaintingOverlayScrollbars); |
| 798 | 799 |
| 799 m_paintLayer.setContainsDirtyOverlayScrollbars(false); | 800 m_paintLayer.setContainsDirtyOverlayScrollbars(false); |
| 800 } | 801 } |
| 801 | 802 |
| 802 } // namespace blink | 803 } // namespace blink |
| OLD | NEW |