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/LayoutInline.h" | 8 #include "core/layout/LayoutInline.h" |
| 9 #include "core/layout/LayoutView.h" | 9 #include "core/layout/LayoutView.h" |
| 10 #include "core/paint/ClipPathClipper.h" | 10 #include "core/paint/ClipPathClipper.h" |
| (...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 261 // These helpers output clip and compositing operations using a RAII pattern . Stack-allocated-varibles are destructed in the reverse order of construction, | 261 // These helpers output clip and compositing operations using a RAII pattern . Stack-allocated-varibles are destructed in the reverse order of construction, |
| 262 // so they are nested properly. | 262 // so they are nested properly. |
| 263 Optional<ClipPathClipper> clipPathClipper; | 263 Optional<ClipPathClipper> clipPathClipper; |
| 264 // Clip-path, like border radius, must not be applied to the contents of a c omposited-scrolling container. | 264 // Clip-path, like border radius, must not be applied to the contents of a c omposited-scrolling container. |
| 265 // It must, however, still be applied to the mask layer, so that the composi tor can properly mask the | 265 // It must, however, still be applied to the mask layer, so that the composi tor can properly mask the |
| 266 // scrolling contents and scrollbars. | 266 // scrolling contents and scrollbars. |
| 267 if (m_paintLayer.layoutObject()->hasClipPath() && (!m_paintLayer.needsCompos itedScrolling() || (paintFlags & PaintLayerPaintingChildClippingMaskPhase))) { | 267 if (m_paintLayer.layoutObject()->hasClipPath() && (!m_paintLayer.needsCompos itedScrolling() || (paintFlags & PaintLayerPaintingChildClippingMaskPhase))) { |
| 268 paintingInfo.ancestorHasClipPathClipping = true; | 268 paintingInfo.ancestorHasClipPathClipping = true; |
| 269 | 269 |
| 270 LayoutRect referenceBox(m_paintLayer.boxForClipPath()); | 270 LayoutRect referenceBox(m_paintLayer.boxForClipPath()); |
| 271 referenceBox.moveBy(offsetFromRoot); | 271 if (m_paintLayer.enclosingPaginationLayer()) |
| 272 m_paintLayer.convertFromFlowThreadToVisualBoundingBoxInAncestor(pain tingInfo.rootLayer, referenceBox); | |
|
mstensho (USE GERRIT)
2016/09/02 19:06:01
This isn't going to work correctly if the clipping
fs
2016/09/02 19:16:51
Yeah, we have similar issues with inlines spanning
| |
| 273 else | |
| 274 referenceBox.moveBy(offsetFromRoot); | |
| 272 clipPathClipper.emplace( | 275 clipPathClipper.emplace( |
| 273 context, *m_paintLayer.layoutObject(), FloatRect(referenceBox), Floa tPoint(offsetFromRoot)); | 276 context, *m_paintLayer.layoutObject(), FloatRect(referenceBox), Floa tPoint(referenceBox.location())); |
| 274 } | 277 } |
| 275 | 278 |
| 276 Optional<CompositingRecorder> compositingRecorder; | 279 Optional<CompositingRecorder> compositingRecorder; |
| 277 // Blending operations must be performed only with the nearest ancestor stac king context. | 280 // Blending operations must be performed only with the nearest ancestor stac king context. |
| 278 // Note that there is no need to composite if we're painting the root. | 281 // Note that there is no need to composite if we're painting the root. |
| 279 // FIXME: this should be unified further into PaintLayer::paintsWithTranspar ency(). | 282 // FIXME: this should be unified further into PaintLayer::paintsWithTranspar ency(). |
| 280 bool shouldCompositeForBlendMode = (!m_paintLayer.layoutObject()->isDocument Element() || m_paintLayer.layoutObject()->isSVGRoot()) && m_paintLayer.stackingN ode()->isStackingContext() && m_paintLayer.hasNonIsolatedDescendantWithBlendMode (); | 283 bool shouldCompositeForBlendMode = (!m_paintLayer.layoutObject()->isDocument Element() || m_paintLayer.layoutObject()->isSVGRoot()) && m_paintLayer.stackingN ode()->isStackingContext() && m_paintLayer.hasNonIsolatedDescendantWithBlendMode (); |
| 281 if (shouldCompositeForBlendMode || m_paintLayer.paintsWithTransparency(paint ingInfo.getGlobalPaintFlags())) { | 284 if (shouldCompositeForBlendMode || m_paintLayer.paintsWithTransparency(paint ingInfo.getGlobalPaintFlags())) { |
| 282 FloatRect compositingBounds = FloatRect(m_paintLayer.paintingExtent(pain tingInfo.rootLayer, paintingInfo.subPixelAccumulation, paintingInfo.getGlobalPai ntFlags())); | 285 FloatRect compositingBounds = FloatRect(m_paintLayer.paintingExtent(pain tingInfo.rootLayer, paintingInfo.subPixelAccumulation, paintingInfo.getGlobalPai ntFlags())); |
| 283 compositingRecorder.emplace(context, *m_paintLayer.layoutObject(), | 286 compositingRecorder.emplace(context, *m_paintLayer.layoutObject(), |
| (...skipping 501 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 785 if (!m_paintLayer.containsDirtyOverlayScrollbars()) | 788 if (!m_paintLayer.containsDirtyOverlayScrollbars()) |
| 786 return; | 789 return; |
| 787 | 790 |
| 788 PaintLayerPaintingInfo paintingInfo(&m_paintLayer, LayoutRect(enclosingIntRe ct(damageRect)), paintFlags, LayoutSize()); | 791 PaintLayerPaintingInfo paintingInfo(&m_paintLayer, LayoutRect(enclosingIntRe ct(damageRect)), paintFlags, LayoutSize()); |
| 789 paintLayer(context, paintingInfo, PaintLayerPaintingOverlayScrollbars); | 792 paintLayer(context, paintingInfo, PaintLayerPaintingOverlayScrollbars); |
| 790 | 793 |
| 791 m_paintLayer.setContainsDirtyOverlayScrollbars(false); | 794 m_paintLayer.setContainsDirtyOverlayScrollbars(false); |
| 792 } | 795 } |
| 793 | 796 |
| 794 } // namespace blink | 797 } // namespace blink |
| OLD | NEW |