Index: firefox-146.0.1/gfx/webrender_bindings/RenderCompositorSWGL.cpp
===================================================================
--- firefox-146.0.1.orig/gfx/webrender_bindings/RenderCompositorSWGL.cpp
+++ firefox-146.0.1/gfx/webrender_bindings/RenderCompositorSWGL.cpp
@@ -7,6 +7,7 @@
 #include "RenderCompositorSWGL.h"
 
 #include "mozilla/gfx/Logging.h"
+#include "mozilla/gfx/Swizzle.h"
 #include "mozilla/widget/CompositorWidget.h"
 
 #ifdef MOZ_WIDGET_GTK
@@ -242,6 +243,17 @@ void RenderCompositorSWGL::CommitMappedB
   }
   mDT->Flush();
 
+#if MOZ_BIG_ENDIAN()
+  // One swizzle to rule them all.
+  // With exception to certain text boxes with 1 line (46 pixels) and 2 lines
+  // (64 pixels) in Firefox 115. Per following bug:
+  // https://bugzilla.mozilla.org/show_bug.cgi?id=1900574
+  if ((int)mDT->GetSize().height != 46 && mDT->GetSize().height != 64)
+    gfx::SwizzleData(mMappedData, mMappedStride, gfx::SurfaceFormat::B8G8R8A8,
+                     mMappedData, mMappedStride, gfx::SurfaceFormat::A8R8G8B8,
+                     mDT->GetSize());
+#endif
+
   // Done with the DT. Hand it back to the widget and clear out any trace of it.
   mWidget->EndRemoteDrawingInRegion(mDT, mDirtyRegion);
   mDirtyRegion.SetEmpty();
Index: firefox-146.0.1/image/imgFrame.cpp
===================================================================
--- firefox-146.0.1.orig/image/imgFrame.cpp
+++ firefox-146.0.1/image/imgFrame.cpp
@@ -380,6 +380,17 @@ nsresult imgFrame::InitWithDrawable(gfxD
     return NS_ERROR_OUT_OF_MEMORY;
   }
 
+#if MOZ_BIG_ENDIAN()
+  if (aBackend == gfx::BackendType::SKIA && canUseDataSurface) {
+      // SKIA is lying about what format it returns on big endian
+      for (int ii=0; ii < mRawSurface->GetSize().Height()*mRawSurface->Stride() / 4; ++ii) {
+        uint32_t *vals = (uint32_t*)(mRawSurface->GetData());
+        uint32_t val = ((vals[ii] << 8) & 0xFF00FF00 ) | ((vals[ii] >> 8) & 0xFF00FF );
+        vals[ii] = (val << 16) | (val >> 16);
+      }
+  }
+#endif
+
   if (!canUseDataSurface) {
     // We used an offscreen surface, which is an "optimized" surface from
     // imgFrame's perspective.
