本文整理汇总了C++中ContainerLayer::SetFrameMetrics方法的典型用法代码示例。如果您正苦于以下问题:C++ ContainerLayer::SetFrameMetrics方法的具体用法?C++ ContainerLayer::SetFrameMetrics怎么用?C++ ContainerLayer::SetFrameMetrics使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ContainerLayer
的用法示例。
在下文中一共展示了ContainerLayer::SetFrameMetrics方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: switch
//.........这里部分代码省略.........
layer->SetFixedPositionMargins(common.fixedPositionMargin());
if (PLayerParent* maskLayer = common.maskLayerParent()) {
layer->SetMaskLayer(cast(maskLayer)->AsLayer());
} else {
layer->SetMaskLayer(NULL);
}
layer->SetAnimations(common.animations());
typedef SpecificLayerAttributes Specific;
const SpecificLayerAttributes& specific = attrs.specific();
switch (specific.type()) {
case Specific::Tnull_t:
break;
case Specific::TThebesLayerAttributes: {
MOZ_LAYERS_LOG(("[ParentSide] thebes layer"));
ThebesLayerComposite* thebesLayer =
static_cast<ThebesLayerComposite*>(layer);
const ThebesLayerAttributes& attrs =
specific.get_ThebesLayerAttributes();
thebesLayer->SetValidRegion(attrs.validRegion());
break;
}
case Specific::TContainerLayerAttributes: {
MOZ_LAYERS_LOG(("[ParentSide] container layer"));
ContainerLayer* containerLayer =
static_cast<ContainerLayer*>(layer);
const ContainerLayerAttributes& attrs =
specific.get_ContainerLayerAttributes();
containerLayer->SetFrameMetrics(attrs.metrics());
containerLayer->SetPreScale(attrs.preXScale(), attrs.preYScale());
containerLayer->SetInheritedScale(attrs.inheritedXScale(), attrs.inheritedYScale());
break;
}
case Specific::TColorLayerAttributes:
MOZ_LAYERS_LOG(("[ParentSide] color layer"));
static_cast<ColorLayer*>(layer)->SetColor(
specific.get_ColorLayerAttributes().color().value());
break;
case Specific::TCanvasLayerAttributes:
MOZ_LAYERS_LOG(("[ParentSide] canvas layer"));
static_cast<CanvasLayer*>(layer)->SetFilter(
specific.get_CanvasLayerAttributes().filter());
static_cast<CanvasLayerComposite*>(layer)->SetBounds(
specific.get_CanvasLayerAttributes().bounds());
break;
case Specific::TRefLayerAttributes:
MOZ_LAYERS_LOG(("[ParentSide] ref layer"));
static_cast<RefLayer*>(layer)->SetReferentId(
specific.get_RefLayerAttributes().id());
break;
case Specific::TImageLayerAttributes: {
MOZ_LAYERS_LOG(("[ParentSide] image layer"));
ImageLayer* imageLayer = static_cast<ImageLayer*>(layer);
const ImageLayerAttributes& attrs = specific.get_ImageLayerAttributes();
示例2: switch
//.........这里部分代码省略.........
}
if (PLayerParent* maskLayer = common.maskLayerParent()) {
layer->SetMaskLayer(cast(maskLayer)->AsLayer());
} else {
layer->SetMaskLayer(NULL);
}
layer->SetAnimations(common.animations());
typedef SpecificLayerAttributes Specific;
const SpecificLayerAttributes& specific = attrs.specific();
switch (specific.type()) {
case Specific::Tnull_t:
break;
case Specific::TThebesLayerAttributes: {
MOZ_LAYERS_LOG(("[ParentSide] thebes layer"));
ShadowThebesLayer* thebesLayer =
static_cast<ShadowThebesLayer*>(layer);
const ThebesLayerAttributes& attrs =
specific.get_ThebesLayerAttributes();
thebesLayer->SetValidRegion(attrs.validRegion());
break;
}
case Specific::TContainerLayerAttributes: {
MOZ_LAYERS_LOG(("[ParentSide] container layer"));
ContainerLayer* containerLayer =
static_cast<ContainerLayer*>(layer);
const ContainerLayerAttributes& attrs =
specific.get_ContainerLayerAttributes();
containerLayer->SetFrameMetrics(attrs.metrics());
containerLayer->SetPreScale(attrs.preXScale(), attrs.preYScale());
break;
}
case Specific::TColorLayerAttributes:
MOZ_LAYERS_LOG(("[ParentSide] color layer"));
static_cast<ColorLayer*>(layer)->SetColor(
specific.get_ColorLayerAttributes().color().value());
break;
case Specific::TCanvasLayerAttributes:
MOZ_LAYERS_LOG(("[ParentSide] canvas layer"));
static_cast<CanvasLayer*>(layer)->SetFilter(
specific.get_CanvasLayerAttributes().filter());
break;
case Specific::TRefLayerAttributes:
MOZ_LAYERS_LOG(("[ParentSide] ref layer"));
static_cast<RefLayer*>(layer)->SetReferentId(
specific.get_RefLayerAttributes().id());
break;
case Specific::TImageLayerAttributes: {
MOZ_LAYERS_LOG(("[ParentSide] image layer"));
ImageLayer* imageLayer = static_cast<ImageLayer*>(layer);
const ImageLayerAttributes& attrs = specific.get_ImageLayerAttributes();
imageLayer->SetFilter(attrs.filter());
imageLayer->SetForceSingleTile(attrs.forceSingleTile());
break;