| 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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 void RenderSVGResourceMarker::layout() | 46 void RenderSVGResourceMarker::layout() |
| 47 { | 47 { |
| 48 ASSERT(needsLayout()); | 48 ASSERT(needsLayout()); |
| 49 if (m_isInLayout) | 49 if (m_isInLayout) |
| 50 return; | 50 return; |
| 51 | 51 |
| 52 TemporaryChange<bool> inLayoutChange(m_isInLayout, true); | 52 TemporaryChange<bool> inLayoutChange(m_isInLayout, true); |
| 53 | 53 |
| 54 // RenderSVGHiddenContainer overwrites layout(). We need the | 54 // RenderSVGHiddenContainer overwrites layout(). We need the |
| 55 // layouting of RenderSVGContainer for calculating local | 55 // layouting of RenderSVGContainer for calculating local |
| 56 // transformations and repaint. | 56 // transformations and paint invalidation. |
| 57 RenderSVGContainer::layout(); | 57 RenderSVGContainer::layout(); |
| 58 | 58 |
| 59 clearInvalidationMask(); | 59 clearInvalidationMask(); |
| 60 } | 60 } |
| 61 | 61 |
| 62 void RenderSVGResourceMarker::removeAllClientsFromCache(bool markForInvalidation
) | 62 void RenderSVGResourceMarker::removeAllClientsFromCache(bool markForInvalidation
) |
| 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) | 73 void RenderSVGResourceMarker::applyViewportClip(PaintInfo& paintInfo) |
| 74 { | 74 { |
| 75 if (SVGRenderSupport::isOverflowHidden(this)) | 75 if (SVGRenderSupport::isOverflowHidden(this)) |
| 76 paintInfo.context->clip(m_viewport); | 76 paintInfo.context->clip(m_viewport); |
| 77 } | 77 } |
| 78 | 78 |
| 79 FloatRect RenderSVGResourceMarker::markerBoundaries(const AffineTransform& marke
rTransformation) const | 79 FloatRect RenderSVGResourceMarker::markerBoundaries(const AffineTransform& marke
rTransformation) const |
| 80 { | 80 { |
| 81 FloatRect coordinates = RenderSVGContainer::paintInvalidationRectInLocalCoor
dinates(); | 81 FloatRect coordinates = RenderSVGContainer::paintInvalidationRectInLocalCoor
dinates(); |
| 82 | 82 |
| 83 // Map repaint rect into parent coordinate space, in which the marker bounda
ries have to be evaluated | 83 // Map paint invalidation rect into parent coordinate space, in which the ma
rker boundaries have to be evaluated |
| 84 coordinates = localToParentTransform().mapRect(coordinates); | 84 coordinates = localToParentTransform().mapRect(coordinates); |
| 85 | 85 |
| 86 return markerTransformation.mapRect(coordinates); | 86 return markerTransformation.mapRect(coordinates); |
| 87 } | 87 } |
| 88 | 88 |
| 89 const AffineTransform& RenderSVGResourceMarker::localToParentTransform() const | 89 const AffineTransform& RenderSVGResourceMarker::localToParentTransform() const |
| 90 { | 90 { |
| 91 m_localToParentTransform = AffineTransform::translation(m_viewport.x(), m_vi
ewport.y()) * viewportTransform(); | 91 m_localToParentTransform = AffineTransform::translation(m_viewport.x(), m_vi
ewport.y()) * viewportTransform(); |
| 92 return m_localToParentTransform; | 92 return m_localToParentTransform; |
| 93 // If this class were ever given a localTransform(), then the above would re
ad: | 93 // If this class were ever given a localTransform(), then the above would re
ad: |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 178 SVGMarkerElement* marker = toSVGMarkerElement(element()); | 178 SVGMarkerElement* marker = toSVGMarkerElement(element()); |
| 179 ASSERT(marker); | 179 ASSERT(marker); |
| 180 | 180 |
| 181 SVGLengthContext lengthContext(marker); | 181 SVGLengthContext lengthContext(marker); |
| 182 float w = marker->markerWidth()->currentValue()->value(lengthContext); | 182 float w = marker->markerWidth()->currentValue()->value(lengthContext); |
| 183 float h = marker->markerHeight()->currentValue()->value(lengthContext); | 183 float h = marker->markerHeight()->currentValue()->value(lengthContext); |
| 184 m_viewport = FloatRect(0, 0, w, h); | 184 m_viewport = FloatRect(0, 0, w, h); |
| 185 } | 185 } |
| 186 | 186 |
| 187 } | 187 } |
| OLD | NEW |