Changeset 183891 in webkit


Ignore:
Timestamp:
May 6, 2015, 3:14:34 PM (10 years ago)
Author:
hyatt@apple.com
Message:

Avoid copies in scrollOffsetForFixedPosition() and inline it.
https://bugs.webkit.org/show_bug.cgi?id=144709

Reviewed by Simon Fraser.

  • page/FrameView.cpp:

(WebCore::FrameView::frameScaleFactor):
Added so that scrollOffsetForFixedPosition() can be inlined without having to
reference Frame's implementation.

(WebCore::FrameView::scrollOffsetForFixedPosition): Deleted.
Moved this to the header.

  • page/FrameView.h:

Inline scrollOffsetForFixedPosition() and get rid of all the copying
it was doing.

Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r183887 r183891  
     12015-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
    1202015-05-06  David Hyatt  <hyatt@apple.com>
    221
  • trunk/Source/WebCore/page/FrameView.cpp

    r183885 r183891  
    16371637}
    16381638
     1639float FrameView::frameScaleFactor() const
     1640{
     1641    return frame().frameScaleFactor();
     1642}
     1643
    16391644LayoutSize FrameView::scrollOffsetForFixedPosition(const LayoutRect& visibleContentRect, const LayoutSize& totalContentsSize, const LayoutPoint& scrollPosition, const LayoutPoint& scrollOrigin, float frameScaleFactor, bool fixedElementsLayoutRelativeToFrame, ScrollBehaviorForFixedElements behaviorForFixed, int headerHeight, int footerHeight)
    16401645{
     
    16531658
    16541659    return LayoutSize(position.x() * dragFactorX / frameScaleFactor, position.y() * dragFactorY / frameScaleFactor);
    1655 }
    1656 
    1657 LayoutSize FrameView::scrollOffsetForFixedPosition() const
    1658 {
    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());
    16661660}
    16671661
  • trunk/Source/WebCore/page/FrameView.h

    r183885 r183891  
    275275    const ViewportConstrainedObjectSet* viewportConstrainedObjects() const { return m_viewportConstrainedObjects.get(); }
    276276    bool hasViewportConstrainedObjects() const { return m_viewportConstrainedObjects && m_viewportConstrainedObjects->size() > 0; }
     277   
     278    float frameScaleFactor() const;
    277279
    278280    // Functions for querying the current scrolled position, negating the effects of overhang
    279281    // 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   
    281287    // Static function can be called from another thread.
    282288    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.