Michael Droettboom wrote:
> Christopher Barker wrote:
>> Michael Droettboom wrote:
>>> Wx supports polycurves in its new wxGraphicsContext API (but not the 
>>> wxDC API that mpl uses now).  This means a fairly complete rewrite of 
>>> the wx backend,
>> not necessarily. You can create a GraphicsContext from a wx.DC, you may 
>> be able to just add that step for drawing polycurves.
>>
>>> since you 
>>> can no longer draw to an in-memory buffer, but only a true wxClientDC). 
>> you can create a GraphicsContext from a wxMemeoryDC, so yes, you can 
>> draw to a buffer.
> 
> I'm having trouble just getting a wxPython to compile with 
> wxGraphicsContext support (perhaps another argument against using it...)
> 
> I was basing this determination on the wx documentation which clearly 
> states one can only create a wxGraphicsContext from a wxWindowDC. 
> wxMemoryDC inherits from wxDC, not wxWindowDC. I'd be certainly happy to 
> find out that the documentation is incorrect on this point, as it would 
> certainly make the implementation easier.

I did finally get this to work -- thanks for the tip that you can use a 
wxGraphicsContext on a wxMemoryDC.

>> I haev no idea what the impact on performance would be, but in general, 
>> GraphicsContext is slower than DC.
> 
> Particularly, if it works as it appears to by rendering to a Cairo 
> buffer first.

It's really bad, actually.  It's entirely possible that I'm doing things 
suboptimally, of course.  If someone with more wx.GraphicsContext 
experience were to look at backend_wx.py on the branch, I'd appreciate it.

I particularly wonder if drawing directly to a wx.Window would perform 
better over the network than to a wx.MemoryDC and then blitting that to 
the window (as both trunk and branch do now).  Clipping rectangles have 
a major impact also.  I did optimize the code so that the clipping state 
changes as infrequently as possible (rather than with each drawing 
operation), but it still has a huge impact.  I suspect that 
wx.GraphicsContext treats all clips as clipping paths, rather than the 
more efficient clipping rectangles when it can.

These benchmarks are on the branch on a RHEL4 box.

Local:
WxAgg:  27.5 fps
Wx:      1.8 fps
Wx:     16.8 fps (without clipping)

Network (X11 with compression):
WxAgg:   2.0 fps
Wx:      1.7 fps
Wx:      2.0 fps (without clipping)

Windows and Mac may perform quite differently, given that they use 
completely different rendering code.

Unless some "trick" can be found to make this better, it's hard to 
recommend Wx over WxAgg on the branch.

Cheers,
Mike

-- 
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel

Reply via email to