WXAgg backend updates

Hello everyone,

I just committed some accelerator-related updates to the WXAgg backend. I have fixed the problem with the way I was calling the wxBitmap constructor in _wxagg.src. More importantly, I written another set of the agg-to-wx.Bitmap conversion routines that uses the new BitmapFromBufferRGBA() function in wxPython 2.8. The blit() routine also got a bit faster after I realized it was more efficient to just convert the whole buffer and blit part of it instead of clipping during conversion.

I have tested these changes with wxPython 2.8.1.1 under OSX 10.4.8. My goal is that none of the changes break compatibility with wxPython 2.4 or 2.6. I'd really appreciate it if someone could test and benchmark those versions using `examples/animation_blit_wx.py'.

Ken

Thanks Ken!!

> More importantly, I written

another set of the agg-to-wx.Bitmap conversion routines that uses the new BitmapFromBufferRGBA() function in wxPython 2.8.

Are these in Python or c++?

The blit() routine also got a bit faster after I realized it was more efficient to just convert the whole buffer and blit part of it instead of clipping during conversion.

really? interesting -- it shows you never know!

I have tested these changes with wxPython 2.8.1.1 under OSX 10.4.8. My goal is that none of the changes break compatibility with wxPython 2.4 or 2.6.

um, how is that possible if you're using the new 2.8 functions?

I'd really appreciate it if someone could test and benchmark those versions using `examples/animation_blit_wx.py'.

I'll see what I can do.

By the way, did you see the weird toolbar behavior with 2.8 on OS-X?

-Chris

···

--
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception

Chris.Barker@...236...

More importantly, I written another set of the agg-to-wx.Bitmap conversion routines that uses the new BitmapFromBufferRGBA() function in wxPython 2.8.

Are these in Python or c++?

Since BitmapFromBuffer() and its aforementioned cousin are covered in the wxWidgets documentation for wxBitmap, I believe they're mostly in C++.

The blit()
routine also got a bit faster after I realized it was more efficient
to just convert the whole buffer and blit part of it instead of
clipping during conversion.

really? interesting -- it shows you never know!

Yep. Benchmarking is your friend!

I have tested these changes with wxPython 2.8.1.1 under OSX 10.4.8.
My goal is that none of the changes break compatibility with wxPython
2.4 or 2.6.

um, how is that possible if you're using the new 2.8 functions?

There are two conditional checks based on wx.__version__. One is in setup.py to not build the C++ accelerator for wxPython 2.8. The other is in backend_wxagg.py and figures out which of the three agg/wx.Bitmap conversion implementations to use -- the pure Python routines, the C++ accelerator, or the wxPython 2.8 edition of the pure Python routines.

I'd really appreciate it if someone could test and
benchmark those versions using `examples/animation_blit_wx.py'.

I'll see what I can do.

By the way, did you see the weird toolbar behavior with 2.8 on OS-X?

It didn't jump out at me, but I wasn't paying much attention. I'll try to reproduce it tomorrow.

Ken

···

On Feb 22, 2007, at 1:11 PM, Christopher Barker wrote:

Ken McIvor wrote:

Are these in Python or c++?

Since BitmapFromBuffer() and its aforementioned cousin are covered in the wxWidgets documentation for wxBitmap, I believe they're mostly in C++.

umm, I meant, is YOUR code in Python or C++, but it looks like you answered that below:

um, how is that possible if you're using the new 2.8 functions?

There are two conditional checks based on wx.__version__. One is in setup.py to not build the C++ accelerator for wxPython 2.8. The other is in backend_wxagg.py and figures out which of the three agg/wx.Bitmap conversion implementations to use -- the pure Python routines, the C++ accelerator, or the wxPython 2.8 edition of the pure Python routines.

Ah. I had written some "smarts" for setup.py (and utilities it uses) to do a better job of finding the correct wx-config. Is there any point to that now? If so, I'll sent it along to you.

-Chris

···

--
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception

Chris.Barker@...236...

FYI Christopher, et al. - Due to operator incompetence the changes I blabbed about earlier haven't hit the repository yet.

Ken

Debian stable is going to be released soon with wxPython 2.4 and 2.6, so I'd like to keep working to improve the C++ accelerator when practical. Could you send me the changes?

Ken

···

On Feb 22, 2007, at 5:17 PM, Christopher Barker wrote:

I had written some "smarts" for setup.py (and utilities it uses) to do a better job of finding the correct wx-config. Is there any point to that now? If so, I'll sent it along to you.