Source/WebKit2/ChangeLog

 12012-07-04 Andras Becsi <andras.becsi@nokia.com>
 2
 3 [Qt][WK2] Improve visible content rect update
 4 https://bugs.webkit.org/show_bug.cgi?id=90547
 5
 6 Reviewed by NOBODY (OOPS!).
 7
 8 Avoid the extra work of computing the visible rect multiple
 9 times within the notification function and set a correct
 10 fixed visible content rect during page load.
 11 Also make sure that notifications with a null trajectory
 12 vector reach the backing store since a null vector means
 13 that all tiles around the viewport were requested.
 14
 15 * UIProcess/qt/QtViewportHandler.cpp:
 16 (WebKit::ViewportUpdateDeferrer::~ViewportUpdateDeferrer):
 17 (WebKit::QtViewportHandler::informVisibleContentChange):
 18 (WebKit::QtViewportHandler::viewportItemSizeChanged):
 19 * UIProcess/qt/QtViewportHandler.h:
 20 (QtViewportHandler):
 21 * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
 22 (WebKit::WebFrameLoaderClient::transitionToCommittedForNewPage):
 23 * WebProcess/WebPage/LayerTreeCoordinator/LayerTreeCoordinator.cpp:
 24 (WebKit::LayerTreeCoordinator::setVisibleContentsRect):
 25
1262012-07-04 Christophe Dumez <christophe.dumez@intel.com>
227
328 [EFL][WK2] Ewk_View should report load errors

Source/WebKit2/UIProcess/qt/QtViewportHandler.cpp

@@public:
8989 handler->resumePageContent();
9090
9191 // Make sure that tiles all around the viewport will be requested.
92  handler->informVisibleContentChange(QPointF());
 92 handler->informVisibleContentChange();
9393 }
9494
9595private:

@@void QtViewportHandler::informVisibleContentChange(const QPointF& trajectoryVect
709709 if (!drawingArea)
710710 return;
711711
712  if (m_lastVisibleContentsRect == visibleContentsRect())
 712 const QRect currentVisibleContentsRect = visibleContentsRect();
 713
 714 // A zero trajectoryVector indicates that tiles all around the viewport are requested.
 715 if (!trajectoryVector.isNull() && m_lastVisibleContentsRect == currentVisibleContentsRect)
713716 return;
714717
715718 qreal scale = m_pageItem->contentsScale();

@@void QtViewportHandler::informVisibleContentChange(const QPointF& trajectoryVect
717720 if (scale != m_lastCommittedScale)
718721 emit m_viewportItem->experimental()->test()->contentsScaleCommitted();
719722 m_lastCommittedScale = scale;
720  m_lastVisibleContentsRect = visibleContentsRect();
 723 m_lastVisibleContentsRect = currentVisibleContentsRect;
721724
722  drawingArea->setVisibleContentsRect(visibleContentsRect(), scale, trajectoryVector, m_viewportItem->contentPos());
 725 drawingArea->setVisibleContentsRect(currentVisibleContentsRect, scale, trajectoryVector, m_viewportItem->contentPos());
723726
724727 // Ensure that updatePaintNode is always called before painting.
725728 m_pageItem->update();

@@void QtViewportHandler::viewportItemSizeChanged()
736739 // it can resize the content accordingly.
737740 m_webPageProxy->setViewportSize(viewportSize);
738741
739  informVisibleContentChange(QPointF());
 742 informVisibleContentChange();
740743}
741744
742745void QtViewportHandler::scaleContent(const QPointF& centerInCSSCoordinates, qreal cssScale)

Source/WebKit2/UIProcess/qt/QtViewportHandler.h

@@private:
168168 QPointF m_lastScrollPosition;
169169 qreal m_pinchStartScale;
170170 qreal m_lastCommittedScale;
171  QRectF m_lastVisibleContentsRect;
 171 QRect m_lastVisibleContentsRect;
172172 qreal m_zoomOutScale;
173173 QList<ScaleStackItem> m_scaleStack;
174174};

Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp

@@void WebFrameLoaderClient::transitionToCommittedForNewPage()
12241224 bool isMainFrame = webPage->mainWebFrame() == m_frame;
12251225 bool shouldUseFixedLayout = isMainFrame && webPage->useFixedLayout();
12261226
 1227 IntSize currentVisibleContentSize;
 1228 if (const FrameView* view = m_frame->coreFrame()->view())
 1229 currentVisibleContentSize = view->visibleContentRect().size();
 1230
12271231 const ResourceResponse& response = m_frame->coreFrame()->loader()->documentLoader()->response();
12281232 m_frameHasCustomRepresentation = isMainFrame && WebProcess::shared().shouldUseCustomRepresentationForResponse(response);
12291233 m_frameCameFromPageCache = false;

@@void WebFrameLoaderClient::transitionToCommittedForNewPage()
12311235 m_frame->coreFrame()->createView(webPage->size(), backgroundColor, /* transparent */ false, IntSize(), shouldUseFixedLayout);
12321236 m_frame->coreFrame()->view()->setTransparent(!webPage->drawsBackground());
12331237 if (shouldUseFixedLayout)
1234  m_frame->coreFrame()->view()->setFixedVisibleContentRect(webPage->bounds());
 1238 // The HistoryController will update the scroll position later if needed.
 1239 m_frame->coreFrame()->view()->setFixedVisibleContentRect(IntRect(IntPoint::zero(), currentVisibleContentSize));
12351240}
12361241
12371242void WebFrameLoaderClient::didSaveToPageCache()

Source/WebKit2/WebProcess/WebPage/LayerTreeCoordinator/LayerTreeCoordinator.cpp

@@void LayerTreeCoordinator::setVisibleContentsRect(const IntRect& rect, float sca
512512 bool contentsRectDidChange = rect != m_visibleContentsRect;
513513 bool contentsScaleDidChange = scale != m_contentsScale;
514514
515  if (trajectoryVector != FloatPoint::zero())
516  toWebGraphicsLayer(m_nonCompositedContentLayer.get())->setVisibleContentRectTrajectoryVector(trajectoryVector);
 515 toWebGraphicsLayer(m_nonCompositedContentLayer.get())->setVisibleContentRectTrajectoryVector(trajectoryVector);
517516
518517 if (contentsRectDidChange || contentsScaleDidChange) {
519518 m_visibleContentsRect = rect;