| 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 "core/paint/PaintLayerPainter.h" | 5 #include "core/paint/PaintLayerPainter.h" |
| 6 | 6 |
| 7 #include "core/frame/FrameView.h" | 7 #include "core/frame/FrameView.h" |
| 8 #include "core/frame/Settings.h" | 8 #include "core/frame/Settings.h" |
| 9 #include "core/layout/LayoutBlock.h" | 9 #include "core/layout/LayoutBlock.h" |
| 10 #include "core/layout/LayoutView.h" | 10 #include "core/layout/LayoutView.h" |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 if (isSVGClipPathElement(element) && element->layoutObject()) { | 156 if (isSVGClipPathElement(element) && element->layoutObject()) { |
| 157 if (!rootRelativeBoundsComputed) { | 157 if (!rootRelativeBoundsComputed) { |
| 158 rootRelativeBounds = paintLayer.physicalBoundingBoxIncluding
ReflectionAndStackingChildren(offsetFromRoot); | 158 rootRelativeBounds = paintLayer.physicalBoundingBoxIncluding
ReflectionAndStackingChildren(offsetFromRoot); |
| 159 rootRelativeBoundsComputed = true; | 159 rootRelativeBoundsComputed = true; |
| 160 } | 160 } |
| 161 | 161 |
| 162 m_resourceClipper = toLayoutSVGResourceClipper(toLayoutSVGResour
ceContainer(element->layoutObject())); | 162 m_resourceClipper = toLayoutSVGResourceClipper(toLayoutSVGResour
ceContainer(element->layoutObject())); |
| 163 // When SVG applies the clip and the coordinate system is "user
space on use", we must explicitly pass in | 163 // When SVG applies the clip and the coordinate system is "user
space on use", we must explicitly pass in |
| 164 // the layer offset to have the clip paint in the correct locati
on. When the coordinate system is | 164 // the layer offset to have the clip paint in the correct locati
on. When the coordinate system is |
| 165 // "object bounding box" the offset is already accounted for in
the rootRelativeBounds. | 165 // "object bounding box" the offset is already accounted for in
the rootRelativeBounds. |
| 166 FloatPoint layerPositionOffset = m_resourceClipper->clipPathUnit
s() == SVGUnitTypes::SVG_UNIT_TYPE_USERSPACEONUSE ? | 166 FloatPoint layerPositionOffset = m_resourceClipper->clipPathUnit
s() == SVGUnitTypes::kSvgUnitTypeUserspaceonuse ? |
| 167 FloatPoint(offsetFromRoot) : FloatPoint(); | 167 FloatPoint(offsetFromRoot) : FloatPoint(); |
| 168 if (!SVGClipPainter(*m_resourceClipper).prepareEffect(*paintLaye
r.layoutObject(), FloatRect(rootRelativeBounds), | 168 if (!SVGClipPainter(*m_resourceClipper).prepareEffect(*paintLaye
r.layoutObject(), FloatRect(rootRelativeBounds), |
| 169 FloatRect(rootRelativeBounds), layerPositionOffset, context,
m_clipperState)) { | 169 FloatRect(rootRelativeBounds), layerPositionOffset, context,
m_clipperState)) { |
| 170 // No need to post-apply the clipper if this failed. | 170 // No need to post-apply the clipper if this failed. |
| 171 m_resourceClipper = 0; | 171 m_resourceClipper = 0; |
| 172 } | 172 } |
| 173 } | 173 } |
| 174 } | 174 } |
| 175 } | 175 } |
| 176 | 176 |
| (...skipping 632 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 809 if (!m_paintLayer.containsDirtyOverlayScrollbars()) | 809 if (!m_paintLayer.containsDirtyOverlayScrollbars()) |
| 810 return; | 810 return; |
| 811 | 811 |
| 812 PaintLayerPaintingInfo paintingInfo(&m_paintLayer, LayoutRect(enclosingIntRe
ct(damageRect)), paintFlags, LayoutSize()); | 812 PaintLayerPaintingInfo paintingInfo(&m_paintLayer, LayoutRect(enclosingIntRe
ct(damageRect)), paintFlags, LayoutSize()); |
| 813 paintLayer(context, paintingInfo, PaintLayerPaintingOverlayScrollbars); | 813 paintLayer(context, paintingInfo, PaintLayerPaintingOverlayScrollbars); |
| 814 | 814 |
| 815 m_paintLayer.setContainsDirtyOverlayScrollbars(false); | 815 m_paintLayer.setContainsDirtyOverlayScrollbars(false); |
| 816 } | 816 } |
| 817 | 817 |
| 818 } // namespace blink | 818 } // namespace blink |
| OLD | NEW |