403Webshell
Server IP : 82.208.35.60  /  Your IP : 216.73.216.89
Web Server : Apache/2.4.55 (FreeBSD) OpenSSL/1.1.1q-freebsd PHP/7.3.31
System : FreeBSD server7.d2m.cz 12.4-RELEASE-p9 FreeBSD 12.4-RELEASE-p9 GENERIC amd64
User : studiokobylisy_cz ( 1008)
PHP Version : 7.3.31
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /usr/ports/www/firefox-esr/files/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/ports/www/firefox-esr/files/patch-bug1716707
commit ce7a2f400d4f599c72e32e2635fee7ea94c0848c
Author: Christoph Moench-Tegeder <cmt@burggraben.net>
Date:   Wed Apr 13 14:44:46 2022 +0200

    big-endian color fixes, but without breaking little-endian
    
    as le is what most people actually use

diff --git gfx/webrender_bindings/RenderCompositorSWGL.cpp gfx/webrender_bindings/RenderCompositorSWGL.cpp
index dbf137c849ee..243a01ff9cf3 100644
--- gfx/webrender_bindings/RenderCompositorSWGL.cpp
+++ 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
@@ -235,6 +236,13 @@ void RenderCompositorSWGL::CommitMappedBuffer(bool aDirty) {
   }
   mDT->Flush();
 
+#if MOZ_BIG_ENDIAN()
+  // One swizzle to rule them all.
+  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();
diff --git image/imgFrame.cpp image/imgFrame.cpp
index e58c3dd5b2d4..c1e7e77c362b 100644
--- image/imgFrame.cpp
+++ image/imgFrame.cpp
@@ -372,6 +372,17 @@ nsresult imgFrame::InitWithDrawable(gfxDrawable* aDrawable,
     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.

Youez - 2016 - github.com/yon3zu
LinuXploit