Changeset 168190 in webkit
- Timestamp:
- May 2, 2014, 2:24:54 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 12 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/platform/ios-sim/compositing/overflow/iframe-inside-overflow-clipping-expected.txt (modified) (1 diff)
-
LayoutTests/platform/ios-sim/compositing/overflow/overflow-auto-with-touch-no-overflow-expected.txt (modified) (1 diff)
-
LayoutTests/platform/ios-sim/compositing/overflow/overflow-overlay-with-touch-no-overflow-expected.txt (modified) (1 diff)
-
LayoutTests/platform/ios-sim/compositing/overflow/overflow-scroll-with-touch-no-overflow-expected.txt (modified) (1 diff)
-
LayoutTests/platform/ios-sim/compositing/overflow/subpixel-overflow-expected.txt (modified) (1 diff)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/rendering/RenderBox.cpp (modified) (1 diff)
-
Source/WebCore/rendering/RenderLayer.cpp (modified) (1 diff)
-
Source/WebCore/rendering/RenderLayer.h (modified) (1 diff)
-
Source/WebCore/rendering/RenderLayerBacking.cpp (modified) (4 diffs)
-
Source/WebCore/rendering/RenderLayerCompositor.cpp (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r168173 r168190 1 2014-05-02 Simon Fraser <simon.fraser@apple.com> 2 3 [iOS WK2] Don't create backing store for -webkit-overflow-scrolling:touch that can't scroll 4 https://bugs.webkit.org/show_bug.cgi?id=132487 5 <rdar://problem/16758041> 6 7 Reviewed by Sam Weinig. 8 9 These are all progressions, and show that we make layers in fewer cases. 10 11 * platform/ios-sim/compositing/overflow/iframe-inside-overflow-clipping-expected.txt: 12 * platform/ios-sim/compositing/overflow/overflow-auto-with-touch-no-overflow-expected.txt: 13 * platform/ios-sim/compositing/overflow/overflow-overlay-with-touch-no-overflow-expected.txt: 14 * platform/ios-sim/compositing/overflow/overflow-scroll-with-touch-no-overflow-expected.txt: 15 * platform/ios-sim/compositing/overflow/subpixel-overflow-expected.txt: 16 1 17 2014-05-02 Commit Queue <commit-queue@webkit.org> 2 18 -
trunk/LayoutTests/platform/ios-sim/compositing/overflow/iframe-inside-overflow-clipping-expected.txt
r167372 r168190 2 2 3 3 4 -
trunk/LayoutTests/platform/ios-sim/compositing/overflow/overflow-auto-with-touch-no-overflow-expected.txt
r167371 r168190 1 (GraphicsLayer2 (bounds 800.00 600.00)3 (children 14 (GraphicsLayer5 (bounds 800.00 600.00)6 (children 17 (GraphicsLayer8 (position 8.00 8.00)9 (bounds 300.00 300.00)10 (children 111 (GraphicsLayer12 (bounds 300.00 300.00)13 (children 114 (GraphicsLayer15 (bounds 300.00 300.00)16 (drawsContent 1)17 )18 )19 )20 )21 )22 )23 )24 )25 )26 1 -
trunk/LayoutTests/platform/ios-sim/compositing/overflow/overflow-overlay-with-touch-no-overflow-expected.txt
r167371 r168190 1 (GraphicsLayer2 (bounds 800.00 600.00)3 (children 14 (GraphicsLayer5 (bounds 800.00 600.00)6 (children 17 (GraphicsLayer8 (position 8.00 8.00)9 (bounds 300.00 300.00)10 (children 111 (GraphicsLayer12 (bounds 300.00 300.00)13 (children 114 (GraphicsLayer15 (bounds 300.00 300.00)16 (drawsContent 1)17 )18 )19 )20 )21 )22 )23 )24 )25 )26 1 -
trunk/LayoutTests/platform/ios-sim/compositing/overflow/overflow-scroll-with-touch-no-overflow-expected.txt
r167371 r168190 1 (GraphicsLayer2 (bounds 800.00 600.00)3 (children 14 (GraphicsLayer5 (bounds 800.00 600.00)6 (children 17 (GraphicsLayer8 (position 8.00 8.00)9 (bounds 300.00 300.00)10 (children 111 (GraphicsLayer12 (bounds 300.00 300.00)13 (children 114 (GraphicsLayer15 (bounds 300.00 300.00)16 (drawsContent 1)17 )18 )19 )20 )21 )22 )23 )24 )25 )26 1 -
trunk/LayoutTests/platform/ios-sim/compositing/overflow/subpixel-overflow-expected.txt
r168078 r168190 4 4 5 5 Content 6 (GraphicsLayer7 (bounds 800.00 600.00)8 (children 19 (GraphicsLayer10 (bounds 800.00 600.00)11 (children 312 (GraphicsLayer13 (position 18.00 18.00)14 (bounds 202.00 202.50)15 (drawsContent 1)16 (children 117 (GraphicsLayer18 (position 1.00 1.00)19 (bounds 200.00 200.00)20 (children 121 (GraphicsLayer22 (bounds 200.00 200.00)23 (drawsContent 1)24 )25 )26 )27 )28 )29 (GraphicsLayer30 (position 244.00 18.00)31 (bounds 202.00 202.50)32 (drawsContent 1)33 (children 134 (GraphicsLayer35 (position 1.00 1.00)36 (bounds 200.00 201.00)37 (children 138 (GraphicsLayer39 (bounds 200.00 201.00)40 (drawsContent 1)41 )42 )43 )44 )45 )46 (GraphicsLayer47 (position 470.00 18.00)48 (bounds 202.00 203.00)49 (drawsContent 1)50 (children 151 (GraphicsLayer52 (position 1.00 1.00)53 (bounds 200.00 201.00)54 (children 155 (GraphicsLayer56 (bounds 200.00 201.00)57 (drawsContent 1)58 )59 )60 )61 )62 )63 )64 )65 )66 )67 6 -
trunk/Source/WebCore/ChangeLog
r168188 r168190 1 2014-05-02 Simon Fraser <simon.fraser@apple.com> 2 3 [iOS WK2] Don't create backing store for -webkit-overflow-scrolling:touch that can't scroll 4 https://bugs.webkit.org/show_bug.cgi?id=132487 5 <rdar://problem/16758041> 6 7 Reviewed by Sam Weinig. 8 9 Previously, -webkit-overflow-scrolling:touch would cause us to make compositing 10 layers for any element that had overflow: auto or scroll on either axis. This 11 created lots of backing store when not required. 12 13 Improve this to only create compositing for scrolling when there is actually 14 scrollable overflow. This makes things slightly more complex, because we can 15 only know when layout is up to date. 16 17 * rendering/RenderBox.cpp: 18 (WebCore::RenderBox::computeRectForRepaint): usesCompositedScrolling() tells 19 us if we're actually doing composited overflow. 20 * rendering/RenderLayer.cpp: 21 (WebCore::RenderLayer::hasTouchScrollableOverflow): 22 (WebCore::RenderLayer::handleTouchEvent): 23 * rendering/RenderLayer.h: 24 * rendering/RenderLayerBacking.cpp: 25 (WebCore::layerOrAncestorIsTransformedOrUsingCompositedScrolling): 26 (WebCore::RenderLayerBacking::updateGraphicsLayerConfiguration): Only update 27 scrolling and clipping layers if layout is not pending. 28 (WebCore::RenderLayerBacking::updateGraphicsLayerGeometry): 29 (WebCore::RenderLayerBacking::updateScrollingLayers): The caller calls 30 updateInternalHierarchy(), so no need to do it here. 31 * rendering/RenderLayerCompositor.cpp: 32 (WebCore::RenderLayerCompositor::requiresCompositingForScrolling): We 33 can only determine that we're scrollable after layout. 34 (WebCore::isStickyInAcceleratedScrollingLayerOrViewport): 35 (WebCore::isMainFrameScrollingOrOverflowScrolling): 36 1 37 2014-05-02 Anders Carlsson <andersca@apple.com> 2 38 -
trunk/Source/WebCore/rendering/RenderBox.cpp
r167988 r168190 2177 2177 RenderBox* containerBox = toRenderBox(o); 2178 2178 #if PLATFORM(IOS) 2179 if (!containerBox->layer() || !containerBox->layer()-> hasAcceleratedTouchScrolling()) {2179 if (!containerBox->layer() || !containerBox->layer()->usesCompositedScrolling()) { 2180 2180 #endif 2181 2181 containerBox->applyCachedClipAndScrollOffsetForRepaint(rect); -
trunk/Source/WebCore/rendering/RenderLayer.cpp
r168119 r168190 2116 2116 } 2117 2117 2118 #if PLATFORM(IOS) && ENABLE(TOUCH_EVENTS) 2118 bool RenderLayer::hasTouchScrollableOverflow() const 2119 { 2120 return hasAcceleratedTouchScrolling() && (hasScrollableHorizontalOverflow() || hasScrollableVerticalOverflow()); 2121 } 2122 2123 #if ENABLE(TOUCH_EVENTS) 2119 2124 bool RenderLayer::handleTouchEvent(const PlatformTouchEvent& touchEvent) 2120 2125 { 2121 2126 // If we have accelerated scrolling, let the scrolling be handled outside of WebKit. 2122 if (has AcceleratedTouchScrolling())2127 if (hasTouchScrollableOverflow()) 2123 2128 return false; 2124 2129 -
trunk/Source/WebCore/rendering/RenderLayer.h
r168119 r168190 461 461 // Returns true when the layer could do touch scrolling, but doesn't look at whether there is actually scrollable overflow. 462 462 bool hasAcceleratedTouchScrolling() const; 463 // Returns true when there is actually scrollable overflow (requires layout to be up-to-date). 464 bool hasTouchScrollableOverflow() const; 463 465 #endif 464 466 -
trunk/Source/WebCore/rendering/RenderLayerBacking.cpp
r168079 r168190 407 407 if (curr->hasTransform() 408 408 #if PLATFORM(IOS) 409 || curr->has AcceleratedTouchScrolling()409 || curr->hasTouchScrollableOverflow() 410 410 #else 411 411 || curr->needsCompositedScrolling() … … 537 537 538 538 bool needsDescendentsClippingLayer = compositor().clipsCompositingDescendants(m_owningLayer); 539 bool usesCompositedScrolling; 539 540 if (!renderer().view().needsLayout()) { 541 bool usesCompositedScrolling; 540 542 #if PLATFORM(IOS) 541 usesCompositedScrolling = m_owningLayer.hasAcceleratedTouchScrolling();543 usesCompositedScrolling = m_owningLayer.hasTouchScrollableOverflow(); 542 544 #else 543 usesCompositedScrolling = m_owningLayer.needsCompositedScrolling(); 544 #endif 545 546 // Our scrolling layer will clip. 547 if (usesCompositedScrolling) 548 needsDescendentsClippingLayer = false; 545 usesCompositedScrolling = m_owningLayer.needsCompositedScrolling(); 546 #endif 547 // Our scrolling layer will clip. 548 if (usesCompositedScrolling) 549 needsDescendentsClippingLayer = false; 550 551 if (updateScrollingLayers(usesCompositedScrolling)) 552 layerConfigChanged = true; 553 554 if (updateDescendantClippingLayer(needsDescendentsClippingLayer)) 555 layerConfigChanged = true; 556 } 549 557 550 558 if (updateAncestorClippingLayer(compositor().clippedByAncestor(m_owningLayer))) 551 559 layerConfigChanged = true; 552 560 553 if (updateDescendantClippingLayer(needsDescendentsClippingLayer))554 layerConfigChanged = true;555 556 561 if (updateOverflowControlsLayers(requiresHorizontalScrollbarLayer(), requiresVerticalScrollbarLayer(), requiresScrollCornerLayer())) 557 layerConfigChanged = true;558 559 if (updateScrollingLayers(usesCompositedScrolling))560 562 layerConfigChanged = true; 561 563 … … 753 755 754 756 #if PLATFORM(IOS) 755 if (compAncestor && compAncestor->has AcceleratedTouchScrolling()) {757 if (compAncestor && compAncestor->hasTouchScrollableOverflow()) { 756 758 RenderBox* renderBox = toRenderBox(&compAncestor->renderer()); 757 759 LayoutRect paddingBox(renderBox->borderLeft(), renderBox->borderTop(), … … 1441 1443 } 1442 1444 1443 updateInternalHierarchy();1444 1445 m_graphicsLayer->setPaintingPhase(paintingPhaseForPrimaryLayer()); 1445 1446 m_graphicsLayer->setNeedsDisplay(); // Because painting phases changed. -
trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp
r168119 r168190 2477 2477 bool RenderLayerCompositor::requiresCompositingForScrolling(const RenderLayer& layer) const 2478 2478 { 2479 return layer.hasAcceleratedTouchScrolling(); 2479 if (!layer.hasAcceleratedTouchScrolling()) 2480 return false; 2481 2482 if (!m_inPostLayoutUpdate) { 2483 m_reevaluateCompositingAfterLayout = true; 2484 return layer.isComposited(); 2485 } 2486 2487 return layer.hasTouchScrollableOverflow(); 2480 2488 } 2481 2489 #endif … … 2500 2508 2501 2509 RenderLayer* enclosingOverflowLayer = layer.enclosingOverflowClipLayer(ExcludeSelf); 2502 if (enclosingOverflowLayer && enclosingOverflowLayer->has AcceleratedTouchScrolling()) {2510 if (enclosingOverflowLayer && enclosingOverflowLayer->hasTouchScrollableOverflow()) { 2503 2511 if (enclosingAcceleratedOverflowLayer) 2504 2512 *enclosingAcceleratedOverflowLayer = enclosingOverflowLayer; … … 2538 2546 2539 2547 #if PLATFORM(IOS) 2540 return layer.has AcceleratedTouchScrolling();2548 return layer.hasTouchScrollableOverflow(); 2541 2549 #else 2542 2550 return layer.needsCompositedScrolling();
Note:
See TracChangeset
for help on using the changeset viewer.