gdiplus: implement CachedBitmap based on Image
vincent at codeweavers.com
Fri Nov 21 17:14:16 CST 2008
Our current implementation of CachedBitmap clones the image it is given and attempts to force that image to be a Bitmap. This is impossible (at least without doing something more complex). It actually leaks the cloned Image by putting it in a local variable whose value is never used, and the GpCachedBitmap ends up pointing to an invalid Image, causing a crash if it is drawn.
Since the only operations permitted for CachedBitmaps are "draw" and "delete", it doesn't much matter whether we really have a Bitmap (ideally, we'd have a gdi bitmap optimized for the given HDC). So just clone the Image and use it in the usual way.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 2657 bytes
Url : http://www.winehq.org/pipermail/wine-patches/attachments/20081121/bd1c9ca6/attachment.obj
More information about the wine-patches