Bug 1513699 - Disable SkiaGL on WebRender r=jrmuizel

Disable SkiaGL on WebRender, since there is a case that R8G8B8X8 is used, but WebRender does not support R8G8B8X8 yet. And SkiaGL is already disabled by Bug 1468801.

Differential Revision: https://phabricator.services.mozilla.com/D14366
This commit is contained in:
sotaro 2018-12-13 18:01:16 +09:00
parent fd32b3a6fa
commit ba323650b7
3 changed files with 12 additions and 4 deletions

View File

@ -1262,9 +1262,11 @@ bool CanvasRenderingContext2D::AllowOpenGLCanvas() const {
// canvas creation, but in that case the
// HTMLCanvasElement::GetCompositorBackendType would return LAYERS_NONE
// as well, so it wouldn't help much.
//
// XXX Disable SkiaGL on WebRender, since there is a case that R8G8B8X8
// is used, but WebRender does not support R8G8B8X8.
return (mCompositorBackend == LayersBackend::LAYERS_OPENGL ||
mCompositorBackend == LayersBackend::LAYERS_WR) &&
return (mCompositorBackend == LayersBackend::LAYERS_OPENGL) &&
gfxPlatform::GetPlatform()->AllowOpenGLCanvas();
}

View File

@ -14,6 +14,7 @@
#include "gfxPlatform.h" // for gfxPlatform
#include "GLReadTexImageHelper.h"
#include "mozilla/gfx/BaseSize.h" // for BaseSize
#include "mozilla/gfx/gfxVars.h"
#include "mozilla/layers/BufferTexture.h"
#include "mozilla/layers/AsyncCanvasRenderer.h"
#include "mozilla/layers/CompositableForwarder.h"
@ -236,6 +237,9 @@ class TexClientFactory {
if (!areRGBAFormatsBroken) {
gfx::SurfaceFormat format = mHasAlpha ? gfx::SurfaceFormat::R8G8B8A8
: gfx::SurfaceFormat::R8G8B8X8;
if (gfxVars::UseWebRender() && format == gfx::SurfaceFormat::R8G8B8X8) {
MOZ_CRASH("R8G8B8X8 is not supported on WebRender");
}
ret = Create(format);
}

View File

@ -1563,10 +1563,12 @@ bool gfxPlatform::AllowOpenGLCanvas() {
// The compositor backend is only set correctly in the parent process,
// so we let content process always assume correct compositor backend.
// The callers have to do the right thing.
//
// XXX Disable SkiaGL on WebRender, since there is a case that R8G8B8X8
// is used, but WebRender does not support R8G8B8X8.
bool correctBackend =
!XRE_IsParentProcess() ||
((mCompositorBackend == LayersBackend::LAYERS_OPENGL ||
mCompositorBackend == LayersBackend::LAYERS_WR) &&
(mCompositorBackend == LayersBackend::LAYERS_OPENGL &&
(GetContentBackendFor(mCompositorBackend) == BackendType::SKIA));
if (gfxPrefs::CanvasAzureAccelerated() && correctBackend) {