| 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 689 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 (m_paintLayer.needsPaintPhaseDescendantBlockBackgrounds()) | 708 if (m_paintLayer.needsPaintPhaseDescendantBlockBackgrounds()) |
| 709 paintForegroundForFragmentsWithPhase(PaintPhaseDescendantBlockBackgr
oundsOnly, layerFragments, context, localPaintingInfo, paintFlags, clipState); | 709 paintForegroundForFragmentsWithPhase(PaintPhaseDescendantBlockBackgr
oundsOnly, layerFragments, context, localPaintingInfo, paintFlags, clipState); |
| 710 if (m_paintLayer.needsPaintPhaseFloat()) | 710 // TODO(wangxianzhu): Enable float empty-phase optimization after fixing
crbug.com/603910. |
| 711 paintForegroundForFragmentsWithPhase(PaintPhaseFloat, layerFragments
, context, localPaintingInfo, paintFlags, clipState); | 711 // if (m_paintLayer.needsPaintPhaseFloat()) |
| 712 paintForegroundForFragmentsWithPhase(PaintPhaseFloat, layerFragments, co
ntext, localPaintingInfo, paintFlags, clipState); |
| 712 paintForegroundForFragmentsWithPhase(PaintPhaseForeground, layerFragment
s, context, localPaintingInfo, paintFlags, clipState); | 713 paintForegroundForFragmentsWithPhase(PaintPhaseForeground, layerFragment
s, context, localPaintingInfo, paintFlags, clipState); |
| 713 if (m_paintLayer.needsPaintPhaseDescendantOutlines()) | 714 if (m_paintLayer.needsPaintPhaseDescendantOutlines()) |
| 714 paintForegroundForFragmentsWithPhase(PaintPhaseDescendantOutlinesOnl
y, layerFragments, context, localPaintingInfo, paintFlags, clipState); | 715 paintForegroundForFragmentsWithPhase(PaintPhaseDescendantOutlinesOnl
y, layerFragments, context, localPaintingInfo, paintFlags, clipState); |
| 715 } | 716 } |
| 716 } | 717 } |
| 717 | 718 |
| 718 void PaintLayerPainter::paintForegroundForFragmentsWithPhase(PaintPhase phase, | 719 void PaintLayerPainter::paintForegroundForFragmentsWithPhase(PaintPhase phase, |
| 719 const PaintLayerFragments& layerFragments, GraphicsContext& context, | 720 const PaintLayerFragments& layerFragments, GraphicsContext& context, |
| 720 const PaintLayerPaintingInfo& localPaintingInfo, PaintLayerFlags paintFlags,
ClipState clipState) | 721 const PaintLayerPaintingInfo& localPaintingInfo, PaintLayerFlags paintFlags,
ClipState clipState) |
| 721 { | 722 { |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 773 if (!m_paintLayer.containsDirtyOverlayScrollbars()) | 774 if (!m_paintLayer.containsDirtyOverlayScrollbars()) |
| 774 return; | 775 return; |
| 775 | 776 |
| 776 PaintLayerPaintingInfo paintingInfo(&m_paintLayer, LayoutRect(enclosingIntRe
ct(damageRect)), paintFlags, LayoutSize()); | 777 PaintLayerPaintingInfo paintingInfo(&m_paintLayer, LayoutRect(enclosingIntRe
ct(damageRect)), paintFlags, LayoutSize()); |
| 777 paintLayer(context, paintingInfo, PaintLayerPaintingOverlayScrollbars); | 778 paintLayer(context, paintingInfo, PaintLayerPaintingOverlayScrollbars); |
| 778 | 779 |
| 779 m_paintLayer.setContainsDirtyOverlayScrollbars(false); | 780 m_paintLayer.setContainsDirtyOverlayScrollbars(false); |
| 780 } | 781 } |
| 781 | 782 |
| 782 } // namespace blink | 783 } // namespace blink |
| OLD | NEW |