Don't issue GL calls when the geometry is empty
authorEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
Tue, 5 Jul 2011 08:33:59 +0000 (10:33 +0200)
committerQt by Nokia <qt-info@nokia.com>
Tue, 5 Jul 2011 10:38:50 +0000 (12:38 +0200)
commitd010d0893a8796e2973327a06f71988ea5fde14d
treec3d32808e85066482816dd574022c676f6c88c05
parent8226443b16f91aba62125c8f1e1f114cb9c1739b
Don't issue GL calls when the geometry is empty

This works as a band-aid and optimization for QT-5104, because in the
text in the example, which contains latin text and has a latin default
font set, will think of all spaces between the cyrillic characters as
latin characters, hence it will make separate text items for them and
issue separate glDrawElements() calls. By cutting off if there are no
glyphs to draw, we can avoid hitting the actual bug for this and several
other use cases, making it less likely to happen.

Task-number: QT-5104
Reviewed-by: Samuel
(cherry picked from commit f51b5fe09c63e4b3c2ab5a4d06e162c43d38207d)

Change-Id: Id80f55ce403a7aa112c3abb314d080aa43c0078b
Reviewed-on: http://codereview.qt.nokia.com/1158
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp