ScrollingCoordinatorMac.h [plain text]
#ifndef ScrollingCoordinatorMac_h
#define ScrollingCoordinatorMac_h
#if ENABLE(THREADED_SCROLLING)
#include "ScrollingCoordinator.h"
namespace WebCore {
class ScrollingStateNode;
class ScrollingStateScrollingNode;
class ScrollingStateTree;
class ScrollingCoordinatorMac : public ScrollingCoordinator {
public:
explicit ScrollingCoordinatorMac(Page*);
virtual ~ScrollingCoordinatorMac();
virtual void pageDestroyed();
virtual ScrollingTree* scrollingTree() const;
virtual void commitTreeStateIfNeeded();
virtual void frameViewLayoutUpdated(FrameView*);
virtual void frameViewRootLayerDidChange(FrameView*);
virtual void scrollableAreaScrollbarLayerDidChange(ScrollableArea*, ScrollbarOrientation);
virtual bool requestScrollPositionUpdate(FrameView*, const IntPoint&);
virtual bool handleWheelEvent(FrameView*, const PlatformWheelEvent&);
virtual ScrollingNodeID attachToStateTree(ScrollingNodeType, ScrollingNodeID newNodeID, ScrollingNodeID parentID);
virtual void detachFromStateTree(ScrollingNodeID);
virtual void clearStateTree();
virtual String scrollingStateTreeAsText() const OVERRIDE;
virtual bool isRubberBandInProgress() const OVERRIDE;
virtual bool rubberBandsAtBottom() const OVERRIDE;
virtual void setRubberBandsAtBottom(bool) OVERRIDE;
virtual bool rubberBandsAtTop() const OVERRIDE;
virtual void setRubberBandsAtTop(bool) OVERRIDE;
virtual void setScrollPinningBehavior(ScrollPinningBehavior) OVERRIDE;
private:
virtual bool supportsFixedPositionLayers() const OVERRIDE { return true; }
virtual void updateViewportConstrainedNode(ScrollingNodeID, const ViewportConstraints&, GraphicsLayer*) OVERRIDE;
virtual void updateScrollingNode(ScrollingNodeID, GraphicsLayer* scrollLayer, GraphicsLayer* counterScrollingLayer) OVERRIDE;
virtual void syncChildPositions(const LayoutRect& viewportRect) OVERRIDE;
virtual void recomputeWheelEventHandlerCountForFrameView(FrameView*);
virtual void setShouldUpdateScrollLayerPositionOnMainThread(MainThreadScrollingReasons);
virtual bool hasVisibleSlowRepaintViewportConstrainedObjects(FrameView*) const { return false; }
void ensureRootStateNodeForFrameView(FrameView*);
struct ScrollParameters {
ScrollElasticity horizontalScrollElasticity;
ScrollElasticity verticalScrollElasticity;
bool hasEnabledHorizontalScrollbar;
bool hasEnabledVerticalScrollbar;
ScrollbarMode horizontalScrollbarMode;
ScrollbarMode verticalScrollbarMode;
IntPoint scrollOrigin;
IntRect viewportRect;
IntSize totalContentsSize;
float frameScaleFactor;
int headerHeight;
int footerHeight;
};
void setScrollParametersForNode(const ScrollParameters&, ScrollingStateScrollingNode*);
void setScrollLayerForNode(GraphicsLayer*, ScrollingStateNode*);
void setCounterScrollingLayerForNode(GraphicsLayer*, ScrollingStateScrollingNode*);
void setHeaderLayerForNode(GraphicsLayer*, ScrollingStateScrollingNode*);
void setFooterLayerForNode(GraphicsLayer*, ScrollingStateScrollingNode*);
void setNonFastScrollableRegionForNode(const Region&, ScrollingStateScrollingNode*);
void setWheelEventHandlerCountForNode(unsigned, ScrollingStateScrollingNode*);
void updateMainFrameScrollLayerPosition();
void scheduleTreeStateCommit();
void scrollingStateTreeCommitterTimerFired(Timer<ScrollingCoordinatorMac>*);
void commitTreeState();
OwnPtr<ScrollingStateTree> m_scrollingStateTree;
RefPtr<ScrollingTree> m_scrollingTree;
Timer<ScrollingCoordinatorMac> m_scrollingStateTreeCommitterTimer;
};
}
#endif // ENABLE(THREADED_SCROLLING)
#endif // ScrollingCoordinatorMac_h