Modified: trunk/Source/WebCore/ChangeLog (163450 => 163451)
--- trunk/Source/WebCore/ChangeLog 2014-02-05 17:31:47 UTC (rev 163450)
+++ trunk/Source/WebCore/ChangeLog 2014-02-05 17:34:59 UTC (rev 163451)
@@ -1,3 +1,19 @@
+2014-02-05 Zoltan Horvath <zol...@webkit.org>
+
+ [CSS Shapes] Simplify BasicShapeInset::path
+ https://bugs.webkit.org/show_bug.cgi?id=127920
+
+ Reviewed by David Hyatt.
+
+ I introduced a new static helper function called floatSizeForLengthSize
+ in order to simplify BasicShapeInset::path method.
+
+ No new tests, no behavior change.
+
+ * rendering/style/BasicShapes.cpp:
+ (WebCore::floatSizeForLengthSize): New helper function.
+ (WebCore::BasicShapeInset::path):
+
2014-02-05 Wojciech Bielawski <w.bielaw...@samsung.com>
XMLHttpRequest performs too many copies for ArrayBuffer results
Modified: trunk/Source/WebCore/rendering/style/BasicShapes.cpp (163450 => 163451)
--- trunk/Source/WebCore/rendering/style/BasicShapes.cpp 2014-02-05 17:31:47 UTC (rev 163450)
+++ trunk/Source/WebCore/rendering/style/BasicShapes.cpp 2014-02-05 17:34:59 UTC (rev 163451)
@@ -344,6 +344,12 @@
return result.release();
}
+static FloatSize floatSizeForLengthSize(const LengthSize& lengthSize, const FloatRect& boundingBox)
+{
+ return FloatSize(floatValueForLength(lengthSize.width(), boundingBox.width()),
+ floatValueForLength(lengthSize.height(), boundingBox.height()));
+}
+
void BasicShapeInset::path(Path& path, const FloatRect& boundingBox)
{
ASSERT(path.isEmpty());
@@ -356,22 +362,10 @@
std::max<float>(boundingBox.width() - left - floatValueForLength(m_right, boundingBox.width()), 0),
std::max<float>(boundingBox.height() - top - floatValueForLength(m_bottom, boundingBox.height()), 0)
),
- FloatSize(
- floatValueForLength(m_topLeftRadius.width(), boundingBox.width()),
- floatValueForLength(m_topLeftRadius.height(), boundingBox.height())
- ),
- FloatSize(
- floatValueForLength(m_topRightRadius.width(), boundingBox.width()),
- floatValueForLength(m_topRightRadius.height(), boundingBox.height())
- ),
- FloatSize(
- floatValueForLength(m_bottomLeftRadius.width(), boundingBox.width()),
- floatValueForLength(m_bottomLeftRadius.height(), boundingBox.height())
- ),
- FloatSize(
- floatValueForLength(m_bottomRightRadius.width(), boundingBox.width()),
- floatValueForLength(m_bottomRightRadius.height(), boundingBox.height())
- )
+ floatSizeForLengthSize(m_topLeftRadius, boundingBox),
+ floatSizeForLengthSize(m_topRightRadius, boundingBox),
+ floatSizeForLengthSize(m_bottomLeftRadius, boundingBox),
+ floatSizeForLengthSize(m_bottomRightRadius, boundingBox)
);
}