本文整理汇总了C++中ScrollingStateScrollingNode类的典型用法代码示例。如果您正苦于以下问题:C++ ScrollingStateScrollingNode类的具体用法?C++ ScrollingStateScrollingNode怎么用?C++ ScrollingStateScrollingNode使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ScrollingStateScrollingNode类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SCROLLING_NODE_ENCODE
void ArgumentCoder<ScrollingStateScrollingNode>::encode(ArgumentEncoder& encoder, const ScrollingStateScrollingNode& node)
{
encoder << static_cast<const ScrollingStateNode&>(node);
SCROLLING_NODE_ENCODE(ViewportSize, viewportSize)
SCROLLING_NODE_ENCODE(TotalContentsSize, totalContentsSize)
SCROLLING_NODE_ENCODE(ScrollPosition, scrollPosition)
SCROLLING_NODE_ENCODE(ScrollOrigin, scrollOrigin)
SCROLLING_NODE_ENCODE(FrameScaleFactor, frameScaleFactor)
SCROLLING_NODE_ENCODE(NonFastScrollableRegion, nonFastScrollableRegion)
SCROLLING_NODE_ENCODE(WheelEventHandlerCount, wheelEventHandlerCount)
SCROLLING_NODE_ENCODE(ReasonsForSynchronousScrolling, synchronousScrollingReasons)
SCROLLING_NODE_ENCODE(ScrollableAreaParams, scrollableAreaParameters)
SCROLLING_NODE_ENCODE_ENUM(BehaviorForFixedElements, scrollBehaviorForFixedElements)
SCROLLING_NODE_ENCODE(RequestedScrollPosition, requestedScrollPosition)
SCROLLING_NODE_ENCODE(RequestedScrollPosition, requestedScrollPositionRepresentsProgrammaticScroll)
SCROLLING_NODE_ENCODE(HeaderHeight, headerHeight)
SCROLLING_NODE_ENCODE(FooterHeight, footerHeight)
SCROLLING_NODE_ENCODE(TopContentInset, topContentInset)
if (node.hasChangedProperty(ScrollingStateScrollingNode::ScrolledContentsLayer))
encoder << static_cast<GraphicsLayer::PlatformLayerID>(node.scrolledContentsLayer());
if (node.hasChangedProperty(ScrollingStateScrollingNode::CounterScrollingLayer))
encoder << static_cast<GraphicsLayer::PlatformLayerID>(node.counterScrollingLayer());
}
示例2: toScrollingStateScrollingNode
void AsyncScrollingCoordinator::updateScrollingNode(ScrollingNodeID nodeID, GraphicsLayer* scrollLayer, GraphicsLayer* counterScrollingLayer)
{
ScrollingStateScrollingNode* node = toScrollingStateScrollingNode(m_scrollingStateTree->stateNodeForID(nodeID));
ASSERT(node);
if (!node)
return;
node->setLayer(scrollLayer);
node->setCounterScrollingLayer(counterScrollingLayer);
}
示例3: setStateScrollingNodeSnapOffsetsAsFloat
static inline void setStateScrollingNodeSnapOffsetsAsFloat(ScrollingStateScrollingNode& node, ScrollEventAxis axis, const Vector<LayoutUnit>& snapOffsets, float deviceScaleFactor)
{
// FIXME: Incorporate current page scale factor in snapping to device pixel. Perhaps we should just convert to float here and let UI process do the pixel snapping?
Vector<float> snapOffsetsAsFloat;
snapOffsetsAsFloat.reserveInitialCapacity(snapOffsets.size());
for (size_t i = 0; i < snapOffsets.size(); ++i)
snapOffsetsAsFloat.append(roundToDevicePixel(snapOffsets[i], deviceScaleFactor, false));
if (axis == ScrollEventAxis::Horizontal)
node.setHorizontalSnapOffsets(snapOffsetsAsFloat);
else
node.setVerticalSnapOffsets(snapOffsetsAsFloat);
}
示例4: lock
void ScrollingTree::commitNewTreeState(PassOwnPtr<ScrollingStateTree> scrollingStateTree)
{
bool rootStateNodeChanged = scrollingStateTree->hasNewRootStateNode();
ScrollingStateScrollingNode* rootNode = scrollingStateTree->rootStateNode();
if (rootNode
&& (rootStateNodeChanged
|| rootNode->hasChangedProperty(ScrollingStateScrollingNode::WheelEventHandlerCount)
|| rootNode->hasChangedProperty(ScrollingStateScrollingNode::NonFastScrollableRegion)
|| rootNode->hasChangedProperty(ScrollingStateNode::ScrollLayer))) {
MutexLocker lock(m_mutex);
if (rootStateNodeChanged || rootNode->hasChangedProperty(ScrollingStateNode::ScrollLayer))
m_mainFrameScrollPosition = FloatPoint();
if (rootStateNodeChanged || rootNode->hasChangedProperty(ScrollingStateScrollingNode::WheelEventHandlerCount))
m_hasWheelEventHandlers = scrollingStateTree->rootStateNode()->wheelEventHandlerCount();
if (rootStateNodeChanged || rootNode->hasChangedProperty(ScrollingStateScrollingNode::NonFastScrollableRegion))
m_nonFastScrollableRegion = scrollingStateTree->rootStateNode()->nonFastScrollableRegion();
}
bool scrollRequestIsProgammatic = rootNode ? rootNode->requestedScrollPositionRepresentsProgrammaticScroll() : false;
TemporaryChange<bool> changeHandlingProgrammaticScroll(m_isHandlingProgrammaticScroll, scrollRequestIsProgammatic);
removeDestroyedNodes(*scrollingStateTree);
updateTreeFromStateNode(rootNode);
}
示例5: ASSERT
void ScrollingTree::commitNewTreeState(PassOwnPtr<ScrollingStateTree> scrollingStateTree)
{
ASSERT(ScrollingThread::isCurrentThread());
ScrollingStateScrollingNode* rootNode = scrollingStateTree->rootStateNode();
if (rootNode->hasChangedProperty(ScrollingStateScrollingNode::WheelEventHandlerCount) || rootNode->hasChangedProperty(ScrollingStateScrollingNode::NonFastScrollableRegion) || rootNode->hasChangedProperty(ScrollingStateNode::ScrollLayer)) {
MutexLocker lock(m_mutex);
if (rootNode->hasChangedProperty(ScrollingStateNode::ScrollLayer))
m_mainFrameScrollPosition = IntPoint();
if (rootNode->hasChangedProperty(ScrollingStateScrollingNode::WheelEventHandlerCount))
m_hasWheelEventHandlers = scrollingStateTree->rootStateNode()->wheelEventHandlerCount();
if (rootNode->hasChangedProperty(ScrollingStateScrollingNode::NonFastScrollableRegion))
m_nonFastScrollableRegion = scrollingStateTree->rootStateNode()->nonFastScrollableRegion();
}
TemporaryChange<bool> changeHandlingProgrammaticScroll(m_isHandlingProgrammaticScroll, rootNode->requestedScrollPositionRepresentsProgrammaticScroll());
removeDestroyedNodes(scrollingStateTree.get());
updateTreeFromStateNode(rootNode);
}
示例6: ScrollingStateNode
ScrollingStateScrollingNode::ScrollingStateScrollingNode(const ScrollingStateScrollingNode& stateNode, ScrollingStateTree& adoptiveTree)
: ScrollingStateNode(stateNode, adoptiveTree)
, m_scrollableAreaSize(stateNode.scrollableAreaSize())
, m_totalContentsSize(stateNode.totalContentsSize())
, m_scrollPosition(stateNode.scrollPosition())
, m_requestedScrollPosition(stateNode.requestedScrollPosition())
, m_scrollOrigin(stateNode.scrollOrigin())
, m_scrollableAreaParameters(stateNode.scrollableAreaParameters())
, m_requestedScrollPositionRepresentsProgrammaticScroll(stateNode.requestedScrollPositionRepresentsProgrammaticScroll())
{
}
示例7: ASSERT
bool AsyncScrollingCoordinator::requestScrollPositionUpdate(FrameView* frameView, const IntPoint& scrollPosition)
{
ASSERT(isMainThread());
ASSERT(m_page);
if (!coordinatesScrollingForFrameView(frameView))
return false;
if (frameView->inProgrammaticScroll() || frameView->frame().document()->inPageCache())
updateScrollPositionAfterAsyncScroll(frameView->scrollLayerID(), scrollPosition, frameView->inProgrammaticScroll(), SetScrollingLayerPosition);
// If this frame view's document is being put into the page cache, we don't want to update our
// main frame scroll position. Just let the FrameView think that we did.
if (frameView->frame().document()->inPageCache())
return true;
ScrollingStateScrollingNode* stateNode = toScrollingStateScrollingNode(m_scrollingStateTree->stateNodeForID(frameView->scrollLayerID()));
if (!stateNode)
return false;
stateNode->setRequestedScrollPosition(scrollPosition, frameView->inProgrammaticScroll());
return true;
}
示例8: SCROLLING_NODE_DECODE
bool ArgumentCoder<ScrollingStateScrollingNode>::decode(ArgumentDecoder& decoder, ScrollingStateScrollingNode& node)
{
if (!decoder.decode(static_cast<ScrollingStateNode&>(node)))
return false;
SCROLLING_NODE_DECODE(ViewportSize, FloatSize, setViewportSize);
SCROLLING_NODE_DECODE(TotalContentsSize, IntSize, setTotalContentsSize);
SCROLLING_NODE_DECODE(ScrollPosition, FloatPoint, setScrollPosition);
SCROLLING_NODE_DECODE(ScrollOrigin, IntPoint, setScrollOrigin);
SCROLLING_NODE_DECODE(FrameScaleFactor, float, setFrameScaleFactor);
SCROLLING_NODE_DECODE(NonFastScrollableRegion, Region, setNonFastScrollableRegion);
SCROLLING_NODE_DECODE(WheelEventHandlerCount, int, setWheelEventHandlerCount);
SCROLLING_NODE_DECODE(ReasonsForSynchronousScrolling, SynchronousScrollingReasons, setSynchronousScrollingReasons);
SCROLLING_NODE_DECODE(ScrollableAreaParams, ScrollableAreaParameters, setScrollableAreaParameters);
SCROLLING_NODE_DECODE_ENUM(BehaviorForFixedElements, ScrollBehaviorForFixedElements, setScrollBehaviorForFixedElements);
if (node.hasChangedProperty(ScrollingStateScrollingNode::RequestedScrollPosition)) {
FloatPoint scrollPosition;
if (!decoder.decode(scrollPosition))
return false;
bool representsProgrammaticScroll;
if (!decoder.decode(representsProgrammaticScroll))
return false;
node.setRequestedScrollPosition(scrollPosition, representsProgrammaticScroll);
}
SCROLLING_NODE_DECODE(HeaderHeight, int, setHeaderHeight);
SCROLLING_NODE_DECODE(FooterHeight, int, setFooterHeight);
SCROLLING_NODE_DECODE(TopContentInset, float, setTopContentInset);
if (node.hasChangedProperty(ScrollingStateScrollingNode::ScrolledContentsLayer)) {
GraphicsLayer::PlatformLayerID layerID;
if (!decoder.decode(layerID))
return false;
node.setScrolledContentsLayer(layerID);
}
if (node.hasChangedProperty(ScrollingStateScrollingNode::CounterScrollingLayer)) {
GraphicsLayer::PlatformLayerID layerID;
if (!decoder.decode(layerID))
return false;
node.setCounterScrollingLayer(layerID);
}
return true;
}
示例9: ScrollingStateNode
ScrollingStateScrollingNode::ScrollingStateScrollingNode(const ScrollingStateScrollingNode& stateNode, ScrollingStateTree& adoptiveTree)
: ScrollingStateNode(stateNode, adoptiveTree)
#if PLATFORM(MAC)
, m_verticalScrollbarPainter(stateNode.verticalScrollbarPainter())
, m_horizontalScrollbarPainter(stateNode.horizontalScrollbarPainter())
#endif
, m_viewportSize(stateNode.viewportSize())
, m_totalContentsSize(stateNode.totalContentsSize())
, m_scrollPosition(stateNode.scrollPosition())
, m_scrollOrigin(stateNode.scrollOrigin())
, m_scrollableAreaParameters(stateNode.scrollableAreaParameters())
, m_nonFastScrollableRegion(stateNode.nonFastScrollableRegion())
, m_frameScaleFactor(stateNode.frameScaleFactor())
, m_wheelEventHandlerCount(stateNode.wheelEventHandlerCount())
, m_synchronousScrollingReasons(stateNode.synchronousScrollingReasons())
, m_behaviorForFixed(stateNode.scrollBehaviorForFixedElements())
, m_headerHeight(stateNode.headerHeight())
, m_footerHeight(stateNode.footerHeight())
, m_requestedScrollPosition(stateNode.requestedScrollPosition())
, m_requestedScrollPositionRepresentsProgrammaticScroll(stateNode.requestedScrollPositionRepresentsProgrammaticScroll())
, m_topContentInset(stateNode.topContentInset())
{
if (hasChangedProperty(ScrolledContentsLayer))
setScrolledContentsLayer(stateNode.scrolledContentsLayer().toRepresentation(adoptiveTree.preferredLayerRepresentation()));
if (hasChangedProperty(CounterScrollingLayer))
setCounterScrollingLayer(stateNode.counterScrollingLayer().toRepresentation(adoptiveTree.preferredLayerRepresentation()));
if (hasChangedProperty(InsetClipLayer))
setInsetClipLayer(stateNode.insetClipLayer().toRepresentation(adoptiveTree.preferredLayerRepresentation()));
if (hasChangedProperty(ContentShadowLayer))
setContentShadowLayer(stateNode.contentShadowLayer().toRepresentation(adoptiveTree.preferredLayerRepresentation()));
if (hasChangedProperty(HeaderLayer))
setHeaderLayer(stateNode.headerLayer().toRepresentation(adoptiveTree.preferredLayerRepresentation()));
if (hasChangedProperty(FooterLayer))
setFooterLayer(stateNode.footerLayer().toRepresentation(adoptiveTree.preferredLayerRepresentation()));
}
示例10: toScrollingStateScrollingNode
void ScrollingTreeScrollingNode::updateBeforeChildren(ScrollingStateNode* stateNode)
{
ScrollingStateScrollingNode* state = toScrollingStateScrollingNode(stateNode);
if (state->hasChangedProperty(ScrollingStateScrollingNode::ViewportRect))
m_viewportRect = state->viewportRect();
if (state->hasChangedProperty(ScrollingStateScrollingNode::TotalContentsSize)) {
if (scrollingTree().isRubberBandInProgress())
m_totalContentsSizeForRubberBand = m_totalContentsSize;
else
m_totalContentsSizeForRubberBand = state->totalContentsSize();
m_totalContentsSize = state->totalContentsSize();
}
if (state->hasChangedProperty(ScrollingStateScrollingNode::FrameScaleFactor))
m_frameScaleFactor = state->frameScaleFactor();
if (state->hasChangedProperty(ScrollingStateScrollingNode::ShouldUpdateScrollLayerPositionOnMainThread))
m_shouldUpdateScrollLayerPositionOnMainThread = state->shouldUpdateScrollLayerPositionOnMainThread();
if (state->hasChangedProperty(ScrollingStateScrollingNode::HorizontalScrollElasticity))
m_horizontalScrollElasticity = state->horizontalScrollElasticity();
if (state->hasChangedProperty(ScrollingStateScrollingNode::VerticalScrollElasticity))
m_verticalScrollElasticity = state->verticalScrollElasticity();
if (state->hasChangedProperty(ScrollingStateScrollingNode::HasEnabledHorizontalScrollbar))
m_hasEnabledHorizontalScrollbar = state->hasEnabledHorizontalScrollbar();
if (state->hasChangedProperty(ScrollingStateScrollingNode::HasEnabledVerticalScrollbar))
m_hasEnabledVerticalScrollbar = state->hasEnabledVerticalScrollbar();
if (state->hasChangedProperty(ScrollingStateScrollingNode::HorizontalScrollbarMode))
m_horizontalScrollbarMode = state->horizontalScrollbarMode();
if (state->hasChangedProperty(ScrollingStateScrollingNode::VerticalScrollbarMode))
m_verticalScrollbarMode = state->verticalScrollbarMode();
if (state->hasChangedProperty(ScrollingStateScrollingNode::ScrollOrigin))
m_scrollOrigin = state->scrollOrigin();
if (state->hasChangedProperty(ScrollingStateScrollingNode::HeaderHeight))
m_headerHeight = state->headerHeight();
if (state->hasChangedProperty(ScrollingStateScrollingNode::FooterHeight))
m_footerHeight = state->footerHeight();
if (state->hasChangedProperty(ScrollingStateScrollingNode::BehaviorForFixedElements))
m_behaviorForFixed = state->scrollBehaviorForFixedElements();
}
示例11: switch
void RemoteScrollingCoordinatorProxy::connectStateNodeLayers(ScrollingStateTree& stateTree, const RemoteLayerTreeHost& layerTreeHost)
{
for (auto it : stateTree.nodeMap()) {
ScrollingStateNode* currNode = it.value;
switch (currNode->nodeType()) {
case ScrollingNode: {
ScrollingStateScrollingNode* scrollingStateNode = toScrollingStateScrollingNode(currNode);
if (scrollingStateNode->hasChangedProperty(ScrollingStateNode::ScrollLayer))
scrollingStateNode->setLayer(layerTreeHost.getLayer(scrollingStateNode->layer()));
if (scrollingStateNode->hasChangedProperty(ScrollingStateScrollingNode::CounterScrollingLayer))
scrollingStateNode->setCounterScrollingLayer(layerTreeHost.getLayer(scrollingStateNode->counterScrollingLayer()));
// FIXME: we should never have header and footer layers coming from the WebProcess.
if (scrollingStateNode->hasChangedProperty(ScrollingStateScrollingNode::HeaderLayer))
scrollingStateNode->setHeaderLayer(layerTreeHost.getLayer(scrollingStateNode->headerLayer()));
if (scrollingStateNode->hasChangedProperty(ScrollingStateScrollingNode::FooterLayer))
scrollingStateNode->setFooterLayer(layerTreeHost.getLayer(scrollingStateNode->footerLayer()));
break;
}
case FixedNode:
if (currNode->hasChangedProperty(ScrollingStateNode::ScrollLayer))
currNode->setLayer(layerTreeHost.getLayer(currNode->layer()));
break;
case StickyNode:
if (currNode->hasChangedProperty(ScrollingStateNode::ScrollLayer))
currNode->setLayer(layerTreeHost.getLayer(currNode->layer()));
break;
}
}
}
示例12: dumpProperty
void RemoteScrollingTreeTextStream::dump(const ScrollingStateScrollingNode& node, bool changedPropertiesOnly)
{
RemoteScrollingTreeTextStream& ts = *this;
if (!changedPropertiesOnly || node.hasChangedProperty(ScrollingStateScrollingNode::ViewportSize))
dumpProperty(ts, "viewport-size", node.viewportSize());
if (!changedPropertiesOnly || node.hasChangedProperty(ScrollingStateScrollingNode::TotalContentsSize))
dumpProperty(ts, "total-contents-size", node.totalContentsSize());
if (!changedPropertiesOnly || node.hasChangedProperty(ScrollingStateScrollingNode::ScrollPosition))
dumpProperty(ts, "scroll-position", node.scrollPosition());
if (!changedPropertiesOnly || node.hasChangedProperty(ScrollingStateScrollingNode::ScrollOrigin))
dumpProperty(ts, "scroll-origin", node.scrollOrigin());
if (!changedPropertiesOnly || node.hasChangedProperty(ScrollingStateScrollingNode::FrameScaleFactor))
dumpProperty(ts, "frame-scale-factor", node.frameScaleFactor());
// FIXME: dump nonFastScrollableRegion
// FIXME: dump wheelEventHandlerCount
// FIXME: dump synchronousScrollingReasons
// FIXME: dump scrollableAreaParameters
// FIXME: dump scrollBehaviorForFixedElements
if (!changedPropertiesOnly || node.hasChangedProperty(ScrollingStateScrollingNode::RequestedScrollPosition)) {
dumpProperty(ts, "requested-scroll-position", node.requestedScrollPosition());
dumpProperty(ts, "requested-scroll-position-is-programatic", node.requestedScrollPositionRepresentsProgrammaticScroll());
}
if (!changedPropertiesOnly || node.hasChangedProperty(ScrollingStateScrollingNode::HeaderHeight))
dumpProperty(ts, "header-height", node.headerHeight());
if (!changedPropertiesOnly || node.hasChangedProperty(ScrollingStateScrollingNode::FooterHeight))
dumpProperty(ts, "footer-height", node.footerHeight());
if (!changedPropertiesOnly || node.hasChangedProperty(ScrollingStateScrollingNode::TopContentInset))
dumpProperty(ts, "top-content-inset", node.topContentInset());
if (!changedPropertiesOnly || node.hasChangedProperty(ScrollingStateScrollingNode::ScrolledContentsLayer))
dumpProperty(ts, "scrolled-contents-layer", static_cast<GraphicsLayer::PlatformLayerID>(node.scrolledContentsLayer()));
if (!changedPropertiesOnly || node.hasChangedProperty(ScrollingStateScrollingNode::CounterScrollingLayer))
dumpProperty(ts, "counter-scrolling-layer", static_cast<GraphicsLayer::PlatformLayerID>(node.counterScrollingLayer()));
if (!changedPropertiesOnly || node.hasChangedProperty(ScrollingStateScrollingNode::InsetClipLayer))
dumpProperty(ts, "clip-inset-layer", static_cast<GraphicsLayer::PlatformLayerID>(node.insetClipLayer()));
if (!changedPropertiesOnly || node.hasChangedProperty(ScrollingStateScrollingNode::HeaderLayer))
dumpProperty(ts, "header-layer", static_cast<GraphicsLayer::PlatformLayerID>(node.headerLayer()));
if (!changedPropertiesOnly || node.hasChangedProperty(ScrollingStateScrollingNode::FooterLayer))
dumpProperty(ts, "footer-layer", static_cast<GraphicsLayer::PlatformLayerID>(node.footerLayer()));
}