[SCM] WebKit Debian packaging branch, webkit-1.2, updated. upstream/1.1.90-6072-g9a69373

kevino at webkit.org kevino at webkit.org
Wed Apr 7 23:27:20 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit f5691eedeb30fe0272247eb252fecd0612593a78
Author: kevino at webkit.org <kevino at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Mon Nov 9 20:32:38 2009 +0000

    Reviewed by Kevin Ollivier.
    
    [wx] Fix handling of alpha channel when using wxWidgets 2.9: it was
    simply ignored before resulting in transparent areas being black in PNG
    images for example.
    
    https://bugs.webkit.org/show_bug.cgi?id=30823
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@50677 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index fc7beaa..67b5848 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,16 @@
+2009-11-09  Vadim Zeitlin  <vadim at wxwidgets.org>
+
+        Reviewed by Kevin Ollivier.
+
+        [wx] Fix handling of alpha channel when using wxWidgets 2.9: it was
+        simply ignored before resulting in transparent areas being black in PNG
+        images for example.
+        
+        https://bugs.webkit.org/show_bug.cgi?id=30823
+
+        * platform/image-decoders/wx/ImageDecoderWx.cpp:
+        (WebCore::RGBA32Buffer::asNewNativeImage):
+
 2009-11-09  Laszlo Gombos  <laszlo.1.gombos at nokia.com>
 
         Reviewed by Kenneth Rohde Christiansen.
diff --git a/WebCore/platform/image-decoders/wx/ImageDecoderWx.cpp b/WebCore/platform/image-decoders/wx/ImageDecoderWx.cpp
index 3cadf1c..e6e45b7 100644
--- a/WebCore/platform/image-decoders/wx/ImageDecoderWx.cpp
+++ b/WebCore/platform/image-decoders/wx/ImageDecoderWx.cpp
@@ -40,35 +40,41 @@ namespace WebCore {
 NativeImagePtr RGBA32Buffer::asNewNativeImage() const
 {
     wxBitmap* bmp = new wxBitmap(width(), height(), 32);
-    typedef wxPixelData<wxBitmap, wxAlphaPixelFormat> WxPixelData;
-    WxPixelData data(*bmp);
-    
-    // NB: It appears that the data is in BGRA format instead of RGBA format.
-    // This code works properly on both ppc and intel, meaning the issue is
-    // likely not an issue of byte order getting mixed up on different archs. 
-    const unsigned char* bytes = (const unsigned char*)m_bytes.data();
-    int rowCounter = 0;
-    long pixelCounter = 0;
-    WxPixelData::Iterator p(data);
-    WxPixelData::Iterator rowStart = p; 
-    for (size_t i = 0; i < m_bytes.size() * 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];
+
+    {
+        typedef wxPixelData<wxBitmap, wxAlphaPixelFormat> WxPixelData;
+        WxPixelData data(*bmp);
         
-        p++;
+        // NB: It appears that the data is in BGRA format instead of RGBA format.
+        // This code works properly on both ppc and intel, meaning the issue is
+        // likely not an issue of byte order getting mixed up on different archs. 
+        const unsigned char* bytes = (const unsigned char*)m_bytes.data();
+        int rowCounter = 0;
+        long pixelCounter = 0;
+        WxPixelData::Iterator p(data);
+        WxPixelData::Iterator rowStart = p; 
+        for (size_t i = 0; i < m_bytes.size() * 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];
+            
+            p++;
 
-        pixelCounter++;
-        if ((pixelCounter % width()) == 0) {
-            rowCounter++;
-            p = rowStart;
-            p.MoveTo(data, 0, rowCounter);
+            pixelCounter++;
+            if ((pixelCounter % width()) == 0) {
+                rowCounter++;
+                p = rowStart;
+                p.MoveTo(data, 0, rowCounter);
+            }
         }
-    }
 #if !wxCHECK_VERSION(2,9,0)
-    bmp->UseAlpha();
+        bmp->UseAlpha();
 #endif
+    } // ensure that WxPixelData is destroyed as it unlocks the bitmap data in
+      // its dtor and we can't access it (notably in CreateBitmap() below)
+      // before this is done
+
     ASSERT(bmp->IsOk());
 
 #if USE(WXGC)

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list