Changeset 97945 in webkit
- Timestamp:
- Oct 20, 2011 12:22:49 AM (13 years ago)
- Location:
- trunk/Source
- Files:
-
- 6 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r97944 r97945 1 2011-10-20 Carol Szabo <carol@webkit.org> 2 3 Tiled Backing Store does not regenerate tiles when it should 4 https://bugs.webkit.org/show_bug.cgi?id=57798 5 6 Reviewed by Darin Adler. 7 8 Changed TiledBackingStore::adjustVisibleRect to take into account 9 contentsSize, the same way as it is done when tiles are generated. 10 11 This is an issue that requires a certain sequence of API calls which 12 may not be easily simulated from DumpRenderTree, but which is 13 easily reproduced with QtTest. This is why I have provided only 14 a Qt specific test despite this being a generic problem. 15 16 * platform/graphics/TiledBackingStore.cpp: 17 (WebCore::TiledBackingStore::adjustVisibleRect): 18 Changed to take into account ContentsSize. 19 (WebCore::TiledBackingStore::visibleContentsRect): 20 Added to return the intersection of the viewport's visible rect with 21 the ContentsRect. 22 (WebCore::TiledBackingStore::createTiles): 23 Changed to take into account the ContentsSize when calculating the 24 previously visible rect. 25 * platform/graphics/TiledBackingStore.h: 26 1 27 2011-10-19 Jer Noble <jer.noble@apple.com> 2 28 -
trunk/Source/WebCore/platform/graphics/TiledBackingStore.cpp
r97571 r97945 174 174 void TiledBackingStore::adjustVisibleRect() 175 175 { 176 IntRect visibleRect = mapFromContents(m_client->tiledBackingStoreVisibleRect());176 IntRect visibleRect = visibleContentsRect(); 177 177 if (m_previousVisibleRect == visibleRect) 178 178 return; … … 180 180 181 181 startTileCreationTimer(); 182 } 183 184 IntRect TiledBackingStore::visibleContentsRect() 185 { 186 return mapFromContents(intersection(m_client->tiledBackingStoreVisibleRect(), m_client->tiledBackingStoreContentsRect())); 182 187 } 183 188 … … 243 248 return; 244 249 245 IntRect visibleRect = mapFromContents(m_client->tiledBackingStoreVisibleRect());250 IntRect visibleRect = visibleContentsRect(); 246 251 m_previousVisibleRect = visibleRect; 247 252 -
trunk/Source/WebCore/platform/graphics/TiledBackingStore.h
r97571 r97945 106 106 107 107 void paintCheckerPattern(GraphicsContext*, const IntRect&, const Tile::Coordinate&); 108 IntRect visibleContentsRect(); 108 109 109 110 private: -
trunk/Source/WebKit/qt/ChangeLog
r97766 r97945 1 2011-10-20 Carol Szabo <carol@webkit.org> 2 3 Tiled Backing Store does not regenerate tiles when it should 4 https://bugs.webkit.org/show_bug.cgi?id=57798 5 6 Reviewed by Darin Adler. 7 8 Provided test for this bug. Changed the name of the resource I added 9 for a previous test so that the name is descriptive such that it can 10 be shared across several tests. 11 12 * tests/qgraphicswebview/tst_qgraphicswebview.cpp: 13 (tst_QGraphicsWebView::bug57798): 14 (tst_QGraphicsWebView::bug56929): 15 * tests/qgraphicswebview/tst_qgraphicswebview.qrc: 16 1 17 2011-10-18 Tor Arne Vestbø <tor.arne.vestbo@nokia.com> 2 18 -
trunk/Source/WebKit/qt/tests/qgraphicswebview/tst_qgraphicswebview.cpp
r97571 r97945 50 50 void renderHints(); 51 51 #if defined(WTF_USE_TILED_BACKING_STORE) && WTF_USE_TILED_BACKING_STORE 52 void bug57798(); 52 53 void bug56929(); 53 54 #endif … … 202 203 203 204 #if defined(WTF_USE_TILED_BACKING_STORE) && WTF_USE_TILED_BACKING_STORE 204 void tst_QGraphicsWebView::bug56929() 205 { 206 // When rendering from tiles sychronous layout should not be triggered 207 // and scrollbars should be in sync with the size of the document in the displayed state. 205 void tst_QGraphicsWebView::bug57798() 206 { 207 // When content size grows from less than viewport size to more than that, tiles may need to be regenerated. 208 208 209 209 QGraphicsWebView* webView = new QGraphicsWebView(); … … 213 213 view.scene()->addItem(webView); 214 214 webView->settings()->setAttribute(QWebSettings::TiledBackingStoreEnabled, true); 215 QUrl url("qrc:///resources/56929.html"); 215 QStyleOptionGraphicsItem option; 216 option.exposedRect = view.sceneRect(); 217 QImage img(view.width(), view.height(), 218 QImage::Format_ARGB32_Premultiplied); 219 QPainter painter(&img); 220 // This will not paint anything as the tiles are not ready, but will trigger tile creation with size (0, 0). 221 webView->paint(&painter, &option); 222 QApplication::processEvents(); 223 QUrl url("qrc:///resources/greendiv.html"); 224 webView->load(url); 225 QVERIFY(waitForSignal(webView, SIGNAL(loadFinished(bool)))); 226 // This should trigger the recreation of the tiles. 227 webView->paint(&painter, &option); 228 QApplication::processEvents(); 229 painter.fillRect(option.exposedRect, Qt::red); // This is here to ensure failure if paint does not paint anything 230 webView->paint(&painter, &option); 231 QCOMPARE(img.pixel(option.exposedRect.width() / 4, option.exposedRect.height() / 4), qRgba(0, 128, 0, 255)); 232 } 233 234 void tst_QGraphicsWebView::bug56929() 235 { 236 // When rendering from tiles sychronous layout should not be triggered 237 // and scrollbars should be in sync with the size of the document in the displayed state. 238 239 QGraphicsWebView* webView = new QGraphicsWebView(); 240 webView->setGeometry(QRectF(0.0, 0.0, 100.0, 100.0)); 241 QGraphicsView view(new QGraphicsScene()); 242 view.scene()->setParent(&view); 243 view.scene()->addItem(webView); 244 webView->settings()->setAttribute(QWebSettings::TiledBackingStoreEnabled, true); 245 QUrl url("qrc:///resources/greendiv.html"); 216 246 webView->load(url); 217 247 QVERIFY(waitForSignal(webView, SIGNAL(loadFinished(bool)))); -
trunk/Source/WebKit/qt/tests/qgraphicswebview/tst_qgraphicswebview.qrc
r82676 r97945 4 4 <file>resources/pointing_right.html</file> 5 5 <file>resources/pointing_up.html</file> 6 <file>resources/ 56929.html</file>6 <file>resources/greendiv.html</file> 7 7 </qresource> 8 8 </RCC>
Note: See TracChangeset
for help on using the changeset viewer.