Text Selection Speed

Koos Vriezen koos.vriezen at xs4all.nl
Mon Jun 24 21:03:06 BST 2002


On Mon, 24 Jun 2002, Dirk Mueller wrote:

> On Son, 23 Jun 2002, Koos Vriezen wrote:
>
> > On Sun, 23 Jun 2002, Dirk Mueller wrote:
> >
> > > On Son, 23 Jun 2002, Koos Vriezen wrote:
> > >
> > > > movies. The whole page is repainted all the time when repainting is
> > > > delayed to 40 ms (which speed up text selection).
> > > > BTW what do you think of not re-rescheduling repainting of rectangles?
> > >
> > > Sorry ?
> > QUpperLeftRect.unite(QLowerRightRect)
>
> Well, collapsing several rectangular repaint requests certainly makes sense,
> thats why we introduced the "scheduling".

Making one big rectangle out of two far away small rectangles.

> > > But nodeAtPoint is virtual, and is reimplmented in RenderFlow.
> > How common is that to have specialObjects?
>
> Very. There is basically no non-trivial page without dozens of them.
>
> > Don't use the cache in that
> > case or make it a separate function that could be called first.
>
> Possible. but you have to check them in the right order.. just checking the
> specialobjects alone isn't enough.

Ok, making the cache a bit smarter. Add a RenderObject* to
RenderObject::InnerNode and:
  void breakCache(RenderObject *ro, int _tx, int _ty)
    { if (!m_breakcache) { m_breakcache = ro; tx = _tx; ty = _ty; } }

In RenderFlow::nodeAtPoint
  if (containsSpecial())
      info.breakCache(this, _tx, _ty);

And in DocumentImpl::prepareMouseEvent
  if (d->cachedInnerNode &&
     ((d->cachedInnerNode->m_breakcache &&
      d->cachedInnerNode->m_breakcache->nodeAtPoint(....)) ||
     (!d->cachedInnerNode->m_breakcache &&
      d->cachedInnerNode->innerNode()->renderer()->nodeAtPoint(...))) {
    ........

Should solve that.

Koos





More information about the kfm-devel mailing list