本文整理汇总了C++中LayerManager::GetBackendType方法的典型用法代码示例。如果您正苦于以下问题:C++ LayerManager::GetBackendType方法的具体用法?C++ LayerManager::GetBackendType怎么用?C++ LayerManager::GetBackendType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LayerManager
的用法示例。
在下文中一共展示了LayerManager::GetBackendType方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setupLayerManager
void
nsWindow::DoDraw(void)
{
if (!hal::GetScreenEnabled()) {
gDrawRequest = true;
return;
}
if (!gWindowToRedraw) {
LOG(" no window to draw, bailing");
return;
}
StopBootAnimation();
nsIntRegion region = gWindowToRedraw->mDirtyRegion;
gWindowToRedraw->mDirtyRegion.SetEmpty();
LayerManager* lm = gWindowToRedraw->GetLayerManager();
if (mozilla::layers::LAYERS_OPENGL == lm->GetBackendType()) {
LayerManagerOGL* oglm = static_cast<LayerManagerOGL*>(lm);
oglm->SetClippingRegion(region);
oglm->SetWorldTransform(sRotationMatrix);
if (nsIWidgetListener* listener = gWindowToRedraw->GetWidgetListener())
listener->PaintWindow(gWindowToRedraw, region, 0);
} else if (mozilla::layers::LAYERS_BASIC == lm->GetBackendType()) {
MOZ_ASSERT(sFramebufferOpen || sUsingOMTC);
nsRefPtr<gfxASurface> targetSurface;
if(sUsingOMTC)
targetSurface = sOMTCSurface;
else
targetSurface = Framebuffer::BackBuffer();
{
nsRefPtr<gfxContext> ctx = new gfxContext(targetSurface);
gfxUtils::PathFromRegion(ctx, region);
ctx->Clip();
// No double-buffering needed.
AutoLayerManagerSetup setupLayerManager(
gWindowToRedraw, ctx, mozilla::layers::BUFFER_NONE,
ScreenRotation(EffectiveScreenRotation()));
if (nsIWidgetListener* listener = gWindowToRedraw->GetWidgetListener())
listener->PaintWindow(gWindowToRedraw, region, 0);
}
if (!sUsingOMTC) {
targetSurface->Flush();
Framebuffer::Present(region);
}
} else {
NS_RUNTIMEABORT("Unexpected layer manager type");
}
}
示例2: event
void
nsWindow::DoDraw(void)
{
if (!hal::GetScreenEnabled()) {
gDrawRequest = true;
return;
}
if (!gWindowToRedraw) {
LOG(" no window to draw, bailing");
return;
}
nsPaintEvent event(true, NS_PAINT, gWindowToRedraw);
event.region = gWindowToRedraw->mDirtyRegion;
gWindowToRedraw->mDirtyRegion.SetEmpty();
LayerManager* lm = gWindowToRedraw->GetLayerManager();
if (LayerManager::LAYERS_OPENGL == lm->GetBackendType()) {
LayerManagerOGL* oglm = static_cast<LayerManagerOGL*>(lm);
oglm->SetClippingRegion(event.region);
oglm->SetWorldTransform(sRotationMatrix);
gWindowToRedraw->mEventCallback(&event);
} else if (LayerManager::LAYERS_BASIC == lm->GetBackendType()) {
MOZ_ASSERT(sFramebufferOpen || sUsingOMTC);
nsRefPtr<gfxASurface> targetSurface;
if(sUsingOMTC)
targetSurface = sOMTCSurface;
else
targetSurface = Framebuffer::BackBuffer();
{
nsRefPtr<gfxContext> ctx = new gfxContext(targetSurface);
gfxUtils::PathFromRegion(ctx, event.region);
ctx->Clip();
// No double-buffering needed.
AutoLayerManagerSetup setupLayerManager(
gWindowToRedraw, ctx, BasicLayerManager::BUFFER_NONE);
gWindowToRedraw->mEventCallback(&event);
}
if (!sUsingOMTC) {
targetSurface->Flush();
Framebuffer::Present(event.region);
}
} else {
NS_RUNTIMEABORT("Unexpected layer manager type");
}
}
示例3: LOG
void
nsWindow::DoDraw(void)
{
if (!hal::GetScreenEnabled()) {
gDrawRequest = true;
return;
}
if (sTopWindows.IsEmpty()) {
LOG(" no window to draw, bailing");
return;
}
nsWindow *targetWindow = (nsWindow *)sTopWindows[0];
while (targetWindow->GetLastChild())
targetWindow = (nsWindow *)targetWindow->GetLastChild();
nsIWidgetListener* listener = targetWindow->GetWidgetListener();
if (listener) {
listener->WillPaintWindow(targetWindow);
}
LayerManager* lm = targetWindow->GetLayerManager();
if (mozilla::layers::LayersBackend::LAYERS_CLIENT == lm->GetBackendType()) {
// No need to do anything, the compositor will handle drawing
} else {
NS_RUNTIMEABORT("Unexpected layer manager type");
}
listener = targetWindow->GetWidgetListener();
if (listener) {
listener->DidPaintWindow();
}
}
示例4: ShadowLayersParent
PLayersParent*
RenderFrameParent::AllocPLayers(LayerManager::LayersBackend* aBackendType)
{
if (!mFrameLoader || mFrameLoaderDestroyed) {
*aBackendType = LayerManager::LAYERS_NONE;
return nsnull;
}
LayerManager* lm = GetLayerManager();
ShadowLayerManager* slm = lm->AsShadowManager();
if (!slm) {
*aBackendType = LayerManager::LAYERS_NONE;
return nsnull;
}
*aBackendType = lm->GetBackendType();
return new ShadowLayersParent(slm, this);
}
示例5: nsIntRect
bool
TabChild::InitWidget(const nsIntSize& size)
{
NS_ABORT_IF_FALSE(!mWidget && !mRemoteFrame, "CreateWidget twice?");
mWidget = nsIWidget::CreatePuppetWidget(this);
if (!mWidget) {
NS_ERROR("couldn't create fake widget");
return false;
}
mWidget->Create(
nsnull, 0, // no parents
nsIntRect(nsIntPoint(0, 0), size),
nsnull, // HandleWidgetEvent
nsnull // nsIDeviceContext
);
RenderFrameChild* remoteFrame =
static_cast<RenderFrameChild*>(SendPRenderFrameConstructor());
if (!remoteFrame) {
NS_WARNING("failed to construct RenderFrame");
return false;
}
NS_ABORT_IF_FALSE(0 == remoteFrame->ManagedPLayersChild().Length(),
"shouldn't have a shadow manager yet");
PLayersChild* shadowManager = remoteFrame->SendPLayersConstructor();
if (!shadowManager) {
NS_WARNING("failed to construct LayersChild");
// This results in |remoteFrame| being deleted.
PRenderFrameChild::Send__delete__(remoteFrame);
return false;
}
LayerManager* lm = mWidget->GetLayerManager();
NS_ABORT_IF_FALSE(LayerManager::LAYERS_BASIC == lm->GetBackendType(),
"content processes should only be using BasicLayers");
BasicShadowLayerManager* bslm = static_cast<BasicShadowLayerManager*>(lm);
NS_ABORT_IF_FALSE(!bslm->HasShadowManager(),
"PuppetWidget shouldn't have shadow manager yet");
bslm->SetShadowManager(shadowManager);
mRemoteFrame = remoteFrame;
return true;
}