本文整理汇总了C++中ShadowLayerParent类的典型用法代码示例。如果您正苦于以下问题:C++ ShadowLayerParent类的具体用法?C++ ShadowLayerParent怎么用?C++ ShadowLayerParent使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ShadowLayerParent类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
void
LayerTransactionParent::Destroy()
{
mDestroyed = true;
for (size_t i = 0; i < ManagedPLayerParent().Length(); ++i) {
ShadowLayerParent* slp =
static_cast<ShadowLayerParent*>(ManagedPLayerParent()[i]);
slp->Destroy();
}
}
示例2: ManagedPLayerParent
void
LayerTransactionParent::Destroy()
{
const ManagedContainer<PLayerParent>& layers = ManagedPLayerParent();
for (auto iter = layers.ConstIter(); !iter.Done(); iter.Next()) {
ShadowLayerParent* slp =
static_cast<ShadowLayerParent*>(iter.Get()->GetKey());
slp->Destroy();
}
mDestroyed = true;
}
示例3: ManagedPLayerParent
void
LayerTransactionParent::Destroy()
{
const ManagedContainer<PLayerParent>& layers = ManagedPLayerParent();
for (auto iter = layers.ConstIter(); !iter.Done(); iter.Next()) {
ShadowLayerParent* slp =
static_cast<ShadowLayerParent*>(iter.Get()->GetKey());
slp->Destroy();
}
InfallibleTArray<PTextureParent*> textures;
ManagedPTextureParent(textures);
for (unsigned int i = 0; i < textures.Length(); ++i) {
RefPtr<TextureHost> tex = TextureHost::AsTextureHost(textures[i]);
tex->DeallocateDeviceData();
}
mDestroyed = true;
}
示例4: MOZ_LAYERS_LOG
//.........这里部分代码省略.........
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::TOpPaintTiledLayerBuffer: {
MOZ_LAYERS_LOG(("[ParentSide] Paint TiledLayerBuffer"));
const OpPaintTiledLayerBuffer& op = edit.get_OpPaintTiledLayerBuffer();
ShadowLayerParent* shadow = AsShadowLayer(op);
ShadowThebesLayer* shadowLayer = static_cast<ShadowThebesLayer*>(shadow->AsLayer());
TiledLayerComposer* tileComposer = shadowLayer->AsTiledLayerComposer();
NS_ASSERTION(tileComposer, "shadowLayer is not a tile composer");
BasicTiledLayerBuffer* p = (BasicTiledLayerBuffer*)op.tiledLayerBuffer();
tileComposer->PaintedTiledLayerBuffer(p);
break;
}
case Edit::TOpPaintThebesBuffer: {
MOZ_LAYERS_LOG(("[ParentSide] Paint ThebesLayer"));
const OpPaintThebesBuffer& op = edit.get_OpPaintThebesBuffer();
ShadowLayerParent* shadow = AsShadowLayer(op);
ShadowThebesLayer* thebes =
static_cast<ShadowThebesLayer*>(shadow->AsLayer());
const ThebesBuffer& newFront = op.newFrontBuffer();
RenderTraceInvalidateStart(thebes, "FF00FF", op.updatedRegion().GetBounds());
OptionalThebesBuffer newBack;
nsIntRegion newValidRegion;
OptionalThebesBuffer readonlyFront;
nsIntRegion frontUpdatedRegion;
thebes->Swap(newFront, op.updatedRegion(),
&newBack, &newValidRegion,
&readonlyFront, &frontUpdatedRegion);
replyv.push_back(
OpThebesBufferSwap(
shadow, NULL,
newBack, newValidRegion,
示例5: MOZ_LAYERS_LOG
//.........这里部分代码省略.........
mRoot = AsShadowLayer(edit.get_OpSetRoot())->AsContainer();
break;
}
case Edit::TOpInsertAfter: {
MOZ_LAYERS_LOG(("[ParentSide] InsertAfter"));
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::TOpPaintThebesBuffer: {
MOZ_LAYERS_LOG(("[ParentSide] Paint ThebesLayer"));
const OpPaintThebesBuffer& op = edit.get_OpPaintThebesBuffer();
ShadowLayerParent* shadow = AsShadowLayer(op);
ShadowThebesLayer* thebes =
static_cast<ShadowThebesLayer*>(shadow->AsLayer());
const ThebesBuffer& newFront = op.newFrontBuffer();
ThebesBuffer newBack;
nsIntRegion newValidRegion;
OptionalThebesBuffer readonlyFront;
nsIntRegion frontUpdatedRegion;
thebes->Swap(newFront, op.updatedRegion(),
&newBack, &newValidRegion,
&readonlyFront, &frontUpdatedRegion);
replyv.push_back(
OpThebesBufferSwap(
shadow, NULL,
newBack, newValidRegion,
readonlyFront, frontUpdatedRegion));
break;
}
case Edit::TOpPaintCanvas: {
MOZ_LAYERS_LOG(("[ParentSide] Paint CanvasLayer"));
const OpPaintCanvas& op = edit.get_OpPaintCanvas();
ShadowLayerParent* shadow = AsShadowLayer(op);
ShadowCanvasLayer* canvas =
static_cast<ShadowCanvasLayer*>(shadow->AsLayer());
SurfaceDescriptor newFront = op.newFrontBuffer();
SurfaceDescriptor newBack;
canvas->Swap(op.newFrontBuffer(), &newBack);
if (newFront == newBack) {
newFront = SurfaceDescriptor();
}
示例6: profiler_tracing
bool
LayerTransactionParent::RecvUpdate(const InfallibleTArray<Edit>& cset,
const uint64_t& aTransactionId,
const TargetConfig& targetConfig,
const bool& isFirstPaint,
const bool& scheduleComposite,
const uint32_t& paintSequenceNumber,
const bool& isRepeatTransaction,
InfallibleTArray<EditReply>* reply)
{
profiler_tracing("Paint", "Composite", TRACING_INTERVAL_START);
PROFILER_LABEL("LayerTransactionParent", "RecvUpdate",
js::ProfileEntry::Category::GRAPHICS);
#ifdef COMPOSITOR_PERFORMANCE_WARNING
TimeStamp updateStart = TimeStamp::Now();
#endif
MOZ_LAYERS_LOG(("[ParentSide] received txn with %d edits", cset.Length()));
if (mDestroyed || !layer_manager() || layer_manager()->IsDestroyed()) {
return true;
}
if (mLayerManager && mLayerManager->GetCompositor() &&
!targetConfig.naturalBounds().IsEmpty()) {
mLayerManager->GetCompositor()->SetScreenRotation(targetConfig.rotation());
}
EditReplyVector replyv;
{
AutoResolveRefLayers resolve(mShadowLayersManager->GetCompositionManager(this));
layer_manager()->BeginTransaction();
}
for (EditArray::index_type i = 0; i < cset.Length(); ++i) {
const Edit& edit = cset[i];
switch (edit.type()) {
// Create* ops
case Edit::TOpCreateThebesLayer: {
MOZ_LAYERS_LOG(("[ParentSide] CreateThebesLayer"));
nsRefPtr<ThebesLayerComposite> layer =
layer_manager()->CreateThebesLayerComposite();
AsLayerComposite(edit.get_OpCreateThebesLayer())->Bind(layer);
break;
}
case Edit::TOpCreateContainerLayer: {
MOZ_LAYERS_LOG(("[ParentSide] CreateContainerLayer"));
nsRefPtr<ContainerLayer> layer = layer_manager()->CreateContainerLayerComposite();
AsLayerComposite(edit.get_OpCreateContainerLayer())->Bind(layer);
break;
}
case Edit::TOpCreateImageLayer: {
MOZ_LAYERS_LOG(("[ParentSide] CreateImageLayer"));
nsRefPtr<ImageLayerComposite> layer =
layer_manager()->CreateImageLayerComposite();
AsLayerComposite(edit.get_OpCreateImageLayer())->Bind(layer);
break;
}
case Edit::TOpCreateColorLayer: {
MOZ_LAYERS_LOG(("[ParentSide] CreateColorLayer"));
nsRefPtr<ColorLayerComposite> layer = layer_manager()->CreateColorLayerComposite();
AsLayerComposite(edit.get_OpCreateColorLayer())->Bind(layer);
break;
}
case Edit::TOpCreateCanvasLayer: {
MOZ_LAYERS_LOG(("[ParentSide] CreateCanvasLayer"));
nsRefPtr<CanvasLayerComposite> layer =
layer_manager()->CreateCanvasLayerComposite();
AsLayerComposite(edit.get_OpCreateCanvasLayer())->Bind(layer);
break;
}
case Edit::TOpCreateRefLayer: {
MOZ_LAYERS_LOG(("[ParentSide] CreateRefLayer"));
nsRefPtr<RefLayerComposite> layer =
layer_manager()->CreateRefLayerComposite();
AsLayerComposite(edit.get_OpCreateRefLayer())->Bind(layer);
break;
}
// Attributes
case Edit::TOpSetLayerAttributes: {
MOZ_LAYERS_LOG(("[ParentSide] SetLayerAttributes"));
const OpSetLayerAttributes& osla = edit.get_OpSetLayerAttributes();
ShadowLayerParent* layerParent = AsLayerComposite(osla);
Layer* layer = layerParent->AsLayer();
if (!layer) {
return false;
}
const LayerAttributes& attrs = osla.attrs();
//.........这里部分代码省略.........