Changeset 76463 in webkit


Ignore:
Timestamp:
Jan 23, 2011 8:24:25 AM (13 years ago)
Author:
andreas.kling@nokia.com
Message:

2011-01-23 Andreas Kling <kling@webkit.org>

Reviewed by Tor Arne Vestbø.

[Qt] Use rad2deg() from WTF instead of rolling our own.

  • platform/graphics/qt/GraphicsContextQt.cpp: (WebCore::GraphicsContext::rotate):
  • platform/graphics/qt/PathQt.cpp: (WebCore::Path::addArc):
Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r76462 r76463  
     12011-01-23  Andreas Kling  <kling@webkit.org>
     2
     3        Reviewed by Tor Arne Vestbø.
     4
     5        [Qt] Use rad2deg() from WTF instead of rolling our own.
     6
     7        * platform/graphics/qt/GraphicsContextQt.cpp:
     8        (WebCore::GraphicsContext::rotate):
     9        * platform/graphics/qt/PathQt.cpp:
     10        (WebCore::Path::addArc):
     11
    1122011-01-23  Kenneth Rohde Christiansen <kenneth@webkit.org>
    213
  • trunk/Source/WebCore/platform/graphics/qt/GraphicsContextQt.cpp

    r76415 r76463  
    6363#include <QStack>
    6464#include <QVector>
    65 
    66 #ifndef M_PI
    67 #define M_PI 3.14159265358979323846
    68 #endif
     65#include <wtf/MathExtras.h>
    6966
    7067namespace WebCore {
     
    11361133        return;
    11371134
    1138     m_data->p()->rotate(180 / M_PI*radians);
     1135    m_data->p()->rotate(rad2deg(radians));
    11391136}
    11401137
  • trunk/Source/WebCore/platform/graphics/qt/PathQt.cpp

    r71936 r76463  
    4040#include <QTransform>
    4141#include <QString>
     42#include <wtf/MathExtras.h>
    4243#include <wtf/OwnPtr.h>
    43 
    44 #define _USE_MATH_DEFINES
    45 #include <math.h>
    46 
    47 #ifndef M_PI
    48 #   define M_PI 3.14159265358979323846
    49 #endif
    5044
    5145namespace WebCore {
     
    264258}
    265259
    266 #define DEGREES(t) ((t) * 180.0 / M_PI)
    267260void Path::addArc(const FloatPoint& p, float r, float sar, float ear, bool anticlockwise)
    268261{
     
    281274    //end hack
    282275
    283     float sa = DEGREES(sar);
    284     float ea = DEGREES(ear);
     276    float sa = rad2deg(sar);
     277    float ea = rad2deg(ear);
    285278
    286279    double span = 0;
Note: See TracChangeset for help on using the changeset viewer.