Changeset 93050 in webkit
- Timestamp:
- Aug 15, 2011, 12:07:58 PM (14 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 20 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r93047 r93050 1 2011-08-15 Levi Weintraub <leviw@chromium.org> 2 3 Switch remaining SVG Rendering methods to LayoutUnits 4 https://bugs.webkit.org/show_bug.cgi?id=66169 5 6 Reviewed by Eric Seidel. 7 8 Changing remaining integer SVG methods to use the LayoutUnits abstraction. 9 10 No tests as no change in functionality. 11 12 * rendering/svg/RenderSVGBlock.cpp: 13 (WebCore::RenderSVGBlock::visualOverflowRect): 14 * rendering/svg/RenderSVGBlock.h: 15 * rendering/svg/RenderSVGContainer.cpp: 16 (WebCore::RenderSVGContainer::paint): 17 * rendering/svg/RenderSVGForeignObject.cpp: 18 (WebCore::RenderSVGForeignObject::paint): 19 (WebCore::RenderSVGForeignObject::clippedOverflowRectForRepaint): 20 (WebCore::RenderSVGForeignObject::computeRectForRepaint): 21 * rendering/svg/RenderSVGHiddenContainer.cpp: 22 (WebCore::RenderSVGHiddenContainer::paint): 23 * rendering/svg/RenderSVGImage.cpp: 24 (WebCore::RenderSVGImage::paint): 25 * rendering/svg/RenderSVGInlineText.cpp: 26 (WebCore::RenderSVGInlineText::linesBoundingBox): 27 * rendering/svg/RenderSVGInlineText.h: 28 * rendering/svg/RenderSVGModelObject.cpp: 29 (WebCore::RenderSVGModelObject::outlineBoundsForRepaint): 30 * rendering/svg/RenderSVGPath.cpp: 31 (WebCore::RenderSVGPath::paint): 32 * rendering/svg/RenderSVGRoot.cpp: 33 (WebCore::RenderSVGRoot::localToBorderBoxTransform): 34 (WebCore::RenderSVGRoot::parentOriginToBorderBox): 35 (WebCore::RenderSVGRoot::borderOriginToContentBox): 36 (WebCore::RenderSVGRoot::localToRepaintContainerTransform): 37 (WebCore::RenderSVGRoot::localToParentTransform): 38 (WebCore::RenderSVGRoot::clippedOverflowRectForRepaint): 39 (WebCore::RenderSVGRoot::computeRectForRepaint): 40 * rendering/svg/RenderSVGRoot.h: 41 * rendering/svg/RenderSVGText.cpp: 42 (WebCore::RenderSVGText::paint): 43 * rendering/svg/SVGInlineFlowBox.cpp: 44 (WebCore::SVGInlineFlowBox::paint): 45 * rendering/svg/SVGInlineTextBox.cpp: 46 (WebCore::SVGInlineTextBox::paint): 47 * rendering/svg/SVGRenderSupport.cpp: 48 (WebCore::SVGRenderSupport::clippedOverflowRectForRepaint): 49 (WebCore::SVGRenderSupport::computeRectForRepaint): 50 * rendering/svg/SVGRenderSupport.h: 51 * rendering/svg/SVGRootInlineBox.cpp: 52 (WebCore::SVGRootInlineBox::paint): 53 (WebCore::SVGRootInlineBox::computePerCharacterLayoutInformation): 54 (WebCore::SVGRootInlineBox::layoutChildBoxes): 55 (WebCore::SVGRootInlineBox::layoutRootBox): 56 (WebCore::SVGRootInlineBox::closestLeafChildForPosition): 57 * rendering/svg/SVGRootInlineBox.h: 58 1 59 2011-08-12 Jeff Miller <jeffm@apple.com> 2 60 -
trunk/Source/WebCore/rendering/svg/RenderSVGBlock.cpp
r92152 r93050 35 35 } 36 36 37 IntRect RenderSVGBlock::visualOverflowRect() const37 LayoutRect RenderSVGBlock::visualOverflowRect() const 38 38 { 39 39 LayoutRect borderRect = borderBoxRect(); -
trunk/Source/WebCore/rendering/svg/RenderSVGBlock.h
r92152 r93050 33 33 explicit RenderSVGBlock(SVGElement*); 34 34 35 virtual IntRect visualOverflowRect() const;35 virtual LayoutRect visualOverflowRect() const; 36 36 37 37 private: -
trunk/Source/WebCore/rendering/svg/RenderSVGContainer.cpp
r90698 r93050 92 92 } 93 93 94 void RenderSVGContainer::paint(PaintInfo& paintInfo, const IntPoint&)94 void RenderSVGContainer::paint(PaintInfo& paintInfo, const LayoutPoint&) 95 95 { 96 96 if (paintInfo.context->paintingDisabled()) -
trunk/Source/WebCore/rendering/svg/RenderSVGForeignObject.cpp
r92434 r93050 45 45 } 46 46 47 void RenderSVGForeignObject::paint(PaintInfo& paintInfo, const IntPoint&)47 void RenderSVGForeignObject::paint(PaintInfo& paintInfo, const LayoutPoint&) 48 48 { 49 49 if (paintInfo.context->paintingDisabled()) … … 67 67 } 68 68 69 IntRect RenderSVGForeignObject::clippedOverflowRectForRepaint(RenderBoxModelObject* repaintContainer) const69 LayoutRect RenderSVGForeignObject::clippedOverflowRectForRepaint(RenderBoxModelObject* repaintContainer) const 70 70 { 71 71 return SVGRenderSupport::clippedOverflowRectForRepaint(this, repaintContainer); 72 72 } 73 73 74 void RenderSVGForeignObject::computeRectForRepaint(RenderBoxModelObject* repaintContainer, IntRect& repaintRect, bool fixed) const74 void RenderSVGForeignObject::computeRectForRepaint(RenderBoxModelObject* repaintContainer, LayoutRect& repaintRect, bool fixed) const 75 75 { 76 76 SVGRenderSupport::computeRectForRepaint(this, repaintContainer, repaintRect, fixed); -
trunk/Source/WebCore/rendering/svg/RenderSVGHiddenContainer.cpp
r92438 r93050 40 40 } 41 41 42 void RenderSVGHiddenContainer::paint(PaintInfo&, const IntPoint&)42 void RenderSVGHiddenContainer::paint(PaintInfo&, const LayoutPoint&) 43 43 { 44 44 // This subtree does not paint. -
trunk/Source/WebCore/rendering/svg/RenderSVGImage.cpp
r90698 r93050 104 104 } 105 105 106 void RenderSVGImage::paint(PaintInfo& paintInfo, const IntPoint&)106 void RenderSVGImage::paint(PaintInfo& paintInfo, const LayoutPoint&) 107 107 { 108 108 if (paintInfo.context->paintingDisabled() || style()->visibility() == HIDDEN || !m_imageResource->hasImage()) -
trunk/Source/WebCore/rendering/svg/RenderSVGInlineText.cpp
r92625 r93050 128 128 } 129 129 130 IntRect RenderSVGInlineText::linesBoundingBox() const131 { 132 IntRect boundingBox;130 LayoutRect RenderSVGInlineText::linesBoundingBox() const 131 { 132 LayoutRect boundingBox; 133 133 for (InlineTextBox* box = firstTextBox(); box; box = box->nextTextBox()) 134 134 boundingBox.unite(box->calculateBoundaries()); -
trunk/Source/WebCore/rendering/svg/RenderSVGInlineText.h
r90675 r93050 61 61 virtual VisiblePosition positionForPoint(const LayoutPoint&); 62 62 virtual IntRect localCaretRect(InlineBox*, int caretOffset, int* extraWidthToEndOfLine = 0); 63 virtual IntRect linesBoundingBox() const;63 virtual LayoutRect linesBoundingBox() const; 64 64 virtual InlineTextBox* createTextBox(); 65 65 -
trunk/Source/WebCore/rendering/svg/RenderSVGModelObject.cpp
r92438 r93050 62 62 // FIXME: This may also need to move into SVGRenderSupport as the RenderBox version depends 63 63 // on borderBoundingBox() which SVG RenderBox subclases (like SVGRenderBlock) do not implement. 64 IntRect RenderSVGModelObject::outlineBoundsForRepaint(RenderBoxModelObject* repaintContainer, IntPoint*) const64 LayoutRect RenderSVGModelObject::outlineBoundsForRepaint(RenderBoxModelObject* repaintContainer, LayoutPoint*) const 65 65 { 66 IntRect box = enclosingIntRect(repaintRectInLocalCoordinates());66 LayoutRect box = enclosingLayoutRect(repaintRectInLocalCoordinates()); 67 67 adjustRectForOutlineAndShadow(box); 68 68 -
trunk/Source/WebCore/rendering/svg/RenderSVGPath.cpp
r91915 r93050 247 247 } 248 248 249 void RenderSVGPath::paint(PaintInfo& paintInfo, const IntPoint&)249 void RenderSVGPath::paint(PaintInfo& paintInfo, const LayoutPoint&) 250 250 { 251 251 if (paintInfo.context->paintingDisabled() || style()->visibility() == HIDDEN || m_path.isEmpty()) -
trunk/Source/WebCore/rendering/svg/RenderSVGRoot.cpp
r92545 r93050 347 347 AffineTransform RenderSVGRoot::localToBorderBoxTransform() const 348 348 { 349 IntSize borderAndPadding = borderOriginToContentBox();349 LayoutSize borderAndPadding = borderOriginToContentBox(); 350 350 SVGSVGElement* svg = static_cast<SVGSVGElement*>(node()); 351 351 float scale = style()->effectiveZoom(); … … 355 355 } 356 356 357 IntSize RenderSVGRoot::parentOriginToBorderBox() const358 { 359 return IntSize(x(), y());360 } 361 362 IntSize RenderSVGRoot::borderOriginToContentBox() const363 { 364 return IntSize(borderLeft() + paddingLeft(), borderTop() + paddingTop());365 } 366 367 AffineTransform RenderSVGRoot::localToRepaintContainerTransform(const IntPoint& parentOriginInContainer) const357 LayoutSize RenderSVGRoot::parentOriginToBorderBox() const 358 { 359 return locationOffset(); 360 } 361 362 LayoutSize RenderSVGRoot::borderOriginToContentBox() const 363 { 364 return LayoutSize(borderLeft() + paddingLeft(), borderTop() + paddingTop()); 365 } 366 367 AffineTransform RenderSVGRoot::localToRepaintContainerTransform(const LayoutPoint& parentOriginInContainer) const 368 368 { 369 369 return AffineTransform::translation(parentOriginInContainer.x(), parentOriginInContainer.y()) * localToParentTransform(); … … 372 372 const AffineTransform& RenderSVGRoot::localToParentTransform() const 373 373 { 374 IntSize parentToBorderBoxOffset = parentOriginToBorderBox();374 LayoutSize parentToBorderBoxOffset = parentOriginToBorderBox(); 375 375 376 376 m_localToParentTransform = AffineTransform::translation(parentToBorderBoxOffset.width(), parentToBorderBoxOffset.height()) * localToBorderBoxTransform(); … … 379 379 } 380 380 381 IntRect RenderSVGRoot::clippedOverflowRectForRepaint(RenderBoxModelObject* repaintContainer) const381 LayoutRect RenderSVGRoot::clippedOverflowRectForRepaint(RenderBoxModelObject* repaintContainer) const 382 382 { 383 383 return SVGRenderSupport::clippedOverflowRectForRepaint(this, repaintContainer); 384 384 } 385 385 386 void RenderSVGRoot::computeRectForRepaint(RenderBoxModelObject* repaintContainer, IntRect& repaintRect, bool fixed) const386 void RenderSVGRoot::computeRectForRepaint(RenderBoxModelObject* repaintContainer, LayoutRect& repaintRect, bool fixed) const 387 387 { 388 388 // Apply our local transforms (except for x/y translation), then our shadow, … … 391 391 392 392 // Apply initial viewport clip - not affected by overflow settings 393 repaintRect.intersect(enclosing IntRect(FloatRect(FloatPoint(), m_viewportSize)));393 repaintRect.intersect(enclosingLayoutRect(FloatRect(FloatPoint(), m_viewportSize))); 394 394 395 395 const SVGRenderStyle* svgStyle = style()->svgStyle(); -
trunk/Source/WebCore/rendering/svg/RenderSVGRoot.h
r92545 r93050 88 88 virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const LayoutPoint& pointInContainer, const LayoutPoint& accumulatedOffset, HitTestAction); 89 89 90 virtual IntRect clippedOverflowRectForRepaint(RenderBoxModelObject* repaintContainer) const;91 virtual void computeRectForRepaint(RenderBoxModelObject* repaintContainer, IntRect& repaintRect, bool fixed) const;90 virtual LayoutRect clippedOverflowRectForRepaint(RenderBoxModelObject* repaintContainer) const; 91 virtual void computeRectForRepaint(RenderBoxModelObject* repaintContainer, LayoutRect& repaintRect, bool fixed) const; 92 92 93 93 virtual void mapLocalToContainer(RenderBoxModelObject* repaintContainer, bool useTransforms, bool fixed, TransformState&, bool* wasFixed = 0) const; … … 98 98 void updateCachedBoundaries(); 99 99 100 IntSize parentOriginToBorderBox() const;101 IntSize borderOriginToContentBox() const;102 AffineTransform localToRepaintContainerTransform(const IntPoint& parentOriginInContainer) const;100 LayoutSize parentOriginToBorderBox() const; 101 LayoutSize borderOriginToContentBox() const; 102 AffineTransform localToRepaintContainerTransform(const LayoutPoint& parentOriginInContainer) const; 103 103 AffineTransform localToBorderBoxTransform() const; 104 104 -
trunk/Source/WebCore/rendering/svg/RenderSVGText.cpp
r92438 r93050 230 230 } 231 231 232 void RenderSVGText::paint(PaintInfo& paintInfo, const IntPoint&)232 void RenderSVGText::paint(PaintInfo& paintInfo, const LayoutPoint&) 233 233 { 234 234 if (paintInfo.context->paintingDisabled()) -
trunk/Source/WebCore/rendering/svg/SVGInlineFlowBox.cpp
r90166 r93050 50 50 } 51 51 52 void SVGInlineFlowBox::paint(PaintInfo& paintInfo, const IntPoint&, int, int)52 void SVGInlineFlowBox::paint(PaintInfo& paintInfo, const LayoutPoint&, LayoutUnit, LayoutUnit) 53 53 { 54 54 ASSERT(paintInfo.phase == PaintPhaseForeground || paintInfo.phase == PaintPhaseSelection); … … 66 66 computeTextMatchMarkerRectForRenderer(toRenderSVGInlineText(static_cast<SVGInlineTextBox*>(child)->textRenderer())); 67 67 68 child->paint(childPaintInfo, IntPoint(), 0, 0);68 child->paint(childPaintInfo, LayoutPoint(), 0, 0); 69 69 } 70 70 } -
trunk/Source/WebCore/rendering/svg/SVGInlineTextBox.cpp
r92625 r93050 246 246 } 247 247 248 void SVGInlineTextBox::paint(PaintInfo& paintInfo, const IntPoint&, int, int)248 void SVGInlineTextBox::paint(PaintInfo& paintInfo, const LayoutPoint&, LayoutUnit, LayoutUnit) 249 249 { 250 250 ASSERT(paintInfo.shouldPaintWithinRoot(renderer())); -
trunk/Source/WebCore/rendering/svg/SVGRenderSupport.cpp
r92434 r93050 46 46 namespace WebCore { 47 47 48 IntRect SVGRenderSupport::clippedOverflowRectForRepaint(const RenderObject* object, RenderBoxModelObject* repaintContainer)48 LayoutRect SVGRenderSupport::clippedOverflowRectForRepaint(const RenderObject* object, RenderBoxModelObject* repaintContainer) 49 49 { 50 50 // Return early for any cases where we don't actually paint 51 51 if (object->style()->visibility() != VISIBLE && !object->enclosingLayer()->hasVisibleContent()) 52 return IntRect();52 return LayoutRect(); 53 53 54 54 // Pass our local paint rect to computeRectForRepaint() which will 55 55 // map to parent coords and recurse up the parent chain. 56 IntRect repaintRect = enclosingIntRect(object->repaintRectInLocalCoordinates());56 LayoutRect repaintRect = enclosingLayoutRect(object->repaintRectInLocalCoordinates()); 57 57 object->computeRectForRepaint(repaintContainer, repaintRect); 58 58 return repaintRect; 59 59 } 60 60 61 void SVGRenderSupport::computeRectForRepaint(const RenderObject* object, RenderBoxModelObject* repaintContainer, IntRect& repaintRect, bool fixed)61 void SVGRenderSupport::computeRectForRepaint(const RenderObject* object, RenderBoxModelObject* repaintContainer, LayoutRect& repaintRect, bool fixed) 62 62 { 63 63 const SVGRenderStyle* svgStyle = object->style()->svgStyle(); -
trunk/Source/WebCore/rendering/svg/SVGRenderSupport.h
r92434 r93050 62 62 63 63 // Important functions used by nearly all SVG renderers centralizing coordinate transformations / repaint rect calculations 64 static IntRect clippedOverflowRectForRepaint(const RenderObject*, RenderBoxModelObject* repaintContainer);65 static void computeRectForRepaint(const RenderObject*, RenderBoxModelObject* repaintContainer, IntRect&, bool fixed);64 static LayoutRect clippedOverflowRectForRepaint(const RenderObject*, RenderBoxModelObject* repaintContainer); 65 static void computeRectForRepaint(const RenderObject*, RenderBoxModelObject* repaintContainer, LayoutRect&, bool fixed); 66 66 static void mapLocalToContainer(const RenderObject*, RenderBoxModelObject* repaintContainer, bool useTransforms, bool fixed, TransformState&, bool* wasFixed = 0); 67 67 -
trunk/Source/WebCore/rendering/svg/SVGRootInlineBox.cpp
r89183 r93050 37 37 namespace WebCore { 38 38 39 void SVGRootInlineBox::paint(PaintInfo& paintInfo, const IntPoint&, int, int)39 void SVGRootInlineBox::paint(PaintInfo& paintInfo, const LayoutPoint&, LayoutUnit, LayoutUnit) 40 40 { 41 41 ASSERT(paintInfo.phase == PaintPhaseForeground || paintInfo.phase == PaintPhaseSelection); … … 65 65 SVGInlineFlowBox::computeTextMatchMarkerRectForRenderer(toRenderSVGInlineText(static_cast<SVGInlineTextBox*>(child)->textRenderer())); 66 66 67 child->paint(childPaintInfo, IntPoint(), 0, 0);67 child->paint(childPaintInfo, LayoutPoint(), 0, 0); 68 68 } 69 69 } … … 93 93 // Perform SVG text layout phase four 94 94 // Position & resize all SVGInlineText/FlowBoxes in the inline box tree, resize the root box as well as the RenderSVGText parent block. 95 IntRect childRect;95 LayoutRect childRect; 96 96 layoutChildBoxes(this, &childRect); 97 97 layoutRootBox(childRect); … … 137 137 } 138 138 139 void SVGRootInlineBox::layoutChildBoxes(InlineFlowBox* start, IntRect* childRect)139 void SVGRootInlineBox::layoutChildBoxes(InlineFlowBox* start, LayoutRect* childRect) 140 140 { 141 141 for (InlineBox* child = start->firstChild(); child; child = child->nextOnLine()) { 142 IntRect boxRect;142 LayoutRect boxRect; 143 143 if (child->isSVGInlineTextBox()) { 144 144 ASSERT(child->renderer()); … … 172 172 } 173 173 174 void SVGRootInlineBox::layoutRootBox(const IntRect& childRect)174 void SVGRootInlineBox::layoutRootBox(const LayoutRect& childRect) 175 175 { 176 176 RenderBlock* parentBlock = block(); 177 177 ASSERT(parentBlock); 178 178 179 int widthBlock = childRect.width();180 int heightBlock = childRect.height();179 LayoutUnit widthBlock = childRect.width(); 180 LayoutUnit heightBlock = childRect.height(); 181 181 182 182 // Finally, assign the root block position, now that all content is laid out. … … 201 201 } 202 202 203 InlineBox* SVGRootInlineBox::closestLeafChildForPosition(const IntPoint& point)203 InlineBox* SVGRootInlineBox::closestLeafChildForPosition(const LayoutPoint& point) 204 204 { 205 205 InlineBox* firstLeaf = firstLeafChild(); -
trunk/Source/WebCore/rendering/svg/SVGRootInlineBox.h
r90791 r93050 53 53 virtual FloatRect repaintRectInLocalCoordinates() const { return FloatRect(); } 54 54 55 InlineBox* closestLeafChildForPosition(const IntPoint&);55 InlineBox* closestLeafChildForPosition(const LayoutPoint&); 56 56 57 57 private: 58 58 void reorderValueLists(Vector<SVGTextLayoutAttributes>&); 59 59 void layoutCharactersInTextBoxes(InlineFlowBox*, SVGTextLayoutEngine&); 60 void layoutChildBoxes(InlineFlowBox*, IntRect* = 0);61 void layoutRootBox(const IntRect&);60 void layoutChildBoxes(InlineFlowBox*, LayoutRect* = 0); 61 void layoutRootBox(const LayoutRect&); 62 62 63 63 private:
Note:
See TracChangeset
for help on using the changeset viewer.