[Qt] Delay viewport position, scale and contents size updates until tiles are rendered
[WebKit-https.git] / Source / WebKit2 / UIProcess / PageViewportController.h
index d7fb3a0..2b94cea 100644 (file)
@@ -74,10 +74,9 @@ public:
     void suspendContent();
     void resumeContent();
 
-    WebCore::FloatRect positionRangeForViewportAtScale(float viewportScale) const;
-
     float innerBoundedViewportScale(float) const;
     float outerBoundedViewportScale(float) const;
+    WebCore::FloatPoint clampViewportToContents(const WebCore::FloatPoint& viewportPos, float viewportScale);
 
     bool hasSuspendedContent() const { return m_hasSuspendedContent; }
     bool hadUserInteraction() const { return m_hadUserInteraction; }
@@ -96,14 +95,19 @@ public:
     void didChangeContentsVisibility(const WebCore::FloatPoint& viewportPos, float viewportScale, const WebCore::FloatPoint& trajectoryVector = WebCore::FloatPoint::zero());
 
     // Notifications from the WebProcess.
+    void didCommitLoad();
     void didChangeContentsSize(const WebCore::IntSize& newSize);
     void didChangeViewportAttributes(const WebCore::ViewportAttributes&);
+    void didRenderFrame(const WebCore::IntSize& contentsSize);
+    void pageTransitionViewportReady();
     void pageDidRequestScroll(const WebCore::IntPoint& cssPosition);
 
 private:
     float fromViewportScale(float scale) const { return scale / devicePixelRatio(); }
     float toViewportScale(float scale) const { return scale * devicePixelRatio(); }
     void syncVisibleContents(const WebCore::FloatPoint &trajectoryVector = WebCore::FloatPoint::zero());
+    void applyScaleAfterRenderingContents(float scale);
+    void applyPositionAfterRenderingContents(const WebCore::FloatPoint& pos);
     void updateMinimumScaleToFit();
 
     WebPageProxy* const m_webPageProxy;
@@ -123,11 +127,13 @@ private:
     WebCore::FloatSize m_contentsSize;
     float m_effectiveScale; // Should always be cssScale * devicePixelRatio.
 
+    bool m_viewportPosIsLocked;
+    bool m_effectiveScaleIsLocked;
+
     friend class ViewportUpdateDeferrer;
 };
 
 bool fuzzyCompare(float, float, float epsilon);
-WebCore::FloatPoint boundPosition(const WebCore::FloatPoint minPosition, const WebCore::FloatPoint& position, const WebCore::FloatPoint& maxPosition);
 
 } // namespace WebKit