[cairo] Cairo and GdiPlus or two win32 backends

Hans Breuer hans at breuer.org
Sat Feb 5 11:26:27 PST 2005


On 19.01.2005 15:06, Carl Worth wrote:
> On Sat, 15 Jan 2005 23:20:45 +0100, Hans Breuer wrote:
> 
>>Since 2004-11-12 there is code for a GDI+ backend in cairo
>>cvs but it isn't referenced anywhere (i.e. unusable)
> 
> [..]
> 
>>Also the patch available since 2004-05-30 [1] - pending since
>>about half a year [3] - is updated to cleanly apply to current
>>cvs. See: http://hans.breuer.org/dia/cairo-2005-01-15-hb.diff
> 
> 
> Hi Hans,
> 
> I did have your patch sitting in my queue for a couple months. I
> wasn't willing to commit it since I was not qualified to review it.
> 
So if noone feels qualified to review new backend code that new
backend will simply never be accepted in Cairo ?

> Then, at the end of July, 2004, Stuart approached me saying he was
> interested in writing a win32 backend. I said, "Great! I've got this
> patch here from Hans that I've been waiting for someone to review." He
> looked it over that same evening and had the first version of his
> patch the next morning.
> 
... started from scratch (or from the code of Maarten?) with a completely
differnt approach than mine. The first comparsion I've done here:

http://lists.freedesktop.org/archives/cairo/2004-May/001519.html

Another attempt for a short summary :

                       Maarten       Stuart       Hans           Owen
exported symbols by:  #pragma      #pragma    libcairo.def       ?(1)
compiler used:         msvc?        msvc         msvc           mingw
language:                C           C++          C              C
font backend:        freetype    unfinished    freetype        win32?base 
based on (backend):    image        GDI+       Windows          Cairo
                                                Metafile        Metafile?
target:                HWND          HDC       multiple(2)    DIB/HDC?(3)

(1) my guess is libcairo.def, approach succesfully used from GLib to
     The GIMP; maybe generated by CPP as recently introduced in GTK+
     but at the moment it apears to rely on GCC auto export facility
(2) Windows Metafiles can be 'rendered' to anything between file, screen
     and printer. They are also commonly used as clipboard exchange format.
(3) Device Independent Bitmap, that is completely pixel based.

> It was quite some time between then and when his code got committed to
> CVS, and I don't know the reasons for that delay.
> 
> But, with all of this, I thought that Stuart's worked built on yours,
I'd say they are mostly orthogonal. And the same holds true for Owens new
win32 backend (which apparently replaced the GDI+ backend) ...

> so I didn't realize you were still waiting for someone to commit your
> patch. (Admittedly, I hadn't read either patch. I'm still not
> qualified to review win32 code).
> 
There should be nothing special to win32 code except some ugliness ;-)
But coding style, descriptive comments including questions for cairo
concepts - all should be familiar.

> I hope that helps explain what's been happening on my end. I'm sorry
> if this episode has given you the impression that we're not accepting
> of code contributions.
> 
But how to continue now? As I see it there are still quite some open
issues even if one ignores the new backend - which is just that,
and has almost no influence on the rest of Cairo - with backend
specific headers even less ;-)

- Should Cairo be buildable with something other than GCC ?
- Should it be possible to write Cairo backends in C++ (probably
   to be resolved by cairo-backend.h separartion) ?
- Is a vector based backend something considered useless or -
   if not - will there be better support in the backend interface ?
   - Extracting clip masks from bitmaps certainly is possible but
     shouldn't this info better be provided as vectors?
   - If I understood the operators correctly they are a mix between
     simple drawing mode and some logical operations on objects. Again
     wouldn't it be possible to provide this objects vector
     information down to the backend?
- (not really Cairo but it's planned usage) How to cross platform
   interface printers ?

And more general:

- How does one provide patches accepted ? [Or is it just a matter of
   getting CVS access and simply commit at will? ;]

> And to anybody, please let me know if there's more I can do to be more
> communicative about things. And feel free to pester me (even
> individually if you like) if I seem to have forgotten about any issue
> that's important to you.
> 
I always thought my intent was rather clear: Get Cairo to do something
useful even on win32 and - especially as someone keeping Gtk+ and Dia
to be buildable with msvc - make it fit into the build systems used
there.
With current cvs Gtk+ depending on Cairo IMHO it would be really sad
if the we-dont-care policy would be continued. Should this new
GTK+ dependency really break the ability to build everything
up to The GIMP and Dia with windoze native tools ???

BTW: I've updated my Cairo patch once more, available here:
http://hans.breuer.org/dia/cairo-2005-02-05-hb.diff

On my local disk there are also small modifications to build libpixman
and cairo_snippets including dependencies with the M$ toolchain.
It would be nice if these can be reconsidered ...

Even if you are not interested in win32 stuff at all you may be
interested in fixing a serious bug in *text_to_glyphs() :

2005-01-15  Hans Breuer  <hans at breuer.org>

	* src/cairo_ft_font.c src/cairo_win32_font.c : (text_to_glyphs) don't
	free *glyphs to be returned


Thanks,
	Hans

-------- Hans "at" Breuer "dot" Org -----------
Tell me what you need, and I'll tell you how to
get along without it.                -- Dilbert




More information about the cairo mailing list