mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1184402 - Reset format usage authority on context lose/restore. r=jgilbert
This commit is contained in:
parent
e3d5bca93c
commit
1a99cebbe6
@ -20,13 +20,18 @@ WebGL1Context::Create()
|
||||
WebGL1Context::WebGL1Context()
|
||||
: WebGLContext()
|
||||
{
|
||||
mFormatUsage = Move(webgl::FormatUsageAuthority::CreateForWebGL1());
|
||||
}
|
||||
|
||||
WebGL1Context::~WebGL1Context()
|
||||
{
|
||||
}
|
||||
|
||||
UniquePtr<webgl::FormatUsageAuthority>
|
||||
WebGL1Context::CreateFormatUsage() const
|
||||
{
|
||||
return webgl::FormatUsageAuthority::CreateForWebGL1();
|
||||
}
|
||||
|
||||
JSObject*
|
||||
WebGL1Context::WrapObject(JSContext* cx, JS::Handle<JSObject*> givenProto)
|
||||
{
|
||||
|
@ -18,6 +18,7 @@ public:
|
||||
|
||||
private:
|
||||
WebGL1Context();
|
||||
virtual UniquePtr<webgl::FormatUsageAuthority> CreateFormatUsage() const override;
|
||||
|
||||
public:
|
||||
virtual ~WebGL1Context();
|
||||
|
@ -21,8 +21,6 @@ WebGL2Context::WebGL2Context()
|
||||
{
|
||||
MOZ_ASSERT(IsSupported(), "not supposed to create a WebGL2Context"
|
||||
"context when not supported");
|
||||
|
||||
mFormatUsage = Move(webgl::FormatUsageAuthority::CreateForWebGL2());
|
||||
}
|
||||
|
||||
WebGL2Context::~WebGL2Context()
|
||||
@ -30,6 +28,12 @@ WebGL2Context::~WebGL2Context()
|
||||
|
||||
}
|
||||
|
||||
UniquePtr<webgl::FormatUsageAuthority>
|
||||
WebGL2Context::CreateFormatUsage() const
|
||||
{
|
||||
return webgl::FormatUsageAuthority::CreateForWebGL2();
|
||||
}
|
||||
|
||||
/*static*/ bool
|
||||
WebGL2Context::IsSupported()
|
||||
{
|
||||
|
@ -356,6 +356,7 @@ public:
|
||||
|
||||
private:
|
||||
WebGL2Context();
|
||||
virtual UniquePtr<webgl::FormatUsageAuthority> CreateFormatUsage() const override;
|
||||
|
||||
virtual bool IsTexParamValid(GLenum pname) const override;
|
||||
|
||||
|
@ -1487,7 +1487,9 @@ public:
|
||||
void GenerateWarning(const char* fmt, ...);
|
||||
void GenerateWarning(const char* fmt, va_list ap);
|
||||
|
||||
public:
|
||||
UniquePtr<webgl::FormatUsageAuthority> mFormatUsage;
|
||||
virtual UniquePtr<webgl::FormatUsageAuthority> CreateFormatUsage() const = 0;
|
||||
|
||||
// Friend list
|
||||
friend class WebGLTexture;
|
||||
|
@ -1653,6 +1653,11 @@ WebGLContext::InitAndValidateGL()
|
||||
if (!gl)
|
||||
return false;
|
||||
|
||||
// Unconditionally create a new format usage authority. This is
|
||||
// important when restoring contexts and extensions need to add
|
||||
// formats back into the authority.
|
||||
mFormatUsage = CreateFormatUsage();
|
||||
|
||||
GLenum error = gl->fGetError();
|
||||
if (error != LOCAL_GL_NO_ERROR) {
|
||||
GenerateWarning("GL error 0x%x occurred during OpenGL context"
|
||||
|
Loading…
Reference in New Issue
Block a user