Comment 9 for bug 733912

Revision history for this message
Andrey Bondarenko (abone) wrote :

Both versions are affected because on_expose function was not changed. If you check serc/greeter.c::on_expose, you will see that this function redraws entire screen on each call:

    if( bg_img )
    {
        cairo_matrix_t matrix;
        double x = 0, y = 0, sx, sy;
        cairo_get_matrix(cr, &matrix);
        sx = (double)gdk_screen_width() / (double)gdk_pixbuf_get_width(bg_img);
        sy = (double)gdk_screen_height() / (double)gdk_pixbuf_get_height(bg_img);
        cairo_scale(cr, sx, sy);
        gdk_cairo_set_source_pixbuf(cr, bg_img, x, y);
        cairo_paint(cr);
        cairo_set_matrix(cr, &matrix);
    }

Witn src/greeter.c::on_timeout function which changes system time every second, it leads to full screen redraw every second. In my case it means to scale 800x800 pixels wallpaper image and put it on 1600x900 pixel screen. This algorithm just cannot work fast or consume ow CPU.

It need to use information from evt and redraw only affected area. Also, I think it should cache pre-scaled bitmap.

Sorry, I have no experience in GTK/Cairo programming and cannot provide a patch right now.