Backed out changeset 8b59e729f75e (bug 1287182) for webgl failures

--HG--
extra : histedit_source : 4f82442bd4a877623eaa3744c3ecdec42ec93449%2Cece28bdaa8427acb4fb00a5e2f7b1a45a21d3989
This commit is contained in:
Wes Kocher 2016-07-19 11:58:26 -07:00
Родитель 3855cd246d
Коммит 08c17907d7
3 изменённых файлов: 5 добавлений и 81 удалений

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

@ -163,8 +163,7 @@ DEFINES['ANGLE_ENABLE_GLSL'] = "1"
DEFINES['ANGLE_ENABLE_ESSL'] = "1"
DEFINES['ANGLE_ENABLE_KEYEDMUTEX'] = "1"
EXPORTS.angle += [ 'include/GLSLANG/ShaderLang.h', 'include/GLSLANG/ShaderVars.h', 'include/platform/Platform.h' ]
EXPORTS.angle += [ 'include/GLSLANG/ShaderLang.h', 'include/GLSLANG/ShaderVars.h' ]
EXPORTS.angle.KHR += [ 'include/KHR/khrplatform.h' ]
LOCAL_INCLUDES += [ 'include', 'src', 'src/common/third_party/numerics' ]

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

@ -4,15 +4,12 @@
#include "GLLibraryEGL.h"
#include "angle/Platform.h"
#include "gfxConfig.h"
#include "gfxCrashReporterUtils.h"
#include "gfxUtils.h"
#include "mozilla/Preferences.h"
#include "mozilla/Assertions.h"
#include "mozilla/Telemetry.h"
#include "mozilla/Tokenizer.h"
#include "mozilla/ScopeExit.h"
#include "mozilla/unused.h"
#include "nsDirectoryServiceDefs.h"
#include "nsDirectoryServiceUtils.h"
@ -175,43 +172,8 @@ GetAndInitDisplay(GLLibraryEGL& egl, void* displayType)
return display;
}
class AngleErrorReporting: public angle::Platform {
public:
explicit AngleErrorReporting(nsACString *aFailureId)
: mFailureId(aFailureId)
{}
void logError(const char *errorMessage) override
{
nsCString str(errorMessage);
Tokenizer tokenizer(str);
// Parse "ANGLE Display::initialize error " << error.getID() << ": "
// << error.getMessage()
nsCString currWord;
Tokenizer::Token intToken;
if (tokenizer.CheckWord("ANGLE") &&
tokenizer.CheckWhite() &&
tokenizer.CheckWord("Display") &&
tokenizer.CheckChar(':') &&
tokenizer.CheckChar(':') &&
tokenizer.CheckWord("initialize") &&
tokenizer.CheckWhite() &&
tokenizer.CheckWord("error") &&
tokenizer.CheckWhite() &&
tokenizer.Check(Tokenizer::TOKEN_INTEGER, intToken)) {
*mFailureId = "FAILURE_ID_ANGLE_ID_";
mFailureId->AppendPrintf("%i", intToken.AsInteger());
} else {
*mFailureId = "FAILURE_ID_ANGLE_UNKNOWN";
}
}
private:
nsACString* mFailureId;
};
static EGLDisplay
GetAndInitDisplayForAccelANGLE(GLLibraryEGL& egl, nsACString* const out_failureId)
GetAndInitDisplayForAccelANGLE(GLLibraryEGL& egl)
{
EGLDisplay ret = 0;
@ -224,16 +186,8 @@ GetAndInitDisplayForAccelANGLE(GLLibraryEGL& egl, nsACString* const out_failureI
if (gfxPrefs::WebGLANGLEForceD3D11())
d3d11ANGLE.UserForceEnable("User force-enabled D3D11 ANGLE on disabled hardware");
AngleErrorReporting errorReporter(out_failureId);
egl.fANGLEPlatformInitialize(&errorReporter);
auto guardShutdown = mozilla::MakeScopeExit([&] {
egl.fANGLEPlatformShutdown();
});
if (gfxConfig::IsForcedOnByUser(Feature::D3D11_HW_ANGLE)) {
if (gfxConfig::IsForcedOnByUser(Feature::D3D11_HW_ANGLE))
return GetAndInitDisplay(egl, LOCAL_EGL_D3D11_ONLY_DISPLAY_ANGLE);
}
if (d3d11ANGLE.IsEnabled()) {
ret = GetAndInitDisplay(egl, LOCAL_EGL_D3D11_ELSE_D3D9_DISPLAY_ANGLE);
@ -418,9 +372,7 @@ GLLibraryEGL::EnsureInitialized(bool forceAccel, nsACString* const out_failureId
// Client exts are ready. (But not display exts!)
if (IsExtensionSupported(ANGLE_platform_angle_d3d)) {
GLLibraryLoader::SymLoadStruct d3dSymbols[] = {
{ (PRFuncPtr*)&mSymbols.fANGLEPlatformInitialize, { "ANGLEPlatformInitialize", nullptr } },
{ (PRFuncPtr*)&mSymbols.fANGLEPlatformShutdown, { "ANGLEPlatformShutdown", nullptr } },
{ (PRFuncPtr*)&mSymbols.fGetPlatformDisplayEXT, { "eglGetPlatformDisplayEXT", nullptr } },
{ (PRFuncPtr*)&mSymbols.fGetPlatformDisplayEXT, { "eglGetPlatformDisplayEXT", nullptr } },
{ nullptr, { nullptr } }
};
@ -472,7 +424,7 @@ GLLibraryEGL::EnsureInitialized(bool forceAccel, nsACString* const out_failureId
}
// Hardware accelerated ANGLE path
chosenDisplay = GetAndInitDisplayForAccelANGLE(*this, out_failureId);
chosenDisplay = GetAndInitDisplayForAccelANGLE(*this);
}
} else {
chosenDisplay = GetAndInitDisplay(*this, EGL_DEFAULT_DISPLAY);

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

@ -52,10 +52,6 @@
#define EGL_DEFAULT_DISPLAY ((EGLNativeDisplayType)0)
#endif
namespace angle {
class Platform;
}
namespace mozilla {
namespace gfx {
@ -120,8 +116,6 @@ public:
}
void ClearSymbols() {
mSymbols.fANGLEPlatformInitialize = nullptr;
mSymbols.fANGLEPlatformShutdown = nullptr;
mSymbols.fGetDisplay = nullptr;
mSymbols.fGetPlatformDisplayEXT = nullptr;
mSymbols.fTerminate = nullptr;
@ -504,22 +498,6 @@ public:
return ret;
}
void fANGLEPlatformInitialize(angle::Platform* platform)
{
MOZ_ASSERT(mSymbols.fANGLEPlatformInitialize);
BEFORE_GL_CALL;
mSymbols.fANGLEPlatformInitialize(platform);
AFTER_GL_CALL;
}
void fANGLEPlatformShutdown()
{
MOZ_ASSERT(mSymbols.fANGLEPlatformShutdown);
BEFORE_GL_CALL;
mSymbols.fANGLEPlatformShutdown();
AFTER_GL_CALL;
}
EGLDisplay Display() {
MOZ_ASSERT(mInitialized);
return mEGLDisplay;
@ -644,11 +622,6 @@ public:
pfnGetSyncAttrib fGetSyncAttrib;
typedef EGLint (GLAPIENTRY * pfnDupNativeFenceFDANDROID)(EGLDisplay dpy, EGLSync sync);
pfnDupNativeFenceFDANDROID fDupNativeFenceFDANDROID;
typedef void (GLAPIENTRY * pfnANGLEPlatformInitialize)(angle::Platform* platform);
pfnANGLEPlatformInitialize fANGLEPlatformInitialize;
typedef void (GLAPIENTRY * pfnANGLEPlatformShutdown)();
pfnANGLEPlatformShutdown fANGLEPlatformShutdown;
} mSymbols;
#ifdef DEBUG