OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2004, 2005, 2007, 2008 Nikolas Zimmermann <zimmermann@kde.org> | 2 * Copyright (C) 2004, 2005, 2007, 2008 Nikolas Zimmermann <zimmermann@kde.org> |
3 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Rob Buis <buis@kde.org> | 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Rob Buis <buis@kde.org> |
4 * Copyright (C) Research In Motion Limited 2009-2010. All rights reserved. | 4 * Copyright (C) Research In Motion Limited 2009-2010. All rights reserved. |
5 * | 5 * |
6 * This library is free software; you can redistribute it and/or | 6 * This library is free software; you can redistribute it and/or |
7 * modify it under the terms of the GNU Library General Public | 7 * modify it under the terms of the GNU Library General Public |
8 * License as published by the Free Software Foundation; either | 8 * License as published by the Free Software Foundation; either |
9 * version 2 of the License, or (at your option) any later version. | 9 * version 2 of the License, or (at your option) any later version. |
10 * | 10 * |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 { | 63 { |
64 markAllClientsForInvalidation(markForInvalidation ? LayoutAndBoundariesInval
idation : ParentOnlyInvalidation); | 64 markAllClientsForInvalidation(markForInvalidation ? LayoutAndBoundariesInval
idation : ParentOnlyInvalidation); |
65 } | 65 } |
66 | 66 |
67 void RenderSVGResourceMarker::removeClientFromCache(RenderObject* client, bool m
arkForInvalidation) | 67 void RenderSVGResourceMarker::removeClientFromCache(RenderObject* client, bool m
arkForInvalidation) |
68 { | 68 { |
69 ASSERT(client); | 69 ASSERT(client); |
70 markClientForInvalidation(client, markForInvalidation ? BoundariesInvalidati
on : ParentOnlyInvalidation); | 70 markClientForInvalidation(client, markForInvalidation ? BoundariesInvalidati
on : ParentOnlyInvalidation); |
71 } | 71 } |
72 | 72 |
73 void RenderSVGResourceMarker::applyViewportClip(PaintInfo& paintInfo) | |
74 { | |
75 if (SVGRenderSupport::isOverflowHidden(this)) | |
76 paintInfo.context->clip(m_viewport); | |
77 } | |
78 | |
79 FloatRect RenderSVGResourceMarker::markerBoundaries(const AffineTransform& marke
rTransformation) const | 73 FloatRect RenderSVGResourceMarker::markerBoundaries(const AffineTransform& marke
rTransformation) const |
80 { | 74 { |
81 FloatRect coordinates = RenderSVGContainer::paintInvalidationRectInLocalCoor
dinates(); | 75 FloatRect coordinates = RenderSVGContainer::paintInvalidationRectInLocalCoor
dinates(); |
82 | 76 |
83 // Map paint invalidation rect into parent coordinate space, in which the ma
rker boundaries have to be evaluated | 77 // Map paint invalidation rect into parent coordinate space, in which the ma
rker boundaries have to be evaluated |
84 coordinates = localToParentTransform().mapRect(coordinates); | 78 coordinates = localToParentTransform().mapRect(coordinates); |
85 | 79 |
86 return markerTransformation.mapRect(coordinates); | 80 return markerTransformation.mapRect(coordinates); |
87 } | 81 } |
88 | 82 |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 | 130 |
137 // An empty viewBox disables rendering. | 131 // An empty viewBox disables rendering. |
138 SVGMarkerElement* marker = toSVGMarkerElement(element()); | 132 SVGMarkerElement* marker = toSVGMarkerElement(element()); |
139 ASSERT(marker); | 133 ASSERT(marker); |
140 if (marker->hasAttribute(SVGNames::viewBoxAttr) && marker->viewBox()->curren
tValue()->isValid() && marker->viewBox()->currentValue()->value().isEmpty()) | 134 if (marker->hasAttribute(SVGNames::viewBoxAttr) && marker->viewBox()->curren
tValue()->isValid() && marker->viewBox()->currentValue()->value().isEmpty()) |
141 return; | 135 return; |
142 | 136 |
143 PaintInfo info(paintInfo); | 137 PaintInfo info(paintInfo); |
144 GraphicsContextStateSaver stateSaver(*info.context, false); | 138 GraphicsContextStateSaver stateSaver(*info.context, false); |
145 info.applyTransform(transform, &stateSaver); | 139 info.applyTransform(transform, &stateSaver); |
| 140 |
| 141 if (SVGRenderSupport::isOverflowHidden(this)) { |
| 142 stateSaver.saveIfNeeded(); |
| 143 info.context->clip(m_viewport); |
| 144 } |
| 145 |
146 RenderSVGContainer::paint(info, IntPoint()); | 146 RenderSVGContainer::paint(info, IntPoint()); |
147 } | 147 } |
148 | 148 |
149 AffineTransform RenderSVGResourceMarker::markerContentTransformation(const Affin
eTransform& contentTransformation, const FloatPoint& origin, float strokeWidth)
const | 149 AffineTransform RenderSVGResourceMarker::markerContentTransformation(const Affin
eTransform& contentTransformation, const FloatPoint& origin, float strokeWidth)
const |
150 { | 150 { |
151 // The 'origin' coordinate maps to SVGs refX/refY, given in coordinates rela
tive to the viewport established by the marker | 151 // The 'origin' coordinate maps to SVGs refX/refY, given in coordinates rela
tive to the viewport established by the marker |
152 FloatPoint mappedOrigin = viewportTransform().mapPoint(origin); | 152 FloatPoint mappedOrigin = viewportTransform().mapPoint(origin); |
153 | 153 |
154 AffineTransform transformation = contentTransformation; | 154 AffineTransform transformation = contentTransformation; |
155 if (strokeWidth != -1) | 155 if (strokeWidth != -1) |
(...skipping 19 matching lines...) Expand all Loading... |
175 SVGMarkerElement* marker = toSVGMarkerElement(element()); | 175 SVGMarkerElement* marker = toSVGMarkerElement(element()); |
176 ASSERT(marker); | 176 ASSERT(marker); |
177 | 177 |
178 SVGLengthContext lengthContext(marker); | 178 SVGLengthContext lengthContext(marker); |
179 float w = marker->markerWidth()->currentValue()->value(lengthContext); | 179 float w = marker->markerWidth()->currentValue()->value(lengthContext); |
180 float h = marker->markerHeight()->currentValue()->value(lengthContext); | 180 float h = marker->markerHeight()->currentValue()->value(lengthContext); |
181 m_viewport = FloatRect(0, 0, w, h); | 181 m_viewport = FloatRect(0, 0, w, h); |
182 } | 182 } |
183 | 183 |
184 } | 184 } |
OLD | NEW |