Changeset 53365 in webkit
- Timestamp:
- Jan 16, 2010 3:04:32 PM (14 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r53364 r53365 1 2010-01-16 Oliver Hunt <oliver@apple.com> 2 3 Reviewed by Nikolas Zimmermann. 4 5 Copying TransformationMatrix consumed a lot of cpu time while scroll with cursor over content 6 https://bugs.webkit.org/show_bug.cgi?id=33766 7 8 Make localToParentTransform return by reference to avid copy overhead. 9 This is a little gnarly in places as it means we need to be able to 10 return temporary values in a few implementations, so we have to add 11 class fields to hold them, heppily the classes that these effect are 12 sufficiently uncommon for this to be okay. 13 14 * rendering/RenderForeignObject.cpp: 15 (WebCore::RenderForeignObject::localToParentTransform): 16 * rendering/RenderForeignObject.h: 17 * rendering/RenderObject.cpp: 18 (WebCore::RenderObject::localTransform): 19 (WebCore::RenderObject::localToParentTransform): 20 * rendering/RenderObject.h: 21 * rendering/RenderPath.cpp: 22 (WebCore::RenderPath::localToParentTransform): 23 (WebCore::RenderPath::nodeAtFloatPoint): 24 * rendering/RenderPath.h: 25 * rendering/RenderSVGImage.h: 26 (WebCore::RenderSVGImage::localToParentTransform): 27 * rendering/RenderSVGRoot.cpp: 28 (WebCore::RenderSVGRoot::localToParentTransform): 29 * rendering/RenderSVGRoot.h: 30 * rendering/RenderSVGText.h: 31 (WebCore::RenderSVGText::localToParentTransform): 32 * rendering/RenderSVGTransformableContainer.cpp: 33 (WebCore::RenderSVGTransformableContainer::localToParentTransform): 34 * rendering/RenderSVGTransformableContainer.h: 35 * rendering/RenderSVGViewportContainer.cpp: 36 (WebCore::RenderSVGViewportContainer::localToParentTransform): 37 * rendering/RenderSVGViewportContainer.h: 38 1 39 2010-01-16 Darin Adler <darin@apple.com> 2 40 -
trunk/WebCore/rendering/RenderForeignObject.cpp
r53103 r53365 89 89 } 90 90 91 TransformationMatrixRenderForeignObject::localToParentTransform() const91 const TransformationMatrix& RenderForeignObject::localToParentTransform() const 92 92 { 93 return localTransform() * translationForAttributes(); 93 m_localToParentTransform = localTransform() * translationForAttributes(); 94 return m_localToParentTransform; 94 95 } 95 96 -
trunk/WebCore/rendering/RenderForeignObject.h
r52647 r53365 39 39 virtual void paint(PaintInfo&, int parentX, int parentY); 40 40 41 virtual TransformationMatrixlocalToParentTransform() const;41 virtual const TransformationMatrix& localToParentTransform() const; 42 42 43 43 virtual void computeRectForRepaint(RenderBoxModelObject* repaintContainer, IntRect&, bool fixed = false); … … 59 59 60 60 TransformationMatrix m_localTransform; 61 mutable TransformationMatrix m_localToParentTransform; 61 62 }; 62 63 -
trunk/WebCore/rendering/RenderObject.cpp
r53355 r53365 2510 2510 TransformationMatrix RenderObject::localTransform() const 2511 2511 { 2512 return TransformationMatrix();2513 } 2514 2515 TransformationMatrix RenderObject::localToParentTransform() const 2516 { 2517 // FIXME: This double virtual call indirection is temporary until I can land the 2518 // rest of the of the localToParentTransform() support for SVG.2519 return localTransform();2512 static const TransformationMatrix identity; 2513 return identity; 2514 } 2515 2516 const TransformationMatrix& RenderObject::localToParentTransform() const 2517 { 2518 static const TransformationMatrix identity; 2519 return identity; 2520 2520 } 2521 2521 -
trunk/WebCore/rendering/RenderObject.h
r53357 r53365 348 348 // Returns the full transform mapping from local coordinates to local coords for the parent SVG renderer 349 349 // This includes any viewport transforms and x/y offsets as well as the transform="" value off the element. 350 virtual TransformationMatrixlocalToParentTransform() const;350 virtual const TransformationMatrix& localToParentTransform() const; 351 351 352 352 // Walks up the parent chain to create a transform which maps from local to document coords -
trunk/WebCore/rendering/RenderPath.cpp
r53349 r53365 70 70 } 71 71 72 TransformationMatrixRenderPath::localToParentTransform() const72 const TransformationMatrix& RenderPath::localToParentTransform() const 73 73 { 74 74 return m_localTransform; … … 266 266 return false; 267 267 268 FloatPoint localPoint = localToParentTransform().inverse().mapPoint(pointInParent);268 FloatPoint localPoint = m_localTransform.inverse().mapPoint(pointInParent); 269 269 270 270 PointerEventsHitRules hitRules(PointerEventsHitRules::SVG_PATH_HITTESTING, style()->pointerEvents()); -
trunk/WebCore/rendering/RenderPath.h
r52866 r53365 53 53 virtual FloatRect repaintRectInLocalCoordinates() const; 54 54 55 virtual TransformationMatrixlocalToParentTransform() const;55 virtual const TransformationMatrix& localToParentTransform() const; 56 56 57 57 void setPath(const Path&); -
trunk/WebCore/rendering/RenderSVGImage.h
r52865 r53365 44 44 virtual bool isSVGImage() const { return true; } 45 45 46 virtual TransformationMatrixlocalToParentTransform() const { return m_localTransform; }46 virtual const TransformationMatrix& localToParentTransform() const { return m_localTransform; } 47 47 48 48 virtual FloatRect objectBoundingBox() const; -
trunk/WebCore/rendering/RenderSVGRoot.cpp
r53300 r53365 225 225 } 226 226 227 TransformationMatrixRenderSVGRoot::localToParentTransform() const227 const TransformationMatrix& RenderSVGRoot::localToParentTransform() const 228 228 { 229 229 IntSize parentToBorderBoxOffset = parentOriginToBorderBox(); … … 232 232 borderBoxOriginToParentOrigin.translate(parentToBorderBoxOffset.width(), parentToBorderBoxOffset.height()); 233 233 234 return localToBorderBoxTransform() * borderBoxOriginToParentOrigin; 234 m_localToParentTransform = localToBorderBoxTransform() * borderBoxOriginToParentOrigin; 235 return m_localToParentTransform; 235 236 } 236 237 -
trunk/WebCore/rendering/RenderSVGRoot.h
r52647 r53365 55 55 virtual void paint(PaintInfo&, int parentX, int parentY); 56 56 57 virtual TransformationMatrixlocalToParentTransform() const;57 virtual const TransformationMatrix& localToParentTransform() const; 58 58 59 59 bool fillContains(const FloatPoint&) const; … … 86 86 RenderObjectChildList m_children; 87 87 FloatSize m_viewportSize; 88 mutable TransformationMatrix m_localToParentTransform; 88 89 }; 89 90 -
trunk/WebCore/rendering/RenderSVGText.h
r52647 r53365 45 45 virtual bool isSVGText() const { return true; } 46 46 47 virtual TransformationMatrixlocalToParentTransform() const { return m_localTransform; }47 virtual const TransformationMatrix& localToParentTransform() const { return m_localTransform; } 48 48 49 49 virtual void paint(PaintInfo&, int tx, int ty); -
trunk/WebCore/rendering/RenderSVGTransformableContainer.cpp
r43211 r53365 35 35 } 36 36 37 TransformationMatrixRenderSVGTransformableContainer::localToParentTransform() const37 const TransformationMatrix& RenderSVGTransformableContainer::localToParentTransform() const 38 38 { 39 39 return m_localTransform; -
trunk/WebCore/rendering/RenderSVGTransformableContainer.h
r43211 r53365 32 32 RenderSVGTransformableContainer(SVGStyledTransformableElement*); 33 33 34 virtual TransformationMatrixlocalToParentTransform() const;34 virtual const TransformationMatrix& localToParentTransform() const; 35 35 36 36 private: -
trunk/WebCore/rendering/RenderSVGViewportContainer.cpp
r52866 r53365 106 106 } 107 107 108 TransformationMatrixRenderSVGViewportContainer::localToParentTransform() const108 const TransformationMatrix& RenderSVGViewportContainer::localToParentTransform() const 109 109 { 110 110 TransformationMatrix viewportTranslation; 111 111 viewportTranslation.translate(m_viewport.x(), m_viewport.y()); 112 return viewportTransform() * viewportTranslation; 112 m_localToParentTransform = viewportTransform() * viewportTranslation; 113 return m_localToParentTransform; 113 114 // If this class were ever given a localTransform(), then the above would read: 114 115 // return viewportTransform() * localTransform() * viewportTranslation; -
trunk/WebCore/rendering/RenderSVGViewportContainer.h
r52866 r53365 47 47 48 48 TransformationMatrix viewportTransform() const; 49 virtual TransformationMatrixlocalToParentTransform() const;49 virtual const TransformationMatrix& localToParentTransform() const; 50 50 51 51 // FIXME: This override should be removed once callers of RenderBox::absoluteTransform() can be removed. … … 58 58 59 59 FloatRect m_viewport; 60 mutable TransformationMatrix m_localToParentTransform; 60 61 }; 61 62
Note: See TracChangeset
for help on using the changeset viewer.