| 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/LayoutView.h" | 8 #include "core/layout/LayoutView.h" |
| 9 #include "core/paint/ClipPathClipper.h" | 9 #include "core/paint/ClipPathClipper.h" |
| 10 #include "core/paint/FilterPainter.h" | 10 #include "core/paint/FilterPainter.h" |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 // Don't create subsequence during special painting to avoid cache conflict | 143 // Don't create subsequence during special painting to avoid cache conflict |
| 144 // with normal painting. | 144 // with normal painting. |
| 145 if (paintingInfo.getGlobalPaintFlags() & GlobalPaintFlattenCompositingLayers) | 145 if (paintingInfo.getGlobalPaintFlags() & GlobalPaintFlattenCompositingLayers) |
| 146 return false; | 146 return false; |
| 147 if (paintFlags & | 147 if (paintFlags & |
| 148 (PaintLayerPaintingRootBackgroundOnly | | 148 (PaintLayerPaintingRootBackgroundOnly | |
| 149 PaintLayerPaintingOverlayScrollbars | PaintLayerUncachedClipRects)) | 149 PaintLayerPaintingOverlayScrollbars | PaintLayerUncachedClipRects)) |
| 150 return false; | 150 return false; |
| 151 | 151 |
| 152 // Create subsequence for only stacking contexts whose painting are atomic. | 152 // Create subsequence for only stacking contexts whose painting are atomic. |
| 153 if (!paintLayer.stackingNode()->isStackingContext()) | 153 // SVG is also painted atomically. |
| 154 if (!paintLayer.stackingNode()->isStackingContext() && |
| 155 !paintLayer.layoutObject()->isSVGRoot()) |
| 154 return false; | 156 return false; |
| 155 | 157 |
| 156 // The layer doesn't have children. Subsequence caching is not worth because | 158 // The layer doesn't have children. Subsequence caching is not worth because |
| 157 // normally the actual painting will be cheap. | 159 // normally the actual painting will be cheap. |
| 160 // SVG is also painted atomically. |
| 158 if (!PaintLayerStackingNodeIterator(*paintLayer.stackingNode(), AllChildren) | 161 if (!PaintLayerStackingNodeIterator(*paintLayer.stackingNode(), AllChildren) |
| 159 .next()) | 162 .next() && |
| 163 !paintLayer.layoutObject()->isSVGRoot()) |
| 160 return false; | 164 return false; |
| 161 | 165 |
| 162 // When in FOUC-avoidance mode, don't cache any subsequences, to avoid having | 166 // When in FOUC-avoidance mode, don't cache any subsequences, to avoid having |
| 163 // to invalidate all of them when leaving this mode. There is an early-out in | 167 // to invalidate all of them when leaving this mode. There is an early-out in |
| 164 // BlockPainter::paintContents that may result in nothing getting painted in | 168 // BlockPainter::paintContents that may result in nothing getting painted in |
| 165 // this mode, in addition to early-out logic in PaintLayerPainter. | 169 // this mode, in addition to early-out logic in PaintLayerPainter. |
| 166 if (paintLayer.layoutObject()->document().didLayoutWithPendingStylesheets()) | 170 if (paintLayer.layoutObject()->document().didLayoutWithPendingStylesheets()) |
| 167 return false; | 171 return false; |
| 168 | 172 |
| 169 return true; | 173 return true; |
| (...skipping 928 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1098 | 1102 |
| 1099 PaintLayerPaintingInfo paintingInfo(&m_paintLayer, | 1103 PaintLayerPaintingInfo paintingInfo(&m_paintLayer, |
| 1100 LayoutRect(enclosingIntRect(damageRect)), | 1104 LayoutRect(enclosingIntRect(damageRect)), |
| 1101 paintFlags, LayoutSize()); | 1105 paintFlags, LayoutSize()); |
| 1102 paintLayer(context, paintingInfo, PaintLayerPaintingOverlayScrollbars); | 1106 paintLayer(context, paintingInfo, PaintLayerPaintingOverlayScrollbars); |
| 1103 | 1107 |
| 1104 m_paintLayer.setContainsDirtyOverlayScrollbars(false); | 1108 m_paintLayer.setContainsDirtyOverlayScrollbars(false); |
| 1105 } | 1109 } |
| 1106 | 1110 |
| 1107 } // namespace blink | 1111 } // namespace blink |
| OLD | NEW |