Wine Reviews
WineHQ DIB engine status Print
Written by Tom Wickline   
Friday, 01 August 2008 07:55
Huw Davies today sent a update on the status of the DIB Engine that he's working on for Wine.

What is a DIB Engine?

This is from the Wine wiki:

DIBEngine

Wine requires a DIB engine (part of the display subsystem that, when pointed at screen memory, can serve as a flat-frame-buffer display driver) to properly handle Device Independent Bitmaps (DIB). In the Win32 API, an application can draw in a DIB via GDI calls or via direct memory access without any synchronization calls in between.

This implies a rather tight coupling of the graphics subsystem with the system memory, which is simply not present in a network transparent design such as X. This is a leftover of the Win16 API, I guess it seemed like a good idea at the time.

To emulate such behavior, we have to play memory tricks (by protecting the DIB memory) and switch between a 'GDI mode' and 'memory mode'. On each of these transitions, we have to copy the DIB to/from the X server. It works, but it is slow, especially over the network.

To fix this problem, we have to be able to emulate the GDI calls in software. This is what the DIB Engine is -- software rendering for the GDI calls.

Software rendering exists -- in fact, we are currently using the X server exactly for that: we copy the DIB to the server, translate the GDI call to an X request, and then we copy the result back. So the code exists, but it is in the X server. We need to copy it over to Wine, clean it up (the X code is not known for its neatness), and integrate it properly (from an architectural perspective) into Wine.

<!> Note: The difficulty in this task is more integration with the current Wine codebase in an incremental and non-intrusive manner. Wine needs infrastructure for the DIB engine so that graphics operations without DIB support can fall back to X11.

/!\ A patch that dumps an entire DIB engine somewhere in the Wine tree is unlikely to be accepted (that has already happened!). It needs to be added in an incremental manner, without breaking working functionality.

Here's a copy of the E-Mail Huw sent to the wine-devel mailing list.

Hi folks,

Here's an update on the DIB engine that I've been working on for the
last few months.  This work has been made possible by the generosity
of Google - so thanks go to them and of course to Dan.

You can find the code at http://repo.or.cz/w/wine/dibeng-hd.git

What's supported
================
- All dib section depths (including BI_BITFIELD support).

- Single pixel solid and dashed pens.

- The 16 rop2s.

- Solid and dib pattern brushes.

- A brunch of primitives for drawing onto all dib section surfaces.

- GDI32 apis: LineTo, Rectangle and PatBlt.

- An extensive test suite for all of the above.

What needs to be done
=====================
- Blitting (eg BitBlt, StretchBlt and StretchDIBits) - I have some
 hacks for these in my tree.

- ExtTextOut

- Many more GDI32 apis - a lot of these should be easy given that we
 have a set of underlying dib drawing primitives.

- Non-MM_TEXT mapping modes and world transforms.

- The initial interaction with GDI32 in BITMAP_SelectObject is hacky
 and needs some work.

- Lots more...

Note that at the moment it's essentially useless because of the lack
of blitting, so unless you fancy hacking on that yourself then you
probably don't want to bother fetching the tree.

I'm going to stop working on this for a while (lots of fun Outlook
2007 bugs for me to look at!), but will endeavour to keep the tree up
to date with respect to WineHQ.  If someone *does* want to hack on
this then feel free to send me patches!

Thanks,
Huw.

Del.icio.us     Digg This!     Furl     Google     Seed Newsvine     Reddit     Slashdot     Stumble It!     Technorati     Yahoo MyWeb

Comments
Add New Search RSS
Write comment
Name:
Email:
 
Title:
UBBCode:
[b] [i] [u] [url] [quote] [code] [img] 
 
Text:

3.26 Copyright (C) 2008 Compojoom.com / Copyright (C) 2007 Alain Georgette / Copyright (C) 2006 Frantisek Hliva. All rights reserved."