| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006 Alexander Kellett <lypanov@kde.org> | 2 * Copyright (C) 2006 Alexander Kellett <lypanov@kde.org> |
| 3 * Copyright (C) 2006 Apple Computer, Inc. | 3 * Copyright (C) 2006 Apple Computer, Inc. |
| 4 * Copyright (C) 2007 Nikolas Zimmermann <zimmermann@kde.org> | 4 * Copyright (C) 2007 Nikolas Zimmermann <zimmermann@kde.org> |
| 5 * Copyright (C) 2007, 2008, 2009 Rob Buis <buis@kde.org> | 5 * Copyright (C) 2007, 2008, 2009 Rob Buis <buis@kde.org> |
| 6 * Copyright (C) 2009 Google, Inc. | 6 * Copyright (C) 2009 Google, Inc. |
| 7 * Copyright (C) 2009 Dirk Schulze <krit@webkit.org> | 7 * Copyright (C) 2009 Dirk Schulze <krit@webkit.org> |
| 8 * Copyright (C) 2010 Patrick Gansterer <paroga@paroga.com> | 8 * Copyright (C) 2010 Patrick Gansterer <paroga@paroga.com> |
| 9 * | 9 * |
| 10 * This library is free software; you can redistribute it and/or | 10 * This library is free software; you can redistribute it and/or |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 m_needsBoundariesUpdate = true; | 110 m_needsBoundariesUpdate = true; |
| 111 } | 111 } |
| 112 | 112 |
| 113 if (element()) | 113 if (element()) |
| 114 element()->setNeedsResizeObserverUpdate(); | 114 element()->setNeedsResizeObserverUpdate(); |
| 115 | 115 |
| 116 return oldObjectBoundingBox.size() != m_objectBoundingBox.size(); | 116 return oldObjectBoundingBox.size() != m_objectBoundingBox.size(); |
| 117 } | 117 } |
| 118 | 118 |
| 119 void LayoutSVGImage::layout() { | 119 void LayoutSVGImage::layout() { |
| 120 ASSERT(needsLayout()); | 120 DCHECK(needsLayout()); |
| 121 LayoutAnalyzer::Scope analyzer(*this); | 121 LayoutAnalyzer::Scope analyzer(*this); |
| 122 | 122 |
| 123 // Invalidate all resources of this client if our layout changed. | 123 // Invalidate all resources of this client if our layout changed. |
| 124 if (everHadLayout() && selfNeedsLayout()) | 124 if (everHadLayout() && selfNeedsLayout()) |
| 125 SVGResourcesCache::clientLayoutChanged(this); | 125 SVGResourcesCache::clientLayoutChanged(this); |
| 126 | 126 |
| 127 updateBoundingBox(); | 127 updateBoundingBox(); |
| 128 | 128 |
| 129 bool updateParentBoundaries = false; | 129 bool updateParentBoundaries = false; |
| 130 if (m_needsTransformUpdate) { | 130 if (m_needsTransformUpdate) { |
| 131 m_localTransform = toSVGImageElement(element())->calculateTransform( | 131 m_localTransform = toSVGImageElement(element())->calculateTransform( |
| 132 SVGElement::IncludeMotionTransform); | 132 SVGElement::IncludeMotionTransform); |
| 133 m_needsTransformUpdate = false; | 133 m_needsTransformUpdate = false; |
| 134 updateParentBoundaries = true; | 134 updateParentBoundaries = true; |
| 135 } | 135 } |
| 136 | 136 |
| 137 if (m_needsBoundariesUpdate) { | 137 if (m_needsBoundariesUpdate) { |
| 138 m_localVisualRect = m_objectBoundingBox; | 138 m_localVisualRect = m_objectBoundingBox; |
| 139 SVGLayoutSupport::adjustVisualRectWithResources(this, m_localVisualRect); | 139 SVGLayoutSupport::adjustVisualRectWithResources(this, m_localVisualRect); |
| 140 m_needsBoundariesUpdate = false; | 140 m_needsBoundariesUpdate = false; |
| 141 updateParentBoundaries = true; | 141 updateParentBoundaries = true; |
| 142 } | 142 } |
| 143 | 143 |
| 144 // If our bounds changed, notify the parents. | 144 // If our bounds changed, notify the parents. |
| 145 if (updateParentBoundaries) | 145 if (updateParentBoundaries) |
| 146 LayoutSVGModelObject::setNeedsBoundariesUpdate(); | 146 LayoutSVGModelObject::setNeedsBoundariesUpdate(); |
| 147 | 147 |
| 148 ASSERT(!m_needsBoundariesUpdate); | 148 DCHECK(!m_needsBoundariesUpdate); |
| 149 ASSERT(!m_needsTransformUpdate); | 149 DCHECK(!m_needsTransformUpdate); |
| 150 clearNeedsLayout(); | 150 clearNeedsLayout(); |
| 151 } | 151 } |
| 152 | 152 |
| 153 void LayoutSVGImage::paint(const PaintInfo& paintInfo, | 153 void LayoutSVGImage::paint(const PaintInfo& paintInfo, |
| 154 const LayoutPoint&) const { | 154 const LayoutPoint&) const { |
| 155 SVGImagePainter(*this).paint(paintInfo); | 155 SVGImagePainter(*this).paint(paintInfo); |
| 156 } | 156 } |
| 157 | 157 |
| 158 bool LayoutSVGImage::nodeAtFloatPoint(HitTestResult& result, | 158 bool LayoutSVGImage::nodeAtFloatPoint(HitTestResult& result, |
| 159 const FloatPoint& pointInParent, | 159 const FloatPoint& pointInParent, |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 203 | 203 |
| 204 void LayoutSVGImage::addOutlineRects(Vector<LayoutRect>& rects, | 204 void LayoutSVGImage::addOutlineRects(Vector<LayoutRect>& rects, |
| 205 const LayoutPoint&, | 205 const LayoutPoint&, |
| 206 IncludeBlockVisualOverflowOrNot) const { | 206 IncludeBlockVisualOverflowOrNot) const { |
| 207 // this is called from paint() after the localTransform has already been | 207 // this is called from paint() after the localTransform has already been |
| 208 // applied | 208 // applied |
| 209 rects.push_back(LayoutRect(visualRectInLocalSVGCoordinates())); | 209 rects.push_back(LayoutRect(visualRectInLocalSVGCoordinates())); |
| 210 } | 210 } |
| 211 | 211 |
| 212 } // namespace blink | 212 } // namespace blink |
| OLD | NEW |