[Kst] extragear/graphics/kst/kst

George Staikos staikos at kde.org
Mon Oct 24 17:45:00 CEST 2005


I think this caused some ugly X congestion or extra repaints of some sort.  
I'm seeing performance problems in the paint() call instead 
KstTopLevelView::paint() now.  Anyone else?

On Saturday 22 October 2005 01:25, George Staikos wrote:
> SVN commit 472825 by staikos:
>
> paint objects top->down instead of bottom->up to make sure we don't get
> inproper geometries or artifacts.  As a side effect, painting goes from
> O(n^2) to O(n) which is nice.
> BUG: 114788
>
>
>  M  +4 -2      ksttoplevelview.cpp
>  M  +8 -10     kstviewobject.cpp
>
>
> --- trunk/extragear/graphics/kst/kst/ksttoplevelview.cpp #472824:472825
> @@ -180,10 +180,13 @@
>
>
>  void KstTopLevelView::paint(KstPaintType type, const QRegion& bounds) {
> -  QRegion boundary = bounds;
>    QPainter p;
>    p.begin(_w);
>    p.setViewXForm(true);
> +  // Paint everything else first so that geometries are properly updated.
> +  paint(type, p, bounds);
> +
> +  QRegion boundary = bounds;
>    for (KstViewObjectList::Iterator i = _children.begin(); i !=
> _children.end(); ++i) { boundary -= (*i)->clipRegion();
>    }
> @@ -191,7 +194,6 @@
>      p.setClipRegion(boundary);
>      p.fillRect(geometry(), QBrush(_backgroundColor));
>      p.setClipping(false);
> -    paint(type, p, bounds);
>    }
>    p.end();
>
> --- trunk/extragear/graphics/kst/kst/kstviewobject.cpp #472824:472825
> @@ -309,29 +309,27 @@
>      }
>    }
>
> -  if (!maximized) {
> -    for (KstViewObjectList::Iterator i = _children.begin(); i !=
> _children.end(); ++i) { +  if (!maximized && !_children.isEmpty()) {
> +    QRegion clipRegion = oldRegion;
> +    KstViewObjectList::Iterator begin = _children.begin();
> +    for (KstViewObjectList::Iterator i = _children.fromLast();; --i) {
>        if (nullBounds ||
> !bounds.intersect(QRegion((*i)->geometry())).isEmpty()) { #ifdef BENCHMARK
>          QTime t;
>          t.start();
>  #endif
> -        QRegion clipRegion = oldRegion;
> -        KstViewObjectList::Iterator j = i;
> -        for (++j; j != _children.end(); ++j) {
> -          clipRegion -= (*j)->clipRegion();
> -        }
>          (*i)->_lastClipRegion = clipRegion;
>          p.setClipRegion(clipRegion);
>          (*i)->paint(type, p, bounds);
> +        clipRegion -= (*i)->clipRegion();
>  #ifdef BENCHMARK
>          int x = t.elapsed();
>          kstdDebug() << "   -> object " << (*i)->tagName() << " took " << x
> << "ms" << endl; #endif
> -        if ((*i)->_maximized) {
> -          break;
> -        }
>        }
> +      if (i == begin) {
> +        break;
> +      }
>      }
>    }
>
> _______________________________________________
> Kst mailing list
> Kst at kde.org
> https://mail.kde.org/mailman/listinfo/kst

-- 
George Staikos
KDE Developer				http://www.kde.org/
Staikos Computing Services Inc.		http://www.staikos.net/


More information about the Kst mailing list