summaryrefslogtreecommitdiffstats
path: root/src/gui/opengl
Commit message (Collapse)AuthorAgeFilesLines
* Fix unused function warnings in qtriangulator.cppThiago Macieira2014-01-101-7/+2
| | | | | | | | | qIntersectionPoint with ints wasn't used, qDot was only used in debug mode. Found by Clang 3.4. Change-Id: I4b5699f75eb88331df54bf5a289133914d80b299 Reviewed-by: Robin Burchell <robin+qt@viroteck.net> Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
* Doc: suppress documentation of methods users shouldn't useThiago Macieira2013-12-211-0/+2
| | | | | Change-Id: Ib905c9c54c236831f76a5c2925e7477cd7d6184c Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Fix radial gradient shader compilation for OpenGL ES 2.0.Carsten Munk2013-12-051-2/+2
| | | | | | | | | Change highp to mediump. This qualifier is ignored on desktop, and mediump should be sufficient elsewhere. Task-number: QTBUG-35353 Change-Id: I79f0ed88717d45dada5dcb781e75b10e72db4bd0 Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
* QOpenGLTextureHelper (Windows): Don't load desktop DLL when GLES2 is usedAndrew Knight2013-11-211-1/+1
| | | | | | | | GL functions should come from the context, not the desktop GL lib, when Qt is configured for OpenGL ES 2 (e.g. ANGLE). Change-Id: I794e1d5989ac72d2e98070d20e91f9c2c4cb7183 Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
* Enable QOpenGLTexture for OpenGL ES 2Jorgen Lind2013-11-145-17/+179
| | | | | Change-Id: I3ec2b7af303070c92e86c0f5ca729eb1a1731682 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* QOpenGLTexture: mark (QImage) ctor explicitMarc Mutz2013-11-141-1/+1
| | | | | | | Disables implicit conversions from QImage to QOpenGLTexture. Change-Id: I09b4d236dde8eae5258e6a954f4e02b4451990bd Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* QOpenGLTexture: mark (Target) ctor explicitMarc Mutz2013-11-141-1/+1
| | | | | | | Disables implicit conversions from Target to QOpenGLTexture. Change-Id: I2edd2dc4528a311577f0b7df4f6ce22696336a88 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* QOpenGLPixelTransferOptions: declare as shared, add move assignment operatorMarc Mutz2013-11-141-0/+10
| | | | | | | | | | | | | | A move constructor cannot be added because the class uses a smart pointer to hold its pImpl, so the move ctor would have to be out-of-line, destroying BC between C++11 and C++98 versions of Qt. Member-swap is required for Q_DECLARED_SHARED, which in turn enables efficient use of the class in Qt containers by marking it movable. Change-Id: I1aaa5bf3343a92e621d9464d8e4352f4e5ceff1f Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Make OpenGL texture glyph cache use the right freetype glyphsGunnar Sletta2013-11-061-1/+11
| | | | | | | | | The freetype font engine would fall back to rasterizing glyphs via QPainterPath in QFontEngine::alphaMapForGlyph() which has a rather unfortunate implementation. Change-Id: Ic0b4095b6f17ab33f0602139f0a8fb441dfba0ee Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
* Doc: Fix broken linksSze Howe Koh2013-11-051-6/+6
| | | | | | | | Task-number: QTBUG-33360 Change-Id: Ic944cb2f575c35ebad64852ef5fc44a50ac03571 Reviewed-by: Jerome Pasion <jerome.pasion@digia.com> Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
* Fix ARGB image glyphs on Open GL ES2 or big endianAllan Sandfeld Jensen2013-11-041-11/+16
| | | | | | | | | | | | Change Ie891665ad66e31692b69db02d34be8d303a7d631 accidentially removed the condition that would ensure ARGB glyphs would get swizzled on OpenGL ES2. This patch readds a condition to check that, and also fixes the same on big endian hosts by reusing the OpenGL ES2 code path. Change-Id: I55615c498261a43c50e5a6902a7e2e24cddc4f4b Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
* Remove now redundant argb to rgba functionAllan Sandfeld Jensen2013-11-041-20/+4
| | | | | Change-Id: I293d71e12398aef91995b68a9ea22cac984917b0 Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
* Fix major performance regression in QGLWidget on texture bindAllan Sandfeld Jensen2013-11-041-3/+5
| | | | | | | | | | | | | | Since Qt 5.1 we have not recognized the GL_EXT_bgra extension on desktop OpenGL, or the GL_EXT_texture_format_BGRA8888 extension on OpenGL ES. This patch matches the GL_EXT_bgra extension on both OpenGL and OpenGL ES and adds discovery of GL_EXT_texture_format_BGRA8888 under OpenGL ES. The old name for GL_EXT_texture_format_BGRA8888, GL_IMG_texture_format_BGRA8888 is also recognized. Change-Id: I2035bfe045aee14e86a1f407f5b8556454f8bb90 Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
* Do not byteswap RGBA8888 formatsAllan Sandfeld Jensen2013-10-252-30/+3
| | | | | | | | | | | | | The three RGBA8888 formats was introduced to make it possible to have QImages and QPixmaps in native OpenGL formats, but uploaded textures of these types are still converted to ARGB first and then swapped back. This patch detects the formats and ensures the unneeded back-and-forth conversion does not take place. It also replaces a seemingly unused private API meant for the same goal. Change-Id: Id69d6973bb9c13d1052f2a1b0c516183f63421c2 Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
* Use QByteArrayLiteral throughout in QOpenGLVertexArrayObjectSean Harmer2013-10-201-8/+8
| | | | | Change-Id: Ia362ead0ffdc077bd0db5d980c80464838c934ea Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* Support APPLE VAO extension on Mac.James Turner2013-10-161-13/+27
| | | | | | | | | | Since Mac lacks a compatibility profile, we often use the highest supported compatible version, 2.1; this lacks vertex-array-object (VAO) support in the API, but Apple provide a compatible extension. Extend the helper object to detect this case and make VAO support work. Change-Id: I75a74e048a0d188cec76bc5a4a9eafa4c9143740 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Fixed narrowing conversion compile error with SwizzleValue cast.Harri Porten2013-10-151-1/+1
| | | | | | | | | | | | | | I got the following compile error with gcc 4.7.0: error: narrowing conversion of ‘r’ from ‘QOpenGLTexture::SwizzleValue’ to ‘GLint {aka int}’ inside { } [-Werror=narrowing] The compiler must being going through the route of treating the enum as an unsigned int and thus choking on the conversion to a signed int. Change-Id: I35c15673d0371c69984bdec80622066f792527ba Reviewed-by: Sean Harmer <sean.harmer@kdab.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Doc: Adding mark-up to boolean default values.Jerome Pasion2013-10-0811-60/+60
| | | | | | | | | | | | | | | | | Default values should have mark-up to denote that they are code. This commit changes: -"property is true" to "property is \c true". -"Returns true" to "Returns \c true". -"property is false" to "property is \c false". -"returns true" to "returns \c true". -"returns false" to "returns \c false". src/3rdparty and non-documentation instances were ignored. Task-number: QTBUG-33360 Change-Id: Ie87eaa57af947caa1230602b61c5c46292a4cf4e Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* Fix syncqt warning about include in qopenglpixeltransferoptions.h.Friedemann Kleint2013-09-301-1/+1
| | | | | | | | WARNING: qopenglpixeltransferoptions.h includes QSharedDataPointer when it should include QtCore/QSharedDataPointer Change-Id: I0a84a37d2f4e310535979ef97b81937d2b2b2313 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Fix check in texture cleanup codeSean Harmer2013-09-301-1/+1
| | | | | Change-Id: Iaf91cf27d64aedb71a8af7ba318ff1231ff11b0d Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* Remove code that doesn't do anything.Gunnar Sletta2013-09-261-19/+0
| | | | | Change-Id: Id2528167f21e1ab81b998ceb808a9fc4a24b239a Reviewed-by: Yoann Lopes <yoann.lopes@digia.com>
* Long live QOpenGLTexture!Sean Harmer2013-09-228-2/+5197
| | | | | | | Task-number: QTBUG-33274 Change-Id: I9259d947d11f8ba330a2cd7f5620d8f1af0a804b Reviewed-by: Sean Harmer <sean.harmer@kdab.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
* Don't try to allocate a msaa FBO when it is not supported.Gunnar Sletta2013-09-201-15/+12
| | | | | | Change-Id: Ib4bdabcfa4e9b76156d7188da82fe2173b4b997e Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Doc: Link to external docs in QOpenGLFunctions_* classesTopi Reinio2013-09-0923-22/+114
| | | | | | | | | | | These are wrapper classes that do not document their functions. This change adds links to docs on opengl.org / khronos.org where suitable, and changes the \brief commands to mention the correct OpenGL version/profile. Change-Id: I48154d5bce26f6753ca4400962939847c78a527d Reviewed-by: Jerome Pasion <jerome.pasion@digia.com> Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2013-08-271-1/+1
|\ | | | | | | | | | | | | Conflicts: examples/widgets/doc/src/addressbook-fr.qdoc Change-Id: Id1196e8e0c6445f1616c3f29234c974d809f8e48
| * Ensure the docs for QOpenGLFunctions_ES2 are generatedThiago Macieira2013-08-231-1/+1
| | | | | | | | | | | | | | | | | | | | qdoc runs the preprocessor, so it probably skipped the definition for this class. Change-Id: I10933134d0c20131dd25e15bee914ebfac358b10 Reviewed-by: Robin Burchell <robin+qt@viroteck.net> Reviewed-by: James Turner <james.turner@kdab.com> Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* | Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2013-08-143-17/+11
|\| | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: configure mkspecs/macx-xcode/Info.plist.app mkspecs/macx-xcode/Info.plist.lib qmake/doc/qmake.qdocconf src/corelib/global/qglobal.h tests/auto/other/exceptionsafety/exceptionsafety.pro tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp Change-Id: I3c769a4a82dc2e99a12c69123fbf17613fd2ac2a
| * un-confuse lupdate: use #if 0 consistentlyOswald Buddenhagen2013-08-121-1/+3
| | | | | | | | | | | | | | | | | | it's no good idea to #if 0 the opening brace but comment out the closing one. Change-Id: I6f9ca8f14f0dc82fb22df85de547564336ed0476 Reviewed-by: Sean Harmer <sean.harmer@kdab.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
| * Fix typo form->fromStephen Kelly2013-07-311-1/+1
| | | | | | | | | | Change-Id: Ifa47cec0e454228d33c917c0baa6d0686955af5a Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
| * Fix upload of glyphs when using RGB32 masks on OpenGL ESGunnar Sletta2013-07-301-14/+4
| | | | | | | | | | | | | | | | | | | | | | | | OpenGL ES doesn't allow internal format to be different from external format, so always do the conversion from BGRA -> RGBA. We are anyway iterating over all the pixels so the performance impact of this should be minimal. Change-Id: Ie891665ad66e31692b69db02d34be8d303a7d631 Reviewed-by: Andy Shaw <andy.shaw@digia.com> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
| * Add workaround for GL on Android emulatorEskil Abrahamsen Blomfeldt2013-07-291-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | On the Android Emulator, the shaders will be compiled by a desktop GL driver, since the GL driver in the emulator is just a thin wrapper. The GL driver does not necessarily support the precision qualifiers, which can cause applications to break. We detect this at runtime in the platform plugin and set a workaround flag to Task-number: QTBUG-32557 Change-Id: Ied00cfe8e804d1f7862697dd379a14f3bed3d980 Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
* | Support RGBA image formatAllan Sandfeld Jensen2013-07-231-8/+13
| | | | | | | | | | | | | | | | | | Support the byte-ordered RGBA format which is used by OpenGL, and many endian neutral byte formats. Task-number: QTBUG-32201 Change-Id: I77cffb4c30c69545fa96ded2f537b2ebd9351acb Reviewed-by: Allan Sandfeld Jensen <allan.jensen@digia.com>
* | Merge branch 'stable' into devSergio Ahumada2013-07-113-14/+64
|\| | | | | | | | | | | | | | | | | | | Conflicts: qmake/generators/mac/pbuilder_pbx.cpp src/corelib/json/qjsonwriter.cpp src/corelib/kernel/qeventdispatcher_blackberry.cpp src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm Change-Id: I24df576c4cbd18fa51b03122f71e32bb83b9028f
| * Restore smooth-scaled drawing of 0.5x-2.0x scaled glyphs in the GL engineTor Arne Vestbø2013-07-081-12/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit b5922c89ba942 (Add support for retina glyph-based text drawing in the GL engine), and commit 155a20628b91 (Use QPaintEngineEx to decide if font is too big for using the glyph cache) together changed the behavior of drawing scaled cached glyphs in the GL engine, producing blocky text drawing when using the FreeType font engine. Whereas before we would cache all glyphs without any transform, and let the paint engine take care of the transform, commit b5922c added support for a scaled GL glyph cache, resulting in a 2x cache, drawn at 1x for example. The problem was that the FreeType engine claimed to support producing glyphs at 2x, but did that using the QFontEngine baseclass implementations, which use a simple fast-transform to scale up the glyphs. The result was a 2x cache with horrible looking glyphs. The first step in fixing this issue was to have the FreeType engine claim to only support translations. This would then make the paint engine choose path-based drawing for all scaled text, which is slow. To restore the optimization that we would draw 0.5x-2.0x scaled text using a smooth-scale in the GL engine (which was removed in 155a206), we then needed to extend shouldDrawCachedGlyphs() and add a special condition for this, coupled with a bit of logic in drawCachedGlyphs() that ensures we don't propagate the painter scale to the glyph cache if the engine is not able to produce scaled glyphs for it. This means we get the old behavior of the GL engine doing a smooth scale of the 1x glyph in the cache. Finally, since the raster engine also checks if the font engine supports the current transform, but for FreeType then ends up in a separate code path when actually drawing the glyphs (as the FreeType font engine supports internal glyph caching), we need to add a corresponding check for hasInternalCaching() in the shouldDrawCachedGlyphs() function, now that the FreeType engine only reports that it supports translations. Change-Id: Id03de896dec5f29535b281fb235332ef018045d8 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
| * Set projection matrix for systems with OpenGL 3.1Wouter Huysentruit2013-07-031-0/+2
| | | | | | | | | | | | | | | | | | | | The projection matrix should also be set for systems running OpenGL 3.1 with GL_ARB_compatibility extension. Task-number: QTBUG-28284 Change-Id: I756155a6064dcbff29fd817e676d31f24f559e8c Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
| * Merge remote-tracking branch 'origin/release' into stableFrederik Gladhorn2013-06-282-2/+26
| |\ | | | | | | | | | Change-Id: I53112e20a65b7d706755b4a22622979f3b91a2c2
| | * Avoid crash when QOpenGLContext is destroyed before the VAOSean Harmer2013-06-282-2/+26
| | | | | | | | | | | | | | | | | | | | | Change-Id: I19df59453156a95c5075a065268333a74cec2476 Reviewed-by: James Turner <james.turner@kdab.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com> Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* | | Add a way to test if an OpenGL context has the fixed function pipeline availableGiuseppe D'Angelo2013-07-022-1/+10
| | | | | | | | | | | | | | | | | | | | | | | | Due to the mess done in 3.0/3.1 this is trickier than it should be, so add a convenience method to test that. Change-Id: I26d77cc8f109820cca3f578c3fa3520e802dc15f Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* | | Fix documentation of the QOpenGLFunctions::OpenGLFeature enumGiuseppe D'Angelo2013-07-021-2/+2
|/ / | | | | | | | | | | | | | | | | | | | | | | It's not really about features already present in OpenGL ES 2 that might not be present in other OpenGL implementations; for instance, NPOT textures are not in ES 2, but only available through extensions. Therefore, change the wording to include optional OpenGL and OpenGL ES features. Change-Id: I3822e50789ded10a937e3c5b7b4be9e267265276 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* | Merge remote-tracking branch 'origin/release' into stableFrederik Gladhorn2013-06-121-0/+1
|\| | | | | | | Change-Id: If29ca1b27da4592d40a7678837c359f75dac1209
| * Doc: Mark QOpenGLFunctions_4_1_Core as a wrapper classTopi Reinio2013-06-101-0/+1
| | | | | | | | | | | | | | | | | | The class documentation missing the \wrapper command, making QDoc complain a lot. Change-Id: Iad8fa3d2facadfb3393642dc08ff4dc416bdccc7 Reviewed-by: Martin Smith <martin.smith@digia.com> Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* | doc: QOpenGLFramebufferObject::bindDefault() was marked internalMartin Smith2013-06-111-1/+0
| | | | | | | | | | | | | | | | The \internal was removed. Task-number: QTBUG-31645 Change-Id: I98b57ec3816b6d9c49e3488accb65f147aeb15f1 Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* | Fix FBO restoring in QOpenGLTextureGlyphCacheValery Volgutov2013-06-051-1/+4
|/ | | | | | | | | | | | | | | | QOpenGLTextureGlyphCache::restoreTextureData restores FBO which was binded before restoreTextureData call. More specifically, it restores QOpenGLContextPrivate's current_fbo member. This works if FBO was binded by QOpenGLFramebufferObject but not if FBO was binded using glBindFramebufferObject and rendering done via QOpenGLPaintDevice. This patch fixes it by querying current FBO using GL_FRAMEBUFFER_BINDING query and restoring it. Change-Id: Ia97a21e62566dc39a5191b66d3ca0e3ad0845ce1 Reviewed-by: Valery Volgutov <valery.volgutov@lge.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
* Prevent QOpenGLShaderProgram::link() from showing unnecessary warnings.Samuel Rødal2013-05-241-5/+7
| | | | | | | | | | | | | | | If the liking didn't fail there's no need to print out warnings. The warnings can still be accessed by the application after calling link() through the log() function. This prevents warnings such as these from appearing: QOpenGLShader::link: "No errors." Task-number: QTBUG-31326 Change-Id: I03c9be5dfada8822c3ab1c3610eac2fc0a91410b Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com> Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* qdoc: The \wrapper command is addedMartin Smith2013-05-0722-0/+22
| | | | | | | | | | | | | | | | | | If \wrapper appears in a \class comment or a \qmltype comment, qdoc will not print warnings when it finds public members of the class or the QML type that are not documented. The \wrapper command is added to several opengl classes. This reduces the number of qdoc warnings by several thousands. Task-number: QTBUG-30755 Change-Id: Iba1eebc1590ccf54100e40fe91423240c1b3d09d Reviewed-by: Topi Reiniö <topi.reinio@digia.com> Reviewed-by: Venugopal Shivashankar <venugopal.shivashankar@digia.com> Reviewed-by: Martin Smith <martin.smith@digia.com> Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* Don't use GL_REPEAT for image-brush drawing on OpenGL ES2Tor Arne Vestbø2013-05-071-1/+9
| | | | | | | | | | | | | | | | | OpenGL ES2 doesn't support NPOT textures in combination with GL_REPEAT, so for OpenGL ES2 we use a custom program that emulates repeat by taking the fractional part of the texture coordinates. This is not enough though, as merely setting GL_TEXTURE_WRAP_x to GL_REPEAT with a NPOT texture is an error in some implementations, so we have to guard the call to updateTextureFilter() in updateBrushTexture() with a check for OpenGL ES2 and use GL_CLAMP_TO_EDGE instead. This fixes missing/black backgrounds in the diagramscene example on iOS. Change-Id: I5020090b5f17faeb06dcab9dc0292459e021af30 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com> Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
* Fix header check: you must #include qconfig.h before QT_NO_OPENGLThiago Macieira2013-04-232-0/+4
| | | | | Change-Id: I50518bd1b721d19e4712a6c11afb0a93afeaa7ea Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Fix memory leak.Sérgio Martins2013-04-181-0/+2
| | | | | | Change-Id: I7d308a869fdc729bd46ace336b71c7e30556d65d Reviewed-by: Sean Harmer <sean.harmer@kdab.com> Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
* QOpenGLPaintDevice: correct painting on retina.Morten Johan Sørvig2013-04-181-1/+1
| | | | | | | | Make QOpenGLPaintDevice::metric(PdmDevicePixelRatio) return d->devicePixelRatio instead of 1. Change-Id: I4cf9dd552a700b958212edc8efb990a45e77fd66 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
* Add default value for qHash's 'seed' argument for QOpenGLVersionProfile/StatusTor Arne Vestbø2013-04-151-1/+1
| | | | | | | | | | | | | | | | Although template<typename T> inline uint qHash(const T &t, uint seed) from qhash.h is never instantiated because we have the two-argument version of qHash() for both QOpenGLVersionProfile and QOpenGLVersionStatus, we need the default argument, as the template in qhash.h uses noexcept, which is evaluated regardless of instantiation, and uses qHash(t) without a seed. This behavior seems to not be the case with Apple clang 4.2, but has been observed with Apple clang 4.1, Clang 3.2, and GCC 4.8. Change-Id: If70e93f64eb9675a7c3ef7897ced2c6aebbec2d6 Reviewed-by: Eike Ziller <eike.ziller@digia.com> Reviewed-by: Olivier Goffart <ogoffart@woboq.com>