本文整理汇总了C++中LayerComposite::EnsureBuffer方法的典型用法代码示例。如果您正苦于以下问题:C++ LayerComposite::EnsureBuffer方法的具体用法?C++ LayerComposite::EnsureBuffer怎么用?C++ LayerComposite::EnsureBuffer使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LayerComposite
的用法示例。
在下文中一共展示了LayerComposite::EnsureBuffer方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: switch
//.........这里部分代码省略.........
const OpInsertAfter& oia = edit.get_OpInsertAfter();
ShadowContainer(oia)->AsContainer()->InsertAfter(
ShadowChild(oia)->AsLayer(), ShadowAfter(oia)->AsLayer());
break;
}
case Edit::TOpAppendChild: {
MOZ_LAYERS_LOG(("[ParentSide] AppendChild"));
const OpAppendChild& oac = edit.get_OpAppendChild();
ShadowContainer(oac)->AsContainer()->InsertAfter(
ShadowChild(oac)->AsLayer(), NULL);
break;
}
case Edit::TOpRemoveChild: {
MOZ_LAYERS_LOG(("[ParentSide] RemoveChild"));
const OpRemoveChild& orc = edit.get_OpRemoveChild();
Layer* childLayer = ShadowChild(orc)->AsLayer();
ShadowContainer(orc)->AsContainer()->RemoveChild(childLayer);
break;
}
case Edit::TOpRepositionChild: {
MOZ_LAYERS_LOG(("[ParentSide] RepositionChild"));
const OpRepositionChild& orc = edit.get_OpRepositionChild();
ShadowContainer(orc)->AsContainer()->RepositionChild(
ShadowChild(orc)->AsLayer(), ShadowAfter(orc)->AsLayer());
break;
}
case Edit::TOpRaiseToTopChild: {
MOZ_LAYERS_LOG(("[ParentSide] RaiseToTopChild"));
const OpRaiseToTopChild& rtc = edit.get_OpRaiseToTopChild();
ShadowContainer(rtc)->AsContainer()->RepositionChild(
ShadowChild(rtc)->AsLayer(), NULL);
break;
}
case Edit::TCompositableOperation: {
ReceiveCompositableUpdate(edit.get_CompositableOperation(),
replyv);
break;
}
case Edit::TOpAttachCompositable: {
const OpAttachCompositable& op = edit.get_OpAttachCompositable();
Attach(cast(op.layerParent()), cast(op.compositableParent()));
break;
}
case Edit::TOpAttachAsyncCompositable: {
const OpAttachAsyncCompositable& op = edit.get_OpAttachAsyncCompositable();
CompositableParent* compositableParent = CompositableMap::Get(op.containerID());
MOZ_ASSERT(compositableParent, "CompositableParent not found in the map");
Attach(cast(op.layerParent()), compositableParent);
compositableParent->SetCompositorID(mLayerManager->GetCompositor()->GetCompositorID());
break;
}
case Edit::TOpPaintTiledLayerBuffer: {
MOZ_LAYERS_LOG(("[ParentSide] Paint TiledLayerBuffer"));
const OpPaintTiledLayerBuffer& op = edit.get_OpPaintTiledLayerBuffer();
ShadowLayerParent* shadow = AsShadowLayer(op);
LayerComposite* compositeLayer = shadow->AsLayer()->AsLayerComposite();
compositeLayer->EnsureBuffer(BUFFER_TILED);
TiledLayerComposer* tileComposer = compositeLayer->AsTiledLayerComposer();
NS_ASSERTION(tileComposer, "compositeLayer is not a tile composer");
BasicTiledLayerBuffer* p = reinterpret_cast<BasicTiledLayerBuffer*>(op.tiledLayerBuffer());
tileComposer->PaintedTiledLayerBuffer(p);
break;
}
default:
NS_RUNTIMEABORT("not reached");
}
}
layer_manager()->EndTransaction(NULL, NULL, LayerManager::END_NO_IMMEDIATE_REDRAW);
if (reply) {
reply->SetCapacity(replyv.size());
if (replyv.size() > 0) {
reply->AppendElements(&replyv.front(), replyv.size());
}
}
// Ensure that any pending operations involving back and front
// buffers have completed, so that neither process stomps on the
// other's buffer contents.
ShadowLayerManager::PlatformSyncBeforeReplyUpdate();
mShadowLayersManager->ShadowLayersUpdated(this, targetConfig, isFirstPaint);
#ifdef COMPOSITOR_PERFORMANCE_WARNING
int compositeTime = (int)(mozilla::TimeStamp::Now() - updateStart).ToMilliseconds();
if (compositeTime > 15) {
printf_stderr("Compositor: Layers update took %i ms (blocking gecko).\n", compositeTime);
}
#endif
return true;
}