Changeset 178723 in webkit
- Timestamp:
- Jan 20, 2015 10:40:33 AM (9 years ago)
- Location:
- trunk/Source
- Files:
-
- 2 added
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r178718 r178723 1 2015-01-19 Simon Fraser <simon.fraser@apple.com> 2 3 Add a way to collect scrolling performance data (viewport tile coverage) with UI-side compositing 4 https://bugs.webkit.org/show_bug.cgi?id=140474 5 6 Reviewed by Tim Horton. 7 8 Add accessors for standard names for container CALayer for each of the tile grids, 9 and when tile grids are swapped, update those names as appropriate. 10 11 * WebCore.exp.in: 12 * platform/graphics/ca/TileController.cpp: 13 (WebCore::TileController::tileGridContainerLayerName): 14 (WebCore::TileController::zoomedOutTileGridContainerLayerName): 15 (WebCore::TileController::setContentsScale): 16 * platform/graphics/ca/TileController.h: 17 * platform/graphics/ca/TileGrid.cpp: 18 (WebCore::TileGrid::TileGrid): 19 (WebCore::TileGrid::setIsZoomedOutTileGrid): 20 * platform/graphics/ca/TileGrid.h: 21 1 22 2015-01-20 Csaba Osztrogonác <ossy@webkit.org> 2 23 -
trunk/Source/WebCore/WebCore.exp.in
r178661 r178723 479 479 __ZN7WebCore14TileController23setTileDebugBorderColorENS_5ColorE 480 480 __ZN7WebCore14TileController23setTileDebugBorderWidthEf 481 __ZN7WebCore14TileController26tileGridContainerLayerNameEv 481 482 __ZN7WebCore14TileController27tileCacheLayerBoundsChangedEv 482 483 __ZN7WebCore14TileControllerC1EPNS_15PlatformCALayerE -
trunk/Source/WebCore/platform/graphics/ca/TileController.cpp
r176459 r178723 41 41 namespace WebCore { 42 42 43 String TileController::tileGridContainerLayerName() 44 { 45 return ASCIILiteral("TileGrid Container Layer"); 46 } 47 48 String TileController::zoomedOutTileGridContainerLayerName() 49 { 50 return ASCIILiteral("Zoomed Out TileGrid Container Layer"); 51 } 52 43 53 TileController::TileController(PlatformCALayer* rootPlatformLayer) 44 54 : m_tileCacheLayer(rootPlatformLayer) … … 114 124 if (m_zoomedOutTileGrid && m_zoomedOutTileGrid->scale() == scale) { 115 125 m_tileGrid = WTF::move(m_zoomedOutTileGrid); 126 m_tileGrid->setIsZoomedOutTileGrid(false); 116 127 m_tileGrid->revalidateTiles(0); 117 128 return; … … 120 131 if (m_zoomedOutContentsScale && m_zoomedOutContentsScale == tileGrid().scale() && tileGrid().scale() != scale && !m_hasTilesWithTemporaryScaleFactor) { 121 132 m_zoomedOutTileGrid = WTF::move(m_tileGrid); 133 m_zoomedOutTileGrid->setIsZoomedOutTileGrid(true); 122 134 m_tileGrid = std::make_unique<TileGrid>(*this); 123 135 } -
trunk/Source/WebCore/platform/graphics/ca/TileController.h
r177786 r178723 55 55 WEBCORE_EXPORT explicit TileController(PlatformCALayer*); 56 56 ~TileController(); 57 58 static String tileGridContainerLayerName(); 59 static String zoomedOutTileGridContainerLayerName(); 57 60 58 61 WEBCORE_EXPORT void tileCacheLayerBoundsChanged(); -
trunk/Source/WebCore/platform/graphics/ca/TileGrid.cpp
r176459 r178723 46 46 , m_cohortRemovalTimer(*this, &TileGrid::cohortRemovalTimerFired) 47 47 { 48 #ifndef NDEBUG 49 m_containerLayer.get().setName("TileGrid Container Layer"); 50 #endif 48 m_containerLayer.get().setName(TileController::tileGridContainerLayerName()); 51 49 } 52 50 … … 57 55 for (auto& tile : m_tiles.values()) 58 56 tile.layer->setOwner(nullptr); 57 } 58 59 void TileGrid::setIsZoomedOutTileGrid(bool isZoomedOutGrid) 60 { 61 if (isZoomedOutGrid) 62 m_containerLayer.get().setName(TileController::zoomedOutTileGridContainerLayerName()); 63 else 64 m_containerLayer.get().setName(TileController::tileGridContainerLayerName()); 59 65 } 60 66 -
trunk/Source/WebCore/platform/graphics/ca/TileGrid.h
r176459 r178723 53 53 54 54 PlatformCALayer& containerLayer() { return m_containerLayer; } 55 56 void setIsZoomedOutTileGrid(bool); 55 57 56 58 void setScale(float); -
trunk/Source/WebKit2/ChangeLog
r178710 r178723 1 2015-01-19 Simon Fraser <simon.fraser@apple.com> 2 3 Add a way to collect scrolling performance data (viewport tile coverage) with UI-side compositing 4 https://bugs.webkit.org/show_bug.cgi?id=140474 5 6 Reviewed by Tim Horton. 7 8 Add a private method to enable scrolling data collection to WKWebView. When enabled, create 9 a RemoteLayerTreeScrollingPerformanceData object that collects "blank pixel" data on 10 every layer tree commit and scroll, and stores them in a vector. A second SPI call 11 allows retrieval of an NSArray of this data. 12 13 To allow RemoteLayerTreeScrollingPerformanceData to find the correct layer which 14 contains the main tile grid, we set a layer name on the appropriate layer (even 15 in release builds). 16 17 * UIProcess/API/Cocoa/WKWebView.mm: 18 (-[WKWebView visibleRectInScreenCoordinates]): 19 (-[WKWebView _didCommitLayerTree:]): 20 (-[WKWebView scrollViewDidScroll:]): 21 (-[WKWebView _setScrollPerformanceDataCollectionEnabled:]): 22 (-[WKWebView _scrollPerformanceDataCollectionEnabled]): 23 (-[WKWebView _scrollPerformanceData]): 24 * UIProcess/API/Cocoa/WKWebViewPrivate.h: 25 * UIProcess/Cocoa/RemoteLayerTreeScrollingPerformanceData.h: Added. 26 (WebKit::RemoteLayerTreeScrollingPerformanceData::BlankPixelCount::BlankPixelCount): 27 * UIProcess/Cocoa/RemoteLayerTreeScrollingPerformanceData.mm: Added. 28 (WebKit::RemoteLayerTreeScrollingPerformanceData::RemoteLayerTreeScrollingPerformanceData): 29 (WebKit::RemoteLayerTreeScrollingPerformanceData::~RemoteLayerTreeScrollingPerformanceData): 30 (WebKit::RemoteLayerTreeScrollingPerformanceData::didCommitLayerTree): 31 (WebKit::RemoteLayerTreeScrollingPerformanceData::didScroll): 32 (WebKit::RemoteLayerTreeScrollingPerformanceData::BlankPixelCount::canCoalesce): 33 (WebKit::RemoteLayerTreeScrollingPerformanceData::appendBlankPixelCount): 34 (WebKit::RemoteLayerTreeScrollingPerformanceData::data): 35 (WebKit::findTileGridContainerLayer): 36 (WebKit::RemoteLayerTreeScrollingPerformanceData::blankPixelCount): 37 * UIProcess/WebPageProxy.cpp: 38 (WebKit::WebPageProxy::WebPageProxy): 39 (WebKit::WebPageProxy::setScrollPerformanceDataCollectionEnabled): 40 * UIProcess/WebPageProxy.h: 41 (WebKit::WebPageProxy::scrollPerformanceDataCollectionEnabled): 42 (WebKit::WebPageProxy::scrollingPerformanceData): 43 * WebKit2.xcodeproj/project.pbxproj: 44 1 45 2015-01-19 Dean Jackson <dino@apple.com> 2 46 -
trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm
r178688 r178723 36 36 #import "LegacySessionStateCoding.h" 37 37 #import "NavigationState.h" 38 #import "RemoteLayerTreeScrollingPerformanceData.h" 38 39 #import "RemoteLayerTreeTransaction.h" 39 40 #import "RemoteObjectRegistry.h" … … 849 850 } 850 851 852 - (WebCore::FloatRect)visibleRectInViewCoordinates 853 { 854 WebCore::FloatRect bounds = self.bounds; 855 bounds.moveBy([_scrollView contentOffset]); 856 WebCore::FloatRect contentViewBounds = [_contentView bounds]; 857 bounds.intersect(contentViewBounds); 858 return bounds; 859 } 860 851 861 // WebCore stores the page scale factor as float instead of double. When we get a scale from WebCore, 852 862 // we need to ignore differences that are within a small rounding error on floats. … … 919 929 [self _updateVisibleContentRects]; 920 930 } 931 932 if (WebKit::RemoteLayerTreeScrollingPerformanceData* scrollPerfData = _page->scrollingPerformanceData()) 933 scrollPerfData->didCommitLayerTree([self visibleRectInViewCoordinates]); 921 934 } 922 935 … … 1377 1390 1378 1391 [self _updateVisibleContentRects]; 1392 1393 if (WebKit::RemoteLayerTreeScrollingPerformanceData* scrollPerfData = _page->scrollingPerformanceData()) 1394 scrollPerfData->didScroll([self visibleRectInViewCoordinates]); 1379 1395 } 1380 1396 … … 2115 2131 } 2116 2132 2133 #pragma mark scrollperf methods 2134 2135 - (void)_setScrollPerformanceDataCollectionEnabled:(BOOL)enabled 2136 { 2137 _page->setScrollPerformanceDataCollectionEnabled(enabled); 2138 } 2139 2140 - (BOOL)_scrollPerformanceDataCollectionEnabled 2141 { 2142 return _page->scrollPerformanceDataCollectionEnabled(); 2143 } 2144 2145 - (NSArray *)_scrollPerformanceData 2146 { 2147 #if PLATFORM(IOS) 2148 if (WebKit::RemoteLayerTreeScrollingPerformanceData* scrollPefData = _page->scrollingPerformanceData()) 2149 return scrollPefData->data(); 2150 #endif 2151 return nil; 2152 } 2153 2117 2154 #pragma mark iOS-specific methods 2118 2155 -
trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewPrivate.h
r178630 r178723 187 187 @property (nonatomic, readonly, getter=_isDisplayingStandaloneImageDocument) BOOL _displayingStandaloneImageDocument; 188 188 189 @property (nonatomic, setter=_setScrollPerformanceDataCollectionEnabled:) BOOL _scrollPerformanceDataCollectionEnabled WK_AVAILABLE(WK_MAC_TBA, WK_IOS_TBA); 190 @property (nonatomic, readonly) NSArray *_scrollPerformanceData WK_AVAILABLE(WK_MAC_TBA, WK_IOS_TBA); 191 189 192 @end 190 193 -
trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp
r178699 r178723 129 129 130 130 #if PLATFORM(COCOA) 131 #include "RemoteLayerTreeDrawingAreaProxy.h" 132 #include "RemoteLayerTreeScrollingPerformanceData.h" 131 133 #include "ViewSnapshotStore.h" 132 134 #include <WebCore/RunLoopObserver.h> … … 134 136 135 137 #if PLATFORM(IOS) 136 #include "RemoteLayerTreeDrawingAreaProxy.h"137 138 #include "WebVideoFullscreenManagerProxy.h" 138 139 #include "WebVideoFullscreenManagerProxyMessages.h" … … 379 380 , m_muted(false) 380 381 , m_mayStartMediaWhenInWindow(true) 382 , m_waitingForDidUpdateViewState(false) 383 #if PLATFORM(COCOA) 384 , m_scrollPerformanceDataCollectionEnabled(false) 385 #endif 381 386 , m_scrollPinningBehavior(DoNotPin) 382 387 , m_navigationID(0) … … 5337 5342 } 5338 5343 5344 void WebPageProxy::setScrollPerformanceDataCollectionEnabled(bool enabled) 5345 { 5346 if (enabled == m_scrollPerformanceDataCollectionEnabled) 5347 return; 5348 5349 m_scrollPerformanceDataCollectionEnabled = enabled; 5350 5351 if (m_scrollPerformanceDataCollectionEnabled && !m_scrollingPerformanceData) 5352 m_scrollingPerformanceData = std::make_unique<RemoteLayerTreeScrollingPerformanceData>(downcast<RemoteLayerTreeDrawingAreaProxy>(*m_drawingArea)); 5353 else if (!m_scrollPerformanceDataCollectionEnabled) 5354 m_scrollingPerformanceData = nullptr; 5355 } 5339 5356 #endif 5340 5357 -
trunk/Source/WebKit2/UIProcess/WebPageProxy.h
r178699 r178723 162 162 class NativeWebWheelEvent; 163 163 class PageClient; 164 class RemoteLayerTreeScrollingPerformanceData; 164 165 class RemoteLayerTreeTransaction; 165 166 class RemoteScrollingCoordinatorProxy; … … 528 529 void confirmCompositionAsync(); 529 530 531 void setScrollPerformanceDataCollectionEnabled(bool); 532 bool scrollPerformanceDataCollectionEnabled() const { return m_scrollPerformanceDataCollectionEnabled; } 533 RemoteLayerTreeScrollingPerformanceData* scrollingPerformanceData() { return m_scrollingPerformanceData.get(); } 534 #endif // PLATFORM(COCOA) 535 530 536 #if PLATFORM(MAC) 531 537 void insertDictatedTextAsync(const String& text, const EditingRange& replacementRange, const Vector<WebCore::TextAlternativeWithRange>& dictationAlternatives, bool registerUndoGroup); … … 544 550 bool executeKeypressCommands(const Vector<WebCore::KeypressCommand>&); 545 551 void cancelComposition(); 546 #endif 552 #endif // !USE(ASYNC_NSTEXTINPUTCLIENT) 547 553 548 554 WKView* wkView() const; 549 555 void intrinsicContentSizeDidChange(const WebCore::IntSize& intrinsicContentSize); 550 556 CGRect boundsOfLayerInLayerBackedWindowCoordinates(CALayer *) const; 551 #endif 552 #endif // PLATFORM(COCOA) 557 #endif // PLATFORM(MAC) 558 553 559 #if PLATFORM(EFL) 554 560 void handleInputMethodKeydown(bool& handled); … … 557 563 void cancelComposition(); 558 564 #endif 565 559 566 #if PLATFORM(GTK) 560 567 PlatformWidget viewWidget(); … … 562 569 void setBackgroundColor(const WebCore::Color& color) { m_backgroundColor = color; } 563 570 #endif 571 564 572 #if USE(COORDINATED_GRAPHICS_MULTIPROCESS) 565 573 void commitPageTransitionViewport(); … … 569 577 void handleWheelEvent(const NativeWebWheelEvent&); 570 578 void handleKeyboardEvent(const NativeWebKeyboardEvent&); 579 571 580 #if ENABLE(IOS_TOUCH_EVENTS) 572 581 void handleTouchEventSynchronously(const NativeWebTouchEvent&); 573 582 void handleTouchEventAsynchronously(const NativeWebTouchEvent&); 583 574 584 #elif ENABLE(TOUCH_EVENTS) 575 585 void handleTouchEvent(const NativeWebTouchEvent&); … … 1618 1628 HashMap<String, String> m_temporaryPDFFiles; 1619 1629 std::unique_ptr<WebCore::RunLoopObserver> m_viewStateChangeDispatcher; 1630 1631 std::unique_ptr<RemoteLayerTreeScrollingPerformanceData> m_scrollingPerformanceData; 1632 bool m_scrollPerformanceDataCollectionEnabled; 1620 1633 #endif 1621 1634 UserObservablePageToken m_pageIsUserObservableCount; -
trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj
r178685 r178723 121 121 0FF24A2D1879E4BC003ABF0C /* RemoteLayerTreeDrawingAreaProxyMessageReceiver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FF24A2B1879E4BC003ABF0C /* RemoteLayerTreeDrawingAreaProxyMessageReceiver.cpp */; }; 122 122 0FF24A2E1879E4BC003ABF0C /* RemoteLayerTreeDrawingAreaProxyMessages.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FF24A2C1879E4BC003ABF0C /* RemoteLayerTreeDrawingAreaProxyMessages.h */; }; 123 0FF2649F1A1FF9C6001FE759 /* RemoteLayerTreeScrollingPerformanceData.mm in Sources */ = {isa = PBXBuildFile; fileRef = 0F707C771A1FEE8300DA7A45 /* RemoteLayerTreeScrollingPerformanceData.mm */; }; 124 0FF264A01A1FF9CC001FE759 /* RemoteLayerTreeScrollingPerformanceData.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F707C791A1FEEA300DA7A45 /* RemoteLayerTreeScrollingPerformanceData.h */; }; 123 125 1A002D43196B337000B9AD44 /* _WKSessionStateInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A002D42196B337000B9AD44 /* _WKSessionStateInternal.h */; }; 124 126 1A002D44196B338900B9AD44 /* _WKSessionState.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A002D3F196B329400B9AD44 /* _WKSessionState.h */; settings = {ATTRIBUTES = (Private, ); }; }; … … 2112 2114 0F5E200118E77051003EC3E5 /* PlatformCAAnimationRemote.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = PlatformCAAnimationRemote.mm; sourceTree = "<group>"; }; 2113 2115 0F5E200218E77051003EC3E5 /* PlatformCAAnimationRemote.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlatformCAAnimationRemote.h; sourceTree = "<group>"; }; 2116 0F707C771A1FEE8300DA7A45 /* RemoteLayerTreeScrollingPerformanceData.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = RemoteLayerTreeScrollingPerformanceData.mm; sourceTree = "<group>"; }; 2117 0F707C791A1FEEA300DA7A45 /* RemoteLayerTreeScrollingPerformanceData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RemoteLayerTreeScrollingPerformanceData.h; sourceTree = "<group>"; }; 2114 2118 0F931C1A18C5711900DBA7C3 /* ScrollingTreeOverflowScrollingNodeIOS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ScrollingTreeOverflowScrollingNodeIOS.h; path = Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.h; sourceTree = "<group>"; }; 2115 2119 0F931C1B18C5711900DBA7C3 /* ScrollingTreeOverflowScrollingNodeIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = ScrollingTreeOverflowScrollingNodeIOS.mm; path = Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm; sourceTree = "<group>"; }; … … 4768 4772 1A002D47196B345D00B9AD44 /* SessionStateCoding.h */, 4769 4773 1A002D46196B345D00B9AD44 /* SessionStateCoding.mm */, 4774 0F707C791A1FEEA300DA7A45 /* RemoteLayerTreeScrollingPerformanceData.h */, 4775 0F707C771A1FEE8300DA7A45 /* RemoteLayerTreeScrollingPerformanceData.mm */, 4770 4776 1AFE436418B6C081009C7A48 /* UIDelegate.h */, 4771 4777 1AFE436318B6C081009C7A48 /* UIDelegate.mm */, … … 7766 7772 BC032D8D10F437A00058C15A /* WebFrame.h in Headers */, 7767 7773 BCE469771214F27B000B98EB /* WebFrameListenerProxy.h in Headers */, 7774 0FF264A01A1FF9CC001FE759 /* RemoteLayerTreeScrollingPerformanceData.h in Headers */, 7768 7775 BC032D7F10F4378D0058C15A /* WebFrameLoaderClient.h in Headers */, 7769 7776 9391F2CB121B67AD00EBF7E8 /* WebFrameNetworkingContext.h in Headers */, … … 9364 9371 0F0C365818C051BA00F607D7 /* RemoteLayerTreeHostIOS.mm in Sources */, 9365 9372 2DDE0AFB18298CC900F97EAA /* RemoteLayerTreePropertyApplier.mm in Sources */, 9373 0FF2649F1A1FF9C6001FE759 /* RemoteLayerTreeScrollingPerformanceData.mm in Sources */, 9366 9374 1AF1AC6B1651759E00C17D7F /* RemoteLayerTreeTransaction.mm in Sources */, 9367 9375 E1B78473163F253E0007B692 /* RemoteNetworkingContext.mm in Sources */,
Note: See TracChangeset
for help on using the changeset viewer.