本文整理汇总了C++中LayerMetricsWrapper::Metrics方法的典型用法代码示例。如果您正苦于以下问题:C++ LayerMetricsWrapper::Metrics方法的具体用法?C++ LayerMetricsWrapper::Metrics怎么用?C++ LayerMetricsWrapper::Metrics使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LayerMetricsWrapper
的用法示例。
在下文中一共展示了LayerMetricsWrapper::Metrics方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetAncestorLayers
bool
ClientTiledPaintedLayer::UseFastPath()
{
LayerMetricsWrapper scrollAncestor;
GetAncestorLayers(&scrollAncestor, nullptr);
if (!scrollAncestor) {
return true;
}
const FrameMetrics& parentMetrics = scrollAncestor.Metrics();
bool multipleTransactionsNeeded = gfxPlatform::GetPlatform()->UseProgressivePaint()
|| gfxPrefs::UseLowPrecisionBuffer()
|| !parentMetrics.GetCriticalDisplayPort().IsEmpty();
bool isFixed = GetIsFixedPosition() || GetParent()->GetIsFixedPosition();
return !multipleTransactionsNeeded || isFixed || parentMetrics.GetDisplayPort().IsEmpty();
}
示例2: GetAncestorLayers
bool
ClientTiledPaintedLayer::UseProgressiveDraw() {
if (!gfxPlatform::GetPlatform()->UseProgressivePaint()) {
// pref is disabled, so never do progressive
return false;
}
if (!mContentClient->GetTiledBuffer()->SupportsProgressiveUpdate()) {
return false;
}
if (ClientManager()->HasShadowTarget()) {
// This condition is true when we are in a reftest scenario. We don't want
// to draw progressively here because it can cause intermittent reftest
// failures because the harness won't wait for all the tiles to be drawn.
return false;
}
if (mPaintData.mCriticalDisplayPort.IsEmpty()) {
// This catches three scenarios:
// 1) This layer doesn't have a scrolling ancestor
// 2) This layer is subject to OMTA transforms
// 3) Low-precision painting is disabled
// In all of these cases, we don't want to draw this layer progressively.
return false;
}
if (GetIsFixedPosition() || GetParent()->GetIsFixedPosition()) {
// This layer is fixed-position and so even if it does have a scrolling
// ancestor it will likely be entirely on-screen all the time, so we
// should draw it all at once
return false;
}
if (ClientManager()->AsyncPanZoomEnabled()) {
LayerMetricsWrapper scrollAncestor;
GetAncestorLayers(&scrollAncestor, nullptr, nullptr);
MOZ_ASSERT(scrollAncestor); // because mPaintData.mCriticalDisplayPort is non-empty
const FrameMetrics& parentMetrics = scrollAncestor.Metrics();
if (!IsScrollingOnCompositor(parentMetrics)) {
return false;
}
}
return true;
}
示例3: GetAncestorLayers
bool
ClientTiledPaintedLayer::UseProgressiveDraw() {
if (!gfxPrefs::ProgressivePaint()) {
// pref is disabled, so never do progressive
return false;
}
if (!mContentClient->GetTiledBuffer()->SupportsProgressiveUpdate()) {
return false;
}
if (ClientManager()->HasShadowTarget()) {
// This condition is true when we are in a reftest scenario. We don't want
// to draw progressively here because it can cause intermittent reftest
// failures because the harness won't wait for all the tiles to be drawn.
return false;
}
if (GetIsFixedPosition() || GetParent()->GetIsFixedPosition()) {
// This layer is fixed-position and so even if it does have a scrolling
// ancestor it will likely be entirely on-screen all the time, so we
// should draw it all at once
return false;
}
if (mPaintData.mHasTransformAnimation) {
// The compositor is going to animate this somehow, so we want it all
// on the screen at once.
return false;
}
if (ClientManager()->AsyncPanZoomEnabled()) {
LayerMetricsWrapper scrollAncestor;
GetAncestorLayers(&scrollAncestor, nullptr, nullptr);
MOZ_ASSERT(scrollAncestor); // because mPaintData.mCriticalDisplayPort is set
if (!scrollAncestor) {
return false;
}
const FrameMetrics& parentMetrics = scrollAncestor.Metrics();
if (!IsScrollingOnCompositor(parentMetrics)) {
return false;
}
}
return true;
}
示例4: GetAncestorLayers
bool
ClientTiledPaintedLayer::UseFastPath()
{
LayerMetricsWrapper scrollAncestor;
GetAncestorLayers(&scrollAncestor, nullptr);
if (!scrollAncestor) {
return true;
}
const FrameMetrics& parentMetrics = scrollAncestor.Metrics();
bool multipleTransactionsNeeded = gfxPlatform::GetPlatform()->UseProgressivePaint()
|| gfxPrefs::UseLowPrecisionBuffer()
|| !parentMetrics.GetCriticalDisplayPort().IsEmpty();
bool isFixed = GetIsFixedPosition() || GetParent()->GetIsFixedPosition();
bool isScrollable = parentMetrics.IsScrollable();
return !multipleTransactionsNeeded || isFixed || !isScrollable
#if !defined(MOZ_WIDGET_ANDROID) || defined(MOZ_ANDROID_APZ)
|| !IsScrollingOnCompositor(parentMetrics)
#endif
;
}