2016-02-04 19:55 GMT+09:00 Marius Gedminas <[email protected]>:

> On Thu, Feb 04, 2016 at 12:33:37PM +0200, Marius Gedminas wrote:
> > On Thu, Feb 04, 2016 at 12:06:57PM +0200, Marius Gedminas wrote:
> > > The 'clearing ... 149 cells' messages in the log prove that this bit
> of code
> > >
> > >         set_cairo_source_rgb_from_pixel(cr, gui.bgcolor->pixel);
> > >         cairo_rectangle(cr,
> > >                         FILL_X(col), FILL_Y(row),
> > >                         num_cells * gui.char_width, gui.char_height);
> > >         cairo_fill(cr);
> > >
> > > was executed, so it remains to be discovered why it didn't clear
> > > anything.  Was there an active clipping rectangle?  Was bgcolor->pixel
> > > wrong?  I'll try to add more debugging printfs().
> <...>
> > Everything seems correct, so I've no idea why cairo isn't clearing that
> > area :(
>
> I turned to IRC for help (#gnome-hackers on irc.gnome.org), and this is
> the advice I received:
>
>   <ebassi> mgedmin: Stop using gdk_cairo_create() and instead use the
>            cairo_t that GtkWidget::draw gives you
>   <ebassi> mgedmin: If you want to draw outside of the drawing code,
>            then create a surface using
>            gdk_window_create_similar_surface() or
>            gdk_window_create_similar_image_surface(), and draw on it;
>            then, inside the ::draw vfunc, use the surface as the source
>            on the cairo_t provided you by GtkWidget
>

Looks great help...

In short, the hacker on IRC told us, "On the same window, use the same
cairo context for every drawing."

It sounds quite natural to me, because, having read snippets of example
code, I was always wondering why we had to call gdk_cairo_create() to
create a context every time.

OK, I'll write another patch implementing that idea.  To do that, it
requires some relatively large structural changes which I expect will take
some time.  So, I beg your patience :)

Last but not least, he visualizer is very cool.  I like it.  It should be
useful for other purposes.  Thank you for sharing it with me!

Regards,
Kazunobu


> Regards,
> Marius Gedminas
> --
> Being really good at C++ is like being really good at using rocks to
> sharpen
> sticks.
>         -- Thant Tessman
>
> --
> --
> You received this message from the "vim_dev" maillist.
> Do not top-post! Type your reply below the text you are replying to.
> For more information, visit http://www.vim.org/maillist.php
>
> ---
> You received this message because you are subscribed to the Google Groups
> "vim_dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui