Changeset 107237 in webkit
- Timestamp:
- Feb 9, 2012 6:40:47 AM (12 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r107236 r107237 1 2012-02-07 Jocelyn Turcotte <jocelyn.turcotte@nokia.com> 2 3 [Qt] Fetch the visible rect from LayerTreeHost instead of keeping a copy in each layer. 4 https://bugs.webkit.org/show_bug.cgi?id=78009 5 6 Reviewed by Noam Rosenthal. 7 8 Since WebGraphicsLayers are now accessed directly from LayerTreeHost, they don't 9 need to keep the visible rect to pass it down their child layers anymore. 10 11 * WebProcess/WebCoreSupport/WebGraphicsLayer.cpp: 12 (WebCore::WebGraphicsLayer::setContentsScale): 13 (WebCore::WebGraphicsLayer::tiledBackingStoreVisibleRect): 14 (WebCore::WebGraphicsLayer::adjustVisibleRect): 15 (WebCore): 16 * WebProcess/WebCoreSupport/WebGraphicsLayer.h: 17 (WebGraphicsLayerClient): 18 (WebGraphicsLayer): 19 * WebProcess/WebPage/qt/LayerTreeHostQt.cpp: 20 (WebKit::LayerTreeHostQt::registerLayer): 21 (WebKit::LayerTreeHostQt::visibleContentsRect): 22 (WebKit): 23 (WebKit::LayerTreeHostQt::setVisibleContentRectAndScale): 24 * WebProcess/WebPage/qt/LayerTreeHostQt.h: 25 (LayerTreeHostQt): 26 1 27 2012-02-09 Jocelyn Turcotte <jocelyn.turcotte@nokia.com> 2 28 -
trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebGraphicsLayer.cpp
r107236 r107237 484 484 } 485 485 486 void WebGraphicsLayer::setVisibleContentRectAndScale(const IntRect& pageVisibleRect, float scale) 487 { 488 if (m_pageVisibleRect == pageVisibleRect && m_contentsScale == scale) 489 return; 490 491 m_pageVisibleRect = pageVisibleRect; 486 void WebGraphicsLayer::setContentsScale(float scale) 487 { 492 488 m_contentsScale = scale; 493 494 if (!m_mainBackingStore || m_mainBackingStore->contentsScale() != scale) { 489 if (m_mainBackingStore && m_mainBackingStore->contentsScale() != scale) { 495 490 m_previousBackingStore = m_mainBackingStore.release(); 496 491 m_mainBackingStore = adoptPtr(new TiledBackingStore(this, TiledBackingStoreRemoteTileBackend::create(this))); 497 492 m_mainBackingStore->setContentsScale(scale); 498 } else 499 m_mainBackingStore->adjustVisibleRect(); 493 } 500 494 } 501 495 … … 538 532 // The resulting quad might be squewed and the visible rect is the bounding box of this quad, 539 533 // so it might spread further than the real visible area (and then even more amplified by the cover rect multiplier). 540 return m_layerTransform.combined().inverse().clampedBoundsOfProjectedQuad(FloatQuad(FloatRect(m_ pageVisibleRect)));534 return m_layerTransform.combined().inverse().clampedBoundsOfProjectedQuad(FloatQuad(FloatRect(m_webGraphicsLayerClient->visibleContentsRect()))); 541 535 } 542 536 … … 624 618 if (client) 625 619 client->attachLayer(this); 620 } 621 622 void WebGraphicsLayer::adjustVisibleRect() 623 { 624 if (m_mainBackingStore) 625 m_mainBackingStore->adjustVisibleRect(); 626 626 } 627 627 -
trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebGraphicsLayer.h
r107236 r107237 53 53 virtual void removeTile(WebLayerID, int tileID) = 0; 54 54 55 virtual WebCore::IntRect visibleContentsRect() const = 0; 55 56 virtual bool layerTreeTileUpdatesAllowed() const = 0; 56 57 virtual int64_t adoptImageBackingStore(WebCore::Image*) = 0; … … 103 104 void setNeedsDisplayInRect(const FloatRect&); 104 105 void setContentsNeedsDisplay(); 105 void set VisibleContentRectAndScale(const IntRect&, float scale);106 void setContentsScale(float); 106 107 void setVisibleContentRectTrajectoryVector(const FloatPoint&); 107 108 virtual void syncCompositingState(const FloatRect&); … … 138 139 void setWebGraphicsLayerClient(WebKit::WebGraphicsLayerClient*); 139 140 141 void adjustVisibleRect(); 140 142 bool isReadyForTileBufferSwap() const; 141 143 void updateContentBuffers(); … … 148 150 GraphicsLayer* m_maskTarget; 149 151 FloatRect m_needsDisplayRect; 150 IntRect m_pageVisibleRect;151 152 LayerTransform m_layerTransform; 152 153 bool m_needsDisplay : 1; -
trunk/Source/WebKit2/WebProcess/WebPage/qt/LayerTreeHostQt.cpp
r107236 r107237 241 241 m_registeredLayers.add(layer); 242 242 243 layer->setVisibleContentRectAndScale(m_visibleContentsRect, m_contentsScale); 243 layer->setContentsScale(m_contentsScale); 244 layer->adjustVisibleRect(); 244 245 } 245 246 … … 415 416 } 416 417 418 WebCore::IntRect LayerTreeHostQt::visibleContentsRect() const 419 { 420 return m_visibleContentsRect; 421 } 422 417 423 void LayerTreeHostQt::setVisibleContentRectAndScale(const IntRect& rect, float scale) 418 424 { … … 423 429 424 430 HashSet<WebCore::WebGraphicsLayer*>::iterator end = m_registeredLayers.end(); 425 for (HashSet<WebCore::WebGraphicsLayer*>::iterator it = m_registeredLayers.begin(); it != end; ++it) 426 (*it)->setVisibleContentRectAndScale(rect, scale); 431 for (HashSet<WebCore::WebGraphicsLayer*>::iterator it = m_registeredLayers.begin(); it != end; ++it) { 432 (*it)->setContentsScale(scale); 433 (*it)->adjustVisibleRect(); 434 } 427 435 scheduleLayerFlush(); 428 436 } -
trunk/Source/WebKit2/WebProcess/WebPage/qt/LayerTreeHostQt.h
r107236 r107237 70 70 virtual void updateTile(WebLayerID, int tileID, const UpdateInfo&); 71 71 virtual void removeTile(WebLayerID, int tileID); 72 virtual WebCore::IntRect visibleContentsRect() const; 72 73 virtual void renderNextFrame(); 73 74 virtual void purgeBackingStores();
Note: See TracChangeset
for help on using the changeset viewer.