本文整理汇总了C++中RenderThread::AddRenderer方法的典型用法代码示例。如果您正苦于以下问题:C++ RenderThread::AddRenderer方法的具体用法?C++ RenderThread::AddRenderer怎么用?C++ RenderThread::AddRenderer使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RenderThread
的用法示例。
在下文中一共展示了RenderThread::AddRenderer方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Run
virtual void Run(RenderThread& aRenderThread, WindowId aWindowId) override
{
layers::AutoCompleteTask complete(mTask);
RefPtr<gl::GLContext> gl;
if (gfx::gfxVars::UseWebRenderANGLE()) {
gl = gl::GLContextProviderEGL::CreateForCompositorWidget(mCompositorWidget, true);
if (!gl || !gl->IsANGLE()) {
gfxCriticalNote << "Failed ANGLE GL context creation for WebRender: " << gfx::hexa(gl.get());
return;
}
}
if (!gl) {
gl = gl::GLContextProvider::CreateForCompositorWidget(mCompositorWidget, true);
}
if (!gl || !gl->MakeCurrent()) {
gfxCriticalNote << "Failed GL context creation for WebRender: " << gfx::hexa(gl.get());
return;
}
gl->fGetIntegerv(LOCAL_GL_MAX_TEXTURE_SIZE, mMaxTextureSize);
*mUseANGLE = gl->IsANGLE();
WrRenderer* wrRenderer = nullptr;
if (!wr_window_new(aWindowId, mSize.width, mSize.height, gl.get(),
this->mEnableProfiler, mWrApi, &wrRenderer)) {
// wr_window_new puts a message into gfxCriticalNote if it returns false
return;
}
MOZ_ASSERT(wrRenderer);
RefPtr<RenderThread> thread = &aRenderThread;
auto renderer = MakeUnique<RendererOGL>(Move(thread),
Move(gl),
Move(mCompositorWidget),
aWindowId,
wrRenderer,
mBridge);
if (wrRenderer && renderer) {
WrExternalImageHandler handler = renderer->GetExternalImageHandler();
wr_renderer_set_external_image_handler(wrRenderer, &handler);
}
aRenderThread.AddRenderer(aWindowId, Move(renderer));
}