Changeset 86272 in webkit
- Timestamp:
- May 11, 2011 2:33:01 PM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r86271 r86272 1 2011-05-11 Levi Weintraub <leviw@chromium.org> 2 3 Reviewed by Eric Seidel. 4 5 Switch RenderBoxModelObject::paintBorder to use IntRect instead of four ints 6 https://bugs.webkit.org/show_bug.cgi?id=60591 7 8 Switching RenderBoxModelObject::paintBorder to use IntRect instead of four ints representing a rect. 9 10 No new tests since there is no functionality change. 11 12 * rendering/InlineFlowBox.cpp: 13 (WebCore::InlineFlowBox::paintBoxDecorations): 14 * rendering/RenderBox.cpp: 15 (WebCore::RenderBox::paintBoxDecorationsWithSize): 16 * rendering/RenderBoxModelObject.cpp: 17 (WebCore::RenderBoxModelObject::paintBorder): 18 * rendering/RenderBoxModelObject.h: 19 * rendering/RenderFieldset.cpp: 20 (WebCore::RenderFieldset::paintBoxDecorations): 21 * rendering/RenderTable.cpp: 22 (WebCore::RenderTable::paintBoxDecorations): 23 * rendering/RenderTableCell.cpp: 24 (WebCore::RenderTableCell::paintBoxDecorations): 25 1 26 2011-05-11 Sheriff Bot <webkit.review.bot@gmail.com> 2 27 -
trunk/Source/WebCore/rendering/InlineFlowBox.cpp
r86188 r86272 1128 1128 // cases only a single call to draw is required. 1129 1129 if (!hasBorderImage || (!prevLineBox() && !nextLineBox())) 1130 boxModelObject()->paintBorder(context, tx, ty, w, h, renderer()->style(), BackgroundBleedNone, includeLogicalLeftEdge(), includeLogicalRightEdge());1130 boxModelObject()->paintBorder(context, IntRect(tx, ty, w, h), renderer()->style(), BackgroundBleedNone, includeLogicalLeftEdge(), includeLogicalRightEdge()); 1131 1131 else { 1132 1132 // We have a border image that spans multiple lines. … … 1151 1151 GraphicsContextStateSaver stateSaver(*context); 1152 1152 context->clip(IntRect(tx, ty, w, h)); 1153 boxModelObject()->paintBorder(context, stripX, stripY, stripWidth, stripHeight, renderer()->style());1153 boxModelObject()->paintBorder(context, IntRect(stripX, stripY, stripWidth, stripHeight), renderer()->style()); 1154 1154 } 1155 1155 } -
trunk/Source/WebCore/rendering/RenderBox.cpp
r86197 r86272 874 874 // The theme will tell us whether or not we should also paint the CSS border. 875 875 if ((!style()->hasAppearance() || (!themePainted && theme()->paintBorderOnly(this, paintInfo, IntRect(tx, ty, width, height)))) && style()->hasBorder()) 876 paintBorder(paintInfo.context, tx, ty, width, height, style(), bleedAvoidance);876 paintBorder(paintInfo.context, IntRect(tx, ty, width, height), style(), bleedAvoidance); 877 877 878 878 if (bleedAvoidance == BackgroundBleedUseTransparencyLayer) -
trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp
r86188 r86272 1347 1347 } 1348 1348 1349 void RenderBoxModelObject::paintBorder(GraphicsContext* graphicsContext, int tx, int ty, int w, int h,1350 const RenderStyle* style,BackgroundBleedAvoidance bleedAvoidance, bool includeLogicalLeftEdge, bool includeLogicalRightEdge)1349 void RenderBoxModelObject::paintBorder(GraphicsContext* graphicsContext, const IntRect& rect, const RenderStyle* style, 1350 BackgroundBleedAvoidance bleedAvoidance, bool includeLogicalLeftEdge, bool includeLogicalRightEdge) 1351 1351 { 1352 1352 // border-image is not affected by border-radius. 1353 if (paintNinePieceImage(graphicsContext, IntRect(tx, ty, w, h), style, style->borderImage()))1353 if (paintNinePieceImage(graphicsContext, rect, style, style->borderImage())) 1354 1354 return; 1355 1355 … … 1360 1360 getBorderEdgeInfo(edges, includeLogicalLeftEdge, includeLogicalRightEdge); 1361 1361 1362 IntRect borderRect(tx, ty, w, h); 1363 RoundedIntRect outerBorder = style->getRoundedBorderFor(borderRect, includeLogicalLeftEdge, includeLogicalRightEdge); 1364 RoundedIntRect innerBorder = style->getRoundedInnerBorderFor(borderRect, includeLogicalLeftEdge, includeLogicalRightEdge); 1362 RoundedIntRect outerBorder = style->getRoundedBorderFor(rect, includeLogicalLeftEdge, includeLogicalRightEdge); 1363 RoundedIntRect innerBorder = style->getRoundedInnerBorderFor(rect, includeLogicalLeftEdge, includeLogicalRightEdge); 1365 1364 1366 1365 const AffineTransform& currentCTM = graphicsContext->getCTM(); … … 1588 1587 } 1589 1588 #else 1590 void RenderBoxModelObject::paintBorder(GraphicsContext* graphicsContext, int tx, int ty, int w, int h,1591 const RenderStyle* style,BackgroundBleedAvoidance, bool includeLogicalLeftEdge, bool includeLogicalRightEdge)1589 void RenderBoxModelObject::paintBorder(GraphicsContext* graphicsContext, const IntRect& rect, const RenderStyle* style, 1590 BackgroundBleedAvoidance, bool includeLogicalLeftEdge, bool includeLogicalRightEdge) 1592 1591 { 1593 1592 // FIXME: This old version of paintBorder should be removed when all ports implement 1594 1593 // GraphicsContext::clipConvexPolygon()!! This should happen soon. 1595 if (paintNinePieceImage(graphicsContext, IntRect(tx, ty, w, h), style, style->borderImage()))1594 if (paintNinePieceImage(graphicsContext, rect, style, style->borderImage())) 1596 1595 return; 1597 1596 … … 1618 1617 1619 1618 1620 RoundedIntRect border( tx, ty, w, h);1619 RoundedIntRect border(rect); 1621 1620 1622 1621 GraphicsContextStateSaver stateSaver(*graphicsContext, false); … … 1647 1646 && (rightStyle == DOTTED || rightStyle == DASHED || rightStyle == SOLID || rightStyle == INSET)); 1648 1647 1649 int x = tx;1650 int x2 = tx + w;1648 int x = rect.x(); 1649 int x2 = rect.maxX(); 1651 1650 if (renderRadii) { 1652 1651 x += border.radii().topLeft().width(); … … 1654 1653 } 1655 1654 1656 drawLineForBoxSide(graphicsContext, x, ty, x2, ty+ style->borderTopWidth(), BSTop, topColor, topStyle,1655 drawLineForBoxSide(graphicsContext, x, rect.y(), x2, rect.y() + style->borderTopWidth(), BSTop, topColor, topStyle, 1657 1656 ignoreLeft ? 0 : style->borderLeftWidth(), ignoreRight ? 0 : style->borderRightWidth()); 1658 1657 1659 1658 if (renderRadii) { 1660 int leftY = ty;1659 int leftY = rect.y(); 1661 1660 1662 1661 // We make the arc double thick and let the clip rect take care of clipping the extra off. … … 1666 1665 1667 1666 if (border.radii().topLeft().width()) { 1668 int leftX = tx;1667 int leftX = rect.x(); 1669 1668 // The inner clip clips inside the arc. This is especially important for 1px borders. 1670 1669 bool applyLeftInnerClip = (style->borderLeftWidth() < border.radii().topLeft().width()) … … 1686 1685 1687 1686 if (border.radii().topRight().width()) { 1688 int rightX = tx + w- border.radii().topRight().width() * 2;1687 int rightX = rect.maxX() - border.radii().topRight().width() * 2; 1689 1688 bool applyRightInnerClip = (style->borderRightWidth() < border.radii().topRight().width()) 1690 1689 && (style->borderTopWidth() < border.radii().topRight().height()) … … 1720 1719 && (rightStyle == DOTTED || rightStyle == DASHED || rightStyle == SOLID || rightStyle == INSET)); 1721 1720 1722 int x = tx;1723 int x2 = tx + w;1721 int x = rect.x(); 1722 int x2 = rect.maxX(); 1724 1723 if (renderRadii) { 1725 1724 x += border.radii().bottomLeft().width(); … … 1727 1726 } 1728 1727 1729 drawLineForBoxSide(graphicsContext, x, ty + h - style->borderBottomWidth(), x2, ty + h, BSBottom, bottomColor, bottomStyle,1728 drawLineForBoxSide(graphicsContext, x, rect.maxY() - style->borderBottomWidth(), x2, rect.maxY(), BSBottom, bottomColor, bottomStyle, 1730 1729 ignoreLeft ? 0 : style->borderLeftWidth(), ignoreRight ? 0 : style->borderRightWidth()); 1731 1730 … … 1734 1733 1735 1734 if (border.radii().bottomLeft().width()) { 1736 int leftX = tx;1737 int leftY = ty + h- border.radii().bottomLeft().height() * 2;1735 int leftX = rect.x(); 1736 int leftY = rect.maxY() - border.radii().bottomLeft().height() * 2; 1738 1737 bool applyLeftInnerClip = (style->borderLeftWidth() < border.radii().bottomLeft().width()) 1739 1738 && (style->borderBottomWidth() < border.radii().bottomLeft().height()) … … 1759 1758 1760 1759 if (border.radii().bottomRight().width()) { 1761 int rightY = ty + h- border.radii().bottomRight().height() * 2;1762 int rightX = tx + w- border.radii().bottomRight().width() * 2;1760 int rightY = rect.maxY() - border.radii().bottomRight().height() * 2; 1761 int rightX = rect.maxX() - border.radii().bottomRight().width() * 2; 1763 1762 bool applyRightInnerClip = (style->borderRightWidth() < border.radii().bottomRight().width()) 1764 1763 && (style->borderBottomWidth() < border.radii().bottomRight().height()) … … 1789 1788 && (bottomStyle == DOTTED || bottomStyle == DASHED || bottomStyle == SOLID || bottomStyle == INSET)); 1790 1789 1791 int y = ty;1792 int y2 = ty + h;1790 int y = rect.y(); 1791 int y2 = rect.maxY(); 1793 1792 if (renderRadii) { 1794 1793 y += border.radii().topLeft().height(); … … 1796 1795 } 1797 1796 1798 drawLineForBoxSide(graphicsContext, tx, y, tx+ style->borderLeftWidth(), y2, BSLeft, leftColor, leftStyle,1797 drawLineForBoxSide(graphicsContext, rect.x(), y, rect.x() + style->borderLeftWidth(), y2, BSLeft, leftColor, leftStyle, 1799 1798 ignoreTop ? 0 : style->borderTopWidth(), ignoreBottom ? 0 : style->borderBottomWidth()); 1800 1799 1801 1800 if (renderRadii && (!upperLeftBorderStylesMatch || !lowerLeftBorderStylesMatch)) { 1802 int topX = tx;1801 int topX = rect.x(); 1803 1802 thickness = style->borderLeftWidth() * 2; 1804 1803 1805 1804 if (!upperLeftBorderStylesMatch && border.radii().topLeft().width()) { 1806 int topY = ty;1805 int topY = rect.y(); 1807 1806 bool applyTopInnerClip = (style->borderLeftWidth() < border.radii().topLeft().width()) 1808 1807 && (style->borderTopWidth() < border.radii().topLeft().height()) … … 1823 1822 1824 1823 if (!lowerLeftBorderStylesMatch && border.radii().bottomLeft().width()) { 1825 int bottomY = ty + h- border.radii().bottomLeft().height() * 2;1824 int bottomY = rect.maxY() - border.radii().bottomLeft().height() * 2; 1826 1825 bool applyBottomInnerClip = (style->borderLeftWidth() < border.radii().bottomLeft().width()) 1827 1826 && (style->borderBottomWidth() < border.radii().bottomLeft().height()) … … 1854 1853 && (bottomStyle == DOTTED || bottomStyle == DASHED || bottomStyle == SOLID || bottomStyle == INSET)); 1855 1854 1856 int y = ty;1857 int y2 = ty + h;1855 int y = rect.y(); 1856 int y2 = rect.maxY(); 1858 1857 if (renderRadii) { 1859 1858 y += border.radii().topRight().height(); … … 1861 1860 } 1862 1861 1863 drawLineForBoxSide(graphicsContext, tx + w - style->borderRightWidth(), y, tx + w, y2, BSRight, rightColor, rightStyle,1862 drawLineForBoxSide(graphicsContext, rect.maxX() - style->borderRightWidth(), y, rect.maxX(), y2, BSRight, rightColor, rightStyle, 1864 1863 ignoreTop ? 0 : style->borderTopWidth(), ignoreBottom ? 0 : style->borderBottomWidth()); 1865 1864 … … 1868 1867 1869 1868 if (!upperRightBorderStylesMatch && border.radii().topRight().width()) { 1870 int topX = tx + w- border.radii().topRight().width() * 2;1871 int topY = ty;1869 int topX = rect.maxX() - border.radii().topRight().width() * 2; 1870 int topY = rect.y(); 1872 1871 bool applyTopInnerClip = (style->borderRightWidth() < border.radii().topRight().width()) 1873 1872 && (style->borderTopWidth() < border.radii().topRight().height()) … … 1888 1887 1889 1888 if (!lowerRightBorderStylesMatch && border.radii().bottomRight().width()) { 1890 int bottomX = tx + w- border.radii().bottomRight().width() * 2;1891 int bottomY = ty + h- border.radii().bottomRight().height() * 2;1889 int bottomX = rect.maxX() - border.radii().bottomRight().width() * 2; 1890 int bottomY = rect.maxY() - border.radii().bottomRight().height() * 2; 1892 1891 bool applyBottomInnerClip = (style->borderRightWidth() < border.radii().bottomRight().width()) 1893 1892 && (style->borderBottomWidth() < border.radii().bottomRight().height()) -
trunk/Source/WebCore/rendering/RenderBoxModelObject.h
r86188 r86272 119 119 virtual void childBecameNonInline(RenderObject* /*child*/) { } 120 120 121 void paintBorder(GraphicsContext*, int tx, int ty, int w, int h, const RenderStyle*, BackgroundBleedAvoidance = BackgroundBleedNone, bool includeLogicalLeftEdge = true, bool includeLogicalRightEdge = true);121 void paintBorder(GraphicsContext*, const IntRect&, const RenderStyle*, BackgroundBleedAvoidance = BackgroundBleedNone, bool includeLogicalLeftEdge = true, bool includeLogicalRightEdge = true); 122 122 bool paintNinePieceImage(GraphicsContext*, const IntRect&, const RenderStyle*, const NinePieceImage&, CompositeOperator = CompositeSourceOver); 123 123 void paintBoxShadow(GraphicsContext*, int tx, int ty, int w, int h, const RenderStyle*, ShadowStyle, bool includeLogicalLeftEdge = true, bool includeLogicalRightEdge = true); -
trunk/Source/WebCore/rendering/RenderFieldset.cpp
r85256 r86272 168 168 } 169 169 170 paintBorder(paintInfo.context, tx, ty, w, h, style());170 paintBorder(paintInfo.context, IntRect(tx, ty, w, h), style()); 171 171 } 172 172 -
trunk/Source/WebCore/rendering/RenderTable.cpp
r86197 r86272 571 571 572 572 if (style()->hasBorder() && !collapseBorders()) 573 paintBorder(paintInfo.context, rect .x(), rect.y(), rect.width(), rect.height(), style());573 paintBorder(paintInfo.context, rect, style()); 574 574 } 575 575 -
trunk/Source/WebCore/rendering/RenderTableCell.cpp
r84504 r86272 1021 1021 return; 1022 1022 1023 paintBorder(paintInfo.context, tx, ty, w, h, style());1023 paintBorder(paintInfo.context, IntRect(tx, ty, w, h), style()); 1024 1024 } 1025 1025
Note: See TracChangeset
for help on using the changeset viewer.