Reviewed by Kevin Ollivier.
authorkevino@webkit.org <kevino@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 17 Jun 2011 05:07:52 +0000 (05:07 +0000)
committerkevino@webkit.org <kevino@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 17 Jun 2011 05:07:52 +0000 (05:07 +0000)
[wx] Account for differing byte order when decoding images in the PPC build.

https://bugs.webkit.org/show_bug.cgi?id=62830

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@89115 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/platform/image-decoders/wx/ImageDecoderWx.cpp

index a955076..03a0b45 100644 (file)
@@ -1,3 +1,14 @@
+2011-06-16  Robin Dunn  <robin@alldunn.com>
+
+        Reviewed by Kevin Ollivier.
+
+        [wx] Account for differing byte order when decoding images in the PPC build.
+        
+        https://bugs.webkit.org/show_bug.cgi?id=62830
+
+        * platform/image-decoders/wx/ImageDecoderWx.cpp:
+        (WebCore::ImageFrame::asNewNativeImage):
+
 2011-06-16  Darin Adler  <darin@apple.com>
 
         Reviewed by Dan Bernstein.
index 9314bbe..79aa119 100644 (file)
@@ -54,11 +54,17 @@ NativeImagePtr ImageFrame::asNewNativeImage() const
         WxPixelData::Iterator p(data);
         WxPixelData::Iterator rowStart = p; 
         for (size_t i = 0; i < m_size.width() * m_size.height() * sizeof(PixelData); i += sizeof(PixelData)) {
-                p.Red() = bytes[i + 2];
-                p.Green() = bytes[i + 1];
-                p.Blue() = bytes[i + 0];
-                p.Alpha() = bytes[i + 3];
-            
+#if CPU(BIG_ENDIAN)
+            p.Alpha() = bytes[i + 3];
+            p.Red() = bytes[i + 2];
+            p.Green() = bytes[i + 1];
+            p.Blue() = bytes[i + 0];
+#else
+            p.Alpha() = bytes[i + 0];
+            p.Red() = bytes[i + 1];
+            p.Green() = bytes[i + 2];
+            p.Blue() = bytes[i + 3];
+#endif
             p++;
 
             pixelCounter++;