wxGraphicsContext and wxDC ?

Robert Roebling robert at roebling.de
Fri Jun 1 11:14:33 PDT 2007


Kevin Ollivier wrote:

> > Bryan Petty wrote:
> >
> >> Stefan replied with the answer to your question:
> >>
> >> "The goal is to have a graphics API that is closer to the modern
> >> graphics engines like Quartz, GDI+ and Cairo, that allow to support
> >> their richness and capabilities.
> >>
> >> It also is important to expose some of their objects like matrices,
> >> paths etc as separate objects, that can be stored for later reuse, so
> >> that performance does not suffer from on-the-fly conversions. As a
> >> compatibility DC there is the wxGCDC (GraphicsContextDC) in dcgraph.h
> >> that allows to use the old DC API on a new graphics context."
> >>
> >> To add to Stefan's reply, wxGraphicsContext is also the turning point
> >> for abstracting out the rendering engine for the ability to switch  
> >> out
> >> engines either at compile time or in runtime in the future.
> >
> > Well, actually I'm (intermittingly) working on being able to
> > switch wxDC based drawing engines at run-time (which is
> > required for using either Cairo or the old drawing system
> > depending on which version of GTK+ you have).
> 
> BTW, it looks like the WebKit GTK+ port is solving this issue by  
> allowing Cairo to work with older versions of GTK+, which I think we  
> should try and support as well. They basically re-implement  
> gdk_cairo_context. Here's a copy of the WebKit file to do this that  
> was pasted online last night (it has yet to be submitted to the patch  
> tracker):
> 
> http://paste.lisp.org/display/42101/raw

I get an error from the server.

> So basically we'd replace (or conditionally change) our  
> gdk_cairo_create call with this call instead. I was able to use this  
> to compile with --enable-graphics_ctx on a Linux box with an old  
> version of GTK+ and it worked fine, though I still have to test it.

That is an amazing trick, if it really works. Please contact the
author about the licence.

Are you still working on wxWebKit?
 
  Robert







More information about the wx-users mailing list