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

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

Issue 2065593002: Unprefix the CSS 'filter' property (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Adjust test Created 4 years, 6 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/SVGRootPainter.h" 5 #include "core/paint/SVGRootPainter.h"
6 6
7 #include "core/layout/svg/LayoutSVGRoot.h" 7 #include "core/layout/svg/LayoutSVGRoot.h"
8 #include "core/layout/svg/SVGLayoutSupport.h" 8 #include "core/layout/svg/SVGLayoutSupport.h"
9 #include "core/paint/BoxPainter.h" 9 #include "core/paint/BoxPainter.h"
10 #include "core/paint/ObjectPaintProperties.h" 10 #include "core/paint/ObjectPaintProperties.h"
(...skipping 21 matching lines...) Expand all
32 if (shouldPaintSelfOutline(paintInfo.phase)) 32 if (shouldPaintSelfOutline(paintInfo.phase))
33 return; 33 return;
34 34
35 // An empty viewBox also disables rendering. 35 // An empty viewBox also disables rendering.
36 // (http://www.w3.org/TR/SVG/coords.html#ViewBoxAttribute) 36 // (http://www.w3.org/TR/SVG/coords.html#ViewBoxAttribute)
37 SVGSVGElement* svg = toSVGSVGElement(m_layoutSVGRoot.node()); 37 SVGSVGElement* svg = toSVGSVGElement(m_layoutSVGRoot.node());
38 ASSERT(svg); 38 ASSERT(svg);
39 if (svg->hasEmptyViewBox()) 39 if (svg->hasEmptyViewBox())
40 return; 40 return;
41 41
42 // Don't paint if we don't have kids, except if we have filters we should pa int those.
43 if (!m_layoutSVGRoot.firstChild() && !SVGLayoutSupport::hasFilterResource(m_ layoutSVGRoot))
44 return;
45
46 PaintInfo paintInfoBeforeFiltering(paintInfo); 42 PaintInfo paintInfoBeforeFiltering(paintInfo);
47 43
48 Optional<ScopedPaintChunkProperties> transformPropertyScope; 44 Optional<ScopedPaintChunkProperties> transformPropertyScope;
49 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { 45 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) {
50 const auto* objectProperties = m_layoutSVGRoot.objectPaintProperties(); 46 const auto* objectProperties = m_layoutSVGRoot.objectPaintProperties();
51 if (objectProperties && objectProperties->svgLocalTransform()) { 47 if (objectProperties && objectProperties->svgLocalTransform()) {
52 auto& paintController = paintInfoBeforeFiltering.context.getPaintCon troller(); 48 auto& paintController = paintInfoBeforeFiltering.context.getPaintCon troller();
53 PaintChunkProperties properties(paintController.currentPaintChunkPro perties()); 49 PaintChunkProperties properties(paintController.currentPaintChunkPro perties());
54 properties.transform = objectProperties->svgLocalTransform(); 50 properties.transform = objectProperties->svgLocalTransform();
55 transformPropertyScope.emplace(paintController, properties); 51 transformPropertyScope.emplace(paintController, properties);
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 if (paintContext.paintInfo().phase == PaintPhaseForeground && !paintContext. applyClipMaskAndFilterIfNecessary()) 86 if (paintContext.paintInfo().phase == PaintPhaseForeground && !paintContext. applyClipMaskAndFilterIfNecessary())
91 return; 87 return;
92 88
93 BoxPainter(m_layoutSVGRoot).paint(paintContext.paintInfo(), LayoutPoint()); 89 BoxPainter(m_layoutSVGRoot).paint(paintContext.paintInfo(), LayoutPoint());
94 90
95 PaintTiming& timing = PaintTiming::from(m_layoutSVGRoot.node()->document().t opDocument()); 91 PaintTiming& timing = PaintTiming::from(m_layoutSVGRoot.node()->document().t opDocument());
96 timing.markFirstContentfulPaint(); 92 timing.markFirstContentfulPaint();
97 } 93 }
98 94
99 } // namespace blink 95 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698