本文整理汇总了C++中ContainerLayer::GetAsyncPanZoomController方法的典型用法代码示例。如果您正苦于以下问题:C++ ContainerLayer::GetAsyncPanZoomController方法的具体用法?C++ ContainerLayer::GetAsyncPanZoomController怎么用?C++ ContainerLayer::GetAsyncPanZoomController使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ContainerLayer
的用法示例。
在下文中一共展示了ContainerLayer::GetAsyncPanZoomController方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: cast
bool
LayerTransactionParent::RecvSetAsyncScrollOffset(PLayerParent* aLayer,
const int32_t& aX, const int32_t& aY)
{
if (mDestroyed || !layer_manager() || layer_manager()->IsDestroyed()) {
return false;
}
Layer* layer = cast(aLayer)->AsLayer();
if (!layer) {
return false;
}
ContainerLayer* containerLayer = layer->AsContainerLayer();
if (!containerLayer) {
return false;
}
AsyncPanZoomController* controller = containerLayer->GetAsyncPanZoomController();
if (!controller) {
return false;
}
controller->SetTestAsyncScrollOffset(CSSPoint(aX, aY));
return true;
}
示例2: displayPort
bool
AsyncCompositionManager::ApplyAsyncContentTransformToTree(TimeStamp aCurrentFrame,
Layer *aLayer,
bool* aWantNextFrame)
{
bool appliedTransform = false;
for (Layer* child = aLayer->GetFirstChild();
child; child = child->GetNextSibling()) {
appliedTransform |=
ApplyAsyncContentTransformToTree(aCurrentFrame, child, aWantNextFrame);
}
ContainerLayer* container = aLayer->AsContainerLayer();
if (!container) {
return appliedTransform;
}
if (AsyncPanZoomController* controller = container->GetAsyncPanZoomController()) {
LayerComposite* layerComposite = aLayer->AsLayerComposite();
gfx3DMatrix oldTransform = aLayer->GetTransform();
ViewTransform treeTransform;
ScreenPoint scrollOffset;
*aWantNextFrame |=
controller->SampleContentTransformForFrame(aCurrentFrame,
&treeTransform,
scrollOffset);
const gfx3DMatrix& rootTransform = mLayerManager->GetRoot()->GetTransform();
const FrameMetrics& metrics = container->GetFrameMetrics();
// XXX We use rootTransform instead of metrics.mResolution here because on
// Fennec the resolution is set on the root layer rather than the scrollable layer.
// The SyncFrameMetrics call and the paintScale variable are used on Fennec only
// so it doesn't affect any other platforms. See bug 732971.
CSSToLayerScale paintScale = metrics.mDevPixelsPerCSSPixel
/ LayerToLayoutDeviceScale(rootTransform.GetXScale(), rootTransform.GetYScale());
CSSRect displayPort(metrics.mCriticalDisplayPort.IsEmpty() ?
metrics.mDisplayPort : metrics.mCriticalDisplayPort);
LayerMargin fixedLayerMargins(0, 0, 0, 0);
ScreenPoint offset(0, 0);
SyncFrameMetrics(scrollOffset, treeTransform.mScale.scale, metrics.mScrollableRect,
mLayersUpdated, displayPort, paintScale,
mIsFirstPaint, fixedLayerMargins, offset);
mIsFirstPaint = false;
mLayersUpdated = false;
// Apply the render offset
mLayerManager->GetCompositor()->SetScreenRenderOffset(offset);
gfx3DMatrix transform(gfx3DMatrix(treeTransform) * aLayer->GetTransform());
// The transform already takes the resolution scale into account. Since we
// will apply the resolution scale again when computing the effective
// transform, we must apply the inverse resolution scale here.
transform.Scale(1.0f/container->GetPreXScale(),
1.0f/container->GetPreYScale(),
1);
transform.ScalePost(1.0f/aLayer->GetPostXScale(),
1.0f/aLayer->GetPostYScale(),
1);
layerComposite->SetShadowTransform(transform);
NS_ASSERTION(!layerComposite->GetShadowTransformSetByAnimation(),
"overwriting animated transform!");
// Apply resolution scaling to the old transform - the layer tree as it is
// doesn't have the necessary transform to display correctly.
#ifdef MOZ_WIDGET_ANDROID
// XXX We use rootTransform instead of the resolution on the individual layer's
// FrameMetrics on Fennec because the resolution is set on the root layer rather
// than the scrollable layer. See bug 732971. On non-Fennec we do the right thing.
LayoutDeviceToLayerScale resolution(1.0 / rootTransform.GetXScale(),
1.0 / rootTransform.GetYScale());
#else
LayoutDeviceToLayerScale resolution = metrics.mResolution;
#endif
oldTransform.Scale(resolution.scale, resolution.scale, 1);
AlignFixedLayersForAnchorPoint(aLayer, aLayer, oldTransform, fixedLayerMargins);
appliedTransform = true;
}
return appliedTransform;
}