Bug 1734649 - Part 1. Remove checks for WebRender based on RenderThread. r=jgilbert

IsAccelAngleSupported would always indicate ANGLE support on Windows but
we have a specific variant of GLLibraryEGL::CreateDisplay for use with
ANGLE which bypasses this check for the WebRender compositor. It is
otherwise only used for WebGL and non-Windows, so we can skip the
assertions here.

Differential Revision: https://phabricator.services.mozilla.com/D129895
This commit is contained in:
Andrew Osmond 2021-11-04 16:29:44 +00:00
Родитель a0dd0c9c53
Коммит bbbb7c2f0e
2 изменённых файлов: 2 добавлений и 11 удалений

Просмотреть файл

@ -20,7 +20,6 @@
#include "mozilla/ScopeExit.h" #include "mozilla/ScopeExit.h"
#include "mozilla/StaticPtr.h" #include "mozilla/StaticPtr.h"
#include "mozilla/layers/CompositorOptions.h" #include "mozilla/layers/CompositorOptions.h"
#include "mozilla/webrender/RenderThread.h"
#include "mozilla/widget/CompositorWidget.h" #include "mozilla/widget/CompositorWidget.h"
#include "mozilla/widget/WinCompositorWidget.h" #include "mozilla/widget/WinCompositorWidget.h"
@ -382,7 +381,7 @@ static RefPtr<GLContext> CreateForWidget(const HWND window,
LOCAL_WGL_FULL_ACCELERATION_ARB, LOCAL_WGL_FULL_ACCELERATION_ARB,
0}; 0};
const int* attribs; const int* attribs;
if (wr::RenderThread::IsInRenderThread()) { if (isWebRender) {
attribs = kAttribsForWebRender; attribs = kAttribsForWebRender;
} else { } else {
attribs = kAttribs; attribs = kAttribs;
@ -414,7 +413,7 @@ static RefPtr<GLContext> CreateForWidget(const HWND window,
0}; 0};
const int* attribs; const int* attribs;
if (wr::RenderThread::IsInRenderThread()) { if (isWebRender) {
attribs = kAttribsForWebRender; attribs = kAttribsForWebRender;
} else { } else {
attribs = kAttribs; attribs = kAttribs;

Просмотреть файл

@ -18,7 +18,6 @@
#include "mozilla/StaticPrefs_gfx.h" #include "mozilla/StaticPrefs_gfx.h"
#include "mozilla/StaticPrefs_webgl.h" #include "mozilla/StaticPrefs_webgl.h"
#include "mozilla/Unused.h" #include "mozilla/Unused.h"
#include "mozilla/webrender/RenderThread.h"
#include "nsDirectoryServiceDefs.h" #include "nsDirectoryServiceDefs.h"
#include "nsDirectoryServiceUtils.h" #include "nsDirectoryServiceUtils.h"
#include "nsPrintfCString.h" #include "nsPrintfCString.h"
@ -218,11 +217,6 @@ std::shared_ptr<EglDisplay> GLLibraryEGL::CreateDisplay(
} }
static bool IsAccelAngleSupported(nsACString* const out_failureId) { static bool IsAccelAngleSupported(nsACString* const out_failureId) {
if (wr::RenderThread::IsInRenderThread()) {
// We can only enter here with WebRender, so assert that this is a
// WebRender-enabled build.
return true;
}
if (!gfx::gfxVars::AllowWebglAccelAngle()) { if (!gfx::gfxVars::AllowWebglAccelAngle()) {
if (out_failureId->IsEmpty()) { if (out_failureId->IsEmpty()) {
*out_failureId = "FEATURE_FAILURE_ACCL_ANGLE_NOT_OK"_ns; *out_failureId = "FEATURE_FAILURE_ACCL_ANGLE_NOT_OK"_ns;
@ -273,8 +267,6 @@ AngleErrorReporting gAngleErrorReporter;
static std::shared_ptr<EglDisplay> GetAndInitDisplayForAccelANGLE( static std::shared_ptr<EglDisplay> GetAndInitDisplayForAccelANGLE(
GLLibraryEGL& egl, nsACString* const out_failureId) { GLLibraryEGL& egl, nsACString* const out_failureId) {
MOZ_RELEASE_ASSERT(!wr::RenderThread::IsInRenderThread());
gfx::FeatureState& d3d11ANGLE = gfx::FeatureState& d3d11ANGLE =
gfx::gfxConfig::GetFeature(gfx::Feature::D3D11_HW_ANGLE); gfx::gfxConfig::GetFeature(gfx::Feature::D3D11_HW_ANGLE);