wxGraphicsContext and wxDC ?

Kevin Ollivier kevino at theolliviers.com
Fri Jun 1 10:55:16 PDT 2007


Hi Robert,

On Jun 1, 2007, at 10:38 AM, Robert Roebling 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

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.

Regards,

Kevin

>  Robert
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: wx-users-unsubscribe at lists.wxwidgets.org
> For additional commands, e-mail: wx-users-help at lists.wxwidgets.org
>





More information about the wx-users mailing list