Title: [110995] trunk/Source/WebCore
- Revision
- 110995
- Author
- kenn...@webkit.org
- Date
- 2012-03-16 06:00:57 -0700 (Fri, 16 Mar 2012)
Log Message
Use the normalize method of FloatPoint instead of normalizing manually
https://bugs.webkit.org/show_bug.cgi?id=81343
Reviewed by Simon Hausmann.
* platform/graphics/TiledBackingStore.cpp:
(WebCore::TiledBackingStore::coverWithTilesIfNeeded):
(WebCore::TiledBackingStore::computeCoverAndKeepRect):
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (110994 => 110995)
--- trunk/Source/WebCore/ChangeLog 2012-03-16 12:50:01 UTC (rev 110994)
+++ trunk/Source/WebCore/ChangeLog 2012-03-16 13:00:57 UTC (rev 110995)
@@ -1,3 +1,14 @@
+2012-03-16 Kenneth Rohde Christiansen <kenn...@webkit.org>
+
+ Use the normalize method of FloatPoint instead of normalizing manually
+ https://bugs.webkit.org/show_bug.cgi?id=81343
+
+ Reviewed by Simon Hausmann.
+
+ * platform/graphics/TiledBackingStore.cpp:
+ (WebCore::TiledBackingStore::coverWithTilesIfNeeded):
+ (WebCore::TiledBackingStore::computeCoverAndKeepRect):
+
2012-03-16 Kentaro Hara <hara...@chromium.org>
Move Notifications APIs from DOMWindow.idl to DOMWindowNotifications.idl
Modified: trunk/Source/WebCore/platform/graphics/TiledBackingStore.cpp (110994 => 110995)
--- trunk/Source/WebCore/platform/graphics/TiledBackingStore.cpp 2012-03-16 12:50:01 UTC (rev 110994)
+++ trunk/Source/WebCore/platform/graphics/TiledBackingStore.cpp 2012-03-16 13:00:57 UTC (rev 110995)
@@ -69,10 +69,14 @@
void TiledBackingStore::coverWithTilesIfNeeded(const FloatPoint& trajectoryVector)
{
IntRect visibleRect = this->visibleRect();
- if (m_trajectoryVector == trajectoryVector && m_visibleRect == visibleRect)
+
+ FloatPoint normalizedVector = trajectoryVector;
+ normalizedVector.normalize();
+
+ if (m_trajectoryVector == normalizedVector && m_visibleRect == visibleRect)
return;
- m_trajectoryVector = trajectoryVector;
+ m_trajectoryVector = normalizedVector;
m_visibleRect = visibleRect;
startBackingStoreUpdateTimer();
@@ -340,8 +344,7 @@
coverRect.inflateY(visibleRect.height() * (m_coverAreaMultiplier - 1) / 2);
keepRect = coverRect;
- float trajectoryVectorNorm = sqrt(pow(m_trajectoryVector.x(), 2) + pow(m_trajectoryVector.y(), 2));
- if (trajectoryVectorNorm) {
+ if (m_trajectoryVector == FloatPoint::zero()) {
// A null trajectory vector (no motion) means that tiles for the coverArea will be created.
// A non-null trajectory vector will shrink the covered rect to visibleRect plus its expansion from its
// center toward the cover area edges in the direction of the given vector.
@@ -356,8 +359,8 @@
// Unite the visible rect with a "ghost" of the visible rect moved in the direction of the trajectory vector.
coverRect = visibleRect;
- coverRect.move(coverRect.width() * m_trajectoryVector.x() / trajectoryVectorNorm * trajectoryVectorMultiplier,
- coverRect.height() * m_trajectoryVector.y() / trajectoryVectorNorm * trajectoryVectorMultiplier);
+ coverRect.move(coverRect.width() * m_trajectoryVector.x() * trajectoryVectorMultiplier,
+ coverRect.height() * m_trajectoryVector.y() * trajectoryVectorMultiplier);
coverRect.unite(visibleRect);
}
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes