diff options
author | trav90 <travawine@palemoon.org> | 2022-05-28 11:45:52 -0500 |
---|---|---|
committer | trav90 <travawine@palemoon.org> | 2022-05-28 11:45:52 -0500 |
commit | 9f0c3479c0ffaf383823f5c9b37dbaa116cd0501 (patch) | |
tree | 4a3551da62896ebb913a41ccb88eed09f0aef74f /gfx | |
parent | 33a3173c79b1978a15ba09c70bcf744f84191626 (diff) | |
download | uxp-9f0c3479c0ffaf383823f5c9b37dbaa116cd0501.tar.gz |
Issue #457 - Make GLContextSymbols a pure aggregate POD
Diffstat (limited to 'gfx')
-rw-r--r-- | gfx/gl/GLContext.cpp | 5 | ||||
-rw-r--r-- | gfx/gl/GLContextSymbols.h | 10 |
2 files changed, 5 insertions, 10 deletions
diff --git a/gfx/gl/GLContext.cpp b/gfx/gl/GLContext.cpp index 72a7bea58b..d07b925ad5 100644 --- a/gfx/gl/GLContext.cpp +++ b/gfx/gl/GLContext.cpp @@ -454,6 +454,7 @@ GLContext::GLContext(CreateContextFlags flags, const SurfaceCaps& caps, mTopError(LOCAL_GL_NO_ERROR), mDebugFlags(ChooseDebugFlags(flags)), mSharedContext(sharedContext), + mSymbols{}, mCaps(caps), mScreen(nullptr), mLockedSurface(nullptr), @@ -519,7 +520,7 @@ GLContext::InitWithPrefix(const char* prefix, bool trygl) if (!InitWithPrefixImpl(prefix, trygl)) { // If initialization fails, zero the symbols to avoid hard-to-understand bugs. - mSymbols.Zero(); + mSymbols = {}; NS_WARNING("GLContext::InitWithPrefix failed!"); return false; } @@ -2205,7 +2206,7 @@ GLContext::MarkDestroyed() mReadTexImageHelper = nullptr; mIsDestroyed = true; - mSymbols.Zero(); + mSymbols = {}; if (MakeCurrent(true)) { mTexGarbageBin->GLContextTeardown(); } diff --git a/gfx/gl/GLContextSymbols.h b/gfx/gl/GLContextSymbols.h index 61069e3f73..798e6cef5d 100644 --- a/gfx/gl/GLContextSymbols.h +++ b/gfx/gl/GLContextSymbols.h @@ -25,15 +25,9 @@ namespace mozilla { namespace gl { -struct GLContextSymbols +struct GLContextSymbols final { - GLContextSymbols() { - Zero(); - } - - void Zero() { - memset(this, 0, sizeof(GLContextSymbols)); - } + GLContextSymbols() = delete; // Initialize with {}. typedef void (GLAPIENTRY * PFNGLACTIVETEXTUREPROC) (GLenum texture); PFNGLACTIVETEXTUREPROC fActiveTexture; |