[SCM] WebKit Debian packaging branch, webkit-1.3, updated. upstream/1.3.7-4207-g178b198
weinig at apple.com
weinig at apple.com
Mon Feb 21 00:20:12 UTC 2011
The following commit has been merged in the webkit-1.3 branch:
commit 9e84c4e3b0b715fecc2be843253d7a3b194c2d03
Author: weinig at apple.com <weinig at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Sat Jan 29 22:19:01 2011 +0000
Fix 32-bit build on the Mac.
Reviewed by Jon Honeycutt.
* platform/mac/ScrollAnimatorMac.mm:
(WebCore::roundTowardZero):
(WebCore::roundToDevicePixelTowardZero):
Use floats instead of doubles to avoid double-to-float conversion
issues.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@77071 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog
index 13cfc9b..d0a6da7 100644
--- a/Source/WebCore/ChangeLog
+++ b/Source/WebCore/ChangeLog
@@ -1,4 +1,16 @@
-2011-01-28 Simon Fraser <simon.fraser at apple.com>
+2011-01-29 Sam Weinig <sam at webkit.org>
+
+ Reviewed by Jon Honeycutt.
+
+ Fix 32-bit build on the Mac.
+
+ * platform/mac/ScrollAnimatorMac.mm:
+ (WebCore::roundTowardZero):
+ (WebCore::roundToDevicePixelTowardZero):
+ Use floats instead of doubles to avoid double-to-float conversion
+ issues.
+
+2011-01-29 Simon Fraser <simon.fraser at apple.com>
Reviewed by Adam Barth.
diff --git a/Source/WebCore/platform/mac/ScrollAnimatorMac.mm b/Source/WebCore/platform/mac/ScrollAnimatorMac.mm
index d0ea5f4..622fe12 100644
--- a/Source/WebCore/platform/mac/ScrollAnimatorMac.mm
+++ b/Source/WebCore/platform/mac/ScrollAnimatorMac.mm
@@ -212,18 +212,18 @@ void ScrollAnimatorMac::immediateScrollByDeltaY(float deltaY)
#if ENABLE(RUBBER_BANDING)
-static const double scrollVelocityZeroingTimeout = 0.10;
-static const double rubberbandStiffness = 20.0;
-static const double rubberbandDirectionLockStretchRatio = 1.0;
-static const double rubberbandMinimumRequiredDeltaBeforeStretch = 10.0;
-static const double rubberbandAmplitude = 0.31;
-static const double rubberbandPeriod = 1.6;
+static const float scrollVelocityZeroingTimeout = 0.10f;
+static const float rubberbandStiffness = 20.0f;
+static const float rubberbandDirectionLockStretchRatio = 1.0f;
+static const float rubberbandMinimumRequiredDeltaBeforeStretch = 10.0f;
+static const float rubberbandAmplitude = 0.31f;
+static const float rubberbandPeriod = 1.6f;
static float elasticDeltaForTimeDelta(float initialPosition, float initialVelocity, float elapsedTime)
{
float amplitude = rubberbandAmplitude;
float period = rubberbandPeriod;
- float criticalDampeningFactor = exp((-elapsedTime * rubberbandStiffness) / period);
+ float criticalDampeningFactor = expf((-elapsedTime * rubberbandStiffness) / period);
return (initialPosition + (-initialVelocity * elapsedTime * amplitude)) * criticalDampeningFactor;
}
@@ -456,7 +456,7 @@ void ScrollAnimatorMac::smoothScrollWithEvent(PlatformWheelEvent& wheelEvent)
m_stretchScrollForce.setWidth(m_stretchScrollForce.width() + deltaX);
m_stretchScrollForce.setHeight(m_stretchScrollForce.height() + deltaY);
- FloatSize dampedDelta(ceil(elasticDeltaForReboundDelta(m_stretchScrollForce.width())), ceil(elasticDeltaForReboundDelta(m_stretchScrollForce.height())));
+ FloatSize dampedDelta(ceilf(elasticDeltaForReboundDelta(m_stretchScrollForce.width())), ceilf(elasticDeltaForReboundDelta(m_stretchScrollForce.height())));
FloatPoint origOrigin = m_scrollableArea->visibleContentRect().location() - stretchAmount;
FloatPoint newOrigin = origOrigin + dampedDelta;
@@ -517,17 +517,16 @@ void ScrollAnimatorMac::snapRubberBand()
m_snapRubberBandTimer.startRepeating(1.0/60.0);
}
-static inline double roundTowardZero(double num)
+static inline float roundTowardZero(float num)
{
- return num > 0.0 ? ceil(num - 0.5) : floor(num + 0.5);
+ return num > 0.0 ? ceilf(num - 0.5) : floorf(num + 0.5);
}
-static inline double roundToDevicePixelTowardZero(double num)
+static inline float roundToDevicePixelTowardZero(float num)
{
- double roundedNum = round(num);
- if (fabs(num - roundedNum) < 0.125) {
+ float roundedNum = roundf(num);
+ if (fabs(num - roundedNum) < 0.125)
num = roundedNum;
- }
return roundTowardZero(num);
}
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list