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/DeprecatedPaintLayerPainter.h" | 6 #include "core/paint/DeprecatedPaintLayerPainter.h" |
7 | 7 |
8 #include "core/frame/Settings.h" | 8 #include "core/frame/Settings.h" |
9 #include "core/layout/ClipPathOperation.h" | 9 #include "core/layout/ClipPathOperation.h" |
10 #include "core/layout/LayoutBlock.h" | 10 #include "core/layout/LayoutBlock.h" |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 Document& document = paintLayer.layoutObject()->document(); | 139 Document& document = paintLayer.layoutObject()->document(); |
140 // FIXME: It doesn't work with forward or external SVG references (h
ttps://bugs.webkit.org/show_bug.cgi?id=90405) | 140 // FIXME: It doesn't work with forward or external SVG references (h
ttps://bugs.webkit.org/show_bug.cgi?id=90405) |
141 Element* element = document.getElementById(referenceClipPathOperatio
n->fragment()); | 141 Element* element = document.getElementById(referenceClipPathOperatio
n->fragment()); |
142 if (isSVGClipPathElement(element) && element->layoutObject()) { | 142 if (isSVGClipPathElement(element) && element->layoutObject()) { |
143 if (!rootRelativeBoundsComputed) { | 143 if (!rootRelativeBoundsComputed) { |
144 rootRelativeBounds = paintLayer.physicalBoundingBoxIncluding
ReflectionAndStackingChildren(paintingInfo.rootLayer, offsetFromRoot); | 144 rootRelativeBounds = paintLayer.physicalBoundingBoxIncluding
ReflectionAndStackingChildren(paintingInfo.rootLayer, offsetFromRoot); |
145 rootRelativeBoundsComputed = true; | 145 rootRelativeBoundsComputed = true; |
146 } | 146 } |
147 | 147 |
148 m_resourceClipper = toLayoutSVGResourceClipper(toLayoutSVGResour
ceContainer(element->layoutObject())); | 148 m_resourceClipper = toLayoutSVGResourceClipper(toLayoutSVGResour
ceContainer(element->layoutObject())); |
149 if (!SVGClipPainter(*m_resourceClipper).applyClippingToContext(*
paintLayer.layoutObject(), rootRelativeBounds, | 149 if (!SVGClipPainter(*m_resourceClipper).prepareEffect(*paintLaye
r.layoutObject(), rootRelativeBounds, |
150 paintingInfo.paintDirtyRect, context, m_clipperState)) { | 150 paintingInfo.paintDirtyRect, context, m_clipperState)) { |
151 // No need to post-apply the clipper if this failed. | 151 // No need to post-apply the clipper if this failed. |
152 m_resourceClipper = 0; | 152 m_resourceClipper = 0; |
153 } | 153 } |
154 } | 154 } |
155 } | 155 } |
156 } | 156 } |
157 | 157 |
158 ~ClipPathHelper() | 158 ~ClipPathHelper() |
159 { | 159 { |
160 if (m_resourceClipper) | 160 if (m_resourceClipper) |
161 SVGClipPainter(*m_resourceClipper).postApplyStatefulResource(*m_pain
tLayer.layoutObject(), m_context, m_clipperState); | 161 SVGClipPainter(*m_resourceClipper).finishEffect(*m_paintLayer.layout
Object(), m_context, m_clipperState); |
162 } | 162 } |
163 private: | 163 private: |
164 LayoutSVGResourceClipper* m_resourceClipper; | 164 LayoutSVGResourceClipper* m_resourceClipper; |
165 Optional<ClipPathRecorder> m_clipPathRecorder; | 165 Optional<ClipPathRecorder> m_clipPathRecorder; |
166 SVGClipPainter::ClipperState m_clipperState; | 166 SVGClipPainter::ClipperState m_clipperState; |
167 const DeprecatedPaintLayer& m_paintLayer; | 167 const DeprecatedPaintLayer& m_paintLayer; |
168 GraphicsContext* m_context; | 168 GraphicsContext* m_context; |
169 }; | 169 }; |
170 | 170 |
171 void DeprecatedPaintLayerPainter::paintLayerContents(GraphicsContext* context, c
onst DeprecatedPaintLayerPaintingInfo& paintingInfo, PaintLayerFlags paintFlags,
FragmentPolicy fragmentPolicy) | 171 void DeprecatedPaintLayerPainter::paintLayerContents(GraphicsContext* context, c
onst DeprecatedPaintLayerPaintingInfo& paintingInfo, PaintLayerFlags paintFlags,
FragmentPolicy fragmentPolicy) |
(...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
604 if (!m_paintLayer.containsDirtyOverlayScrollbars()) | 604 if (!m_paintLayer.containsDirtyOverlayScrollbars()) |
605 return; | 605 return; |
606 | 606 |
607 DeprecatedPaintLayerPaintingInfo paintingInfo(&m_paintLayer, LayoutRect(encl
osingIntRect(damageRect)), paintFlags, LayoutSize(), paintingRoot); | 607 DeprecatedPaintLayerPaintingInfo paintingInfo(&m_paintLayer, LayoutRect(encl
osingIntRect(damageRect)), paintFlags, LayoutSize(), paintingRoot); |
608 paintLayer(context, paintingInfo, PaintLayerPaintingOverlayScrollbars); | 608 paintLayer(context, paintingInfo, PaintLayerPaintingOverlayScrollbars); |
609 | 609 |
610 m_paintLayer.setContainsDirtyOverlayScrollbars(false); | 610 m_paintLayer.setContainsDirtyOverlayScrollbars(false); |
611 } | 611 } |
612 | 612 |
613 } // namespace blink | 613 } // namespace blink |
OLD | NEW |