Changeset 161610 in webkit
- Timestamp:
- Jan 9, 2014 5:38:46 PM (10 years ago)
- Location:
- trunk/Source
- Files:
-
- 3 added
- 16 edited
- 4 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WTF/ChangeLog
r161601 r161610 1 2014-01-09 Simon Fraser <simon.fraser@apple.com> 2 3 Enable async scrolling for iOS 4 https://bugs.webkit.org/show_bug.cgi?id=126730 5 6 Reviewed by Tim Horton. 7 8 Turn on ENABLE_ASYNC_SCROLLING for iOS. 9 10 * wtf/FeatureDefines.h: 11 1 12 2014-01-09 Anders Carlsson <andersca@apple.com> 2 13 -
trunk/Source/WTF/wtf/FeatureDefines.h
r161601 r161610 57 57 #if PLATFORM(IOS) 58 58 59 #if !defined(ENABLE_ASYNC_SCROLLING) 60 #define ENABLE_ASYNC_SCROLLING 1 61 #endif 62 59 63 #if !defined(ENABLE_8BIT_TEXTRUN) 60 64 #define ENABLE_8BIT_TEXTRUN 1 -
trunk/Source/WebCore/ChangeLog
r161609 r161610 1 2014-01-09 Simon Fraser <simon.fraser@apple.com> 2 3 Enable async scrolling for iOS 4 https://bugs.webkit.org/show_bug.cgi?id=126730 5 6 Reviewed by Tim Horton. 7 8 Turn on ENABLE_ASYNC_SCROLLING for iOS. 9 10 Disable rubber-banding and scrollbar-related Mac code for PLATFORM(IOS), 11 provide stubs for scrolling nodes and scrolling state nodes, and an 12 iOS scrolling tree, and scrolling coordinator. 13 14 Move crollingCoordinator::create() into the platform implementation file. 15 16 * page/scrolling/ScrollingCoordinator.cpp: 17 (WebCore::ScrollingCoordinator::create): 18 * page/scrolling/ScrollingStateScrollingNode.cpp: 19 (WebCore::ScrollingStateScrollingNode::ScrollingStateScrollingNode): 20 (WebCore::ScrollingStateScrollingNode::setScrollbarPaintersFromScrollbars): 21 * page/scrolling/ScrollingStateScrollingNode.h: 22 * page/scrolling/ScrollingTree.h: 23 (WebCore::ScrollingTree::isScrollingTreeIOS): 24 * page/scrolling/ThreadedScrollingTree.h: 25 * page/scrolling/ios/ScrollingCoordinatorIOS.h: Copied from Source/WebKit2/UIProcess/Scrolling/RemoteScrollingTree.h. 26 * page/scrolling/ios/ScrollingCoordinatorIOS.mm: Copied from Source/WebCore/page/scrolling/mac/ScrollingCoordinatorMac.mm. 27 (WebCore::ScrollingCoordinator::create): 28 (WebCore::ScrollingCoordinatorIOS::ScrollingCoordinatorIOS): 29 (WebCore::ScrollingCoordinatorIOS::~ScrollingCoordinatorIOS): 30 (WebCore::ScrollingCoordinatorIOS::pageDestroyed): 31 (WebCore::ScrollingCoordinatorIOS::commitTreeStateIfNeeded): 32 (WebCore::ScrollingCoordinatorIOS::scheduleTreeStateCommit): 33 (WebCore::ScrollingCoordinatorIOS::scrollingStateTreeCommitterTimerFired): 34 (WebCore::ScrollingCoordinatorIOS::commitTreeState): 35 (WebCore::ScrollingCoordinatorIOS::createScrollingTreeNode): 36 * page/scrolling/ios/ScrollingTreeIOS.cpp: Added. 37 (WebCore::ScrollingTreeIOS::create): 38 (WebCore::ScrollingTreeIOS::ScrollingTreeIOS): 39 (WebCore::ScrollingTreeIOS::~ScrollingTreeIOS): 40 (WebCore::derefScrollingCoordinator): 41 (WebCore::ScrollingTreeIOS::invalidate): 42 (WebCore::ScrollingTreeIOS::commitNewTreeState): 43 (WebCore::ScrollingTreeIOS::updateMainFrameScrollPosition): 44 (WebCore::ScrollingTreeIOS::createNode): 45 * page/scrolling/ios/ScrollingTreeIOS.h: Copied from Source/WebCore/page/scrolling/ThreadedScrollingTree.h. 46 * page/scrolling/ios/ScrollingTreeScrollingNodeIOS.h: Added. 47 * page/scrolling/ios/ScrollingTreeScrollingNodeIOS.mm: Added. 48 (WebCore::ScrollingTreeScrollingNodeIOS::create): 49 (WebCore::ScrollingTreeScrollingNodeIOS::ScrollingTreeScrollingNodeIOS): 50 (WebCore::ScrollingTreeScrollingNodeIOS::~ScrollingTreeScrollingNodeIOS): 51 (WebCore::ScrollingTreeScrollingNodeIOS::updateBeforeChildren): 52 (WebCore::ScrollingTreeScrollingNodeIOS::updateAfterChildren): 53 (WebCore::ScrollingTreeScrollingNodeIOS::scrollPosition): 54 (WebCore::ScrollingTreeScrollingNodeIOS::setScrollPosition): 55 (WebCore::ScrollingTreeScrollingNodeIOS::setScrollPositionWithoutContentEdgeConstraints): 56 (WebCore::ScrollingTreeScrollingNodeIOS::setScrollLayerPosition): 57 (WebCore::ScrollingTreeScrollingNodeIOS::minimumScrollPosition): 58 (WebCore::ScrollingTreeScrollingNodeIOS::maximumScrollPosition): 59 (WebCore::ScrollingTreeScrollingNodeIOS::scrollBy): 60 (WebCore::ScrollingTreeScrollingNodeIOS::scrollByWithoutContentEdgeConstraints): 61 * page/scrolling/mac/ScrollingCoordinatorMac.mm: 62 (WebCore::ScrollingCoordinator::create): 63 * page/scrolling/mac/ScrollingTreeFixedNode.mm: 64 * page/scrolling/mac/ScrollingTreeStickyNode.mm: 65 1 66 2014-01-09 Myles C. Maxfield <mmaxfield@apple.com> 2 67 -
trunk/Source/WebCore/Configurations/WebCore.xcconfig
r161603 r161610 107 107 108 108 EXCLUDED_SOURCE_FILE_NAMES = $(EXCLUDED_SOURCE_FILE_NAMES_$(PLATFORM_NAME)); 109 EXCLUDED_SOURCE_FILE_NAMES_iphoneos = *.tiff *Cursor.png Cursor.cpp CursorMac.mm EventHandlerMac.mm HTMLConverter.mm KillRingMac.mm PlatformEventFactoryMac.mm SSLKeyGeneratorMac.cpp SearchPopupMenuMac.mm S haredTimerMac.mm WebVideoFullscreenController.mm WebVideoFullscreenHUDWindowController.mm WebWindowAnimation.mm;109 EXCLUDED_SOURCE_FILE_NAMES_iphoneos = *.tiff *Cursor.png Cursor.cpp CursorMac.mm EventHandlerMac.mm HTMLConverter.mm KillRingMac.mm PlatformEventFactoryMac.mm SSLKeyGeneratorMac.cpp SearchPopupMenuMac.mm ScrollingCoordinatorMac.mm ScrollingStateScrollingNodeMac.mm ScrollingTreeScrollingNodeMac.mm SharedTimerMac.mm WebVideoFullscreenController.mm WebVideoFullscreenHUDWindowController.mm WebWindowAnimation.mm; 110 110 EXCLUDED_SOURCE_FILE_NAMES_iphonesimulator = $(EXCLUDED_SOURCE_FILE_NAMES_iphoneos); 111 111 EXCLUDED_SOURCE_FILE_NAMES_macosx = *IOS.h *IOS.cpp *IOS.mm KillRingNone.cpp WAKAppKitStubs.h WAKClipView.h WAKResponder.h WAKScrollView.h WAKView.h WAKViewPrivate.h WAKWindow.h WKContentObservation.h WKGraphics.h WKTypes.h WKUtilities.h WKView.h WKViewPrivate.h WebCoreThread.h WebCoreThreadMessage.h WebCoreThreadRun.h WebCoreThreadSystemInterface.h; -
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
r161603 r161610 490 490 0FB8890E167D30160010CDA5 /* ScrollingStateStickyNode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FB8890C167D30160010CDA5 /* ScrollingStateStickyNode.cpp */; }; 491 491 0FB8890F167D30160010CDA5 /* ScrollingStateStickyNode.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FB8890D167D30160010CDA5 /* ScrollingStateStickyNode.h */; settings = {ATTRIBUTES = (Private, ); }; }; 492 0FC4E40D187F82E10045882C /* ScrollingCoordinatorIOS.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FC4E407187F82E10045882C /* ScrollingCoordinatorIOS.h */; }; 493 0FC4E40E187F82E10045882C /* ScrollingCoordinatorIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = 0FC4E408187F82E10045882C /* ScrollingCoordinatorIOS.mm */; }; 494 0FC4E40F187F82E10045882C /* ScrollingTreeIOS.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FC4E409187F82E10045882C /* ScrollingTreeIOS.cpp */; }; 495 0FC4E410187F82E10045882C /* ScrollingTreeIOS.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FC4E40A187F82E10045882C /* ScrollingTreeIOS.h */; }; 496 0FC4E411187F82E10045882C /* ScrollingTreeScrollingNodeIOS.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FC4E40B187F82E10045882C /* ScrollingTreeScrollingNodeIOS.h */; }; 497 0FC4E412187F82E10045882C /* ScrollingTreeScrollingNodeIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = 0FC4E40C187F82E10045882C /* ScrollingTreeScrollingNodeIOS.mm */; }; 492 498 0FCF33240F2B9715004B6795 /* ColorCG.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FCF33230F2B9715004B6795 /* ColorCG.cpp */; }; 493 499 0FCF332E0F2B9A25004B6795 /* WebLayer.mm in Sources */ = {isa = PBXBuildFile; fileRef = 0FCF332A0F2B9A25004B6795 /* WebLayer.mm */; }; … … 7218 7224 0FB8890C167D30160010CDA5 /* ScrollingStateStickyNode.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScrollingStateStickyNode.cpp; sourceTree = "<group>"; }; 7219 7225 0FB8890D167D30160010CDA5 /* ScrollingStateStickyNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScrollingStateStickyNode.h; sourceTree = "<group>"; }; 7226 0FC4E407187F82E10045882C /* ScrollingCoordinatorIOS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ScrollingCoordinatorIOS.h; path = ios/ScrollingCoordinatorIOS.h; sourceTree = "<group>"; }; 7227 0FC4E408187F82E10045882C /* ScrollingCoordinatorIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = ScrollingCoordinatorIOS.mm; path = ios/ScrollingCoordinatorIOS.mm; sourceTree = "<group>"; }; 7228 0FC4E409187F82E10045882C /* ScrollingTreeIOS.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ScrollingTreeIOS.cpp; path = ios/ScrollingTreeIOS.cpp; sourceTree = "<group>"; }; 7229 0FC4E40A187F82E10045882C /* ScrollingTreeIOS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ScrollingTreeIOS.h; path = ios/ScrollingTreeIOS.h; sourceTree = "<group>"; }; 7230 0FC4E40B187F82E10045882C /* ScrollingTreeScrollingNodeIOS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ScrollingTreeScrollingNodeIOS.h; path = ios/ScrollingTreeScrollingNodeIOS.h; sourceTree = "<group>"; }; 7231 0FC4E40C187F82E10045882C /* ScrollingTreeScrollingNodeIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = ScrollingTreeScrollingNodeIOS.mm; path = ios/ScrollingTreeScrollingNodeIOS.mm; sourceTree = "<group>"; }; 7220 7232 0FCF33230F2B9715004B6795 /* ColorCG.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ColorCG.cpp; sourceTree = "<group>"; }; 7221 7233 0FCF332A0F2B9A25004B6795 /* WebLayer.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebLayer.mm; sourceTree = "<group>"; }; … … 14441 14453 usesTabs = 0; 14442 14454 }; 14455 0FC4E406187F82D30045882C /* ios */ = { 14456 isa = PBXGroup; 14457 children = ( 14458 0FC4E407187F82E10045882C /* ScrollingCoordinatorIOS.h */, 14459 0FC4E408187F82E10045882C /* ScrollingCoordinatorIOS.mm */, 14460 0FC4E409187F82E10045882C /* ScrollingTreeIOS.cpp */, 14461 0FC4E40A187F82E10045882C /* ScrollingTreeIOS.h */, 14462 0FC4E40B187F82E10045882C /* ScrollingTreeScrollingNodeIOS.h */, 14463 0FC4E40C187F82E10045882C /* ScrollingTreeScrollingNodeIOS.mm */, 14464 ); 14465 name = ios; 14466 sourceTree = "<group>"; 14467 }; 14443 14468 14DFB33F0A7DF7630018F769 /* Derived Sources */ = { 14444 14469 isa = PBXGroup; … … 14665 14690 isa = PBXGroup; 14666 14691 children = ( 14692 0FC4E406187F82D30045882C /* ios */, 14667 14693 0FFD4D5E18651FA300512F6E /* AsyncScrollingCoordinator.cpp */, 14668 14694 0FFD4D5F18651FA300512F6E /* AsyncScrollingCoordinator.h */, … … 23728 23754 A8EA7D2B0A19385500A8EF5F /* HTMLImageLoader.h in Headers */, 23729 23755 A81369CC097374F600D74463 /* HTMLInputElement.h in Headers */, 23756 0FC4E410187F82E10045882C /* ScrollingTreeIOS.h in Headers */, 23730 23757 97BC849B12370A4B000C6161 /* HTMLInputStream.h in Headers */, 23731 23758 93309DE6099E64920056E581 /* HTMLInterchange.h in Headers */, … … 23740 23767 A8EA79F40A1916DF00A8EF5F /* HTMLMenuElement.h in Headers */, 23741 23768 2BE8E2C712A589EC00FAD550 /* HTMLMetaCharsetParser.h in Headers */, 23769 0FC4E40D187F82E10045882C /* ScrollingCoordinatorIOS.h in Headers */, 23742 23770 A871DC240A15205700B12A68 /* HTMLMetaElement.h in Headers */, 23743 23771 A454424B119B3661009BE912 /* HTMLMeterElement.h in Headers */, … … 25671 25699 BEF29EEC1715DD0900C4B4C9 /* VideoTrackPrivate.h in Headers */, 25672 25700 0705851B17FB44B4005F2BCB /* JSAllAudioCapabilities.h in Headers */, 25701 0FC4E411187F82E10045882C /* ScrollingTreeScrollingNodeIOS.h in Headers */, 25673 25702 CEF418CF1179678C009D112C /* ViewportArguments.h in Headers */, 25674 25703 3FFFF9AE159D9B060020BBD5 /* ViewportStyleResolver.h in Headers */, … … 27201 27230 F33F053D120B0DA500E5743A /* InspectorDebuggerAgent.cpp in Sources */, 27202 27231 7A24587B1021EAF4000A00AA /* InspectorDOMAgent.cpp in Sources */, 27232 0FC4E40F187F82E10045882C /* ScrollingTreeIOS.cpp in Sources */, 27203 27233 F3D4C47812E07663003DA150 /* InspectorDOMDebuggerAgent.cpp in Sources */, 27204 27234 7A74ECBA101839A600BF939E /* InspectorDOMStorageAgent.cpp in Sources */, … … 28221 28251 50D10D991545F5760096D288 /* RenderLayerFilterInfo.cpp in Sources */, 28222 28252 3C244FEBA375AC633F88BE6F /* RenderLayerModelObject.cpp in Sources */, 28253 0FC4E40E187F82E10045882C /* ScrollingCoordinatorIOS.mm in Sources */, 28223 28254 BC33FB1B0F30EE85002CDD7C /* RenderLineBoxList.cpp in Sources */, 28224 28255 ABB5419E0ACDDFE4002820EB /* RenderListBox.cpp in Sources */, … … 28907 28938 6E3FAE8E14733FDB00E42307 /* WebGLDepthTexture.cpp in Sources */, 28908 28939 6EBF0E5412A8929800DB1709 /* WebGLExtension.cpp in Sources */, 28940 0FC4E412187F82E10045882C /* ScrollingTreeScrollingNodeIOS.mm in Sources */, 28909 28941 49C7B9CE1042D32F0009D447 /* WebGLFramebuffer.cpp in Sources */, 28910 28942 6E47E66010B7944B00B186C8 /* WebGLGetInfo.cpp in Sources */, -
trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.cpp
r161373 r161610 46 46 #endif 47 47 48 #if ENABLE(ASYNC_SCROLLING)49 #include "ScrollingCoordinatorMac.h"50 #endif51 52 48 #if USE(COORDINATED_GRAPHICS) 53 49 #include "ScrollingCoordinatorCoordinatedGraphics.h" … … 60 56 namespace WebCore { 61 57 58 #if !PLATFORM(MAC) 62 59 PassRefPtr<ScrollingCoordinator> ScrollingCoordinator::create(Page* page) 63 60 { 64 #if USE(ACCELERATED_COMPOSITING) && ENABLE(ASYNC_SCROLLING)65 return adoptRef(new ScrollingCoordinatorMac(page));66 #endif67 68 61 #if USE(COORDINATED_GRAPHICS) 69 62 return adoptRef(new ScrollingCoordinatorCoordinatedGraphics(page)); … … 76 69 return adoptRef(new ScrollingCoordinator(page)); 77 70 } 71 #endif 78 72 79 73 ScrollingCoordinator::ScrollingCoordinator(Page* page) -
trunk/Source/WebCore/page/scrolling/ScrollingStateScrollingNode.cpp
r161315 r161610 42 42 ScrollingStateScrollingNode::ScrollingStateScrollingNode(ScrollingStateTree& stateTree, ScrollingNodeID nodeID) 43 43 : ScrollingStateNode(ScrollingNode, stateTree, nodeID) 44 #if PLATFORM(MAC) 44 #if PLATFORM(MAC) && !PLATFORM(IOS) 45 45 , m_verticalScrollbarPainter(0) 46 46 , m_horizontalScrollbarPainter(0) … … 58 58 ScrollingStateScrollingNode::ScrollingStateScrollingNode(const ScrollingStateScrollingNode& stateNode, ScrollingStateTree& adoptiveTree) 59 59 : ScrollingStateNode(stateNode, adoptiveTree) 60 #if PLATFORM(MAC) 60 #if PLATFORM(MAC) && !PLATFORM(IOS) 61 61 , m_verticalScrollbarPainter(stateNode.verticalScrollbarPainter()) 62 62 , m_horizontalScrollbarPainter(stateNode.horizontalScrollbarPainter()) … … 233 233 } 234 234 235 #if !(PLATFORM(MAC) && !PLATFORM(IOS)) 236 void ScrollingStateScrollingNode::setScrollbarPaintersFromScrollbars(Scrollbar*, Scrollbar*) 237 { 238 } 239 #endif 240 235 241 void ScrollingStateScrollingNode::dumpProperties(TextStream& ts, int indent) const 236 242 { -
trunk/Source/WebCore/page/scrolling/ScrollingStateScrollingNode.h
r161303 r161610 117 117 void setFooterLayer(const LayerRepresentation&); 118 118 119 #if PLATFORM(MAC) 119 #if PLATFORM(MAC) && !PLATFORM(IOS) 120 120 ScrollbarPainter verticalScrollbarPainter() const { return m_verticalScrollbarPainter; } 121 121 ScrollbarPainter horizontalScrollbarPainter() const { return m_horizontalScrollbarPainter; } … … 135 135 LayerRepresentation m_footerLayer; 136 136 137 #if PLATFORM(MAC) 137 #if PLATFORM(MAC) && !PLATFORM(IOS) 138 138 ScrollbarPainter m_verticalScrollbarPainter; 139 139 ScrollbarPainter m_horizontalScrollbarPainter; -
trunk/Source/WebCore/page/scrolling/ScrollingTree.h
r161373 r161610 59 59 virtual bool isThreadedScrollingTree() const { return false; } 60 60 virtual bool isRemoteScrollingTree() const { return false; } 61 virtual bool isScrollingTreeIOS() const { return false; } 61 62 62 63 virtual EventResult tryToHandleWheelEvent(const PlatformWheelEvent&) = 0; -
trunk/Source/WebCore/page/scrolling/ThreadedScrollingTree.h
r161276 r161610 48 48 virtual ~ThreadedScrollingTree(); 49 49 50 virtual bool isThreadedScrollingTree() const { return true; }51 52 50 virtual void commitNewTreeState(PassOwnPtr<ScrollingStateTree>) OVERRIDE; 53 51 … … 63 61 private: 64 62 explicit ThreadedScrollingTree(AsyncScrollingCoordinator*); 63 virtual bool isThreadedScrollingTree() const OVERRIDE { return true; } 65 64 66 65 virtual PassOwnPtr<ScrollingTreeNode> createNode(ScrollingNodeType, ScrollingNodeID) OVERRIDE; -
trunk/Source/WebCore/page/scrolling/ios/ScrollingCoordinatorIOS.h
r161609 r161610 24 24 */ 25 25 26 #ifndef RemoteScrollingTree_h27 #define RemoteScrollingTree_h26 #ifndef ScrollingCoordinatorIOS_h 27 #define ScrollingCoordinatorIOS_h 28 28 29 29 #if ENABLE(ASYNC_SCROLLING) 30 30 31 #include "RemoteScrollingCoordinator.h" 32 #include <WebCore/ScrollElasticityController.h> 33 #include <WebCore/ScrollingConstraints.h> 34 #include <WebCore/ScrollingTree.h> 31 #include "AsyncScrollingCoordinator.h" 35 32 36 namespace Web Kit{33 namespace WebCore { 37 34 38 class RemoteScrollingCoordinatorProxy; 35 class Scrollbar; 36 class ScrollingStateNode; 37 class ScrollingStateScrollingNode; 38 class ScrollingStateTree; 39 class ThreadedScrollingTree; 39 40 40 class RemoteScrollingTree : public WebCore::ScrollingTree{41 class ScrollingCoordinatorIOS : public AsyncScrollingCoordinator { 41 42 public: 42 static RefPtr<RemoteScrollingTree> create(RemoteScrollingCoordinatorProxy&);43 virtual ~ RemoteScrollingTree();43 explicit ScrollingCoordinatorIOS(Page*); 44 virtual ~ScrollingCoordinatorIOS(); 44 45 45 virtual bool isRemoteScrollingTree() const OVERRIDE { return true; } 46 virtual EventResult tryToHandleWheelEvent(const WebCore::PlatformWheelEvent&) OVERRIDE; 46 virtual void pageDestroyed(); 47 47 48 const RemoteScrollingCoordinatorProxy& scrollingCoordinatorProxy() const { return m_scrollingCoordinatorProxy; } 48 virtual void commitTreeStateIfNeeded() OVERRIDE; 49 50 // Handle the wheel event on the scrolling thread. Returns whether the event was handled or not. 51 virtual bool handleWheelEvent(FrameView*, const PlatformWheelEvent&) OVERRIDE { return false; } 49 52 50 53 private: 51 explicit RemoteScrollingTree(RemoteScrollingCoordinatorProxy&); 54 virtual PassOwnPtr<ScrollingTreeNode> createScrollingTreeNode(ScrollingNodeType, ScrollingNodeID) OVERRIDE; 55 virtual void scheduleTreeStateCommit() OVERRIDE; 52 56 53 #if PLATFORM(MAC) 54 virtual void handleWheelEventPhase(WebCore::PlatformWheelEventPhase) OVERRIDE; 55 #endif 56 virtual void updateMainFrameScrollPosition(const WebCore::IntPoint& scrollPosition, WebCore::SetOrSyncScrollingLayerPosition = WebCore::SyncScrollingLayerPosition) OVERRIDE; 57 void scrollingStateTreeCommitterTimerFired(Timer<ScrollingCoordinatorIOS>*); 58 void commitTreeState(); 57 59 58 virtual PassOwnPtr<WebCore::ScrollingTreeNode> createNode(WebCore::ScrollingNodeType, WebCore::ScrollingNodeID); 59 60 RemoteScrollingCoordinatorProxy& m_scrollingCoordinatorProxy; 60 Timer<ScrollingCoordinatorIOS> m_scrollingStateTreeCommitterTimer; 61 61 }; 62 62 63 SCROLLING_TREE_TYPE_CASTS(RemoteScrollingTree, isRemoteScrollingTree()); 64 65 } // namespace WebKit 63 } // namespace WebCore 66 64 67 65 #endif // ENABLE(ASYNC_SCROLLING) 68 66 69 #endif // RemoteScrollingTree_h67 #endif // ScrollingCoordinatorIOS_h -
trunk/Source/WebCore/page/scrolling/ios/ScrollingCoordinatorIOS.mm
r161609 r161610 1 1 /* 2 * Copyright (C) 201 1Apple Inc. All rights reserved.2 * Copyright (C) 2014 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 28 28 #if ENABLE(ASYNC_SCROLLING) 29 29 30 #import "ScrollingCoordinator Mac.h"30 #import "ScrollingCoordinatorIOS.h" 31 31 32 32 #include "FrameView.h" 33 33 #include "MainFrame.h" 34 34 #include "Page.h" 35 #include "PlatformWheelEvent.h"36 35 #include "Region.h" 37 36 #include "ScrollingStateTree.h" 38 37 #include "ScrollingThread.h" 39 38 #include "ScrollingTreeFixedNode.h" 40 #include "ScrollingTreeScrollingNode Mac.h"39 #include "ScrollingTreeScrollingNodeIOS.h" 41 40 #include "ScrollingTreeStickyNode.h" 42 #include "ThreadedScrollingTree.h" 43 #include "TiledBacking.h" 41 #include "ScrollingTreeIOS.h" 44 42 #include <wtf/Functional.h> 45 43 #include <wtf/MainThread.h> … … 48 46 namespace WebCore { 49 47 50 ScrollingCoordinatorMac::ScrollingCoordinatorMac(Page* page) 51 : AsyncScrollingCoordinator(page) 52 , m_scrollingStateTreeCommitterTimer(this, &ScrollingCoordinatorMac::scrollingStateTreeCommitterTimerFired) 48 PassRefPtr<ScrollingCoordinator> ScrollingCoordinator::create(Page* page) 53 49 { 54 setScrollingTree(ThreadedScrollingTree::create(this));50 return adoptRef(new ScrollingCoordinatorIOS(page)); 55 51 } 56 52 57 ScrollingCoordinatorMac::~ScrollingCoordinatorMac() 53 ScrollingCoordinatorIOS::ScrollingCoordinatorIOS(Page* page) 54 : AsyncScrollingCoordinator(page) 55 , m_scrollingStateTreeCommitterTimer(this, &ScrollingCoordinatorIOS::scrollingStateTreeCommitterTimerFired) 56 { 57 setScrollingTree(ScrollingTreeIOS::create(this)); 58 } 59 60 ScrollingCoordinatorIOS::~ScrollingCoordinatorIOS() 58 61 { 59 62 ASSERT(!scrollingTree()); 60 63 } 61 64 62 void ScrollingCoordinator Mac::pageDestroyed()65 void ScrollingCoordinatorIOS::pageDestroyed() 63 66 { 64 67 AsyncScrollingCoordinator::pageDestroyed(); … … 67 70 68 71 // Invalidating the scrolling tree will break the reference cycle between the ScrollingCoordinator and ScrollingTree objects. 69 RefPtr<ThreadedScrollingTree> scrollingTree = static_pointer_cast<ThreadedScrollingTree>(releaseScrollingTree()); 70 ScrollingThread::dispatch(bind(&ThreadedScrollingTree::invalidate, scrollingTree)); 72 releaseScrollingTree(); 71 73 } 72 74 73 void ScrollingCoordinator Mac::commitTreeStateIfNeeded()75 void ScrollingCoordinatorIOS::commitTreeStateIfNeeded() 74 76 { 75 77 if (!scrollingStateTree()->hasChangedProperties()) … … 80 82 } 81 83 82 bool ScrollingCoordinatorMac::handleWheelEvent(FrameView*, const PlatformWheelEvent& wheelEvent) 83 { 84 ASSERT(isMainThread()); 85 ASSERT(m_page); 86 87 if (scrollingTree()->willWheelEventStartSwipeGesture(wheelEvent)) 88 return false; 89 90 ScrollingThread::dispatch(bind(&ThreadedScrollingTree::handleWheelEvent, toThreadedScrollingTree(scrollingTree()), wheelEvent)); 91 return true; 92 } 93 94 void ScrollingCoordinatorMac::scheduleTreeStateCommit() 84 void ScrollingCoordinatorIOS::scheduleTreeStateCommit() 95 85 { 96 86 ASSERT(scrollingStateTree()->hasChangedProperties()); … … 102 92 } 103 93 104 void ScrollingCoordinator Mac::scrollingStateTreeCommitterTimerFired(Timer<ScrollingCoordinatorMac>*)94 void ScrollingCoordinatorIOS::scrollingStateTreeCommitterTimerFired(Timer<ScrollingCoordinatorIOS>*) 105 95 { 106 96 commitTreeState(); 107 97 } 108 98 109 void ScrollingCoordinator Mac::commitTreeState()99 void ScrollingCoordinatorIOS::commitTreeState() 110 100 { 111 101 ASSERT(scrollingStateTree()->hasChangedProperties()); 112 102 113 103 OwnPtr<ScrollingStateTree> treeState = scrollingStateTree()->commit(LayerRepresentation::PlatformLayerRepresentation); 114 ScrollingThread::dispatch(bind(&ThreadedScrollingTree::commitNewTreeState, toThreadedScrollingTree(scrollingTree()), treeState.release())); 115 116 updateTiledScrollingIndicator(); 104 // FIXME: figure out how to commit. 117 105 } 118 106 119 void ScrollingCoordinatorMac::updateTiledScrollingIndicator() 120 { 121 FrameView* frameView = m_page->mainFrame().view(); 122 if (!frameView) 123 return; 124 125 TiledBacking* tiledBacking = frameView->tiledBacking(); 126 if (!tiledBacking) 127 return; 128 129 ScrollingModeIndication indicatorMode; 130 if (shouldUpdateScrollLayerPositionSynchronously()) 131 indicatorMode = SynchronousScrollingBecauseOfStyleIndication; 132 else if (scrollingStateTree()->rootStateNode() && scrollingStateTree()->rootStateNode()->wheelEventHandlerCount()) 133 indicatorMode = SynchronousScrollingBecauseOfEventHandlersIndication; 134 else 135 indicatorMode = AsyncScrollingIndication; 136 137 tiledBacking->setScrollingModeIndication(indicatorMode); 138 } 139 140 PassOwnPtr<ScrollingTreeNode> ScrollingCoordinatorMac::createScrollingTreeNode(ScrollingNodeType nodeType, ScrollingNodeID nodeID) 107 PassOwnPtr<ScrollingTreeNode> ScrollingCoordinatorIOS::createScrollingTreeNode(ScrollingNodeType nodeType, ScrollingNodeID nodeID) 141 108 { 142 109 ASSERT(scrollingTree()); … … 144 111 switch (nodeType) { 145 112 case ScrollingNode: 146 return ScrollingTreeScrollingNode Mac::create(*scrollingTree(), nodeID);113 return ScrollingTreeScrollingNodeIOS::create(*scrollingTree(), nodeID); 147 114 case FixedNode: 148 115 return ScrollingTreeFixedNode::create(*scrollingTree(), nodeID); -
trunk/Source/WebCore/page/scrolling/ios/ScrollingTreeIOS.h
r161609 r161610 24 24 */ 25 25 26 #ifndef ThreadedScrollingTree_h27 #define ThreadedScrollingTree_h26 #ifndef ScrollingTreeIOS_h 27 #define ScrollingTreeIOS_h 28 28 29 29 #if ENABLE(ASYNC_SCROLLING) … … 38 38 class AsyncScrollingCoordinator; 39 39 40 // The ThreadedScrollingTree class lives almost exclusively on the scrolling thread and manages the 41 // hierarchy of scrollable regions on the page. It's also responsible for dispatching events 42 // to the correct scrolling tree nodes or dispatching events back to the ScrollingCoordinator 43 // object on the main thread if they can't be handled on the scrolling thread for various reasons. 44 class ThreadedScrollingTree : public ScrollingTree { 40 class ScrollingTreeIOS : public ScrollingTree { 45 41 public: 46 static RefPtr<ThreadedScrollingTree> create(AsyncScrollingCoordinator*); 47 48 virtual ~ThreadedScrollingTree(); 49 50 virtual bool isThreadedScrollingTree() const { return true; } 42 static RefPtr<ScrollingTreeIOS> create(AsyncScrollingCoordinator*); 43 virtual ~ScrollingTreeIOS(); 51 44 52 45 virtual void commitNewTreeState(PassOwnPtr<ScrollingStateTree>) OVERRIDE; 53 46 54 virtual void handleWheelEvent(const PlatformWheelEvent&) OVERRIDE; 55 56 // Can be called from any thread. Will try to handle the wheel event on the scrolling thread. 57 // Returns true if the wheel event can be handled on the scrolling thread and false if the 58 // event must be sent again to the WebCore event handler. 59 virtual EventResult tryToHandleWheelEvent(const PlatformWheelEvent&) OVERRIDE; 47 // No wheel events on iOS 48 virtual void handleWheelEvent(const PlatformWheelEvent&) OVERRIDE { } 49 virtual EventResult tryToHandleWheelEvent(const PlatformWheelEvent&) OVERRIDE { return DidNotHandleEvent; } 60 50 61 51 virtual void invalidate() OVERRIDE; 62 52 63 53 private: 64 explicit ThreadedScrollingTree(AsyncScrollingCoordinator*); 54 explicit ScrollingTreeIOS(AsyncScrollingCoordinator*); 55 virtual bool isScrollingTreeIOS() const OVERRIDE { return true; } 65 56 66 57 virtual PassOwnPtr<ScrollingTreeNode> createNode(ScrollingNodeType, ScrollingNodeID) OVERRIDE; … … 68 59 virtual void updateMainFrameScrollPosition(const IntPoint& scrollPosition, SetOrSyncScrollingLayerPosition = SyncScrollingLayerPosition) OVERRIDE; 69 60 #if PLATFORM(MAC) 70 virtual void handleWheelEventPhase(PlatformWheelEventPhase) OVERRIDE ;61 virtual void handleWheelEventPhase(PlatformWheelEventPhase) OVERRIDE { } 71 62 #endif 72 63 … … 74 65 }; 75 66 76 SCROLLING_TREE_TYPE_CASTS( ThreadedScrollingTree, isThreadedScrollingTree());67 SCROLLING_TREE_TYPE_CASTS(ScrollingTreeIOS, isScrollingTreeIOS()); 77 68 78 69 } // namespace WebCore … … 80 71 #endif // ENABLE(ASYNC_SCROLLING) 81 72 82 #endif // ThreadedScrollingTree_h73 #endif // ScrollingTreeIOS_h -
trunk/Source/WebCore/page/scrolling/ios/ScrollingTreeScrollingNodeIOS.h
r161609 r161610 24 24 */ 25 25 26 #ifndef RemoteScrollingTree_h27 #define RemoteScrollingTree_h26 #ifndef ScrollingTreeScrollingNodeIOS_h 27 #define ScrollingTreeScrollingNodeIOS_h 28 28 29 29 #if ENABLE(ASYNC_SCROLLING) 30 30 31 #include "RemoteScrollingCoordinator.h" 32 #include <WebCore/ScrollElasticityController.h> 33 #include <WebCore/ScrollingConstraints.h> 34 #include <WebCore/ScrollingTree.h> 31 #include "ScrollingTreeScrollingNode.h" 32 #include <wtf/RetainPtr.h> 35 33 36 namespace WebKit { 34 OBJC_CLASS CALayer; 37 35 38 class RemoteScrollingCoordinatorProxy; 36 namespace WebCore { 39 37 40 class RemoteScrollingTree : public WebCore::ScrollingTree {38 class ScrollingTreeScrollingNodeIOS : public ScrollingTreeScrollingNode { 41 39 public: 42 static RefPtr<RemoteScrollingTree> create(RemoteScrollingCoordinatorProxy&); 43 virtual ~RemoteScrollingTree(); 44 45 virtual bool isRemoteScrollingTree() const OVERRIDE { return true; } 46 virtual EventResult tryToHandleWheelEvent(const WebCore::PlatformWheelEvent&) OVERRIDE; 47 48 const RemoteScrollingCoordinatorProxy& scrollingCoordinatorProxy() const { return m_scrollingCoordinatorProxy; } 40 static PassOwnPtr<ScrollingTreeScrollingNode> create(ScrollingTree&, ScrollingNodeID); 41 virtual ~ScrollingTreeScrollingNodeIOS(); 49 42 50 43 private: 51 explicit RemoteScrollingTree(RemoteScrollingCoordinatorProxy&);44 ScrollingTreeScrollingNodeIOS(ScrollingTree&, ScrollingNodeID); 52 45 53 #if PLATFORM(MAC) 54 virtual void handleWheelEventPhase(WebCore::PlatformWheelEventPhase) OVERRIDE;55 #endif 56 virtual void updateMainFrameScrollPosition(const WebCore::IntPoint& scrollPosition, WebCore::SetOrSyncScrollingLayerPosition = WebCore::SyncScrollingLayerPosition) OVERRIDE;46 // ScrollingTreeNode member functions. 47 virtual void updateBeforeChildren(const ScrollingStateNode&) OVERRIDE; 48 virtual void updateAfterChildren(const ScrollingStateNode&) OVERRIDE; 49 virtual void handleWheelEvent(const PlatformWheelEvent&) OVERRIDE { } 57 50 58 virtual PassOwnPtr<WebCore::ScrollingTreeNode> createNode(WebCore::ScrollingNodeType, WebCore::ScrollingNodeID); 59 60 RemoteScrollingCoordinatorProxy& m_scrollingCoordinatorProxy; 51 IntPoint scrollPosition() const; 52 void setScrollPosition(const IntPoint&); 53 void setScrollPositionWithoutContentEdgeConstraints(const IntPoint&); 54 55 void setScrollLayerPosition(const IntPoint&); 56 57 IntPoint minimumScrollPosition() const; 58 IntPoint maximumScrollPosition() const; 59 60 void scrollBy(const IntSize&); 61 void scrollByWithoutContentEdgeConstraints(const IntSize&); 62 63 RetainPtr<CALayer> m_scrollLayer; 64 RetainPtr<CALayer> m_counterScrollingLayer; 65 RetainPtr<CALayer> m_headerLayer; 66 RetainPtr<CALayer> m_footerLayer; 67 IntPoint m_probableMainThreadScrollPosition; 61 68 }; 62 69 63 SCROLLING_TREE_TYPE_CASTS(RemoteScrollingTree, isRemoteScrollingTree()); 64 65 } // namespace WebKit 70 } // namespace WebCore 66 71 67 72 #endif // ENABLE(ASYNC_SCROLLING) 68 73 69 #endif // RemoteScrollingTree_h74 #endif // ScrollingTreeScrollingNodeIOS_h -
trunk/Source/WebCore/page/scrolling/mac/ScrollingCoordinatorMac.mm
r161315 r161610 47 47 48 48 namespace WebCore { 49 50 PassRefPtr<ScrollingCoordinator> ScrollingCoordinator::create(Page* page) 51 { 52 return adoptRef(new ScrollingCoordinatorMac(page)); 53 } 49 54 50 55 ScrollingCoordinatorMac::ScrollingCoordinatorMac(Page* page) … … 153 158 } 154 159 155 156 160 } // namespace WebCore 157 161 -
trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeFixedNode.mm
r161303 r161610 31 31 #include "ScrollingStateFixedNode.h" 32 32 #include "ScrollingTree.h" 33 #include <QuartzCore/CALayer.h> 33 34 34 35 namespace WebCore { -
trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeStickyNode.mm
r161303 r161610 31 31 #include "ScrollingStateStickyNode.h" 32 32 #include "ScrollingTree.h" 33 #include <QuartzCore/CALayer.h> 33 34 34 35 namespace WebCore { -
trunk/Source/WebKit2/ChangeLog
r161609 r161610 1 2014-01-09 Simon Fraser <simon.fraser@apple.com> 2 3 Enable async scrolling for iOS 4 https://bugs.webkit.org/show_bug.cgi?id=126730 5 6 Reviewed by Tim Horton. 7 8 Turn on ENABLE_ASYNC_SCROLLING for iOS. 9 10 On iOS, create ScrollingTreeScrollingNodeIOS nodes. 11 12 * UIProcess/Scrolling/RemoteScrollingTree.cpp: 13 (WebKit::RemoteScrollingTree::createNode): 14 * UIProcess/Scrolling/RemoteScrollingTree.h: 15 1 16 2014-01-06 Gavin Barraclough <barraclough@apple.com> 2 17 -
trunk/Source/WebKit2/UIProcess/Scrolling/RemoteScrollingTree.cpp
r161529 r161610 32 32 #include "RemoteScrollingCoordinatorProxy.h" 33 33 #include <WebCore/ScrollingTreeFixedNode.h> 34 #include <WebCore/ScrollingTreeStickyNode.h> 35 36 #if PLATFORM(IOS) 37 #include <WebCore/ScrollingTreeScrollingNodeIOS.h> 38 #else 34 39 #include <WebCore/ScrollingTreeScrollingNodeMac.h> 35 # include <WebCore/ScrollingTreeStickyNode.h>40 #endif 36 41 37 42 using namespace WebCore; … … 82 87 switch (nodeType) { 83 88 case ScrollingNode: 89 #if PLATFORM(IOS) 90 return ScrollingTreeScrollingNodeIOS::create(*this, nodeID); 91 #else 84 92 return ScrollingTreeScrollingNodeMac::create(*this, nodeID); 93 #endif 85 94 case FixedNode: 86 95 return ScrollingTreeFixedNode::create(*this, nodeID); -
trunk/Source/WebKit2/UIProcess/Scrolling/RemoteScrollingTree.h
r161529 r161610 30 30 31 31 #include "RemoteScrollingCoordinator.h" 32 #include <WebCore/ScrollElasticityController.h>33 32 #include <WebCore/ScrollingConstraints.h> 34 33 #include <WebCore/ScrollingTree.h>
Note: See TracChangeset
for help on using the changeset viewer.