Title: [89115] trunk/Source/WebCore
Revision
89115
Author
[email protected]
Date
2011-06-16 22:07:52 -0700 (Thu, 16 Jun 2011)

Log Message

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

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (89114 => 89115)


--- trunk/Source/WebCore/ChangeLog	2011-06-17 04:45:33 UTC (rev 89114)
+++ trunk/Source/WebCore/ChangeLog	2011-06-17 05:07:52 UTC (rev 89115)
@@ -1,3 +1,14 @@
+2011-06-16  Robin Dunn  <[email protected]>
+
+        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  <[email protected]>
 
         Reviewed by Dan Bernstein.

Modified: trunk/Source/WebCore/platform/image-decoders/wx/ImageDecoderWx.cpp (89114 => 89115)


--- trunk/Source/WebCore/platform/image-decoders/wx/ImageDecoderWx.cpp	2011-06-17 04:45:33 UTC (rev 89114)
+++ trunk/Source/WebCore/platform/image-decoders/wx/ImageDecoderWx.cpp	2011-06-17 05:07:52 UTC (rev 89115)
@@ -54,11 +54,17 @@
         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++;
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to