Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1382)

Unified Diff: Source/core/rendering/style/RenderStyle.cpp

Issue 815933006: Change all uses of the RoundedRect class to use FloatRoundedRect instead. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/rendering/style/RenderStyle.h ('k') | Source/platform/blink_platform.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/style/RenderStyle.cpp
diff --git a/Source/core/rendering/style/RenderStyle.cpp b/Source/core/rendering/style/RenderStyle.cpp
index a59ae27816bb3bd8e11017af5d867cb98e8d052f..b3ef60a3d72d0a3ccb5377385dfb505e83b7a723 100644
--- a/Source/core/rendering/style/RenderStyle.cpp
+++ b/Source/core/rendering/style/RenderStyle.cpp
@@ -887,9 +887,9 @@ void RenderStyle::setBoxShadow(PassRefPtr<ShadowList> s)
rareNonInheritedData.access()->m_boxShadow = s;
}
-static RoundedRect::Radii calcRadiiFor(const BorderData& border, IntSize size)
+static FloatRoundedRect::Radii calcRadiiFor(const BorderData& border, LayoutSize size)
{
- return RoundedRect::Radii(
+ return FloatRoundedRect::Radii(
IntSize(valueForLength(border.topLeft().width(), size.width()),
valueForLength(border.topLeft().height(), size.height())),
IntSize(valueForLength(border.topRight().width(), size.width()),
@@ -917,19 +917,18 @@ short RenderStyle::verticalBorderSpacing() const { return inherited->vertical_bo
void RenderStyle::setHorizontalBorderSpacing(short v) { SET_VAR(inherited, horizontal_border_spacing, v); }
void RenderStyle::setVerticalBorderSpacing(short v) { SET_VAR(inherited, vertical_border_spacing, v); }
-RoundedRect RenderStyle::getRoundedBorderFor(const LayoutRect& borderRect, bool includeLogicalLeftEdge, bool includeLogicalRightEdge) const
+FloatRoundedRect RenderStyle::getRoundedBorderFor(const LayoutRect& borderRect, bool includeLogicalLeftEdge, bool includeLogicalRightEdge) const
{
- IntRect snappedBorderRect(pixelSnappedIntRect(borderRect));
- RoundedRect roundedRect(snappedBorderRect);
+ FloatRoundedRect roundedRect(pixelSnappedIntRect(borderRect));
if (hasBorderRadius()) {
- RoundedRect::Radii radii = calcRadiiFor(surround->border, snappedBorderRect.size());
+ FloatRoundedRect::Radii radii = calcRadiiFor(surround->border, borderRect.size());
radii.scale(calcBorderRadiiConstraintScaleFor(borderRect, radii));
roundedRect.includeLogicalEdges(radii, isHorizontalWritingMode(), includeLogicalLeftEdge, includeLogicalRightEdge);
}
return roundedRect;
}
-RoundedRect RenderStyle::getRoundedInnerBorderFor(const LayoutRect& borderRect, bool includeLogicalLeftEdge, bool includeLogicalRightEdge) const
+FloatRoundedRect RenderStyle::getRoundedInnerBorderFor(const LayoutRect& borderRect, bool includeLogicalLeftEdge, bool includeLogicalRightEdge) const
{
bool horizontal = isHorizontalWritingMode();
@@ -941,7 +940,7 @@ RoundedRect RenderStyle::getRoundedInnerBorderFor(const LayoutRect& borderRect,
return getRoundedInnerBorderFor(borderRect, topWidth, bottomWidth, leftWidth, rightWidth, includeLogicalLeftEdge, includeLogicalRightEdge);
}
-RoundedRect RenderStyle::getRoundedInnerBorderFor(const LayoutRect& borderRect,
+FloatRoundedRect RenderStyle::getRoundedInnerBorderFor(const LayoutRect& borderRect,
int topWidth, int bottomWidth, int leftWidth, int rightWidth, bool includeLogicalLeftEdge, bool includeLogicalRightEdge) const
{
LayoutRect innerRect(borderRect.x() + leftWidth,
@@ -949,10 +948,10 @@ RoundedRect RenderStyle::getRoundedInnerBorderFor(const LayoutRect& borderRect,
borderRect.width() - leftWidth - rightWidth,
borderRect.height() - topWidth - bottomWidth);
- RoundedRect roundedRect(pixelSnappedIntRect(innerRect));
+ FloatRoundedRect roundedRect(pixelSnappedIntRect(innerRect));
if (hasBorderRadius()) {
- RoundedRect::Radii radii = getRoundedBorderFor(borderRect).radii();
+ FloatRoundedRect::Radii radii = getRoundedBorderFor(borderRect).radii();
radii.shrink(topWidth, bottomWidth, leftWidth, rightWidth);
roundedRect.includeLogicalEdges(radii, isHorizontalWritingMode(), includeLogicalLeftEdge, includeLogicalRightEdge);
}
« no previous file with comments | « Source/core/rendering/style/RenderStyle.h ('k') | Source/platform/blink_platform.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698