Changeset 183891 in webkit
- Timestamp:
- May 6, 2015, 3:14:34 PM (10 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r183887 r183891 1 2015-05-06 David Hyatt <hyatt@apple.com> 2 3 Avoid copies in scrollOffsetForFixedPosition() and inline it. 4 https://bugs.webkit.org/show_bug.cgi?id=144709 5 6 Reviewed by Simon Fraser. 7 8 * page/FrameView.cpp: 9 (WebCore::FrameView::frameScaleFactor): 10 Added so that scrollOffsetForFixedPosition() can be inlined without having to 11 reference Frame's implementation. 12 13 (WebCore::FrameView::scrollOffsetForFixedPosition): Deleted. 14 Moved this to the header. 15 16 * page/FrameView.h: 17 Inline scrollOffsetForFixedPosition() and get rid of all the copying 18 it was doing. 19 1 20 2015-05-06 David Hyatt <hyatt@apple.com> 2 21 -
trunk/Source/WebCore/page/FrameView.cpp
r183885 r183891 1637 1637 } 1638 1638 1639 float FrameView::frameScaleFactor() const 1640 { 1641 return frame().frameScaleFactor(); 1642 } 1643 1639 1644 LayoutSize FrameView::scrollOffsetForFixedPosition(const LayoutRect& visibleContentRect, const LayoutSize& totalContentsSize, const LayoutPoint& scrollPosition, const LayoutPoint& scrollOrigin, float frameScaleFactor, bool fixedElementsLayoutRelativeToFrame, ScrollBehaviorForFixedElements behaviorForFixed, int headerHeight, int footerHeight) 1640 1645 { … … 1653 1658 1654 1659 return LayoutSize(position.x() * dragFactorX / frameScaleFactor, position.y() * dragFactorY / frameScaleFactor); 1655 }1656 1657 LayoutSize FrameView::scrollOffsetForFixedPosition() const1658 {1659 IntRect visibleContentRect = this->visibleContentRect();1660 IntSize totalContentsSize = this->totalContentsSize();1661 IntPoint scrollPosition = this->scrollPosition();1662 IntPoint scrollOrigin = this->scrollOrigin();1663 float frameScaleFactor = frame().frameScaleFactor();1664 ScrollBehaviorForFixedElements behaviorForFixed = scrollBehaviorForFixedElements();1665 return scrollOffsetForFixedPosition(visibleContentRect, totalContentsSize, scrollPosition, scrollOrigin, frameScaleFactor, fixedElementsLayoutRelativeToFrame(), behaviorForFixed, headerHeight(), footerHeight());1666 1660 } 1667 1661 -
trunk/Source/WebCore/page/FrameView.h
r183885 r183891 275 275 const ViewportConstrainedObjectSet* viewportConstrainedObjects() const { return m_viewportConstrainedObjects.get(); } 276 276 bool hasViewportConstrainedObjects() const { return m_viewportConstrainedObjects && m_viewportConstrainedObjects->size() > 0; } 277 278 float frameScaleFactor() const; 277 279 278 280 // Functions for querying the current scrolled position, negating the effects of overhang 279 281 // and adjusting for page scale. 280 LayoutSize scrollOffsetForFixedPosition() const; 282 LayoutSize scrollOffsetForFixedPosition() const 283 { 284 return scrollOffsetForFixedPosition(visibleContentRect(), totalContentsSize(), scrollPosition(), scrollOrigin(), frameScaleFactor(), fixedElementsLayoutRelativeToFrame(), scrollBehaviorForFixedElements(), headerHeight(), footerHeight()); 285 } 286 281 287 // Static function can be called from another thread. 282 288 static LayoutSize scrollOffsetForFixedPosition(const LayoutRect& visibleContentRect, const LayoutSize& totalContentsSize, const LayoutPoint& scrollPosition, const LayoutPoint& scrollOrigin, float frameScaleFactor, bool fixedElementsLayoutRelativeToFrame, ScrollBehaviorForFixedElements, int headerHeight, int footerHeight);
Note:
See TracChangeset
for help on using the changeset viewer.