| 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 "config.h" | 5 #include "config.h" |
| 6 #include "core/paint/DeprecatedPaintLayerPainter.h" | 6 #include "core/paint/DeprecatedPaintLayerPainter.h" |
| 7 | 7 |
| 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" |
| 11 #include "core/layout/LayoutView.h" | 11 #include "core/layout/LayoutView.h" |
| 12 #include "core/layout/svg/LayoutSVGResourceClipper.h" | 12 #include "core/layout/svg/LayoutSVGResourceClipper.h" |
| 13 #include "core/page/Page.h" | 13 #include "core/page/Page.h" |
| 14 #include "core/paint/CompositingRecorder.h" | 14 #include "core/paint/CompositingRecorder.h" |
| 15 #include "core/paint/DeprecatedPaintLayer.h" | 15 #include "core/paint/DeprecatedPaintLayer.h" |
| 16 #include "core/paint/FilterPainter.h" | 16 #include "core/paint/FilterPainter.h" |
| 17 #include "core/paint/LayerClipRecorder.h" | 17 #include "core/paint/LayerClipRecorder.h" |
| 18 #include "core/paint/LayerFixedPositionRecorder.h" | 18 #include "core/paint/LayerFixedPositionRecorder.h" |
| 19 #include "core/paint/PaintInfo.h" | 19 #include "core/paint/PaintInfo.h" |
| 20 #include "core/paint/SVGClipPainter.h" | 20 #include "core/paint/SVGClipPainter.h" |
| 21 #include "core/paint/ScopeRecorder.h" | 21 #include "core/paint/ScopeRecorder.h" |
| 22 #include "core/paint/ScrollRecorder.h" | 22 #include "core/paint/ScrollRecorder.h" |
| 23 #include "core/paint/ScrollableAreaPainter.h" | 23 #include "core/paint/ScrollableAreaPainter.h" |
| 24 #include "core/paint/Transform3DRecorder.h" | 24 #include "core/paint/Transform3DRecorder.h" |
| 25 #include "platform/graphics/GraphicsLayer.h" | 25 #include "platform/graphics/GraphicsLayer.h" |
| 26 #include "platform/graphics/paint/ClipPathRecorder.h" | 26 #include "platform/graphics/paint/ClipPathRecorder.h" |
| 27 #include "platform/graphics/paint/ClipRecorder.h" | 27 #include "platform/graphics/paint/ClipRecorder.h" |
| 28 #include "platform/graphics/paint/CompositingDisplayItem.h" | 28 #include "platform/graphics/paint/CompositingDisplayItem.h" |
| 29 #include "platform/graphics/paint/DisplayItemList.h" | 29 #include "platform/graphics/paint/DisplayItemCacheSkipper.h" |
| 30 #include "platform/graphics/paint/Transform3DDisplayItem.h" | 30 #include "platform/graphics/paint/Transform3DDisplayItem.h" |
| 31 #include "wtf/Optional.h" | 31 #include "wtf/Optional.h" |
| 32 | 32 |
| 33 namespace blink { | 33 namespace blink { |
| 34 | 34 |
| 35 static inline bool shouldSuppressPaintingLayer(DeprecatedPaintLayer* layer) | 35 static inline bool shouldSuppressPaintingLayer(DeprecatedPaintLayer* layer) |
| 36 { | 36 { |
| 37 // Avoid painting descendants of the root layer when stylesheets haven't loa
ded. This eliminates FOUC. | 37 // Avoid painting descendants of the root layer when stylesheets haven't loa
ded. This eliminates FOUC. |
| 38 // It's ok not to draw, because later on, when all the stylesheets do load,
updateStyleSelector on the Document | 38 // It's ok not to draw, because later on, when all the stylesheets do load,
updateStyleSelector on the Document |
| 39 // will do a full paintInvalidationForWholeLayoutObject(). | 39 // will do a full paintInvalidationForWholeLayoutObject(). |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 } | 94 } |
| 95 | 95 |
| 96 void DeprecatedPaintLayerPainter::paintLayerContentsAndReflection(GraphicsContex
t* context, const DeprecatedPaintLayerPaintingInfo& paintingInfo, PaintLayerFlag
s paintFlags, FragmentPolicy fragmentPolicy) | 96 void DeprecatedPaintLayerPainter::paintLayerContentsAndReflection(GraphicsContex
t* context, const DeprecatedPaintLayerPaintingInfo& paintingInfo, PaintLayerFlag
s paintFlags, FragmentPolicy fragmentPolicy) |
| 97 { | 97 { |
| 98 ASSERT(m_paintLayer.isSelfPaintingLayer() || m_paintLayer.hasSelfPaintingLay
erDescendant()); | 98 ASSERT(m_paintLayer.isSelfPaintingLayer() || m_paintLayer.hasSelfPaintingLay
erDescendant()); |
| 99 | 99 |
| 100 PaintLayerFlags localPaintFlags = paintFlags & ~(PaintLayerAppliedTransform)
; | 100 PaintLayerFlags localPaintFlags = paintFlags & ~(PaintLayerAppliedTransform)
; |
| 101 | 101 |
| 102 // Paint the reflection first if we have one. | 102 // Paint the reflection first if we have one. |
| 103 if (m_paintLayer.reflectionInfo()) { | 103 if (m_paintLayer.reflectionInfo()) { |
| 104 DisplayItemCacheSkipper skipper(*context); |
| 104 ScopeRecorder scopeRecorder(*context, *m_paintLayer.layoutObject()); | 105 ScopeRecorder scopeRecorder(*context, *m_paintLayer.layoutObject()); |
| 105 m_paintLayer.reflectionInfo()->paint(context, paintingInfo, localPaintFl
ags | PaintLayerPaintingReflection); | 106 m_paintLayer.reflectionInfo()->paint(context, paintingInfo, localPaintFl
ags | PaintLayerPaintingReflection); |
| 106 } | 107 } |
| 107 | 108 |
| 108 localPaintFlags |= PaintLayerPaintingCompositingAllPhases; | 109 localPaintFlags |= PaintLayerPaintingCompositingAllPhases; |
| 109 paintLayerContents(context, paintingInfo, localPaintFlags, fragmentPolicy); | 110 paintLayerContents(context, paintingInfo, localPaintFlags, fragmentPolicy); |
| 110 } | 111 } |
| 111 | 112 |
| 112 class ClipPathHelper { | 113 class ClipPathHelper { |
| 113 public: | 114 public: |
| (...skipping 628 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 742 if (!m_paintLayer.containsDirtyOverlayScrollbars()) | 743 if (!m_paintLayer.containsDirtyOverlayScrollbars()) |
| 743 return; | 744 return; |
| 744 | 745 |
| 745 DeprecatedPaintLayerPaintingInfo paintingInfo(&m_paintLayer, LayoutRect(encl
osingIntRect(damageRect)), paintBehavior, LayoutSize(), paintingRoot); | 746 DeprecatedPaintLayerPaintingInfo paintingInfo(&m_paintLayer, LayoutRect(encl
osingIntRect(damageRect)), paintBehavior, LayoutSize(), paintingRoot); |
| 746 paintLayer(context, paintingInfo, PaintLayerPaintingOverlayScrollbars); | 747 paintLayer(context, paintingInfo, PaintLayerPaintingOverlayScrollbars); |
| 747 | 748 |
| 748 m_paintLayer.setContainsDirtyOverlayScrollbars(false); | 749 m_paintLayer.setContainsDirtyOverlayScrollbars(false); |
| 749 } | 750 } |
| 750 | 751 |
| 751 } // namespace blink | 752 } // namespace blink |
| OLD | NEW |