Changeset 165279 in webkit
- Timestamp:
- Mar 7, 2014, 12:52:09 PM (11 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r165276 r165279 1 2014-03-07 Simon Fraser <simon.fraser@apple.com> 2 3 [iOS] Add an updateID to visibleContentRect updates which is passed back in layer transactions, so we know whether transactions are stale 4 https://bugs.webkit.org/show_bug.cgi?id=129897 5 6 Reviewed by Benjamin Poulain. 7 8 In WebKit2 on iOS we need to know when layer updates from the web process 9 are stale with respect to visible rect updates from the UI process. Do so 10 by adding an updateID to VisibleContentRectUpdateInfo, and storing it 11 on each side, returning it in RemoteLayerTreeTransaction. 12 13 Did some re-ordering of members and encoding order in RemoteLayerTreeTransaction 14 to group like data members together. 15 16 * Shared/VisibleContentRectUpdateInfo.cpp: 17 (WebKit::VisibleContentRectUpdateInfo::encode): 18 (WebKit::VisibleContentRectUpdateInfo::decode): 19 * Shared/VisibleContentRectUpdateInfo.h: 20 (WebKit::VisibleContentRectUpdateInfo::VisibleContentRectUpdateInfo): 21 (WebKit::VisibleContentRectUpdateInfo::updateID): 22 (WebKit::operator==): 23 * Shared/mac/RemoteLayerTreeTransaction.h: 24 (WebKit::RemoteLayerTreeTransaction::setLastVisibleContentRectUpdateID): 25 (WebKit::RemoteLayerTreeTransaction::lastVisibleContentRectUpdateID): 26 * Shared/mac/RemoteLayerTreeTransaction.mm: 27 (WebKit::RemoteLayerTreeTransaction::encode): 28 (WebKit::RemoteLayerTreeTransaction::decode): 29 * UIProcess/WebPageProxy.h: 30 (WebKit::WebPageProxy::nextVisibleContentRectUpdateID): 31 (WebKit::WebPageProxy::lastVisibleContentRectUpdateID): 32 * UIProcess/ios/WKContentView.mm: 33 (-[WKContentView didUpdateVisibleRect:unobscuredRect:scale:inStableState:]): 34 * WebProcess/WebPage/WebPage.cpp: 35 (WebKit::WebPage::WebPage): 36 (WebKit::WebPage::willCommitLayerTree): 37 * WebProcess/WebPage/WebPage.h: 38 * WebProcess/WebPage/ios/WebPageIOS.mm: 39 (WebKit::WebPage::updateVisibleContentRects): 40 1 41 2014-03-07 Roger Fong <roger_fong@apple.com> 2 42 -
trunk/Source/WebKit2/Shared/VisibleContentRectUpdateInfo.cpp
r165235 r165279 37 37 encoder << m_customFixedPositionRect; 38 38 encoder << m_scale; 39 encoder << m_updateID; 39 40 encoder << m_inStableState; 40 41 } … … 50 51 if (!decoder.decode(result.m_scale)) 51 52 return false; 53 if (!decoder.decode(result.m_updateID)) 54 return false; 52 55 if (!decoder.decode(result.m_inStableState)) 53 56 return false; -
trunk/Source/WebKit2/Shared/VisibleContentRectUpdateInfo.h
r165235 r165279 40 40 VisibleContentRectUpdateInfo() 41 41 : m_scale(-1) 42 , m_updateID(0) 43 , m_inStableState(false) 42 44 { 43 45 } 44 46 45 VisibleContentRectUpdateInfo( const WebCore::FloatRect& exposedRect, const WebCore::FloatRect& unobscuredRect, const WebCore::FloatRect& customFixedPositionRect, double scale, bool inStableState)47 VisibleContentRectUpdateInfo(uint64_t updateID, const WebCore::FloatRect& exposedRect, const WebCore::FloatRect& unobscuredRect, const WebCore::FloatRect& customFixedPositionRect, double scale, bool inStableState) 46 48 : m_exposedRect(exposedRect) 47 49 , m_unobscuredRect(unobscuredRect) 48 50 , m_customFixedPositionRect(customFixedPositionRect) 49 51 , m_scale(scale) 52 , m_updateID(updateID) 50 53 , m_inStableState(inStableState) 51 54 { … … 56 59 const WebCore::FloatRect& customFixedPositionRect() const { return m_customFixedPositionRect; } 57 60 double scale() const { return m_scale; } 61 uint64_t updateID() const { return m_updateID; } 58 62 bool inStableState() const { return m_inStableState; } 59 63 … … 66 70 WebCore::FloatRect m_customFixedPositionRect; 67 71 double m_scale; 72 uint64_t m_updateID; 68 73 bool m_inStableState; 69 74 }; … … 71 76 inline bool operator==(const VisibleContentRectUpdateInfo& a, const VisibleContentRectUpdateInfo& b) 72 77 { 78 // Note: the comparison doesn't include updateID since we care about equality based on the other data. 73 79 return a.scale() == b.scale() 74 80 && a.exposedRect() == b.exposedRect() -
trunk/Source/WebKit2/Shared/mac/RemoteLayerTreeTransaction.h
r164702 r165279 165 165 double pageScaleFactor() const { return m_pageScaleFactor; } 166 166 void setPageScaleFactor(double pageScaleFactor) { m_pageScaleFactor = pageScaleFactor; } 167 168 void setLastVisibleContentRectUpdateID(uint64_t lastVisibleContentRectUpdateID) { m_lastVisibleContentRectUpdateID = lastVisibleContentRectUpdateID; } 169 uint64_t lastVisibleContentRectUpdateID() const { return m_lastVisibleContentRectUpdateID; } 167 170 168 171 bool scaleWasSetByUIProcess() const { return m_scaleWasSetByUIProcess; } … … 189 192 Vector<LayerCreationProperties> m_createdLayers; 190 193 Vector<WebCore::GraphicsLayer::PlatformLayerID> m_destroyedLayerIDs; 194 Vector<WebCore::GraphicsLayer::PlatformLayerID> m_videoLayerIDsPendingFullscreen; 195 191 196 WebCore::IntSize m_contentsSize; 192 197 double m_pageScaleFactor; 193 bool m_scaleWasSetByUIProcess;194 uint64_t m_renderTreeSize;195 198 double m_minimumScaleFactor; 196 199 double m_maximumScaleFactor; 200 uint64_t m_lastVisibleContentRectUpdateID; 201 uint64_t m_renderTreeSize; 202 bool m_scaleWasSetByUIProcess; 197 203 bool m_allowsUserScaling; 198 Vector<WebCore::GraphicsLayer::PlatformLayerID> m_videoLayerIDsPendingFullscreen;199 204 }; 200 205 -
trunk/Source/WebKit2/Shared/mac/RemoteLayerTreeTransaction.mm
r164910 r165279 412 412 413 413 encoder << m_destroyedLayerIDs; 414 encoder << m_videoLayerIDsPendingFullscreen; 415 414 416 encoder << m_contentsSize; 415 417 encoder << m_pageScaleFactor; 416 encoder << m_scaleWasSetByUIProcess;417 418 encoder << m_minimumScaleFactor; 418 419 encoder << m_maximumScaleFactor; 420 421 encoder << m_lastVisibleContentRectUpdateID; 422 encoder << m_renderTreeSize; 423 424 encoder << m_scaleWasSetByUIProcess; 419 425 encoder << m_allowsUserScaling; 420 encoder << m_renderTreeSize;421 encoder << m_videoLayerIDsPendingFullscreen;422 426 } 423 427 … … 456 460 } 457 461 462 if (!decoder.decode(result.m_videoLayerIDsPendingFullscreen)) 463 return false; 464 458 465 if (!decoder.decode(result.m_contentsSize)) 459 466 return false; … … 462 469 return false; 463 470 471 if (!decoder.decode(result.m_minimumScaleFactor)) 472 return false; 473 474 if (!decoder.decode(result.m_maximumScaleFactor)) 475 return false; 476 477 if (!decoder.decode(result.m_lastVisibleContentRectUpdateID)) 478 return false; 479 480 if (!decoder.decode(result.m_renderTreeSize)) 481 return false; 482 464 483 if (!decoder.decode(result.m_scaleWasSetByUIProcess)) 465 484 return false; 466 485 467 if (!decoder.decode(result.m_minimumScaleFactor))468 return false;469 470 if (!decoder.decode(result.m_maximumScaleFactor))471 return false;472 473 486 if (!decoder.decode(result.m_allowsUserScaling)) 474 return false;475 476 if (!decoder.decode(result.m_renderTreeSize))477 return false;478 479 if (!decoder.decode(result.m_videoLayerIDsPendingFullscreen))480 487 return false; 481 488 -
trunk/Source/WebKit2/UIProcess/WebPageProxy.h
r165276 r165279 460 460 461 461 bool updateVisibleContentRects(const VisibleContentRectUpdateInfo&); 462 uint64_t nextVisibleContentRectUpdateID() const { return m_lastVisibleContentRectUpdate.updateID() + 1; } 463 uint64_t lastVisibleContentRectUpdateID() const { return m_lastVisibleContentRectUpdate.updateID(); } 464 462 465 void setViewportConfigurationMinimumLayoutSize(const WebCore::IntSize&); 463 466 void didCommitLayerTree(const WebKit::RemoteLayerTreeTransaction&); -
trunk/Source/WebKit2/UIProcess/ios/WKContentView.mm
r165235 r165279 174 174 175 175 FloatRect fixedPosRect = [self fixedPositionRectFromExposedRect:unobscuredRect scale:scale]; 176 _page->updateVisibleContentRects(VisibleContentRectUpdateInfo( visibleRect, unobscuredRect, fixedPosRect, scale, isStableState));176 _page->updateVisibleContentRects(VisibleContentRectUpdateInfo(_page->nextVisibleContentRectUpdateID(), visibleRect, unobscuredRect, fixedPosRect, scale, isStableState)); 177 177 178 178 RemoteScrollingCoordinatorProxy* scrollingCoordinator = _page->scrollingCoordinatorProxy(); -
trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp
r165148 r165279 284 284 #if PLATFORM(IOS) 285 285 , m_shouldReturnWordAtSelection(false) 286 , m_lastVisibleContentRectUpdateID(0) 286 287 , m_scaleWasSetByUIProcess(false) 287 288 , m_userHasChangedPageScaleFactor(false) … … 2633 2634 layerTransaction.setRenderTreeSize(corePage()->renderTreeSize()); 2634 2635 #if PLATFORM(IOS) 2636 layerTransaction.setLastVisibleContentRectUpdateID(m_lastVisibleContentRectUpdateID); 2635 2637 layerTransaction.setScaleWasSetByUIProcess(scaleWasSetByUIProcess()); 2636 2638 layerTransaction.setMinimumScaleFactor(minimumPageScaleFactor()); -
trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h
r165148 r165279 1101 1101 1102 1102 WebCore::ViewportConfiguration m_viewportConfiguration; 1103 uint64_t m_lastVisibleContentRectUpdateID; 1103 1104 bool m_scaleWasSetByUIProcess; 1104 1105 bool m_userHasChangedPageScaleFactor; -
trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm
r165235 r165279 1730 1730 void WebPage::updateVisibleContentRects(const VisibleContentRectUpdateInfo& visibleContentRectUpdateInfo) 1731 1731 { 1732 m_lastVisibleContentRectUpdateID = visibleContentRectUpdateInfo.updateID(); 1733 1732 1734 FloatRect exposedRect = visibleContentRectUpdateInfo.exposedRect(); 1733 1735 m_drawingArea->setExposedContentRect(enclosingIntRect(exposedRect));
Note:
See TracChangeset
for help on using the changeset viewer.