? cairo.def ? win32-surface.patch Index: cairo-win32-surface.c =================================================================== RCS file: /cvs/cairo/cairo/src/cairo-win32-surface.c,v retrieving revision 1.33 diff -r1.33 cairo-win32-surface.c 526a527,615 > #if !defined(AC_SRC_OVER) > #define AC_SRC_OVER 0x00 > #pragma pack(1) > typedef struct { > BYTE BlendOp; > BYTE BlendFlags; > BYTE SourceConstantAlpha; > BYTE AlphaFormat; > }BLENDFUNCTION; > #pragma pack() > #endif > > /* for compatibility with VC++ 6 */ > #ifndef AC_SRC_ALPHA > #define AC_SRC_ALPHA 0x01 > #endif > > typedef BOOL (WINAPI *cairo_alpha_blend_func_t) (HDC hdcDest, > int nXOriginDest, > int nYOriginDest, > int nWidthDest, > int hHeightDest, > HDC hdcSrc, > int nXOriginSrc, > int nYOriginSrc, > int nWidthSrc, > int nHeightSrc, > BLENDFUNCTION blendFunction); > > static cairo_int_status_t > _composite_alpha_blend (cairo_win32_surface_t *dst, > cairo_win32_surface_t *src, > int alpha, > int src_x, > int src_y, > int dst_x, > int dst_y, > int width, > int height) > { > static unsigned alpha_blend_checked = FALSE; > static cairo_alpha_blend_func_t alpha_blend = NULL; > > BLENDFUNCTION blend_function; > > /* Check for AlphaBlend dynamically to allow compiling on > * MSVC 6 and use on older windows versions > */ > if (!alpha_blend_checked) { > OSVERSIONINFO os; > > os.dwOSVersionInfoSize = sizeof (os); > GetVersionEx (&os); > > /* If running on Win98, disable using AlphaBlend() > * to avoid Win98 AlphaBlend() bug */ > if (VER_PLATFORM_WIN32_WINDOWS != os.dwPlatformId || > os.dwMajorVersion != 4 || os.dwMinorVersion != 10) > { > HMODULE msimg32_dll = LoadLibrary ("msimg32"); > > if (msimg32_dll != NULL) > alpha_blend = (cairo_alpha_blend_func_t)GetProcAddress (msimg32_dll, > "AlphaBlend"); > } > > alpha_blend_checked = TRUE; > } > > if (alpha_blend == NULL) > return CAIRO_INT_STATUS_UNSUPPORTED; > > blend_function.BlendOp = AC_SRC_OVER; > blend_function.BlendFlags = 0; > blend_function.SourceConstantAlpha = alpha; > blend_function.AlphaFormat = src->format == CAIRO_FORMAT_ARGB32 ? AC_SRC_ALPHA : 0; > > if (!alpha_blend (dst->dc, > dst_x, dst_y, > width, height, > src->dc, > src_x, src_y, > width, height, > blend_function)) > return _cairo_win32_print_gdi_error ("_cairo_win32_surface_composite"); > > return CAIRO_STATUS_SUCCESS; > } > 594,610c683,685 < BLENDFUNCTION blend_function; < < blend_function.BlendOp = AC_SRC_OVER; < blend_function.BlendFlags = 0; < blend_function.SourceConstantAlpha = alpha; < blend_function.AlphaFormat = src->format == CAIRO_FORMAT_ARGB32 ? AC_SRC_ALPHA : 0; < < if (!AlphaBlend (dst->dc, < dst_x, dst_y, < width, height, < src->dc, < src_x + itx, src_y + ity, < width, height, < blend_function)) < return _cairo_win32_print_gdi_error ("_cairo_win32_surface_composite"); < < return CAIRO_STATUS_SUCCESS; --- > return _composite_alpha_blend (dst, src, alpha, > src_x + itx, src_y + ity, > dst_x, dst_y, width, height);