本文整理汇总了C++中mozilla::layers::FrameMetrics::GetExpandedScrollableRect方法的典型用法代码示例。如果您正苦于以下问题:C++ FrameMetrics::GetExpandedScrollableRect方法的具体用法?C++ FrameMetrics::GetExpandedScrollableRect怎么用?C++ FrameMetrics::GetExpandedScrollableRect使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mozilla::layers::FrameMetrics
的用法示例。
在下文中一共展示了FrameMetrics::GetExpandedScrollableRect方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ExpandDisplayPortToTileBoundaries
static void
MaybeAlignAndClampDisplayPort(mozilla::layers::FrameMetrics& aFrameMetrics,
const CSSPoint& aActualScrollOffset)
{
// Correct the display-port by the difference between the requested scroll
// offset and the resulting scroll offset after setting the requested value.
CSSRect& displayPort = aFrameMetrics.mDisplayPort;
displayPort += aFrameMetrics.mScrollOffset - aActualScrollOffset;
// Expand the display port to the next tile boundaries, if tiled thebes layers
// are enabled.
if (gfxPlatform::GetPrefLayersEnableTiles()) {
displayPort =
ExpandDisplayPortToTileBoundaries(displayPort + aActualScrollOffset,
aFrameMetrics.LayersPixelsPerCSSPixel())
- aActualScrollOffset;
}
// Finally, clamp the display port to the expanded scrollable rect.
CSSRect scrollableRect = aFrameMetrics.GetExpandedScrollableRect();
displayPort = scrollableRect.Intersect(displayPort + aActualScrollOffset)
- aActualScrollOffset;
}