Changeset 170462 in webkit
- Timestamp:
- Jun 25, 2014, 9:15:50 PM (11 years ago)
- Location:
- trunk/Source
- Files:
-
- 8 edited
-
WebCore/ChangeLog (modified) (1 diff)
-
WebCore/page/scrolling/ScrollingConstraints.h (modified) (1 diff)
-
WebCore/platform/graphics/GraphicsLayer.h (modified) (1 diff)
-
WebCore/platform/graphics/ca/GraphicsLayerCA.cpp (modified) (1 diff)
-
WebCore/platform/graphics/ca/GraphicsLayerCA.h (modified) (2 diffs)
-
WebCore/rendering/RenderLayerCompositor.cpp (modified) (2 diffs)
-
WebKit2/ChangeLog (modified) (1 diff)
-
WebKit2/UIProcess/ios/RemoteScrollingCoordinatorProxyIOS.mm (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r170461 r170462 1 2014-06-25 Simon Fraser <simon.fraser@apple.com> 2 3 [iOS WK2] Fixed position elements jump around when zooming 4 https://bugs.webkit.org/show_bug.cgi?id=134328 5 <rdar://problem/17447048> 6 7 Reviewed by Zalan Bujtas. 8 9 If a given remote layer tree commit contains changes of layers for viewport-constrained 10 objects, then the associated scrolling tree also needs to show that the layers changed, 11 since we need to re-run the "viewport changed" logic in the UI process to get the 12 layers correctly positioned for the current zoom level. 13 14 The bug was that page scale changes resulted in small "pixel alignment" position 15 changes which touched layers, but we didn't commit any scrolling tree changes. So 16 the scrolling tree commit would result in visibly stale layer positions, with no scrolling tree 17 update to adjust them for the current transient zoom. 18 19 Fix by making use of the existing "alignment offset" field in the ViewportConstraints 20 data, and having RemoteScrollingCoordinatorProxy::connectStateNodeLayers() note that 21 fixed or sticky layers changed if any properties of fixed or sticky scrolling tree 22 nodes were updated. 23 24 * page/scrolling/ScrollingConstraints.h: 25 (WebCore::StickyPositionViewportConstraints::operator==): 26 * platform/graphics/GraphicsLayer.h: 27 (WebCore::GraphicsLayer::pixelAlignmentOffset): 28 * platform/graphics/ca/GraphicsLayerCA.cpp: 29 (WebCore::GraphicsLayerCA::updateGeometry): 30 * platform/graphics/ca/GraphicsLayerCA.h: 31 * rendering/RenderLayerCompositor.cpp: 32 (WebCore::RenderLayerCompositor::computeFixedViewportConstraints): 33 (WebCore::RenderLayerCompositor::computeStickyViewportConstraints): 34 1 35 2014-06-25 Simon Fraser <simon.fraser@apple.com> 2 36 -
trunk/Source/WebCore/page/scrolling/ScrollingConstraints.h
r162139 r170462 168 168 bool operator==(const StickyPositionViewportConstraints& other) const 169 169 { 170 return m_leftOffset == other.m_leftOffset 170 return m_alignmentOffset == other.m_alignmentOffset 171 && m_anchorEdges == other.m_anchorEdges 172 && m_leftOffset == other.m_leftOffset 171 173 && m_rightOffset == other.m_rightOffset 172 174 && m_topOffset == other.m_topOffset -
trunk/Source/WebCore/platform/graphics/GraphicsLayer.h
r170071 r170462 463 463 bool hasFlattenedPerspectiveTransform() const { return !preserves3D() && m_childrenTransform.hasPerspective(); } 464 464 #endif 465 virtual FloatSize pixelAlignmentOffset() const { return FloatSize(); } 465 466 466 467 virtual void setAppliesPageScale(bool appliesScale = true) { m_appliesPageScale = appliesScale; } -
trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp
r170071 r170462 1521 1521 } 1522 1522 1523 m_pixelAlignmentOffset = pixelAlignmentOffset; 1524 1523 1525 // Push the layer to device pixel boundary (setPosition()), but move the content back to its original position (setBounds()) 1524 1526 m_layer->setPosition(adjustedPosition); -
trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h
r170071 r170462 146 146 147 147 virtual void deviceOrPageScaleFactorChanged() override; 148 149 virtual FloatSize pixelAlignmentOffset() const override { return m_pixelAlignmentOffset; } 148 150 149 151 struct CommitState { … … 529 531 Vector<FloatRect> m_dirtyRects; 530 532 533 FloatSize m_pixelAlignmentOffset; 534 531 535 LayerChangeFlags m_uncommittedChanges; 532 536 bool m_isCommittingChanges; -
trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp
r170417 r170462 3537 3537 constraints.setLayerPositionAtLastLayout(graphicsLayer->position()); 3538 3538 constraints.setViewportRectAtLastLayout(viewportRect); 3539 constraints.setAlignmentOffset(graphicsLayer->pixelAlignmentOffset()); 3539 3540 3540 3541 const RenderStyle& style = layer.renderer().style(); … … 3580 3581 constraints.setLayerPositionAtLastLayout(graphicsLayer->position()); 3581 3582 constraints.setStickyOffsetAtLastLayout(renderer.stickyPositionOffset()); 3583 constraints.setAlignmentOffset(graphicsLayer->pixelAlignmentOffset()); 3582 3584 3583 3585 return constraints; -
trunk/Source/WebKit2/ChangeLog
r170460 r170462 1 2014-06-25 Simon Fraser <simon.fraser@apple.com> 2 3 [iOS WK2] Fixed position elements jump around when zooming 4 https://bugs.webkit.org/show_bug.cgi?id=134328 5 <rdar://problem/17447048> 6 7 Reviewed by Zalan Bujtas. 8 9 If a given remote layer tree commit contains changes of layers for viewport-constrained 10 objects, then the associated scrolling tree also needs to show that the layers changed, 11 since we need to re-run the "viewport changed" logic in the UI process to get the 12 layers correctly positioned for the current zoom level. 13 14 The bug was that page scale changes resulted in small "pixel alignment" position 15 changes which touched layers, but we didn't commit any scrolling tree changes. So 16 the scrolling tree commit would result in visibly stale layer positions, with no scrolling tree 17 update to adjust them for the current transient zoom. 18 19 Fix by making use of the existing "alignment offset" field in the ViewportConstraints 20 data, and having RemoteScrollingCoordinatorProxy::connectStateNodeLayers() note that 21 fixed or sticky layers changed if any properties of fixed or sticky scrolling tree 22 nodes were updated. 23 24 * UIProcess/ios/RemoteScrollingCoordinatorProxyIOS.mm: 25 (WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers): 26 1 27 2014-06-25 Benjamin Poulain <bpoulain@apple.com> 2 28 -
trunk/Source/WebKit2/UIProcess/ios/RemoteScrollingCoordinatorProxyIOS.mm
r169791 r170462 79 79 } 80 80 case FixedNode: 81 if (currNode->hasChangedProperty(ScrollingStateNode::ScrollLayer)) {81 if (currNode->hasChangedProperty(ScrollingStateNode::ScrollLayer)) 82 82 currNode->setLayer(layerRepresentationFromLayerOrView(layerTreeHost.getLayer(currNode->layer()))); 83 fixedOrStickyLayerChanged = true;84 }83 84 fixedOrStickyLayerChanged |= currNode->hasChangedProperties(); 85 85 break; 86 86 case StickyNode: 87 if (currNode->hasChangedProperty(ScrollingStateNode::ScrollLayer)) {87 if (currNode->hasChangedProperty(ScrollingStateNode::ScrollLayer)) 88 88 currNode->setLayer(layerRepresentationFromLayerOrView(layerTreeHost.getLayer(currNode->layer()))); 89 fixedOrStickyLayerChanged = true; 90 }89 90 fixedOrStickyLayerChanged |= currNode->hasChangedProperties(); 91 91 break; 92 92 }
Note:
See TracChangeset
for help on using the changeset viewer.