Backed out changeset 9b01df568861 (bug 8430335) for assertions & incorrect bug number; CLOSED TREE

This commit is contained in:
Ed Morley 2014-05-30 17:15:40 +01:00
parent c3154d2a5f
commit 50452d4d69
3 changed files with 3 additions and 49 deletions

View File

@ -268,7 +268,6 @@ GLContextEGL::~GLContextEGL()
#endif
sEGLLibrary.fDestroyContext(EGL_DISPLAY(), mContext);
sEGLLibrary.UnsetCachedCurrentContext();
#if defined(MOZ_WIDGET_GONK) && ANDROID_VERSION < 17
if (!mIsOffscreen) {
@ -382,18 +381,7 @@ GLContextEGL::MakeCurrentImpl(bool aForce) {
// Assume that EGL has the same problem as WGL does,
// where MakeCurrent with an already-current context is
// still expensive.
bool hasDifferentContext = false;
if (sEGLLibrary.CachedCurrentContext() != mContext) {
// even if the cached context doesn't match the current one
// might still
if (sEGLLibrary.fGetCurrentContext() != mContext) {
hasDifferentContext = true;
} else {
sEGLLibrary.SetCachedCurrentContext(mContext);
}
}
if (aForce || hasDifferentContext) {
if (aForce || sEGLLibrary.fGetCurrentContext() != mContext) {
EGLSurface surface = mSurfaceOverride != EGL_NO_SURFACE
? mSurfaceOverride
: mSurface;
@ -414,11 +402,7 @@ GLContextEGL::MakeCurrentImpl(bool aForce) {
printf_stderr("EGL Error: 0x%04x\n", eglError);
#endif
}
} else {
sEGLLibrary.SetCachedCurrentContext(mContext);
}
} else {
MOZ_ASSERT(sEGLLibrary.CachedCurrentContext() == sEGLLibrary.fGetCurrentContext());
}
return succeeded;

View File

@ -6,7 +6,6 @@
#include "gfxCrashReporterUtils.h"
#include "mozilla/Preferences.h"
#include "nsDebug.h"
#include "nsDirectoryServiceDefs.h"
#include "nsDirectoryServiceUtils.h"
#include "nsPrintfCString.h"
@ -21,9 +20,7 @@ namespace mozilla {
namespace gl {
GLLibraryEGL sEGLLibrary;
#ifdef MOZ_B2G
ThreadLocal<EGLContext> GLLibraryEGL::sCurrentContext;
#endif
// should match the order of EGLExtensions, and be null-terminated.
static const char *sEGLExtensionNames[] = {
"EGL_KHR_image_base",
@ -107,10 +104,6 @@ GLLibraryEGL::EnsureInitialized()
mozilla::ScopedGfxFeatureReporter reporter("EGL");
#ifdef MOZ_B2G
NS_ABORT_IF_FALSE(sCurrentContext.init());
#endif
#ifdef XP_WIN
#ifdef MOZ_WEBGL
if (!mEGLLibrary) {

View File

@ -10,7 +10,7 @@
#endif
#include "GLLibraryLoader.h"
#include "mozilla/ThreadLocal.h"
#include "nsIFile.h"
#include <bitset>
@ -529,29 +529,6 @@ public:
static void AfterGLCall(const char* glFunction);
#endif
#ifdef MOZ_B2G
EGLContext CachedCurrentContext() {
return sCurrentContext.get();
}
void UnsetCachedCurrentContext() {
sCurrentContext.set(nullptr);
}
void SetCachedCurrentContext(EGLContext aCtx) {
sCurrentContext.set(aCtx);
}
private:
static ThreadLocal<EGLContext> sCurrentContext;
public:
#else
EGLContext CachedCurrentContext() {
return nullptr;
}
void UnsetCachedCurrentContext() {}
void SetCachedCurrentContext(EGLContext aCtx) { }
#endif
private:
bool mInitialized;
PRLibrary* mEGLLibrary;