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/SVGRootPainter.h" | 6 #include "core/paint/SVGRootPainter.h" |
7 | 7 |
8 #include "core/layout/svg/LayoutSVGRoot.h" | 8 #include "core/layout/svg/LayoutSVGRoot.h" |
9 #include "core/layout/svg/SVGResources.h" | 9 #include "core/layout/svg/SVGResources.h" |
10 #include "core/layout/svg/SVGResourcesCache.h" | 10 #include "core/layout/svg/SVGResourcesCache.h" |
(...skipping 30 matching lines...) Expand all Loading... |
41 if (!resources || !resources->filter()) | 41 if (!resources || !resources->filter()) |
42 return; | 42 return; |
43 } | 43 } |
44 | 44 |
45 PaintInfo paintInfoBeforeFiltering(paintInfo); | 45 PaintInfo paintInfoBeforeFiltering(paintInfo); |
46 | 46 |
47 // Apply initial viewport clip. | 47 // Apply initial viewport clip. |
48 Optional<ClipRecorder> clipRecorder; | 48 Optional<ClipRecorder> clipRecorder; |
49 if (m_layoutSVGRoot.shouldApplyViewportClip()) { | 49 if (m_layoutSVGRoot.shouldApplyViewportClip()) { |
50 // TODO(pdr): Clip the paint info cull rect here. | 50 // TODO(pdr): Clip the paint info cull rect here. |
51 clipRecorder.emplace(*paintInfoBeforeFiltering.context, m_layoutSVGRoot,
paintInfoBeforeFiltering.displayItemTypeForClipping(), LayoutRect(pixelSnappedI
ntRect(m_layoutSVGRoot.overflowClipRect(paintOffset)))); | 51 clipRecorder.emplace(paintInfoBeforeFiltering.context, m_layoutSVGRoot,
paintInfoBeforeFiltering.displayItemTypeForClipping(), LayoutRect(pixelSnappedIn
tRect(m_layoutSVGRoot.overflowClipRect(paintOffset)))); |
52 } | 52 } |
53 | 53 |
54 // Convert from container offsets (html layoutObjects) to a relative transfo
rm (svg layoutObjects). | 54 // Convert from container offsets (html layoutObjects) to a relative transfo
rm (svg layoutObjects). |
55 // Transform from our paint container's coordinate system to our local coord
s. | 55 // Transform from our paint container's coordinate system to our local coord
s. |
56 IntPoint adjustedPaintOffset = roundedIntPoint(paintOffset); | 56 IntPoint adjustedPaintOffset = roundedIntPoint(paintOffset); |
57 AffineTransform paintOffsetToBorderBox = AffineTransform::translation(adjust
edPaintOffset.x(), adjustedPaintOffset.y()) * m_layoutSVGRoot.localToBorderBoxTr
ansform(); | 57 AffineTransform paintOffsetToBorderBox = AffineTransform::translation(adjust
edPaintOffset.x(), adjustedPaintOffset.y()) * m_layoutSVGRoot.localToBorderBoxTr
ansform(); |
58 paintInfoBeforeFiltering.updateCullRect(paintOffsetToBorderBox); | 58 paintInfoBeforeFiltering.updateCullRect(paintOffsetToBorderBox); |
59 TransformRecorder transformRecorder(*paintInfoBeforeFiltering.context, m_lay
outSVGRoot, paintOffsetToBorderBox); | 59 TransformRecorder transformRecorder(paintInfoBeforeFiltering.context, m_layo
utSVGRoot, paintOffsetToBorderBox); |
60 | 60 |
61 SVGPaintContext paintContext(m_layoutSVGRoot, paintInfoBeforeFiltering); | 61 SVGPaintContext paintContext(m_layoutSVGRoot, paintInfoBeforeFiltering); |
62 if (paintContext.paintInfo().phase == PaintPhaseForeground && !paintContext.
applyClipMaskAndFilterIfNecessary()) | 62 if (paintContext.paintInfo().phase == PaintPhaseForeground && !paintContext.
applyClipMaskAndFilterIfNecessary()) |
63 return; | 63 return; |
64 | 64 |
65 BoxPainter(m_layoutSVGRoot).paint(paintContext.paintInfo(), LayoutPoint()); | 65 BoxPainter(m_layoutSVGRoot).paint(paintContext.paintInfo(), LayoutPoint()); |
66 } | 66 } |
67 | 67 |
68 } // namespace blink | 68 } // namespace blink |
OLD | NEW |