| 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 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 264 | 264 |
| 265 bool isSelfPaintingLayer = m_paintLayer.isSelfPaintingLayer(); | 265 bool isSelfPaintingLayer = m_paintLayer.isSelfPaintingLayer(); |
| 266 bool isPaintingOverlayScrollbars = | 266 bool isPaintingOverlayScrollbars = |
| 267 paintFlags & PaintLayerPaintingOverlayScrollbars; | 267 paintFlags & PaintLayerPaintingOverlayScrollbars; |
| 268 bool isPaintingScrollingContent = | 268 bool isPaintingScrollingContent = |
| 269 paintFlags & PaintLayerPaintingCompositingScrollingPhase; | 269 paintFlags & PaintLayerPaintingCompositingScrollingPhase; |
| 270 bool isPaintingCompositedForeground = | 270 bool isPaintingCompositedForeground = |
| 271 paintFlags & PaintLayerPaintingCompositingForegroundPhase; | 271 paintFlags & PaintLayerPaintingCompositingForegroundPhase; |
| 272 bool isPaintingCompositedBackground = | 272 bool isPaintingCompositedBackground = |
| 273 paintFlags & PaintLayerPaintingCompositingBackgroundPhase; | 273 paintFlags & PaintLayerPaintingCompositingBackgroundPhase; |
| 274 bool isPaintingCompositedDecoration = |
| 275 paintFlags & PaintLayerPaintingCompositingDecorationPhase; |
| 274 bool isPaintingOverflowContents = | 276 bool isPaintingOverflowContents = |
| 275 paintFlags & PaintLayerPaintingOverflowContents; | 277 paintFlags & PaintLayerPaintingOverflowContents; |
| 276 // Outline always needs to be painted even if we have no visible content. | 278 // Outline always needs to be painted even if we have no visible content. |
| 277 // Also, the outline is painted in the background phase during composited | 279 // It is painted as part of the decoration phase which paints content that |
| 278 // scrolling. If it were painted in the foreground phase, it would move with | 280 // is not scrolled and should be above scrolled content. |
| 279 // the scrolled content. When not composited scrolling, the outline is painted | |
| 280 // in the foreground phase. Since scrolled contents are moved by paint | |
| 281 // invalidation in this case, the outline won't get 'dragged along'. | |
| 282 bool shouldPaintSelfOutline = | 281 bool shouldPaintSelfOutline = |
| 283 isSelfPaintingLayer && !isPaintingOverlayScrollbars && | 282 isSelfPaintingLayer && !isPaintingOverlayScrollbars && |
| 284 ((isPaintingScrollingContent && isPaintingCompositedBackground) || | 283 (isPaintingCompositedDecoration || !isPaintingScrollingContent) && |
| 285 (!isPaintingScrollingContent && isPaintingCompositedForeground)) && | |
| 286 m_paintLayer.layoutObject()->styleRef().hasOutline(); | 284 m_paintLayer.layoutObject()->styleRef().hasOutline(); |
| 285 |
| 287 bool shouldPaintContent = m_paintLayer.hasVisibleContent() && | 286 bool shouldPaintContent = m_paintLayer.hasVisibleContent() && |
| 288 isSelfPaintingLayer && !isPaintingOverlayScrollbars; | 287 isSelfPaintingLayer && !isPaintingOverlayScrollbars; |
| 289 | 288 |
| 290 PaintResult result = FullyPainted; | 289 PaintResult result = FullyPainted; |
| 291 | 290 |
| 292 if (paintFlags & PaintLayerPaintingRootBackgroundOnly && | 291 if (paintFlags & PaintLayerPaintingRootBackgroundOnly && |
| 293 !m_paintLayer.layoutObject()->isLayoutView()) | 292 !m_paintLayer.layoutObject()->isLayoutView()) |
| 294 return result; | 293 return result; |
| 295 | 294 |
| 296 if (m_paintLayer.layoutObject()->view()->frame() && | 295 if (m_paintLayer.layoutObject()->view()->frame() && |
| (...skipping 805 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1102 | 1101 |
| 1103 PaintLayerPaintingInfo paintingInfo(&m_paintLayer, | 1102 PaintLayerPaintingInfo paintingInfo(&m_paintLayer, |
| 1104 LayoutRect(enclosingIntRect(damageRect)), | 1103 LayoutRect(enclosingIntRect(damageRect)), |
| 1105 paintFlags, LayoutSize()); | 1104 paintFlags, LayoutSize()); |
| 1106 paintLayer(context, paintingInfo, PaintLayerPaintingOverlayScrollbars); | 1105 paintLayer(context, paintingInfo, PaintLayerPaintingOverlayScrollbars); |
| 1107 | 1106 |
| 1108 m_paintLayer.setContainsDirtyOverlayScrollbars(false); | 1107 m_paintLayer.setContainsDirtyOverlayScrollbars(false); |
| 1109 } | 1108 } |
| 1110 | 1109 |
| 1111 } // namespace blink | 1110 } // namespace blink |
| OLD | NEW |