On Tue, Nov 9, 2010 at 2:25 PM, John Hunter <jdh2...@gmail.com> wrote:

> Attached also is the example code I am using to test.  Strangely, the
> agg buffer seems to be updating internally but the gtk window is only
> updating when I hover my mouse over it, and then only once until I
> activate another window and then re-hover over the mpl animation
> window.

OK, this was an example of how writing the email for help solves the
problem.  As soon as I described the strange updating behavior, it
triggered my memory about the expose event code in backend_gtk and
when I took a look at that I realized I need to draw to the window and
not the pixbuf as we do in _render_figure.  The revised diff is
attached.

So this email now is a patch review request, and importantly, can we
get rid of all gtk extension code?  There is now no need for
_gtkagg.cpp, and the only other piece is src/_backend_gdk.c which
provides pixbuf_get_pixels_array.  If we could get rid of this, which
is used for images and mathtext in the GDK backend, it would be a big
win for compilation and distribution.  Ideally, I would like to not
compile anything against a GUI, but so far we haven't been able to
figure out a way around TkAgg.  But removing GTK compile time
dependencies would be a good start.

If you are familiar with agg and/or gtk/gdk internals, please take a
look at my updated patch.  I am not double buffering as we are in
_render_figure, which seems appropriate for animation.  I am actually
a little confused about why we need so many buffers in the main draw
pipeline -- we have the agg buffer, the gtk pixbuf, the gdk pixmap,
and the gdk window.  Does anyone recall why we don't render directly
from the pixbuf to the window here?  My guess is that it is to handle
the expose event in backend_gtk efficiently, but we should be able to
do this from the pixbuf directly to the window....  Or perhaps I'm
missing something.

I'm going to proceed with removing _gtkagg.cpp in the trunk, and I
think we should consider disabling default builds of _backend_gdk.c
(they could be enabled by a config option if we can't find a python
replacement for pixbuf_get_pixels_array)

JDH

Attachment: diff.out
Description: Binary data

Attachment: animation_blit_gtk.py
Description: Binary data

------------------------------------------------------------------------------
The Next 800 Companies to Lead America's Growth: New Video Whitepaper
David G. Thomson, author of the best-selling book "Blueprint to a 
Billion" shares his insights and actions to help propel your 
business during the next growth cycle. Listen Now!
http://p.sf.net/sfu/SAP-dev2dev
_______________________________________________
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel

Reply via email to