OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2004, 2005, 2007 Nikolas Zimmermann <zimmermann@kde.org> | 2 * Copyright (C) 2004, 2005, 2007 Nikolas Zimmermann <zimmermann@kde.org> |
3 * Copyright (C) 2004, 2005, 2007 Rob Buis <buis@kde.org> | 3 * Copyright (C) 2004, 2005, 2007 Rob Buis <buis@kde.org> |
4 * Copyright (C) 2007 Eric Seidel <eric@webkit.org> | 4 * Copyright (C) 2007 Eric Seidel <eric@webkit.org> |
5 * Copyright (C) 2009 Google, Inc. | 5 * Copyright (C) 2009 Google, Inc. |
6 * | 6 * |
7 * This library is free software; you can redistribute it and/or | 7 * This library is free software; you can redistribute it and/or |
8 * modify it under the terms of the GNU Library General Public | 8 * modify it under the terms of the GNU Library General Public |
9 * License as published by the Free Software Foundation; either | 9 * License as published by the Free Software Foundation; either |
10 * version 2 of the License, or (at your option) any later version. | 10 * version 2 of the License, or (at your option) any later version. |
(...skipping 14 matching lines...) Expand all Loading... |
25 #include "core/layout/svg/SVGLayoutSupport.h" | 25 #include "core/layout/svg/SVGLayoutSupport.h" |
26 #include "core/paint/SVGContainerPainter.h" | 26 #include "core/paint/SVGContainerPainter.h" |
27 #include "core/svg/SVGSVGElement.h" | 27 #include "core/svg/SVGSVGElement.h" |
28 #include "core/svg/SVGUseElement.h" | 28 #include "core/svg/SVGUseElement.h" |
29 #include "platform/graphics/GraphicsContext.h" | 29 #include "platform/graphics/GraphicsContext.h" |
30 | 30 |
31 namespace blink { | 31 namespace blink { |
32 | 32 |
33 LayoutSVGViewportContainer::LayoutSVGViewportContainer(SVGElement* node) | 33 LayoutSVGViewportContainer::LayoutSVGViewportContainer(SVGElement* node) |
34 : LayoutSVGContainer(node) | 34 : LayoutSVGContainer(node) |
35 , m_didTransformToRootUpdate(false) | |
36 , m_isLayoutSizeChanged(false) | 35 , m_isLayoutSizeChanged(false) |
37 , m_needsTransformUpdate(true) | 36 , m_needsTransformUpdate(true) |
38 { | 37 { |
39 } | 38 } |
40 | 39 |
41 void LayoutSVGViewportContainer::determineIfLayoutSizeChanged() | 40 void LayoutSVGViewportContainer::determineIfLayoutSizeChanged() |
42 { | 41 { |
43 ASSERT(element()); | 42 ASSERT(element()); |
44 if (!isSVGSVGElement(*element())) | 43 if (!isSVGSVGElement(*element())) |
45 return; | 44 return; |
(...skipping 14 matching lines...) Expand all Loading... |
60 m_viewport = FloatRect(svg->x()->currentValue()->value(lengthContext), svg->
y()->currentValue()->value(lengthContext), svg->width()->currentValue()->value(l
engthContext), svg->height()->currentValue()->value(lengthContext)); | 59 m_viewport = FloatRect(svg->x()->currentValue()->value(lengthContext), svg->
y()->currentValue()->value(lengthContext), svg->width()->currentValue()->value(l
engthContext), svg->height()->currentValue()->value(lengthContext)); |
61 | 60 |
62 if (oldViewport != m_viewport) { | 61 if (oldViewport != m_viewport) { |
63 setNeedsBoundariesUpdate(); | 62 setNeedsBoundariesUpdate(); |
64 setNeedsTransformUpdate(); | 63 setNeedsTransformUpdate(); |
65 } | 64 } |
66 } | 65 } |
67 | 66 |
68 bool LayoutSVGViewportContainer::calculateLocalTransform() | 67 bool LayoutSVGViewportContainer::calculateLocalTransform() |
69 { | 68 { |
70 m_didTransformToRootUpdate = m_needsTransformUpdate || SVGLayoutSupport::tra
nsformToRootChanged(parent()); | |
71 if (!m_needsTransformUpdate) | 69 if (!m_needsTransformUpdate) |
72 return false; | 70 return false; |
73 | 71 |
74 m_localToParentTransform = AffineTransform::translation(m_viewport.x(), m_vi
ewport.y()) * viewportTransform(); | 72 m_localToParentTransform = AffineTransform::translation(m_viewport.x(), m_vi
ewport.y()) * viewportTransform(); |
75 m_needsTransformUpdate = false; | 73 m_needsTransformUpdate = false; |
76 return true; | 74 return true; |
77 } | 75 } |
78 | 76 |
79 AffineTransform LayoutSVGViewportContainer::viewportTransform() const | 77 AffineTransform LayoutSVGViewportContainer::viewportTransform() const |
80 { | 78 { |
(...skipping 14 matching lines...) Expand all Loading... |
95 | 93 |
96 return m_viewport.contains(pointInParent); | 94 return m_viewport.contains(pointInParent); |
97 } | 95 } |
98 | 96 |
99 void LayoutSVGViewportContainer::paint(const PaintInfo& paintInfo, const LayoutP
oint& paintOffset) const | 97 void LayoutSVGViewportContainer::paint(const PaintInfo& paintInfo, const LayoutP
oint& paintOffset) const |
100 { | 98 { |
101 SVGContainerPainter(*this).paint(paintInfo); | 99 SVGContainerPainter(*this).paint(paintInfo); |
102 } | 100 } |
103 | 101 |
104 } // namespace blink | 102 } // namespace blink |
OLD | NEW |