Index: src/generic/graphicc.cpp

===================================================================
--- src/generic/graphicc.cpp	(revision 76007)
+++ src/generic/graphicc.cpp	(working copy)
@@ -1569,12 +1569,13 @@
             {
                 const wxUint32 argb = *src++;
 
-                *alpha++ = (argb & 0xff000000) >> 24;
+                const unsigned char a = argb >> 24;
+                *alpha++ = a;
 
                 // Copy the RGB data undoing the pre-multiplication.
-                *dst++ = Unpremultiply(*alpha, (argb & 0x00ff0000) >> 16);
-                *dst++ = Unpremultiply(*alpha, (argb & 0x0000ff00) >>  8);
-                *dst++ = Unpremultiply(*alpha, (argb & 0x000000ff));
+                *dst++ = Unpremultiply(a, argb >> 16);
+                *dst++ = Unpremultiply(a, argb >>  8);
+                *dst++ = Unpremultiply(a, argb);
             }
 
             src = rowStart + stride;


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@76015 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Paul Cornett
2014-02-25 17:38:34 +00:00
parent ab25cfbdfc
commit 07aa605bb5
2 changed files with 6 additions and 4 deletions

View File

@@ -598,6 +598,7 @@ All (GUI):
- Make wxFILTER_INCLUDE_LIST in wxTextValidator actually usable.
- Make wxHTML more efficient when displaying large tables (Kinaou Hervé).
- Prevent wxGrid rows/columns from becoming too small on double click.
- Fix wxGraphicsBitmap::ConvertToImage() when using Cairo.
wxGTK:

View File

@@ -1569,12 +1569,13 @@ wxImage wxCairoBitmapData::ConvertToImage() const
{
const wxUint32 argb = *src++;
*alpha++ = (argb & 0xff000000) >> 24;
const unsigned char a = argb >> 24;
*alpha++ = a;
// Copy the RGB data undoing the pre-multiplication.
*dst++ = Unpremultiply(*alpha, (argb & 0x00ff0000) >> 16);
*dst++ = Unpremultiply(*alpha, (argb & 0x0000ff00) >> 8);
*dst++ = Unpremultiply(*alpha, (argb & 0x000000ff));
*dst++ = Unpremultiply(a, argb >> 16);
*dst++ = Unpremultiply(a, argb >> 8);
*dst++ = Unpremultiply(a, argb);
}
src = rowStart + stride;