本文整理汇总了C++中CompositorChild类的典型用法代码示例。如果您正苦于以下问题:C++ CompositorChild类的具体用法?C++ CompositorChild怎么用?C++ CompositorChild使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CompositorChild类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Manager
bool
ClientTiledPaintedLayer::IsScrollingOnCompositor(const FrameMetrics& aParentMetrics)
{
CompositorChild* compositor = nullptr;
if (Manager() && Manager()->AsClientLayerManager()) {
compositor = Manager()->AsClientLayerManager()->GetCompositorChild();
}
if (!compositor) {
return false;
}
FrameMetrics compositorMetrics;
if (!compositor->LookupCompositorFrameMetrics(aParentMetrics.GetScrollId(),
compositorMetrics)) {
return false;
}
// 1 is a tad high for a fuzzy equals epsilon however if our scroll delta
// is so small then we have nothing to gain from using paint heuristics.
float COORDINATE_EPSILON = 1.f;
return !FuzzyEqualsAdditive(compositorMetrics.GetScrollOffset().x,
aParentMetrics.GetScrollOffset().x,
COORDINATE_EPSILON) ||
!FuzzyEqualsAdditive(compositorMetrics.GetScrollOffset().y,
aParentMetrics.GetScrollOffset().y,
COORDINATE_EPSILON);
}
示例2: GetRemoteRenderer
void
ClientLayerManager::StopFrameTimeRecording(uint32_t aStartIndex,
nsTArray<float>& aFrameIntervals)
{
CompositorChild* renderer = GetRemoteRenderer();
if (renderer) {
renderer->SendStopFrameTimeRecording(aStartIndex, &aFrameIntervals);
}
}
示例3: MOZ_ASSERT
void
ClientLayerManager::GetFrameUniformity(FrameUniformityData* aOutData)
{
MOZ_ASSERT(XRE_IsParentProcess(), "Frame Uniformity only supported in parent process");
if (HasShadowManager()) {
CompositorChild* child = GetRemoteRenderer();
child->SendGetFrameUniformity(aOutData);
return;
}
return LayerManager::GetFrameUniformity(aOutData);
}
示例4: MOZ_ASSERT
bool
SharedFrameMetricsHelper::UpdateFromCompositorFrameMetrics(
ContainerLayer* aLayer,
bool aHasPendingNewThebesContent,
bool aLowPrecision,
ParentLayerRect& aCompositionBounds,
CSSToParentLayerScale& aZoom)
{
MOZ_ASSERT(aLayer);
CompositorChild* compositor = CompositorChild::Get();
if (!compositor) {
FindFallbackContentFrameMetrics(aLayer, aCompositionBounds, aZoom);
return false;
}
const FrameMetrics& contentMetrics = aLayer->GetFrameMetrics();
FrameMetrics compositorMetrics;
if (!compositor->LookupCompositorFrameMetrics(contentMetrics.mScrollId,
compositorMetrics)) {
FindFallbackContentFrameMetrics(aLayer, aCompositionBounds, aZoom);
return false;
}
aCompositionBounds = ParentLayerRect(compositorMetrics.mCompositionBounds);
aZoom = compositorMetrics.GetZoomToParent();
// Reset the checkerboard risk flag when switching to low precision
// rendering.
if (aLowPrecision && !mLastProgressiveUpdateWasLowPrecision) {
// Skip low precision rendering until we're at risk of checkerboarding.
if (!mProgressiveUpdateWasInDanger) {
return true;
}
mProgressiveUpdateWasInDanger = false;
}
mLastProgressiveUpdateWasLowPrecision = aLowPrecision;
// Always abort updates if the resolution has changed. There's no use
// in drawing at the incorrect resolution.
if (!FuzzyEquals(compositorMetrics.GetZoom().scale, contentMetrics.GetZoom().scale)) {
return true;
}
// Never abort drawing if we can't be sure we've sent a more recent
// display-port. If we abort updating when we shouldn't, we can end up
// with blank regions on the screen and we open up the risk of entering
// an endless updating cycle.
if (fabsf(contentMetrics.GetScrollOffset().x - compositorMetrics.GetScrollOffset().x) <= 2 &&
fabsf(contentMetrics.GetScrollOffset().y - compositorMetrics.GetScrollOffset().y) <= 2 &&
fabsf(contentMetrics.mDisplayPort.x - compositorMetrics.mDisplayPort.x) <= 2 &&
fabsf(contentMetrics.mDisplayPort.y - compositorMetrics.mDisplayPort.y) <= 2 &&
fabsf(contentMetrics.mDisplayPort.width - compositorMetrics.mDisplayPort.width) <= 2 &&
fabsf(contentMetrics.mDisplayPort.height - compositorMetrics.mDisplayPort.height)) {
return false;
}
// When not a low precision pass and the page is in danger of checker boarding
// abort update.
if (!aLowPrecision && !mProgressiveUpdateWasInDanger) {
if (AboutToCheckerboard(contentMetrics, compositorMetrics)) {
mProgressiveUpdateWasInDanger = true;
return true;
}
}
// Abort drawing stale low-precision content if there's a more recent
// display-port in the pipeline.
if (aLowPrecision && !aHasPendingNewThebesContent) {
return true;
}
return false;
}