- Revision
- 168233
- Author
- benja...@webkit.org
- Date
- 2014-05-03 18:48:37 -0700 (Sat, 03 May 2014)
Log Message
[iOS][WK2] Support disabling speculative tiling
https://bugs.webkit.org/show_bug.cgi?id=132512
Reviewed by Tim Horton.
Move ScrollView::setScrollVelocity() and ScrollView::computeCoverageRect() to FrameView.
When speculative tiling is disabled, return an unmodified exposed rect.
Time/velocity adjusments are completely unnecessary at the moment since speculative tiling
is enabled as soon as the view scrolls.
* WebCore.exp.in:
* page/FrameView.cpp:
(WebCore::FrameView::setScrollVelocity):
(WebCore::FrameView::computeCoverageRect):
* page/FrameView.h:
* platform/ScrollView.h:
* platform/ios/ScrollViewIOS.mm:
(WebCore::ScrollView::setScrollVelocity): Deleted.
(WebCore::ScrollView::computeCoverageRect): Deleted.
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (168232 => 168233)
--- trunk/Source/WebCore/ChangeLog 2014-05-04 00:17:11 UTC (rev 168232)
+++ trunk/Source/WebCore/ChangeLog 2014-05-04 01:48:37 UTC (rev 168233)
@@ -1,3 +1,26 @@
+2014-05-03 Benjamin Poulain <benja...@webkit.org>
+
+ [iOS][WK2] Support disabling speculative tiling
+ https://bugs.webkit.org/show_bug.cgi?id=132512
+
+ Reviewed by Tim Horton.
+
+ Move ScrollView::setScrollVelocity() and ScrollView::computeCoverageRect() to FrameView.
+ When speculative tiling is disabled, return an unmodified exposed rect.
+
+ Time/velocity adjusments are completely unnecessary at the moment since speculative tiling
+ is enabled as soon as the view scrolls.
+
+ * WebCore.exp.in:
+ * page/FrameView.cpp:
+ (WebCore::FrameView::setScrollVelocity):
+ (WebCore::FrameView::computeCoverageRect):
+ * page/FrameView.h:
+ * platform/ScrollView.h:
+ * platform/ios/ScrollViewIOS.mm:
+ (WebCore::ScrollView::setScrollVelocity): Deleted.
+ (WebCore::ScrollView::computeCoverageRect): Deleted.
+
2014-05-02 Pratik Solanki <psola...@apple.com>
Shortcircuit shouldUseCredentialStorage callback
Modified: trunk/Source/WebCore/WebCore.exp.in (168232 => 168233)
--- trunk/Source/WebCore/WebCore.exp.in 2014-05-04 00:17:11 UTC (rev 168232)
+++ trunk/Source/WebCore/WebCore.exp.in 2014-05-04 01:48:37 UTC (rev 168233)
@@ -2438,8 +2438,8 @@
_WebUIApplicationDidBecomeActiveNotification
_WebUIApplicationWillEnterForegroundNotification
_WebUIApplicationWillResignActiveNotification
+__ZN7WebCore9FrameView17setScrollVelocityEdddd
__ZN7WebCore10ScrollView15setScrollOffsetERKNS_8IntPointE
-__ZN7WebCore10ScrollView17setScrollVelocityEdddd
__ZN7WebCore10ScrollView21setExposedContentRectERKNS_7IntRectE
__ZN7WebCore10ScrollView24setUnobscuredContentRectERKNS_7IntRectE
__ZN7WebCore10XLinkNames4initEv
Modified: trunk/Source/WebCore/page/FrameView.cpp (168232 => 168233)
--- trunk/Source/WebCore/page/FrameView.cpp 2014-05-04 00:17:11 UTC (rev 168232)
+++ trunk/Source/WebCore/page/FrameView.cpp 2014-05-04 01:48:37 UTC (rev 168233)
@@ -4107,6 +4107,58 @@
}
return false;
}
+
+void FrameView::setScrollVelocity(double horizontalVelocity, double verticalVelocity, double scaleChangeRate, double timestamp)
+{
+ m_horizontalVelocity = horizontalVelocity;
+ m_verticalVelocity = verticalVelocity;
+ m_scaleChangeRate = scaleChangeRate;
+ m_lastVelocityUpdateTime = timestamp;
+}
+
+FloatRect FrameView::computeCoverageRect(double horizontalMargin, double verticalMargin) const
+{
+ FloatRect exposedContentRect = this->exposedContentRect();
+ if (!m_speculativeTilingEnabled)
+ return exposedContentRect;
+
+ double currentTime = monotonicallyIncreasingTime();
+ double timeDelta = currentTime - m_lastVelocityUpdateTime;
+
+ FloatRect futureRect = exposedContentRect;
+ futureRect.setLocation(FloatPoint(futureRect.location().x() + timeDelta * m_horizontalVelocity, futureRect.location().y() + timeDelta * m_verticalVelocity));
+
+ if (m_horizontalVelocity) {
+ futureRect.setWidth(futureRect.width() + horizontalMargin);
+ if (m_horizontalVelocity < 0)
+ futureRect.setX(futureRect.x() - horizontalMargin);
+ }
+
+ if (m_verticalVelocity) {
+ futureRect.setHeight(futureRect.height() + verticalMargin);
+ if (m_verticalVelocity < 0)
+ futureRect.setY(futureRect.y() - verticalMargin);
+ }
+
+ if (m_scaleChangeRate <= 0 && !m_horizontalVelocity && !m_verticalVelocity) {
+ futureRect.setWidth(futureRect.width() + horizontalMargin);
+ futureRect.setHeight(futureRect.height() + verticalMargin);
+ futureRect.setX(futureRect.x() - horizontalMargin / 2);
+ futureRect.setY(futureRect.y() - verticalMargin / 2);
+ }
+
+ IntSize contentSize = contentsSize();
+ if (futureRect.maxX() > contentSize.width())
+ futureRect.setX(contentSize.width() - futureRect.width());
+ if (futureRect.maxY() > contentSize.height())
+ futureRect.setY(contentSize.height() - futureRect.height());
+ if (futureRect.x() < 0)
+ futureRect.setX(0);
+ if (futureRect.y() < 0)
+ futureRect.setY(0);
+
+ return futureRect;
+}
#endif // PLATFORM(IOS)
void FrameView::setScrollingPerformanceLoggingEnabled(bool flag)
Modified: trunk/Source/WebCore/page/FrameView.h (168232 => 168233)
--- trunk/Source/WebCore/page/FrameView.h 2014-05-04 00:17:11 UTC (rev 168232)
+++ trunk/Source/WebCore/page/FrameView.h 2014-05-04 01:48:37 UTC (rev 168233)
@@ -129,6 +129,9 @@
IntRect customFixedPositionLayoutRect() const { return m_customFixedPositionLayoutRect; }
void setCustomFixedPositionLayoutRect(const IntRect&);
bool updateFixedPositionLayoutRect();
+
+ void setScrollVelocity(double horizontalVelocity, double verticalVelocity, double scaleChangeRate, double timestamp);
+ FloatRect computeCoverageRect(double horizontalMargin, double verticalMargin) const;
#else
bool useCustomFixedPositionLayoutRect() const { return false; }
#endif
@@ -684,6 +687,11 @@
#if PLATFORM(IOS)
bool m_useCustomFixedPositionLayoutRect;
IntRect m_customFixedPositionLayoutRect;
+
+ double m_horizontalVelocity;
+ double m_verticalVelocity;
+ double m_scaleChangeRate;
+ double m_lastVelocityUpdateTime;
#endif
IntSize m_overrideViewportSize;
Modified: trunk/Source/WebCore/platform/ScrollView.h (168232 => 168233)
--- trunk/Source/WebCore/platform/ScrollView.h 2014-05-04 00:17:11 UTC (rev 168232)
+++ trunk/Source/WebCore/platform/ScrollView.h 2014-05-04 01:48:37 UTC (rev 168233)
@@ -188,9 +188,6 @@
void setExposedContentRect(const IntRect&);
void setUnobscuredContentRect(const IntRect&);
- void setScrollVelocity(double horizontalVelocity, double verticalVelocity, double scaleChangeRate, double timestamp);
- FloatRect computeCoverageRect(double horizontalMargin, double verticalMargin) const;
-
void setActualScrollPosition(const IntPoint&);
LegacyTileCache* legacyTileCache();
#endif
@@ -423,11 +420,6 @@
#if PLATFORM(IOS)
IntRect m_exposedContentRect;
IntRect m_unobscuredContentRect;
-
- double m_horizontalVelocity;
- double m_verticalVelocity;
- double m_scaleChangeRate;
- double m_lastVelocityUpdateTime;
#else
IntRect m_fixedVisibleContentRect;
#endif
Modified: trunk/Source/WebCore/platform/ios/ScrollViewIOS.mm (168232 => 168233)
--- trunk/Source/WebCore/platform/ios/ScrollViewIOS.mm 2014-05-04 00:17:11 UTC (rev 168232)
+++ trunk/Source/WebCore/platform/ios/ScrollViewIOS.mm 2014-05-04 01:48:37 UTC (rev 168233)
@@ -119,56 +119,6 @@
m_unobscuredContentRect = rect;
}
-void ScrollView::setScrollVelocity(double horizontalVelocity, double verticalVelocity, double scaleChangeRate, double timestamp)
-{
- m_horizontalVelocity = horizontalVelocity;
- m_verticalVelocity = verticalVelocity;
- m_scaleChangeRate = scaleChangeRate;
- m_lastVelocityUpdateTime = timestamp;
-}
-
-FloatRect ScrollView::computeCoverageRect(double horizontalMargin, double verticalMargin) const
-{
- FloatRect exposedContentRect = this->exposedContentRect();
-
- double currentTime = monotonicallyIncreasingTime();
- double timeDelta = currentTime - m_lastVelocityUpdateTime;
-
- FloatRect futureRect = exposedContentRect;
- futureRect.setLocation(FloatPoint(futureRect.location().x() + timeDelta * m_horizontalVelocity, futureRect.location().y() + timeDelta * m_verticalVelocity));
-
- if (m_horizontalVelocity) {
- futureRect.setWidth(futureRect.width() + horizontalMargin);
- if (m_horizontalVelocity < 0)
- futureRect.setX(futureRect.x() - horizontalMargin);
- }
-
- if (m_verticalVelocity) {
- futureRect.setHeight(futureRect.height() + verticalMargin);
- if (m_verticalVelocity < 0)
- futureRect.setY(futureRect.y() - verticalMargin);
- }
-
- if (m_scaleChangeRate <= 0 && !m_horizontalVelocity && !m_verticalVelocity) {
- futureRect.setWidth(futureRect.width() + horizontalMargin);
- futureRect.setHeight(futureRect.height() + verticalMargin);
- futureRect.setX(futureRect.x() - horizontalMargin / 2);
- futureRect.setY(futureRect.y() - verticalMargin / 2);
- }
-
- IntSize contentSize = contentsSize();
- if (futureRect.maxX() > contentSize.width())
- futureRect.setX(contentSize.width() - futureRect.width());
- if (futureRect.maxY() > contentSize.height())
- futureRect.setY(contentSize.height() - futureRect.height());
- if (futureRect.x() < 0)
- futureRect.setX(0);
- if (futureRect.y() < 0)
- futureRect.setY(0);
-
- return futureRect;
-}
-
IntRect ScrollView::exposedContentRect() const
{
if (NSScrollView *view = static_cast<NSScrollView *>(platformWidget())) {