Chromium Code Reviews| 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 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 144 // Don't create subsequence during special painting to avoid cache conflict | 144 // Don't create subsequence during special painting to avoid cache conflict |
| 145 // with normal painting. | 145 // with normal painting. |
| 146 if (paintingInfo.getGlobalPaintFlags() & GlobalPaintFlattenCompositingLayers) | 146 if (paintingInfo.getGlobalPaintFlags() & GlobalPaintFlattenCompositingLayers) |
| 147 return false; | 147 return false; |
| 148 if (paintFlags & | 148 if (paintFlags & |
| 149 (PaintLayerPaintingRootBackgroundOnly | | 149 (PaintLayerPaintingRootBackgroundOnly | |
| 150 PaintLayerPaintingOverlayScrollbars | PaintLayerUncachedClipRects)) | 150 PaintLayerPaintingOverlayScrollbars | PaintLayerUncachedClipRects)) |
| 151 return false; | 151 return false; |
| 152 | 152 |
| 153 // Create subsequence for only stacking contexts whose painting are atomic. | 153 // Create subsequence for only stacking contexts whose painting are atomic. |
| 154 if (!paintLayer.stackingNode()->isStackingContext()) | 154 if (!paintLayer.stackingNode()->isStackingContext() && |
| 155 !paintLayer.layoutObject()->isSVGRoot()) | |
|
wkorman
2016/11/12 00:05:51
Consider adding comment above this block re: why w
chrishtr
2016/11/12 00:15:20
Done.
| |
| 155 return false; | 156 return false; |
| 156 | 157 |
| 157 // 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 |
| 158 // normally the actual painting will be cheap. | 159 // normally the actual painting will be cheap. |
| 159 if (!PaintLayerStackingNodeIterator(*paintLayer.stackingNode(), AllChildren) | 160 if (!PaintLayerStackingNodeIterator(*paintLayer.stackingNode(), AllChildren) |
| 160 .next()) | 161 .next() && |
| 162 !paintLayer.layoutObject()->isSVGRoot()) | |
| 161 return false; | 163 return false; |
| 162 | 164 |
| 163 // When in FOUC-avoidance mode, don't cache any subsequences, to avoid having | 165 // When in FOUC-avoidance mode, don't cache any subsequences, to avoid having |
| 164 // to invalidate all of them when leaving this mode. There is an early-out in | 166 // to invalidate all of them when leaving this mode. There is an early-out in |
| 165 // BlockPainter::paintContents that may result in nothing getting painted in | 167 // BlockPainter::paintContents that may result in nothing getting painted in |
| 166 // this mode, in addition to early-out logic in PaintLayerPainter. | 168 // this mode, in addition to early-out logic in PaintLayerPainter. |
| 167 if (paintLayer.layoutObject()->document().didLayoutWithPendingStylesheets()) | 169 if (paintLayer.layoutObject()->document().didLayoutWithPendingStylesheets()) |
| 168 return false; | 170 return false; |
| 169 | 171 |
| 170 return true; | 172 return true; |
| (...skipping 899 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1070 | 1072 |
| 1071 PaintLayerPaintingInfo paintingInfo(&m_paintLayer, | 1073 PaintLayerPaintingInfo paintingInfo(&m_paintLayer, |
| 1072 LayoutRect(enclosingIntRect(damageRect)), | 1074 LayoutRect(enclosingIntRect(damageRect)), |
| 1073 paintFlags, LayoutSize()); | 1075 paintFlags, LayoutSize()); |
| 1074 paintLayer(context, paintingInfo, PaintLayerPaintingOverlayScrollbars); | 1076 paintLayer(context, paintingInfo, PaintLayerPaintingOverlayScrollbars); |
| 1075 | 1077 |
| 1076 m_paintLayer.setContainsDirtyOverlayScrollbars(false); | 1078 m_paintLayer.setContainsDirtyOverlayScrollbars(false); |
| 1077 } | 1079 } |
| 1078 | 1080 |
| 1079 } // namespace blink | 1081 } // namespace blink |
| OLD | NEW |