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/FilterEffectRenderer.h" | 10 #include "core/layout/FilterEffectRenderer.h" |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 Document& document = renderLayer.layoutObject()->document(); | 135 Document& document = renderLayer.layoutObject()->document(); |
136 // FIXME: It doesn't work with forward or external SVG references (h
ttps://bugs.webkit.org/show_bug.cgi?id=90405) | 136 // FIXME: It doesn't work with forward or external SVG references (h
ttps://bugs.webkit.org/show_bug.cgi?id=90405) |
137 Element* element = document.getElementById(referenceClipPathOperatio
n->fragment()); | 137 Element* element = document.getElementById(referenceClipPathOperatio
n->fragment()); |
138 if (isSVGClipPathElement(element) && element->layoutObject()) { | 138 if (isSVGClipPathElement(element) && element->layoutObject()) { |
139 if (!rootRelativeBoundsComputed) { | 139 if (!rootRelativeBoundsComputed) { |
140 rootRelativeBounds = renderLayer.physicalBoundingBoxIncludin
gReflectionAndStackingChildren(paintingInfo.rootLayer, offsetFromRoot); | 140 rootRelativeBounds = renderLayer.physicalBoundingBoxIncludin
gReflectionAndStackingChildren(paintingInfo.rootLayer, offsetFromRoot); |
141 rootRelativeBoundsComputed = true; | 141 rootRelativeBoundsComputed = true; |
142 } | 142 } |
143 | 143 |
144 m_resourceClipper = toLayoutSVGResourceClipper(toLayoutSVGResour
ceContainer(element->layoutObject())); | 144 m_resourceClipper = toLayoutSVGResourceClipper(toLayoutSVGResour
ceContainer(element->layoutObject())); |
145 if (!SVGClipPainter(*m_resourceClipper).applyClippingToContext(r
enderLayer.layoutObject(), rootRelativeBounds, | 145 if (!SVGClipPainter(*m_resourceClipper).applyClippingToContext(*
renderLayer.layoutObject(), rootRelativeBounds, |
146 paintingInfo.paintDirtyRect, context, m_clipperState)) { | 146 paintingInfo.paintDirtyRect, context, m_clipperState)) { |
147 // No need to post-apply the clipper if this failed. | 147 // No need to post-apply the clipper if this failed. |
148 m_resourceClipper = 0; | 148 m_resourceClipper = 0; |
149 } | 149 } |
150 } | 150 } |
151 } | 151 } |
152 } | 152 } |
153 | 153 |
154 ~ClipPathHelper() | 154 ~ClipPathHelper() |
155 { | 155 { |
156 if (m_resourceClipper) | 156 if (m_resourceClipper) |
157 SVGClipPainter(*m_resourceClipper).postApplyStatefulResource(m_rende
rLayer.layoutObject(), m_context, m_clipperState); | 157 SVGClipPainter(*m_resourceClipper).postApplyStatefulResource(*m_rend
erLayer.layoutObject(), m_context, m_clipperState); |
158 } | 158 } |
159 private: | 159 private: |
160 LayoutSVGResourceClipper* m_resourceClipper; | 160 LayoutSVGResourceClipper* m_resourceClipper; |
161 OwnPtr<ClipPathRecorder> m_clipPathRecorder; | 161 OwnPtr<ClipPathRecorder> m_clipPathRecorder; |
162 SVGClipPainter::ClipperState m_clipperState; | 162 SVGClipPainter::ClipperState m_clipperState; |
163 const DeprecatedPaintLayer& m_renderLayer; | 163 const DeprecatedPaintLayer& m_renderLayer; |
164 GraphicsContext* m_context; | 164 GraphicsContext* m_context; |
165 }; | 165 }; |
166 | 166 |
167 void DeprecatedPaintLayerPainter::paintLayerContents(GraphicsContext* context, c
onst DeprecatedPaintLayerPaintingInfo& paintingInfo, PaintLayerFlags paintFlags,
FragmentPolicy fragmentPolicy) | 167 void DeprecatedPaintLayerPainter::paintLayerContents(GraphicsContext* context, c
onst DeprecatedPaintLayerPaintingInfo& paintingInfo, PaintLayerFlags paintFlags,
FragmentPolicy fragmentPolicy) |
(...skipping 541 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
709 if (!m_renderLayer.containsDirtyOverlayScrollbars()) | 709 if (!m_renderLayer.containsDirtyOverlayScrollbars()) |
710 return; | 710 return; |
711 | 711 |
712 DeprecatedPaintLayerPaintingInfo paintingInfo(&m_renderLayer, LayoutRect(enc
losingIntRect(damageRect)), paintBehavior, LayoutSize(), paintingRoot); | 712 DeprecatedPaintLayerPaintingInfo paintingInfo(&m_renderLayer, LayoutRect(enc
losingIntRect(damageRect)), paintBehavior, LayoutSize(), paintingRoot); |
713 paintLayer(context, paintingInfo, PaintLayerPaintingOverlayScrollbars); | 713 paintLayer(context, paintingInfo, PaintLayerPaintingOverlayScrollbars); |
714 | 714 |
715 m_renderLayer.setContainsDirtyOverlayScrollbars(false); | 715 m_renderLayer.setContainsDirtyOverlayScrollbars(false); |
716 } | 716 } |
717 | 717 |
718 } // namespace blink | 718 } // namespace blink |
OLD | NEW |