diff options
author | Tom Cooksey <thomas.cooksey@nokia.com> | 2010-03-10 09:16:23 (GMT) |
---|---|---|
committer | Tom Cooksey <thomas.cooksey@nokia.com> | 2010-03-10 09:53:07 (GMT) |
commit | 620a584c20c1aeb059803dfe246597daaf4f4e04 (patch) | |
tree | fddcd80e795db9c99a56a2e2f0061f79dfd101df /doc/src/snippets/code/src_script_qscriptvalueiterator.cpp | |
parent | b0eeab376fc9f698a899be6dbc4c1fe6cef02982 (diff) | |
download | Qt-620a584c20c1aeb059803dfe246597daaf4f4e04.zip Qt-620a584c20c1aeb059803dfe246597daaf4f4e04.tar.gz Qt-620a584c20c1aeb059803dfe246597daaf4f4e04.tar.bz2 |
Make sure 16-bit EGL configs are chosen over 32-bit configs
We want to make sure 16-bit configs are chosen over 32-bit configs as
they will provide the best performance. The EGL config selection
algorithm is a bit stange in this regard: The selection criteria for
EGL_BUFFER_SIZE is "AtLeast", so we can't use it to discard 32-bit
configs completely from the selection. So it then comes to the
sorting algorithm. The red/green/blue sizes have a sort priority of
3, so they are sorted by first. The sort order is special and
described as "by larger _total_ number of color bits.". So EGL will
put 32-bit configs in the list before the 16-bit configs. However,
the spec also goes on to say "If the requested number of bits in
attrib_list for a particular component is 0, then the number of bits
for that component is not considered". This part of the spec also
seems to imply that setting the red/green/blue bits to zero means
none of the components are considered and EGL disregards the entire
sorting rule. It then looks to the next highest priority rule, which
is EGL_BUFFER_SIZE. Despite the selection criteria being "AtLeast"
for EGL_BUFFER_SIZE, it's sort order is "smaller" meaning 16-bit
configs are put in the list before 32-bit configs. So, to make sure
16-bit is preffered over 32-bit, we must set the red/green/blue
sizes to zero. This has an unfortunate consequence that if the
application sets the red/green/blue size to 5/6/5 on the QGLFormat,
they will probably get a 32-bit config, even when there's an RGB565
config avaliable. Oh well.
Reviewed-By: TrustMe
Diffstat (limited to 'doc/src/snippets/code/src_script_qscriptvalueiterator.cpp')
0 files changed, 0 insertions, 0 deletions