Plasma wallpaper painting inconsistency

Benoit Jacob jacob.benoit.1 at gmail.com
Tue Sep 2 16:20:57 CEST 2008


Hi,

I noticed an inconsistency in the way plasma wallpapers are painted, between
when it is painted as background of the screen and when it is painted in the
little preview in the "Desktop Settings" dialog.

Here is my paint() function. Mandelbrot is a subclass of Wallpaper.

void Mandelbrot::paint(QPainter *painter, const QRectF& exposedRect)
{
    if(!m_tile.final()) {
      QRect destination = m_tile.destination();
      kDebug() << "recompute" << destination;
      mandelbrot_render_with_vectorization<float>(m_tile_image, m_color,
m_tile, 1, 0);
      QPainter(m_image).drawImage(destination, *m_tile_image);
      painter->drawImage(destination, *m_image, destination);
      m_tile.next();
      emit update(m_tile.destination());
    }

    kDebug() << "repaint" << exposedRect;
    painter->drawImage(exposedRect, *m_image, exposedRect);
}

Here is the console output when the wallpaper is painted as the background
of the screen:

.....
plasma(11356) Mandelbrot::paint: recompute QRect(640,700 160x100)
plasma(11356) Mandelbrot::paint: repaint QRectF(0,0 1280x800)
plasma(11356) Mandelbrot::paint: recompute QRect(480,700 160x100)
plasma(11356) Mandelbrot::paint: repaint QRectF(0,0 1280x800)
plasma(11356) Mandelbrot::paint: recompute QRect(320,700 160x100)
plasma(11356) Mandelbrot::paint: repaint QRectF(0,0 1280x800)
plasma(11356) Mandelbrot::paint: recompute QRect(160,700 160x100)
plasma(11356) Mandelbrot::paint: repaint QRectF(0,0 1280x800)
.....

See, the paint() function is always called with exposedRect equal to the
whole screed, regardless of the parameter passed to update().

Now here is the console output when I open the "Desktop Settings" dialog and
it shows the little preview:

......
plasma(11356) Mandelbrot::paint: recompute QRect(102,90 20x12)
plasma(11356) Mandelbrot::paint: repaint QRectF(102,90 20x12)
plasma(11356) Mandelbrot::paint: recompute QRect(82,90 20x12)
plasma(11356) Mandelbrot::paint: repaint QRectF(82,90 20x12)
plasma(11356) Mandelbrot::paint: recompute QRect(61,90 20x12)
plasma(11356) Mandelbrot::paint: repaint QRectF(61,90 20x12)
plasma(11356) Mandelbrot::paint: recompute QRect(41,90 20x12)
plasma(11356) Mandelbrot::paint: repaint QRectF(41,90 20x12)
plasma(11356) Mandelbrot::paint: recompute QRect(20,90 20x12)
plasma(11356) Mandelbrot::paint: repaint QRectF(20,90 20x12)
.....

See, this time the paint()  function is called with exactly the rectangle
that was passed to update().

So:
1) is this inconsistency (difference between preview and actual wallpaper
rendering) justified or a bug?
2) currently the preview has visual artifacts while the actual wallpaper
rendering is OK. But the actual wallpaper rendering, repainting the whole
screen background everytime a tile is updated, is slow. Isn't there a way to
repaint only the updated tile, without having visual artifacts?

Cheers,
Benoit
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.kde.org/pipermail/plasma-devel/attachments/20080902/8018340c/attachment.htm 


More information about the Plasma-devel mailing list