winex11: Avoid using DIB functions to create the dithering image.

This commit is contained in:
Alexandre Julliard 2012-01-10 16:29:47 +01:00
parent 49b73d53cf
commit 978c42feb5
1 changed files with 7 additions and 3 deletions

View File

@ -112,17 +112,21 @@ static Pixmap BRUSH_DitherColor( COLORREF color, int depth)
Pixmap pixmap;
GC gc = get_bitmap_gc(depth);
wine_tsx11_lock();
if (!ditherImage)
{
ditherImage = X11DRV_DIB_CreateXImage( MATRIX_SIZE, MATRIX_SIZE, depth );
if (!ditherImage)
ditherImage = XCreateImage( gdi_display, visual, depth, ZPixmap, 0,
NULL, MATRIX_SIZE, MATRIX_SIZE, 32, 0 );
if (!ditherImage)
{
wine_tsx11_unlock();
ERR("Could not create dither image\n");
return 0;
}
ditherImage->data = HeapAlloc( GetProcessHeap(), 0,
ditherImage->height * ditherImage->bytes_per_line );
}
wine_tsx11_lock();
if (color != prevColor)
{
int r = GetRValue( color ) * DITHER_LEVELS;