Dimitri Frederickx wrote:
> The reason that I want to use OpenGL for rendering is SVG. I have some large 
> animated SVG files I want to show in high definition. When I don't use 
> OpenGL, 
> my animations are not fluent. From time to time the animation stops for a few 
> milli seconds, and then going further but dropping some intermediate 
> rendering. 
>   

That sounds like garbage collection kicking in to me, but in that case I 
suppose the effect should be the same regardless of the viewport widget.

Have you tried removing all allocations in the inner loop, though?

> Can someone help me?
>
> Problems with OpenGL:
>
> 1. By using OpenGL, the quality of my graphics items is drastically reduced. 
> When I resize my pixmaps, I'm using SmoothTransform. Without OpenGL my 
> pictures 
> look really nice and smooth, but with OpenGL I see little blocks around my 
> pictures, no smooth lines, etc. How can I increase the quality of my items?
>   

I'm not completely clear on what is happening here. Are you using 
QGraphicsPixmapItems? If you are, you should set SmoothTransform on the 
items:

    
myPixmapItem.setTransformationMode(Qt.TransformationMode.SmoothTransformation);

If you are however using your own QGraphicsItem subclass with an 
overridden paint() method in which you call drawPixmap() on a painter, 
then you should either set SmoothPixmapTransform render hint on the 
painter before drawing, or on the entire graphics view if you want this 
as a global setting:

    myGraphicsView.setRenderHint(QPainter.RenderHint.SmoothPixmapTransform);

This should, however, give the same results for OpenGL as for software 
rendering. I have made an attempt at reproducing your problem on 
Windows, but I don't see any major differences between a scene rendered 
with OpenGL and one rendered without here.

A few questions to try to track down the problem:

1. Have you tested this on any other platform than Windows?

2. Do you see any artifacts when running the 40 000 chips demo and 
turning on OpenGL rendering? Some differences between software and 
hardware rendering is to be expected, especially for font rendering, and 
this might be affected by the graphics drivers or the graphics hardware 
you are running. We don't know of any issues we would consider 
"unusable", though.

3. Which graphics hard ware are you using?

4. Could you possibly send us screenshots of the problems you are 
seeing, and also a code example if you have one? Since I haven't been 
able to reproduce this, it's hard to picture how bad it is.

> 2. I have made a marquee (scrolling text) with the use of QGraphicsTextItem 
> and 
> QGraphicsItemAnimation. Without OpenGL this works smooth, but with OpenGL my 
> text looks ugly because of the poor quality and because the scrolling 
> suddenly 
> doesn't happen as smooth as before.
>   

I'm not sure, but this may be a side effect of how text rendering is 
optimized in our OpenGL engine. You could replace the regular text 
rendering with an algorithm which converts the texts to QPainterPaths 
(see the Deformation demo) and then renders this instead to avoid the 
problems. Any transformation on the text should be smooth then, but the 
performance will suffer accordingly.

> 3. Adding the setViewport line in my code makes my application crash when I 
> quit 
> it. 9 out of the 10 times my application crashes on a shutdown. When I don't 
> set 
> the viewport, everything works just fine. Here is a part of the error dump:
>   

I've reproduced this crash and made a task for fix it for Qt Jambi 4.4.0_01.

-- Eskil


_______________________________________________
Qt-jambi-interest mailing list
[email protected]
http://lists.trolltech.com/mailman/listinfo/qt-jambi-interest

Reply via email to