本文整理汇总了C++中LayerManager::AsShadowForwarder方法的典型用法代码示例。如果您正苦于以下问题:C++ LayerManager::AsShadowForwarder方法的具体用法?C++ LayerManager::AsShadowForwarder怎么用?C++ LayerManager::AsShadowForwarder使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LayerManager
的用法示例。
在下文中一共展示了LayerManager::AsShadowForwarder方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CreateCompositor
void nsBaseWidget::CreateCompositor()
{
mCompositorThread = new Thread("CompositorThread");
mCompositorParent = new CompositorParent(this, mCompositorThread);
if (mCompositorThread->Start()) {
LayerManager* lm = CreateBasicLayerManager();
MessageLoop *childMessageLoop = mCompositorThread->message_loop();
mCompositorChild = new CompositorChild(lm);
AsyncChannel *parentChannel = mCompositorParent->GetIPCChannel();
AsyncChannel::Side childSide = mozilla::ipc::AsyncChannel::Child;
mCompositorChild->Open(parentChannel, childMessageLoop, childSide);
PLayersChild* shadowManager =
mCompositorChild->SendPLayersConstructor(LayerManager::LAYERS_OPENGL);
if (shadowManager) {
ShadowLayerForwarder* lf = lm->AsShadowForwarder();
if (!lf) {
delete lm;
mCompositorChild = nsnull;
return;
}
lf->SetShadowManager(shadowManager);
lf->SetParentBackendType(LayerManager::LAYERS_OPENGL);
mLayerManager = lm;
} else {
NS_WARNING("fail to construct LayersChild");
delete lm;
mCompositorChild = nsnull;
}
}
}
示例2: CreateCompositor
void nsBaseWidget::CreateCompositor()
{
mCompositorThread = new Thread("CompositorThread");
if (mCompositorThread->Start()) {
bool renderToEGLSurface = false;
#ifdef MOZ_JAVA_COMPOSITOR
renderToEGLSurface = true;
#endif
nsIntRect rect;
GetBounds(rect);
mCompositorParent =
new CompositorParent(this, mCompositorThread->message_loop(), mCompositorThread->thread_id(),
renderToEGLSurface, rect.width, rect.height);
LayerManager* lm = CreateBasicLayerManager();
MessageLoop *childMessageLoop = mCompositorThread->message_loop();
mCompositorChild = new CompositorChild(lm);
AsyncChannel *parentChannel = mCompositorParent->GetIPCChannel();
AsyncChannel::Side childSide = mozilla::ipc::AsyncChannel::Child;
mCompositorChild->Open(parentChannel, childMessageLoop, childSide);
PRInt32 maxTextureSize;
PLayersChild* shadowManager;
if (mUseAcceleratedRendering) {
shadowManager = mCompositorChild->SendPLayersConstructor(LayerManager::LAYERS_OPENGL, &maxTextureSize);
} else {
shadowManager = mCompositorChild->SendPLayersConstructor(LayerManager::LAYERS_BASIC, &maxTextureSize);
}
if (shadowManager) {
ShadowLayerForwarder* lf = lm->AsShadowForwarder();
if (!lf) {
delete lm;
mCompositorChild = nsnull;
return;
}
lf->SetShadowManager(shadowManager);
if (mUseAcceleratedRendering)
lf->SetParentBackendType(LayerManager::LAYERS_OPENGL);
else
lf->SetParentBackendType(LayerManager::LAYERS_BASIC);
lf->SetMaxTextureSize(maxTextureSize);
mLayerManager = lm;
} else {
// We don't currently want to support not having a LayersChild
NS_RUNTIMEABORT("failed to construct LayersChild");
delete lm;
mCompositorChild = nsnull;
}
}
}
示例3:
static void
SendLayersDependentApzcTargetConfirmation(nsIPresShell* aShell, uint64_t aInputBlockId,
const nsTArray<ScrollableLayerGuid>& aTargets)
{
LayerManager* lm = aShell->GetLayerManager();
if (!lm) {
return;
}
LayerTransactionChild* shadow = lm->AsShadowForwarder()->GetShadowManager();
if (!shadow) {
return;
}
shadow->SendSetConfirmedTargetAPZC(aInputBlockId, aTargets);
}
示例4: CreateCompositor
void nsBaseWidget::CreateCompositor()
{
bool renderToEGLSurface = false;
#ifdef MOZ_ANDROID_OMTC
renderToEGLSurface = true;
#endif
nsIntRect rect;
GetBounds(rect);
mCompositorParent =
new CompositorParent(this, renderToEGLSurface, rect.width, rect.height);
LayerManager* lm = CreateBasicLayerManager();
MessageLoop *childMessageLoop = CompositorParent::CompositorLoop();
mCompositorChild = new CompositorChild(lm);
AsyncChannel *parentChannel = mCompositorParent->GetIPCChannel();
AsyncChannel::Side childSide = mozilla::ipc::AsyncChannel::Child;
mCompositorChild->Open(parentChannel, childMessageLoop, childSide);
int32_t maxTextureSize;
PLayersChild* shadowManager;
mozilla::layers::LayersBackend backendHint =
mUseLayersAcceleration ? mozilla::layers::LAYERS_OPENGL : mozilla::layers::LAYERS_BASIC;
mozilla::layers::LayersBackend parentBackend;
shadowManager = mCompositorChild->SendPLayersConstructor(
backendHint, 0, &parentBackend, &maxTextureSize);
if (shadowManager) {
ShadowLayerForwarder* lf = lm->AsShadowForwarder();
if (!lf) {
delete lm;
mCompositorChild = nullptr;
return;
}
lf->SetShadowManager(shadowManager);
lf->SetParentBackendType(parentBackend);
lf->SetMaxTextureSize(maxTextureSize);
mLayerManager = lm;
} else {
// We don't currently want to support not having a LayersChild
NS_RUNTIMEABORT("failed to construct LayersChild");
delete lm;
mCompositorChild = nullptr;
}
}