Protect against malicious SPDY messages

Add handling of invalid stream-ids and buffer overflow in header
parsing.

Change-Id: I712af189d72612639d25890a8861a8f4fe084ce3
Reviewed-by: Peter Hartmann <phartmann@blackberry.com>
tests: Remove superfluous gui additions to QT

by default QT contains both core and gui already

Change-Id: I6f5b551104e40a024468e7cb62e302134e9472ec
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
SPDY: Fix compiler warning about unused variable

Change-Id: Ib3dcd8616ab8167de31a01b3e6f0188d384ff244
Reviewed-by: Peter Hartmann <phartmann@blackberry.com>
QPalette: optimize move assignment operator

Instead of assigning the various bit-fields manually, use the quint32
union field, which is already present to avoid slow bit-field operations
in the member-swap function.

Verifed that the generated assembly for move-assignment is
significantly better than before on GCC.

Change-Id: If4e0ef678bf3a496c6eb369ad3f639f5a9bc79fc
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Add an example for creating OpenGL contexts

Besides serving as an example for performing OpenGL rendering inside
a window container in a way that it works across all GL versions,
this is an extremely useful tool for developers and users alike
since it allows quick and easy checking of what sort of context a
particular driver returns for a particular QSurfaceFormat.

NB! Depending on the OpenGL driver, some surprises can be expected.
The handling of core/compatibility profiles, the fwdcompat bit,
the supported GLSL versions, etc. tend to be somewhat different
across the different OpenGL implementations.

Task-number: QTBUG-37071
Change-Id: Iae4328e66cd0bb19f74a77fefef93ea5a3221e31
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Add core profile versions of the glyph cache shaders

The last step to make QOpenGLTextureGlyphCache working with
OpenGL core profiles.

[ChangeLog] Native (that is, not distance field based) text
rendering is now functional on OpenGL 3.2+ core profiles too.

Task-number: QTBUG-36993
Change-Id: Ic6c0db4806cea623ca7a19ab77b0329155824877
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Honor the value of the PlatformToolset environment variable.

The Windows SDK 7.1 command prompt sets this value to "WindowsSDK7.1"
through its SetEnv.cmd batch script. The MSVC Express Editions do not
include a 64bit compiler toolchain, but the Windows SDK does, so this
change makes it easier to build qmake projects for x86_64 when using
the Express Editions, by running qmake from the SDK command prompt.
See also:
  http://msdn.microsoft.com/en-us/library/9yb4317s%28v=vs.100%29.aspx
  http://msdn.microsoft.com/en-us/library/ff660764%28v=vs.100%29.aspx

Task-number: QTBUG-31185
Change-Id: I49d3e159ed67f64490a3d57c5471d540d76ae13f
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
Do not upload on closed SPDY streams

We should never upload on a SPDY stream in a closed or half-closed
state. To avoid it we need to stop listening for readyRead on the
upload device, and ignore WINDOW_UPDATE on completed streams.

This fixes SPDY access of facebook.com.

Change-Id: Icad45ffc109b2c14b921f1571e114b70a30f40a9
Reviewed-by: Peter Hartmann <phartmann@blackberry.com>
Make bool arguments to QWidgetBackingStore::markDirty enums

This is so we get some typesafty when refactoring, and I think it makes
the code more readable

Change-Id: Ia7531950d5f780dc98f4eb435c1e0050d76cdb5f
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
Add source to debug output of QMouseEvent.

Change-Id: Ibf55a2697ca0ac85624097299be92c1055dcb8aa
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
Windows: Fix return value of WM_QUERYENDSESSION for bogus messages.

LRESULT should be non-zero if the application can quit,
and it is always handled. Improves
97d8e3b2007abf7b14b4ccbfbbc4abdeef712bcf .

Task-number: QTBUG-35986

Change-Id: I0ad95bc20a5d9e2a52c76bdcdfa986595f6a08d8
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
QNX: Report if GL context is shared

This fixes the tst_qopengl sharedResourceCleanup auto test

Change-Id: I0ac6f45797f656b637254f01c2cb8073436b45b2
Reviewed-by: Kevin Krammer <kevin.krammer@kdab.com>
Reviewed-by: Fabian Bumberger <fbumberger@rim.com>
Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
Android: avoid crash with toplevel QGLWidget

Task-number: QTBUG-37096

Change-Id: I14db37a78314782d7b5897db946283bd0063e348
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
QQuickWidget show/hide/raise fix

Make sure the alphamask in the backingstore is updated whenever the
state of a QQuickWidget/QOpenGLWidget child changes.

Task-number: QTBUG-37062
Change-Id: Iffa80fc8993499a15bc9e773a162a3f98b81ae03
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
Unify QFontEngine::getSfntTableData() behavior on all platforms

Being a most significant method in the font API,
getSfntTableData() must behave in exactly the same way on all platforms.
Briefly, it must return true if the table exists in the font,
despite the other params, and always stores the table data length
in 'length' param, thus reporting the amount of bytes actually
needed to store the table data in a buffer.

Change-Id: I7a15465020c1ea818ea46a05ea3b9b7e1cd60d14
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Fix retreiving the 'head' table in QPAGenerator

The 'head' table is usually of 54 bytes length. Passing the buffer of
4 bytes capacity for the 'head' table is expected to return false,
thus skipping the FontRevision tag in QPAGenerator::writeHeader().

Change-Id: I02c0b13f3cbf13579a845fe78fcbc8a437ae22bf
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Hide the justification algorithm implementation details

The justification "classes" stored in the glyph attributes
are actually a justification priorities suitable for a particular
language (script). The external API only uses the justification
metrics array calculated on top of these priorities.

Change-Id: I5b0a39e35954084c63a798b632fd6108f9ae7608
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Make QGlyphLayout consume one byte less per glyph

Change-Id: Iddcc2e1f284dcf13ae98b57ea2d5854e57c83530
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Fix QFontEngineQPA::recalcAdvances() in case of missing glyph

Modifying the glyph indexes array in recalcAdvances() could lead
to undefined behavior.

Change-Id: Ibbb6642f381a5fe01b285dc8d2001c167dc66f46
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Get rid of unused variable

Change-Id: Ie90914c2110d32e573108a355a44dd459097a755
Reviewed-by: Lars Knoll <lars.knoll@digia.com>