Changeset 91180 in webkit
- Timestamp:
- Jul 18, 2011 6:43:12 AM (13 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r91173 r91180 1 2011-07-15 Jocelyn Turcotte <jocelyn.turcotte@nokia.com> 2 3 TiledDrawingArea: map the visibleArea rect from page to tiles coordinates. 4 https://bugs.webkit.org/show_bug.cgi?id=64538 5 6 Reviewed by Benjamin Poulain. 7 8 TiledDrawingAreaProxy expects its coordinates to be scaled according to 9 contentsScale. This patch keep the pushed visibleArea as page coordinates 10 and convert it each time to scaled coordinates in case the contents scale was 11 changed afterward. 12 This is a regression introduced in r90750. 13 Also: 14 - Rename visibleArea to visibleContentRect 15 - Remove an unnecessary mapToContents in QTouchWebPageProxy::setVisibleContentRect 16 17 * UIProcess/API/qt/qtouchwebpage.cpp: 18 (QTouchWebPagePrivate::setViewportRect): 19 * UIProcess/TiledDrawingAreaProxy.cpp: 20 (WebKit::TiledDrawingAreaProxy::invalidate): 21 (WebKit::TiledDrawingAreaProxy::setVisibleContentRect): 22 (WebKit::TiledDrawingAreaProxy::createTiles): 23 (WebKit::TiledDrawingAreaProxy::visibleRect): 24 * UIProcess/TiledDrawingAreaProxy.h: 25 * UIProcess/qt/qtouchwebpageproxy.cpp: 26 (QTouchWebPageProxy::setVisibleContentRect): 27 * UIProcess/qt/qtouchwebpageproxy.h: 28 1 29 2011-07-17 Amruth Raj <amruthraj@motorola.com> 2 30 -
trunk/Source/WebKit2/UIProcess/API/qt/qtouchwebpage.cpp
r90909 r91180 142 142 void QTouchWebPagePrivate::setViewportRect(const QRectF& viewportRect) 143 143 { 144 const QRectF visible Area= q->boundingRect().intersected(viewportRect);145 page->setVisible Area(visibleArea);144 const QRectF visibleContentRect = q->boundingRect().intersected(viewportRect); 145 page->setVisibleContentRect(visibleContentRect); 146 146 } 147 147 -
trunk/Source/WebKit2/UIProcess/TiledDrawingAreaProxy.cpp
r90750 r91180 182 182 TiledDrawingAreaTile::Coordinate bottomRight = tileCoordinateForPoint(innerBottomRight(dirtyRect)); 183 183 184 IntRect coverRect = calculateCoverRect( m_visibleArea);184 IntRect coverRect = calculateCoverRect(visibleRect()); 185 185 186 186 Vector<TiledDrawingAreaTile::Coordinate> tilesToRemove; … … 291 291 } 292 292 293 void TiledDrawingAreaProxy::setVisible Area(const WebCore::IntRect& visibleArea)294 { 295 if (m_visible Area != visibleArea) {296 m_visible Area = visibleArea;293 void TiledDrawingAreaProxy::setVisibleContentRect(const WebCore::IntRect& visibleContentRect) 294 { 295 if (m_visibleContentRect != visibleContentRect) { 296 m_visibleContentRect = visibleContentRect; 297 297 startTileCreationTimer(); 298 298 } … … 352 352 void TiledDrawingAreaProxy::createTiles() 353 353 { 354 if (m_visibleArea.isEmpty()) 354 IntRect visibleRect = this->visibleRect(); 355 if (visibleRect.isEmpty()) 355 356 return; 356 357 … … 359 360 360 361 // Remove tiles outside out current maximum keep rect. 361 dropTilesOutsideRect(calculateKeepRect( m_visibleArea));362 dropTilesOutsideRect(calculateKeepRect(visibleRect)); 362 363 363 364 // Search for the tile position closest to the viewport center that does not yet contain a tile. … … 367 368 unsigned requiredTileCount = 0; 368 369 bool hasVisibleCheckers = false; 369 TiledDrawingAreaTile::Coordinate topLeft = tileCoordinateForPoint( m_visibleArea.location());370 TiledDrawingAreaTile::Coordinate bottomRight = tileCoordinateForPoint(innerBottomRight( m_visibleArea));370 TiledDrawingAreaTile::Coordinate topLeft = tileCoordinateForPoint(visibleRect.location()); 371 TiledDrawingAreaTile::Coordinate bottomRight = tileCoordinateForPoint(innerBottomRight(visibleRect)); 371 372 for (unsigned yCoordinate = topLeft.y(); yCoordinate <= bottomRight.y(); ++yCoordinate) { 372 373 for (unsigned xCoordinate = topLeft.x(); xCoordinate <= bottomRight.x(); ++xCoordinate) { 373 374 TiledDrawingAreaTile::Coordinate currentCoordinate(xCoordinate, yCoordinate); 374 375 // Distance is 0 for all currently visible tiles. 375 double distance = tileDistance( m_visibleArea, currentCoordinate);376 double distance = tileDistance(visibleRect, currentCoordinate); 376 377 377 378 RefPtr<TiledDrawingAreaTile> tile = tileAt(currentCoordinate); … … 497 498 } 498 499 500 IntRect TiledDrawingAreaProxy::visibleRect() const 501 { 502 return mapFromContents(m_visibleContentRect); 503 } 504 499 505 IntRect TiledDrawingAreaProxy::tileRectForCoordinate(const TiledDrawingAreaTile::Coordinate& coordinate) const 500 506 { -
trunk/Source/WebKit2/UIProcess/TiledDrawingAreaProxy.h
r90750 r91180 68 68 virtual ~TiledDrawingAreaProxy(); 69 69 70 void setVisible Area(const WebCore::IntRect& visibleRect);70 void setVisibleContentRect(const WebCore::IntRect&); 71 71 float contentsScale() const { return m_contentsScale; } 72 72 void setContentsScale(float); … … 136 136 137 137 WebCore::IntRect contentsRect() const; 138 WebCore::IntRect visibleRect() const; 138 139 139 140 WebCore::IntRect calculateKeepRect(const WebCore::IntRect& visibleRect) const; … … 167 168 WebCore::FloatSize m_coverAreaMultiplier; 168 169 169 WebCore::IntRect m_visible Area;170 WebCore::IntRect m_visibleContentRect; 170 171 float m_contentsScale; 171 172 -
trunk/Source/WebKit2/UIProcess/qt/qtouchwebpageproxy.cpp
r91064 r91180 86 86 } 87 87 88 void QTouchWebPageProxy::setVisible Area(const QRectF& visibleArea)88 void QTouchWebPageProxy::setVisibleContentRect(const QRectF& visibleContentRect) 89 89 { 90 90 TiledDrawingAreaProxy* tiledDrawingArea = static_cast<TiledDrawingAreaProxy*>(m_webPageProxy->drawingArea()); 91 QRect alignedVisible Area = visibleArea.toAlignedRect();92 tiledDrawingArea->setVisible Area(alignedVisibleArea);91 QRect alignedVisibleContentRect = visibleContentRect.toAlignedRect(); 92 tiledDrawingArea->setVisibleContentRect(alignedVisibleContentRect); 93 93 94 94 // FIXME: Once we support suspend and resume, this should be delayed until the page is active if the page is suspended. 95 IntRect contentVisibleArea = tiledDrawingArea->mapToContents(alignedVisibleArea); 96 m_webPageProxy->setFixedVisibleContentRect(contentVisibleArea); 95 m_webPageProxy->setFixedVisibleContentRect(alignedVisibleContentRect); 97 96 } 98 97 -
trunk/Source/WebKit2/UIProcess/qt/qtouchwebpageproxy.h
r90838 r91180 40 40 virtual bool handleEvent(QEvent*); 41 41 42 void setVisible Area(const QRectF&);42 void setVisibleContentRect(const QRectF&); 43 43 void setResizesToContentsUsingLayoutSize(const QSize& targetLayoutSize); 44 44 void findZoomableAreaForPoint(const QPoint&);
Note: See TracChangeset
for help on using the changeset viewer.