commit d5f94f698b17e95895496e53e9f2d4310724abcb
parent b651a44293e7522ecfcd18d15141b8e9ed4beb4c
Author: Chris Peterson <cpeterson@mozilla.com>
Date: Tue, 9 Dec 2025 00:01:29 +0000
Bug 2002864 - Replace MOZ_CONSTINIT with C++20 constinit in gfx code. r=gfx-reviewers,lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D274503
Diffstat:
8 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/dom/canvas/WebGLTexture.cpp b/dom/canvas/WebGLTexture.cpp
@@ -24,7 +24,7 @@
namespace mozilla {
namespace webgl {
-MOZ_CONSTINIT /*static*/ const ImageInfo ImageInfo::kUndefined;
+constinit /*static*/ const ImageInfo ImageInfo::kUndefined;
size_t ImageInfo::MemoryUsage() const {
if (!IsDefined()) return 0;
diff --git a/gfx/gl/GLContextProviderCGL.mm b/gfx/gl/GLContextProviderCGL.mm
@@ -342,7 +342,7 @@ already_AddRefed<GLContext> GLContextProviderCGL::CreateHeadless(
return gl.forget();
}
-MOZ_CONSTINIT static RefPtr<GLContext> gGlobalContext;
+constinit static RefPtr<GLContext> gGlobalContext;
GLContext* GLContextProviderCGL::GetGlobalContext() {
static bool triedToCreateContext = false;
diff --git a/gfx/gl/GLContextProviderEAGL.mm b/gfx/gl/GLContextProviderEAGL.mm
@@ -142,7 +142,7 @@ already_AddRefed<GLContext> GLContextProviderEAGL::CreateHeadless(
return CreateEAGLContext(desc, GetGlobalContextEAGL()).forget();
}
-MOZ_CONSTINIT static RefPtr<GLContext> gGlobalContext;
+constinit static RefPtr<GLContext> gGlobalContext;
GLContext* GLContextProviderEAGL::GetGlobalContext() {
static bool triedToCreateContext = false;
diff --git a/gfx/layers/GLImages.cpp b/gfx/layers/GLImages.cpp
@@ -20,7 +20,7 @@ using namespace mozilla::gl;
namespace mozilla::layers {
-MOZ_CONSTINIT static RefPtr<GLContext> sSnapshotContext;
+constinit static RefPtr<GLContext> sSnapshotContext;
nsresult GLImage::ReadIntoBuffer(uint8_t* aData, int32_t aStride,
const gfx::IntSize& aSize,
diff --git a/gfx/layers/d3d11/FenceD3D11.cpp b/gfx/layers/d3d11/FenceD3D11.cpp
@@ -16,7 +16,7 @@
namespace mozilla {
namespace layers {
-MOZ_CONSTINIT RefPtr<ID3D11Device> mDevice;
+constinit RefPtr<ID3D11Device> mDevice;
/* static */
RefPtr<FenceD3D11> FenceD3D11::Create(ID3D11Device* aDevice) {
diff --git a/gfx/thebes/gfxAndroidPlatform.cpp b/gfx/thebes/gfxAndroidPlatform.cpp
@@ -77,7 +77,7 @@ NS_IMPL_ISUPPORTS(FreetypeReporter, nsIMemoryReporter)
static FT_MemoryRec_ sFreetypeMemoryRecord;
PRThread* gfxAndroidPlatform::sFontAPIInitializeThread = nullptr;
-MOZ_CONSTINIT nsCString gfxAndroidPlatform::sManufacturer;
+constinit nsCString gfxAndroidPlatform::sManufacturer;
// static
bool gfxAndroidPlatform::IsFontAPIDisabled(bool aDontCheckPref) {
diff --git a/gfx/thebes/gfxFontMissingGlyphs.cpp b/gfx/thebes/gfxFontMissingGlyphs.cpp
@@ -200,7 +200,7 @@ static void DestroyImageKey(void* aClosure) {
delete key;
}
-MOZ_CONSTINIT static RefPtr<SourceSurface> gWRGlyphAtlas[8];
+constinit static RefPtr<SourceSurface> gWRGlyphAtlas[8];
MOZ_RUNINIT static LinkedList<WRUserData> gWRUsers;
UserDataKey WRUserData::sWRUserDataKey;
diff --git a/widget/GfxDriverInfo.cpp b/widget/GfxDriverInfo.cpp
@@ -11,7 +11,7 @@
using namespace mozilla::widget;
-MOZ_CONSTINIT RefPtr<GfxDeviceFamily>
+constinit RefPtr<GfxDeviceFamily>
GfxDriverInfo::sDeviceFamilies[static_cast<size_t>(DeviceFamily::Max)];
nsString*
GfxDriverInfo::sWindowProtocol[static_cast<size_t>(WindowProtocol::Max)];