本文整理汇总了C++中GraphicsLayer::setName方法的典型用法代码示例。如果您正苦于以下问题:C++ GraphicsLayer::setName方法的具体用法?C++ GraphicsLayer::setName怎么用?C++ GraphicsLayer::setName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GraphicsLayer
的用法示例。
在下文中一共展示了GraphicsLayer::setName方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: syncLayerParameters
void LayerTreeHostProxy::syncLayerParameters(const WebLayerInfo& layerInfo)
{
WebLayerID id = layerInfo.id;
ensureLayer(id);
LayerMap::iterator it = m_layers.find(id);
GraphicsLayer* layer = it->second;
layer->setName(layerInfo.name);
layer->setReplicatedByLayer(layerByID(layerInfo.replica));
layer->setMaskLayer(layerByID(layerInfo.mask));
layer->setPosition(layerInfo.pos);
layer->setSize(layerInfo.size);
layer->setTransform(layerInfo.transform);
layer->setAnchorPoint(layerInfo.anchorPoint);
layer->setChildrenTransform(layerInfo.childrenTransform);
layer->setBackfaceVisibility(layerInfo.backfaceVisible);
layer->setContentsOpaque(layerInfo.contentsOpaque);
layer->setContentsRect(layerInfo.contentsRect);
layer->setDrawsContent(layerInfo.drawsContent);
if (layerInfo.imageIsUpdated)
assignImageToLayer(layer, layerInfo.imageBackingStoreID);
// Never make the root layer clip.
layer->setMasksToBounds(layerInfo.isRootLayer ? false : layerInfo.masksToBounds);
layer->setOpacity(layerInfo.opacity);
layer->setPreserves3D(layerInfo.preserves3D);
Vector<GraphicsLayer*> children;
for (size_t i = 0; i < layerInfo.children.size(); ++i) {
WebLayerID childID = layerInfo.children[i];
GraphicsLayer* child = layerByID(childID);
if (!child) {
child = createLayer(childID).leakPtr();
m_layers.add(childID, child);
}
children.append(child);
}
layer->setChildren(children);
for (size_t i = 0; i < layerInfo.animations.size(); ++i) {
const WebKit::WebLayerAnimation anim = layerInfo.animations[i];
switch (anim.operation) {
case WebKit::WebLayerAnimation::AddAnimation: {
const IntSize boxSize = anim.boxSize;
double offset = WTF::currentTime() - anim.startTime;
layer->addAnimation(anim.keyframeList, boxSize, anim.animation.get(), anim.name, offset);
break;
}
case WebKit::WebLayerAnimation::RemoveAnimation:
layer->removeAnimation(anim.name);
break;
case WebKit::WebLayerAnimation::PauseAnimation:
double offset = WTF::currentTime() - anim.startTime;
layer->pauseAnimation(anim.name, offset);
break;
}
}
if (layerInfo.isRootLayer && m_rootLayerID != id)
setRootLayerID(id);
}