Changeset 163451 in webkit


Ignore:
Timestamp:
Feb 5, 2014, 9:34:59 AM (12 years ago)
Author:
zoltan@webkit.org
Message:

[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):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r163444 r163451  
     12014-02-05  Zoltan Horvath  <zoltan@webkit.org>
     2
     3        [CSS Shapes] Simplify BasicShapeInset::path
     4        https://bugs.webkit.org/show_bug.cgi?id=127920
     5
     6        Reviewed by David Hyatt.
     7
     8        I introduced a new static helper function called floatSizeForLengthSize
     9        in order to simplify BasicShapeInset::path method.
     10
     11        No new tests, no behavior change.
     12
     13        * rendering/style/BasicShapes.cpp:
     14        (WebCore::floatSizeForLengthSize): New helper function.
     15        (WebCore::BasicShapeInset::path):
     16
    1172014-02-05  Wojciech Bielawski  <w.bielawski@samsung.com>
    218
  • trunk/Source/WebCore/rendering/style/BasicShapes.cpp

    r163439 r163451  
    345345}
    346346
     347static FloatSize floatSizeForLengthSize(const LengthSize& lengthSize, const FloatRect& boundingBox)
     348{
     349    return FloatSize(floatValueForLength(lengthSize.width(), boundingBox.width()),
     350        floatValueForLength(lengthSize.height(), boundingBox.height()));
     351}
     352
    347353void BasicShapeInset::path(Path& path, const FloatRect& boundingBox)
    348354{
     
    357363            std::max<float>(boundingBox.height() - top - floatValueForLength(m_bottom, boundingBox.height()), 0)
    358364        ),
    359         FloatSize(
    360             floatValueForLength(m_topLeftRadius.width(), boundingBox.width()),
    361             floatValueForLength(m_topLeftRadius.height(), boundingBox.height())
    362         ),
    363         FloatSize(
    364             floatValueForLength(m_topRightRadius.width(), boundingBox.width()),
    365             floatValueForLength(m_topRightRadius.height(), boundingBox.height())
    366         ),
    367         FloatSize(
    368             floatValueForLength(m_bottomLeftRadius.width(), boundingBox.width()),
    369             floatValueForLength(m_bottomLeftRadius.height(), boundingBox.height())
    370         ),
    371         FloatSize(
    372             floatValueForLength(m_bottomRightRadius.width(), boundingBox.width()),
    373             floatValueForLength(m_bottomRightRadius.height(), boundingBox.height())
    374         )
     365        floatSizeForLengthSize(m_topLeftRadius, boundingBox),
     366        floatSizeForLengthSize(m_topRightRadius, boundingBox),
     367        floatSizeForLengthSize(m_bottomLeftRadius, boundingBox),
     368        floatSizeForLengthSize(m_bottomRightRadius, boundingBox)
    375369    );
    376370}
Note: See TracChangeset for help on using the changeset viewer.