[prev in list] [next in list] [prev in thread] [next in thread]
List: wine-devel
Subject: Re: [PATCH 3/3] winex11: Add support for animated cursors in X11
From: Alexandre Julliard <julliard () winehq ! org>
Date: 2010-09-28 15:01:43
Message-ID: 87tyl96hew.fsf () wine ! dyndns ! org
[Download RAW message or body]
Erich Hoover <ehoover@mines.edu> writes:
> @@ -508,35 +517,90 @@ static Cursor create_xcursor_cursor( HDC hdc, ICONINFO *icon, int width, int hei
> info->bmiHeader.biYPelsPerMeter = 0;
> info->bmiHeader.biClrUsed = 0;
> info->bmiHeader.biClrImportant = 0;
> - GetDIBits( hdc, icon->hbmColor, 0, height, image->pixels, info, DIB_RGB_COLORS );
> + hbmColor = CreateDIBSection( hdc, info, DIB_RGB_COLORS, (VOID **) &mem_bits, NULL, 0);
> + if (!hbmColor)
> + {
> + ERR("Failed to create DIB section for image!\n");
> + goto cleanup;
> + }
> + SelectObject( hdc, hbmColor );
> + if (!DrawIconEx( hdc, 0, 0, icon, width, height, istep, NULL, DI_NORMAL ))
> + {
> + TRACE("Could not draw frame %d (walk past end of frames).\n", istep);
> + goto cleanup;
> + }
> + memcpy(image->pixels, mem_bits, info->bmiHeader.biSizeImage);
You should be reusing the info, DC and bitmap objects for all frames
instead of always recreating everything from scratch.
--
Alexandre Julliard
julliard@winehq.org
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic