Bug 1390386 - Remove old TLS current-context check. - r=daoshengmu

MozReview-Commit-ID: 18GSNztjkTM
This commit is contained in:
Jeff Gilbert 2017-08-11 13:41:31 -07:00
Родитель 365866b9f5
Коммит 5f658ac9ef
3 изменённых файлов: 0 добавлений и 45 удалений

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

@ -60,10 +60,6 @@ namespace gl {
using namespace mozilla::gfx;
using namespace mozilla::layers;
#ifdef MOZ_GL_DEBUG
unsigned GLContext::sCurrentGLContextTLS = -1;
#endif
MOZ_THREAD_LOCAL(const GLContext*) GLContext::sCurrentContext;
// If adding defines, don't forget to undefine symbols. See #undef block below.
@ -3036,20 +3032,6 @@ GLContext::MakeCurrent(bool aForce) const
if (MOZ_UNLIKELY( IsDestroyed() ))
return false;
#ifdef MOZ_GL_DEBUG
PR_SetThreadPrivate(sCurrentGLContextTLS, (void*)this);
// XXX this assertion is disabled because it's triggering on Mac;
// we need to figure out why and reenable it.
#if 0
// IsOwningThreadCurrent is a bit of a misnomer;
// the "owning thread" is the creation thread,
// and the only thread that can own this. We don't
// support contexts used on multiple threads.
NS_ASSERTION(IsOwningThreadCurrent(),
"MakeCurrent() called on different thread than this context was created on!");
#endif
#endif
if (mUseTLSIsCurrent && !aForce && sCurrentContext.get() == this) {
MOZ_ASSERT(IsCurrent());
return true;
@ -3088,14 +3070,6 @@ GLContext::BeforeGLCall_Debug(const char* const funcName) const
if (mDebugFlags & DebugFlagTrace) {
printf_stderr("[gl:%p] > %s\n", this, funcName);
}
GLContext* tlsContext = (GLContext*)PR_GetThreadPrivate(sCurrentGLContextTLS);
if (this != tlsContext) {
printf_stderr("Fatal: %s called on non-current context %p. The"
" current context for this thread is %p.\n",
funcName, this, tlsContext);
MOZ_CRASH("GFX: GLContext is not current.");
}
}
void

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

@ -3297,12 +3297,6 @@ protected:
virtual bool MakeCurrentImpl(bool aForce) const = 0;
public:
#ifdef MOZ_GL_DEBUG
static void StaticInit() {
PR_NewThreadPrivateIndex(&sCurrentGLContextTLS, nullptr);
}
#endif
bool MakeCurrent(bool aForce = false) const;
virtual bool Init() = 0;
@ -3446,15 +3440,6 @@ protected:
GLContextSymbols mSymbols;
#ifdef MOZ_GL_DEBUG
// Non-zero debug flags will check that we don't send call
// to a GLContext that isn't current on the current
// thread.
// Store the current context when binding to thread local
// storage to support debug flags on an arbitrary thread.
static unsigned sCurrentGLContextTLS;
#endif
UniquePtr<GLBlitHelper> mBlitHelper;
UniquePtr<GLReadTexImageHelper> mReadTexImageHelper;

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

@ -748,10 +748,6 @@ gfxPlatform::Init()
# endif
#endif
#ifdef MOZ_GL_DEBUG
GLContext::StaticInit();
#endif
InitLayersIPC();
gPlatform->PopulateScreenInfo();