Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(643)

Side by Side Diff: third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp

Issue 2322343003: Add support for <basic-shape> to 'clip-path' on SVG elements (Closed)
Patch Set: Update SPv2 expectations Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 257 matching lines...) Expand 10 before | Expand all | Expand 10 after
268 paintingInfo.ancestorHasClipPathClipping = true; 268 paintingInfo.ancestorHasClipPathClipping = true;
269 269
270 LayoutRect referenceBox(m_paintLayer.boxForClipPath()); 270 LayoutRect referenceBox(m_paintLayer.boxForClipPath());
271 // Note that this isn't going to work correctly if crossing a column bou ndary. The reference box should be 271 // Note that this isn't going to work correctly if crossing a column bou ndary. The reference box should be
272 // determined per-fragment, and hence this ought to be performed after f ragmentation. 272 // determined per-fragment, and hence this ought to be performed after f ragmentation.
273 if (m_paintLayer.enclosingPaginationLayer()) 273 if (m_paintLayer.enclosingPaginationLayer())
274 m_paintLayer.convertFromFlowThreadToVisualBoundingBoxInAncestor(pain tingInfo.rootLayer, referenceBox); 274 m_paintLayer.convertFromFlowThreadToVisualBoundingBoxInAncestor(pain tingInfo.rootLayer, referenceBox);
275 else 275 else
276 referenceBox.moveBy(offsetFromRoot); 276 referenceBox.moveBy(offsetFromRoot);
277 clipPathClipper.emplace( 277 clipPathClipper.emplace(
278 context, *m_paintLayer.layoutObject(), FloatRect(referenceBox), Floa tPoint(referenceBox.location())); 278 context, *m_paintLayer.layoutObject()->styleRef().clipPath(), *m_pai ntLayer.layoutObject(),
279 FloatRect(referenceBox), FloatPoint(referenceBox.location()));
279 } 280 }
280 281
281 Optional<CompositingRecorder> compositingRecorder; 282 Optional<CompositingRecorder> compositingRecorder;
282 // Blending operations must be performed only with the nearest ancestor stac king context. 283 // Blending operations must be performed only with the nearest ancestor stac king context.
283 // Note that there is no need to composite if we're painting the root. 284 // Note that there is no need to composite if we're painting the root.
284 // FIXME: this should be unified further into PaintLayer::paintsWithTranspar ency(). 285 // FIXME: this should be unified further into PaintLayer::paintsWithTranspar ency().
285 bool shouldCompositeForBlendMode = (!m_paintLayer.layoutObject()->isDocument Element() || m_paintLayer.layoutObject()->isSVGRoot()) && m_paintLayer.stackingN ode()->isStackingContext() && m_paintLayer.hasNonIsolatedDescendantWithBlendMode (); 286 bool shouldCompositeForBlendMode = (!m_paintLayer.layoutObject()->isDocument Element() || m_paintLayer.layoutObject()->isSVGRoot()) && m_paintLayer.stackingN ode()->isStackingContext() && m_paintLayer.hasNonIsolatedDescendantWithBlendMode ();
286 if (shouldCompositeForBlendMode || m_paintLayer.paintsWithTransparency(paint ingInfo.getGlobalPaintFlags())) { 287 if (shouldCompositeForBlendMode || m_paintLayer.paintsWithTransparency(paint ingInfo.getGlobalPaintFlags())) {
287 FloatRect compositingBounds = FloatRect(m_paintLayer.paintingExtent(pain tingInfo.rootLayer, paintingInfo.subPixelAccumulation, paintingInfo.getGlobalPai ntFlags())); 288 FloatRect compositingBounds = FloatRect(m_paintLayer.paintingExtent(pain tingInfo.rootLayer, paintingInfo.subPixelAccumulation, paintingInfo.getGlobalPai ntFlags()));
288 compositingRecorder.emplace(context, *m_paintLayer.layoutObject(), 289 compositingRecorder.emplace(context, *m_paintLayer.layoutObject(),
(...skipping 504 matching lines...) Expand 10 before | Expand all | Expand 10 after
793 if (!m_paintLayer.containsDirtyOverlayScrollbars()) 794 if (!m_paintLayer.containsDirtyOverlayScrollbars())
794 return; 795 return;
795 796
796 PaintLayerPaintingInfo paintingInfo(&m_paintLayer, LayoutRect(enclosingIntRe ct(damageRect)), paintFlags, LayoutSize()); 797 PaintLayerPaintingInfo paintingInfo(&m_paintLayer, LayoutRect(enclosingIntRe ct(damageRect)), paintFlags, LayoutSize());
797 paintLayer(context, paintingInfo, PaintLayerPaintingOverlayScrollbars); 798 paintLayer(context, paintingInfo, PaintLayerPaintingOverlayScrollbars);
798 799
799 m_paintLayer.setContainsDirtyOverlayScrollbars(false); 800 m_paintLayer.setContainsDirtyOverlayScrollbars(false);
800 } 801 }
801 802
802 } // namespace blink 803 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/paint/ClipPathClipper.cpp ('k') | third_party/WebKit/Source/core/paint/SVGClipPainter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698