当前位置: 首页>>代码示例>>C++>>正文


C++ LayerManager类代码示例

本文整理汇总了C++中LayerManager的典型用法代码示例。如果您正苦于以下问题:C++ LayerManager类的具体用法?C++ LayerManager怎么用?C++ LayerManager使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了LayerManager类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: 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();
    }
}
开发者ID:msliu,项目名称:gecko-dev,代码行数:34,代码来源:nsWindow.cpp

示例2: Thread

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;
    }
  }
}
开发者ID:michaelrhanson,项目名称:mozilla-central,代码行数:32,代码来源:nsBaseWidget.cpp

示例3: LOG

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");
    }
}
开发者ID:hideakihata,项目名称:mozilla-central.fgv,代码行数:57,代码来源:nsWindow.cpp

示例4: selectionChangedSlot

void LayerTableView::selectionChangedSlot(const QItemSelection&, const QItemSelection&)
{
	QModelIndexList indexes = this->selectionModel()->selection().indexes();
	
	if (indexes.count() == 1)
	{
		LayerManager* pManager = LayerManager::getInstance();
		pManager->selectLayer(indexes.at(0).row());
	}

}
开发者ID:Iownnoname,项目名称:qt,代码行数:11,代码来源:layertableview.cpp

示例5: LOG

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");
    }
}
开发者ID:msliu,项目名称:mozilla-central,代码行数:51,代码来源:nsWindow.cpp

示例6: Thread

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;
    }
  }
}
开发者ID:msliu,项目名称:mozilla-central,代码行数:50,代码来源:nsBaseWidget.cpp

示例7: GetInterceptor

//--------------------------------------------------------------------------
/// Check if the newly-started frame should be automatically traced at a specific frame.
/// \returns An eTraceType value, corresponding to the value set in the server config.
//--------------------------------------------------------------------------
int MultithreadedTraceAnalyzerLayer::GetTraceTypeFlags()
{
    int traceTypeFlags = kTraceType_None;

    // It's time to capture a frame. Check the trace type that was requested.
    InterceptorBase* interceptor = GetInterceptor();
    LayerManager* thisLayerManager = interceptor->GetParentLayerManager();

    if (thisLayerManager->IsAutocaptureFrame())
    {
        traceTypeFlags = SG_GET_INT(OptionTraceType);
    }

    return traceTypeFlags;
}
开发者ID:davidlee80,项目名称:amd-gpuperfstudio-dx12,代码行数:19,代码来源:MultithreadedTraceAnalyzerLayer.cpp

示例8: GetLayerManager

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);
}
开发者ID:mtelleria,项目名称:bluegriffon-debian-packaging,代码行数:16,代码来源:RenderFrameParent.cpp

示例9: SendLayersDependentApzcTargetConfirmation

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);
}
开发者ID:WuChengLin,项目名称:gecko-dev,代码行数:16,代码来源:APZCCallbackHelper.cpp

示例10:

	void Cocos2dRenderManager::releaseAllVertexBuffer()
	{
		LayerManager* layers = LayerManager::getInstancePtr();
		if (layers != nullptr)
		{
			LayerManager::EnumeratorLayer layer = layers->getEnumerator();
			while (layer.next())
			{
				EnumeratorILayerNode layerNode = layer->getEnumerator();
				while (layerNode.next())
				{
					layerNode->releaseVertexBuffer();
				}
			}
		}
	}
开发者ID:dayongxie,项目名称:MyGUI,代码行数:16,代码来源:MyGUI_Cocos2dRenderManager.cpp

示例11: NS_ABORT_IF_FALSE

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;
}
开发者ID:mmmulani,项目名称:v8monkey,代码行数:46,代码来源:TabChild.cpp

示例12: GetBounds

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;
  }
}
开发者ID:nhirata,项目名称:releases-mozilla-central,代码行数:43,代码来源:nsBaseWidget.cpp

示例13: editor

void TimeLine::deleteCurrentLayer()
{
    LayerManager* layerMgr = editor()->layers();
    QString strLayerName = layerMgr->currentLayer()->name();

    int ret = QMessageBox::warning(this,
                                   tr("Delete Layer", "Windows title of Delete current layer pop-up."),
                                   tr("Are you sure you want to delete layer: ") + strLayerName + " ?",
                                   QMessageBox::Ok | QMessageBox::Cancel,
                                   QMessageBox::Ok);
    if (ret == QMessageBox::Ok)
    {
        Status st = layerMgr->deleteLayer(editor()->currentLayerIndex());
        if (st == Status::ERROR_NEED_AT_LEAST_ONE_CAMERA_LAYER)
        {
            QMessageBox::information(this, "",
                                     tr("Please keep at least one camera layer in project"));
        }
    }
}
开发者ID:scribblemaniac,项目名称:pencil,代码行数:20,代码来源:timeline.cpp

示例14: updateView

void LayerTableView::updateView()
{
	//Select layer at init.
	model->refreshModel();
	this->resizeRowsToContents();

	LayerManager* pManager = LayerManager::getInstance();
	QList<LayerItem>* pList = pManager->getpLayerList();
	int index = 0;
	for (QList<LayerItem>::iterator it = pList->begin(); it != pList->end(); it++)
	{
		if (it->isSelected)
		{
			this->selectRow(index);
			break;
		}
		index++;
	}
	this->update();
}
开发者ID:Iownnoname,项目名称:qt,代码行数:20,代码来源:layertableview.cpp

示例15: WillPaintWindow

void nsViewManager::WillPaintWindow(nsIWidget* aWidget)
{
  if (aWidget) {
    nsView* view = nsView::GetViewFor(aWidget);
    LayerManager *manager = aWidget->GetLayerManager();
    if (view &&
        (view->ForcedRepaint() || !manager->NeedsWidgetInvalidation())) {
      ProcessPendingUpdates();
      // Re-get the view pointer here since the ProcessPendingUpdates might have
      // destroyed it during CallWillPaintOnObservers.
      view = nsView::GetViewFor(aWidget);
      if (view) {
        view->SetForcedRepaint(false);
      }
    }
  }

  nsCOMPtr<nsIPresShell> shell = mPresShell;
  if (shell) {
    shell->WillPaintWindow();
  }
}
开发者ID:jonathanmarvens,项目名称:mozilla-central,代码行数:22,代码来源:nsViewManager.cpp


注:本文中的LayerManager类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。