Backed out changeset fd92f897de07 (bug 1726863) for causing assertion failures on ContentCompositorBridgeParent.cpp. CLOSED TREE

This commit is contained in:
Csoregi Natalia 2021-08-24 01:34:22 +03:00
Родитель dcab5ce154
Коммит 8d7a78b944
3 изменённых файлов: 3 добавлений и 81 удалений

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

@ -635,7 +635,6 @@ void WebGLContext::FinishInit() {
// Initial setup.
gl->mImplicitMakeCurrent = true;
gl->mElideDuplicateBindFramebuffers = true;
const auto& size = mDefaultFB->mSize;

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

@ -2158,18 +2158,7 @@ void GLContext::fCopyTexImage2D(GLenum target, GLint level,
AfterGLReadCall();
}
void GLContext::fGetIntegerv(const GLenum pname, GLint* const params) const {
const auto AssertBinding = [&](const char* const name, const GLenum binding,
const GLuint expected) {
if (MOZ_LIKELY(!mDebugFlags)) return;
GLuint actual = 0;
raw_fGetIntegerv(binding, (GLint*)&actual);
if (actual != expected) {
gfxCriticalError() << "Misprediction: " << name << " expected "
<< expected << ", was " << actual;
}
};
void GLContext::fGetIntegerv(GLenum pname, GLint* params) const {
switch (pname) {
case LOCAL_GL_MAX_TEXTURE_SIZE:
MOZ_ASSERT(mMaxTextureSize > 0);
@ -2198,22 +2187,6 @@ void GLContext::fGetIntegerv(const GLenum pname, GLint* const params) const {
}
break;
case LOCAL_GL_DRAW_FRAMEBUFFER_BINDING:
static_assert(LOCAL_GL_DRAW_FRAMEBUFFER_BINDING ==
LOCAL_GL_FRAMEBUFFER_BINDING);
AssertBinding("GL_DRAW_FRAMEBUFFER_BINDING",
LOCAL_GL_DRAW_FRAMEBUFFER_BINDING, mCachedDrawFb);
*params = mCachedDrawFb;
break;
case LOCAL_GL_READ_FRAMEBUFFER_BINDING:
if (IsSupported(GLFeature::framebuffer_blit)) {
AssertBinding("GL_READ_FRAMEBUFFER_BINDING",
LOCAL_GL_READ_FRAMEBUFFER_BINDING, mCachedReadFb);
}
*params = mCachedReadFb;
break;
default:
raw_fGetIntegerv(pname, params);
break;

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

@ -27,7 +27,6 @@
# define MOZ_GL_DEBUG 1
#endif
#include "mozilla/IntegerRange.h"
#include "mozilla/RefPtr.h"
#include "mozilla/UniquePtr.h"
#include "mozilla/ThreadLocal.h"
@ -2020,49 +2019,10 @@ class GLContext : public GenericAtomicRefCounted, public SupportsWeakPtr {
AFTER_GL_CALL;
}
private:
mutable GLuint mCachedDrawFb = 0;
mutable GLuint mCachedReadFb = 0;
public:
bool mElideDuplicateBindFramebuffers = false;
void fBindFramebuffer(const GLenum target, const GLuint fb) const {
if (mElideDuplicateBindFramebuffers) {
MOZ_ASSERT(mCachedDrawFb ==
GetIntAs<GLuint>(LOCAL_GL_DRAW_FRAMEBUFFER_BINDING));
MOZ_ASSERT(mCachedReadFb ==
GetIntAs<GLuint>(LOCAL_GL_READ_FRAMEBUFFER_BINDING));
switch (target) {
case LOCAL_GL_FRAMEBUFFER:
if (mCachedDrawFb == fb && mCachedReadFb == fb) return;
break;
case LOCAL_GL_DRAW_FRAMEBUFFER:
if (mCachedDrawFb == fb) return;
break;
case LOCAL_GL_READ_FRAMEBUFFER:
if (mCachedReadFb == fb) return;
break;
}
}
void fBindFramebuffer(GLenum target, GLuint framebuffer) {
BEFORE_GL_CALL;
mSymbols.fBindFramebuffer(target, fb);
mSymbols.fBindFramebuffer(target, framebuffer);
AFTER_GL_CALL;
switch (target) {
case LOCAL_GL_FRAMEBUFFER:
mCachedDrawFb = fb;
mCachedReadFb = fb;
break;
case LOCAL_GL_DRAW_FRAMEBUFFER:
mCachedDrawFb = fb;
break;
case LOCAL_GL_READ_FRAMEBUFFER:
mCachedReadFb = fb;
break;
}
}
void fBindRenderbuffer(GLenum target, GLuint renderbuffer) {
@ -2326,16 +2286,6 @@ class GLContext : public GenericAtomicRefCounted, public SupportsWeakPtr {
BEFORE_GL_CALL;
mSymbols.fDeleteFramebuffers(n, names);
AFTER_GL_CALL;
for (const auto i : IntegerRange(n)) {
const auto fb = names[i];
if (mCachedDrawFb == fb) {
mCachedDrawFb = 0;
}
if (mCachedReadFb == fb) {
mCachedReadFb = 0;
}
}
}
void raw_fDeleteRenderbuffers(GLsizei n, const GLuint* names) {