зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1194472 - Correctly fetch compositor backend in WebGLContext. r=jgilbert
--HG-- extra : rebase_source : 9e0b5ba81b819b5b179e56dc7c4e1454a660b448
This commit is contained in:
Родитель
c9ee76cab8
Коммит
4f3f101fdb
|
@ -672,6 +672,7 @@ PopulateCapFallbackQueue(const SurfaceCaps& baseCaps,
|
|||
static bool
|
||||
CreateOffscreen(GLContext* gl, const WebGLContextOptions& options,
|
||||
const nsCOMPtr<nsIGfxInfo>& gfxInfo, WebGLContext* webgl,
|
||||
layers::LayersBackend layersBackend,
|
||||
layers::ISurfaceAllocator* surfAllocator)
|
||||
{
|
||||
SurfaceCaps baseCaps;
|
||||
|
@ -689,7 +690,7 @@ CreateOffscreen(GLContext* gl, const WebGLContextOptions& options,
|
|||
|
||||
if (gl->IsANGLE() ||
|
||||
(gl->GetContextType() == GLContextType::GLX &&
|
||||
gfxPlatform::GetPlatform()->GetCompositorBackend() == LayersBackend::LAYERS_OPENGL))
|
||||
layersBackend == LayersBackend::LAYERS_OPENGL))
|
||||
{
|
||||
// We can't use no-alpha formats on ANGLE yet because of:
|
||||
// https://code.google.com/p/angleproject/issues/detail?id=764
|
||||
|
@ -763,7 +764,8 @@ WebGLContext::CreateOffscreenGL(bool forceEnabled)
|
|||
if (!gl)
|
||||
break;
|
||||
|
||||
if (!CreateOffscreen(gl, mOptions, gfxInfo, this, surfAllocator))
|
||||
if (!CreateOffscreen(gl, mOptions, gfxInfo, this,
|
||||
GetCompositorBackendType(), surfAllocator))
|
||||
break;
|
||||
|
||||
if (!InitAndValidateGL())
|
||||
|
@ -1292,6 +1294,17 @@ WebGLContext::GetCanvasLayer(nsDisplayListBuilder* builder,
|
|||
return canvasLayer.forget();
|
||||
}
|
||||
|
||||
layers::LayersBackend
|
||||
WebGLContext::GetCompositorBackendType() const
|
||||
{
|
||||
nsIWidget* docWidget = nsContentUtils::WidgetForDocument(mCanvasElement->OwnerDoc());
|
||||
if (docWidget) {
|
||||
layers::LayerManager* layerManager = docWidget->GetLayerManager();
|
||||
return layerManager->GetCompositorBackendType();
|
||||
}
|
||||
return LayersBackend::LAYERS_NONE;
|
||||
}
|
||||
|
||||
void
|
||||
WebGLContext::GetContextAttributes(dom::Nullable<dom::WebGLContextAttributes>& retval)
|
||||
{
|
||||
|
|
|
@ -363,6 +363,8 @@ public:
|
|||
return IsContextLost() ? 0 : mHeight;
|
||||
}
|
||||
|
||||
layers::LayersBackend GetCompositorBackendType() const;
|
||||
|
||||
void
|
||||
GetContextAttributes(dom::Nullable<dom::WebGLContextAttributes>& retval);
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче