[RQt-devel] unable to draw glyphs using OpenGL

Tomas Sieger tomas.sieger at seznam.cz
Thu Oct 25 21:58:29 CEST 2012


On Thu, Oct 25, 2012 at 12:36 AM, Michael Lawrence
<lawrence.michael at gene.com> wrote:
>
>
> On Wed, Oct 24, 2012 at 1:18 PM, Tomas Sieger <tomas.sieger at seznam.cz>
> wrote:
>>
>> I've tracked the problem down a little bit deeper.
>>
>> I wanted to add some "use opengl" option to cranvas, but realized that
>> some cranvas plots using glyphs *do* work even if using opengl. I
>> found out that glyphs that specify stroke color as a vector of length
>> at least two (!) work:
>>      qdrawGlyph(painter,
>> qglyphCircle(r=5),5,5,stroke=rep('#FF0000FF',2)) # works
>> while those that specify stroke color as a single value do not:
>>      qdrawGlyph(painter,
>> qglyphCircle(r=5),5,5,stroke=rep('#FF0000FF',1)) # does not work
>> as well as those without an explicit stroke color:
>>      qdrawGlyph(painter, qglyphCircle(r=5),5,5) # does not work
>>
>> The length of the stroke color argument really makes a difference. If
>> it is a vector of length >=2, stroke colors get passed to painters
>> explicitly. If it is a single value, it sets the default color in the
>> painter. In the first case, OpenGLPainter draws glyphs explicitly (and
>> the glyph gets rendered correctly). In the latter case, the
>> OpenGLPainter delegates the call to QtBasePainter::drawGlyphs (and the
>> glyph gets not rendered).
>>
>> It makes me feel this might be a SW issue, not necessarily a HW one.
>>
>
> Thanks a lot for looking into this in depth. Yes, there are two code paths
> that use the hardware differently. The multi-color case is actually the more
> complicated one, using modulation to color the same texture many times, so
> it's surprising that it works, while the simpler case is broken. One
> possible test is to use white, so that the glyph image is exactly the same
> in both cases. That would eliminate one difference at least.

The problem persists even for white glyphs.
(I'm setting red background using
scene$setBackgroundBrush(Qt$QBrush(Qt$QColor('red'))) and drawing
white glyphs. "qdrawGlyph(painter,
qglyphCircle(r=5),5:7,5:7,stroke=rep('#FFFFFFFF',1))" get not
rendered.)

Tomas


More information about the Qtinterfaces-devel mailing list