[cairo] Re: Notes on cairo/win32

J. Ali Harlow ali at avrc.city.ac.uk
Fri Jan 14 08:39:16 PST 2005


On 14/01/05 16:21:02, Owen Taylor wrote:

> I have some belief that a C++ class is required to have the same
> in-memory layout as a C structure with the same members in the same
> order.
> 
> I'd be suprised if the Rect class didn't have the memory layout:
> 
> struct Rect_ {
>    int x, y, width, height;
> }
> 
> having private members would just be weird for that.

If you're right, that would certainly work.

> Note there is no reason we can't use C++ in the implementation
> of Cairo. I've never heard of anybody compiling GTK+ for Windows
> with anything other than MSVC or GCC (cross or native).

True, of course.

> The question to me is header file creation... can we create
> redistributable header files that are compatible with the SDK header
> files; the C++ interface is problematical for that because it's
> a lot of inline functions. (Not impossible, just a fair bit of
> work
> 
> The flat interface should be easier.

Yes. I based my headers on Casper Hornstrup's work, but I'm a little  
dubious as to whether he used a clean-room approach to creating them.  
Hard to be sure since I haven't looked at the headers in the Platform  
SDK, but there appear to be things in his headers which don't appear in  
MSDN.

> Right now I'm thinking straight-GDI rather than GDI+ anyways... it
> doesn't sound like there is a big performance advantage to GDI+
> on current Windows,and for acceleration, going to lower levels
> will likely be easier, rather than using the not-quite-a-match
> GDI+.

Ah. I had understood that you were pushing for GDI+ because it gives us  
"anti-aliased paths and alpha-composited primitives". If GDI will do  
what we need then the hardware acceleration, ease of use and  
familiarity would all seem to be benefits.

Ali.




More information about the cairo mailing list