Changeset 108501 in webkit
- Timestamp:
- Feb 22, 2012, 7:15:10 AM (14 years ago)
- Location:
- trunk/Source
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r108498 r108501 1 2012-02-22 Kenneth Rohde Christiansen <kenneth@webkit.org> 2 3 [Qt] Disregard previous backing store as soon as possible 4 https://bugs.webkit.org/show_bug.cgi?id=79232 5 6 Reviewed by Simon Hausmann and No'am Rosenthal. 7 8 Make it possible to drop non-visible tiles and to test 9 if the current visible rect is fully covered. 10 11 * platform/graphics/TiledBackingStore.cpp: 12 (WebCore::TiledBackingStore::visibleContentsRect): 13 (WebCore::TiledBackingStore::coverageRatio): 14 (WebCore::TiledBackingStore::visibleAreaIsCovered): 15 (WebCore): 16 (WebCore::TiledBackingStore::createTiles): 17 (WebCore::TiledBackingStore::removeAllNonVisibleTiles): 18 * platform/graphics/TiledBackingStore.h: 19 (TiledBackingStore): 20 1 21 2012-02-22 Simon Hausmann <simon.hausmann@nokia.com> 2 22 -
trunk/Source/WebCore/platform/graphics/TiledBackingStore.cpp
r108491 r108501 165 165 } 166 166 167 IntRect TiledBackingStore::visibleContentsRect() 167 IntRect TiledBackingStore::visibleContentsRect() const 168 168 { 169 169 return mapFromContents(intersection(m_client->tiledBackingStoreVisibleRect(), m_client->tiledBackingStoreContentsRect())); … … 204 204 205 205 // Returns a ratio between 0.0f and 1.0f of the surface of contentsRect covered by rendered tiles. 206 float TiledBackingStore::coverageRatio(const WebCore::IntRect& contentsRect) 206 float TiledBackingStore::coverageRatio(const WebCore::IntRect& contentsRect) const 207 207 { 208 208 IntRect dirtyRect = mapFromContents(contentsRect); … … 226 226 } 227 227 228 bool TiledBackingStore::visibleAreaIsCovered() const 229 { 230 return coverageRatio(visibleContentsRect()) == 1.0f; 231 } 232 228 233 void TiledBackingStore::createTiles() 229 234 { … … 260 265 continue; 261 266 ++requiredTileCount; 262 // Distance is 0 for all currently visible tiles.267 // Distance is 0 for all tiles inside the visibleRect. 263 268 double distance = tileDistance(visibleRect, currentCoordinate); 264 269 if (distance > shortestDistance) … … 403 408 } 404 409 410 void TiledBackingStore::removeAllNonVisibleTiles() 411 { 412 dropTilesOutsideRect(visibleContentsRect()); 413 } 414 405 415 PassRefPtr<Tile> TiledBackingStore::tileAt(const Tile::Coordinate& coordinate) const 406 416 { -
trunk/Source/WebCore/platform/graphics/TiledBackingStore.h
r108491 r108501 54 54 bool contentsFrozen() const { return m_contentsFrozen; } 55 55 void setContentsFrozen(bool); 56 56 57 void updateTileBuffers(); 57 58 … … 71 72 Tile::Coordinate tileCoordinateForPoint(const IntPoint&) const; 72 73 double tileDistance(const IntRect& viewport, const Tile::Coordinate&) const; 73 float coverageRatio(const WebCore::IntRect& contentsRect); 74 75 bool visibleAreaIsCovered() const; 76 void removeAllNonVisibleTiles(); 74 77 75 78 void setSupportsAlpha(bool); … … 79 82 void startTileBufferUpdateTimer(); 80 83 void startTileCreationTimer(); 81 84 82 85 typedef Timer<TiledBackingStore> TileTimer; 83 86 84 87 void tileBufferUpdateTimerFired(TileTimer*); 85 88 void tileCreationTimerFired(TileTimer*); 86 89 87 90 void createTiles(); 88 91 void computeCoverAndKeepRect(const IntRect& visibleRect, IntRect& coverRect, IntRect& keepRect) const; 89 92 90 93 void commitScaleChange(); 91 94 92 95 bool resizeEdgeTiles(); 93 96 void dropTilesOutsideRect(const IntRect&); 94 97 95 98 PassRefPtr<Tile> tileAt(const Tile::Coordinate&) const; 96 99 void setTile(const Tile::Coordinate& coordinate, PassRefPtr<Tile> tile); 97 100 void removeTile(const Tile::Coordinate& coordinate); 98 101 102 IntRect contentsRect() const; 103 IntRect visibleContentsRect() const; 104 105 float coverageRatio(const IntRect&) const; 99 106 void adjustForContentsRect(IntRect&) const; 100 IntRect contentsRect() const; 101 107 102 108 void paintCheckerPattern(GraphicsContext*, const IntRect&, const Tile::Coordinate&); 103 IntRect visibleContentsRect();104 109 105 110 private: -
trunk/Source/WebKit2/ChangeLog
r108499 r108501 1 2012-02-22 Kenneth Rohde Christiansen <kenneth@webkit.org> 2 3 [Qt] Disregard previous backing store as soon as possible 4 https://bugs.webkit.org/show_bug.cgi?id=79232 5 6 Reviewed by Simon Hausmann and No'am Rosenthal. 7 8 Between creating the new backing store and painting the content, 9 we do not want to drop the previous one as that might result in 10 briefly seeing flickering as the old tiles may be dropped before 11 something replaces them. 12 13 But we do need to drop it at some point and we need to make sure 14 to not spike the memory usage before of this. 15 16 What we now do, is to store the previous backing store as before, 17 but drop all tiles which are not visible and then drop it as soon 18 as the visible rect (which might change due if followed by a quick 19 panning) has been fully covered by tiles. 20 21 * WebProcess/WebCoreSupport/WebGraphicsLayer.cpp: 22 (WebCore::WebGraphicsLayer::setContentsScale): 23 (WebCore::WebGraphicsLayer::updateContentBuffers): 24 1 25 2012-02-22 Michael Brüning <michael.bruning@nokia.com> 2 26 -
trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebGraphicsLayer.cpp
r108491 r108501 489 489 { 490 490 m_contentsScale = scale; 491 if (m_mainBackingStore && m_mainBackingStore->contentsScale() != scale) { 492 m_previousBackingStore = m_mainBackingStore.release(); 493 createBackingStore(); 494 } 491 492 if (!m_mainBackingStore || m_mainBackingStore->contentsScale() == scale) 493 return; 494 495 // Between creating the new backing store and painting the content, 496 // we do not want to drop the previous one as that might result in 497 // briefly seeing flickering as the old tiles may be dropped before 498 // something replaces them. 499 m_previousBackingStore = m_mainBackingStore.release(); 500 501 // No reason to save the previous backing store for non-visible areas. 502 m_previousBackingStore->removeAllNonVisibleTiles(); 503 504 createBackingStore(); 495 505 } 496 506 … … 583 593 584 594 m_inUpdateMode = true; 585 // This is the only place we (re)create the main tiled backing store, 586 // once wehave a remote client and we are ready to send our data to the UI process.595 // This is the only place we (re)create the main tiled backing store, once we 596 // have a remote client and we are ready to send our data to the UI process. 587 597 if (!m_mainBackingStore) 588 598 createBackingStore(); 589 599 m_mainBackingStore->updateTileBuffers(); 590 600 m_inUpdateMode = false; 601 602 // The previous backing store is kept around to avoid flickering between 603 // removing the existing tiles and painting the new ones. The first time 604 // the visibleRect is full painted we remove the previous backing store. 605 if (m_mainBackingStore->visibleAreaIsCovered()) 606 m_previousBackingStore.clear(); 591 607 } 592 608
Note:
See TracChangeset
for help on using the changeset viewer.