DIB Engine - New approach

Massimo Del Fedele max at veneto.com
Tue Apr 14 03:22:14 CDT 2009

The approach taken so far consisted in having 2 device pointers inside GDI32, one for dib engine and
the other for normal display driver.
This way had the disadvantage of having to keep in sync the DC with the right driver depending on
selected bitmap, which lead to many small changes spread along all gdi code; going deeper with
development this approach showed many limits and problems.

So I decided to start again from scratch with a completely different approach which is giving good
results and is quite less invasive on gdi32 code.
Instead of doing :

            -- DIB ENGINE
GDI32 ---
          \ -- X11 DRIVER

I took this approach :


The (X11) display driver is loaded from inside the engine, which replaces it from gdi32 point of view.
The changes in gdi32 are *very* limited, just in driver.c code, making it to load (if desired) the
engine instead of normal x11 driver. No other changes needed. I added as usual the code allowing to
enable/disable the engine on request by registry and/or environment variable.
If the engine is not present or disabled, the driver loader falls back to usual behaviour.
The Engine then loads the X11 driver in init phase and acts as a gate depending on selected BMP,
forwarding to X11 driver all requests for DDB bitmaps and doing the job itself for DIB ones.

This approach showed many advantages, and I' almost ready converting all old code to it.
By now I'm posting here 3 patches showing the approach; the posted driver is a simple pass-throu one,
so it just forwards all calls to X11 driver. The last patch of the series shows the forking behaviour
of DIB/DDB processing from inside the engine, but still forwarding all to X11.

I'd like some comments on the approach taken; on next days I'll post a more complete code with most of
the engine implemented.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-dib-engine-hook-the-engine-bet.patch
Type: text/x-patch
Size: 5834 bytes
Desc: not available
URL: <http://www.winehq.org/pipermail/wine-devel/attachments/20090414/cfcc18dd/attachment-0003.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-dib-engine-initial-pass-throug.patch
Type: text/x-patch
Size: 58751 bytes
Desc: not available
URL: <http://www.winehq.org/pipermail/wine-devel/attachments/20090414/cfcc18dd/attachment-0004.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0003-dib-engine-fork-ddb-dib-behavi.patch
Type: text/x-patch
Size: 71105 bytes
Desc: not available
URL: <http://www.winehq.org/pipermail/wine-devel/attachments/20090414/cfcc18dd/attachment-0005.bin>

More information about the wine-devel mailing list