From 7925f107814e46deb0848d9e6016721ceebfb521 Mon Sep 17 00:00:00 2001 From: Christophe Oosterlynck Date: Wed, 2 Nov 2011 10:00:12 +0100 Subject: Correction for effectiveBoundingRect() calculation for QGraphicsItem MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit QGraphicsItemPrivate::effectiveBoundingRect() should use ItemClipsChildrenToShape flag from the parent while looping to check for clipping and not use its own AncestorClipsChildren flag. By using AncestorClipsChildren, you're checking if one of your ancestors clips you, but you really want to know if your direct parent clips you. Merge-request: 1419 Reviewed-by: Samuel Rødal --- src/gui/graphicsview/qgraphicsitem.cpp | 15 +++++++--- tests/auto/qgraphicseffect/tst_qgraphicseffect.cpp | 34 ++++++++++++++++++++++ 2 files changed, 45 insertions(+), 4 deletions(-) diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp index 73e8eed..ff21296 100644 --- a/src/gui/graphicsview/qgraphicsitem.cpp +++ b/src/gui/graphicsview/qgraphicsitem.cpp @@ -2845,16 +2845,23 @@ QRectF QGraphicsItemPrivate::effectiveBoundingRect(const QRectF &rect) const If the item has an effect, the effective rect can be larger than the item's bouding rect, depending on the effect. + \a topMostEffectItem is the top most parent of which a possible QGraphicsEffect + should be taken into account (\a topMostEffectItem is inclusive). Any effects + of any ancestors of \a topMostEffectItem are not taken into consideration. + \sa boundingRect() */ QRectF QGraphicsItemPrivate::effectiveBoundingRect(QGraphicsItem *topMostEffectItem) const { #ifndef QT_NO_GRAPHICSEFFECT Q_Q(const QGraphicsItem); + // Take into account the items own effect QRectF brect = effectiveBoundingRect(q_ptr->boundingRect()); - if (ancestorFlags & QGraphicsItemPrivate::AncestorClipsChildren || topMostEffectItem == q) + + if (topMostEffectItem == q) return brect; + // Take into account any effects applied to the parents const QGraphicsItem *effectParent = parent; while (effectParent) { QGraphicsEffect *effect = effectParent->d_ptr->graphicsEffect; @@ -2863,10 +2870,10 @@ QRectF QGraphicsItemPrivate::effectiveBoundingRect(QGraphicsItem *topMostEffectI const QRectF effectRectInParentSpace = effectParent->d_ptr->effectiveBoundingRect(brectInParentSpace); brect = effectParent->mapRectToItem(q, effectRectInParentSpace); } - if (effectParent->d_ptr->ancestorFlags & QGraphicsItemPrivate::AncestorClipsChildren - || topMostEffectItem == effectParent) { + if (effectParent && (effectParent->d_ptr->flags & QGraphicsItem::ItemClipsChildrenToShape)) + return brect.intersected(q->mapRectFromItem(effectParent, effectParent->boundingRect())); + else if (topMostEffectItem == effectParent) return brect; - } effectParent = effectParent->d_ptr->parent; } diff --git a/tests/auto/qgraphicseffect/tst_qgraphicseffect.cpp b/tests/auto/qgraphicseffect/tst_qgraphicseffect.cpp index 9c189cb..3d45a07 100644 --- a/tests/auto/qgraphicseffect/tst_qgraphicseffect.cpp +++ b/tests/auto/qgraphicseffect/tst_qgraphicseffect.cpp @@ -68,6 +68,7 @@ private slots: void boundingRectFor(); void boundingRect(); void boundingRect2(); + void boundingRect3(); void draw(); void opacity(); void grayscale(); @@ -319,6 +320,39 @@ void tst_QGraphicsEffect::boundingRect2() QCOMPARE(effect->boundingRect(), effect->boundingRectFor(childRect | grandChildRect)); } +void tst_QGraphicsEffect::boundingRect3() +{ + QGraphicsScene scene; + QGraphicsRectItem *root = new QGraphicsRectItem; + scene.addItem(root); + QRectF rootRect(0, 0, 100, 100); + root->setFlag(QGraphicsItem::ItemClipsChildrenToShape); + root->setRect(rootRect); + + QGraphicsRectItem *child = new QGraphicsRectItem; + child->setPos(5,5); + child->setParentItem(root); + CustomEffect *effect1 = new CustomEffect; + child->setGraphicsEffect(effect1); + + QGraphicsRectItem *grandChild = new QGraphicsRectItem; + QRectF grandChildRect(0, 0, 50, 50); + grandChild->setRect(grandChildRect); + grandChild->setPos(10,10); + grandChild->setParentItem(child); + CustomEffect *effect2 = new CustomEffect; + grandChild->setGraphicsEffect(effect2); + + QRectF effectiveBoundingRectGrandChild = effect2->boundingRectFor(grandChildRect); + QCOMPARE(effect2->boundingRect(), effectiveBoundingRectGrandChild); + + QRectF effectiveBoundingRectChildAndGrandChild = effect1->boundingRectFor(child->mapRectFromItem(grandChild, effectiveBoundingRectGrandChild)); + QCOMPARE(effect1->boundingRect(),effectiveBoundingRectChildAndGrandChild); + + // The children bounding rect of the root should be the rectangle of the grandChild enlarged twice by the CustomEffect on the grandChild and the child, but clipped by the root item + QCOMPARE(root->childrenBoundingRect(), root->boundingRect().intersected(root->mapRectFromItem(child, effectiveBoundingRectChildAndGrandChild))); +} + void tst_QGraphicsEffect::draw() { QGraphicsScene scene; -- cgit v0.12 From 658bac8782bde1404d4713e5b5e60e3f519457fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Thu, 3 Nov 2011 08:26:59 +0100 Subject: Revert "Correction for effectiveBoundingRect() calculation for QGraphicsItem" This reverts commit 7925f107814e46deb0848d9e6016721ceebfb521. Needed to fix regressed auto-test tst_qgraphicsview::update_ancestorClipsChildrenToShape2. --- src/gui/graphicsview/qgraphicsitem.cpp | 15 +++------- tests/auto/qgraphicseffect/tst_qgraphicseffect.cpp | 34 ---------------------- 2 files changed, 4 insertions(+), 45 deletions(-) diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp index ff21296..73e8eed 100644 --- a/src/gui/graphicsview/qgraphicsitem.cpp +++ b/src/gui/graphicsview/qgraphicsitem.cpp @@ -2845,23 +2845,16 @@ QRectF QGraphicsItemPrivate::effectiveBoundingRect(const QRectF &rect) const If the item has an effect, the effective rect can be larger than the item's bouding rect, depending on the effect. - \a topMostEffectItem is the top most parent of which a possible QGraphicsEffect - should be taken into account (\a topMostEffectItem is inclusive). Any effects - of any ancestors of \a topMostEffectItem are not taken into consideration. - \sa boundingRect() */ QRectF QGraphicsItemPrivate::effectiveBoundingRect(QGraphicsItem *topMostEffectItem) const { #ifndef QT_NO_GRAPHICSEFFECT Q_Q(const QGraphicsItem); - // Take into account the items own effect QRectF brect = effectiveBoundingRect(q_ptr->boundingRect()); - - if (topMostEffectItem == q) + if (ancestorFlags & QGraphicsItemPrivate::AncestorClipsChildren || topMostEffectItem == q) return brect; - // Take into account any effects applied to the parents const QGraphicsItem *effectParent = parent; while (effectParent) { QGraphicsEffect *effect = effectParent->d_ptr->graphicsEffect; @@ -2870,10 +2863,10 @@ QRectF QGraphicsItemPrivate::effectiveBoundingRect(QGraphicsItem *topMostEffectI const QRectF effectRectInParentSpace = effectParent->d_ptr->effectiveBoundingRect(brectInParentSpace); brect = effectParent->mapRectToItem(q, effectRectInParentSpace); } - if (effectParent && (effectParent->d_ptr->flags & QGraphicsItem::ItemClipsChildrenToShape)) - return brect.intersected(q->mapRectFromItem(effectParent, effectParent->boundingRect())); - else if (topMostEffectItem == effectParent) + if (effectParent->d_ptr->ancestorFlags & QGraphicsItemPrivate::AncestorClipsChildren + || topMostEffectItem == effectParent) { return brect; + } effectParent = effectParent->d_ptr->parent; } diff --git a/tests/auto/qgraphicseffect/tst_qgraphicseffect.cpp b/tests/auto/qgraphicseffect/tst_qgraphicseffect.cpp index 3d45a07..9c189cb 100644 --- a/tests/auto/qgraphicseffect/tst_qgraphicseffect.cpp +++ b/tests/auto/qgraphicseffect/tst_qgraphicseffect.cpp @@ -68,7 +68,6 @@ private slots: void boundingRectFor(); void boundingRect(); void boundingRect2(); - void boundingRect3(); void draw(); void opacity(); void grayscale(); @@ -320,39 +319,6 @@ void tst_QGraphicsEffect::boundingRect2() QCOMPARE(effect->boundingRect(), effect->boundingRectFor(childRect | grandChildRect)); } -void tst_QGraphicsEffect::boundingRect3() -{ - QGraphicsScene scene; - QGraphicsRectItem *root = new QGraphicsRectItem; - scene.addItem(root); - QRectF rootRect(0, 0, 100, 100); - root->setFlag(QGraphicsItem::ItemClipsChildrenToShape); - root->setRect(rootRect); - - QGraphicsRectItem *child = new QGraphicsRectItem; - child->setPos(5,5); - child->setParentItem(root); - CustomEffect *effect1 = new CustomEffect; - child->setGraphicsEffect(effect1); - - QGraphicsRectItem *grandChild = new QGraphicsRectItem; - QRectF grandChildRect(0, 0, 50, 50); - grandChild->setRect(grandChildRect); - grandChild->setPos(10,10); - grandChild->setParentItem(child); - CustomEffect *effect2 = new CustomEffect; - grandChild->setGraphicsEffect(effect2); - - QRectF effectiveBoundingRectGrandChild = effect2->boundingRectFor(grandChildRect); - QCOMPARE(effect2->boundingRect(), effectiveBoundingRectGrandChild); - - QRectF effectiveBoundingRectChildAndGrandChild = effect1->boundingRectFor(child->mapRectFromItem(grandChild, effectiveBoundingRectGrandChild)); - QCOMPARE(effect1->boundingRect(),effectiveBoundingRectChildAndGrandChild); - - // The children bounding rect of the root should be the rectangle of the grandChild enlarged twice by the CustomEffect on the grandChild and the child, but clipped by the root item - QCOMPARE(root->childrenBoundingRect(), root->boundingRect().intersected(root->mapRectFromItem(child, effectiveBoundingRectChildAndGrandChild))); -} - void tst_QGraphicsEffect::draw() { QGraphicsScene scene; -- cgit v0.12 From 5778a20b4f6acfa9016258ac05e05a073bbd1994 Mon Sep 17 00:00:00 2001 From: Zeno Albisser Date: Thu, 3 Nov 2011 17:13:03 +0100 Subject: Updated WebKit to 99371ddc1d61832131835964a753e1c5817f6916 --- src/3rdparty/webkit/.tag | 2 +- src/3rdparty/webkit/ChangeLog | 11 ++ src/3rdparty/webkit/Source/WebCore/ChangeLog | 38 ++++ src/3rdparty/webkit/Source/WebCore/WebCore.pri | 4 +- src/3rdparty/webkit/Source/WebCore/WebCore.pro | 5 + .../Source/WebCore/bindings/js/JSExceptionBase.h | 86 +++++----- .../Source/WebCore/platform/win/SystemTimeWin.cpp | 3 + src/3rdparty/webkit/Source/WebKit.pri | 7 + .../webkit/Source/WebKit/qt/Api/qwebpage.cpp | 2 +- src/3rdparty/webkit/Source/WebKit/qt/ChangeLog | 36 ++++ src/3rdparty/webkit/Source/WebKit/qt/QtWebKit.pro | 13 +- .../WebKit/qt/docs/qtwebkit-goes-mobile.qdoc | 191 +++++++++++++++++++++ .../webkit/Source/WebKit/qt/docs/qtwebkit.qdoc | 3 + .../qtwebkit_goes_mobile_snippets.cpp | 61 +++++++ src/3rdparty/webkit/VERSION | 2 +- 15 files changed, 411 insertions(+), 53 deletions(-) create mode 100644 src/3rdparty/webkit/Source/WebKit/qt/docs/qtwebkit-goes-mobile.qdoc create mode 100644 src/3rdparty/webkit/Source/WebKit/qt/docs/webkitsnippets/qtwebkit_goes_mobile_snippets.cpp diff --git a/src/3rdparty/webkit/.tag b/src/3rdparty/webkit/.tag index 34446ae..a5f6423 100644 --- a/src/3rdparty/webkit/.tag +++ b/src/3rdparty/webkit/.tag @@ -1 +1 @@ -64cce100215c71575f19ca0b090c65fa97d4ba10 +99371ddc1d61832131835964a753e1c5817f6916 diff --git a/src/3rdparty/webkit/ChangeLog b/src/3rdparty/webkit/ChangeLog index bc11b4d..a661d6a 100644 --- a/src/3rdparty/webkit/ChangeLog +++ b/src/3rdparty/webkit/ChangeLog @@ -1,3 +1,14 @@ +2011-11-03 Zeno Albisser + + [Qt] Unreviewed: Fix universal binary build on Mac. + https://bugreports.qt.nokia.com/browse/QTBUG-20619 + + When building a universal binary the debug version + exceeds the maximum size of a static library. + Therefore we do not allow this configuration. + + * Source/WebKit.pri: + 2011-08-06 Aron Rosenberg Reviewed by Benjamin Poulain. diff --git a/src/3rdparty/webkit/Source/WebCore/ChangeLog b/src/3rdparty/webkit/Source/WebCore/ChangeLog index da9d1b2..ead97bd 100755 --- a/src/3rdparty/webkit/Source/WebCore/ChangeLog +++ b/src/3rdparty/webkit/Source/WebCore/ChangeLog @@ -1,3 +1,41 @@ +2011-11-01 Zeno Albisser + + [Qt] bad codegen, pointer diff in JSC::JSCallbackConstructor::JSCallbackConstructor + https://bugs.webkit.org/show_bug.cgi?id=60951 + + Adjust symbols visibility for WebCore. + + Reviewed by Simon Hausmann. + + * WebCore.pro: + +2011-10-28 Zeno Albisser + + [Qt] Unreviewed: Build fix for MSVC2005 + + Patch by Andy Shaw + + * platform/win/SystemTimeWin.cpp: + +2011-10-13 Zeno Albisser + + [Qt] QtWebKit build error for Mac 32bit + https://bugs.webkit.org/show_bug.cgi?id=69914 + + In WebCore.pro and QtWebKit.pro we define NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES + when compiling with ENABLE_VIDEO and with WTF_USE_QTKIT. + But this is meant to be defined in NSGeometry.h under certain preconditions. + Without setting NS_BUILD_32_LIKE_64 none of these preconditions is + met and therefore NSGeometry.h will create several conflicting type definitions. + + With this patch we create consistent definitions again. + Due to the order of include files we cannot remove + NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES from WebCore.pro. + + Reviewed by Andreas Kling. + + * WebCore.pro: + 2011-09-12 Adam Klein Fix out-of-bounds access in Gradient::sortStopsIfNecessary diff --git a/src/3rdparty/webkit/Source/WebCore/WebCore.pri b/src/3rdparty/webkit/Source/WebCore/WebCore.pri index d8ba8a6..82311d2 100644 --- a/src/3rdparty/webkit/Source/WebCore/WebCore.pri +++ b/src/3rdparty/webkit/Source/WebCore/WebCore.pri @@ -153,7 +153,7 @@ symbian { CONFIG += do_not_build_as_thumb CONFIG(release, debug|release): QMAKE_CXXFLAGS.ARMCC += -OTime -O3 - # Symbian plugin support. + # Symbian plugin support LIBS += -lefsrv !CONFIG(QTDIR_build) { @@ -303,7 +303,7 @@ win32-* { } # Remove whole program optimizations due to miscompilations -win32-msvc2005|win32-msvc2008|win32-msvc2010|wince*:{ +win32-msvc2005|win32-msvc2008|wince*:{ QMAKE_CFLAGS_RELEASE -= -GL QMAKE_CXXFLAGS_RELEASE -= -GL diff --git a/src/3rdparty/webkit/Source/WebCore/WebCore.pro b/src/3rdparty/webkit/Source/WebCore/WebCore.pro index a305549..ceceee8 100644 --- a/src/3rdparty/webkit/Source/WebCore/WebCore.pro +++ b/src/3rdparty/webkit/Source/WebCore/WebCore.pro @@ -7,6 +7,8 @@ include($$PWD/../WebKit.pri) include($$PWD/WebCore.pri) include($$PWD/../JavaScriptCore/JavaScriptCore.pri) +contains(QT_CONFIG, reduce_exports):CONFIG += hide_symbols + TEMPLATE = lib TARGET = $$WEBCORE_TARGET CONFIG += staticlib @@ -2973,6 +2975,9 @@ contains(DEFINES, ENABLE_VIDEO=1) { platform/mac/WebWindowAnimation.mm DEFINES+=NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES + contains(CONFIG, "x86") { + DEFINES+=NS_BUILD_32_LIKE_64 + } } else: contains(DEFINES, WTF_USE_GSTREAMER=1) { HEADERS += \ diff --git a/src/3rdparty/webkit/Source/WebCore/bindings/js/JSExceptionBase.h b/src/3rdparty/webkit/Source/WebCore/bindings/js/JSExceptionBase.h index a9366ed..01c6ac2 100644 --- a/src/3rdparty/webkit/Source/WebCore/bindings/js/JSExceptionBase.h +++ b/src/3rdparty/webkit/Source/WebCore/bindings/js/JSExceptionBase.h @@ -1,43 +1,43 @@ -/* - * Copyright (C) 2009 Apple Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef JSExceptionBase_h -#define JSExceptionBase_h - -namespace JSC { - -class JSValue; - -} // namespace JSC - -namespace WebCore { - -class ExceptionBase; - -ExceptionBase* toExceptionBase(JSC::JSValue); - -} // namespace WebCore - -#endif // JSExceptionBase_h +/* + * Copyright (C) 2009 Apple Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef JSExceptionBase_h +#define JSExceptionBase_h + +namespace JSC { + +class JSValue; + +} // namespace JSC + +namespace WebCore { + +class ExceptionBase; + +ExceptionBase* toExceptionBase(JSC::JSValue); + +} // namespace WebCore + +#endif // JSExceptionBase_h diff --git a/src/3rdparty/webkit/Source/WebCore/platform/win/SystemTimeWin.cpp b/src/3rdparty/webkit/Source/WebCore/platform/win/SystemTimeWin.cpp index 547decc..c40a45a 100644 --- a/src/3rdparty/webkit/Source/WebCore/platform/win/SystemTimeWin.cpp +++ b/src/3rdparty/webkit/Source/WebCore/platform/win/SystemTimeWin.cpp @@ -27,6 +27,9 @@ #include "SystemTime.h" #include +#ifndef _WIN32_WINNT +#define _WIN32_WINNT 0x0500 +#endif #include namespace WebCore { diff --git a/src/3rdparty/webkit/Source/WebKit.pri b/src/3rdparty/webkit/Source/WebKit.pri index 5bd9577..bc889d1 100644 --- a/src/3rdparty/webkit/Source/WebKit.pri +++ b/src/3rdparty/webkit/Source/WebKit.pri @@ -10,6 +10,13 @@ CONFIG(QTDIR_build) { # Make sure we compile both debug and release on mac when inside Qt. # This line was extracted from qbase.pri instead of including the whole file win32|mac:!macx-xcode:CONFIG += debug_and_release + # In case we are building a universal binary for Qt, building debug is not + # possible because we would exceed the maximum library size for 32bit. + mac:CONFIG(QT_CONFIG, x86):CONFIG(QT_CONFIG, x86_64):debug|debug_and_release { + message(Building a universal binary with debug symbols is not possible. Building release!) + CONFIG -= debug_and_release debug + CONFIG += release + } } else { !CONFIG(release, debug|release) { OBJECTS_DIR = obj/debug diff --git a/src/3rdparty/webkit/Source/WebKit/qt/Api/qwebpage.cpp b/src/3rdparty/webkit/Source/WebKit/qt/Api/qwebpage.cpp index b3efe0f..8f0f153 100644 --- a/src/3rdparty/webkit/Source/WebKit/qt/Api/qwebpage.cpp +++ b/src/3rdparty/webkit/Source/WebKit/qt/Api/qwebpage.cpp @@ -3972,7 +3972,7 @@ quint64 QWebPage::bytesReceived() const } /*! - \since 4.7 + \since 4.8 \fn void QWebPage::viewportChangeRequested() Page authors can provide the supplied values by using the viewport meta tag. More information diff --git a/src/3rdparty/webkit/Source/WebKit/qt/ChangeLog b/src/3rdparty/webkit/Source/WebKit/qt/ChangeLog index 32428f1..7ba98b8 100644 --- a/src/3rdparty/webkit/Source/WebKit/qt/ChangeLog +++ b/src/3rdparty/webkit/Source/WebKit/qt/ChangeLog @@ -1,3 +1,39 @@ +2011-11-03 Jesus Sanchez-Palencia + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] QtWebKit should have documentation clarifying its mobile features usage + https://bugs.webkit.org/show_bug.cgi?id=41465 + + Add "QtWebKit Goes Mobile" documentation + + * docs/qtwebkit-goes-mobile.qdoc: Added. + * docs/qtwebkit.qdoc: Linked to qtwebkit-goes-mobile documentation + * docs/webkitsnippets/qtwebkit_goes_mobile_snippets.cpp: Added. + +2011-11-01 Alexis Menard + + Unreviewed Qt documentation fix. + + This signal is Qt 4.8 material. + + * Api/qwebpage.cpp: + +2011-10-21 Zeno Albisser + + [Qt] WebKit build does not respect QMAKE_MAC_SDK variable. + https://bugs.webkit.org/show_bug.cgi?id=70596 + + Instead of only relying on DARWIN_MAJOR_VERSION we also + check QMAKE_MAC_SDK. In case QMAKE_MAC_SDK is not defined + we are still falling back to DARWIN_MAJOR_VERSION. + + Patch by Andy Shaw + + Reviewed by Noam Rosenthal. + + * QtWebKit.pro: + 2011-09-06 Ademar de Souza Reis Jr. [Qt][Symbian] REGRESSION[94105] DumpRenderTree.exe doesn't build on Symbian diff --git a/src/3rdparty/webkit/Source/WebKit/qt/QtWebKit.pro b/src/3rdparty/webkit/Source/WebKit/qt/QtWebKit.pro index 41b0d39..197aa98 100644 --- a/src/3rdparty/webkit/Source/WebKit/qt/QtWebKit.pro +++ b/src/3rdparty/webkit/Source/WebKit/qt/QtWebKit.pro @@ -233,6 +233,9 @@ contains(DEFINES, ENABLE_VIDEO=1) { $$SOURCE_DIR/../WebKitLibraries/ DEFINES+=NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES + contains(CONFIG, "x86") { + DEFINES+=NS_BUILD_32_LIKE_64 + } HEADERS += $$PWD/WebCoreSupport/WebSystemInterface.h \ $$PWD/WebCoreSupport/QTKitFullScreenVideoHandler.h @@ -244,12 +247,12 @@ contains(DEFINES, ENABLE_VIDEO=1) { # We can know the Mac OS version by using the Darwin major version DARWIN_VERSION = $$split(QMAKE_HOST.version, ".") DARWIN_MAJOR_VERSION = $$first(DARWIN_VERSION) - equals(DARWIN_MAJOR_VERSION, "11") { - LIBS += $$SOURCE_DIR/../WebKitLibraries/libWebKitSystemInterfaceLion.a - } else:equals(DARWIN_MAJOR_VERSION, "10") { - LIBS += $$SOURCE_DIR/../WebKitLibraries/libWebKitSystemInterfaceSnowLeopard.a - } else:equals(DARWIN_MAJOR_VERSION, "9") { + equals(DARWIN_MAJOR_VERSION, "9") | contains(QMAKE_MAC_SDK, "/Developer/SDKs/MacOSX10.5.sdk") { LIBS += $$SOURCE_DIR/../WebKitLibraries/libWebKitSystemInterfaceLeopard.a + } else: equals(DARWIN_MAJOR_VERSION, "10") | contains(QMAKE_MAC_SDK, "/Developer/SDKs/MacOSX10.6.sdk") { + LIBS += $$SOURCE_DIR/../WebKitLibraries/libWebKitSystemInterfaceSnowLeopard.a + } else: equals(DARWIN_MAJOR_VERSION, "11") | contains(QMAKE_MAC_SDK, "/Developer/SDKs/MacOSX10.7.sdk") { + LIBS += $$SOURCE_DIR/../WebKitLibraries/libWebKitSystemInterfaceLion.a } } } diff --git a/src/3rdparty/webkit/Source/WebKit/qt/docs/qtwebkit-goes-mobile.qdoc b/src/3rdparty/webkit/Source/WebKit/qt/docs/qtwebkit-goes-mobile.qdoc new file mode 100644 index 0000000..40144d1 --- /dev/null +++ b/src/3rdparty/webkit/Source/WebKit/qt/docs/qtwebkit-goes-mobile.qdoc @@ -0,0 +1,191 @@ +/*! + \inmodule QtWebKit + \page qtwebkit-goes-mobile.html + \title QtWebKit Goes Mobile + \contentspage QtWebKit + \section1 Overview + + A lot of effort has been put into QtWebKit to make it attractive for + use on mobile devices. + + The goal of this tutorial is to help you understand the mobile + features and how to make the best of them, in other words, how to + create a good mobile web view that can be used on touch devices. + + If you want to target mobile devices you should consider using \l{QGraphicsWebView} + instead of \l{QWebView}. Since \l{QWebView} is based on the \l{QWidget} + system, it cannot easily support rotation, overlays, hardware accelerated + compositing and tiling. If you need a \l{QWidget} anyway, you can always + construct a \l{QGraphicsView} (which is a \l{QWidget}) with a \l{QGraphicsWebView} inside. + + So let's start with a very simple \l{QGraphicsWebView} based "browser": + + \snippet webkitsnippets/qtwebkit_goes_mobile_snippets.cpp 0 + + Here we set up a \l{QGraphicsView} application and add a + \l{QGraphicsWebView} to the scene. Notice + that we're disabling the scrollbars on the QGraphicsView because QtWebKit + handles scrolling and scrollbars automatically. This is to allow scrolling + optimizations and to enable web authors to interact with the scrollbars, + for instance, to style them differently. + + On touch-based mobile devices a feature known as tiling is often used. It + is used due to the interaction model (touch) as well as a scrolling + optimization. With this optimization we will have to deal with scrolling + ourselves, and we will have to disable features like scroll bar styling. + This is not usually a problem, since mobile browsers do not usually show + scroll bars, but use scroll indicators instead. + + Tiling basically means that the contents of the viewport is separated into + a grid of tiles, so that when you update an area, instead of just updating + the area, you actually update the whole tile or sub-regions of it. + This offers a few advantages for scrolling as, when you scroll, you do not need + to repaint the new visible area for each scroll step, but you simply update a row + of tiles each time; these tiles are often only partly on the screen. + This minimizes all the painting calls that we have to do and enables kinetic scrolling. + + Loading, rendering, and laying out are blocking operations. Though barely + noticeable on desktop machines, these operations can block for a long time + on a mobile device, letting the user believe the application has become + unresponsive. Additionally, scrolling will also stall when the user uses + his fingers to scroll, leading to a bad user experience. + + One way to overcome this issue, is to do all loading, laying out and + painting (basically all non-UI related work) in another thread or process, and + just blit the result from the web process/thread to the UI. There is research + in progress to enable this for a future version of QtWebKit, using WebKit2, but for now, + freezing the backing store can help when performing a zooming operation, for instance. + This will be discussed later, in the \l{#Enabling the Tiling}{Enabling the Tiling} section. + + When using tiles, you can blit any tile available when scrolling. When no tile is available you + can show a checkerboard tile instead, not letting the scrolling wait for the + tiles to be updated. This results in a responsive interface, with the only + disadvantage that you might see checkerboard tiles from time to time. + + The use of tiles also helps with zooming. Repainting at each zoom level change during + a zoom animation is basically impossible on a mobile device (or desktop for + that matter) and thus, with tiling, you can stop the tiles from being updated and + just scale the existing tiles. Then, at the end of the animation, update + tiles on top of the scaled ones. For now we will ignore the blocking + issue and concentrate on the tiling and the interaction model. + More information about Tiling can be found here: \l{http://doc.qt.nokia.com/4.7/qwebsettings.html#WebAttribute-enum} (see the entry for TiledBackingStoreEnabled). + + + \section1 Resize to Contents + + When using tiling, we want the \l{QGraphicsWebView} to act as our + content, as it supports tiling. In order for this we need to make it + resize itself to the size of its contents. For this we will use + \l{QGraphicsWebView::resizesToContents}. + + This setting removes the scroll bars for us on the main frame and + makes our \l{QGraphicsWebView} resize itself to the size of its content. + + Enabling it is as easy as setting the property: + + \snippet webkitsnippets/qtwebkit_goes_mobile_snippets.cpp 1 + + The property should be used in conjunction with the + QWebPage::preferredContentsSize property. If not explicitly set, + it is automatically set to a reasonable value. + + If we expand our mobile web view to the size of the contents + of its contained page, the view will be bigger than the device screen. + + + \section1 Using a View as the Window onto the Contents + + The idea is to have a custom widget which has a \l{QGraphicsWebView} as a + class member. Remember that the QGraphicsWebView will be as big as its + content's size, so this custom widget will serve as a viewport onto the + web view. + + The following code snippet illustrates this: + + \snippet webkitsnippets/qtwebkit_goes_mobile_snippets.cpp 2 + + In order to properly handle mouse events, you must install an event filter + on the web view or stack it behind its parent object + (\l{QGraphicsItem::ItemStacksBehindParent}). By doing this the mouse events will + reach a \c{MobileWebView} instance before they reach the member + \l{QGraphicsWebView}. Keep in mind that you'll need to add some logic in order + to distinguish between different mouse events and gestures, such as a + single click, double click and click-and-pan. Besides, scrolling and + zooming will have to be implemented manually. + + + \section1 Adjusting How Contents are Laid Out + + When testing the above on a device, you will notice that many pages are not + laid out very nicely. In particular, the width of the content may be larger + than the width of the device. This is due to the way web contents are laid + out. First, the viewport width is used for fitting the contents. If the + contents do not fit due to a non-flexible element with a width larger than + the viewport width, the minimum possible width will be used. As most pages + are written with a desktop browser in mind, that makes only very few sites + fit into the width of a mobile device. + + QtWebKit has a way to force a layout to a given width or height. What really + matters here is the width. If you lay out a page to a given width, it will get + that width and images might be cropped. The width or height is also used for + laying out fixed elements, but when we resize the \l{QGraphicsWebView} to the + size of the contents, fixed elements will not be relative to the view, which is + the behavior found on most mobile browsers. + + We saw that the QWebPage::preferredContentsSize property is automatically set + to a reasonable value when using \l{QGraphicsWebView::resizesToContents}. + + As you can imagine, laying out with a smaller viewport can cause pages to + break, therefore a default value has been chosen so that it almost breaks no + pages while still making pages fit. This value is 960x800. If the device + has a greater resolution, this value can be changed like this: + + \snippet webkitsnippets/qtwebkit_goes_mobile_snippets.cpp 3 + + You can play around with this and find a suitable size for your device, + but we will keep the default size for now. + + + \section1 The 'viewport' Meta-Tag + + As some sites do not work with 960 pixels width or want to have control of + how the page is laid out, QtWebKit, Android, Firefox Mobile and + the iPhone Safari browser support a meta-tag called \c viewport. This makes + it possible for a web page to let the browser know how it wants to be shown. + More info can be found in the + \l{http://developer.apple.com/safari/library/documentation/appleapplications/reference/safariwebcontent/usingtheviewport/usingtheviewport.html}{Safari Developer Library}. + + You must connect the signal \c{QWebPage::viewportChangeRequested(const + QWebPage::ViewportHints& hints)} to a slot of your mobile web view and use what + is provided by \l{QWebPage::ViewportHints} to update your viewport size, scale + range, and so on. + + + \section1 Enabling the Tiling + + We haven't actually enabled tiling yet, so let's go ahead and do that. That + is very simple as it is basically a setting: + + \snippet webkitsnippets/qtwebkit_goes_mobile_snippets.cpp 4 + + Note that, if you are going to add animations to your zooming or scaling + operations or want to implement fancy kinetic scrolling you might want to + take a look at \l{QGraphicsWebView::setTiledBackingStoreFrozen()}. With this, + you can avoid updates to your tiles during an animation, for instance. + + + \section1 Avoiding Scrollable Subelements + + One big issue with the above is that, iframes and sites using frames can + contain scrollable subelements. That doesn't work well with the touch + interaction model, as you want a finger swipe to scroll the whole page and not + end up just scrolling a subframe. Most mobile browsers work around this by + enabling something called frame flattening. Going straight to the point: + + \snippet webkitsnippets/qtwebkit_goes_mobile_snippets.cpp 5 + + This will make all frames from a web page expand themselves to the size of + their contents, keeping us free of scrollable subareas. + + +*/ diff --git a/src/3rdparty/webkit/Source/WebKit/qt/docs/qtwebkit.qdoc b/src/3rdparty/webkit/Source/WebKit/qt/docs/qtwebkit.qdoc index 1e76901..710d194 100644 --- a/src/3rdparty/webkit/Source/WebKit/qt/docs/qtwebkit.qdoc +++ b/src/3rdparty/webkit/Source/WebKit/qt/docs/qtwebkit.qdoc @@ -29,6 +29,9 @@ made fully editable to the user through the use of the \c{contenteditable} attribute on HTML elements. + QtWebKit has been enhanced to become more attractive on the mobile front as well. + For more information see \l{QtWebKit Goes Mobile}. + QtWebKit is based on the Open Source WebKit engine. More information about WebKit itself can be found on the \l{WebKit Open Source Project} Web site. diff --git a/src/3rdparty/webkit/Source/WebKit/qt/docs/webkitsnippets/qtwebkit_goes_mobile_snippets.cpp b/src/3rdparty/webkit/Source/WebKit/qt/docs/webkitsnippets/qtwebkit_goes_mobile_snippets.cpp new file mode 100644 index 0000000..8126fbf --- /dev/null +++ b/src/3rdparty/webkit/Source/WebKit/qt/docs/webkitsnippets/qtwebkit_goes_mobile_snippets.cpp @@ -0,0 +1,61 @@ +#if 0 +// ! [0] +int main(int argc, char **argv) +{ + QApplication app(argc, argv); + const int width = 640; + const int height = 480; + + QGraphicsScene scene; + + QGraphicsView view(&scene); + view.setFrameShape(QFrame::NoFrame); + view.setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); + view.setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); + + QGraphicsWebView webview; + webview.resize(width, height); + webview.load(QUrl("http://doc.qt.nokia.com/")); + + scene.addItem(&webview); + + view.resize(width, height); + view.show(); + + return app.exec(); +} +// ! [0] + + +// ! [1] +webview.setResizesToContents(true); +// ! [1] + +// ! [2] +class MobileWebView : public QGraphicsWidget { + Q_OBJECT +public: + MobileWebView(QGraphicsItem *parent = 0); + ~MobileWebView(); + + bool mousePress(const QPoint &value); + void mouseMove(const QPoint &value); + void mouseRelease(const QPoint &value); + +private: + QGraphicsWebView* webView; +}; +// ! [2] + +// ! [3] +webview.page()->setPreferredContentsSize(QSize(desiredWidth, desiredHeight)); +// ! [3] + +// ! [4] +QWebSettings::globalSettings()->setAttribute(QWebSettings::TiledBackingStoreEnabled, true); +// ! [4] + +// ! [5] +QWebSettings::globalSettings()->setAttribute(QWebSettings::FrameFlatteningEnable, true); +// ! [5] +#endif diff --git a/src/3rdparty/webkit/VERSION b/src/3rdparty/webkit/VERSION index 6a40345..19f5536 100644 --- a/src/3rdparty/webkit/VERSION +++ b/src/3rdparty/webkit/VERSION @@ -4,4 +4,4 @@ This is a snapshot of the Qt port of WebKit from and has the sha1 checksum - 64cce100215c71575f19ca0b090c65fa97d4ba10 + 99371ddc1d61832131835964a753e1c5817f6916 -- cgit v0.12 From 945c44d0865cf44363e6c860995f971ce952dd5f Mon Sep 17 00:00:00 2001 From: Ademar de Souza Reis Jr Date: Mon, 19 Sep 2011 10:43:14 -0300 Subject: Re-apply change 3dd9e66baaa0848bcc2eb7daecf2b63724624358 by Ademar de Souza Reis Jr dos2unix on a webkit source file (fix support for Visual Studio) webkit/Source/WebCore/bindings/js/JSExceptionBase.h had CRLF terminations, which Visual Studio didn't like for some reason. Reported by Simo Falt. Patch is also being submited to upstream (webkit.org) --- .../Source/WebCore/bindings/js/JSExceptionBase.h | 86 +++++++++++----------- 1 file changed, 43 insertions(+), 43 deletions(-) diff --git a/src/3rdparty/webkit/Source/WebCore/bindings/js/JSExceptionBase.h b/src/3rdparty/webkit/Source/WebCore/bindings/js/JSExceptionBase.h index 01c6ac2..7713002 100644 --- a/src/3rdparty/webkit/Source/WebCore/bindings/js/JSExceptionBase.h +++ b/src/3rdparty/webkit/Source/WebCore/bindings/js/JSExceptionBase.h @@ -1,43 +1,43 @@ -/* - * Copyright (C) 2009 Apple Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef JSExceptionBase_h -#define JSExceptionBase_h - -namespace JSC { - -class JSValue; - -} // namespace JSC - -namespace WebCore { - -class ExceptionBase; - -ExceptionBase* toExceptionBase(JSC::JSValue); - -} // namespace WebCore - -#endif // JSExceptionBase_h +/* + * Copyright (C) 2009 Apple Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef JSExceptionBase_h +#define JSExceptionBase_h + +namespace JSC { + +class JSValue; + +} // namespace JSC + +namespace WebCore { + +class ExceptionBase; + +ExceptionBase* toExceptionBase(JSC::JSValue); + +} // namespace WebCore + +#endif // JSExceptionBase_h -- cgit v0.12 From 37cde52cb17b57f8ec89c248f06331ed4977e51c Mon Sep 17 00:00:00 2001 From: Ademar de Souza Reis Jr Date: Tue, 20 Sep 2011 11:12:04 -0300 Subject: Re-apply change 3489808c1dcd157ac09dd6da16bc057b56696d59 by Ademar de Souza Reis Jr Workaround MSVC2010 problems when linking QtWebKit Include MSVC2010 in the list of compilers where incremental build is disabled (INCREMENTAL:NO). Change suggested by Simo Falt --- src/3rdparty/webkit/Source/WebCore/WebCore.pri | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/3rdparty/webkit/Source/WebCore/WebCore.pri b/src/3rdparty/webkit/Source/WebCore/WebCore.pri index 82311d2..00357a1 100644 --- a/src/3rdparty/webkit/Source/WebCore/WebCore.pri +++ b/src/3rdparty/webkit/Source/WebCore/WebCore.pri @@ -303,7 +303,7 @@ win32-* { } # Remove whole program optimizations due to miscompilations -win32-msvc2005|win32-msvc2008|wince*:{ +win32-msvc2005|win32-msvc2008|win32-msvc2010|wince*:{ QMAKE_CFLAGS_RELEASE -= -GL QMAKE_CXXFLAGS_RELEASE -= -GL -- cgit v0.12 From e3208a8d44423bc3b5c32e2e90f68675e51a3b73 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Thu, 22 Sep 2011 14:48:44 +0200 Subject: Re-apply change a14033620fab5edca44293ec6dfcc904e2e0eb20 by Andreas Kling Sentences should end with a period! (Poor man's rebuild trigger.) --- src/3rdparty/webkit/Source/WebCore/WebCore.pri | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/3rdparty/webkit/Source/WebCore/WebCore.pri b/src/3rdparty/webkit/Source/WebCore/WebCore.pri index 00357a1..d8ba8a6 100644 --- a/src/3rdparty/webkit/Source/WebCore/WebCore.pri +++ b/src/3rdparty/webkit/Source/WebCore/WebCore.pri @@ -153,7 +153,7 @@ symbian { CONFIG += do_not_build_as_thumb CONFIG(release, debug|release): QMAKE_CXXFLAGS.ARMCC += -OTime -O3 - # Symbian plugin support + # Symbian plugin support. LIBS += -lefsrv !CONFIG(QTDIR_build) { -- cgit v0.12 From bc874b5a7158309b8c5469f64f015d739fd3b610 Mon Sep 17 00:00:00 2001 From: Jani Hautakangas Date: Thu, 3 Nov 2011 20:48:01 +0200 Subject: Add GL_EXT_texture_format_BGRA8888 support. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit QtOpenGL supports GL_IMG_texture_format_BGRA8888 but GL_EXT_texture_format_BGRA8888 is missing. These extensions are essentially the same. Task-number: QTBUG-22538 Reviewed-by: Samuel Rødal --- src/opengl/qgl.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp index 08b9ca3..db3a7ac 100644 --- a/src/opengl/qgl.cpp +++ b/src/opengl/qgl.cpp @@ -5499,7 +5499,8 @@ QGLExtensions::Extensions QGLExtensions::currentContextExtensions() glExtensions |= NVFloatBuffer; if (extensions.match("GL_ARB_pixel_buffer_object")) glExtensions |= PixelBufferObject; - if (extensions.match("GL_IMG_texture_format_BGRA8888")) + if (extensions.match("GL_IMG_texture_format_BGRA8888") + || extensions.match("GL_EXT_texture_format_BGRA8888")) glExtensions |= BGRATextureFormat; #if defined(QT_OPENGL_ES_2) glExtensions |= FramebufferObject; -- cgit v0.12 From f92483c3922763a5f5d1500f4892be8b214fe299 Mon Sep 17 00:00:00 2001 From: Jani Hautakangas Date: Thu, 3 Nov 2011 20:51:51 +0200 Subject: Clear error due to FRAMEBUFFER_SRGB_CAPABLE_EXT glGetBooleanv generates an error if this param isn't supported. This error generates wrong warnings in later states. Reviewed-by: Eskil --- src/opengl/qgl.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp index db3a7ac..2fc3dea 100644 --- a/src/opengl/qgl.cpp +++ b/src/opengl/qgl.cpp @@ -5541,6 +5541,9 @@ QGLExtensions::Extensions QGLExtensions::currentContextExtensions() glGetBooleanv(FRAMEBUFFER_SRGB_CAPABLE_EXT, &srgbCapableFramebuffers); if (srgbCapableFramebuffers) glExtensions |= SRGBFrameBuffer; + // Clear possible error which is generated if + // FRAMEBUFFER_SRGB_CAPABLE_EXT isn't supported. + glGetError(); } return glExtensions; -- cgit v0.12