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 372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
383 paintingInfo.rootLayer, referenceBox); | 383 paintingInfo.rootLayer, referenceBox); |
384 else | 384 else |
385 referenceBox.moveBy(offsetFromRoot); | 385 referenceBox.moveBy(offsetFromRoot); |
386 clipPathClipper.emplace( | 386 clipPathClipper.emplace( |
387 context, *m_paintLayer.layoutObject()->styleRef().clipPath(), | 387 context, *m_paintLayer.layoutObject()->styleRef().clipPath(), |
388 *m_paintLayer.layoutObject(), FloatRect(referenceBox), | 388 *m_paintLayer.layoutObject(), FloatRect(referenceBox), |
389 FloatPoint(referenceBox.location())); | 389 FloatPoint(referenceBox.location())); |
390 } | 390 } |
391 | 391 |
392 Optional<CompositingRecorder> compositingRecorder; | 392 Optional<CompositingRecorder> compositingRecorder; |
393 // Blending operations must be performed only with the nearest ancestor | |
394 // stacking context. Note that there is no need to composite if we're | |
395 // painting the root. | |
396 // FIXME: this should be unified further into | 393 // FIXME: this should be unified further into |
397 // PaintLayer::paintsWithTransparency(). | 394 // PaintLayer::paintsWithTransparency(). |
398 bool shouldCompositeForBlendMode = | 395 bool shouldCompositeForBlendMode = |
399 (!m_paintLayer.layoutObject()->isDocumentElement() || | |
400 m_paintLayer.layoutObject()->isSVGRoot()) && | |
401 m_paintLayer.stackingNode()->isStackingContext() && | 396 m_paintLayer.stackingNode()->isStackingContext() && |
402 m_paintLayer.hasNonIsolatedDescendantWithBlendMode(); | 397 m_paintLayer.hasNonIsolatedDescendantWithBlendMode(); |
403 if (shouldCompositeForBlendMode || | 398 if (shouldCompositeForBlendMode || |
404 m_paintLayer.paintsWithTransparency(paintingInfo.getGlobalPaintFlags())) { | 399 m_paintLayer.paintsWithTransparency(paintingInfo.getGlobalPaintFlags())) { |
405 FloatRect compositingBounds = FloatRect(m_paintLayer.paintingExtent( | 400 FloatRect compositingBounds = FloatRect(m_paintLayer.paintingExtent( |
406 paintingInfo.rootLayer, paintingInfo.subPixelAccumulation, | 401 paintingInfo.rootLayer, paintingInfo.subPixelAccumulation, |
407 paintingInfo.getGlobalPaintFlags())); | 402 paintingInfo.getGlobalPaintFlags())); |
408 compositingRecorder.emplace( | 403 compositingRecorder.emplace( |
409 context, *m_paintLayer.layoutObject(), | 404 context, *m_paintLayer.layoutObject(), |
410 WebCoreCompositeToSkiaComposite( | 405 WebCoreCompositeToSkiaComposite( |
(...skipping 712 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1123 | 1118 |
1124 PaintLayerPaintingInfo paintingInfo(&m_paintLayer, | 1119 PaintLayerPaintingInfo paintingInfo(&m_paintLayer, |
1125 LayoutRect(enclosingIntRect(damageRect)), | 1120 LayoutRect(enclosingIntRect(damageRect)), |
1126 paintFlags, LayoutSize()); | 1121 paintFlags, LayoutSize()); |
1127 paintLayer(context, paintingInfo, PaintLayerPaintingOverlayScrollbars); | 1122 paintLayer(context, paintingInfo, PaintLayerPaintingOverlayScrollbars); |
1128 | 1123 |
1129 m_paintLayer.setContainsDirtyOverlayScrollbars(false); | 1124 m_paintLayer.setContainsDirtyOverlayScrollbars(false); |
1130 } | 1125 } |
1131 | 1126 |
1132 } // namespace blink | 1127 } // namespace blink |
OLD | NEW |