Changeset 165235 in webkit
- Timestamp:
- Mar 6, 2014 6:01:39 PM (10 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r165234 r165235 1 2014-03-06 Simon Fraser <simon.fraser@apple.com> 2 3 Send the fixed position rect to the WebProcess along with the other rects 4 https://bugs.webkit.org/show_bug.cgi?id=129856 5 6 Reviewed by Benjamin Poulain. 7 8 Remove the functions that pass the custom fixed position rect through 9 the DrawingArea, and replace them by adding this rect to the 10 VisibleContentRectUpdateInfo, along with the "is stable" flag. We 11 then set the custom fixed position rect in the web process for 12 stable updates. 13 14 * Shared/VisibleContentRectUpdateInfo.cpp: 15 (WebKit::VisibleContentRectUpdateInfo::encode): 16 (WebKit::VisibleContentRectUpdateInfo::decode): 17 * Shared/VisibleContentRectUpdateInfo.h: 18 (WebKit::VisibleContentRectUpdateInfo::VisibleContentRectUpdateInfo): 19 (WebKit::VisibleContentRectUpdateInfo::customFixedPositionRect): 20 (WebKit::VisibleContentRectUpdateInfo::inStableState): 21 (WebKit::operator==): 22 * UIProcess/DrawingAreaProxy.cpp: 23 * UIProcess/ios/WKContentView.mm: 24 (-[WKContentView didUpdateVisibleRect:unobscuredRect:scale:inStableState:]): 25 * WebProcess/WebPage/DrawingArea.h: 26 * WebProcess/WebPage/DrawingArea.messages.in: 27 * WebProcess/WebPage/ios/WebPageIOS.mm: 28 (WebKit::WebPage::updateVisibleContentRects): 29 * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h: 30 * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm: 31 * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h: 32 1 33 2014-03-06 Simon Fraser <simon.fraser@apple.com> 2 34 -
trunk/Source/WebKit2/Shared/VisibleContentRectUpdateInfo.cpp
r164702 r165235 35 35 encoder << m_exposedRect; 36 36 encoder << m_unobscuredRect; 37 encoder << m_customFixedPositionRect; 37 38 encoder << m_scale; 39 encoder << m_inStableState; 38 40 } 39 41 … … 44 46 if (!decoder.decode(result.m_unobscuredRect)) 45 47 return false; 48 if (!decoder.decode(result.m_customFixedPositionRect)) 49 return false; 46 50 if (!decoder.decode(result.m_scale)) 51 return false; 52 if (!decoder.decode(result.m_inStableState)) 47 53 return false; 48 54 return true; -
trunk/Source/WebKit2/Shared/VisibleContentRectUpdateInfo.h
r164702 r165235 43 43 } 44 44 45 VisibleContentRectUpdateInfo(const WebCore::FloatRect& exposedRect, const WebCore::FloatRect& unobscuredRect, double scale)45 VisibleContentRectUpdateInfo(const WebCore::FloatRect& exposedRect, const WebCore::FloatRect& unobscuredRect, const WebCore::FloatRect& customFixedPositionRect, double scale, bool inStableState) 46 46 : m_exposedRect(exposedRect) 47 47 , m_unobscuredRect(unobscuredRect) 48 , m_customFixedPositionRect(customFixedPositionRect) 48 49 , m_scale(scale) 50 , m_inStableState(inStableState) 49 51 { 50 52 } … … 52 54 const WebCore::FloatRect& exposedRect() const { return m_exposedRect; } 53 55 const WebCore::FloatRect& unobscuredRect() const { return m_unobscuredRect; } 56 const WebCore::FloatRect& customFixedPositionRect() const { return m_customFixedPositionRect; } 54 57 double scale() const { return m_scale; } 58 bool inStableState() const { return m_inStableState; } 55 59 56 60 void encode(IPC::ArgumentEncoder&) const; … … 60 64 WebCore::FloatRect m_exposedRect; 61 65 WebCore::FloatRect m_unobscuredRect; 66 WebCore::FloatRect m_customFixedPositionRect; 62 67 double m_scale; 68 bool m_inStableState; 63 69 }; 64 70 65 71 inline bool operator==(const VisibleContentRectUpdateInfo& a, const VisibleContentRectUpdateInfo& b) 66 72 { 67 return a.scale() == b.scale() && a.exposedRect() == b.exposedRect() && a.unobscuredRect() == b.unobscuredRect(); 73 return a.scale() == b.scale() 74 && a.exposedRect() == b.exposedRect() 75 && a.unobscuredRect() == b.unobscuredRect() 76 && a.customFixedPositionRect() == b.customFixedPositionRect() 77 && a.inStableState() == b.inStableState(); 68 78 } 69 79 -
trunk/Source/WebKit2/UIProcess/DrawingAreaProxy.cpp
r164710 r165235 88 88 #endif // PLATFORM(MAC) 89 89 90 #if PLATFORM(COCOA)91 void DrawingAreaProxy::setCustomFixedPositionRect(const FloatRect& fixedPositionRect)92 {93 if (!m_webPageProxy->isValid())94 return;95 96 m_webPageProxy->process().send(Messages::DrawingArea::SetCustomFixedPositionRect(fixedPositionRect), m_webPageProxy->pageID());97 }98 #endif99 100 90 } // namespace WebKit -
trunk/Source/WebKit2/UIProcess/ios/WKContentView.mm
r165230 r165235 172 172 scale = _page->displayedContentScale(); 173 173 } 174 175 _page->updateVisibleContentRects(VisibleContentRectUpdateInfo(visibleRect, unobscuredRect, scale)); 174 175 FloatRect fixedPosRect = [self fixedPositionRectFromExposedRect:unobscuredRect scale:scale]; 176 _page->updateVisibleContentRects(VisibleContentRectUpdateInfo(visibleRect, unobscuredRect, fixedPosRect, scale, isStableState)); 176 177 177 178 RemoteScrollingCoordinatorProxy* scrollingCoordinator = _page->scrollingCoordinatorProxy(); 178 179 scrollingCoordinator->scrollPositionChangedViaDelegatedScrolling(scrollingCoordinator->rootScrollingNodeID(), unobscuredRect.origin); 179 180 180 if (auto drawingArea = _page->drawingArea()) { 181 if (isStableState) { 182 FloatRect fixedPosRect = [self fixedPositionRectFromExposedRect:unobscuredRect scale:scale]; 183 drawingArea->setCustomFixedPositionRect(fixedPosRect); 184 } 181 if (auto drawingArea = _page->drawingArea()) 185 182 drawingArea->updateDebugIndicator(); 186 }187 183 } 188 184 -
trunk/Source/WebKit2/WebProcess/WebPage/DrawingArea.h
r165124 r165235 92 92 virtual void setExposedRect(const WebCore::FloatRect&) = 0; 93 93 virtual WebCore::FloatRect exposedRect() const = 0; 94 virtual void setCustomFixedPositionRect(const WebCore::FloatRect&) = 0;95 94 #endif 96 95 #if PLATFORM(IOS) -
trunk/Source/WebKit2/WebProcess/WebPage/DrawingArea.messages.in
r164192 r165235 31 31 SetColorSpace(WebKit::ColorSpaceData colorSpace) 32 32 SetExposedRect(WebCore::FloatRect exposedRect) 33 SetCustomFixedPositionRect(WebCore::FloatRect fixedPositionRect)34 33 35 34 AdjustTransientZoom(double scale, WebCore::FloatPoint origin) -
trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm
r165124 r165235 1747 1747 1748 1748 m_page->mainFrame().view()->setScrollOffset(scrollPosition); 1749 1750 if (visibleContentRectUpdateInfo.inStableState()) 1751 m_page->mainFrame().view()->setCustomFixedPositionLayoutRect(enclosingIntRect(visibleContentRectUpdateInfo.customFixedPositionRect())); 1752 1749 1753 // FIXME: we should also update the frame view from unobscured rect. Altenatively, we can have it pull the values from ScrollView. 1750 1754 } -
trunk/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h
r165124 r165235 80 80 #endif 81 81 82 virtual void setCustomFixedPositionRect(const WebCore::FloatRect&) override;83 84 82 // WebCore::GraphicsLayerClient 85 83 virtual void notifyAnimationStarted(const WebCore::GraphicsLayer*, double time) override { } -
trunk/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm
r165124 r165235 284 284 } 285 285 286 void RemoteLayerTreeDrawingArea::setCustomFixedPositionRect(const FloatRect& fixedPositionRect)287 {288 #if PLATFORM(IOS)289 FrameView* frameView = m_webPage->corePage()->mainFrame().view();290 if (!frameView)291 return;292 293 frameView->setCustomFixedPositionLayoutRect(enclosingIntRect(fixedPositionRect));294 #endif295 }296 297 286 TiledBacking* RemoteLayerTreeDrawingArea::mainFrameTiledBacking() const 298 287 { -
trunk/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h
r164337 r165235 83 83 virtual WebCore::FloatRect exposedRect() const override { return m_scrolledExposedRect; } 84 84 85 virtual void setCustomFixedPositionRect(const WebCore::FloatRect&) override { }86 87 85 virtual bool supportsAsyncScrolling() override { return true; } 88 86
Note: See TracChangeset
for help on using the changeset viewer.