mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-28 01:57:30 +09:00
Issue #457 - Make GLContextSymbols a pure aggregate POD
This commit is contained in:
parent
c782076add
commit
f2cfb9997e
2 changed files with 5 additions and 10 deletions
|
|
@ -454,6 +454,7 @@ GLContext::GLContext(CreateContextFlags flags, const SurfaceCaps& caps,
|
||||||
mTopError(LOCAL_GL_NO_ERROR),
|
mTopError(LOCAL_GL_NO_ERROR),
|
||||||
mDebugFlags(ChooseDebugFlags(flags)),
|
mDebugFlags(ChooseDebugFlags(flags)),
|
||||||
mSharedContext(sharedContext),
|
mSharedContext(sharedContext),
|
||||||
|
mSymbols{},
|
||||||
mCaps(caps),
|
mCaps(caps),
|
||||||
mScreen(nullptr),
|
mScreen(nullptr),
|
||||||
mLockedSurface(nullptr),
|
mLockedSurface(nullptr),
|
||||||
|
|
@ -519,7 +520,7 @@ GLContext::InitWithPrefix(const char* prefix, bool trygl)
|
||||||
|
|
||||||
if (!InitWithPrefixImpl(prefix, trygl)) {
|
if (!InitWithPrefixImpl(prefix, trygl)) {
|
||||||
// If initialization fails, zero the symbols to avoid hard-to-understand bugs.
|
// If initialization fails, zero the symbols to avoid hard-to-understand bugs.
|
||||||
mSymbols.Zero();
|
mSymbols = {};
|
||||||
NS_WARNING("GLContext::InitWithPrefix failed!");
|
NS_WARNING("GLContext::InitWithPrefix failed!");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
@ -2205,7 +2206,7 @@ GLContext::MarkDestroyed()
|
||||||
mReadTexImageHelper = nullptr;
|
mReadTexImageHelper = nullptr;
|
||||||
|
|
||||||
mIsDestroyed = true;
|
mIsDestroyed = true;
|
||||||
mSymbols.Zero();
|
mSymbols = {};
|
||||||
if (MakeCurrent(true)) {
|
if (MakeCurrent(true)) {
|
||||||
mTexGarbageBin->GLContextTeardown();
|
mTexGarbageBin->GLContextTeardown();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -25,15 +25,9 @@
|
||||||
namespace mozilla {
|
namespace mozilla {
|
||||||
namespace gl {
|
namespace gl {
|
||||||
|
|
||||||
struct GLContextSymbols
|
struct GLContextSymbols final
|
||||||
{
|
{
|
||||||
GLContextSymbols() {
|
GLContextSymbols() = delete; // Initialize with {}.
|
||||||
Zero();
|
|
||||||
}
|
|
||||||
|
|
||||||
void Zero() {
|
|
||||||
memset(this, 0, sizeof(GLContextSymbols));
|
|
||||||
}
|
|
||||||
|
|
||||||
typedef void (GLAPIENTRY * PFNGLACTIVETEXTUREPROC) (GLenum texture);
|
typedef void (GLAPIENTRY * PFNGLACTIVETEXTUREPROC) (GLenum texture);
|
||||||
PFNGLACTIVETEXTUREPROC fActiveTexture;
|
PFNGLACTIVETEXTUREPROC fActiveTexture;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue