Changeset 215469 in webkit
- Timestamp:
- Apr 18, 2017 10:31:20 AM (7 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r215464 r215469 1 2017-04-18 Antti Koivisto <antti@apple.com> 2 3 Enable optimized layer flushes on iOS 4 https://bugs.webkit.org/show_bug.cgi?id=170938 5 <rdar://problem/31677395> 6 7 Reviewed by Simon Fraser. 8 9 Add test verifying that tiles get created for touch overflow scrolling. 10 11 * compositing/ios/overflow-scroll-touch-tiles-expected.txt: Added. 12 * compositing/ios/overflow-scroll-touch-tiles.html: Added. 13 1 14 2017-04-18 Ryan Haddad <ryanhaddad@apple.com> 2 15 -
trunk/Source/WebCore/ChangeLog
r215467 r215469 1 2017-04-18 Antti Koivisto <antti@apple.com> 2 3 Enable optimized layer flushes on iOS 4 https://bugs.webkit.org/show_bug.cgi?id=170938 5 <rdar://problem/31677395> 6 7 Reviewed by Simon Fraser. 8 9 Test: compositing/ios/overflow-scroll-touch-tiles.html 10 11 * platform/graphics/GraphicsLayer.h: 12 (WebCore::GraphicsLayer::setApproximatePosition): 13 14 Make virtual. 15 16 (WebCore::GraphicsLayer::flushCompositingState): 17 * platform/graphics/ca/GraphicsLayerCA.cpp: 18 (WebCore::GraphicsLayerCA::syncPosition): 19 20 Rename PositionChanged enum value to more descriptive NeedsComputeVisibleAndCoverageRect. 21 22 (WebCore::GraphicsLayerCA::setApproximatePosition): 23 (WebCore::GraphicsLayerCA::syncBoundsOrigin): 24 25 Like syncPosition make these invalidate the geometry without scheduling a flush. This is needed 26 so when flush happens we don't just optimize it away. Tile coverage depends on position and bounds. 27 28 (WebCore::GraphicsLayerCA::flushCompositingState): 29 30 Remove FlushScope argument. 31 Disable optimization on WK1 due to some UIKit interactions. 32 33 * platform/graphics/ca/GraphicsLayerCA.h: 34 * platform/graphics/texmap/GraphicsLayerTextureMapper.cpp: 35 (WebCore::GraphicsLayerTextureMapper::flushCompositingState): 36 * platform/graphics/texmap/GraphicsLayerTextureMapper.h: 37 1 38 2017-04-18 Tim Horton <timothy_horton@apple.com> 2 39 -
trunk/Source/WebCore/platform/graphics/GraphicsLayer.h
r215410 r215469 315 315 // approximatePosition, if set, overrides position() and is used during coverage rect computation. 316 316 FloatPoint approximatePosition() const { return m_approximatePosition ? m_approximatePosition.value() : m_position; } 317 v oid setApproximatePosition(std::optional<FloatPoint>p) { m_approximatePosition = p; }317 virtual void setApproximatePosition(const FloatPoint& p) { m_approximatePosition = p; } 318 318 319 319 // For platforms that move underlying platform layers on a different thread for scrolling; just update the GraphicsLayer state. … … 526 526 // with updates drawn into the window. These methods flush internal batched state on this layer 527 527 // and descendant layers, and this layer only. 528 enum class FlushScope { Uncommitted, All }; 529 virtual void flushCompositingState(const FloatRect& /* clipRect */, FlushScope = FlushScope::All) { } 528 virtual void flushCompositingState(const FloatRect& /* clipRect */) { } 530 529 virtual void flushCompositingStateForThisLayerOnly() { } 531 530 -
trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp
r215410 r215469 589 589 GraphicsLayer::syncPosition(point); 590 590 // Ensure future flushes will recompute the coverage rect and update tiling. 591 noteLayerPropertyChanged(PositionChanged, DontScheduleFlush); 591 noteLayerPropertyChanged(NeedsComputeVisibleAndCoverageRect, DontScheduleFlush); 592 } 593 594 void GraphicsLayerCA::setApproximatePosition(const FloatPoint& point) 595 { 596 if (point == m_approximatePosition) 597 return; 598 599 GraphicsLayer::setApproximatePosition(point); 600 // Ensure future flushes will recompute the coverage rect and update tiling. 601 noteLayerPropertyChanged(NeedsComputeVisibleAndCoverageRect, DontScheduleFlush); 592 602 } 593 603 … … 617 627 GraphicsLayer::setBoundsOrigin(origin); 618 628 noteLayerPropertyChanged(GeometryChanged); 629 } 630 631 void GraphicsLayerCA::syncBoundsOrigin(const FloatPoint& origin) 632 { 633 if (origin == m_boundsOrigin) 634 return; 635 636 GraphicsLayer::syncBoundsOrigin(origin); 637 noteLayerPropertyChanged(NeedsComputeVisibleAndCoverageRect, DontScheduleFlush); 619 638 } 620 639 … … 1175 1194 } 1176 1195 1177 void GraphicsLayerCA::flushCompositingState(const FloatRect& visibleRect , FlushScope flushScope)1196 void GraphicsLayerCA::flushCompositingState(const FloatRect& visibleRect) 1178 1197 { 1179 1198 TransformState state(TransformState::UnapplyInverseTransformDirection, FloatQuad(visibleRect)); … … 1182 1201 1183 1202 CommitState commitState; 1184 commitState.ancestorHadChanges = visibleRect != m_previousCommittedVisibleRect || flushScope == FlushScope::All;1203 commitState.ancestorHadChanges = visibleRect != m_previousCommittedVisibleRect; 1185 1204 m_previousCommittedVisibleRect = visibleRect; 1205 1206 #if PLATFORM(IOS) 1207 // In WK1, UIKit may be changing layer bounds behind our back in overflow-scroll layers, so disable the optimization. 1208 // See the similar test in computeVisibleAndCoverageRect(). 1209 if (m_layer->isPlatformCALayerCocoa()) 1210 commitState.ancestorHadChanges = true; 1211 #endif 1186 1212 1187 1213 recursiveCommitChanges(commitState, state); -
trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h
r215410 r215469 77 77 WEBCORE_EXPORT void setPosition(const FloatPoint&) override; 78 78 WEBCORE_EXPORT void syncPosition(const FloatPoint&) override; 79 WEBCORE_EXPORT void setApproximatePosition(const FloatPoint&) override; 79 80 WEBCORE_EXPORT void setAnchorPoint(const FloatPoint3D&) override; 80 81 WEBCORE_EXPORT void setSize(const FloatSize&) override; 81 82 WEBCORE_EXPORT void setBoundsOrigin(const FloatPoint&) override; 83 WEBCORE_EXPORT void syncBoundsOrigin(const FloatPoint&) override; 82 84 83 85 WEBCORE_EXPORT void setTransform(const TransformationMatrix&) override; … … 160 162 void recursiveCommitChanges(const CommitState&, const TransformState&, float pageScaleFactor = 1, const FloatPoint& positionRelativeToBase = FloatPoint(), bool affectedByPageScale = false); 161 163 162 WEBCORE_EXPORT void flushCompositingState(const FloatRect& , FlushScope) override;164 WEBCORE_EXPORT void flushCompositingState(const FloatRect&) override; 163 165 WEBCORE_EXPORT void flushCompositingStateForThisLayerOnly() override; 164 166 … … 497 499 WindRuleChanged = 1LLU << 37, 498 500 UserInteractionEnabledChanged = 1LLU << 38, 499 PositionChanged= 1LLU << 39,501 NeedsComputeVisibleAndCoverageRect = 1LLU << 39, 500 502 }; 501 503 typedef uint64_t LayerChangeFlags; -
trunk/Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.cpp
r215447 r215469 498 498 } 499 499 500 void GraphicsLayerTextureMapper::flushCompositingState(const FloatRect& rect , FlushScope)500 void GraphicsLayerTextureMapper::flushCompositingState(const FloatRect& rect) 501 501 { 502 502 if (!m_layer.textureMapper()) -
trunk/Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.h
r215447 r215469 84 84 void setShowRepaintCounter(bool) override; 85 85 86 void flushCompositingState(const FloatRect& , FlushScope) override;86 void flushCompositingState(const FloatRect&) override; 87 87 void flushCompositingStateForThisLayerOnly() override; 88 88 -
trunk/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp
r215410 r215469 573 573 } 574 574 575 void CoordinatedGraphicsLayer::flushCompositingState(const FloatRect& rect , FlushScope)575 void CoordinatedGraphicsLayer::flushCompositingState(const FloatRect& rect) 576 576 { 577 577 if (CoordinatedGraphicsLayer* mask = downcast<CoordinatedGraphicsLayer>(maskLayer())) -
trunk/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h
r215410 r215469 101 101 void setContentsNeedsDisplay() override; 102 102 void deviceOrPageScaleFactorChanged() override; 103 void flushCompositingState(const FloatRect& , FlushScope) override;103 void flushCompositingState(const FloatRect&) override; 104 104 void flushCompositingStateForThisLayerOnly() override; 105 105 bool setFilters(const FilterOperations&) override; -
trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp
r215425 r215469 453 453 454 454 LOG_WITH_STREAM(Compositing, stream << "\nRenderLayerCompositor " << this << " flushPendingLayerChanges(" << isFlushRoot << ") " << visibleRect); 455 rootLayer->flushCompositingState(visibleRect , GraphicsLayer::FlushScope::Uncommitted);455 rootLayer->flushCompositingState(visibleRect); 456 456 LOG_WITH_STREAM(Compositing, stream << "RenderLayerCompositor " << this << " flush complete\n"); 457 457 #endif
Note: See TracChangeset
for help on using the changeset viewer.