本文整理汇总了C++中FrameMetrics::GetPaintRequestTime方法的典型用法代码示例。如果您正苦于以下问题:C++ FrameMetrics::GetPaintRequestTime方法的具体用法?C++ FrameMetrics::GetPaintRequestTime怎么用?C++ FrameMetrics::GetPaintRequestTime使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FrameMetrics
的用法示例。
在下文中一共展示了FrameMetrics::GetPaintRequestTime方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetPresShell
void
APZCCallbackHelper::UpdateRootFrame(FrameMetrics& aMetrics)
{
if (aMetrics.GetScrollId() == FrameMetrics::NULL_SCROLL_ID) {
return;
}
nsIContent* content = nsLayoutUtils::FindContentFor(aMetrics.GetScrollId());
if (!content) {
return;
}
nsCOMPtr<nsIPresShell> shell = GetPresShell(content);
if (!shell || aMetrics.GetPresShellId() != shell->GetPresShellId()) {
return;
}
MOZ_ASSERT(aMetrics.GetUseDisplayPortMargins());
if (gfxPrefs::APZAllowZooming()) {
// If zooming is disabled then we don't really want to let APZ fiddle
// with these things. In theory setting the resolution here should be a
// no-op, but setting the SPCSPS is bad because it can cause a stale value
// to be returned by window.innerWidth/innerHeight (see bug 1187792).
float presShellResolution = shell->GetResolution();
// If the pres shell resolution has changed on the content side side
// the time this repaint request was fired, consider this request out of date
// and drop it; setting a zoom based on the out-of-date resolution can have
// the effect of getting us stuck with the stale resolution.
if (presShellResolution != aMetrics.GetPresShellResolution()) {
return;
}
// The pres shell resolution is updated by the the async zoom since the
// last paint.
presShellResolution = aMetrics.GetPresShellResolution()
* aMetrics.GetAsyncZoom().scale;
shell->SetResolutionAndScaleTo(presShellResolution);
}
// Do this as late as possible since scrolling can flush layout. It also
// adjusts the display port margins, so do it before we set those.
ScrollFrame(content, aMetrics);
MOZ_ASSERT(nsLayoutUtils::HasDisplayPort(content));
SetDisplayPortMargins(shell, content, aMetrics);
SetPaintRequestTime(content, aMetrics.GetPaintRequestTime());
}
示例2: ScrollFrame
void
APZCCallbackHelper::UpdateSubFrame(FrameMetrics& aMetrics)
{
if (aMetrics.GetScrollId() == FrameMetrics::NULL_SCROLL_ID) {
return;
}
nsIContent* content = nsLayoutUtils::FindContentFor(aMetrics.GetScrollId());
if (!content) {
return;
}
MOZ_ASSERT(aMetrics.GetUseDisplayPortMargins());
// We don't currently support zooming for subframes, so nothing extra
// needs to be done beyond the tasks common to this and UpdateRootFrame.
ScrollFrame(content, aMetrics);
if (nsCOMPtr<nsIPresShell> shell = GetPresShell(content)) {
SetDisplayPortMargins(shell, content, aMetrics);
}
SetPaintRequestTime(content, aMetrics.GetPaintRequestTime());
}