Changeset 129005 in webkit
- Timestamp:
- Sep 19, 2012 7:42:52 AM (12 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r129003 r129005 1 2012-09-19 Patrick Gansterer <paroga@webkit.org> 2 3 Remove all usages of M_PI from WebCore 4 https://bugs.webkit.org/show_bug.cgi?id=93109 5 6 Reviewed by Dirk Schulze. 7 8 <wtf/MathExtras.h> implements many functions dealing with M_PI. 9 Use them in WebCore instead of duplicating the functionality. 10 11 * platform/blackberry/PlatformTouchEventBlackBerry.cpp: 12 (WebCore::PlatformTouchEvent::PlatformTouchEvent): 13 * platform/graphics/ca/mac/PlatformCALayerMac.mm: 14 (PlatformCALayer::setFilters): 15 * platform/graphics/cairo/GraphicsContextCairo.cpp: 16 (WebCore::GraphicsContext::drawEllipse): 17 (WebCore::GraphicsContext::strokeArc): 18 * platform/graphics/wx/FontPlatformDataWxMac.mm: 19 * platform/mac/WebWindowAnimation.mm: 20 (-[WebWindowScaleAnimation currentValue]): 21 * platform/wx/wxcode/gdiplus/non-kerned-drawing.cpp: 22 (DegToRad): 23 (RadToDeg): 24 1 25 2012-09-10 Vsevolod Vlasov <vsevik@chromium.org> 2 26 -
trunk/Source/WebCore/platform/blackberry/PlatformTouchEventBlackBerry.cpp
r112792 r129005 23 23 #include "PlatformTouchEvent.h" 24 24 25 #if ENABLE(TOUCH_EVENTS) 26 25 27 #include <BlackBerryPlatformTouchEvent.h> 26 27 28 #include <wtf/CurrentTime.h> 28 29 #if ENABLE(TOUCH_EVENTS) 29 #include <wtf/MathExtras.h> 30 30 31 31 namespace WebCore { … … 67 67 BlackBerry::Platform::PinchGestureData* data = static_cast<BlackBerry::Platform::PinchGestureData*>(pinch.m_data); 68 68 if (data) { 69 m_rotation = data->m_angle * 180 / M_PI;69 m_rotation = rad2deg(data->m_angle); 70 70 m_scale = data->m_scale; 71 71 } -
trunk/Source/WebCore/platform/graphics/ca/mac/PlatformCALayerMac.mm
r122670 r129005 43 43 #import <QuartzCore/QuartzCore.h> 44 44 #import <wtf/CurrentTime.h> 45 #import <wtf/MathExtras.h> 45 46 #import <wtf/UnusedParam.h> 46 47 … … 756 757 757 758 // The CIHueAdjust value is in radians 758 [caFilter setValue:[NSNumber numberWithFloat: op->amount() * M_PI * 2 / 360] forKey:@"inputAngle"];759 [caFilter setValue:[NSNumber numberWithFloat:deg2rad(op->amount())] forKey:@"inputAngle"]; 759 760 [caFilter setName:filterName]; 760 761 [array.get() addObject:caFilter]; -
trunk/Source/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp
r128570 r129005 66 66 using namespace std; 67 67 68 #ifndef M_PI69 #define M_PI 3.1415926535897932384670 #endif71 72 68 namespace WebCore { 73 69 … … 354 350 cairo_translate(cr, rect.x() + xRadius, rect.y() + yRadius); 355 351 cairo_scale(cr, xRadius, yRadius); 356 cairo_arc(cr, 0., 0., 1., 0., 2 * M_PI);352 cairo_arc(cr, 0., 0., 1., 0., 2 * piFloat); 357 353 cairo_restore(cr); 358 354 … … 393 389 cairo_scale(cr, 1., scaleFactor); 394 390 395 cairo_arc_negative(cr, x + hRadius, (y + vRadius) * reverseScaleFactor, hRadius, -fa * M_PI/180, -falen * M_PI/180);391 cairo_arc_negative(cr, x + hRadius, (y + vRadius) * reverseScaleFactor, hRadius, deg2rad(-fa), deg2rad(-falen)); 396 392 397 393 if (w != h) -
trunk/Source/WebCore/platform/graphics/wx/FontPlatformDataWxMac.mm
r95901 r129005 30 30 #include "FontPlatformData.h" 31 31 32 #include <wtf/MathExtras.h> 32 33 #include <wx/defs.h> 33 34 #include <wx/font.h> … … 42 43 #if !wxCHECK_VERSION(2,9,0) || !wxOSX_USE_COCOA 43 44 44 static inline double DegToRad(double deg) 45 { 46 return (deg * M_PI) / 180.0; 47 } 48 49 static const NSAffineTransformStruct kSlantNSTransformStruct = { 1, 0, tan(DegToRad(11)), 1, 0, 0 }; 45 static const NSAffineTransformStruct kSlantNSTransformStruct = { 1, 0, tan(deg2rad(11)), 1, 0, 0 }; 50 46 51 47 NSFont* OSXCreateNSFont(const wxNativeFontInfo* info) -
trunk/Source/WebCore/platform/mac/WebWindowAnimation.mm
r115847 r129005 31 31 #import "WebCoreSystemInterface.h" 32 32 #import <wtf/Assertions.h> 33 #import <wtf/MathExtras.h> 33 34 #import <wtf/UnusedParam.h> 34 35 … … 102 103 - (float)currentValue 103 104 { 104 return narrowPrecisionToFloat(0.5 - 0.5 * cos( M_PI* (1 - [self currentProgress])));105 return narrowPrecisionToFloat(0.5 - 0.5 * cos(piDouble * (1 - [self currentProgress]))); 105 106 } 106 107 -
trunk/Source/WebCore/platform/wx/wxcode/gdiplus/non-kerned-drawing.cpp
r95901 r129005 30 30 #include "GraphicsContext.h" 31 31 #include "SimpleFontData.h" 32 32 #include <wtf/MathExtras.h> 33 33 #include <wx/defs.h> 34 34 … … 46 46 //----------------------------------------------------------------------------- 47 47 48 const double RAD2DEG = 180.0 / M_PI;48 const double RAD2DEG = 180.0 / piDouble; 49 49 50 50 //----------------------------------------------------------------------------- … … 55 55 static inline double dmax(double a, double b) { return a > b ? a : b; } 56 56 57 static inline double DegToRad(double deg) { return (deg * M_PI) / 180.0; }58 static inline double RadToDeg(double deg) { return (deg * 180.0) / M_PI; }57 static inline double DegToRad(double deg) { return deg2rad(deg); } 58 static inline double RadToDeg(double rad) { return rad2deg(rad); } 59 59 60 60 #include "wx/msw/private.h"
Note: See TracChangeset
for help on using the changeset viewer.