summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMichael Brasser <michael.brasser@nokia.com>2009-08-31 00:16:40 (GMT)
committerMichael Brasser <michael.brasser@nokia.com>2009-08-31 00:16:40 (GMT)
commit9dade8d2e57655019ed4dc2fcdc4e226401138a2 (patch)
tree6aa3520f525b2ab923b4238079f1012756fa2488 /src
parente1dd37f6b54881aef3b9e1e686dc56bb96fc14ed (diff)
parentd23863952b0c13ccd8b2989d24153d94b3d3f83d (diff)
downloadQt-9dade8d2e57655019ed4dc2fcdc4e226401138a2.zip
Qt-9dade8d2e57655019ed4dc2fcdc4e226401138a2.tar.gz
Qt-9dade8d2e57655019ed4dc2fcdc4e226401138a2.tar.bz2
Merge branch '4.6' of git@scm.dev.nokia.troll.no:qt/qt into kinetic-declarativeui
Conflicts: src/gui/graphicsview/qgraphicsitem.cpp src/gui/graphicsview/qgraphicsitem.h src/gui/graphicsview/qgraphicsitem_p.h src/gui/graphicsview/qgraphicsscene.cpp
Diffstat (limited to 'src')
-rw-r--r--src/3rdparty/phonon/ds9/backend.h2
-rw-r--r--src/3rdparty/phonon/ds9/mediaobject.cpp2
-rw-r--r--src/3rdparty/webkit/JavaScriptCore/jit/JITOpcodes.cpp1
-rw-r--r--src/3rdparty/webkit/JavaScriptCore/jit/JITStubs.cpp8
-rw-r--r--src/activeqt/container/qaxwidget.cpp7
-rw-r--r--src/corelib/animation/qabstractanimation.cpp58
-rw-r--r--src/corelib/animation/qabstractanimation_p.h1
-rw-r--r--src/corelib/animation/qpropertyanimation.cpp78
-rw-r--r--src/corelib/animation/qpropertyanimation.h1
-rw-r--r--src/corelib/animation/qpropertyanimation_p.h11
-rw-r--r--src/corelib/animation/qvariantanimation_p.h6
-rw-r--r--src/corelib/global/qglobal.cpp6
-rw-r--r--src/corelib/global/qglobal.h13
-rw-r--r--src/corelib/global/qnamespace.qdoc5
-rw-r--r--src/corelib/global/qt_windows.h7
-rw-r--r--src/corelib/io/qfsfileengine_unix.cpp129
-rw-r--r--src/corelib/io/qfsfileengine_win.cpp5
-rw-r--r--src/corelib/io/qprocess.cpp3
-rw-r--r--src/corelib/io/qsettings.cpp22
-rw-r--r--src/corelib/io/qtemporaryfile.cpp4
-rw-r--r--src/corelib/kernel/qabstractitemmodel.cpp423
-rw-r--r--src/corelib/kernel/qabstractitemmodel.h16
-rw-r--r--src/corelib/kernel/qabstractitemmodel_p.h7
-rw-r--r--src/corelib/kernel/qcore_symbian_p.cpp4
-rw-r--r--src/corelib/kernel/qcoreapplication.cpp88
-rw-r--r--src/corelib/kernel/qmetaobject.cpp12
-rw-r--r--src/corelib/kernel/qmetaobject_p.h7
-rw-r--r--src/corelib/kernel/qobject.cpp163
-rw-r--r--src/corelib/kernel/qobject.h4
-rw-r--r--src/corelib/kernel/qobjectdefs.h8
-rw-r--r--src/corelib/statemachine/qabstracttransition_p.h2
-rw-r--r--src/corelib/statemachine/qsignalevent.h2
-rw-r--r--src/corelib/statemachine/qsignaltransition.cpp17
-rw-r--r--src/corelib/statemachine/qsignaltransition_p.h3
-rw-r--r--src/corelib/statemachine/qstatemachine.cpp7
-rw-r--r--src/corelib/thread/qthread_win.cpp4
-rw-r--r--src/corelib/tools/qlocale_symbian.cpp8
-rw-r--r--src/corelib/tools/qscopedpointer.cpp4
-rw-r--r--src/corelib/tools/qsharedpointer_impl.h2
-rw-r--r--src/corelib/tools/qstringbuilder.h6
-rw-r--r--src/gui/accessible/qaccessible_mac_cocoa.mm13
-rw-r--r--src/gui/effects/qgraphicseffect.cpp469
-rw-r--r--src/gui/effects/qgraphicseffect.h5
-rw-r--r--src/gui/effects/qgraphicseffect_p.h7
-rw-r--r--src/gui/embedded/qkbd_defaultmap_qws_p.h2
-rw-r--r--src/gui/embedded/qkbd_qws_p.h4
-rw-r--r--src/gui/embedded/qkbdqnx_qws.cpp5
-rw-r--r--src/gui/embedded/qlock.cpp11
-rw-r--r--src/gui/embedded/qmousetslib_qws.h2
-rw-r--r--src/gui/embedded/qscreen_qws.h4
-rw-r--r--src/gui/embedded/qscreenlinuxfb_qws.cpp6
-rw-r--r--src/gui/embedded/qscreenlinuxfb_qws.h8
-rw-r--r--src/gui/embedded/qscreenproxy_qws.cpp3
-rw-r--r--src/gui/embedded/qscreenqnx_qws.cpp3
-rw-r--r--src/gui/embedded/qsoundqss_qws.cpp4
-rw-r--r--src/gui/embedded/qwsutils_qws.h12
-rw-r--r--src/gui/graphicsview/qgraphicsanchorlayout.cpp45
-rw-r--r--src/gui/graphicsview/qgraphicsanchorlayout_p.cpp2
-rw-r--r--src/gui/graphicsview/qgraphicsitem.cpp124
-rw-r--r--src/gui/graphicsview/qgraphicsitem.h6
-rw-r--r--src/gui/graphicsview/qgraphicsitem_p.h10
-rw-r--r--src/gui/graphicsview/qgraphicslayout.cpp4
-rw-r--r--src/gui/graphicsview/qgraphicslayout_p.h4
-rw-r--r--src/gui/graphicsview/qgraphicslayoutitem_p.h4
-rw-r--r--src/gui/graphicsview/qgraphicslinearlayout.cpp3
-rw-r--r--src/gui/graphicsview/qgraphicsproxywidget_p.h4
-rw-r--r--src/gui/graphicsview/qgraphicsscene.cpp250
-rw-r--r--src/gui/graphicsview/qgraphicsscene.h3
-rw-r--r--src/gui/graphicsview/qgraphicsscene_p.h7
-rw-r--r--src/gui/graphicsview/qgraphicsscenebsptreeindex_p.h4
-rw-r--r--src/gui/graphicsview/qgraphicssceneevent.cpp8
-rw-r--r--src/gui/graphicsview/qgraphicssceneindex_p.h4
-rw-r--r--src/gui/graphicsview/qgraphicstransform_p.h4
-rw-r--r--src/gui/graphicsview/qgraphicsview_p.h4
-rw-r--r--src/gui/graphicsview/qgraphicswidget.cpp19
-rw-r--r--src/gui/graphicsview/qgraphicswidget_p.h4
-rw-r--r--src/gui/graphicsview/qgridlayoutengine.cpp22
-rw-r--r--src/gui/graphicsview/qgridlayoutengine_p.h4
-rw-r--r--src/gui/graphicsview/qsimplex_p.cpp2
-rw-r--r--src/gui/image/qpixmap.cpp2
-rw-r--r--src/gui/image/qpixmap_qws.cpp5
-rw-r--r--src/gui/image/qpixmapfilter.cpp4
-rw-r--r--src/gui/inputmethod/qinputcontext.cpp39
-rw-r--r--src/gui/inputmethod/qwininputcontext_p.h1
-rw-r--r--src/gui/inputmethod/qwininputcontext_win.cpp49
-rw-r--r--src/gui/inputmethod/qwsinputcontext_qws.cpp16
-rw-r--r--src/gui/itemviews/qabstractitemview.cpp3
-rw-r--r--src/gui/itemviews/qsortfilterproxymodel.cpp11
-rw-r--r--src/gui/itemviews/qsortfilterproxymodel.h1
-rw-r--r--src/gui/kernel/qapplication_p.h5
-rw-r--r--src/gui/kernel/qapplication_qws.cpp9
-rw-r--r--src/gui/kernel/qapplication_win.cpp25
-rw-r--r--src/gui/kernel/qcocoaview_mac.mm11
-rw-r--r--src/gui/kernel/qcocoaview_mac_p.h1
-rw-r--r--src/gui/kernel/qevent.cpp68
-rw-r--r--src/gui/kernel/qevent_p.h2
-rw-r--r--src/gui/kernel/qmime_mac.cpp13
-rw-r--r--src/gui/kernel/qsound_qws.cpp4
-rw-r--r--src/gui/kernel/qstandardgestures.cpp231
-rw-r--r--src/gui/kernel/qstandardgestures.h48
-rw-r--r--src/gui/kernel/qstandardgestures_p.h39
-rw-r--r--src/gui/kernel/qwidget.cpp35
-rw-r--r--src/gui/kernel/qwidget_mac.mm11
-rw-r--r--src/gui/math3d/qmatrix4x4.cpp2
-rw-r--r--src/gui/painting/qbackingstore.cpp3
-rw-r--r--src/gui/painting/qpaintengine_raster.cpp2
-rw-r--r--src/gui/painting/qpaintengineex_p.h3
-rw-r--r--src/gui/painting/qpainter.cpp42
-rw-r--r--src/gui/painting/qpainter.h3
-rw-r--r--src/gui/styles/images/defaults60theme.blobbin0 -> 74127 bytes
-rw-r--r--src/gui/styles/qcommonstyle.cpp167
-rw-r--r--src/gui/styles/qcommonstyle_p.h3
-rw-r--r--src/gui/styles/qmacstyle_mac.mm13
-rw-r--r--src/gui/styles/qs60style.cpp192
-rw-r--r--src/gui/styles/qs60style.h2
-rw-r--r--src/gui/styles/qs60style_p.h6
-rw-r--r--src/gui/styles/qs60style_s60.cpp3
-rw-r--r--src/gui/styles/qs60style_simulated.cpp3
-rw-r--r--src/gui/styles/qstyle_s60_simulated.qrc2
-rw-r--r--src/gui/styles/qstylesheetstyle.cpp26
-rw-r--r--src/gui/styles/styles.pri3
-rw-r--r--src/gui/text/qfontdatabase_s60.cpp11
-rw-r--r--src/gui/text/qfontengine_qpf.cpp3
-rw-r--r--src/gui/text/qfontengine_s60.cpp9
-rw-r--r--src/gui/text/qfontengine_s60_p.h4
-rw-r--r--src/gui/text/qfontengine_win.cpp4
-rw-r--r--src/gui/util/qsystemtrayicon_win.cpp9
-rw-r--r--src/gui/widgets/qabstractscrollarea.cpp2
-rw-r--r--src/gui/widgets/qcocoatoolbardelegate_mac.mm6
-rw-r--r--src/gui/widgets/qlinecontrol_p.h2
-rw-r--r--src/gui/widgets/qlineedit.cpp6
-rw-r--r--src/gui/widgets/qlineedit.h1
-rw-r--r--src/gui/widgets/qlineedit_p.cpp8
-rw-r--r--src/gui/widgets/qlineedit_p.h2
-rw-r--r--src/gui/widgets/qmenu.cpp2
-rw-r--r--src/gui/widgets/qmenu_mac.mm13
-rw-r--r--src/gui/widgets/qplaintextedit.cpp4
-rw-r--r--src/gui/widgets/qtabbar.cpp16
-rw-r--r--src/gui/widgets/qtoolbar.cpp2
-rw-r--r--src/gui/widgets/qtoolbarlayout.cpp4
-rw-r--r--src/gui/widgets/qtoolbarlayout_p.h4
-rw-r--r--src/multimedia/audio/qaudiodeviceinfo_alsa_p.cpp4
-rw-r--r--src/multimedia/audio/qaudiodeviceinfo_alsa_p.h4
-rw-r--r--src/multimedia/audio/qaudiodeviceinfo_win32_p.cpp3
-rw-r--r--src/multimedia/audio/qaudiodeviceinfo_win32_p.h4
-rw-r--r--src/multimedia/audio/qaudioinput_alsa_p.cpp3
-rw-r--r--src/multimedia/audio/qaudioinput_alsa_p.h4
-rw-r--r--src/multimedia/audio/qaudioinput_win32_p.cpp3
-rw-r--r--src/multimedia/audio/qaudioinput_win32_p.h4
-rw-r--r--src/multimedia/audio/qaudiooutput_alsa_p.cpp4
-rw-r--r--src/multimedia/audio/qaudiooutput_alsa_p.h4
-rw-r--r--src/multimedia/audio/qaudiooutput_win32_p.cpp4
-rw-r--r--src/multimedia/audio/qaudiooutput_win32_p.h4
-rw-r--r--src/multimedia/video/qimagevideobuffer.cpp4
-rw-r--r--src/network/access/qhttpnetworkconnection.cpp32
-rw-r--r--src/network/access/qhttpnetworkconnection_p.h4
-rw-r--r--src/network/access/qhttpnetworkconnectionchannel.cpp32
-rw-r--r--src/network/access/qhttpnetworkconnectionchannel_p.h5
-rw-r--r--src/network/access/qhttpnetworkreply.cpp16
-rw-r--r--src/network/access/qhttpnetworkreply_p.h3
-rw-r--r--src/network/access/qnetworkaccesshttpbackend.cpp6
-rw-r--r--src/network/ssl/qsslsocket.cpp6
-rw-r--r--src/opengl/gl2paintengineex/qgl2pexvertexarray.cpp2
-rw-r--r--src/opengl/gl2paintengineex/qglengineshadermanager_p.h2
-rw-r--r--src/opengl/gl2paintengineex/qglengineshadersource_p.h51
-rw-r--r--src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp139
-rw-r--r--src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h13
-rw-r--r--src/opengl/qgl.cpp338
-rw-r--r--src/opengl/qgl.h38
-rw-r--r--src/opengl/qgl_p.h33
-rw-r--r--src/opengl/qgl_x11.cpp13
-rw-r--r--src/opengl/qgl_x11egl.cpp10
-rw-r--r--src/opengl/qglextensions_p.h8
-rw-r--r--src/opengl/qglframebufferobject.cpp10
-rw-r--r--src/opengl/qglpixmapfilter.cpp5
-rw-r--r--src/opengl/qglshaderprogram.cpp101
-rw-r--r--src/opengl/qglshaderprogram.h20
-rw-r--r--src/opengl/qgraphicsshadereffect.cpp16
-rw-r--r--src/opengl/qgraphicsshadereffect.h4
-rw-r--r--src/opengl/qpaintengine_opengl.cpp16
-rw-r--r--src/opengl/qpixmapdata_gl.cpp2
-rw-r--r--src/opengl/util/fragmentprograms_p.h6883
-rw-r--r--src/opengl/util/generator.pro2
-rw-r--r--src/opengl/util/texture_brush.glsl2
-rw-r--r--src/openvg/qpaintengine_vg.cpp63
-rw-r--r--src/openvg/qpaintengine_vg_p.h3
-rw-r--r--src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp59
-rw-r--r--src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp35
-rw-r--r--src/plugins/gfxdrivers/directfb/qdirectfbscreen.h5
-rw-r--r--src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp67
-rw-r--r--src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.h7
-rw-r--r--src/plugins/imageformats/jpeg/qjpeghandler.cpp11
-rw-r--r--src/plugins/s60/src/qdesktopservices_3_2.cpp1
-rw-r--r--src/s60installs/s60installs.pro (renamed from src/s60installs/qt_libs.pro)3
-rw-r--r--src/script/api/qscriptcontextinfo.cpp14
-rw-r--r--src/script/api/qscriptengine.cpp23
-rw-r--r--src/script/api/qscriptvalue.cpp115
-rw-r--r--src/script/api/qscriptvalue_p.h8
-rw-r--r--src/script/bridge/qscriptglobalobject.cpp9
-rw-r--r--src/script/bridge/qscriptglobalobject_p.h4
-rw-r--r--src/script/bridge/qscriptvariant.cpp2
-rw-r--r--src/script/script.pro3
-rw-r--r--src/script/utils/qscriptdate.cpp2
-rw-r--r--src/sql/drivers/odbc/qsql_odbc.cpp54
-rw-r--r--src/src.pro5
-rw-r--r--src/svg/qsvgtinydocument.cpp4
-rw-r--r--src/tools/moc/generator.cpp27
-rw-r--r--src/xml/dom/qdom.cpp6
-rw-r--r--src/xmlpatterns/parser/qquerytransformparser_p.h51
209 files changed, 6748 insertions, 5169 deletions
diff --git a/src/3rdparty/phonon/ds9/backend.h b/src/3rdparty/phonon/ds9/backend.h
index 9b2c2a2..8b020c2 100644
--- a/src/3rdparty/phonon/ds9/backend.h
+++ b/src/3rdparty/phonon/ds9/backend.h
@@ -64,7 +64,7 @@ namespace Phonon
Filter getAudioOutputFilter(int index) const;
- static QMutex *Backend::directShowMutex();
+ static QMutex *directShowMutex();
Q_SIGNALS:
void objectDescriptionChanged(ObjectDescriptionType);
diff --git a/src/3rdparty/phonon/ds9/mediaobject.cpp b/src/3rdparty/phonon/ds9/mediaobject.cpp
index 579517f..e42dff9 100644
--- a/src/3rdparty/phonon/ds9/mediaobject.cpp
+++ b/src/3rdparty/phonon/ds9/mediaobject.cpp
@@ -21,9 +21,7 @@ along with this library. If not, see <http://www.gnu.org/licenses/>.
#include <QtCore/QTime>
#include <QtCore/QLibrary>
-#ifndef Q_CC_MSVC
#include <dshow.h>
-#endif //Q_CC_MSVC
#include <objbase.h>
#include <initguid.h>
#include <qnetwork.h>
diff --git a/src/3rdparty/webkit/JavaScriptCore/jit/JITOpcodes.cpp b/src/3rdparty/webkit/JavaScriptCore/jit/JITOpcodes.cpp
index b669dfa..8371229 100644
--- a/src/3rdparty/webkit/JavaScriptCore/jit/JITOpcodes.cpp
+++ b/src/3rdparty/webkit/JavaScriptCore/jit/JITOpcodes.cpp
@@ -763,6 +763,7 @@ void JIT::emit_op_debug(Instruction* currentInstruction)
stubCall.addArgument(Imm32(currentInstruction[1].u.operand));
stubCall.addArgument(Imm32(currentInstruction[2].u.operand));
stubCall.addArgument(Imm32(currentInstruction[3].u.operand));
+ stubCall.addArgument(Imm32(currentInstruction[4].u.operand));
stubCall.call();
}
diff --git a/src/3rdparty/webkit/JavaScriptCore/jit/JITStubs.cpp b/src/3rdparty/webkit/JavaScriptCore/jit/JITStubs.cpp
index 40d2182..2563848 100644
--- a/src/3rdparty/webkit/JavaScriptCore/jit/JITStubs.cpp
+++ b/src/3rdparty/webkit/JavaScriptCore/jit/JITStubs.cpp
@@ -58,6 +58,10 @@
#include "SamplingTool.h"
#include <stdio.h>
+#ifdef QT_BUILD_SCRIPT_LIB
+#include "bridge/qscriptobject_p.h"
+#endif
+
using namespace std;
namespace JSC {
@@ -1470,7 +1474,11 @@ DEFINE_STUB_FUNCTION(JSObject*, op_construct_JSConstruct)
structure = asObject(stackFrame.args[3].jsValue())->inheritorID();
else
structure = constructor->scope().node()->globalObject()->emptyObjectStructure();
+#ifdef QT_BUILD_SCRIPT_LIB
+ return new (stackFrame.globalData) QScriptObject(structure);
+#else
return new (stackFrame.globalData) JSObject(structure);
+#endif
}
DEFINE_STUB_FUNCTION(EncodedJSValue, op_construct_NotJSConstruct)
diff --git a/src/activeqt/container/qaxwidget.cpp b/src/activeqt/container/qaxwidget.cpp
index e4c9d42..621c836 100644
--- a/src/activeqt/container/qaxwidget.cpp
+++ b/src/activeqt/container/qaxwidget.cpp
@@ -1535,9 +1535,10 @@ HRESULT WINAPI QAxClientSite::SetBorderSpace(LPCBORDERWIDTHS pborderwidths)
HRESULT WINAPI QAxClientSite::SetActiveObject(IOleInPlaceActiveObject *pActiveObject, LPCOLESTR pszObjName)
{
AX_DEBUG(QAxClientSite::SetActiveObject);
-
- if (pszObjName && widget)
- widget->setWindowTitle(QString::fromWCharArray(pszObjName));
+
+ Q_UNUSED(pszObjName);
+ // we are ignoring the name of the object, as suggested by MSDN documentation
+ // for IOleInPlaceUIWindow::SetActiveObject().
if (m_spInPlaceActiveObject) {
if (!inPlaceModelessEnabled)
diff --git a/src/corelib/animation/qabstractanimation.cpp b/src/corelib/animation/qabstractanimation.cpp
index 617f4db..49bd8e9 100644
--- a/src/corelib/animation/qabstractanimation.cpp
+++ b/src/corelib/animation/qabstractanimation.cpp
@@ -161,7 +161,9 @@ QT_BEGIN_NAMESPACE
Q_GLOBAL_STATIC(QThreadStorage<QUnifiedTimer *>, unifiedTimer)
-QUnifiedTimer::QUnifiedTimer() : QObject(), lastTick(0), timingInterval(DEFAULT_TIMER_INTERVAL), consistentTiming(false)
+QUnifiedTimer::QUnifiedTimer() :
+ QObject(), lastTick(0), timingInterval(DEFAULT_TIMER_INTERVAL),
+ currentAnimationIdx(0), consistentTiming(false)
{
}
@@ -200,21 +202,19 @@ void QUnifiedTimer::timerEvent(QTimerEvent *event)
}
} else if (event->timerId() == animationTimer.timerId()) {
const int delta = lastTick - oldLastTick;
- //we copy the list so that if it is changed we still get to
- //call setCurrentTime on all animations.
- const QList<QAbstractAnimation*> currentAnimations = animations;
- for (int i = 0; i < currentAnimations.count(); ++i) {
- QAbstractAnimation *animation = currentAnimations.at(i);
+ for (currentAnimationIdx = 0; currentAnimationIdx < animations.count(); ++currentAnimationIdx) {
+ QAbstractAnimation *animation = animations.at(currentAnimationIdx);
int elapsed = QAbstractAnimationPrivate::get(animation)->totalCurrentTime
+ (animation->direction() == QAbstractAnimation::Forward ? delta : -delta);
animation->setCurrentTime(elapsed);
}
+ currentAnimationIdx = 0;
}
}
void QUnifiedTimer::registerAnimation(QAbstractAnimation *animation)
{
- if (animations.contains(animation) ||animationsToStart.contains(animation))
+ if (animations.contains(animation) || animationsToStart.contains(animation))
return;
animationsToStart << animation;
startStopAnimationTimer.start(0, this); // we delay the check if we should start/stop the global timer
@@ -222,8 +222,17 @@ void QUnifiedTimer::registerAnimation(QAbstractAnimation *animation)
void QUnifiedTimer::unregisterAnimation(QAbstractAnimation *animation)
{
- animations.removeAll(animation);
- animationsToStart.removeAll(animation);
+ Q_ASSERT(animations.count(animation) + animationsToStart.count(animation) <= 1);
+
+ int idx = animations.indexOf(animation);
+ if (idx != -1) {
+ animations.removeAt(idx);
+ // this is needed if we unregister an animation while its running
+ if (idx <= currentAnimationIdx)
+ --currentAnimationIdx;
+ } else {
+ animationsToStart.removeOne(animation);
+ }
startStopAnimationTimer.start(0, this); // we delay the check if we should start/stop the global timer
}
@@ -250,28 +259,33 @@ void QAbstractAnimationPrivate::setState(QAbstractAnimation::State newState)
}
state = newState;
- QPointer<QAbstractAnimation> guard(q);
+ QWeakPointer<QAbstractAnimation> guard(q);
- guard->updateState(oldState, newState);
+ q->updateState(oldState, newState);
+ if (!guard)
+ return;
//this is to be safe if updateState changes the state
if (state == oldState)
return;
// Notify state change
- if (guard)
- emit guard->stateChanged(oldState, newState);
+ emit q->stateChanged(oldState, newState);
+ if (!guard)
+ return;
- switch (state)
- {
+ switch (state) {
case QAbstractAnimation::Paused:
case QAbstractAnimation::Running:
//this ensures that the value is updated now that the animation is running
- if(oldState == QAbstractAnimation::Stopped && guard)
- guard->setCurrentTime(currentTime);
+ if(oldState == QAbstractAnimation::Stopped) {
+ q->setCurrentTime(currentTime);
+ if (!guard)
+ return;
+ }
// Register timer if our parent is not running.
- if (state == QAbstractAnimation::Running && guard) {
+ if (state == QAbstractAnimation::Running) {
if (!group || group->state() == QAbstractAnimation::Stopped) {
QUnifiedTimer::instance()->registerAnimation(q);
}
@@ -283,7 +297,10 @@ void QAbstractAnimationPrivate::setState(QAbstractAnimation::State newState)
case QAbstractAnimation::Stopped:
// Leave running state.
int dura = q->duration();
- if (deleteWhenStopped && guard)
+ if (!guard)
+ return;
+
+ if (deleteWhenStopped)
q->deleteLater();
QUnifiedTimer::instance()->unregisterAnimation(q);
@@ -291,8 +308,7 @@ void QAbstractAnimationPrivate::setState(QAbstractAnimation::State newState)
if (dura == -1 || loopCount < 0
|| (oldDirection == QAbstractAnimation::Forward && (oldCurrentTime * (oldCurrentLoop + 1)) == (dura * loopCount))
|| (oldDirection == QAbstractAnimation::Backward && oldCurrentTime == 0)) {
- if (guard)
- emit q->finished();
+ emit q->finished();
}
break;
}
diff --git a/src/corelib/animation/qabstractanimation_p.h b/src/corelib/animation/qabstractanimation_p.h
index 32189f5..bcd7354 100644
--- a/src/corelib/animation/qabstractanimation_p.h
+++ b/src/corelib/animation/qabstractanimation_p.h
@@ -141,6 +141,7 @@ private:
QTime time;
int lastTick;
int timingInterval;
+ int currentAnimationIdx;
bool consistentTiming;
QList<QAbstractAnimation*> animations, animationsToStart;
};
diff --git a/src/corelib/animation/qpropertyanimation.cpp b/src/corelib/animation/qpropertyanimation.cpp
index 35d65d0..49862d2 100644
--- a/src/corelib/animation/qpropertyanimation.cpp
+++ b/src/corelib/animation/qpropertyanimation.cpp
@@ -92,8 +92,6 @@
#include "qanimationgroup.h"
#include "qpropertyanimation_p.h"
-#include <QtCore/qmath.h>
-#include <QtCore/qmutex.h>
#include <private/qmutexpool_p.h>
#ifndef QT_NO_ANIMATION
@@ -102,50 +100,38 @@ QT_BEGIN_NAMESPACE
void QPropertyAnimationPrivate::updateMetaProperty()
{
- if (!target || propertyName.isEmpty())
+ if (!target || propertyName.isEmpty()) {
+ propertyType = QVariant::Invalid;
+ propertyIndex = -1;
return;
-
- if (!hasMetaProperty && !property.isValid()) {
- const QMetaObject *mo = target->metaObject();
- propertyIndex = mo->indexOfProperty(propertyName);
- if (propertyIndex != -1) {
- hasMetaProperty = true;
- property = mo->property(propertyIndex);
- propertyType = property.userType();
- } else {
- if (!target->dynamicPropertyNames().contains(propertyName))
- qWarning("QPropertyAnimation: you're trying to animate a non-existing property %s of your QObject", propertyName.constData());
- }
}
- if (property.isValid())
+ propertyType = targetValue->property(propertyName).userType();
+ propertyIndex = targetValue->metaObject()->indexOfProperty(propertyName);
+ if (propertyIndex == -1 && !targetValue->dynamicPropertyNames().contains(propertyName))
+ qWarning("QPropertyAnimation: you're trying to animate a non-existing property %s of your QObject", propertyName.constData());
+
+ if (propertyType != QVariant::Invalid)
convertValues(propertyType);
}
void QPropertyAnimationPrivate::updateProperty(const QVariant &newValue)
{
- if (!target || state == QAbstractAnimation::Stopped)
+ if (state == QAbstractAnimation::Stopped)
return;
- if (hasMetaProperty) {
- if (newValue.userType() == propertyType) {
- //no conversion is needed, we directly call the QObject::qt_metacall
- void *data = const_cast<void*>(newValue.constData());
- target->qt_metacall(QMetaObject::WriteProperty, propertyIndex, &data);
- } else {
- property.write(target, newValue);
- }
- } else {
- target->setProperty(propertyName.constData(), newValue);
+ if (!target) {
+ q_func()->stop(); //the target was destroyed we need to stop the animation
+ return;
}
-}
-void QPropertyAnimationPrivate::_q_targetDestroyed()
-{
- Q_Q(QPropertyAnimation);
- //we stop here so that this animation is removed from the global hash
- q->stop();
- target = 0;
+ if (propertyIndex != -1 && newValue.userType() == propertyType) {
+ //no conversion is needed, we directly call the QObject::qt_metacall
+ void *data = const_cast<void*>(newValue.constData());
+ targetValue->qt_metacall(QMetaObject::WriteProperty, propertyIndex, &data);
+ } else {
+ targetValue->setProperty(propertyName.constData(), newValue);
+ }
}
/*!
@@ -187,14 +173,13 @@ QPropertyAnimation::~QPropertyAnimation()
*/
QObject *QPropertyAnimation::targetObject() const
{
- Q_D(const QPropertyAnimation);
- return d->target;
+ return d_func()->target.data();
}
void QPropertyAnimation::setTargetObject(QObject *target)
{
Q_D(QPropertyAnimation);
- if (d->target == target)
+ if (d->targetValue == target)
return;
if (d->state != QAbstractAnimation::Stopped) {
@@ -202,15 +187,7 @@ void QPropertyAnimation::setTargetObject(QObject *target)
return;
}
- //we need to get notified when the target is destroyed
- if (d->target)
- disconnect(d->target, SIGNAL(destroyed()), this, SLOT(_q_targetDestroyed()));
-
- if (target)
- connect(target, SIGNAL(destroyed()), SLOT(_q_targetDestroyed()));
-
- d->target = target;
- d->hasMetaProperty = false;
+ d->target = d->targetValue = target;
d->updateMetaProperty();
}
@@ -236,7 +213,6 @@ void QPropertyAnimation::setPropertyName(const QByteArray &propertyName)
}
d->propertyName = propertyName;
- d->hasMetaProperty = false;
d->updateMetaProperty();
}
@@ -273,7 +249,7 @@ void QPropertyAnimation::updateState(QAbstractAnimation::State oldState,
{
Q_D(QPropertyAnimation);
- if (!d->target) {
+ if (!d->target && oldState == Stopped) {
qWarning("QPropertyAnimation::updateState: Changing state of an animation without target");
return;
}
@@ -286,14 +262,16 @@ void QPropertyAnimation::updateState(QAbstractAnimation::State oldState,
typedef QPair<QObject *, QByteArray> QPropertyAnimationPair;
typedef QHash<QPropertyAnimationPair, QPropertyAnimation*> QPropertyAnimationHash;
static QPropertyAnimationHash hash;
- QPropertyAnimationPair key(d->target, d->propertyName);
+ //here we need to use value because we need to know to which pointer
+ //the animation was referring in case stopped because the target was destroyed
+ QPropertyAnimationPair key(d->targetValue, d->propertyName);
if (newState == Running) {
d->updateMetaProperty();
animToStop = hash.value(key, 0);
hash.insert(key, this);
// update the default start value
if (oldState == Stopped) {
- d->setDefaultStartEndValue(d->target->property(d->propertyName.constData()));
+ d->setDefaultStartEndValue(d->targetValue->property(d->propertyName.constData()));
//let's check if we have a start value and an end value
if (d->direction == Forward && !startValue().isValid() && !d->defaultStartEndValue.isValid())
qWarning("QPropertyAnimation::updateState: starting an animation without start value");
diff --git a/src/corelib/animation/qpropertyanimation.h b/src/corelib/animation/qpropertyanimation.h
index e12508d..56fb4b1 100644
--- a/src/corelib/animation/qpropertyanimation.h
+++ b/src/corelib/animation/qpropertyanimation.h
@@ -76,7 +76,6 @@ protected:
void updateState(QAbstractAnimation::State oldState, QAbstractAnimation::State newState);
private:
- Q_PRIVATE_SLOT(d_func(), void _q_targetDestroyed())
Q_DISABLE_COPY(QPropertyAnimation)
Q_DECLARE_PRIVATE(QPropertyAnimation)
};
diff --git a/src/corelib/animation/qpropertyanimation_p.h b/src/corelib/animation/qpropertyanimation_p.h
index ffa6114..3777aa0 100644
--- a/src/corelib/animation/qpropertyanimation_p.h
+++ b/src/corelib/animation/qpropertyanimation_p.h
@@ -54,7 +54,6 @@
//
#include "qpropertyanimation.h"
-#include <QtCore/qmetaobject.h>
#include "private/qvariantanimation_p.h"
@@ -67,20 +66,18 @@ class QPropertyAnimationPrivate : public QVariantAnimationPrivate
Q_DECLARE_PUBLIC(QPropertyAnimation)
public:
QPropertyAnimationPrivate()
- : target(0), propertyType(0), propertyIndex(0), hasMetaProperty(false)
+ : targetValue(0), propertyType(0), propertyIndex(-1)
{
}
- void _q_targetDestroyed();
-
- QObject *target;
+ QWeakPointer<QObject> target;
+ //we use targetValue to be able to unregister the target from the global hash
+ QObject *targetValue;
//for the QProperty
- QMetaProperty property;
int propertyType;
int propertyIndex;
- bool hasMetaProperty;
QByteArray propertyName;
void updateProperty(const QVariant &);
void updateMetaProperty();
diff --git a/src/corelib/animation/qvariantanimation_p.h b/src/corelib/animation/qvariantanimation_p.h
index ce625f1..da120df 100644
--- a/src/corelib/animation/qvariantanimation_p.h
+++ b/src/corelib/animation/qvariantanimation_p.h
@@ -78,10 +78,7 @@ public:
void setDefaultStartEndValue(const QVariant &value);
- int duration;
- QEasingCurve easing;
- QVariantAnimation::KeyValues keyValues;
QVariant currentValue;
QVariant defaultStartEndValue;
@@ -91,6 +88,9 @@ public:
QVariantAnimation::KeyValue start, end;
} currentInterval;
+ QEasingCurve easing;
+ int duration;
+ QVariantAnimation::KeyValues keyValues;
QVariantAnimation::Interpolator interpolator;
void setCurrentValueForProgress(const qreal progress);
diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp
index d7ae78f..7a24ecc 100644
--- a/src/corelib/global/qglobal.cpp
+++ b/src/corelib/global/qglobal.cpp
@@ -1903,12 +1903,12 @@ QSysInfo::SymbianVersion QSysInfo::symbianVersion()
*/
/*!
- T *q_check_ptr(T *pointer)
+ \fn T *q_check_ptr(T *pointer)
\relates <QtGlobal>
- Users Q_CHECK_PTR on \a pointer, then returns \a pointer.
+ Users Q_CHECK_PTR on \a pointer, then returns \a pointer.
- This can be used as an inline version of Q_CHECK_PTR.
+ This can be used as an inline version of Q_CHECK_PTR.
*/
/*!
diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h
index 87f5cb2..d26728d 100644
--- a/src/corelib/global/qglobal.h
+++ b/src/corelib/global/qglobal.h
@@ -265,15 +265,6 @@ namespace QT_NAMESPACE {}
# define Q_OS_WIN
#endif
-#if defined(Q_OS_WIN32)
-# ifndef WINVER
-# define WINVER 0x0500
-# endif
-# ifndef _WIN32_WINNT
-# define _WIN32_WINNT 0x0500
-# endif
-#endif
-
#if defined(Q_OS_DARWIN)
# define Q_OS_MAC /* Q_OS_MAC is mostly for compatibility, but also more clear */
# define Q_OS_MACX /* Q_OS_MACX is only for compatibility.*/
@@ -2399,6 +2390,10 @@ QT3_SUPPORT Q_CORE_EXPORT const char *qInstallPathSysconf();
#endif
#if defined(Q_OS_SYMBIAN)
+
+//Symbian does not support data imports from a DLL
+#define Q_NO_DATA_RELOCATION
+
QT_END_NAMESPACE
// forward declare std::exception
#ifdef __cplusplus
diff --git a/src/corelib/global/qnamespace.qdoc b/src/corelib/global/qnamespace.qdoc
index 657e367..134cbcc 100644
--- a/src/corelib/global/qnamespace.qdoc
+++ b/src/corelib/global/qnamespace.qdoc
@@ -2445,7 +2445,7 @@
\value ImhNone No hints.
\value ImhHiddenText Characters should be hidden, as is typically used when entering passwords.
This is automatically set when setting QLineEdit::echoMode to \c Password.
- \value ImhNumbersOnly Only number input is allowed.
+ \value ImhDigitsOnly Only number input is allowed.
\value ImhUppercaseOnly Only upper case letter input is allowed.
\value ImhLowercaseOnly Only lower case letter input is allowed.
\value ImhNoAutoUppercase The input method should not try to automatically switch to upper case
@@ -2456,6 +2456,9 @@
\value ImhNoPredictiveText Do not use predictive text (i.e. dictionary lookup) while typing.
\value ImhDialableCharactersOnly Only characters suitable for phone dialling are allowed.
+ \omitvalue ImhFormattedNumbersOnly
+ \omitvalue ImhExclusiveInputMask
+
\note If several flags ending with \c Only are ORed together, the resulting character set will
consist of the union of the specified sets. For instance specifying \c ImhNumbersOnly and
\c ImhUppercaseOnly would yield a set consisting of numbers and uppercase letters.
diff --git a/src/corelib/global/qt_windows.h b/src/corelib/global/qt_windows.h
index 6e3f242..dd722f9 100644
--- a/src/corelib/global/qt_windows.h
+++ b/src/corelib/global/qt_windows.h
@@ -53,6 +53,13 @@
#endif
#endif
+#if defined(Q_CC_MINGW)
+// mingw's windows.h does not set _WIN32_WINNT, resulting breaking compilation
+#ifndef WINVER
+#define WINVER 0x500
+#endif
+#endif
+
#include <windows.h>
#ifdef _WIN32_WCE
diff --git a/src/corelib/io/qfsfileengine_unix.cpp b/src/corelib/io/qfsfileengine_unix.cpp
index a7919d3..ec20e4a 100644
--- a/src/corelib/io/qfsfileengine_unix.cpp
+++ b/src/corelib/io/qfsfileengine_unix.cpp
@@ -46,9 +46,6 @@
#ifndef QT_NO_FSFILEENGINE
-#ifndef QT_NO_REGEXP
-# include "qregexp.h"
-#endif
#include "qfile.h"
#include "qdir.h"
#include "qdatetime.h"
@@ -71,7 +68,7 @@
QT_BEGIN_NAMESPACE
-#ifdef Q_OS_SYMBIAN
+#if defined(Q_OS_SYMBIAN)
/*!
\internal
@@ -409,7 +406,7 @@ bool QFSFileEngine::copy(const QString &newName)
QString oldNative(QDir::toNativeSeparators(d->filePath));
TPtrC oldPtr(qt_QString2TPtrC(oldNative));
QFileInfo fi(newName);
- QString absoluteNewName = fi.absolutePath() + QDir::separator() + fi.fileName();
+ QString absoluteNewName = fi.absoluteFilePath();
QString newNative(QDir::toNativeSeparators(absoluteNewName));
TPtrC newPtr(qt_QString2TPtrC(newNative));
TRAPD (err,
@@ -422,8 +419,10 @@ bool QFSFileEngine::copy(const QString &newName)
}
) // End TRAP
delete fm;
+ // ### Add error reporting on failure
return (err == KErrNone);
#else
+ Q_UNUSED(newName);
// ### Add copy code for Unix here
setError(QFile::UnspecifiedError, QLatin1String("Not implemented!"));
return false;
@@ -457,10 +456,9 @@ bool QFSFileEngine::mkdir(const QString &name, bool createParentDirectories) con
{
QString dirName = name;
if (createParentDirectories) {
-#if defined(Q_OS_SYMBIAN)
- dirName = QDir::toNativeSeparators(QDir::cleanPath(dirName));
-#else
dirName = QDir::cleanPath(dirName);
+#if defined(Q_OS_SYMBIAN)
+ dirName = QDir::toNativeSeparators(dirName);
#endif
for(int oldslash = -1, slash=0; slash != -1; oldslash = slash) {
slash = dirName.indexOf(QDir::separator(), oldslash+1);
@@ -493,10 +491,9 @@ bool QFSFileEngine::rmdir(const QString &name, bool recurseParentDirectories) co
{
QString dirName = name;
if (recurseParentDirectories) {
-#if defined(Q_OS_SYMBIAN)
- dirName = QDir::toNativeSeparators(QDir::cleanPath(dirName));
-#else
dirName = QDir::cleanPath(dirName);
+#if defined(Q_OS_SYMBIAN)
+ dirName = QDir::toNativeSeparators(dirName);
#endif
for(int oldslash = 0, slash=dirName.length(); slash > 0; oldslash = slash) {
QByteArray chunk = QFile::encodeName(dirName.left(slash));
@@ -537,12 +534,12 @@ QString QFSFileEngine::currentPath(const QString &)
QString result;
QT_STATBUF st;
#if defined(Q_OS_SYMBIAN)
- char currentName[PATH_MAX+1];
- if (::getcwd(currentName, PATH_MAX))
- result = QDir::fromNativeSeparators(QFile::decodeName(QByteArray(currentName)));
+ char nativeCurrentName[PATH_MAX+1];
+ if (::getcwd(nativeCurrentName, PATH_MAX))
+ result = QDir::fromNativeSeparators(QFile::decodeName(QByteArray(nativeCurrentName)));
if (result.isEmpty()) {
# if defined(QT_DEBUG)
- qWarning("QDir::currentPath: getcwd() failed");
+ qWarning("QFSFileEngine::currentPath: getcwd() failed");
# endif
} else
#endif
@@ -559,7 +556,7 @@ QString QFSFileEngine::currentPath(const QString &)
result = QFile::decodeName(QByteArray(currentName));
# if defined(QT_DEBUG)
if (result.isNull())
- qWarning("QDir::currentPath: getcwd() failed");
+ qWarning("QFSFileEngine::currentPath: getcwd() failed");
# endif
#endif
} else {
@@ -568,10 +565,10 @@ QString QFSFileEngine::currentPath(const QString &)
// try to create it (can happen with application private dirs)
// Ignore mkdir failures; we want to be consistent with Open C
// current path regardless.
- ::mkdir(QFile::encodeName(currentName), 0777);
+ QT_MKDIR(QFile::encodeName(nativeCurrentName), 0777);
#else
# if defined(QT_DEBUG)
- qWarning("QDir::currentPath: stat(\".\") failed");
+ qWarning("QFSFileEngine::currentPath: stat(\".\") failed");
# endif
#endif
}
@@ -607,11 +604,14 @@ QString QFSFileEngine::rootPath()
QString QFSFileEngine::tempPath()
{
-#ifdef Q_OS_SYMBIAN
+#if defined(Q_OS_SYMBIAN)
# ifdef Q_WS_S60
TFileName symbianPath = PathInfo::PhoneMemoryRootPath();
QString temp = QDir::fromNativeSeparators(qt_TDesC2QString(symbianPath));
temp += QLatin1String( "temp/");
+
+ // Just to verify that folder really exist on hardware
+ QT_MKDIR(QFile::encodeName(temp), 0777);
# else
# warning No fallback implementation of QFSFileEngine::tempPath()
return QString();
@@ -632,14 +632,16 @@ QFileInfoList QFSFileEngine::drives()
RFs rfs = qt_s60GetRFs();
TInt err = rfs.DriveList(driveList);
if (err == KErrNone) {
+ char driveName[] = "A:/";
+
for (char i = 0; i < KMaxDrives; i++) {
if (driveList[i]) {
- ret.append(QString("%1:/").arg(QChar('A' + i)));
+ driveName[0] = 'A' + i;
+ ret.append(QFileInfo(QLatin1String(driveName)));
}
}
- }
- else {
- qWarning("QDir::drives: Getting drives failed");
+ } else {
+ qWarning("QFSFileEngine::drives: Getting drives failed");
}
#else
ret.append(QFileInfo(rootPath()));
@@ -680,22 +682,16 @@ bool QFSFileEnginePrivate::isSymlink() const
#if defined(Q_OS_SYMBIAN)
static bool _q_isSymbianHidden(const QString &path, bool isDir)
{
- bool retval = false;
RFs rfs = qt_s60GetRFs();
QFileInfo fi(path);
QString absPath = fi.absoluteFilePath();
- if (isDir && absPath.at(absPath.size()-1) != QChar('/')) {
- absPath += QChar('/');
- }
+ if (isDir && !absPath.endsWith(QLatin1Char('/')))
+ absPath.append(QLatin1Char('/'));
QString native(QDir::toNativeSeparators(absPath));
TPtrC ptr(qt_QString2TPtrC(native));
TUint attributes;
TInt err = rfs.Att(ptr, attributes);
- if (err == KErrNone && (attributes & KEntryAttHidden)) {
- retval = true;
- }
-
- return retval;
+ return (err == KErrNone && (attributes & KEntryAttHidden));
}
#endif
@@ -805,16 +801,16 @@ QAbstractFileEngine::FileFlags QFSFileEngine::fileFlags(FileFlags type) const
ret |= ExistsFlag;
#if defined(Q_OS_SYMBIAN)
if (d->filePath == QLatin1String("/")
- || (d->filePath.at(0).isLetter()
- && d->filePath.mid(1,d->filePath.length()) == QLatin1String(":/")))
+ || (d->filePath.length() == 3 && d->filePath.at(0).isLetter()
+ && d->filePath.at(1) == QLatin1Char(':') && d->filePath.at(2) == QLatin1Char('/'))) {
ret |= RootFlag;
-
- // In Symbian, all symlinks have hidden attribute for some reason;
- // lets make them visible for better compatibility with other platforms.
- // If somebody actually wants a hidden link, then they are out of luck.
- if (!(ret & RootFlag) && !d->isSymlink())
- if(_q_isSymbianHidden(d->filePath, ret & DirectoryType))
- ret |= HiddenFlag;
+ } else {
+ // In Symbian, all symlinks have hidden attribute for some reason;
+ // lets make them visible for better compatibility with other platforms.
+ // If somebody actually wants a hidden link, then they are out of luck.
+ if (!d->isSymlink() && _q_isSymbianHidden(d->filePath, ret & DirectoryType))
+ ret |= HiddenFlag;
+ }
#else
if (d->filePath == QLatin1String("/")) {
ret |= RootFlag;
@@ -825,7 +821,7 @@ QAbstractFileEngine::FileFlags QFSFileEngine::fileFlags(FileFlags type) const
# if !defined(QWS) && defined(Q_OS_MAC)
|| _q_isMacHidden(d->filePath)
# endif
- ) {
+ ) {
ret |= HiddenFlag;
}
}
@@ -834,12 +830,12 @@ QAbstractFileEngine::FileFlags QFSFileEngine::fileFlags(FileFlags type) const
return ret;
}
-#ifdef Q_OS_SYMBIAN
-static QString symbianFileName(QAbstractFileEngine::FileName file, const QFSFileEngine *engine,
- const QFSFileEnginePrivate * const d)
+#if defined(Q_OS_SYMBIAN)
+QString QFSFileEngine::fileName(FileName file) const
{
+ Q_D(const QFSFileEngine);
const QLatin1Char slashChar('/');
- if(file == QAbstractFileEngine::BaseName) {
+ if(file == BaseName) {
int slash = d->filePath.lastIndexOf(slashChar);
if(slash == -1) {
int colon = d->filePath.lastIndexOf(QLatin1Char(':'));
@@ -848,7 +844,7 @@ static QString symbianFileName(QAbstractFileEngine::FileName file, const QFSFile
return d->filePath;
}
return d->filePath.mid(slash + 1);
- } else if(file == QAbstractFileEngine::PathName) {
+ } else if(file == PathName) {
if(!d->filePath.size())
return d->filePath;
@@ -864,7 +860,7 @@ static QString symbianFileName(QAbstractFileEngine::FileName file, const QFSFile
slash++;
return d->filePath.left(slash);
}
- } else if(file == QAbstractFileEngine::AbsoluteName || file == QAbstractFileEngine::AbsolutePathName) {
+ } else if(file == AbsoluteName || file == AbsolutePathName) {
QString ret;
if (!isRelativePathSymbian(d->filePath)) {
if (d->filePath.size() > 2 && d->filePath.at(1) == QLatin1Char(':')
@@ -892,7 +888,7 @@ static QString symbianFileName(QAbstractFileEngine::FileName file, const QFSFile
ret[0] = ret.at(0).toUpper();
}
- if (file == QAbstractFileEngine::AbsolutePathName) {
+ if (file == AbsolutePathName) {
int slash = ret.lastIndexOf(slashChar);
if (slash < 0)
return ret;
@@ -902,12 +898,12 @@ static QString symbianFileName(QAbstractFileEngine::FileName file, const QFSFile
return ret.left(slash > 0 ? slash : 1);
}
return ret;
- } else if(file == QAbstractFileEngine::CanonicalName || file == QAbstractFileEngine::CanonicalPathName) {
- if (!(engine->fileFlags(QAbstractFileEngine::ExistsFlag) & QAbstractFileEngine::ExistsFlag))
+ } else if(file == CanonicalName || file == CanonicalPathName) {
+ if (!(fileFlags(ExistsFlag) & ExistsFlag))
return QString();
- QString ret = QFSFileEnginePrivate::canonicalized(symbianFileName(QAbstractFileEngine::AbsoluteName, engine, d));
- if (!ret.isEmpty() && file == QAbstractFileEngine::CanonicalPathName) {
+ QString ret = QFSFileEnginePrivate::canonicalized(fileName(AbsoluteName));
+ if (file == CanonicalPathName && !ret.isEmpty()) {
int slash = ret.lastIndexOf(slashChar);
if (slash == -1)
ret = QDir::fromNativeSeparators(QDir::currentPath());
@@ -916,7 +912,7 @@ static QString symbianFileName(QAbstractFileEngine::FileName file, const QFSFile
ret = ret.left(slash);
}
return ret;
- } else if(file == QAbstractFileEngine::LinkName) {
+ } else if(file == LinkName) {
if (d->isSymlink()) {
char s[PATH_MAX+1];
int len = readlink(d->nativeFilePath.constData(), s, PATH_MAX);
@@ -939,19 +935,17 @@ static QString symbianFileName(QAbstractFileEngine::FileName file, const QFSFile
}
}
return QString();
- } else if(file == QAbstractFileEngine::BundleName) {
+ } else if(file == BundleName) {
return QString();
}
return d->filePath;
}
-#endif
+
+#else
QString QFSFileEngine::fileName(FileName file) const
{
Q_D(const QFSFileEngine);
-#ifdef Q_OS_SYMBIAN
- return symbianFileName(file, this, d);
-#else
if (file == BundleName) {
#if !defined(QWS) && defined(Q_OS_MAC)
QCFType<CFURLRef> url = CFURLCreateWithFileSystemPath(0, QCFString(d->filePath),
@@ -1004,7 +998,7 @@ QString QFSFileEngine::fileName(FileName file) const
return QString();
QString ret = QFSFileEnginePrivate::canonicalized(fileName(AbsoluteName));
- if (!ret.isEmpty() && file == CanonicalPathName) {
+ if (file == CanonicalPathName && !ret.isEmpty()) {
int slash = ret.lastIndexOf(QLatin1Char('/'));
if (slash == -1)
ret = QDir::currentPath();
@@ -1085,19 +1079,16 @@ QString QFSFileEngine::fileName(FileName file) const
return QString();
}
return d->filePath;
-#endif // Q_OS_SYMBIAN
}
+#endif // Q_OS_SYMBIAN
bool QFSFileEngine::isRelativePath() const
{
Q_D(const QFSFileEngine);
-#ifdef Q_OS_SYMBIAN
+#if defined(Q_OS_SYMBIAN)
return isRelativePathSymbian(d->filePath);
#else
- int len = d->filePath.length();
- if (len == 0)
- return true;
- return d->filePath[0] != QLatin1Char('/');
+ return d->filePath.length() ? d->filePath[0] != QLatin1Char('/') : true;
#endif
}
@@ -1134,9 +1125,7 @@ QString QFSFileEngine::owner(FileOwner own) const
if (pw)
return QFile::decodeName(QByteArray(pw->pw_name));
} else if (own == OwnerGroup) {
-#ifdef Q_OS_SYMBIAN
- return QString();
-#endif
+#if !defined(Q_OS_SYMBIAN)
struct group *gr = 0;
#if !defined(QT_NO_THREAD) && defined(_POSIX_THREAD_SAFE_FUNCTIONS) && !defined(Q_OS_OPENBSD)
size_max = sysconf(_SC_GETGR_R_SIZE_MAX);
@@ -1154,12 +1143,12 @@ QString QFSFileEngine::owner(FileOwner own) const
|| errno != ERANGE)
break;
}
-
#else
gr = getgrgid(ownerId(own));
#endif
if (gr)
return QFile::decodeName(QByteArray(gr->gr_name));
+#endif
}
return QString();
}
diff --git a/src/corelib/io/qfsfileengine_win.cpp b/src/corelib/io/qfsfileengine_win.cpp
index a8de17b..4e142a9 100644
--- a/src/corelib/io/qfsfileengine_win.cpp
+++ b/src/corelib/io/qfsfileengine_win.cpp
@@ -123,6 +123,9 @@ typedef struct _REPARSE_DATA_BUFFER {
# ifndef IO_REPARSE_TAG_SYMLINK
# define IO_REPARSE_TAG_SYMLINK (0xA000000CL)
# endif
+# ifndef FSCTL_GET_REPARSE_POINT
+# define FSCTL_GET_REPARSE_POINT CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 42, METHOD_BUFFERED, FILE_ANY_ACCESS)
+# endif
#endif
QT_BEGIN_NAMESPACE
@@ -1289,6 +1292,8 @@ static QString readSymLink(const QString &link)
qFree(rdb);
CloseHandle(handle);
}
+#else
+ Q_UNUSED(link);
#endif // Q_OS_WINCE
return result;
}
diff --git a/src/corelib/io/qprocess.cpp b/src/corelib/io/qprocess.cpp
index 764304d..f4bf5cc 100644
--- a/src/corelib/io/qprocess.cpp
+++ b/src/corelib/io/qprocess.cpp
@@ -1646,7 +1646,8 @@ bool QProcess::waitForBytesWritten(int msecs)
has been emitted, or until \a msecs milliseconds have passed.
Returns true if the process finished; otherwise returns false (if
- the operation timed out or if an error occurred).
+ the operation timed out, if an error occurred, or if this QProcess
+ is already finished).
This function can operate without an event loop. It is
useful when writing non-GUI applications and when performing
diff --git a/src/corelib/io/qsettings.cpp b/src/corelib/io/qsettings.cpp
index 8612e03..de483ed 100644
--- a/src/corelib/io/qsettings.cpp
+++ b/src/corelib/io/qsettings.cpp
@@ -2118,12 +2118,12 @@ void QConfFileSettingsPrivate::ensureSectionParsed(QConfFile *confFile,
Custom types registered using qRegisterMetaType() and
qRegisterMetaTypeStreamOperators() can be stored using QSettings.
- \section1 Key Syntax
+ \section1 Section and Key Syntax
Setting keys can contain any Unicode characters. The Windows
registry and INI files use case-insensitive keys, whereas the
Carbon Preferences API on Mac OS X uses case-sensitive keys. To
- avoid portability problems, follow these two simple rules:
+ avoid portability problems, follow these simple rules:
\list 1
\o Always refer to the same key using the same case. For example,
@@ -2134,7 +2134,7 @@ void QConfFileSettingsPrivate::ensureSectionParsed(QConfFile *confFile,
example, if you have a key called "MainWindow", don't try to
save another key as "mainwindow".
- \o Do not use slashes ('/' and '\\') in key names; the
+ \o Do not use slashes ('/' and '\\') in section or key names; the
backslash character is used to separate sub keys (see below). On
windows '\\' are converted by QSettings to '/', which makes
them identical.
@@ -3199,8 +3199,8 @@ bool QSettings::isWritable() const
Note that the Windows registry and INI files use case-insensitive
keys, whereas the Carbon Preferences API on Mac OS X uses
- case-sensitive keys. To avoid portability problems, see the \l{Key
- Syntax} rules.
+ case-sensitive keys. To avoid portability problems, see the
+ \l{Section and Key Syntax} rules.
Example:
@@ -3234,8 +3234,8 @@ void QSettings::setValue(const QString &key, const QVariant &value)
Note that the Windows registry and INI files use case-insensitive
keys, whereas the Carbon Preferences API on Mac OS X uses
- case-sensitive keys. To avoid portability problems, see the \l{Key
- Syntax} rules.
+ case-sensitive keys. To avoid portability problems, see the
+ \l{Section and Key Syntax} rules.
\sa setValue(), value(), contains()
*/
@@ -3269,8 +3269,8 @@ void QSettings::remove(const QString &key)
Note that the Windows registry and INI files use case-insensitive
keys, whereas the Carbon Preferences API on Mac OS X uses
- case-sensitive keys. To avoid portability problems, see the \l{Key
- Syntax} rules.
+ case-sensitive keys. To avoid portability problems, see the
+ \l{Section and Key Syntax} rules.
\sa value(), setValue()
*/
@@ -3331,8 +3331,8 @@ bool QSettings::event(QEvent *event)
Note that the Windows registry and INI files use case-insensitive
keys, whereas the Carbon Preferences API on Mac OS X uses
- case-sensitive keys. To avoid portability problems, see the \l{Key
- Syntax} rules.
+ case-sensitive keys. To avoid portability problems, see the
+ \l{Section and Key Syntax} rules.
Example:
diff --git a/src/corelib/io/qtemporaryfile.cpp b/src/corelib/io/qtemporaryfile.cpp
index 3db0564..adfcf5e 100644
--- a/src/corelib/io/qtemporaryfile.cpp
+++ b/src/corelib/io/qtemporaryfile.cpp
@@ -514,10 +514,6 @@ QTemporaryFile::QTemporaryFile()
{
Q_D(QTemporaryFile);
d->templateName = QDir::tempPath() + QLatin1String("/qt_temp.XXXXXX");
-#ifdef Q_OS_SYMBIAN
- //Just to verify that folder really exist on hardware
- fileEngine()->mkdir(QDir::tempPath(), true);
-#endif
}
/*!
diff --git a/src/corelib/kernel/qabstractitemmodel.cpp b/src/corelib/kernel/qabstractitemmodel.cpp
index 3b7059b..1ba3000 100644
--- a/src/corelib/kernel/qabstractitemmodel.cpp
+++ b/src/corelib/kernel/qabstractitemmodel.cpp
@@ -599,6 +599,118 @@ void QAbstractItemModelPrivate::rowsInserted(const QModelIndex &parent,
}
}
+void QAbstractItemModelPrivate::itemsAboutToBeMoved(const QModelIndex &srcParent, int srcFirst, int srcLast, const QModelIndex &destinationParent, int destinationChild, Qt::Orientation orientation)
+{
+ Q_Q(QAbstractItemModel);
+ QVector<QPersistentModelIndexData *> persistent_moved_explicitly;
+ QVector<QPersistentModelIndexData *> persistent_moved_in_source;
+ QVector<QPersistentModelIndexData *> persistent_moved_in_destination;
+
+ QHash<QModelIndex, QPersistentModelIndexData *>::const_iterator it;
+ const QHash<QModelIndex, QPersistentModelIndexData *>::const_iterator begin = persistent.indexes.constBegin();
+ const QHash<QModelIndex, QPersistentModelIndexData *>::const_iterator end = persistent.indexes.constEnd();
+
+ const bool sameParent = (srcParent == destinationParent);
+ const bool movingUp = (srcFirst > destinationChild);
+
+ for ( it = begin; it != end; ++it) {
+ QPersistentModelIndexData *data = *it;
+ const QModelIndex &index = data->index;
+ const QModelIndex &parent = index.parent();
+ const bool isSourceIndex = (parent == srcParent);
+ const bool isDestinationIndex = (parent == destinationParent);
+
+ int childPosition;
+ if (orientation == Qt::Vertical)
+ childPosition = index.row();
+ else
+ childPosition = index.column();
+
+ if (!index.isValid() || !(isSourceIndex || isDestinationIndex ) )
+ continue;
+
+ if (!sameParent && isDestinationIndex) {
+ if (childPosition >= destinationChild)
+ persistent_moved_in_destination.append(data);
+ continue;
+ }
+
+ if (sameParent && movingUp && childPosition < destinationChild)
+ continue;
+
+ if (sameParent && !movingUp && childPosition < srcFirst )
+ continue;
+
+ if (!sameParent && childPosition < srcFirst)
+ continue;
+
+ if (sameParent && (childPosition > srcLast) && (childPosition >= destinationChild ))
+ continue;
+
+ if ((childPosition <= srcLast) && (childPosition >= srcFirst)) {
+ persistent_moved_explicitly.append(data);
+ } else {
+ persistent_moved_in_source.append(data);
+ }
+ }
+ persistent.moved.push(persistent_moved_explicitly);
+ persistent.moved.push(persistent_moved_in_source);
+ persistent.moved.push(persistent_moved_in_destination);
+}
+
+/*!
+ \internal
+
+ Moves persistent indexes \a indexes by amount \a change. The change will be either a change in row value or a change in
+ column value depending on the value of \a orientation. The indexes may also be moved to a different parent if \a parent
+ differs from the existing parent for the index.
+*/
+void QAbstractItemModelPrivate::movePersistentIndexes(QVector<QPersistentModelIndexData *> indexes, int change, const QModelIndex &parent, Qt::Orientation orientation)
+{
+ QVector<QPersistentModelIndexData *>::const_iterator it;
+ const QVector<QPersistentModelIndexData *>::const_iterator begin = indexes.constBegin();
+ const QVector<QPersistentModelIndexData *>::const_iterator end = indexes.constEnd();
+
+ for (it = begin; it != end; ++it)
+ {
+ QPersistentModelIndexData *data = *it;
+
+ int row = data->index.row();
+ int column = data->index.column();
+
+ if (Qt::Vertical == orientation)
+ row += change;
+ else
+ column += change;
+
+ persistent.indexes.erase(persistent.indexes.find(data->index));
+ data->index = q_func()->index(row, column, parent);
+ if (data->index.isValid()) {
+ persistent.insertMultiAtEnd(data->index, data);
+ } else {
+ qWarning() << "QAbstractItemModel::endMoveRows: Invalid index (" << row << "," << column << ") in model" << q_func();
+ }
+ }
+}
+
+void QAbstractItemModelPrivate::itemsMoved(const QModelIndex &sourceParent, int sourceFirst, int sourceLast, const QModelIndex &destinationParent, int destinationChild, Qt::Orientation orientation)
+{
+ QVector<QPersistentModelIndexData *> moved_in_destination = persistent.moved.pop();
+ QVector<QPersistentModelIndexData *> moved_in_source = persistent.moved.pop();
+ QVector<QPersistentModelIndexData *> moved_explicitly = persistent.moved.pop();
+
+ const bool sameParent = (sourceParent == destinationParent);
+ const bool movingUp = (sourceFirst > destinationChild);
+
+ const int explicit_change = (!sameParent || movingUp) ? destinationChild - sourceFirst : destinationChild - sourceLast - 1 ;
+ const int source_change = (!sameParent || !movingUp) ? -1*(sourceLast - sourceFirst + 1) : sourceLast - sourceFirst + 1 ;
+ const int destination_change = sourceLast - sourceFirst + 1;
+
+ movePersistentIndexes(moved_explicitly, explicit_change, destinationParent, orientation);
+ movePersistentIndexes(moved_in_source, source_change, sourceParent, orientation);
+ movePersistentIndexes(moved_in_destination, destination_change, destinationParent, orientation);
+}
+
void QAbstractItemModelPrivate::rowsAboutToBeRemoved(const QModelIndex &parent,
int first, int last)
{
@@ -1227,7 +1339,7 @@ void QAbstractItemModelPrivate::columnsRemoved(const QModelIndex &parent,
\endlist
- \sa layoutAboutToBeChanged(), dataChanged(), headerDataChanged(), reset(),
+ \sa layoutAboutToBeChanged(), dataChanged(), headerDataChanged(), modelReset(),
changePersistentIndex()
*/
@@ -1370,6 +1482,70 @@ QAbstractItemModel::~QAbstractItemModel()
*/
/*!
+ \fn void QAbstractItemModel::rowsMoved(const QModelIndex &sourceParent, int sourceStart, int sourceEnd, const QModelIndex &destinationParent, int destinationRow)
+ \since 4.6
+
+ This signal is emitted after rows have been moved within the
+ model. The items between \a sourceStart and \a sourceEnd
+ inclusive, under the given \a sourceParent item have been moved to \a destinationParent
+ starting at the row \a destinationRow.
+
+ \bold{Note:} Components connected to this signal use it to adapt to changes
+ in the model's dimensions. It can only be emitted by the QAbstractItemModel
+ implementation, and cannot be explicitly emitted in subclass code.
+
+ \sa beginMoveRows()
+*/
+
+/*!
+ \fn void QAbstractItemModel::rowsAboutToBeMoved(const QModelIndex &sourceParent, int sourceStart, int sourceEnd, const QModelIndex &destinationParent, int destinationRow)
+ \since 4.6
+
+ This signal is emitted just before rows are moved within the
+ model. The items that will be moved are those between \a sourceStart and \a sourceEnd
+ inclusive, under the given \a sourceParent item. They will be moved to \a destinationParent
+ starting at the row \a destinationRow.
+
+ \bold{Note:} Components connected to this signal use it to adapt to changes
+ in the model's dimensions. It can only be emitted by the QAbstractItemModel
+ implementation, and cannot be explicitly emitted in subclass code.
+
+ \sa beginMoveRows()
+*/
+
+/*!
+ \fn void QAbstractItemModel::columnsMoved(const QModelIndex &sourceParent, int sourceStart, int sourceEnd, const QModelIndex &destinationParent, int destinationColumn)
+ \since 4.6
+
+ This signal is emitted after columns have been moved within the
+ model. The items between \a sourceStart and \a sourceEnd
+ inclusive, under the given \a sourceParent item have been moved to \a destinationParent
+ starting at the column \a destinationColumn.
+
+ \bold{Note:} Components connected to this signal use it to adapt to changes
+ in the model's dimensions. It can only be emitted by the QAbstractItemModel
+ implementation, and cannot be explicitly emitted in subclass code.
+
+ \sa beginMoveRows()
+*/
+
+/*!
+ \fn void QAbstractItemModel::columnsAboutToBeMoved(const QModelIndex &sourceParent, int sourceStart, int sourceEnd, const QModelIndex &destinationParent, int destinationColumn)
+ \since 4.6
+
+ This signal is emitted just before columns are moved within the
+ model. The items that will be moved are those between \a sourceStart and \a sourceEnd
+ inclusive, under the given \a sourceParent item. They will be moved to \a destinationParent
+ starting at the column \a destinationColumn.
+
+ \bold{Note:} Components connected to this signal use it to adapt to changes
+ in the model's dimensions. It can only be emitted by the QAbstractItemModel
+ implementation, and cannot be explicitly emitted in subclass code.
+
+ \sa beginMoveRows()
+*/
+
+/*!
\fn void QAbstractItemModel::columnsInserted(const QModelIndex &parent, int start, int end)
This signal is emitted after columns have been inserted into the model. The
@@ -2284,6 +2460,123 @@ void QAbstractItemModel::endRemoveRows()
}
/*!
+ Returns whether a move operation is valid.
+
+ A move operation is not allowed if it moves a continuous range of rows to a destination within
+ itself, or if it attempts to move a row to one of its own descendants.
+
+ \internal
+*/
+bool QAbstractItemModelPrivate::allowMove(const QModelIndex &srcParent, int start, int end, const QModelIndex &destinationParent, int destinationStart, Qt::Orientation orientation)
+{
+ Q_Q(QAbstractItemModel);
+ // Don't move the range within itself.
+ if ( ( destinationParent == srcParent )
+ && ( destinationStart >= start )
+ && ( destinationStart <= end + 1) )
+ return false;
+
+ QModelIndex destinationAncestor = destinationParent;
+ int pos = (Qt::Vertical == orientation) ? destinationAncestor.row() : destinationAncestor.column();
+ forever {
+ if (destinationAncestor == srcParent) {
+ if (pos >= start && pos <= end)
+ return false;
+ break;
+ }
+
+ if (!destinationAncestor.isValid())
+ break;
+
+ pos = (Qt::Vertical == orientation) ? destinationAncestor.row() : destinationAncestor.column();
+ destinationAncestor = destinationAncestor.parent();
+ }
+
+ return true;
+}
+
+/*!
+ Begins a row move operation.
+
+ When reimplementing a subclass, this method simplifies moving
+ entities in your model. This method is responsible for moving
+ persistent indexes in the model, which you would otherwise be
+ required to do yourself.
+
+ Using beginMoveRows and endMoveRows is an alternative to emitting
+ layoutAboutToBeChanged and layoutChanged directly along with
+ changePersistentIndexes. layoutAboutToBeChanged is emitted by
+ this method for compatibility reasons.
+
+ The \a sourceParent index corresponds to the parent from which the
+ rows are moved; \a sourceFirst and \a sourceLast are the row
+ numbers of the rows to be moved. The \a destinationParent index
+ corresponds to the parent into which the rows are moved. The \a
+ destinationChild is the row to which the rows will be moved. That
+ is, the index at row \a sourceFirst in \a sourceParent will become
+ row \a destinationChild in \a destinationParent. Its siblings will
+ be moved correspondingly.
+
+ Note that \a sourceParent and \a destinationParent may be the
+ same, in which case you must ensure that the \a destinationChild is
+ not within the range of \a sourceFirst and \a sourceLast. You
+ must also ensure that you do not attempt to move a row to one of
+ its own chilren or ancestors. This method returns false if either
+ condition is true, in which case you should abort your move
+ operation.
+
+ \sa endMoveRows()
+
+ \since 4.6
+*/
+bool QAbstractItemModel::beginMoveRows(const QModelIndex &sourceParent, int sourceFirst, int sourceLast, const QModelIndex &destinationParent, int destinationChild)
+{
+ Q_ASSERT(sourceFirst >= 0);
+ Q_ASSERT(sourceLast >= sourceFirst);
+ Q_ASSERT(destinationChild >= 0);
+ Q_D(QAbstractItemModel);
+
+ if (!d->allowMove(sourceParent, sourceFirst, sourceLast, destinationParent, destinationChild, Qt::Vertical)) {
+ return false;
+ }
+
+ d->changes.push(QAbstractItemModelPrivate::Change(sourceParent, sourceFirst, sourceLast));
+ int destinationLast = destinationChild + (sourceLast - sourceFirst);
+ d->changes.push(QAbstractItemModelPrivate::Change(destinationParent, destinationChild, destinationLast));
+
+ d->itemsAboutToBeMoved(sourceParent, sourceFirst, sourceLast, destinationParent, destinationChild, Qt::Vertical);
+ emit rowsAboutToBeMoved(sourceParent, sourceFirst, sourceLast, destinationParent, destinationChild);
+ emit layoutAboutToBeChanged();
+ return true;
+}
+
+/*!
+ Ends a row move operation.
+
+ When implementing a subclass, you must call this
+ function \e after moving data within the model's underlying data
+ store.
+
+ layoutChanged is emitted by this method for compatibility reasons.
+
+ \sa beginMoveRows()
+
+ \since 4.6
+*/
+void QAbstractItemModel::endMoveRows()
+{
+ Q_D(QAbstractItemModel);
+
+ QAbstractItemModelPrivate::Change insertChange = d->changes.pop();
+ QAbstractItemModelPrivate::Change removeChange = d->changes.pop();
+
+ d->itemsMoved(removeChange.parent, removeChange.first, removeChange.last, insertChange.parent, insertChange.first, Qt::Vertical);
+
+ emit rowsMoved(removeChange.parent, removeChange.first, removeChange.last, insertChange.parent, insertChange.first);
+ emit layoutChanged();
+}
+
+/*!
Begins a column insertion operation.
When reimplementing insertColumns() in a subclass, you must call this
@@ -2406,9 +2699,108 @@ void QAbstractItemModel::endRemoveColumns()
}
/*!
+ Begins a column move operation.
+
+ When reimplementing a subclass, this method simplifies moving
+ entities in your model. This method is responsible for moving
+ persistent indexes in the model, which you would otherwise be
+ required to do yourself.
+
+ Using beginMoveColumns and endMoveColumns is an alternative to
+ emitting layoutAboutToBeChanged and layoutChanged directly along
+ with changePersistentIndexes. layoutAboutToBeChanged is emitted
+ by this method for compatibility reasons.
+
+ The \a sourceParent index corresponds to the parent from which the
+ columns are moved; \a sourceFirst and \a sourceLast are the column
+ numbers of the columns to be moved. The \a destinationParent index
+ corresponds to the parent into which the columns are moved. The \a
+ destinationChild is the column to which the columns will be
+ moved. That is, the index at column \a sourceFirst in \a
+ sourceParent will become column \a destinationChild in \a
+ destinationParent. Its siblings will be moved correspondingly.
+
+ Note that \a sourceParent and \a destinationParent may be the
+ same, in which case you must ensure that the \a destinationChild
+ is not within the range of \a sourceFirst and \a sourceLast. You
+ must also ensure that you do not attempt to move a row to one of
+ its own chilren or ancestors. This method returns false if either
+ condition is true, in which case you should abort your move
+ operation.
+
+ \sa endMoveColumns()
+
+ \since 4.6
+*/
+bool QAbstractItemModel::beginMoveColumns(const QModelIndex &sourceParent, int sourceFirst, int sourceLast, const QModelIndex &destinationParent, int destinationChild)
+{
+ Q_ASSERT(sourceFirst >= 0);
+ Q_ASSERT(sourceLast >= sourceFirst);
+ Q_ASSERT(destinationChild >= 0);
+ Q_D(QAbstractItemModel);
+
+ if (!d->allowMove(sourceParent, sourceFirst, sourceLast, destinationParent, destinationChild, Qt::Horizontal)) {
+ return false;
+ }
+
+ d->changes.push(QAbstractItemModelPrivate::Change(sourceParent, sourceFirst, sourceLast));
+ int destinationLast = destinationChild + (sourceLast - sourceFirst);
+ d->changes.push(QAbstractItemModelPrivate::Change(destinationParent, destinationChild, destinationLast));
+
+ d->itemsAboutToBeMoved(sourceParent, sourceFirst, sourceLast, destinationParent, destinationChild, Qt::Horizontal);
+
+ emit columnsAboutToBeMoved(sourceParent, sourceFirst, sourceLast, destinationParent, destinationChild);
+ emit layoutAboutToBeChanged();
+ return true;
+}
+
+/*!
+ Ends a column move operation.
+
+ When implementing a subclass, you must call this
+ function \e after moving data within the model's underlying data
+ store.
+
+ layoutChanged is emitted by this method for compatibility reasons.
+
+ \sa beginMoveColumns()
+
+ \since 4.6
+*/
+void QAbstractItemModel::endMoveColumns()
+{
+ Q_D(QAbstractItemModel);
+
+ QAbstractItemModelPrivate::Change insertChange = d->changes.pop();
+ QAbstractItemModelPrivate::Change removeChange = d->changes.pop();
+
+ d->itemsMoved(removeChange.parent, removeChange.first, removeChange.last, insertChange.parent, insertChange.first, Qt::Horizontal);
+
+ emit columnsMoved(removeChange.parent, removeChange.first, removeChange.last, insertChange.parent, insertChange.first);
+ emit layoutChanged();
+}
+
+/*!
Resets the model to its original state in any attached views.
- The view to which the model is attached to will be reset as well.
+ \note Use beginResetModel() and endResetModel() instead whenever possible.
+ Use this method only if there is no way to call beginResetModel() before invalidating the model.
+ Otherwise it could lead to unexcpected behaviour, especially when used with proxy models.
+*/
+void QAbstractItemModel::reset()
+{
+ Q_D(QAbstractItemModel);
+ emit modelAboutToBeReset();
+ d->invalidatePersistentIndexes();
+ emit modelReset();
+}
+
+/*!
+ Begins a model reset operation.
+
+ A reset operation resets the model to its current state in any attached views.
+
+ \note Any views attached to this model will be reset as well.
When a model is reset it means that any previous data reported from the
model is now invalid and has to be queried for again. This also means that
@@ -2418,12 +2810,29 @@ void QAbstractItemModel::endRemoveColumns()
call this function rather than emit dataChanged() to inform other
components when the underlying data source, or its structure, has changed.
- \sa modelAboutToBeReset(), modelReset()
+ You must call this function before resetting any internal data structures in your model
+ or proxy model.
+
+ \sa modelAboutToBeReset(), modelReset(), endResetModel()
+ \since 4.6
*/
-void QAbstractItemModel::reset()
+void QAbstractItemModel::beginResetModel()
{
- Q_D(QAbstractItemModel);
emit modelAboutToBeReset();
+}
+
+/*!
+ Completes a model reset operation.
+
+ You must call this function after resetting any internal data structure in your model
+ or proxy model.
+
+ \sa beginResetModel()
+ \since 4.6
+*/
+void QAbstractItemModel::endResetModel()
+{
+ Q_D(QAbstractItemModel);
d->invalidatePersistentIndexes();
emit modelReset();
}
@@ -2895,7 +3304,7 @@ bool QAbstractListModel::dropMimeData(const QMimeData *data, Qt::DropAction acti
This signal is emitted when reset() is called, before the model's internal
state (e.g. persistent model indexes) has been invalidated.
- \sa reset(), modelReset()
+ \sa beginResetModel(), modelReset()
*/
/*!
@@ -2905,7 +3314,7 @@ bool QAbstractListModel::dropMimeData(const QMimeData *data, Qt::DropAction acti
This signal is emitted when reset() is called, after the model's internal
state (e.g. persistent model indexes) has been invalidated.
- \sa reset(), modelAboutToBeReset()
+ \sa endResetModel(), modelAboutToBeReset()
*/
/*!
diff --git a/src/corelib/kernel/qabstractitemmodel.h b/src/corelib/kernel/qabstractitemmodel.h
index 00f6cb2..1ca6cbe 100644
--- a/src/corelib/kernel/qabstractitemmodel.h
+++ b/src/corelib/kernel/qabstractitemmodel.h
@@ -252,6 +252,13 @@ private: // can only be emitted by QAbstractItemModel
void modelAboutToBeReset();
void modelReset();
+ void rowsAboutToBeMoved( const QModelIndex &sourceParent, int sourceStart, int sourceEnd, const QModelIndex &destinationParent, int destinationRow );
+ void rowsMoved( const QModelIndex &parent, int start, int end, const QModelIndex &destination, int row );
+
+ void columnsAboutToBeMoved( const QModelIndex &sourceParent, int sourceStart, int sourceEnd, const QModelIndex &destinationParent, int destinationColumn );
+ void columnsMoved( const QModelIndex &parent, int start, int end, const QModelIndex &destination, int column );
+
+
public Q_SLOTS:
virtual bool submit();
virtual void revert();
@@ -272,14 +279,23 @@ protected:
void beginRemoveRows(const QModelIndex &parent, int first, int last);
void endRemoveRows();
+ bool beginMoveRows(const QModelIndex &sourceParent, int sourceFirst, int sourceLast, const QModelIndex &destinationParent, int destinationRow);
+ void endMoveRows();
+
void beginInsertColumns(const QModelIndex &parent, int first, int last);
void endInsertColumns();
void beginRemoveColumns(const QModelIndex &parent, int first, int last);
void endRemoveColumns();
+ bool beginMoveColumns(const QModelIndex &sourceParent, int sourceFirst, int sourceLast, const QModelIndex &destinationParent, int destinationColumn);
+ void endMoveColumns();
+
void reset();
+ void beginResetModel();
+ void endResetModel();
+
void changePersistentIndex(const QModelIndex &from, const QModelIndex &to);
void changePersistentIndexList(const QModelIndexList &from, const QModelIndexList &to);
QModelIndexList persistentIndexList() const;
diff --git a/src/corelib/kernel/qabstractitemmodel_p.h b/src/corelib/kernel/qabstractitemmodel_p.h
index e81e627..aae3cba 100644
--- a/src/corelib/kernel/qabstractitemmodel_p.h
+++ b/src/corelib/kernel/qabstractitemmodel_p.h
@@ -80,6 +80,7 @@ class Q_CORE_EXPORT QAbstractItemModelPrivate : public QObjectPrivate
public:
QAbstractItemModelPrivate() : QObjectPrivate(), supportedDragActions(-1), roleNames(defaultRoleNames()) {}
void removePersistentIndexData(QPersistentModelIndexData *data);
+ void movePersistentIndexes(QVector<QPersistentModelIndexData *> indexes, int change, const QModelIndex &parent, Qt::Orientation orientation);
void rowsAboutToBeInserted(const QModelIndex &parent, int first, int last);
void rowsInserted(const QModelIndex &parent, int first, int last);
void rowsAboutToBeRemoved(const QModelIndex &parent, int first, int last);
@@ -91,6 +92,10 @@ public:
static QAbstractItemModel *staticEmptyModel();
static bool variantLessThan(const QVariant &v1, const QVariant &v2);
+ void itemsAboutToBeMoved(const QModelIndex &srcParent, int srcFirst, int srcLast, const QModelIndex &destinationParent, int destinationChild, Qt::Orientation);
+ void itemsMoved(const QModelIndex &srcParent, int srcFirst, int srcLast, const QModelIndex &destinationParent, int destinationChild, Qt::Orientation orientation);
+ bool allowMove(const QModelIndex &srcParent, int srcFirst, int srcLast, const QModelIndex &destinationParent, int destinationChild, Qt::Orientation orientation);
+
inline QModelIndex createIndex(int row, int column, void *data = 0) const {
return q_func()->createIndex(row, column, data);
}
@@ -132,6 +137,8 @@ public:
Change(const QModelIndex &p, int f, int l) : parent(p), first(f), last(l) {}
QModelIndex parent;
int first, last;
+
+ bool isValid() { return first >= 0 && last >= 0; }
};
QStack<Change> changes;
diff --git a/src/corelib/kernel/qcore_symbian_p.cpp b/src/corelib/kernel/qcore_symbian_p.cpp
index 957b92c..a263cc4 100644
--- a/src/corelib/kernel/qcore_symbian_p.cpp
+++ b/src/corelib/kernel/qcore_symbian_p.cpp
@@ -175,10 +175,6 @@ Q_CORE_EXPORT TLibraryFunction qt_resolveS60PluginFunc(int ordinal)
return qt_s60_plugin_resolver()->resolve(ordinal);
}
-/*!
-\internal
-Provides global access to a shared RFs.
-*/
class QS60RFsSession
{
public:
diff --git a/src/corelib/kernel/qcoreapplication.cpp b/src/corelib/kernel/qcoreapplication.cpp
index 6d88d92..854abef 100644
--- a/src/corelib/kernel/qcoreapplication.cpp
+++ b/src/corelib/kernel/qcoreapplication.cpp
@@ -393,43 +393,61 @@ QString qAppName()
application's initialization and finalization, as well as
system-wide and application-wide settings.
- The command line arguments which QCoreApplication's constructor
- should be called with are accessible using arguments(). The
- event loop is started with a call to exec(). Long running
+ \section1 The Event Loop and Event Handling
+
+ The event loop is started with a call to exec(). Long running
operations can call processEvents() to keep the application
responsive.
Some Qt classes, such as QString, can be used without a
QCoreApplication object. However, in general, we recommend that
you create a QCoreApplication or a QApplication object in your \c
- main() function as early as possible. The application will enter
- the event loop when exec() is called. exit() will not return
- until the event loop exits, e.g., when quit() is called.
+ main() function as early as possible. exit() will not return
+ until the event loop exits; e.g., when quit() is called.
+
+ Several static convenience functions are also provided. The
+ QCoreApplication object is available from instance(). Events can
+ be sent or posted using sendEvent(), postEvent(), and
+ sendPostedEvents(). Pending events can be removed with
+ removePostedEvents() or flushed with flush().
+
+ The class provides a quit() slot and an aboutToQuit() signal.
+
+ \section1 Application and Library Paths
An application has an applicationDirPath() and an
- applicationFilePath(). Translation files can be added or removed
+ applicationFilePath(). Library paths (see QLibrary) can be retrieved
+ with libraryPaths() and manipulated by setLibraryPaths(), addLibraryPath(),
+ and removeLibraryPath().
+
+ \section1 Internationalization and Translations
+
+ Translation files can be added or removed
using installTranslator() and removeTranslator(). Application
strings can be translated using translate(). The QObject::tr()
and QObject::trUtf8() functions are implemented in terms of
translate().
- The class provides a quit() slot and an aboutToQuit() signal.
+ \section1 Accessing Command Line Arguments
- Several static convenience functions are also provided. The
- QCoreApplication object is available from instance(). Events can
- be sent or posted using sendEvent(), postEvent(), and
- sendPostedEvents(). Pending events can be removed with
- removePostedEvents() or flushed with flush(). Library paths (see
- QLibrary) can be retrieved with libraryPaths() and manipulated by
- setLibraryPaths(), addLibraryPath(), and removeLibraryPath().
-
- On Unix/Linux Qt is configured to use the system local settings by
- default. This can cause a conflict when using POSIX functions, for
- instance, when converting between data types such as floats and
- strings, since the notation may differ between locales. To get
- around this problem call the POSIX function setlocale(LC_NUMERIC,"C")
- right after initializing QApplication or QCoreApplication to reset
- the locale that is used for number formatting to "C"-locale.
+ The command line arguments which are passed to QCoreApplication's
+ constructor should be accessed using the arguments() function.
+ Note that some arguments supplied by the user may have been
+ processed and removed by QCoreApplication.
+
+ In cases where command line arguments need to be obtained using the
+ argv() function, you must convert them from the local string encoding
+ using QString::fromLocal8Bit().
+
+ \section1 Locale Settings
+
+ On Unix/Linux Qt is configured to use the system locale settings by
+ default. This can cause a conflict when using POSIX functions, for
+ instance, when converting between data types such as floats and
+ strings, since the notation may differ between locales. To get
+ around this problem, call the POSIX function \c{setlocale(LC_NUMERIC,"C")}
+ right after initializing QApplication or QCoreApplication to reset
+ the locale that is used for number formatting to "C"-locale.
\sa QApplication, QAbstractEventDispatcher, QEventLoop,
{Semaphores Example}, {Wait Conditions Example}
@@ -1011,7 +1029,7 @@ void QCoreApplication::exit(int returnCode)
The event is \e not deleted when the event has been sent. The normal
approach is to create the event on the stack, for example:
- \snippet doc/src/snippets/code/src.corelib.kernel.qcoreapplication.cpp 0
+ \snippet doc/src/snippets/code/src_corelib_kernel_qcoreapplication.cpp 0
\sa postEvent(), notify()
*/
@@ -1534,7 +1552,7 @@ bool QCoreApplication::event(QEvent *e)
Example:
- \snippet doc/src/snippets/code/src.corelib.kernel.qcoreapplication.cpp 1
+ \snippet doc/src/snippets/code/src_corelib_kernel_qcoreapplication.cpp 1
\sa exit(), aboutToQuit(), QApplication::lastWindowClosed()
*/
@@ -1975,9 +1993,9 @@ char **QCoreApplication::argv()
\warning On Unix, this list is built from the argc and argv parameters passed
to the constructor in the main() function. The string-data in argv is
interpreted using QString::fromLocal8Bit(); hence it is not possible to
- pass i.e. Japanese command line arguments on a system that runs in a latin1
- locale. Most modern Unix systems do not have this limitation, as they are
- Unicode based.
+ pass, for example, Japanese command line arguments on a system that runs in a
+ Latin1 locale. Most modern Unix systems do not have this limitation, as they are
+ Unicode-based.
On NT-based Windows, this limitation does not apply either.
On Windows, the arguments() are not built from the contents of argv/argc, as
@@ -2153,7 +2171,7 @@ Q_GLOBAL_STATIC_WITH_ARGS(QMutex, libraryPathMutex, (QMutex::Recursive))
If you want to iterate over the list, you can use the \l foreach
pseudo-keyword:
- \snippet doc/src/snippets/code/src.corelib.kernel.qcoreapplication.cpp 2
+ \snippet doc/src/snippets/code/src_corelib_kernel_qcoreapplication.cpp 2
\sa setLibraryPaths(), addLibraryPath(), removeLibraryPath(), QLibrary,
{How to Create Qt Plugins}
@@ -2300,7 +2318,7 @@ void QCoreApplication::removeLibraryPath(const QString &path)
A function with the following signature that can be used as an
event filter:
- \snippet doc/src/snippets/code/src.corelib.kernel.qcoreapplication.cpp 3
+ \snippet doc/src/snippets/code/src_corelib_kernel_qcoreapplication.cpp 3
\sa setEventFilter()
*/
@@ -2489,7 +2507,7 @@ int QCoreApplication::loopLevel()
}
#endif
-/*!
+/*
\fn void QCoreApplication::watchUnixSignal(int signal, bool watch)
\internal
*/
@@ -2513,7 +2531,7 @@ int QCoreApplication::loopLevel()
The function specified by \a ptr should take no arguments and should
return nothing. For example:
- \snippet doc/src/snippets/code/src.corelib.kernel.qcoreapplication.cpp 4
+ \snippet doc/src/snippets/code/src_corelib_kernel_qcoreapplication.cpp 4
Note that for an application- or module-wide cleanup,
qAddPostRoutine() is often not suitable. For example, if the
@@ -2527,7 +2545,7 @@ int QCoreApplication::loopLevel()
parent-child mechanism to call a cleanup function at the right
time:
- \snippet doc/src/snippets/code/src.corelib.kernel.qcoreapplication.cpp 5
+ \snippet doc/src/snippets/code/src_corelib_kernel_qcoreapplication.cpp 5
By selecting the right parent object, this can often be made to
clean up the module's data at the right moment.
@@ -2541,7 +2559,7 @@ int QCoreApplication::loopLevel()
translation functions, \c tr() and \c trUtf8(), with these
signatures:
- \snippet doc/src/snippets/code/src.corelib.kernel.qcoreapplication.cpp 6
+ \snippet doc/src/snippets/code/src_corelib_kernel_qcoreapplication.cpp 6
This macro is useful if you want to use QObject::tr() or
QObject::trUtf8() in classes that don't inherit from QObject.
@@ -2550,7 +2568,7 @@ int QCoreApplication::loopLevel()
class definition (before the first \c{public:} or \c{protected:}).
For example:
- \snippet doc/src/snippets/code/src.corelib.kernel.qcoreapplication.cpp 7
+ \snippet doc/src/snippets/code/src_corelib_kernel_qcoreapplication.cpp 7
The \a context parameter is normally the class name, but it can
be any string.
diff --git a/src/corelib/kernel/qmetaobject.cpp b/src/corelib/kernel/qmetaobject.cpp
index 3d26160..5771feb 100644
--- a/src/corelib/kernel/qmetaobject.cpp
+++ b/src/corelib/kernel/qmetaobject.cpp
@@ -613,16 +613,26 @@ static const QMetaObject *QMetaObject_findMetaObject(const QMetaObject *self, co
if (strcmp(self->d.stringdata, name) == 0)
return self;
if (self->d.extradata) {
+#ifdef Q_NO_DATA_RELOCATION
+ const QMetaObjectAccessor *e;
+ Q_ASSERT(priv(self->d.data)->revision >= 2);
+#else
const QMetaObject **e;
if (priv(self->d.data)->revision < 2) {
e = (const QMetaObject**)(self->d.extradata);
- } else {
+ } else
+#endif
+ {
const QMetaObjectExtraData *extra = (const QMetaObjectExtraData*)(self->d.extradata);
e = extra->objects;
}
if (e) {
while (*e) {
+#ifdef Q_NO_DATA_RELOCATION
+ if (const QMetaObject *m =QMetaObject_findMetaObject(&((*e)()), name))
+#else
if (const QMetaObject *m =QMetaObject_findMetaObject((*e), name))
+#endif
return m;
++e;
}
diff --git a/src/corelib/kernel/qmetaobject_p.h b/src/corelib/kernel/qmetaobject_p.h
index d843deb..572e727 100644
--- a/src/corelib/kernel/qmetaobject_p.h
+++ b/src/corelib/kernel/qmetaobject_p.h
@@ -102,6 +102,7 @@ enum MetaObjectFlags {
DynamicMetaObject = 0x01
};
+class QMutex;
struct QMetaObjectPrivate
{
@@ -121,13 +122,17 @@ struct QMetaObjectPrivate
static int indexOfSignalRelative(const QMetaObject **baseObject, const char* name);
static int originalClone(const QMetaObject *obj, int local_method_index);
+#ifndef QT_NO_QOBJECT
//defined in qobject.cpp
static bool connect(const QObject *sender, int signal_index,
const QObject *receiver, int method_index,
int type = 0, int *types = 0);
static bool disconnect(const QObject *sender, int signal_index,
const QObject *receiver, int method_index);
-
+ static inline bool disconnectHelper(QObjectPrivate::Connection *c,
+ const QObject *receiver, int method_index,
+ QMutex *senderMutex);
+#endif
};
#ifndef UTILS_H
diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp
index 2117a2d..6a451d5 100644
--- a/src/corelib/kernel/qobject.cpp
+++ b/src/corelib/kernel/qobject.cpp
@@ -240,18 +240,20 @@ static void computeOffsets(const QMetaObject *metaobject, int *signalOffset, int
}
}
-/*! \internal
+/*
This vector contains the all connections from an object.
- Each object may have one vector containing the lists of connections for a given signal.
- The index in the vector correspond to the signal index.
- The signal index is the one returned by QObjectPrivate::signalIndex (not QMetaObject::indexOfSignal).
+ Each object may have one vector containing the lists of
+ connections for a given signal. The index in the vector correspond
+ to the signal index. The signal index is the one returned by
+ QObjectPrivate::signalIndex (not QMetaObject::indexOfSignal).
Negative index means connections to all signals.
This vector is protected by the object mutex (signalSlotMutexes())
- Each Connection is also part of a 'senders' linked list. The mutex of the receiver must be locked when touching
- the pointers of this linked list.
+ Each Connection is also part of a 'senders' linked list. The mutex
+ of the receiver must be locked when touching the pointers of this
+ linked list.
*/
class QObjectConnectionListVector : public QVector<QObjectPrivate::ConnectionList>
{
@@ -289,7 +291,7 @@ bool QObjectPrivate::isSender(const QObject *receiver, const char *signal) const
QMutexLocker locker(signalSlotLock(q));
if (connectionLists) {
if (signal_index < connectionLists->count()) {
- const QObjectPrivate::Connection *c =
+ const QObjectPrivate::Connection *c =
connectionLists->at(signal_index).first;
while (c) {
@@ -358,7 +360,7 @@ void QObjectPrivate::cleanConnectionLists()
if (connectionLists->dirty && !connectionLists->inUse) {
// remove broken connections
for (int signal = -1; signal < connectionLists->count(); ++signal) {
- QObjectPrivate::ConnectionList &connectionList =
+ QObjectPrivate::ConnectionList &connectionList =
(*connectionLists)[signal];
// Set to the last entry in the connection list that was *not*
@@ -381,8 +383,8 @@ void QObjectPrivate::cleanConnectionLists()
}
}
- // Correct the connection list's last pointer. As
- // conectionList.last could equal last, this could be a noop
+ // Correct the connection list's last pointer.
+ // As conectionList.last could equal last, this could be a noop
connectionList.last = last;
}
connectionLists->dirty = false;
@@ -904,7 +906,7 @@ QObject::~QObject()
if (d->connectionLists) {
++d->connectionLists->inUse;
for (int signal = -1; signal < d->connectionLists->count(); ++signal) {
- QObjectPrivate::ConnectionList &connectionList =
+ QObjectPrivate::ConnectionList &connectionList =
(*d->connectionLists)[signal];
while (QObjectPrivate::Connection *c = connectionList.first) {
@@ -1089,10 +1091,9 @@ QObjectPrivate::Connection::~Connection()
\snippet doc/src/snippets/code/src_corelib_kernel_qobject.cpp 4
- (\l QLayoutItem is not a QObject.)
-
- Consider using qobject_cast<Type *>(object) instead. The method
- is both faster and safer.
+ If you need to determine whether an object is an instance of a particular
+ class for the purpose of casting it, consider using qobject_cast<Type *>(object)
+ instead.
\sa metaObject(), qobject_cast()
*/
@@ -1170,7 +1171,7 @@ static QObject *qChildHelper(const char *objName, const char *inheritsClass,
more than one, the first one found is returned.
*/
QObject* QObject::child(const char *objName, const char *inheritsClass,
- bool recursiveSearch) const
+ bool recursiveSearch) const
{
Q_D(const QObject);
return qChildHelper(objName, inheritsClass, recursiveSearch, d->children);
@@ -1389,7 +1390,7 @@ bool QObject::eventFilter(QObject * /* watched */, QEvent * /* event */)
/*!
If \a block is true, signals emitted by this object are blocked
(i.e., emitting a signal will not invoke anything connected to it).
- If \a block is false, no such blocking will occur.
+ If \a block is false, no such blocking will occur.
The return value is the previous value of signalsBlocked().
@@ -1681,12 +1682,12 @@ void QObject::killTimer(int id)
#ifdef QT3_SUPPORT
static void objSearch(QObjectList &result,
- const QObjectList &list,
- const char *inheritsClass,
- bool onlyWidgets,
- const char *objName,
- QRegExp *rx,
- bool recurse)
+ const QObjectList &list,
+ const char *inheritsClass,
+ bool onlyWidgets,
+ const char *objName,
+ QRegExp *rx,
+ bool recurse)
{
for (int i = 0; i < list.size(); ++i) {
QObject *obj = list.at(i);
@@ -1756,9 +1757,9 @@ static void objSearch(QObjectList &result,
*/
QObjectList QObject::queryList(const char *inheritsClass,
- const char *objName,
- bool regexpMatch,
- bool recursiveSearch) const
+ const char *objName,
+ bool regexpMatch,
+ bool recursiveSearch) const
{
Q_D(const QObject);
QObjectList list;
@@ -1910,7 +1911,7 @@ QObjectList QObject::queryList(const char *inheritsClass,
\internal
*/
void qt_qFindChildren_helper(const QObject *parent, const QString &name, const QRegExp *re,
- const QMetaObject &mo, QList<void*> *list)
+ const QMetaObject &mo, QList<void*> *list)
{
if (!parent || !list)
return;
@@ -2459,7 +2460,7 @@ QObject *QObject::sender() const
{
Q_D(const QObject);
- QMutexLocker(signalSlotLock(this));
+ QMutexLocker locker(signalSlotLock(this));
if (!d->currentSender)
return 0;
@@ -2518,7 +2519,7 @@ int QObject::receivers(const char *signal) const
QMutexLocker locker(signalSlotLock(this));
if (d->connectionLists) {
if (signal_index < d->connectionLists->count()) {
- const QObjectPrivate::Connection *c =
+ const QObjectPrivate::Connection *c =
d->connectionLists->at(signal_index).first;
while (c) {
receivers += c->receiver ? 1 : 0;
@@ -3010,7 +3011,7 @@ bool QMetaObjectPrivate::connect(const QObject *sender, int signal_index,
if (type & Qt::UniqueConnection) {
QObjectConnectionListVector *connectionLists = QObjectPrivate::get(s)->connectionLists;
if (connectionLists && connectionLists->count() > signal_index) {
- const QObjectPrivate::Connection *c2 =
+ const QObjectPrivate::Connection *c2 =
(*connectionLists)[signal_index].first;
while (c2) {
@@ -3078,16 +3079,52 @@ bool QMetaObject::disconnect(const QObject *sender, int signal_index,
}
/*! \internal
+ Helper function to remove the connection from the senders list and setting the receivers to 0
+ */
+bool QMetaObjectPrivate::disconnectHelper(QObjectPrivate::Connection *c,
+ const QObject *receiver, int method_index,
+ QMutex *senderMutex)
+{
+ bool success = false;
+ while (c) {
+ if (c->receiver
+ && (receiver == 0 || (c->receiver == receiver
+ && (method_index < 0 || c->method == method_index)))) {
+ bool needToUnlock = false;
+ QMutex *receiverMutex = 0;
+ if (!receiver) {
+ receiverMutex = signalSlotLock(c->receiver);
+ // need to relock this receiver and sender in the correct order
+ needToUnlock = QOrderedMutexLocker::relock(senderMutex, receiverMutex);
+ }
+ if (c->receiver) {
+ *c->prev = c->next;
+ if (c->next)
+ c->next->prev = c->prev;
+ }
+
+ if (needToUnlock)
+ receiverMutex->unlock();
+
+ c->receiver = 0;
+
+ success = true;
+ }
+ c = c->nextConnectionList;
+ }
+ return success;
+}
+
+/*! \internal
Same as the QMetaObject::disconnect, but \a signal_index must be the result of QObjectPrivate::signalIndex
*/
bool QMetaObjectPrivate::disconnect(const QObject *sender, int signal_index,
- const QObject *receiver, int method_index)
+ const QObject *receiver, int method_index)
{
if (!sender)
return false;
QObject *s = const_cast<QObject *>(sender);
- QObject *r = const_cast<QObject *>(receiver);
QMutex *senderMutex = signalSlotLock(sender);
QMutex *receiverMutex = receiver ? signalSlotLock(receiver) : 0;
@@ -3104,60 +3141,19 @@ bool QMetaObjectPrivate::disconnect(const QObject *sender, int signal_index,
if (signal_index < 0) {
// remove from all connection lists
for (signal_index = -1; signal_index < connectionLists->count(); ++signal_index) {
- QObjectPrivate::Connection *c =
+ QObjectPrivate::Connection *c =
(*connectionLists)[signal_index].first;
- while (c) {
- if (c->receiver
- && (r == 0 || (c->receiver == r
- && (method_index < 0 || c->method == method_index)))) {
- QMutex *m = signalSlotLock(c->receiver);
- bool needToUnlock = false;
- if (!receiverMutex && senderMutex != m) {
- // need to relock this receiver and sender in the correct order
- needToUnlock = QOrderedMutexLocker::relock(senderMutex, m);
- }
- if (c->receiver) {
- *c->prev = c->next;
- if (c->next) c->next->prev = c->prev;
- }
-
- if (needToUnlock)
- m->unlock();
-
- c->receiver = 0;
-
- success = true;
- connectionLists->dirty = true;
- }
- c = c->nextConnectionList;
+ if (disconnectHelper(c, receiver, method_index, senderMutex)) {
+ success = true;
+ connectionLists->dirty = true;
}
}
} else if (signal_index < connectionLists->count()) {
- QObjectPrivate::Connection *c =
+ QObjectPrivate::Connection *c =
(*connectionLists)[signal_index].first;
- while (c) {
- if (c->receiver
- && (r == 0 || (c->receiver == r
- && (method_index < 0 || c->method == method_index)))) {
- QMutex *m = signalSlotLock(c->receiver);
- bool needToUnlock = false;
- if (!receiverMutex && senderMutex != m) {
- // need to relock this receiver and sender in the correct order
- needToUnlock = QOrderedMutexLocker::relock(senderMutex, m);
- }
- if (c->receiver) {
- *c->prev = c->next;
- if (c->next) c->next->prev = c->prev;
- }
-
- if (needToUnlock)
- m->unlock();
- c->receiver = 0;
-
- success = true;
- connectionLists->dirty = true;
- }
- c = c->nextConnectionList;
+ if (disconnectHelper(c, receiver, method_index, senderMutex)) {
+ success = true;
+ connectionLists->dirty = true;
}
}
@@ -3490,7 +3486,8 @@ int QObjectPrivate::signalIndex(const char *signalName) const
\a signal_index must be the index returned by QObjectPrivate::signalIndex;
*/
-bool QObjectPrivate::isSignalConnected(int signal_index) const {
+bool QObjectPrivate::isSignalConnected(int signal_index) const
+{
if (signal_index < (int)sizeof(connectedSignals) * 8
&& !qt_signal_spy_callback_set.signal_begin_callback
&& !qt_signal_spy_callback_set.signal_end_callback) {
@@ -3720,7 +3717,7 @@ void QObject::dumpObjectInfo()
qDebug(" signal: %s", signal.signature());
// receivers
- const QObjectPrivate::Connection *c =
+ const QObjectPrivate::Connection *c =
d->connectionLists->at(signal_index).first;
while (c) {
if (!c->receiver) {
diff --git a/src/corelib/kernel/qobject.h b/src/corelib/kernel/qobject.h
index aa538bc..d85faee 100644
--- a/src/corelib/kernel/qobject.h
+++ b/src/corelib/kernel/qobject.h
@@ -381,7 +381,7 @@ inline QList<T> qFindChildren(const QObject *o, const QRegExp &re)
#endif // Q_MOC_RUN
-template <class T> inline const char * qobject_interface_iid()
+template <class T> inline const char * qobject_interface_iid()
{ return 0; }
template <class T> inline T qobject_cast_helper(QObject *object, T)
@@ -465,7 +465,7 @@ inline T qobject_cast(const QObject *object)
}
-template <class T> inline const char * qobject_interface_iid()
+template <class T> inline const char * qobject_interface_iid()
{ return 0; }
#ifndef Q_MOC_RUN
diff --git a/src/corelib/kernel/qobjectdefs.h b/src/corelib/kernel/qobjectdefs.h
index 421617a..3f990a3 100644
--- a/src/corelib/kernel/qobjectdefs.h
+++ b/src/corelib/kernel/qobjectdefs.h
@@ -150,6 +150,7 @@ inline void qYouForgotTheQ_OBJECT_Macro(T1, T2) {}
public: \
Q_OBJECT_CHECK \
static const QMetaObject staticMetaObject; \
+ static const QMetaObject &getStaticMetaObject(); \
virtual const QMetaObject *metaObject() const; \
virtual void *qt_metacast(const char *); \
QT_TR_FUNCTIONS \
@@ -161,6 +162,7 @@ private:
#define Q_GADGET \
public: \
static const QMetaObject staticMetaObject; \
+ static const QMetaObject &getStaticMetaObject(); \
private:
#else // Q_MOC_RUN
#define slots slots
@@ -444,9 +446,15 @@ struct Q_CORE_EXPORT QMetaObject
};
+typedef const QMetaObject& (*QMetaObjectAccessor)();
+
struct QMetaObjectExtraData
{
+#ifdef Q_NO_DATA_RELOCATION
+ const QMetaObjectAccessor *objects;
+#else
const QMetaObject **objects;
+#endif
int (*static_metacall)(QMetaObject::Call, int, void **);
};
diff --git a/src/corelib/statemachine/qabstracttransition_p.h b/src/corelib/statemachine/qabstracttransition_p.h
index 328be16..33e4474 100644
--- a/src/corelib/statemachine/qabstracttransition_p.h
+++ b/src/corelib/statemachine/qabstracttransition_p.h
@@ -75,7 +75,7 @@ public:
static QAbstractTransitionPrivate *get(QAbstractTransition *q);
bool callEventTest(QEvent *e);
- void callOnTransition(QEvent *e);
+ virtual void callOnTransition(QEvent *e);
QState *sourceState() const;
QStateMachine *machine() const;
void emitTriggered();
diff --git a/src/corelib/statemachine/qsignalevent.h b/src/corelib/statemachine/qsignalevent.h
index 7e5d888..de166f4 100644
--- a/src/corelib/statemachine/qsignalevent.h
+++ b/src/corelib/statemachine/qsignalevent.h
@@ -70,6 +70,8 @@ private:
QObject *m_sender;
int m_signalIndex;
QList<QVariant> m_arguments;
+
+ friend class QSignalTransitionPrivate;
};
#endif //QT_NO_STATEMACHINE
diff --git a/src/corelib/statemachine/qsignaltransition.cpp b/src/corelib/statemachine/qsignaltransition.cpp
index e34448f..fb28c08 100644
--- a/src/corelib/statemachine/qsignaltransition.cpp
+++ b/src/corelib/statemachine/qsignaltransition.cpp
@@ -245,6 +245,23 @@ bool QSignalTransition::event(QEvent *e)
return QAbstractTransition::event(e);
}
+void QSignalTransitionPrivate::callOnTransition(QEvent *e)
+{
+ Q_Q(QSignalTransition);
+
+ QSignalEvent *se = static_cast<QSignalEvent *>(e);
+ int savedSignalIndex;
+ if (e->type() == QEvent::Signal) {
+ savedSignalIndex = se->m_signalIndex;
+ se->m_signalIndex = originalSignalIndex;
+ }
+
+ q->onTransition(e);
+
+ if (e->type() == QEvent::Signal)
+ se->m_signalIndex = savedSignalIndex;
+}
+
QT_END_NAMESPACE
#endif //QT_NO_STATEMACHINE
diff --git a/src/corelib/statemachine/qsignaltransition_p.h b/src/corelib/statemachine/qsignaltransition_p.h
index 21082ab..69bbcc9 100644
--- a/src/corelib/statemachine/qsignaltransition_p.h
+++ b/src/corelib/statemachine/qsignaltransition_p.h
@@ -69,9 +69,12 @@ public:
void unregister();
void maybeRegister();
+ virtual void callOnTransition(QEvent *e);
+
QObject *sender;
QByteArray signal;
int signalIndex;
+ int originalSignalIndex;
};
QT_END_NAMESPACE
diff --git a/src/corelib/statemachine/qstatemachine.cpp b/src/corelib/statemachine/qstatemachine.cpp
index d6946de..e5bca2c 100644
--- a/src/corelib/statemachine/qstatemachine.cpp
+++ b/src/corelib/statemachine/qstatemachine.cpp
@@ -1408,6 +1408,7 @@ void QStateMachinePrivate::registerSignalTransition(QSignalTransition *transitio
signal.remove(0, 1);
const QMetaObject *meta = sender->metaObject();
int signalIndex = meta->indexOfSignal(signal);
+ int originalSignalIndex = signalIndex;
if (signalIndex == -1) {
signalIndex = meta->indexOfSignal(QMetaObject::normalizedSignature(signal));
if (signalIndex == -1) {
@@ -1416,6 +1417,11 @@ void QStateMachinePrivate::registerSignalTransition(QSignalTransition *transitio
return;
}
}
+ // The signal index we actually want to connect to is the one
+ // that is going to be sent, i.e. the non-cloned original index.
+ while (meta->method(signalIndex).attributes() & QMetaMethod::Cloned)
+ --signalIndex;
+
QVector<int> &connectedSignalIndexes = connections[sender];
if (connectedSignalIndexes.size() <= signalIndex)
connectedSignalIndexes.resize(signalIndex+1);
@@ -1435,6 +1441,7 @@ void QStateMachinePrivate::registerSignalTransition(QSignalTransition *transitio
}
++connectedSignalIndexes[signalIndex];
QSignalTransitionPrivate::get(transition)->signalIndex = signalIndex;
+ QSignalTransitionPrivate::get(transition)->originalSignalIndex = originalSignalIndex;
#ifdef QSTATEMACHINE_DEBUG
qDebug() << q << ": added signal transition from" << transition->sourceState()
<< ": ( sender =" << sender << ", signal =" << signal
diff --git a/src/corelib/thread/qthread_win.cpp b/src/corelib/thread/qthread_win.cpp
index 82b462e..12ee413 100644
--- a/src/corelib/thread/qthread_win.cpp
+++ b/src/corelib/thread/qthread_win.cpp
@@ -39,6 +39,10 @@
**
****************************************************************************/
+//#define WINVER 0x0500
+#define _WIN32_WINNT 0x0400
+
+
#include "qthread.h"
#include "qthread_p.h"
#include "qthreadstorage.h"
diff --git a/src/corelib/tools/qlocale_symbian.cpp b/src/corelib/tools/qlocale_symbian.cpp
index 3103ba1..2da768b 100644
--- a/src/corelib/tools/qlocale_symbian.cpp
+++ b/src/corelib/tools/qlocale_symbian.cpp
@@ -76,8 +76,8 @@ static TPtrC defaultFormatSpec(TExtendedLocale&)
return TPtrC(KNullDesC);
}
-/*!
- Definition of struct for mapping Symbian to ISO locale
+/*
+ Definition of struct for mapping Symbian to ISO locale
*/
struct symbianToISO {
int symbian_language;
@@ -85,8 +85,8 @@ struct symbianToISO {
};
-/*!
- Mapping from Symbian to ISO locale
+/*
+ Mapping from Symbian to ISO locale
*/
static const symbianToISO symbian_to_iso_list[] = {
{ ELangEnglish, "en_GB" },
diff --git a/src/corelib/tools/qscopedpointer.cpp b/src/corelib/tools/qscopedpointer.cpp
index ef6cc39..5296bae 100644
--- a/src/corelib/tools/qscopedpointer.cpp
+++ b/src/corelib/tools/qscopedpointer.cpp
@@ -170,7 +170,7 @@ QT_BEGIN_NAMESPACE
*/
/*!
- \fn bool QScopedPointer::operator==(const QScopedPointer<T> &other) const
+ \fn bool QScopedPointer::operator==(const QScopedPointer<T, Cleanup> &other) const
Equality operator. Returns true if the scoped pointer \a other
is pointing to the same object as this pointer, otherwise returns false.
@@ -178,7 +178,7 @@ QT_BEGIN_NAMESPACE
/*!
- \fn bool QScopedPointer::operator!=(const QScopedPointer<T> &other) const
+ \fn bool QScopedPointer::operator!=(const QScopedPointer<T, Cleanup> &other) const
Inequality operator. Returns true if the scoped pointer \a other
is not pointing to the same object as this pointer, otherwise returns false.
diff --git a/src/corelib/tools/qsharedpointer_impl.h b/src/corelib/tools/qsharedpointer_impl.h
index 90ca34f..e4f7ba9 100644
--- a/src/corelib/tools/qsharedpointer_impl.h
+++ b/src/corelib/tools/qsharedpointer_impl.h
@@ -511,7 +511,7 @@ public:
QWeakPointer<T> toWeakRef() const;
protected:
- inline QSharedPointer(Qt::Initialization i) : BaseClass(i) {}
+ inline explicit QSharedPointer(Qt::Initialization i) : BaseClass(i) {}
public:
static inline QSharedPointer<T> create()
diff --git a/src/corelib/tools/qstringbuilder.h b/src/corelib/tools/qstringbuilder.h
index a93a638..9be57c5 100644
--- a/src/corelib/tools/qstringbuilder.h
+++ b/src/corelib/tools/qstringbuilder.h
@@ -44,6 +44,12 @@
#include <QtCore/qstring.h>
+#if defined(Q_CC_GNU) && !defined(Q_CC_INTEL)
+# if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ == 0)
+# include <QtCore/qmap.h>
+# endif
+#endif
+
#include <string.h>
QT_BEGIN_HEADER
diff --git a/src/gui/accessible/qaccessible_mac_cocoa.mm b/src/gui/accessible/qaccessible_mac_cocoa.mm
index 502827c..41a2566 100644
--- a/src/gui/accessible/qaccessible_mac_cocoa.mm
+++ b/src/gui/accessible/qaccessible_mac_cocoa.mm
@@ -59,9 +59,9 @@ QT_BEGIN_NAMESPACE
//#define MAC_ACCESSIBILTY_DEVELOPER_MODE
#ifdef MAC_ACCESSIBILTY_DEVELOPER_MODE
-#define MAC_ACCESSIBILTY_DEBUG qDebug
+#define MAC_ACCESSIBILTY_DEBUG QT_PREPEND_NAMESPACE(qDebug)
#else
-#define MAC_ACCESSIBILTY_DEBUG if (0) qDebug
+#define MAC_ACCESSIBILTY_DEBUG if (0) QT_PREPEND_NAMESPACE(qDebug)
#endif
typedef QMap<QAccessible::Role, NSString *> QMacAccessibiltyRoleMap;
@@ -195,13 +195,13 @@ QT_END_NAMESPACE
- (BOOL)accessibilityIsIgnored
{
- QAInterface interface = interfaceForView(self);
+ QT_PREPEND_NAMESPACE(QAInterface) interface = QT_PREPEND_NAMESPACE(interfaceForView)(self);
return isInterfaceIgnored(interface);
}
- (NSArray *)accessibilityAttributeNames
{
- QAInterface interface = interfaceForView(self);
+ QT_PREPEND_NAMESPACE(QAInterface) interface = QT_PREPEND_NAMESPACE(interfaceForView)(self);
static NSArray *attributes = nil;
if (attributes == nil) {
@@ -213,9 +213,10 @@ QT_END_NAMESPACE
- (id)accessibilityAttributeValue:(NSString *)attribute
{
- MAC_ACCESSIBILTY_DEBUG() << "accessibilityAttributeValue" << self << QCFString::toQString(reinterpret_cast<CFStringRef>(attribute));
+ MAC_ACCESSIBILTY_DEBUG() << "accessibilityAttributeValue" << self <<
+ QT_PREPEND_NAMESPACE(QCFString)::toQString(reinterpret_cast<CFStringRef>(attribute));
- QAInterface interface = interfaceForView(self);
+ QT_PREPEND_NAMESPACE(QAInterface) interface = QT_PREPEND_NAMESPACE(interfaceForView)(self);
// Switch on the attribute name and call the appropriate handler function.
// Pass the call on to the NSView class for attributes we don't handle.
diff --git a/src/gui/effects/qgraphicseffect.cpp b/src/gui/effects/qgraphicseffect.cpp
index a6aef52..50644ff 100644
--- a/src/gui/effects/qgraphicseffect.cpp
+++ b/src/gui/effects/qgraphicseffect.cpp
@@ -61,15 +61,17 @@
Qt provides the following standard effects:
\list
- \o QGraphicsGrayScaleEffect - renders the item in shades of gray
- \o QGraphicsColorizeEffect - renders the item in shades of any given color
- \o QGraphicsPixelizeEffect - pixelizes the item with any pixel size
\o QGraphicsBlurEffect - blurs the item by a given radius
\o QGraphicsDropShadowEffect - renders a dropshadow behind the item
+ \o QGraphicsColorizeEffect - renders the item in shades of any given color
\o QGraphicsOpacityEffect - renders the item with an opacity
- \o QGrahicsShaderEffect - renders the item with a pixel shader fragment
+ \o QGraphicsPixelizeEffect - pixelizes the item with any pixel size
+ \o QGraphicsGrayscaleEffect - renders the item in shades of gray
+ \o QGraphicsShaderEffect - renders the item with a pixel shader fragment
\endlist
+ \img graphicseffect-effects.png
+ \img graphicseffect-widget.png
For more information on how to use each effect, refer to the specific
effect's documentation.
@@ -108,33 +110,41 @@ QT_BEGIN_NAMESPACE
/*!
\class QGraphicsEffectSource
- \brief The QGraphicsEffectSource represents the source on which a
+ \brief The QGraphicsEffectSource class represents the source on which a
QGraphicsEffect is installed on.
\since 4.6
- When a QGraphicsEffect is installed on a QGraphicsItem, for example, this class will act as
- a wrapper around QGraphicsItem. E.g. calling update() is effectively the same as
- calling QGraphicsItem::update().
+ When a QGraphicsEffect is installed on a QGraphicsItem, for example, this
+ class will act as a wrapper around QGraphicsItem. Then, calling update() is
+ effectively the same as calling QGraphicsItem::update().
- It also provides a pixmap() function which creates a pixmap with the source
- painted into it.
+ QGraphicsEffectSource also provides a pixmap() function which creates a
+ pixmap with the source painted into it.
- \sa QGraphicsItem::setGraphicsEffect(), QWidget::setGraphicsEffect.
+ \sa QGraphicsItem::setGraphicsEffect(), QWidget::setGraphicsEffect().
+*/
+
+/*!
+ \internal
*/
QGraphicsEffectSource::QGraphicsEffectSource(QGraphicsEffectSourcePrivate &dd, QObject *parent)
: QObject(dd, parent)
{}
+/*!
+ Destroys the effect source.
+*/
QGraphicsEffectSource::~QGraphicsEffectSource()
{}
/*!
Returns the bounds of the current painter's device.
- This function is useful when you e.g. want to draw something in device coordinates
- and want to make sure the size of the pixmap is not bigger than the device's size.
+ This function is useful when you want to draw something in device
+ coordinates and ensure the size of the pixmap is not bigger than the size
+ of the device.
- Note that calling QGraphicsEffectSource::pixmap(Qt::DeviceCoordinates) always returns
+ Calling QGraphicsEffectSource::pixmap(Qt::DeviceCoordinates) always returns
a pixmap which is bound to the device's size.
\sa pixmap()
@@ -145,7 +155,7 @@ QRect QGraphicsEffectSource::deviceRect() const
}
/*!
- Returns the bounding rectangle of the source mapped to the \a system specified.
+ Returns the bounding rectangle of the source mapped to the given \a system.
\sa draw()
*/
@@ -155,8 +165,8 @@ QRectF QGraphicsEffectSource::boundingRect(Qt::CoordinateSystem system) const
}
/*!
- Returns a pointer to the item if this source is a QGraphicsItem;
- otherwise returns 0;
+ Returns a pointer to the item if this source is a QGraphicsItem; otherwise
+ returns 0.
\sa widget()
*/
@@ -166,8 +176,8 @@ const QGraphicsItem *QGraphicsEffectSource::graphicsItem() const
}
/*!
- Returns a pointer to the widget if this source is a QWidget;
- otherwise returns 0;
+ Returns a pointer to the widget if this source is a QWidget; otherwise
+ returns 0.
\sa graphicsItem()
*/
@@ -177,8 +187,8 @@ const QWidget *QGraphicsEffectSource::widget() const
}
/*!
- Returns a pointer to the style options (used when drawing the source)
- if available; otherwise returns 0.
+ Returns a pointer to the style options (used when drawing the source) if
+ available; otherwise returns 0.
\sa graphicsItem(), widget()
*/
@@ -188,26 +198,27 @@ const QStyleOption *QGraphicsEffectSource::styleOption() const
}
/*!
- Draws the source using the \a painter specified.
+ Draws the source using the given \a painter.
This function should only be called from QGraphicsEffect::draw().
+
For example:
\snippet doc/src/snippets/code/src_gui_effects_qgraphicseffect.cpp 0
\sa QGraphicsEffect::draw()
*/
-
void QGraphicsEffectSource::draw(QPainter *painter)
{
d_func()->draw(painter);
}
/*!
- Schedules a redraw of the source. You can call this function whenever the
- source needs to be redrawn.
+ Schedules a redraw of the source. Call this function whenever the source
+ needs to be redrawn.
- \sa QGraphicsEffect::updateBoundingRect(), QWidget::update(), QGraphicsItem::update(),
+ \sa QGraphicsEffect::updateBoundingRect(), QWidget::update(),
+ QGraphicsItem::update(),
*/
void QGraphicsEffectSource::update()
{
@@ -215,11 +226,12 @@ void QGraphicsEffectSource::update()
}
/*!
- Returns true if the source effectively is a pixmap, e.g. a QGraphicsPixmapItem.
+ Returns true if the source effectively is a pixmap, e.g., a
+ QGraphicsPixmapItem.
- This function is useful for optimization purposes, e.g. there's no point in
- drawing the source in device coordinates to avoid pixmap scaling if this function
- returns true; the source pixmap will be scaled anyways.
+ This function is useful for optimization purposes. For instance, there's no
+ point in drawing the source in device coordinates to avoid pixmap scaling
+ if this function returns true - the source pixmap will be scaled anyways.
*/
bool QGraphicsEffectSource::isPixmap() const
{
@@ -227,13 +239,14 @@ bool QGraphicsEffectSource::isPixmap() const
}
/*!
- Returns a pixmap with the source painted into it. The \a system specifies which
- coordinate system to be used for the source. The optional out parameter
- \a offset returns the offset of which the pixmap should be painted
- at using the current painter.
+ Returns a pixmap with the source painted into it.
+
+ The \a system specifies which coordinate system to be used for the source.
+ The optional \a offset parameter returns the offset where the pixmap should
+ be painted at using the current painter.
- Note that the returned pixmap is bound to the current painter's device
- rect when the specified \a system is Qt::DeviceCoordinates.
+ The returned pixmap is bound to the current painter's device rectangle when
+ \a system is Qt::DeviceCoordinates.
\sa QGraphicsEffect::draw(), boundingRect(), deviceRect()
*/
@@ -268,9 +281,9 @@ QGraphicsEffect::~QGraphicsEffect()
}
/*!
- Returns the bounding rectangle for this effect (i.e., the bounding
+ Returns the bounding rectangle for this effect, i.e., the bounding
rectangle of the source, adjusted by any margins applied by the effect
- itself).
+ itself.
\sa boundingRectFor(), updateBoundingRect()
*/
@@ -300,13 +313,13 @@ QRectF QGraphicsEffect::boundingRectFor(const QRectF &rect) const
\brief whether the effect is enabled or not.
If an effect is disabled, the source will be rendered with as normal, with
- no interference from the effect. If the effect is enabled (default), the
- source will be rendered with the effect applied.
+ no interference from the effect. If the effect is enabled, the source will
+ be rendered with the effect applied.
- This property is provided so that you can disable certain effects on slow
- platforms, in order to ensure that the user interface is responsive.
+ This property is enabled by default.
- \sa enabledChanged()
+ Using this property, you can disable certain effects on slow platforms, in
+ order to ensure that the user interface is responsive.
*/
bool QGraphicsEffect::isEnabled() const
{
@@ -330,6 +343,7 @@ void QGraphicsEffect::setEnabled(bool enable)
\fn void QGraphicsEffect::enabledChanged(bool enabled)
This signal is emitted whenever the effect is enabled or disabled.
+ The \a enabled parameter holds the effects's new enabled state.
\sa isEnabled()
*/
@@ -347,7 +361,7 @@ QGraphicsEffectSource *QGraphicsEffect::source() const
}
/*!
- This function notifies the effect framework that the effect's bounding
+ This function notifies the effect framework when the effect's bounding
rectangle has changed. As a custom effect author, you must call this
function whenever you change any parameters that will cause the virtual
boundingRectFor() function to return a different value.
@@ -365,17 +379,19 @@ void QGraphicsEffect::updateBoundingRect()
\fn virtual void QGraphicsEffect::draw(QPainter *painter,
QGraphicsEffectSource *source) = 0
- This pure virtual function draws the effect and is called whenever the source()
- needs to be drawn.
+ This pure virtual function draws the effect and is called whenever the
+ source() needs to be drawn.
- Reimplement this function in a QGraphicsEffect subclass to provide the effect's
- drawing implementation, using \a painter. The \a source parameter is provided
- for convenience; its value is the same as source(). Example:
+ Reimplement this function in a QGraphicsEffect subclass to provide the
+ effect's drawing implementation, using \a painter. The \a source parameter
+ is provided for convenience; its value is the same as source().
+
+ For example:
\snippet doc/src/snippets/code/src_gui_effects_qgraphicseffect.cpp 1
- Note that this function should not be called explicitly by the user, since it's
- meant for re-implementation purposes only.
+ This function should not be called explicitly by the user, since it is
+ meant for reimplementation purposes only.
\sa QGraphicsEffectSource
*/
@@ -387,7 +403,8 @@ void QGraphicsEffect::updateBoundingRect()
\value SourceAttached The effect is installed on a source.
\value SourceDetached The effect is uninstalled on a source.
- \value SourceBoundingRectChanged The bounding rect of the source has changed.
+ \value SourceBoundingRectChanged The bounding rect of the source has
+ changed.
\value SourceInvalidated The visual appearance of the source has changed.
*/
@@ -410,17 +427,31 @@ void QGraphicsEffect::sourceChanged(ChangeFlags flags)
A grayscale effect renders the source in shades of gray.
- \sa QGraphicsColorizeEffect
+ \img graphicseffect-grayscale.png
+
+ \sa QGraphicsDropShadowEffect, QGraphicsBlurEffect, QGraphicsPixelizeEffect,
+ QGraphicsColorizeEffect, QGraphicsOpacityEffect
+*/
+
+/*!
+ Constructs a new QGraphicsGrayscale instance.
+ The \a parent parameter is passed to QGraphicsEffect's constructor.
*/
QGraphicsGrayscaleEffect::QGraphicsGrayscaleEffect(QObject *parent)
: QGraphicsEffect(*new QGraphicsGrayscaleEffectPrivate, parent)
{
}
+/*!
+ Destroys the effect.
+*/
QGraphicsGrayscaleEffect::~QGraphicsGrayscaleEffect()
{
}
+/*!
+ \reimp
+*/
void QGraphicsGrayscaleEffect::draw(QPainter *painter, QGraphicsEffectSource *source)
{
Q_D(QGraphicsGrayscaleEffect);
@@ -443,41 +474,48 @@ void QGraphicsGrayscaleEffect::draw(QPainter *painter, QGraphicsEffectSource *so
/*!
\class QGraphicsColorizeEffect
- \brief The QGraphicsColorizeEffect provides a colorize effect.
+ \brief The QGraphicsColorizeEffect class provides a colorize effect.
\since 4.6
- A colorize effect renders the source with a tint of its color(). The
- color can be modified using the setColor() function.
+ A colorize effect renders the source with a tint of its color(). The color
+ can be modified using the setColor() function.
By default, the color is light blue (QColor(0, 0, 192)).
- \sa QGraphicsGrayscaleEffect
+ \img graphicseffect-colorize.png
+
+ \sa QGraphicsDropShadowEffect, QGraphicsBlurEffect, QGraphicsPixelizeEffect,
+ QGraphicsGrayscaleEffect, QGraphicsOpacityEffect
+*/
+
+/*!
+ Constructs a new QGraphicsColorizeEffect instance.
+ The \a parent parameter is passed to QGraphicsEffect's constructor.
*/
QGraphicsColorizeEffect::QGraphicsColorizeEffect(QObject *parent)
: QGraphicsEffect(*new QGraphicsColorizeEffectPrivate, parent)
{
}
+/*!
+ Destroys the effect.
+*/
QGraphicsColorizeEffect::~QGraphicsColorizeEffect()
{
}
/*!
- Returns the color.
+ \property QGraphicsColorizeEffect::color
+ \brief the color of the effect.
- \sa setColor(), colorChanged()
-*/
+ By default, the color is light blue (QColor(0, 0, 192)).
+*/;
QColor QGraphicsColorizeEffect::color() const
{
Q_D(const QGraphicsColorizeEffect);
return d->filter->color();
}
-/*!
- Sets the color to the \a color specified.
-
- \sa color(), colorChanged()
-*/
void QGraphicsColorizeEffect::setColor(const QColor &color)
{
Q_D(QGraphicsColorizeEffect);
@@ -492,8 +530,12 @@ void QGraphicsColorizeEffect::setColor(const QColor &color)
\fn void QGraphicsColorizeEffect::colorChanged(const QColor &color)
This signal is emitted whenever the effect's color changes.
+ The \a color parameter holds the effect's new color.
*/
+/*!
+ \reimp
+*/
void QGraphicsColorizeEffect::draw(QPainter *painter, QGraphicsEffectSource *source)
{
Q_D(QGraphicsColorizeEffect);
@@ -515,30 +557,45 @@ void QGraphicsColorizeEffect::draw(QPainter *painter, QGraphicsEffectSource *sou
/*!
\class QGraphicsPixelizeEffect
- \brief The QGraphicsPixelizeEffect provides a pixelize effect.
+ \brief The QGraphicsPixelizeEffect class provides a pixelize effect.
\since 4.6
- A pixelize effect renders the source in lower resolution. This effect
- is useful for reducing details, in e.g. a censorship. The resolution
- can be modified using the setPixelSize() function.
+ A pixelize effect renders the source in lower resolution. This effect is
+ useful for reducing details, like censorship. The resolution can be
+ modified using the setPixelSize() function.
By default, the pixel size is 3.
- \sa QGraphicsBlurEffect
+ \img graphicseffect-pixelize.png
+
+ \sa QGraphicsDropShadowEffect, QGraphicsBlurEffect, QGraphicsGrayscaleEffect,
+ QGraphicsColorizeEffect, QGraphicsOpacityEffect
+*/
+
+/*!
+ Constructs a new QGraphicsPixelizeEffect instance.
+ The \a parent parameter is passed to QGraphicsEffect's constructor.
*/
QGraphicsPixelizeEffect::QGraphicsPixelizeEffect(QObject *parent)
: QGraphicsEffect(*new QGraphicsPixelizeEffectPrivate, parent)
{
}
+/*!
+ Destroys the effect.
+*/
QGraphicsPixelizeEffect::~QGraphicsPixelizeEffect()
{
}
/*!
- Returns the size of a pixel.
+ \property QGraphicsPixelizeEffect::pixelSize
+ \brief the size of a pixel in the effect.
- \sa setPixelSize(), pixelSizeChanged()
+ Setting the pixel size to 2 means two pixels in the source will be used to
+ represent one pixel. Using a bigger size results in lower resolution.
+
+ By default, the pixel size is 3.
*/
int QGraphicsPixelizeEffect::pixelSize() const
{
@@ -546,15 +603,6 @@ int QGraphicsPixelizeEffect::pixelSize() const
return d->pixelSize;
}
-/*!
- Sets the size of a pixel to the \a size specified.
-
- Setting the \a size to e.g. 2 means two pixels in the source will
- be used to represent one pixel. Using a bigger size results in
- lower resolution.
-
- \sa pixelSize(), pixelSizeChanged()
-*/
void QGraphicsPixelizeEffect::setPixelSize(int size)
{
Q_D(QGraphicsPixelizeEffect);
@@ -569,6 +617,7 @@ void QGraphicsPixelizeEffect::setPixelSize(int size)
\fn void QGraphicsPixelizeEffect::pixelSizeChanged(int size)
This signal is emitted whenever the effect's pixel size changes.
+ The \a size parameter holds the effect's new pixel size.
*/
static inline void pixelize(QImage *image, int pixelSize)
@@ -592,6 +641,9 @@ static inline void pixelize(QImage *image, int pixelSize)
}
}
+/*!
+ \reimp
+*/
void QGraphicsPixelizeEffect::draw(QPainter *painter, QGraphicsEffectSource *source)
{
Q_D(QGraphicsPixelizeEffect);
@@ -624,31 +676,46 @@ void QGraphicsPixelizeEffect::draw(QPainter *painter, QGraphicsEffectSource *sou
/*!
\class QGraphicsBlurEffect
- \brief The QGraphicsBlurEffect provides a blur effect.
+ \brief The QGraphicsBlurEffect class provides a blur effect.
\since 4.6
A blur effect blurs the source. This effect is useful for reducing details,
- e.g. when the source loses focus and you want to draw attention to other
+ such as when the source loses focus and you want to draw attention to other
elements. The level of detail can be modified using the setBlurRadius()
function.
By default, the blur radius is 5 pixels.
- \sa QGraphicsPixelizeEffect
+ \img graphicseffect-blur.png
+
+ \sa QGraphicsDropShadowEffect, QGraphicsPixelizeEffect, QGraphicsGrayscaleEffect,
+ QGraphicsColorizeEffect, QGraphicsOpacityEffect
+*/
+
+/*!
+ Constructs a new QGraphicsBlurEffect instance.
+ The \a parent parameter is passed to QGraphicsEffect's constructor.
*/
QGraphicsBlurEffect::QGraphicsBlurEffect(QObject *parent)
: QGraphicsEffect(*new QGraphicsBlurEffectPrivate, parent)
{
}
+/*!
+ Destroys the effect.
+*/
QGraphicsBlurEffect::~QGraphicsBlurEffect()
{
}
/*!
- Returns the blur radius.
+ \property QGraphicsBlurEffect::blurRadius
+ \brief the blur radius of the effect.
- \sa setBlurRadius(), blurRadiusChanged()
+ Using a smaller radius results in a sharper appearance, whereas a bigger
+ radius results in a more blurred appearance.
+
+ By default, the blur radius is 5 pixels.
*/
int QGraphicsBlurEffect::blurRadius() const
{
@@ -656,14 +723,6 @@ int QGraphicsBlurEffect::blurRadius() const
return d->filter->radius();
}
-/*!
- Sets the blur radius to the \a radius specified.
-
- Using a smaller radius results in a sharper appearance, whereas a
- bigger radius results in a more blurry appearance.
-
- \sa blurRadius(), blurRadiusChanged()
-*/
void QGraphicsBlurEffect::setBlurRadius(int radius)
{
Q_D(QGraphicsBlurEffect);
@@ -679,14 +738,21 @@ void QGraphicsBlurEffect::setBlurRadius(int radius)
\fn void QGraphicsBlurEffect::blurRadiusChanged(int radius)
This signal is emitted whenever the effect's blur radius changes.
+ The \a radius parameter holds the effect's new blur radius.
*/
+/*!
+ \reimp
+*/
QRectF QGraphicsBlurEffect::boundingRectFor(const QRectF &rect) const
{
Q_D(const QGraphicsBlurEffect);
return d->filter->boundingRectFor(rect);
}
+/*!
+ \reimp
+*/
void QGraphicsBlurEffect::draw(QPainter *painter, QGraphicsEffectSource *source)
{
Q_D(QGraphicsBlurEffect);
@@ -717,28 +783,44 @@ void QGraphicsBlurEffect::draw(QPainter *painter, QGraphicsEffectSource *source)
\since 4.6
A drop shadow effect renders the source with a drop shadow. The color of
- the drop shadow can be modified using the setColor() function, the drop
- shadow offset can be modified using the setOffset function, and the blur
- radius of the drop shadow can be changed through the setBlurRadius()
+ the drop shadow can be modified using the setColor() function. The drop
+ shadow offset can be modified using the setOffset() function and the blur
+ radius of the drop shadow can be changed with the setBlurRadius()
function.
By default, the drop shadow is a semi-transparent dark gray
- (QColor(63, 63, 63, 180)) shadow, blurred with a radius of 1 at an
- offset of 8 pixels towards the lower right.
+ (QColor(63, 63, 63, 180)) shadow, blurred with a radius of 1 at an offset
+ of 8 pixels towards the lower right.
+
+ \img graphicseffect-drop-shadow.png
+
+ \sa QGraphicsBlurEffect, QGraphicsPixelizeEffect, QGraphicsGrayscaleEffect,
+ QGraphicsColorizeEffect, QGraphicsOpacityEffect
+*/
+
+/*!
+ Constructs a new QGraphicsDropShadowEffect instance.
+ The \a parent parameter is passed to QGraphicsEffect's constructor.
*/
QGraphicsDropShadowEffect::QGraphicsDropShadowEffect(QObject *parent)
: QGraphicsEffect(*new QGraphicsDropShadowEffectPrivate, parent)
{
}
+/*!
+ Destroys the effect.
+*/
QGraphicsDropShadowEffect::~QGraphicsDropShadowEffect()
{
}
/*!
- Returns the shadow offset in pixels.
+ \property QGraphicsDropShadowEffect::offset
+ \brief the shadow offset in pixels.
- \sa setOffset(), blurRadius(), color(), offsetChanged()
+ By default, the offset is 8 pixels towards the lower right.
+
+ \sa blurRadius(), color()
*/
QPointF QGraphicsDropShadowEffect::offset() const
{
@@ -746,11 +828,6 @@ QPointF QGraphicsDropShadowEffect::offset() const
return d->filter->offset();
}
-/*!
- Sets the shadow offset in pixels to the \a offset specified.
-
- \sa offset(), setBlurRadius(), setColor(), offsetChanged()
-*/
void QGraphicsDropShadowEffect::setOffset(const QPointF &offset)
{
Q_D(QGraphicsDropShadowEffect);
@@ -766,12 +843,19 @@ void QGraphicsDropShadowEffect::setOffset(const QPointF &offset)
\fn void QGraphicsDropShadowEffect::offsetChanged(const QPointF &offset)
This signal is emitted whenever the effect's shadow offset changes.
+ The \a offset parameter holds the effect's new shadow offset.
*/
/*!
- Returns the radius in pixels of the blur on the drop shadow.
+ \property QGraphicsDropShadowEffect::blurRadius
+ \brief the blur radius in pixels of the drop shadow.
+
+ Using a smaller radius results in a sharper shadow, whereas using a bigger
+ radius results in a more blurred shadow.
+
+ By default, the blur radius is 1 pixel.
- \sa setBlurRadius(), color(), offset(), blurRadiusChanged()
+ \sa color(), offset().
*/
int QGraphicsDropShadowEffect::blurRadius() const
{
@@ -779,15 +863,6 @@ int QGraphicsDropShadowEffect::blurRadius() const
return d->filter->blurRadius();
}
-/*!
- Sets the radius in pixels of the blur on the drop shadow to the
- \a blurRadius specified.
-
- Using a smaller radius results in a sharper shadow, whereas using
- a bigger radius results in a more blurry shadow.
-
- \sa blurRadius(), setColor(), setOffset(), blurRadiusChanged()
-*/
void QGraphicsDropShadowEffect::setBlurRadius(int blurRadius)
{
Q_D(QGraphicsDropShadowEffect);
@@ -803,12 +878,17 @@ void QGraphicsDropShadowEffect::setBlurRadius(int blurRadius)
\fn void QGraphicsDropShadowEffect::blurRadiusChanged(int blurRadius)
This signal is emitted whenever the effect's blur radius changes.
+ The \a blurRadius parameter holds the effect's new blur radius.
*/
/*!
- Returns the color of the drop shadow.
+ \property QGraphicsDropShadowEffect::color
+ \brief the color of the drop shadow.
- \sa setColor, offset(), blurRadius(), colorChanged()
+ By default, the drop color is a semi-transparent dark gray
+ (QColor(63, 63, 63, 180)).
+
+ \sa offset(), blurRadius()
*/
QColor QGraphicsDropShadowEffect::color() const
{
@@ -816,11 +896,6 @@ QColor QGraphicsDropShadowEffect::color() const
return d->filter->color();
}
-/*!
- Sets the color of the drop shadow to the \a color specified.
-
- \sa color(), setOffset(), setBlurRadius(), colorChanged()
-*/
void QGraphicsDropShadowEffect::setColor(const QColor &color)
{
Q_D(QGraphicsDropShadowEffect);
@@ -835,14 +910,21 @@ void QGraphicsDropShadowEffect::setColor(const QColor &color)
\fn void QGraphicsDropShadowEffect::colorChanged(const QColor &color)
This signal is emitted whenever the effect's color changes.
+ The \a color parameter holds the effect's new color.
*/
+/*!
+ \reimp
+*/
QRectF QGraphicsDropShadowEffect::boundingRectFor(const QRectF &rect) const
{
Q_D(const QGraphicsDropShadowEffect);
return d->filter->boundingRectFor(rect);
}
+/*!
+ \reimp
+*/
void QGraphicsDropShadowEffect::draw(QPainter *painter, QGraphicsEffectSource *source)
{
Q_D(QGraphicsDropShadowEffect);
@@ -872,25 +954,44 @@ void QGraphicsDropShadowEffect::draw(QPainter *painter, QGraphicsEffectSource *s
\brief The QGraphicsOpacityEffect class provides an opacity effect.
\since 4.6
- An opacity effects renders the source with an opacity. This effect is useful
- for making the source semi-transparent, in e.g. a fade-in/fade-out sequence.
- The opacity can be modified using the setOpacity() function.
+ An opacity effect renders the source with an opacity. This effect is useful
+ for making the source semi-transparent, similar to a fade-in/fade-out
+ sequence. The opacity can be modified using the setOpacity() function.
By default, the opacity is 0.7.
+
+ \img graphicseffect-opacity.png
+
+ \sa QGraphicsDropShadowEffect, QGraphicsBlurEffect, QGraphicsPixelizeEffect,
+ QGraphicsGrayscaleEffect, QGraphicsColorizeEffect
+*/
+
+/*!
+ Constructs a new QGraphicsOpacityEffect instance.
+ The \a parent parameter is passed to QGraphicsEffect's constructor.
*/
QGraphicsOpacityEffect::QGraphicsOpacityEffect(QObject *parent)
: QGraphicsEffect(*new QGraphicsOpacityEffectPrivate, parent)
{
}
+/*!
+ Destroys the effect.
+*/
QGraphicsOpacityEffect::~QGraphicsOpacityEffect()
{
}
/*!
- Returns the opacity.
+ \property QGraphicsOpacityEffect::opacity
+ \brief the opacity of the effect.
+
+ The value should be in the range of 0.0 to 1.0, where 0.0 is
+ fully transparent and 1.0 is fully opaque.
- \sa setOpacity(), opacityChanged()
+ By default, the opacity is 0.7.
+
+ \sa setOpacityMask()
*/
qreal QGraphicsOpacityEffect::opacity() const
{
@@ -898,13 +999,6 @@ qreal QGraphicsOpacityEffect::opacity() const
return d->opacity;
}
-/*!
- Sets the opacity to the \a opacity specified. The value should be in
- the range 0.0 to 1.0, where 0.0 is fully transparent and 1.0 is
- fully opaque.
-
- \sa opacity(), opacityChanged()
-*/
void QGraphicsOpacityEffect::setOpacity(qreal opacity)
{
Q_D(QGraphicsOpacityEffect);
@@ -914,6 +1008,10 @@ void QGraphicsOpacityEffect::setOpacity(qreal opacity)
return;
d->opacity = opacity;
+ if ((d->isFullyTransparent = qFuzzyIsNull(d->opacity)))
+ d->isFullyOpaque = 0;
+ else
+ d->isFullyOpaque = qFuzzyIsNull(d->opacity - 1);
emit opacityChanged(opacity);
}
@@ -921,18 +1019,61 @@ void QGraphicsOpacityEffect::setOpacity(qreal opacity)
\fn void QGraphicsOpacityEffect::opacityChanged(qreal opacity)
This signal is emitted whenever the effect's opacity changes.
+ The \a opacity parameter holds the effect's new opacity.
*/
+/*!
+ \property QGraphicsOpacityEffect::opacityMask
+ \brief the opacity mask of the effect.
+
+ An opacity mask allows you apply opacity to portions of an element.
+
+ For example:
+
+ \snippet doc/src/snippets/code/src_gui_effects_qgraphicseffect.cpp 2
+
+ There is no opacity mask by default.
+
+ \sa setOpacity()
+*/
+QBrush QGraphicsOpacityEffect::opacityMask() const
+{
+ Q_D(const QGraphicsOpacityEffect);
+ return d->opacityMask;
+}
+
+void QGraphicsOpacityEffect::setOpacityMask(const QBrush &mask)
+{
+ Q_D(QGraphicsOpacityEffect);
+ if (d->opacityMask == mask)
+ return;
+
+ d->opacityMask = mask;
+ d->hasOpacityMask = (mask.style() != Qt::NoBrush);
+
+ emit opacityMaskChanged(mask);
+}
+
+/*!
+ \fn void QGraphicsOpacityEffect::opacityMaskChanged(const QBrush &mask)
+
+ This signal is emitted whenever the effect's opacity mask changes.
+ The \a mask parameter holds the effect's new opacity mask.
+*/
+
+/*!
+ \reimp
+*/
void QGraphicsOpacityEffect::draw(QPainter *painter, QGraphicsEffectSource *source)
{
Q_D(QGraphicsOpacityEffect);
// Transparent; nothing to draw.
- if (qFuzzyIsNull(d->opacity))
+ if (d->isFullyTransparent)
return;
// Opaque; draw directly without going through a pixmap.
- if (qFuzzyIsNull(d->opacity - 1)) {
+ if (d->isFullyOpaque && !d->hasOpacityMask) {
source->draw(painter);
return;
}
@@ -943,13 +1084,55 @@ void QGraphicsOpacityEffect::draw(QPainter *painter, QGraphicsEffectSource *sour
QPoint offset;
if (source->isPixmap()) {
// No point in drawing in device coordinates (pixmap will be scaled anyways).
- const QPixmap pixmap = source->pixmap(Qt::LogicalCoordinates, &offset);
- painter->drawPixmap(offset, pixmap);
+ if (!d->hasOpacityMask) {
+ const QPixmap pixmap = source->pixmap(Qt::LogicalCoordinates, &offset);
+ painter->drawPixmap(offset, pixmap);
+ } else {
+ QRectF srcBrect = source->boundingRect();
+ QPixmap pixmap(srcBrect.size().toSize());
+ pixmap.fill(Qt::transparent);
+
+ QPainter pixmapPainter(&pixmap);
+ pixmapPainter.setRenderHints(painter->renderHints());
+ pixmapPainter.translate(-srcBrect.topLeft());
+ source->draw(&pixmapPainter);
+ pixmapPainter.setCompositionMode(QPainter::CompositionMode_DestinationIn);
+ pixmapPainter.fillRect(srcBrect, d->opacityMask);
+ pixmapPainter.end();
+
+ painter->drawPixmap(srcBrect.topLeft(), pixmap);
+ }
} else {
// Draw pixmap in device coordinates to avoid pixmap scaling;
- const QPixmap pixmap = source->pixmap(Qt::DeviceCoordinates, &offset);
- painter->setWorldTransform(QTransform());
- painter->drawPixmap(offset, pixmap);
+ if (!d->hasOpacityMask) {
+ const QPixmap pixmap = source->pixmap(Qt::DeviceCoordinates, &offset);
+ painter->setWorldTransform(QTransform());
+ painter->drawPixmap(offset, pixmap);
+ } else {
+ QTransform worldTransform = painter->worldTransform();
+
+ // Calculate source bounding rect in logical and device coordinates.
+ QRectF srcBrect = source->boundingRect();
+ QRect srcDeviceBrect = worldTransform.mapRect(srcBrect).toAlignedRect();
+ srcDeviceBrect &= source->deviceRect();
+
+ offset = srcDeviceBrect.topLeft();
+ worldTransform *= QTransform::fromTranslate(-srcDeviceBrect.x(), -srcDeviceBrect.y());
+
+ QPixmap pixmap(srcDeviceBrect.size());
+ pixmap.fill(Qt::transparent);
+
+ QPainter pixmapPainter(&pixmap);
+ pixmapPainter.setRenderHints(painter->renderHints());
+ pixmapPainter.setWorldTransform(worldTransform);
+ source->draw(&pixmapPainter);
+ pixmapPainter.setCompositionMode(QPainter::CompositionMode_DestinationIn);
+ pixmapPainter.fillRect(srcBrect, d->opacityMask);
+ pixmapPainter.end();
+
+ painter->setWorldTransform(QTransform());
+ painter->drawPixmap(offset, pixmap);
+ }
}
painter->restore();
diff --git a/src/gui/effects/qgraphicseffect.h b/src/gui/effects/qgraphicseffect.h
index fef6531..a53357b 100644
--- a/src/gui/effects/qgraphicseffect.h
+++ b/src/gui/effects/qgraphicseffect.h
@@ -46,6 +46,7 @@
#include <QtCore/qpoint.h>
#include <QtCore/qrect.h>
#include <QtGui/qcolor.h>
+#include <QtGui/qbrush.h>
QT_BEGIN_HEADER
@@ -274,17 +275,21 @@ class Q_GUI_EXPORT QGraphicsOpacityEffect: public QGraphicsEffect
{
Q_OBJECT
Q_PROPERTY(int opacity READ opacity WRITE setOpacity NOTIFY opacityChanged)
+ Q_PROPERTY(QBrush opacityMask READ opacityMask WRITE setOpacityMask NOTIFY opacityMaskChanged)
public:
QGraphicsOpacityEffect(QObject *parent = 0);
~QGraphicsOpacityEffect();
qreal opacity() const;
+ QBrush opacityMask() const;
public Q_SLOTS:
void setOpacity(qreal opacity);
+ void setOpacityMask(const QBrush &mask);
Q_SIGNALS:
void opacityChanged(qreal opacity);
+ void opacityMaskChanged(const QBrush &mask);
protected:
void draw(QPainter *painter, QGraphicsEffectSource *source);
diff --git a/src/gui/effects/qgraphicseffect_p.h b/src/gui/effects/qgraphicseffect_p.h
index 175bd99..c902b67 100644
--- a/src/gui/effects/qgraphicseffect_p.h
+++ b/src/gui/effects/qgraphicseffect_p.h
@@ -164,10 +164,15 @@ class QGraphicsOpacityEffectPrivate : public QGraphicsEffectPrivate
{
Q_DECLARE_PUBLIC(QGraphicsOpacityEffect)
public:
- QGraphicsOpacityEffectPrivate() : opacity(0.7) {}
+ QGraphicsOpacityEffectPrivate()
+ : opacity(qreal(0.7)), isFullyTransparent(0), isFullyOpaque(0), hasOpacityMask(0) {}
~QGraphicsOpacityEffectPrivate() {}
qreal opacity;
+ QBrush opacityMask;
+ uint isFullyTransparent : 1;
+ uint isFullyOpaque : 1;
+ uint hasOpacityMask : 1;
};
QT_END_NAMESPACE
diff --git a/src/gui/embedded/qkbd_defaultmap_qws_p.h b/src/gui/embedded/qkbd_defaultmap_qws_p.h
index 2903492..a6c2d25 100644
--- a/src/gui/embedded/qkbd_defaultmap_qws_p.h
+++ b/src/gui/embedded/qkbd_defaultmap_qws_p.h
@@ -53,6 +53,8 @@
// We mean it.
//
+// no QT_BEGIN_NAMESPACE, since we include it internally...
+
const QWSKeyboard::Mapping QWSKbPrivate::s_keymap_default[] = {
{ 1, 0xffff, 0x01000000, 0x00, 0x00, 0x0000 },
{ 2, 0x0031, 0x00000031, 0x00, 0x00, 0x0000 },
diff --git a/src/gui/embedded/qkbd_qws_p.h b/src/gui/embedded/qkbd_qws_p.h
index df7ce1b..5af8f7c 100644
--- a/src/gui/embedded/qkbd_qws_p.h
+++ b/src/gui/embedded/qkbd_qws_p.h
@@ -55,6 +55,8 @@
#include <QDataStream>
+QT_BEGIN_NAMESPACE
+
namespace QWSKeyboard {
const quint32 FileMagic = 0x514d4150; // 'QMAP'
@@ -127,4 +129,6 @@ inline QDataStream &operator<<(QDataStream &ds, const QWSKeyboard::Composing &c)
}
#endif // QT_NO_DATASTREAM
+QT_END_NAMESPACE
+
#endif // QWSKEYBOARD_H
diff --git a/src/gui/embedded/qkbdqnx_qws.cpp b/src/gui/embedded/qkbdqnx_qws.cpp
index 4f0b9de..6e147dd 100644
--- a/src/gui/embedded/qkbdqnx_qws.cpp
+++ b/src/gui/embedded/qkbdqnx_qws.cpp
@@ -49,6 +49,9 @@
#include "qplatformdefs.h"
#include <errno.h>
+
+QT_BEGIN_NAMESPACE
+
/*!
\class QWSQnxKeyboardHandler
\preliminary
@@ -229,3 +232,5 @@ void QWSQnxKeyboardHandler::socketActivated()
// (on QNX, isPress is not set when the key event is repeated).
processKeyEvent(unicode, key, modifiers, isPress || isRepeat, isRepeat);
}
+
+QT_END_NAMESPACE
diff --git a/src/gui/embedded/qlock.cpp b/src/gui/embedded/qlock.cpp
index c32e9b5..9f2d3b8 100644
--- a/src/gui/embedded/qlock.cpp
+++ b/src/gui/embedded/qlock.cpp
@@ -41,10 +41,11 @@
#include "qlock_p.h"
-QT_BEGIN_NAMESPACE
#ifdef QT_NO_QWS_MULTIPROCESS
+QT_BEGIN_NAMESPACE
+
/* no multiprocess - use a dummy */
QLock::QLock(const QString & /*filename*/, char /*id*/, bool /*create*/)
@@ -77,6 +78,8 @@ bool QLock::locked() const
return data;
}
+QT_END_NAMESPACE
+
#else // QT_NO_QWS_MULTIPROCESS
#include "qwssignalhandler_p.h"
@@ -110,6 +113,9 @@ union semun {
#include <private/qcore_unix_p.h> // overrides QT_OPEN
+
+QT_BEGIN_NAMESPACE
+
#define MAX_LOCKS 200 // maximum simultaneous read locks
class QLockData
@@ -324,6 +330,7 @@ bool QLock::locked() const
return (data->count > 0);
}
+QT_END_NAMESPACE
+
#endif // QT_NO_QWS_MULTIPROCESS
-QT_END_NAMESPACE
diff --git a/src/gui/embedded/qmousetslib_qws.h b/src/gui/embedded/qmousetslib_qws.h
index 4dd39b5..71672f0 100644
--- a/src/gui/embedded/qmousetslib_qws.h
+++ b/src/gui/embedded/qmousetslib_qws.h
@@ -73,8 +73,8 @@ protected:
};
-QT_END_NAMESPACE
#endif // QT_NO_QWS_MOUSE_TSLIB
+QT_END_NAMESPACE
QT_END_HEADER
#endif // QMOUSETSLIB_QWS_H
diff --git a/src/gui/embedded/qscreen_qws.h b/src/gui/embedded/qscreen_qws.h
index 275e83f..307c2fd 100644
--- a/src/gui/embedded/qscreen_qws.h
+++ b/src/gui/embedded/qscreen_qws.h
@@ -50,6 +50,8 @@
#include <QtGui/qimage.h>
#include <QtGui/qregion.h>
+struct fb_cmap;
+
QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
@@ -169,8 +171,6 @@ private:
#endif // QT_NO_QWS_CURSOR
-struct fb_cmap;
-
// A (used) chunk of offscreen memory
class QPoolEntry
diff --git a/src/gui/embedded/qscreenlinuxfb_qws.cpp b/src/gui/embedded/qscreenlinuxfb_qws.cpp
index 69e5808..1679ef2 100644
--- a/src/gui/embedded/qscreenlinuxfb_qws.cpp
+++ b/src/gui/embedded/qscreenlinuxfb_qws.cpp
@@ -291,8 +291,8 @@ bool QLinuxFbScreen::connect(const QString &displaySpec)
d_ptr->fd = QT_OPEN(dev.toLatin1().constData(), O_RDONLY);
}
- fb_fix_screeninfo finfo;
- fb_var_screeninfo vinfo;
+ ::fb_fix_screeninfo finfo;
+ ::fb_var_screeninfo vinfo;
//#######################
// Shut up Valgrind
memset(&vinfo, 0, sizeof(vinfo));
@@ -429,7 +429,7 @@ bool QLinuxFbScreen::connect(const QString &displaySpec)
if((vinfo.bits_per_pixel==8) || (vinfo.bits_per_pixel==4)) {
screencols= (vinfo.bits_per_pixel==8) ? 256 : 16;
int loopc;
- fb_cmap startcmap;
+ ::fb_cmap startcmap;
startcmap.start=0;
startcmap.len=screencols;
startcmap.red=(unsigned short int *)
diff --git a/src/gui/embedded/qscreenlinuxfb_qws.h b/src/gui/embedded/qscreenlinuxfb_qws.h
index eb47848..e3c712a 100644
--- a/src/gui/embedded/qscreenlinuxfb_qws.h
+++ b/src/gui/embedded/qscreenlinuxfb_qws.h
@@ -44,6 +44,11 @@
#include <QtGui/qscreen_qws.h>
+struct fb_cmap;
+struct fb_var_screeninfo;
+struct fb_fix_screeninfo;
+
+
QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
@@ -70,9 +75,6 @@ public:
};
-struct fb_cmap;
-struct fb_var_screeninfo;
-struct fb_fix_screeninfo;
class QLinuxFbScreenPrivate;
class Q_GUI_EXPORT QLinuxFbScreen : public QScreen
diff --git a/src/gui/embedded/qscreenproxy_qws.cpp b/src/gui/embedded/qscreenproxy_qws.cpp
index b566dc0..b87fdd1 100644
--- a/src/gui/embedded/qscreenproxy_qws.cpp
+++ b/src/gui/embedded/qscreenproxy_qws.cpp
@@ -45,6 +45,7 @@
#include <qregexp.h>
+QT_BEGIN_NAMESPACE
#ifndef QT_NO_QWS_CURSOR
/*!
@@ -629,4 +630,6 @@ QRegion QProxyScreen::region() const
return QScreen::region();
}
+QT_END_NAMESPACE
+
#endif // QT_NO_QWS_PROXYSCREEN
diff --git a/src/gui/embedded/qscreenqnx_qws.cpp b/src/gui/embedded/qscreenqnx_qws.cpp
index 70f6d6b..77fe13e 100644
--- a/src/gui/embedded/qscreenqnx_qws.cpp
+++ b/src/gui/embedded/qscreenqnx_qws.cpp
@@ -44,6 +44,8 @@
#include <gf/gf.h>
+QT_BEGIN_NAMESPACE
+
// This struct holds all the pointers to QNX's internals
struct QQnxScreenContext
{
@@ -445,3 +447,4 @@ void QQnxScreen::exposeRegion(QRegion r, int changing)
gf_draw_end(d->context);
}
+QT_END_NAMESPACE
diff --git a/src/gui/embedded/qsoundqss_qws.cpp b/src/gui/embedded/qsoundqss_qws.cpp
index 2f5f39a..811943a 100644
--- a/src/gui/embedded/qsoundqss_qws.cpp
+++ b/src/gui/embedded/qsoundqss_qws.cpp
@@ -67,10 +67,10 @@
#include <qdebug.h>
-QT_BEGIN_NAMESPACE
-
extern int errno;
+QT_BEGIN_NAMESPACE
+
#define QT_QWS_SOUND_16BIT 1 // or 0, or undefined for always 0
#define QT_QWS_SOUND_STEREO 1 // or 0, or undefined for always 0
diff --git a/src/gui/embedded/qwsutils_qws.h b/src/gui/embedded/qwsutils_qws.h
index 23e0104..fe959ef 100644
--- a/src/gui/embedded/qwsutils_qws.h
+++ b/src/gui/embedded/qwsutils_qws.h
@@ -44,6 +44,12 @@
#include <QtCore/QIODevice>
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+QT_MODULE(Gui)
+
#ifndef QT_NO_SXE
#define QWS_SOCK_BASE QUnixSocket
#define QWS_SOCK_SERVER_BASE QUnixSocketServer
@@ -58,12 +64,6 @@ class QTcpServer;
class QWSSocket;
class QWSServerSocket;
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-QT_MODULE(Gui)
-
/********************************************************************
*
* Convenient socket functions
diff --git a/src/gui/graphicsview/qgraphicsanchorlayout.cpp b/src/gui/graphicsview/qgraphicsanchorlayout.cpp
index 2894c59..95561b7 100644
--- a/src/gui/graphicsview/qgraphicsanchorlayout.cpp
+++ b/src/gui/graphicsview/qgraphicsanchorlayout.cpp
@@ -65,8 +65,9 @@
automatically added to the layout, and if items are removed, all their anchors will be
automatically removed
- \section1 Size Hints and Size Policies in QGraphicsLinearLayout
- QGraphicsLinearLayout respects each item's size hints and size policies. However it does
+ \section1 Size Hints and Size Policies in QGraphicsAnchorLayout
+
+ QGraphicsAnchorLayout respects each item's size hints and size policies. However it does
not respect stretch factors currently. This might change in the future, so please refrain
from using stretch factors in anchor layout to avoid any future regressions.
@@ -83,6 +84,10 @@
QT_BEGIN_NAMESPACE
+/*!
+ Constructs a QGraphicsAnchorLayout instance. \a parent is passed to
+ QGraphicsLayout's constructor.
+ */
QGraphicsAnchorLayout::QGraphicsAnchorLayout(QGraphicsLayoutItem *parent)
: QGraphicsLayout(*new QGraphicsAnchorLayoutPrivate(), parent)
{
@@ -90,6 +95,9 @@ QGraphicsAnchorLayout::QGraphicsAnchorLayout(QGraphicsLayoutItem *parent)
d->createLayoutEdges();
}
+/*!
+ Destroys the QGraphicsAnchorLayout object.
+*/
QGraphicsAnchorLayout::~QGraphicsAnchorLayout()
{
Q_D(QGraphicsAnchorLayout);
@@ -187,32 +195,41 @@ void QGraphicsAnchorLayout::addCornerAnchors(QGraphicsLayoutItem *firstItem,
}
/*!
- \fn QGraphicsAnchorLayout::addLeftAndRightAnchors(QGraphicsLayoutItem *firstEdge, QGraphicsLayoutItem *secondEdge)
+ \fn QGraphicsAnchorLayout::addLeftAndRightAnchors(QGraphicsLayoutItem *firstItem, QGraphicsLayoutItem *secondItem)
+
+ Anchors the left and right edges of \a firstItem to the same edges of
+ \a secondItem.
This convenience function is equivalent to calling
\code
- l->addAnchor(firstEdge, Qt::AnchorLeft, secondEdge, Qt::AnchorLeft);
- l->addAnchor(firstEdge, Qt::AnchorRight, secondEdge, Qt::AnchorRight);
+ l->addAnchor(firstItem, Qt::AnchorLeft, secondItem, Qt::AnchorLeft);
+ l->addAnchor(firstItem, Qt::AnchorRight, secondItem, Qt::AnchorRight);
\endcode
*/
/*!
- \fn QGraphicsAnchorLayout::addTopAndBottomAnchors(QGraphicsLayoutItem *firstEdge, QGraphicsLayoutItem *secondEdge)
+ \fn QGraphicsAnchorLayout::addTopAndBottomAnchors(QGraphicsLayoutItem *firstItem, QGraphicsLayoutItem *secondItem)
+
+ Anchors the top and bottom edges of \a firstItem to the same edges of
+ \a secondItem.
This convenience function is equivalent to calling
\code
- l->addAnchor(firstEdge, Qt::AnchorTop, secondEdge, Qt::AnchorTop);
- l->addAnchor(firstEdge, Qt::AnchorBottom, secondEdge, Qt::AnchorBottom);
+ l->addAnchor(firstItem, Qt::AnchorTop, secondItem, Qt::AnchorTop);
+ l->addAnchor(firstItem, Qt::AnchorBottom, secondItem, Qt::AnchorBottom);
\endcode
*/
/*!
- \fn QGraphicsAnchorLayout::addAllAnchors(QGraphicsLayoutItem *firstEdge, QGraphicsLayoutItem *secondEdge)
+ \fn QGraphicsAnchorLayout::addAllAnchors(QGraphicsLayoutItem *firstItem, QGraphicsLayoutItem *secondItem)
+
+ Anchors all edges (left, right, top and bottom) of \a firstItem to the same edges of
+ \a secondItem.
This convenience function is equivalent to calling
\code
- l->addLeftAndRightAnchors(firstEdge, secondEdge);
- l->addTopAndBottomAnchors(firstEdge, secondEdge);
+ l->addLeftAndRightAnchors(firstItem, secondItem);
+ l->addTopAndBottomAnchors(firstItem, secondItem);
\endcode
*/
@@ -228,6 +245,7 @@ void QGraphicsAnchorLayout::setAnchorSpacing(const QGraphicsLayoutItem *firstIte
if (!d->setAnchorSize(firstItem, firstEdge, secondItem, secondEdge, &spacing)) {
qWarning("setAnchorSpacing: The anchor does not exist.");
+ return;
}
invalidate();
}
@@ -369,7 +387,12 @@ void QGraphicsAnchorLayout::setGeometry(const QRectF &geom)
}
/*!
+ Removes the layout item at \a index without destroying it. Ownership of
+ the item is transferred to the caller.
+
Removing an item will also remove any of the anchors associated with it.
+
+ \sa itemAt(), count()
*/
void QGraphicsAnchorLayout::removeAt(int index)
{
diff --git a/src/gui/graphicsview/qgraphicsanchorlayout_p.cpp b/src/gui/graphicsview/qgraphicsanchorlayout_p.cpp
index c965712..d4afa5b 100644
--- a/src/gui/graphicsview/qgraphicsanchorlayout_p.cpp
+++ b/src/gui/graphicsview/qgraphicsanchorlayout_p.cpp
@@ -554,7 +554,7 @@ bool QGraphicsAnchorLayoutPrivate::simplifyGraphIteration(QGraphicsAnchorLayoutP
qDebug("candidate list for sequential simplification:\n[%s]", qPrintable(strPath));
#endif
- bool forward;
+ bool forward = true;
AnchorVertex *prev = beforeSequence;
int intervalFrom = 0;
diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp
index ead5aee..e1e95b1 100644
--- a/src/gui/graphicsview/qgraphicsitem.cpp
+++ b/src/gui/graphicsview/qgraphicsitem.cpp
@@ -331,6 +331,13 @@
\value ItemNegativeZStacksBehindParent The item automatically stacks behind
it's parent if it's z-value is negative. This flag enables setZValue() to
toggle ItemStacksBehindParent.
+
+ \value ItemIsPanel. The item is a panel. A panel provides activation and
+ contained focus handling. Only one panel can be active at a time (see
+ QGraphicsItem::isActive()). When no panel is active, QGraphicsScene
+ activates all non-panel items. Window items (i.e.,
+ QGraphicsItem::isWindow() returns true) are panels. This flag was
+ introduced in Qt 4.6.
*/
/*!
@@ -1341,14 +1348,29 @@ QGraphicsWidget *QGraphicsItem::topLevelWidget() const
*/
QGraphicsWidget *QGraphicsItem::window() const
{
- if (isWidget() && static_cast<const QGraphicsWidget *>(this)->isWindow())
- return static_cast<QGraphicsWidget *>(const_cast<QGraphicsItem *>(this));
- if (QGraphicsWidget *parent = parentWidget())
- return parent->window();
+ QGraphicsItem *p = panel();
+ if (p && p->isWindow())
+ return static_cast<QGraphicsWidget *>(p);
return 0;
}
/*!
+ \since 4.6
+
+ Returns the item's panel, or 0 if this item does not have a panel. If the
+ item is a panel, it will return itself. Otherwise it will return the
+ closest ancestor that is a panel.
+
+ \sa isPanel(), ItemIsPanel
+*/
+QGraphicsItem *QGraphicsItem::panel() const
+{
+ if (d_ptr->flags & ItemIsPanel)
+ return const_cast<QGraphicsItem *>(this);
+ return d_ptr->parent ? d_ptr->parent->panel() : 0;
+}
+
+/*!
\since 4.6
Return the graphics item cast to a QGraphicsObject, if the class is actually a
@@ -1434,6 +1456,17 @@ bool QGraphicsItem::isWindow() const
}
/*!
+ \since 4.6
+ Returns true if the item is a panel; otherwise returns false.
+
+ \sa QGraphicsItem::panel(), ItemIsPanel
+*/
+bool QGraphicsItem::isPanel() const
+{
+ return d_ptr->flags & ItemIsPanel;
+}
+
+/*!
Returns this item's flags. The flags describe what configurable features
of the item are enabled and not. For example, if the flags include
ItemIsFocusable, the item can accept input focus.
@@ -1496,6 +1529,9 @@ static void _q_qgraphicsItemSetFlag(QGraphicsItem *item, QGraphicsItem::Graphics
*/
void QGraphicsItem::setFlags(GraphicsItemFlags flags)
{
+ if (isWindow())
+ flags |= ItemIsPanel;
+
// Notify change and check for adjustment.
if (quint32(d_ptr->flags) == quint32(flags))
return;
@@ -1850,16 +1886,16 @@ void QGraphicsItemPrivate::setVisibleHelper(bool newVisible, bool explicitly, bo
q->ungrabKeyboard();
}
if (q_ptr->hasFocus() && scene) {
- // Hiding the closest non-window ancestor of the focus item
+ // Hiding the closest non-panel ancestor of the focus item
QGraphicsItem *focusItem = scene->focusItem();
bool clear = true;
- if (isWidget && !focusItem->isWindow()) {
+ if (isWidget && !focusItem->isPanel()) {
do {
if (focusItem == q_ptr) {
clear = !static_cast<QGraphicsWidget *>(q_ptr)->focusNextPrevChild(true);
break;
}
- } while ((focusItem = focusItem->parentWidget()) && !focusItem->isWindow());
+ } while ((focusItem = focusItem->parentWidget()) && !focusItem->isPanel());
}
if (clear)
q_ptr->clearFocus();
@@ -1981,17 +2017,17 @@ void QGraphicsItemPrivate::setEnabledHelper(bool newEnabled, bool explicitly, bo
if (scene && scene->mouseGrabberItem() == q_ptr)
q_ptr->ungrabMouse();
if (q_ptr->hasFocus()) {
- // Disabling the closest non-window ancestor of the focus item
+ // Disabling the closest non-panel ancestor of the focus item
// causes focus to pop to the next item, otherwise it's cleared.
QGraphicsItem *focusItem = scene->focusItem();
bool clear = true;
- if (isWidget && !focusItem->isWindow() && q_ptr->isAncestorOf(focusItem)) {
+ if (isWidget && !focusItem->isPanel() && q_ptr->isAncestorOf(focusItem)) {
do {
if (focusItem == q_ptr) {
clear = !static_cast<QGraphicsWidget *>(q_ptr)->focusNextPrevChild(true);
break;
}
- } while ((focusItem = focusItem->parentWidget()) && !focusItem->isWindow());
+ } while ((focusItem = focusItem->parentWidget()) && !focusItem->isPanel());
}
if (clear)
q_ptr->clearFocus();
@@ -2588,12 +2624,33 @@ void QGraphicsItem::setHandlesChildEvents(bool enabled)
d_ptr->handlesChildEvents = enabled;
d_ptr->updateAncestorFlag(QGraphicsItem::GraphicsItemFlag(-1));
}
+/*!
+ \since 4.6
+ Returns true if this item is active; otherwise returns false.
+
+ An item can only be active if the scene is active. An item is active
+ if it is, or is a descendent of, an active panel. Items in non-active
+ panels are not active.
+
+ Items that are not part of a panel follow scene activation when the
+ scene has no active panel.
+
+ Only active items can gain input focus.
+
+ \sa QGraphicsScene::isActive(), QGraphicsScene::activePanel(), panel(), isPanel()
+*/
+bool QGraphicsItem::isActive() const
+{
+ if (!d_ptr->scene || !d_ptr->scene->isActive())
+ return false;
+ return panel() == d_ptr->scene->activePanel();
+}
/*!
- Returns true if this item or its \l{focusProxy()}{focus proxy} has keyboard
- input focus; otherwise, returns false.
+ Returns true if this item is active, and it or its \l{focusProxy()}{focus
+ proxy} has keyboard input focus; otherwise, returns false.
- \sa focusItem(), setFocus(), QGraphicsScene::setFocusItem()
+ \sa focusItem(), setFocus(), QGraphicsScene::setFocusItem(), isActive()
*/
bool QGraphicsItem::hasFocus() const
{
@@ -2610,9 +2667,10 @@ bool QGraphicsItem::hasFocus() const
Only enabled items that set the ItemIsFocusable flag can accept keyboard
focus.
- If this item is not visible, or not associated with a scene, it will not
- gain immediate input focus. However, it will be registered as the preferred
- focus item for its subtree of items, should it later become visible.
+ If this item is not visible, not active, or not associated with a scene,
+ it will not gain immediate input focus. However, it will be registered as
+ the preferred focus item for its subtree of items, should it later become
+ visible.
As a result of calling this function, this item will receive a
\l{focusInEvent()}{focus in event} with \a focusReason. If another item
@@ -2655,8 +2713,8 @@ void QGraphicsItem::setFocus(Qt::FocusReason focusReason)
}
d_ptr->setItemFocusedInScope(false);
- QGraphicsWidget *w = window();
- if (!w || w->isActiveWindow()) {
+ QGraphicsItem *p = panel();
+ if (!p || p->isActive()) {
// Visible items immediately gain focus from scene.
d_ptr->scene->d_func()->setFocusItemHelper(f, focusReason);
}
@@ -2668,8 +2726,8 @@ void QGraphicsItem::setFocus(Qt::FocusReason focusReason)
/*!
Takes keyboard input focus from the item.
- If it has focus, a \l{focusOutEvent()}{focus out event} is sent to this item
- to tell it that it is about to lose the focus.
+ If it has focus, a \l{focusOutEvent()}{focus out event} is sent to this
+ item to tell it that it is about to lose the focus.
Only items that set the ItemIsFocusable flag, or widgets that set an
appropriate focus policy, can accept keyboard focus.
@@ -4783,7 +4841,7 @@ void QGraphicsItemPrivate::setSubFocus()
bool hidden = !visible;
do {
parent->d_func()->subFocusItem = item;
- } while (!parent->isWindow() && (parent = parent->d_ptr->parent) && (!hidden || !parent->d_func()->visible) && !(parent->d_ptr->flags & QGraphicsItem::ItemIsFocusScope));
+ } while (!parent->isPanel() && (parent = parent->d_ptr->parent) && (!hidden || !parent->d_func()->visible) && !(parent->d_ptr->flags & QGraphicsItem::ItemIsFocusScope));
}
/*!
@@ -4797,7 +4855,7 @@ void QGraphicsItemPrivate::clearSubFocus()
if (parent->d_ptr->subFocusItem != q_ptr)
break;
parent->d_ptr->subFocusItem = 0;
- } while (!parent->isWindow() && (parent = parent->d_ptr->parent));
+ } while (!parent->isPanel() && (parent = parent->d_ptr->parent));
}
/*!
@@ -6048,6 +6106,17 @@ bool QGraphicsItem::sceneEvent(QEvent *event)
case QEvent::InputMethod:
inputMethodEvent(static_cast<QInputMethodEvent *>(event));
break;
+ case QEvent::WindowActivate:
+ case QEvent::WindowDeactivate:
+ // Propagate panel activation.
+ if (d_ptr->scene) {
+ for (int i = 0; i < d_ptr->children.size(); ++i) {
+ QGraphicsItem *child = d_ptr->children.at(i);
+ if (!(child->d_ptr->ancestorFlags & QGraphicsItemPrivate::AncestorHandlesChildEvents))
+ d_ptr->scene->sendEvent(child, event);
+ }
+ }
+ break;
default:
return false;
}
@@ -10214,10 +10283,8 @@ void QGraphicsItemEffectSourcePrivate::draw(QPainter *painter)
info->widget, info->opacity, info->effectTransform, info->wasDirtySceneTransform,
info->drawItem);
} else {
- QTransform effectTransform = painter->worldTransform();
- effectTransform *= info->painter->worldTransform().inverted();
- if (info->effectTransform)
- effectTransform *= *info->effectTransform;
+ QTransform effectTransform = info->painter->worldTransform().inverted();
+ effectTransform *= painter->worldTransform();
scened->draw(item, painter, info->viewTransform, info->transformPtr, info->exposedRegion,
info->widget, info->opacity, &effectTransform, info->wasDirtySceneTransform,
info->drawItem);
@@ -10453,6 +10520,9 @@ QDebug operator<<(QDebug debug, QGraphicsItem::GraphicsItemFlag flag)
case QGraphicsItem::ItemIsFocusScope:
str = "ItemIsFocusScope";
break;
+ case QGraphicsItem::ItemIsPanel:
+ str = "ItemIsPanel";
+ break;
}
debug << str;
return debug;
@@ -10462,7 +10532,7 @@ QDebug operator<<(QDebug debug, QGraphicsItem::GraphicsItemFlags flags)
{
debug << '(';
bool f = false;
- for (int i = 0; i < 9; ++i) {
+ for (int i = 0; i < 16; ++i) {
if (flags & (1 << i)) {
if (f)
debug << '|';
diff --git a/src/gui/graphicsview/qgraphicsitem.h b/src/gui/graphicsview/qgraphicsitem.h
index b76f5ac..59659c9 100644
--- a/src/gui/graphicsview/qgraphicsitem.h
+++ b/src/gui/graphicsview/qgraphicsitem.h
@@ -103,8 +103,9 @@ public:
ItemHasNoContents = 0x400,
ItemSendsGeometryChanges = 0x800,
ItemAcceptsInputMethod = 0x1000,
+ ItemIsFocusScope = 0x2000,
ItemNegativeZStacksBehindParent = 0x4000,
- ItemIsFocusScope = 0x8000
+ ItemIsPanel = 0x8000
// NB! Don't forget to increase the d_ptr->flags bit field by 1 when adding a new flag.
};
Q_DECLARE_FLAGS(GraphicsItemFlags, GraphicsItemFlag)
@@ -161,11 +162,13 @@ public:
QGraphicsWidget *parentWidget() const;
QGraphicsWidget *topLevelWidget() const;
QGraphicsWidget *window() const;
+ QGraphicsItem *panel() const;
void setParentItem(QGraphicsItem *parent);
QList<QGraphicsItem *> children() const; // ### obsolete
QList<QGraphicsItem *> childItems() const;
bool isWidget() const;
bool isWindow() const;
+ bool isPanel() const;
QGraphicsObject *toGraphicsObject();
const QGraphicsObject *toGraphicsObject() const;
@@ -231,6 +234,7 @@ public:
bool handlesChildEvents() const;
void setHandlesChildEvents(bool enabled);
+ bool isActive() const;
bool hasFocus() const;
void setFocus(Qt::FocusReason focusReason = Qt::OtherFocusReason);
void clearFocus();
diff --git a/src/gui/graphicsview/qgraphicsitem_p.h b/src/gui/graphicsview/qgraphicsitem_p.h
index 7abd7f5..60db4a7 100644
--- a/src/gui/graphicsview/qgraphicsitem_p.h
+++ b/src/gui/graphicsview/qgraphicsitem_p.h
@@ -47,8 +47,8 @@
// -------------
//
// This file is not part of the Qt API. It exists for the convenience
-// of qapplication_*.cpp, qwidget*.cpp and qfiledialog.cpp. This header
-// file may change from version to version without notice, or even be removed.
+// of other Qt classes. This header file may change from version to
+// version without notice, or even be removed.
//
// We mean it.
//
@@ -498,7 +498,7 @@ public:
quint32 needSortChildren : 1;
quint32 allChildrenDirty : 1;
- // New 32 bits
+ // Packed 32 bits
quint32 fullUpdatePending : 1;
quint32 flags : 16;
quint32 dirtyChildrenBoundingRect : 1;
@@ -516,8 +516,10 @@ public:
quint32 notifyBoundingRectChanged : 1;
quint32 notifyInvalidated : 1;
quint32 mouseSetsFocus : 1;
+
+ // New 32 bits
quint32 itemIsFocusedInScope : 1;
- quint32 unused : 1; // feel free to use
+ quint32 unused : 31; // feel free to use
// Optional stacking order
int globalStackingOrder;
diff --git a/src/gui/graphicsview/qgraphicslayout.cpp b/src/gui/graphicsview/qgraphicslayout.cpp
index 58c174c..df6be90 100644
--- a/src/gui/graphicsview/qgraphicslayout.cpp
+++ b/src/gui/graphicsview/qgraphicslayout.cpp
@@ -390,8 +390,10 @@ void QGraphicsLayout::widgetEvent(QEvent *e)
QGraphicsLayout to return a pointer to the item at index \a i. The
reimplementation can assume that \a i is valid (i.e., it respects the
value of count()).
+ Together with count(), it is provided as a means of iterating over all items in a layout.
- The subclass is free to decide how to store the items.
+ The subclass is free to decide how to store the items, and the visual arrangement
+ does not have to be reflected through this function.
\sa count(), removeAt()
*/
diff --git a/src/gui/graphicsview/qgraphicslayout_p.h b/src/gui/graphicsview/qgraphicslayout_p.h
index 2ad853b..0e43b55 100644
--- a/src/gui/graphicsview/qgraphicslayout_p.h
+++ b/src/gui/graphicsview/qgraphicslayout_p.h
@@ -47,8 +47,8 @@
// -------------
//
// This file is not part of the Qt API. It exists for the convenience
-// of qapplication_*.cpp, qwidget*.cpp and qfiledialog.cpp. This header
-// file may change from version to version without notice, or even be removed.
+// of other Qt classes. This header file may change from version to
+// version without notice, or even be removed.
//
// We mean it.
//
diff --git a/src/gui/graphicsview/qgraphicslayoutitem_p.h b/src/gui/graphicsview/qgraphicslayoutitem_p.h
index 5bda3ca..4d9a8c9 100644
--- a/src/gui/graphicsview/qgraphicslayoutitem_p.h
+++ b/src/gui/graphicsview/qgraphicslayoutitem_p.h
@@ -47,8 +47,8 @@
// -------------
//
// This file is not part of the Qt API. It exists for the convenience
-// of qapplication_*.cpp, qwidget*.cpp and qfiledialog.cpp. This header
-// file may change from version to version without notice, or even be removed.
+// of other Qt classes. This header file may change from version to
+// version without notice, or even be removed.
//
// We mean it.
//
diff --git a/src/gui/graphicsview/qgraphicslinearlayout.cpp b/src/gui/graphicsview/qgraphicslinearlayout.cpp
index 185780a..1b271e5 100644
--- a/src/gui/graphicsview/qgraphicslinearlayout.cpp
+++ b/src/gui/graphicsview/qgraphicslinearlayout.cpp
@@ -277,7 +277,7 @@ void QGraphicsLinearLayout::insertItem(int index, QGraphicsLayoutItem *item)
Q_ASSERT(item);
d->fixIndex(&index);
d->engine.insertRow(index, d->orientation);
- new QGridLayoutItem(&d->engine, item, d->gridRow(index), d->gridColumn(index));
+ new QGridLayoutItem(&d->engine, item, d->gridRow(index), d->gridColumn(index), 1, 1, 0, index);
invalidate();
}
@@ -471,6 +471,7 @@ int QGraphicsLinearLayout::count() const
/*!
\reimp
+ When iterating from 0 and up, it will return the items in the visual arranged order.
*/
QGraphicsLayoutItem *QGraphicsLinearLayout::itemAt(int index) const
{
diff --git a/src/gui/graphicsview/qgraphicsproxywidget_p.h b/src/gui/graphicsview/qgraphicsproxywidget_p.h
index e2be89c..04fe40a 100644
--- a/src/gui/graphicsview/qgraphicsproxywidget_p.h
+++ b/src/gui/graphicsview/qgraphicsproxywidget_p.h
@@ -47,8 +47,8 @@
// -------------
//
// This file is not part of the Qt API. It exists for the convenience
-// of qapplication_*.cpp, qwidget*.cpp and qfiledialog.cpp. This header
-// file may change from version to version without notice, or even be removed.
+// of other Qt classes. This header file may change from version to
+// version without notice, or even be removed.
//
// We mean it.
//
diff --git a/src/gui/graphicsview/qgraphicsscene.cpp b/src/gui/graphicsview/qgraphicsscene.cpp
index af137e7..3efb511 100644
--- a/src/gui/graphicsview/qgraphicsscene.cpp
+++ b/src/gui/graphicsview/qgraphicsscene.cpp
@@ -288,7 +288,8 @@ QGraphicsScenePrivate::QGraphicsScenePrivate()
focusItem(0),
lastFocusItem(0),
tabFocusFirst(0),
- activeWindow(0),
+ activePanel(0),
+ lastActivePanel(0),
activationRefCount(0),
lastMouseGrabberItem(0),
lastMouseGrabberItemHasImplicitMouseGrab(false),
@@ -516,10 +517,12 @@ void QGraphicsScenePrivate::removeItemHelper(QGraphicsItem *item)
focusItem = 0;
if (item == lastFocusItem)
lastFocusItem = 0;
- if (item == activeWindow) {
+ if (item == activePanel) {
// ### deactivate...
- activeWindow = 0;
+ activePanel = 0;
}
+ if (item == lastActivePanel)
+ lastActivePanel = 0;
// Disable selectionChanged() for individual items
++selectionChanging;
@@ -672,8 +675,8 @@ void QGraphicsScenePrivate::removePopup(QGraphicsWidget *widget, bool itemIsDyin
if (focusItem && popupWidgets.isEmpty()) {
QFocusEvent event(QEvent::FocusIn, Qt::PopupFocusReason);
sendEvent(focusItem, &event);
- } else {
- ungrabKeyboard((QGraphicsItem *)widget, itemIsDying);
+ } else if (keyboardGrabberItems.contains(static_cast<QGraphicsItem *>(widget))) {
+ ungrabKeyboard(static_cast<QGraphicsItem *>(widget), itemIsDying);
}
if (!itemIsDying && widget->isVisible()) {
widget->hide();
@@ -1078,8 +1081,9 @@ void QGraphicsScenePrivate::mousePressEventHandler(QGraphicsSceneMouseEvent *mou
}
// Update window activation.
- QGraphicsWidget *newActiveWindow = windowForItem(cachedItemsUnderMouse.value(0));
- if (newActiveWindow != activeWindow)
+ QGraphicsItem *topItem = cachedItemsUnderMouse.value(0);
+ QGraphicsWidget *newActiveWindow = topItem ? topItem->window() : 0;
+ if (newActiveWindow != q->activeWindow())
q->setActiveWindow(newActiveWindow);
// Set focus on the topmost enabled item that can take focus.
@@ -1114,7 +1118,7 @@ void QGraphicsScenePrivate::mousePressEventHandler(QGraphicsSceneMouseEvent *mou
// check if the item we are sending to are disabled (before we send the event)
bool disabled = !item->isEnabled();
- bool isWindow = item->isWindow();
+ bool isPanel = item->isPanel();
if (mouseEvent->type() == QEvent::GraphicsSceneMouseDoubleClick
&& item != lastMouseGrabberItem && lastMouseGrabberItem) {
// If this item is different from the item that received the last
@@ -1155,8 +1159,8 @@ void QGraphicsScenePrivate::mousePressEventHandler(QGraphicsSceneMouseEvent *mou
}
ungrabMouse(item, /* itemIsDying = */ dontSendUngrabEvents);
- // Don't propagate through windows.
- if (isWindow)
+ // Don't propagate through panels.
+ if (isPanel)
break;
}
@@ -1178,18 +1182,6 @@ void QGraphicsScenePrivate::mousePressEventHandler(QGraphicsSceneMouseEvent *mou
}
}
-QGraphicsWidget *QGraphicsScenePrivate::windowForItem(const QGraphicsItem *item) const
-{
- if (!item)
- return 0;
- do {
- if (item->isWidget())
- return static_cast<const QGraphicsWidget *>(item)->window();
- item = item->parentItem();
- } while (item);
- return 0;
-}
-
/*!
\internal
@@ -2236,6 +2228,9 @@ void QGraphicsScene::destroyItemGroup(QGraphicsItemGroup *group)
moved to this scene), QGraphicsScene will send an addition notification as
the item is removed from its previous scene.
+ If the item is a panel, the scene is active, and there is no active panel
+ in the scene, then the item will be activated.
+
\sa removeItem(), addEllipse(), addLine(), addPath(), addPixmap(),
addRect(), addText(), addWidget()
*/
@@ -2368,9 +2363,9 @@ void QGraphicsScenePrivate::addItem(QGraphicsItem *item,
// Deliver post-change notification
item->itemChange(QGraphicsItem::ItemSceneHasChanged, newSceneVariant);
- // Auto-activate the first inactive window if the scene is active.
- if (activationRefCount > 0 && !activeWindow && item->isWindow())
- q->setActiveWindow(static_cast<QGraphicsWidget *>(item));
+ // Auto-activate the first inactive panel if the scene is active.
+ if (q->isActive() && !activePanel && item->isPanel())
+ q->setActivePanel(item);
// Ensure that newly added items that have subfocus set, gain
// focus automatically if there isn't a focus item already.
@@ -3143,40 +3138,43 @@ bool QGraphicsScene::event(QEvent *event)
case QEvent::InputMethod:
inputMethodEvent(static_cast<QInputMethodEvent *>(event));
break;
- case QEvent::WindowActivate: {
+ case QEvent::WindowActivate:
if (!d->activationRefCount++) {
- // Notify all non-window widgets.
- foreach (QGraphicsItem *item, items()) {
- if (item->isWidget() && item->isVisible() && !item->isWindow() && !item->parentWidget()) {
- QEvent event(QEvent::WindowActivate);
- QApplication::sendEvent(static_cast<QGraphicsWidget *>(item), &event);
+ if (d->lastActivePanel) {
+ // Activate the last panel.
+ setActivePanel(d->lastActivePanel);
+ } else if (d->tabFocusFirst && d->tabFocusFirst->isPanel()) {
+ // Activate the panel of the first item in the tab focus
+ // chain.
+ setActivePanel(d->tabFocusFirst);
+ } else {
+ // Activate all toplevel items.
+ QEvent event(QEvent::WindowActivate);
+ foreach (QGraphicsItem *item, items()) {
+ if (item->isVisible() && !item->isPanel() && !item->parentItem())
+ sendEvent(item, &event);
}
}
-
- // Restore window activation.
- QGraphicsItem *nextFocusItem = d->focusItem ? d->focusItem : d->lastFocusItem;
- if (nextFocusItem && nextFocusItem->window())
- setActiveWindow(static_cast<QGraphicsWidget *>(nextFocusItem));
- else if (d->tabFocusFirst && d->tabFocusFirst->isWindow())
- setActiveWindow(d->tabFocusFirst);
}
break;
- }
- case QEvent::WindowDeactivate: {
+ case QEvent::WindowDeactivate:
if (!--d->activationRefCount) {
- // Remove window activation.
- setActiveWindow(0);
-
- // Notify all non-window widgets.
- foreach (QGraphicsItem *item, items()) {
- if (item->isWidget() && item->isVisible() && !item->isWindow() && !item->parentWidget()) {
- QEvent event(QEvent::WindowDeactivate);
- QApplication::sendEvent(static_cast<QGraphicsWidget *>(item), &event);
+ if (d->activePanel) {
+ // Deactivate the active panel (but keep it so we can
+ // reactivate it later).
+ QGraphicsItem *lastActivePanel = d->activePanel;
+ setActivePanel(0);
+ d->lastActivePanel = lastActivePanel;
+ } else {
+ // Activate all toplevel items.
+ QEvent event(QEvent::WindowDeactivate);
+ foreach (QGraphicsItem *item, items()) {
+ if (item->isVisible() && !item->isPanel() && !item->parentItem())
+ sendEvent(item, &event);
}
}
}
break;
- }
case QEvent::ApplicationFontChange: {
// Resolve the existing scene font.
d->resolveFont();
@@ -3539,8 +3537,8 @@ bool QGraphicsScenePrivate::dispatchHoverEvent(QGraphicsSceneHoverEvent *hoverEv
QGraphicsItem *commonAncestorItem = (item && !hoverItems.isEmpty()) ? item->commonAncestorItem(hoverItems.last()) : 0;
while (commonAncestorItem && !itemAcceptsHoverEvents_helper(commonAncestorItem))
commonAncestorItem = commonAncestorItem->parentItem();
- if (commonAncestorItem && commonAncestorItem->window() != item->window()) {
- // The common ancestor isn't in the same window as the two hovered
+ if (commonAncestorItem && commonAncestorItem->panel() != item->panel()) {
+ // The common ancestor isn't in the same panel as the two hovered
// items.
commonAncestorItem = 0;
}
@@ -3561,8 +3559,8 @@ bool QGraphicsScenePrivate::dispatchHoverEvent(QGraphicsSceneHoverEvent *hoverEv
QGraphicsItem *parent = item;
while (parent && parent != commonAncestorItem) {
parents.prepend(parent);
- if (parent->isWindow()) {
- // Stop at the window - we don't deliver beyond this point.
+ if (parent->isPanel()) {
+ // Stop at the panel - we don't deliver beyond this point.
break;
}
parent = parent->parentItem();
@@ -3639,7 +3637,7 @@ void QGraphicsScene::keyPressEvent(QKeyEvent *keyEvent)
// is filtered out, stop propagating it.
if (!d->sendEvent(p, keyEvent))
break;
- } while (!keyEvent->isAccepted() && !p->isWindow() && (p = p->parentItem()));
+ } while (!keyEvent->isAccepted() && !p->isPanel() && (p = p->parentItem()));
} else {
keyEvent->ignore();
}
@@ -3669,7 +3667,7 @@ void QGraphicsScene::keyReleaseEvent(QKeyEvent *keyEvent)
// is filtered out, stop propagating it.
if (!d->sendEvent(p, keyEvent))
break;
- } while (!keyEvent->isAccepted() && !p->isWindow() && (p = p->parentItem()));
+ } while (!keyEvent->isAccepted() && !p->isPanel() && (p = p->parentItem()));
} else {
keyEvent->ignore();
}
@@ -3831,9 +3829,9 @@ void QGraphicsScene::wheelEvent(QGraphicsSceneWheelEvent *wheelEvent)
wheelEvent->setPos(item->d_ptr->genericMapFromScene(wheelEvent->scenePos(),
wheelEvent->widget()));
wheelEvent->accept();
- bool isWindow = item->isWindow();
+ bool isPanel = item->isPanel();
d->sendEvent(item, wheelEvent);
- if (isWindow || wheelEvent->isAccepted())
+ if (isPanel || wheelEvent->isAccepted())
break;
}
}
@@ -4892,7 +4890,7 @@ bool QGraphicsScene::focusNextPrevChild(bool next)
if (widget->flags() & QGraphicsItem::ItemIsFocusable
&& widget->isEnabled() && widget->isVisibleTo(0)
&& (widget->focusPolicy() & Qt::TabFocus)
- && (!item || !item->isWindow() || item->isAncestorOf(widget))
+ && (!item || !item->isPanel() || item->isAncestorOf(widget))
) {
setFocusItem(widget, next ? Qt::TabFocusReason : Qt::BacktabFocusReason);
return true;
@@ -5079,84 +5077,150 @@ void QGraphicsScene::setPalette(const QPalette &palette)
}
/*!
- \since 4.4
+ \since 4.6
- Returns the current active window, or 0 if there is no window is currently
- active.
+ Returns true if the scene is active (e.g., it's viewed by
+ at least one QGraphicsView that is active); otherwise returns false.
- \sa QGraphicsScene::setActiveWindow()
+ \sa QGraphicsItem::isActive(), QWidget::isActiveWindow()
*/
-QGraphicsWidget *QGraphicsScene::activeWindow() const
+bool QGraphicsScene::isActive() const
{
Q_D(const QGraphicsScene);
- return d->activeWindow;
+ return d->activationRefCount > 0;
}
/*!
- \since 4.4
- Activates \a widget, which must be a widget in this scene. You can also
- pass 0 for \a widget, in which case QGraphicsScene will deactivate any
- currently active window.
+ \since 4.6
+ Returns the current active panel, or 0 if no panel is currently active.
- \sa activeWindow(), QGraphicsWidget::isActiveWindow()
+ \sa QGraphicsScene::setActivePanel()
*/
-void QGraphicsScene::setActiveWindow(QGraphicsWidget *widget)
+QGraphicsItem *QGraphicsScene::activePanel() const
+{
+ Q_D(const QGraphicsScene);
+ return d->activePanel;
+}
+
+/*!
+ \since 4.6
+ Activates \a item, which must be an item in this scene. You
+ can also pass 0 for \a item, in which case QGraphicsScene will
+ deactivate any currently active panel.
+
+ \sa activePanel(), isActive(), QGraphicsItem::isActive()
+*/
+void QGraphicsScene::setActivePanel(QGraphicsItem *item)
{
Q_D(QGraphicsScene);
- if (widget && widget->scene() != this) {
- qWarning("QGraphicsScene::setActiveWindow: widget %p must be part of this scene",
- widget);
+ if (item && item->scene() != this) {
+ qWarning("QGraphicsScene::setActivePanel: item %p must be part of this scene",
+ item);
return;
}
- // Activate the widget's window.
- QGraphicsWidget *window = widget ? widget->window() : 0;
- if (window == d->activeWindow)
+ // Find the item's panel.
+ QGraphicsItem *panel = item ? item->panel() : 0;
+ d->lastActivePanel = panel ? d->activePanel : 0;
+ if (panel == d->activePanel)
return;
- // Deactivate the last active window.
- if (d->activeWindow) {
- if (QGraphicsWidget *fw = d->activeWindow->focusWidget()) {
+ // Deactivate the last active panel.
+ if (d->activePanel) {
+ if (QGraphicsItem *fi = d->activePanel->focusItem()) {
// Remove focus from the current focus item.
- if (fw == focusItem())
+ if (fi == focusItem())
setFocusItem(0, Qt::ActiveWindowFocusReason);
}
QEvent event(QEvent::WindowDeactivate);
- QApplication::sendEvent(d->activeWindow, &event);
+ sendEvent(d->activePanel, &event);
+ } else if (panel) {
+ // Deactivate the scene if changing activation to a panel.
+ QEvent event(QEvent::WindowDeactivate);
+ foreach (QGraphicsItem *item, items()) {
+ if (item->isVisible() && !item->isPanel() && !item->parentItem())
+ sendEvent(item, &event);
+ }
}
// Update activate state.
- d->activeWindow = window;
+ d->activePanel = panel;
QEvent event(QEvent::ActivationChange);
QApplication::sendEvent(this, &event);
// Activate
- if (window) {
+ if (panel) {
QEvent event(QEvent::WindowActivate);
- QApplication::sendEvent(window, &event);
+ sendEvent(panel, &event);
+ // Set focus on the panel's focus item.
+ if (QGraphicsItem *focusItem = panel->focusItem())
+ focusItem->setFocus(Qt::ActiveWindowFocusReason);
+ } else if (isActive()) {
+ // Activate the scene
+ QEvent event(QEvent::WindowActivate);
+ foreach (QGraphicsItem *item, items()) {
+ if (item->isVisible() && !item->isPanel() && !item->parentItem())
+ sendEvent(item, &event);
+ }
+ }
+}
+
+/*!
+ \since 4.4
+
+ Returns the current active window, or 0 if there is no window is currently
+ active.
+
+ \sa QGraphicsScene::setActiveWindow()
+*/
+QGraphicsWidget *QGraphicsScene::activeWindow() const
+{
+ Q_D(const QGraphicsScene);
+ if (d->activePanel && d->activePanel->isWindow())
+ return static_cast<QGraphicsWidget *>(d->activePanel);
+ return 0;
+}
+
+/*!
+ \since 4.4
+ Activates \a widget, which must be a widget in this scene. You can also
+ pass 0 for \a widget, in which case QGraphicsScene will deactivate any
+ currently active window.
+
+ \sa activeWindow(), QGraphicsWidget::isActiveWindow()
+*/
+void QGraphicsScene::setActiveWindow(QGraphicsWidget *widget)
+{
+ if (widget && widget->scene() != this) {
+ qWarning("QGraphicsScene::setActiveWindow: widget %p must be part of this scene",
+ widget);
+ return;
+ }
+
+ // Activate the widget's panel (all windows are panels).
+ QGraphicsItem *panel = widget ? widget->panel() : 0;
+ setActivePanel(panel);
+
+ // Raise
+ if (panel) {
QList<QGraphicsItem *> siblingWindows;
- QGraphicsItem *parent = window->parentItem();
+ QGraphicsItem *parent = panel->parentItem();
// Raise ### inefficient for toplevels
foreach (QGraphicsItem *sibling, parent ? parent->children() : items()) {
- if (sibling != window && sibling->isWidget()
- && static_cast<QGraphicsWidget *>(sibling)->isWindow()) {
+ if (sibling != panel && sibling->isWindow())
siblingWindows << sibling;
- }
}
// Find the highest z value.
- qreal z = window->zValue();
+ qreal z = panel->zValue();
for (int i = 0; i < siblingWindows.size(); ++i)
z = qMax(z, siblingWindows.at(i)->zValue());
// This will probably never overflow.
const qreal litt = qreal(0.001);
- window->setZValue(z + litt);
-
- if (QGraphicsWidget *focusChild = window->focusWidget())
- focusChild->setFocus(Qt::ActiveWindowFocusReason);
+ panel->setZValue(z + litt);
}
}
diff --git a/src/gui/graphicsview/qgraphicsscene.h b/src/gui/graphicsview/qgraphicsscene.h
index 26cb1c2..9478879 100644
--- a/src/gui/graphicsview/qgraphicsscene.h
+++ b/src/gui/graphicsview/qgraphicsscene.h
@@ -243,6 +243,9 @@ public:
QPalette palette() const;
void setPalette(const QPalette &palette);
+ bool isActive() const;
+ QGraphicsItem *activePanel() const;
+ void setActivePanel(QGraphicsItem *item);
QGraphicsWidget *activeWindow() const;
void setActiveWindow(QGraphicsWidget *widget);
diff --git a/src/gui/graphicsview/qgraphicsscene_p.h b/src/gui/graphicsview/qgraphicsscene_p.h
index 9e62901..def6f46 100644
--- a/src/gui/graphicsview/qgraphicsscene_p.h
+++ b/src/gui/graphicsview/qgraphicsscene_p.h
@@ -47,8 +47,8 @@
// -------------
//
// This file is not part of the Qt API. It exists for the convenience
-// of qapplication_*.cpp, qwidget*.cpp and qfiledialog.cpp. This header
-// file may change from version to version without notice, or even be removed.
+// of other Qt classes. This header file may change from version to
+// version without notice, or even be removed.
//
// We mean it.
//
@@ -131,7 +131,8 @@ public:
QGraphicsItem *focusItem;
QGraphicsItem *lastFocusItem;
QGraphicsWidget *tabFocusFirst;
- QGraphicsWidget *activeWindow;
+ QGraphicsItem *activePanel;
+ QGraphicsItem *lastActivePanel;
int activationRefCount;
void setFocusItemHelper(QGraphicsItem *item, Qt::FocusReason focusReason);
diff --git a/src/gui/graphicsview/qgraphicsscenebsptreeindex_p.h b/src/gui/graphicsview/qgraphicsscenebsptreeindex_p.h
index 27c499d..5cc8449 100644
--- a/src/gui/graphicsview/qgraphicsscenebsptreeindex_p.h
+++ b/src/gui/graphicsview/qgraphicsscenebsptreeindex_p.h
@@ -44,8 +44,8 @@
// -------------
//
// This file is not part of the Qt API. It exists for the convenience
-// of qapplication_*.cpp, qwidget*.cpp and qfiledialog.cpp. This header
-// file may change from version to version without notice, or even be removed.
+// of other Qt classes. This header file may change from version to
+// version without notice, or even be removed.
//
// We mean it.
//
diff --git a/src/gui/graphicsview/qgraphicssceneevent.cpp b/src/gui/graphicsview/qgraphicssceneevent.cpp
index 3ec14c3..afcc4e1 100644
--- a/src/gui/graphicsview/qgraphicssceneevent.cpp
+++ b/src/gui/graphicsview/qgraphicssceneevent.cpp
@@ -87,9 +87,11 @@
\since 4.2
\ingroup graphicsview-api
- When a QGraphicsView receives a QMouseEvent, it translates it to
- a QGraphicsSceneMouseEvent. The event is then forwarded to the
- QGraphicsScene associated with the view.
+ When a QGraphicsView receives a QMouseEvent, it translates it to a
+ QGraphicsSceneMouseEvent. The event is then forwarded to the
+ QGraphicsScene associated with the view. If the event is not
+ handled by the scene, the view may use it, e.g., for the
+ \l{QGraphicsView::}{DragMode}.
In addition to containing the item, scene, and screen coordinates
of the event (as pos(), scenePos(), and screenPos()), mouse
diff --git a/src/gui/graphicsview/qgraphicssceneindex_p.h b/src/gui/graphicsview/qgraphicssceneindex_p.h
index d922036..00e5f89 100644
--- a/src/gui/graphicsview/qgraphicssceneindex_p.h
+++ b/src/gui/graphicsview/qgraphicssceneindex_p.h
@@ -47,8 +47,8 @@
// -------------
//
// This file is not part of the Qt API. It exists for the convenience
-// of qapplication_*.cpp, qwidget*.cpp and qfiledialog.cpp. This header
-// file may change from version to version without notice, or even be removed.
+// of other Qt classes. This header file may change from version to
+// version without notice, or even be removed.
//
// We mean it.
//
diff --git a/src/gui/graphicsview/qgraphicstransform_p.h b/src/gui/graphicsview/qgraphicstransform_p.h
index 2c563e4..c9b95fd 100644
--- a/src/gui/graphicsview/qgraphicstransform_p.h
+++ b/src/gui/graphicsview/qgraphicstransform_p.h
@@ -47,8 +47,8 @@
// -------------
//
// This file is not part of the Qt API. It exists for the convenience
-// of qapplication_*.cpp, qwidget*.cpp and qfiledialog.cpp. This header
-// file may change from version to version without notice, or even be removed.
+// of other Qt classes. This header file may change from version to
+// version without notice, or even be removed.
//
// We mean it.
//
diff --git a/src/gui/graphicsview/qgraphicsview_p.h b/src/gui/graphicsview/qgraphicsview_p.h
index bdf5ddd..a40dfdc 100644
--- a/src/gui/graphicsview/qgraphicsview_p.h
+++ b/src/gui/graphicsview/qgraphicsview_p.h
@@ -47,8 +47,8 @@
// -------------
//
// This file is not part of the Qt API. It exists for the convenience
-// of qapplication_*.cpp, qwidget*.cpp and qfiledialog.cpp. This header
-// file may change from version to version without notice, or even be removed.
+// of other Qt classes. This header file may change from version to
+// version without notice, or even be removed.
//
// We mean it.
//
diff --git a/src/gui/graphicsview/qgraphicswidget.cpp b/src/gui/graphicsview/qgraphicswidget.cpp
index 7f9fe65..40addf6 100644
--- a/src/gui/graphicsview/qgraphicswidget.cpp
+++ b/src/gui/graphicsview/qgraphicswidget.cpp
@@ -1285,10 +1285,6 @@ bool QGraphicsWidget::event(QEvent *event)
case QEvent::WindowActivate:
case QEvent::WindowDeactivate:
update();
- foreach (QGraphicsItem *child, childItems()) {
- if (child->isWidget())
- QApplication::sendEvent(static_cast<QGraphicsWidget *>(child), event);
- }
break;
// Taken from QWidget::event
case QEvent::ActivationChange:
@@ -1598,6 +1594,8 @@ void QGraphicsWidget::ungrabKeyboardEvent(QEvent *event)
/*!
Returns the widgets window type.
+
+ \sa windowFlags(), isWindow(), isPanel()
*/
Qt::WindowType QGraphicsWidget::windowType() const
{
@@ -1613,6 +1611,13 @@ Qt::WindowType QGraphicsWidget::windowType() const
is platform-dependent.
By default, this property contains no window flags.
+
+ Windows are panels. If you set the Qt::Window flag, the ItemIsPanel flag
+ will be set automatically. If you clear the Qt::Window flag, the
+ ItemIsPanel flag is also cleared. Note that the ItemIsPanel flag can be
+ set independently of Qt::Window.
+
+ \sa isWindow(), isPanel()
*/
Qt::WindowFlags QGraphicsWidget::windowFlags() const
{
@@ -1631,6 +1636,8 @@ void QGraphicsWidget::setWindowFlags(Qt::WindowFlags wFlags)
if (!d->setWindowFrameMargins)
unsetWindowFrameMargins();
+ setFlag(ItemIsPanel, d->windowFlags & Qt::Window);
+
bool isPopup = (d->windowFlags & Qt::WindowType_Mask) == Qt::Popup;
if (d->scene && isVisible() && wasPopup != isPopup) {
// Popup state changed; update implicit mouse grab.
@@ -1654,7 +1661,7 @@ void QGraphicsWidget::setWindowFlags(Qt::WindowFlags wFlags)
The active window is the window that either contains a child widget that
currently has input focus, or that itself has input focus.
- \sa QGraphicsScene::activeWindow(), QGraphicsScene::setActiveWindow()
+ \sa QGraphicsScene::activeWindow(), QGraphicsScene::setActiveWindow(), isActive()
*/
bool QGraphicsWidget::isActiveWindow() const
{
@@ -1662,7 +1669,7 @@ bool QGraphicsWidget::isActiveWindow() const
if (!d->scene)
return false;
const QGraphicsWidget *w = window();
- return (!w && d->scene->d_func()->activationRefCount) || (w && d->scene->activeWindow() == w);
+ return (!w && d->scene->isActive()) || (w && d->scene->activeWindow() == w);
}
/*!
diff --git a/src/gui/graphicsview/qgraphicswidget_p.h b/src/gui/graphicsview/qgraphicswidget_p.h
index 0e1fe46..1ee79e1 100644
--- a/src/gui/graphicsview/qgraphicswidget_p.h
+++ b/src/gui/graphicsview/qgraphicswidget_p.h
@@ -47,8 +47,8 @@
// -------------
//
// This file is not part of the Qt API. It exists for the convenience
-// of qapplication_*.cpp, qwidget*.cpp and qfiledialog.cpp. This header
-// file may change from version to version without notice, or even be removed.
+// of other Qt classes. This header file may change from version to
+// version without notice, or even be removed.
//
// We mean it.
//
diff --git a/src/gui/graphicsview/qgridlayoutengine.cpp b/src/gui/graphicsview/qgridlayoutengine.cpp
index 5ad6ac9..beb9cb0 100644
--- a/src/gui/graphicsview/qgridlayoutengine.cpp
+++ b/src/gui/graphicsview/qgridlayoutengine.cpp
@@ -461,7 +461,7 @@ void QGridLayoutRowData::dump(int indent) const
QGridLayoutItem::QGridLayoutItem(QGridLayoutEngine *engine, QGraphicsLayoutItem *layoutItem,
int row, int column, int rowSpan, int columnSpan,
- Qt::Alignment alignment)
+ Qt::Alignment alignment, int itemAtIndex)
: q_engine(engine), q_layoutItem(layoutItem), q_alignment(alignment)
{
q_firstRows[Hor] = column;
@@ -471,7 +471,7 @@ QGridLayoutItem::QGridLayoutItem(QGridLayoutEngine *engine, QGraphicsLayoutItem
q_stretches[Hor] = -1;
q_stretches[Ver] = -1;
- q_engine->addItem(this);
+ q_engine->insertItem(this, itemAtIndex);
}
int QGridLayoutItem::firstRow(Qt::Orientation orientation) const
@@ -937,11 +937,20 @@ Qt::Alignment QGridLayoutEngine::effectiveAlignment(const QGridLayoutItem *layou
return align;
}
-void QGridLayoutEngine::addItem(QGridLayoutItem *item)
+/*!
+ \internal
+ The \a index is only used by QGraphicsLinearLayout to ensure that itemAt() reflects the order
+ of visual arrangement. Strictly speaking it does not have to, but most people expect it to.
+ (And if it didn't we would have to add itemArrangedAt(int index) or something..)
+ */
+void QGridLayoutEngine::insertItem(QGridLayoutItem *item, int index)
{
maybeExpandGrid(item->lastRow(), item->lastColumn());
- q_items.append(item);
+ if (index == -1)
+ q_items.append(item);
+ else
+ q_items.insert(index, item);
for (int i = item->firstRow(); i <= item->lastRow(); ++i) {
for (int j = item->firstColumn(); j <= item->lastColumn(); ++j) {
@@ -952,6 +961,11 @@ void QGridLayoutEngine::addItem(QGridLayoutItem *item)
}
}
+void QGridLayoutEngine::addItem(QGridLayoutItem *item)
+{
+ insertItem(item, -1);
+}
+
void QGridLayoutEngine::removeItem(QGridLayoutItem *item)
{
Q_ASSERT(q_items.contains(item));
diff --git a/src/gui/graphicsview/qgridlayoutengine_p.h b/src/gui/graphicsview/qgridlayoutengine_p.h
index 8f3eb13..aab695a 100644
--- a/src/gui/graphicsview/qgridlayoutengine_p.h
+++ b/src/gui/graphicsview/qgridlayoutengine_p.h
@@ -267,7 +267,8 @@ class QGridLayoutItem
{
public:
QGridLayoutItem(QGridLayoutEngine *engine, QGraphicsLayoutItem *layoutItem, int row, int column,
- int rowSpan = 1, int columnSpan = 1, Qt::Alignment alignment = 0);
+ int rowSpan = 1, int columnSpan = 1, Qt::Alignment alignment = 0,
+ int itemAtIndex = -1);
inline int firstRow() const { return q_firstRows[Ver]; }
inline int firstColumn() const { return q_firstRows[Hor]; }
@@ -378,6 +379,7 @@ public:
Qt::Alignment effectiveAlignment(const QGridLayoutItem *layoutItem) const;
+ void insertItem(QGridLayoutItem *item, int index);
void addItem(QGridLayoutItem *item);
void removeItem(QGridLayoutItem *item);
QGridLayoutItem *findLayoutItem(QGraphicsLayoutItem *layoutItem) const;
diff --git a/src/gui/graphicsview/qsimplex_p.cpp b/src/gui/graphicsview/qsimplex_p.cpp
index dbd8d4f..30a7d5d 100644
--- a/src/gui/graphicsview/qsimplex_p.cpp
+++ b/src/gui/graphicsview/qsimplex_p.cpp
@@ -293,7 +293,7 @@ int QSimplex::findPivotColumn()
int QSimplex::pivotRowForColumn(int column)
{
- qreal min = 999999999999.0; // ###
+ qreal min = qreal(999999999999.0); // ###
int minIndex = -1;
for (int i = 1; i < rows; ++i) {
diff --git a/src/gui/image/qpixmap.cpp b/src/gui/image/qpixmap.cpp
index 658b8e0..155474f 100644
--- a/src/gui/image/qpixmap.cpp
+++ b/src/gui/image/qpixmap.cpp
@@ -322,6 +322,8 @@ QPixmap::QPixmap(const char * const xpm[])
QPixmap::~QPixmap()
{
+ if (data->is_cached && data->ref == 1)
+ QImagePixmapCleanupHooks::executePixmapHooks(this);
}
/*!
diff --git a/src/gui/image/qpixmap_qws.cpp b/src/gui/image/qpixmap_qws.cpp
index e549900..a6c70a7 100644
--- a/src/gui/image/qpixmap_qws.cpp
+++ b/src/gui/image/qpixmap_qws.cpp
@@ -48,6 +48,9 @@
#include <private/qdrawhelper_p.h>
#include <private/qpixmap_raster_p.h>
+
+QT_BEGIN_NAMESPACE
+
QPixmap QPixmap::grabWindow(WId window, int x, int y, int w, int h)
{
QWidget *widget = QWidget::find(window);
@@ -148,3 +151,5 @@ int QPixmap::qwsBytesPerLine() const
return 0;
}
+
+QT_END_NAMESPACE
diff --git a/src/gui/image/qpixmapfilter.cpp b/src/gui/image/qpixmapfilter.cpp
index bc14b5e..4b2f365 100644
--- a/src/gui/image/qpixmapfilter.cpp
+++ b/src/gui/image/qpixmapfilter.cpp
@@ -580,8 +580,6 @@ Qt::TransformationMode QPixmapBlurFilter::quality() const
}
/*!
- \reimp
-
\internal
*/
QRectF QPixmapBlurFilter::boundingRectFor(const QRectF &rect) const
@@ -657,8 +655,6 @@ static QImage blurred(const QImage& image, const QRect& rect, int radius)
}
/*!
- \reimp
-
\internal
*/
void QPixmapBlurFilter::draw(QPainter *painter, const QPointF &p, const QPixmap &src, const QRectF &srcRect) const
diff --git a/src/gui/inputmethod/qinputcontext.cpp b/src/gui/inputmethod/qinputcontext.cpp
index 35f1b65..992bc78 100644
--- a/src/gui/inputmethod/qinputcontext.cpp
+++ b/src/gui/inputmethod/qinputcontext.cpp
@@ -105,25 +105,27 @@ QT_BEGIN_NAMESPACE
\header \o Context \o Functions
\row \o Receiving information \o
- x11FilterEvent(),
- filterEvent(),
- mouseHandler()
+ x11FilterEvent(),
+ filterEvent(),
+ mouseHandler()
\row \o Sending back composed text \o
- sendEvent()
+ sendEvent()
\row \o State change notification \o
- setFocusWidget(),
- reset()
+ setFocusWidget(),
+ reset()
\row \o Context information \o
- identifierName(),
- language(),
- font(),
- isComposing()
+ identifierName(),
+ language(),
+ font(),
+ isComposing()
\endtable
+ \section1 Licensing Information
+
\legalese
Copyright (C) 2003-2004 immodule for Qt Project. All rights reserved.
@@ -154,16 +156,17 @@ QInputContext::~QInputContext()
}
/*!
- \internal
Returns the widget that has an input focus for this input
- context. Ordinary input methods should not call this function
- directly to keep platform independence and flexible configuration
- possibility.
+ context.
The return value may differ from holderWidget() if the input
context is shared between several text widgets.
- \sa setFocusWidget(), holderWidget()
+ \warning To ensure platform independence and support flexible
+ configuration of widgets, ordinary input methods should not call
+ this function directly.
+
+ \sa setFocusWidget()
*/
QWidget *QInputContext::focusWidget() const
{
@@ -173,9 +176,9 @@ QWidget *QInputContext::focusWidget() const
/*!
- \internal
- Sets the widget that has an input focus for this input
- context. Ordinary input methods must not call this function
+ Sets the widget that has an input focus for this input context.
+
+ \warning Ordinary input methods must not call this function
directly.
\sa focusWidget()
diff --git a/src/gui/inputmethod/qwininputcontext_p.h b/src/gui/inputmethod/qwininputcontext_p.h
index eff223b..767fc33 100644
--- a/src/gui/inputmethod/qwininputcontext_p.h
+++ b/src/gui/inputmethod/qwininputcontext_p.h
@@ -79,6 +79,7 @@ public:
bool startComposition();
bool endComposition();
bool composition(LPARAM lparam);
+ int reconvertString(RECONVERTSTRING *reconv);
static void TranslateMessage(const MSG *msg);
static LRESULT DefWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
diff --git a/src/gui/inputmethod/qwininputcontext_win.cpp b/src/gui/inputmethod/qwininputcontext_win.cpp
index 684f325..d917cb3 100644
--- a/src/gui/inputmethod/qwininputcontext_win.cpp
+++ b/src/gui/inputmethod/qwininputcontext_win.cpp
@@ -47,6 +47,7 @@
#include "qapplication.h"
#include "qevent.h"
#include "qtextformat.h"
+#include "qtextboundaryfinder.h"
//#define Q_IME_DEBUG
@@ -810,4 +811,52 @@ QString QWinInputContext::language()
return QString();
}
+int QWinInputContext::reconvertString(RECONVERTSTRING *reconv)
+{
+ QWidget *w = focusWidget();
+ if(!w)
+ return -1;
+
+ Q_ASSERT(w->testAttribute(Qt::WA_WState_Created));
+ QString surroundingText = qvariant_cast<QString>(w->inputMethodQuery(Qt::ImSurroundingText));
+ int memSize = sizeof(RECONVERTSTRING)+(surroundingText.length()+1)*sizeof(ushort);
+ // If memory is not allocated, return the required size.
+ if (!reconv) {
+ if (surroundingText.isEmpty())
+ return -1;
+ else
+ return memSize;
+ }
+ int pos = qvariant_cast<int>(w->inputMethodQuery(Qt::ImCursorPosition));
+ // find the word in the surrounding text.
+ QTextBoundaryFinder bounds(QTextBoundaryFinder::Word, surroundingText);
+ bounds.setPosition(pos);
+ if (bounds.isAtBoundary()) {
+ if (QTextBoundaryFinder::EndWord == bounds.boundaryReasons())
+ bounds.toPreviousBoundary();
+ } else {
+ bounds.toPreviousBoundary();
+ }
+ int startPos = bounds.position();
+ bounds.toNextBoundary();
+ int endPos = bounds.position();
+ // select the text, this will be overwritten by following ime events.
+ QList<QInputMethodEvent::Attribute> attrs;
+ attrs << QInputMethodEvent::Attribute(QInputMethodEvent::Selection, startPos, endPos-startPos, QVariant());
+ QInputMethodEvent e(QString(), attrs);
+ qt_sendSpontaneousEvent(w, &e);
+
+ reconv->dwSize = memSize;
+ reconv->dwVersion = 0;
+
+ reconv->dwStrLen = surroundingText.length();
+ reconv->dwStrOffset = sizeof(RECONVERTSTRING);
+ reconv->dwCompStrLen = endPos-startPos;
+ reconv->dwCompStrOffset = startPos*sizeof(ushort);
+ reconv->dwTargetStrLen = reconv->dwCompStrLen;
+ reconv->dwTargetStrOffset = reconv->dwCompStrOffset;
+ memcpy((char*)(reconv+1), surroundingText.utf16(), surroundingText.length()*sizeof(ushort));
+ return memSize;
+}
+
QT_END_NAMESPACE
diff --git a/src/gui/inputmethod/qwsinputcontext_qws.cpp b/src/gui/inputmethod/qwsinputcontext_qws.cpp
index 5d92e1c..371ff1d 100644
--- a/src/gui/inputmethod/qwsinputcontext_qws.cpp
+++ b/src/gui/inputmethod/qwsinputcontext_qws.cpp
@@ -111,8 +111,8 @@ void QWSInputContext::setFocusWidget( QWidget *w )
void QWSInputContext::widgetDestroyed(QWidget *w)
{
- if (w == ::activeWidget)
- ::activeWidget = 0;
+ if (w == QT_PREPEND_NAMESPACE(activeWidget))
+ QT_PREPEND_NAMESPACE(activeWidget) = 0;
QInputContext::widgetDestroyed(w);
}
@@ -138,13 +138,13 @@ void QWSInputContext::mouseHandler( int x, QMouseEvent *event)
QWidget *QWSInputContext::activeWidget()
{
- return ::activeWidget;
+ return QT_PREPEND_NAMESPACE(activeWidget);
}
bool QWSInputContext::isComposing() const
{
- return ::activeWidget != 0;
+ return QT_PREPEND_NAMESPACE(activeWidget) != 0;
}
bool QWSInputContext::translateIMQueryEvent(QWidget *w, const QWSIMQueryEvent *e)
@@ -182,8 +182,8 @@ bool QWSInputContext::translateIMEvent(QWidget *w, const QWSIMEvent *e)
stream >> preedit;
stream >> commit;
- if (preedit.isEmpty() && ::activeWidget)
- w = ::activeWidget;
+ if (preedit.isEmpty() && QT_PREPEND_NAMESPACE(activeWidget))
+ w = QT_PREPEND_NAMESPACE(activeWidget);
QInputContext *qic = w->inputContext();
if (!qic)
@@ -213,9 +213,9 @@ bool QWSInputContext::translateIMEvent(QWidget *w, const QWSIMEvent *e)
#endif
if (preedit.isEmpty())
- ::activeWidget = 0;
+ QT_PREPEND_NAMESPACE(activeWidget) = 0;
else
- ::activeWidget = w;
+ QT_PREPEND_NAMESPACE(activeWidget) = w;
QInputMethodEvent ime(preedit, attrs);
diff --git a/src/gui/itemviews/qabstractitemview.cpp b/src/gui/itemviews/qabstractitemview.cpp
index bca5df7..ccc57d7 100644
--- a/src/gui/itemviews/qabstractitemview.cpp
+++ b/src/gui/itemviews/qabstractitemview.cpp
@@ -1661,9 +1661,6 @@ void QAbstractItemView::mouseReleaseEvent(QMouseEvent *event)
EditTrigger trigger = (selectedClicked ? SelectedClicked : NoEditTriggers);
bool edited = edit(index, trigger, event);
- if (d->selectionModel)
- d->selectionModel->select(index, selectionCommand(index, event));
-
setState(NoState);
if (click) {
diff --git a/src/gui/itemviews/qsortfilterproxymodel.cpp b/src/gui/itemviews/qsortfilterproxymodel.cpp
index d173efe..18fbf7b 100644
--- a/src/gui/itemviews/qsortfilterproxymodel.cpp
+++ b/src/gui/itemviews/qsortfilterproxymodel.cpp
@@ -174,6 +174,7 @@ public:
const QModelIndex &source_bottom_right);
void _q_sourceHeaderDataChanged(Qt::Orientation orientation, int start, int end);
+ void _q_sourceAboutToBeReset();
void _q_sourceReset();
void _q_sourceLayoutAboutToBeChanged();
@@ -1148,11 +1149,17 @@ void QSortFilterProxyModelPrivate::_q_sourceHeaderDataChanged(Qt::Orientation or
emit q->headerDataChanged(orientation, proxy_start, proxy_end);
}
+void QSortFilterProxyModelPrivate::_q_sourceAboutToBeReset()
+{
+ Q_Q(QSortFilterProxyModel);
+ q->beginResetModel();
+}
+
void QSortFilterProxyModelPrivate::_q_sourceReset()
{
Q_Q(QSortFilterProxyModel);
// All internal structures are deleted in clear()
- q->reset();
+ q->endResetModel();
update_source_sort_column();
if (dynamic_sortfilter)
sort();
@@ -1499,6 +1506,7 @@ void QSortFilterProxyModel::setSourceModel(QAbstractItemModel *sourceModel)
disconnect(d->model, SIGNAL(layoutChanged()),
this, SLOT(_q_sourceLayoutChanged()));
+ disconnect(d->model, SIGNAL(modelAboutToBeReset()), this, SLOT(_q_sourceAboutToBeReset()));
disconnect(d->model, SIGNAL(modelReset()), this, SLOT(_q_sourceReset()));
QAbstractProxyModel::setSourceModel(sourceModel);
@@ -1539,6 +1547,7 @@ void QSortFilterProxyModel::setSourceModel(QAbstractItemModel *sourceModel)
connect(d->model, SIGNAL(layoutChanged()),
this, SLOT(_q_sourceLayoutChanged()));
+ connect(d->model, SIGNAL(modelAboutToBeReset()), this, SLOT(_q_sourceAboutToBeReset()));
connect(d->model, SIGNAL(modelReset()), this, SLOT(_q_sourceReset()));
d->clear_mapping();
diff --git a/src/gui/itemviews/qsortfilterproxymodel.h b/src/gui/itemviews/qsortfilterproxymodel.h
index 12baa19..0314aec 100644
--- a/src/gui/itemviews/qsortfilterproxymodel.h
+++ b/src/gui/itemviews/qsortfilterproxymodel.h
@@ -177,6 +177,7 @@ private:
Q_PRIVATE_SLOT(d_func(), void _q_sourceDataChanged(const QModelIndex &source_top_left, const QModelIndex &source_bottom_right))
Q_PRIVATE_SLOT(d_func(), void _q_sourceHeaderDataChanged(Qt::Orientation orientation, int start, int end))
+ Q_PRIVATE_SLOT(d_func(), void _q_sourceAboutToBeReset())
Q_PRIVATE_SLOT(d_func(), void _q_sourceReset())
Q_PRIVATE_SLOT(d_func(), void _q_sourceLayoutAboutToBeChanged())
Q_PRIVATE_SLOT(d_func(), void _q_sourceLayoutChanged())
diff --git a/src/gui/kernel/qapplication_p.h b/src/gui/kernel/qapplication_p.h
index e839617..f7f8ce9 100644
--- a/src/gui/kernel/qapplication_p.h
+++ b/src/gui/kernel/qapplication_p.h
@@ -264,12 +264,15 @@ typedef struct tagGESTURECONFIG
class QPanGesture;
class QPinchGesture;
+class QSwipeGesture;
+
struct QStandardGestures
{
QPanGesture *pan;
QPinchGesture *pinch;
+ QSwipeGesture *swipe;
- QStandardGestures() : pan(0), pinch(0) { }
+ QStandardGestures() : pan(0), pinch(0), swipe(0) { }
};
diff --git a/src/gui/kernel/qapplication_qws.cpp b/src/gui/kernel/qapplication_qws.cpp
index f7a7ab0..5340ae9 100644
--- a/src/gui/kernel/qapplication_qws.cpp
+++ b/src/gui/kernel/qapplication_qws.cpp
@@ -72,6 +72,7 @@
//#include "qwsregionmanager_qws.h"
#include "qwindowsystem_qws.h"
#include "private/qwindowsystem_p.h"
+#include "qdecorationfactory_qws.h"
#include "qwsdisplay_qws.h"
#include "private/qwsdisplay_qws_p.h"
@@ -122,6 +123,8 @@
#endif
#endif
+QT_BEGIN_NAMESPACE
+
#ifndef QT_NO_DIRECTPAINTER
class QDirectPainter;
extern void qt_directpainter_region(QDirectPainter *dp, const QRegion &alloc, int type);
@@ -161,13 +164,9 @@ int qt_servershmid = -1;
bool qws_overrideCursor = false;
#ifndef QT_NO_QWS_MANAGER
-#include "qdecorationfactory_qws.h"
extern Q_GUI_EXPORT QWSServer *qwsServer;
-QT_BEGIN_NAMESPACE
-
-QT_USE_NAMESPACE
static QDecoration *qws_decoration = 0;
#endif
@@ -2371,7 +2370,7 @@ void qt_cleanup()
QString QApplicationPrivate::appName() const // get application name
{
- return ::appName;
+ return QT_PREPEND_NAMESPACE(appName);
}
/*****************************************************************************
diff --git a/src/gui/kernel/qapplication_win.cpp b/src/gui/kernel/qapplication_win.cpp
index 76a3b1e..b92bf03 100644
--- a/src/gui/kernel/qapplication_win.cpp
+++ b/src/gui/kernel/qapplication_win.cpp
@@ -171,6 +171,10 @@ typedef struct tagTOUCHINPUT
#include <mywinsock.h>
#endif
+#ifndef IMR_CONFIRMRECONVERTSTRING
+#define IMR_CONFIRMRECONVERTSTRING 0x0005
+#endif
+
QT_BEGIN_NAMESPACE
#ifdef Q_WS_WINCE
@@ -2263,7 +2267,26 @@ LRESULT CALLBACK QtWndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam
}
break;
}
-
+ case WM_IME_REQUEST: {
+ QWidget *fw = QApplication::focusWidget();
+ QWinInputContext *im = fw ? qobject_cast<QWinInputContext *>(fw->inputContext()) : 0;
+ if (fw && im) {
+ if(wParam == IMR_RECONVERTSTRING) {
+ int ret = im->reconvertString((RECONVERTSTRING *)lParam);
+ if (ret == -1) {
+ result = false;
+ } else {
+ return ret;
+ }
+ } else if (wParam == IMR_CONFIRMRECONVERTSTRING) {
+ RETURN(TRUE);
+ } else {
+ // in all other cases, call DefWindowProc()
+ result = false;
+ }
+ }
+ break;
+ }
#ifndef Q_WS_WINCE
case WM_CHANGECBCHAIN:
case WM_DRAWCLIPBOARD:
diff --git a/src/gui/kernel/qcocoaview_mac.mm b/src/gui/kernel/qcocoaview_mac.mm
index 5ab7ed2..0a45ce9 100644
--- a/src/gui/kernel/qcocoaview_mac.mm
+++ b/src/gui/kernel/qcocoaview_mac.mm
@@ -892,7 +892,7 @@ extern "C" {
qNGEvent.gestureType = QNativeGestureEvent::Rotate;
NSPoint p = [[event window] convertBaseToScreen:[event locationInWindow]];
qNGEvent.position = flipPoint(p).toPoint();
- qNGEvent.percentage = [event rotation];
+ qNGEvent.percentage = -[event rotation];
qt_sendSpontaneousEvent(qwidget, &qNGEvent);
}
@@ -905,7 +905,14 @@ extern "C" {
qNGEvent.gestureType = QNativeGestureEvent::Swipe;
NSPoint p = [[event window] convertBaseToScreen:[event locationInWindow]];
qNGEvent.position = flipPoint(p).toPoint();
- qNGEvent.direction = QSize(-[event deltaX], -[event deltaY]);
+ if ([event deltaX] == 1)
+ qNGEvent.angle = 180.0f;
+ else if ([event deltaX] == -1)
+ qNGEvent.angle = 0.0f;
+ else if ([event deltaY] == 1)
+ qNGEvent.angle = 90.0f;
+ else if ([event deltaY] == -1)
+ qNGEvent.angle = 270.0f;
qt_sendSpontaneousEvent(qwidget, &qNGEvent);
}
diff --git a/src/gui/kernel/qcocoaview_mac_p.h b/src/gui/kernel/qcocoaview_mac_p.h
index d93fa2f..443a118 100644
--- a/src/gui/kernel/qcocoaview_mac_p.h
+++ b/src/gui/kernel/qcocoaview_mac_p.h
@@ -59,6 +59,7 @@ QT_FORWARD_DECLARE_CLASS(QWidgetPrivate);
QT_FORWARD_DECLARE_CLASS(QWidget);
QT_FORWARD_DECLARE_CLASS(QEvent);
QT_FORWARD_DECLARE_CLASS(QCocoaDropData);
+QT_FORWARD_DECLARE_CLASS(QString);
QT_FORWARD_DECLARE_CLASS(QStringList);
QT_BEGIN_NAMESPACE
diff --git a/src/gui/kernel/qevent.cpp b/src/gui/kernel/qevent.cpp
index 76d52c7..8d98223 100644
--- a/src/gui/kernel/qevent.cpp
+++ b/src/gui/kernel/qevent.cpp
@@ -1080,8 +1080,17 @@ Qt::FocusReason QFocusEvent::reason() const
rect() that is the bounding rectangle of that region. Both are
provided because many widgets can't make much use of region(),
and rect() can be much faster than region().boundingRect().
+
+ \section1 Automatic Clipping
+
Painting is clipped to region() during the processing of a paint
- event.
+ event. This clipping is performed by Qt's paint system and is
+ independent of any clipping that may be applied to a QPainter used to
+ draw on the paint device.
+
+ As a result, the value returned by QPainter::clipRegion() on
+ a newly-constructed QPainter will not reflect the clip region that is
+ used by the paint system.
\sa QPainter, QWidget::update(), QWidget::repaint(),
QWidget::paintEvent()
@@ -3544,7 +3553,8 @@ QMenubarUpdatedEvent::QMenubarUpdatedEvent(QMenuBar * const menuBar)
#endif
-/*! \class QTouchEvent
+/*!
+ \class QTouchEvent
\brief The QTouchEvent class contains parameters that describe a touch event.
\since 4.6
\ingroup events
@@ -3556,27 +3566,19 @@ QMenubarUpdatedEvent::QMenubarUpdatedEvent(QMenuBar * const menuBar)
Qt::WA_AcceptTouchEvents attribute set and graphics items need to have the
\l{QGraphicsItem::setAcceptTouchEvents()}{acceptTouchEvents} attribute set to true.
- Note: when using QAbstractScrollArea based widgets, you should enabled the
- Qt::WA_AcceptTouchEvents attribute on the scroll area's
- \l{QAbstractScrollArea::viewport()}{viewport}.
+ When using QAbstractScrollArea based widgets, you should enabled the Qt::WA_AcceptTouchEvents
+ attribute on the scroll area's \l{QAbstractScrollArea::viewport()}{viewport}.
- \section1 Event Delivery and Propagation
+ Similarly to QMouseEvent, Qt automatically grabs each touch point on the first press inside a
+ widget, and the widget will receive all updates for the touch point until it is released.
+ Note that it is possible for a widget to receive events for multiple touch points, and that
+ multiple widgets may be receiving touch events at the same time.
+
+ \section1 Event Handling
All touch events are of type QEvent::TouchBegin, QEvent::TouchUpdate, or QEvent::TouchEnd.
Reimplement QWidget::event() or QAbstractScrollArea::viewportEvent() for widgets and
- QGraphicsItem::sceneEvent() for items in a graphics view to receive touch events. By default,
- QWidget::event() translates the first non-primary touch point in a QTouchEvent into a
- QMouseEvent. This makes it possible to enable touch events on existing widgets that do not
- normally handle QTouchEvent. See below for information on some special considerations needed
- when doing this.
-
- QEvent::TouchBegin is the first touch event sent to a widget. The QEvent::TouchBegin event
- contains a special accept flag that indicates whether the receiver wants the event. By default,
- the event is accepted. You should call ignore() if the touch event is not handled by your
- widget. The QEvent::TouchBegin event is propagated up the parent widget chain until a widget
- accepts it with accept(), or an event filter consumes it. For QGraphicsItems, the
- QEvent::TouchBegin event is propagated to items under the mouse (similar to mouse event
- propagation for QGraphicsItems).
+ QGraphicsItem::sceneEvent() for items in a graphics view to receive touch events.
The QEvent::TouchUpdate and QEvent::TouchEnd events are sent to the widget or item that
accepted the QEvent::TouchBegin event. If the QEvent::TouchBegin event is not accepted and not
@@ -3587,10 +3589,20 @@ QMenubarUpdatedEvent::QMenubarUpdatedEvent(QMenuBar * const menuBar)
Information about each touch point can be retrieved using the QTouchEvent::TouchPoint class.
The Qt::TouchPointState enum describes the different states that a touch point may have.
- Similar to QMouseEvent, Qt automatically grabs each touch point on the first press inside a
- widget; the widget will receive all updates for the touch point until it is released. Note that
- it is possible for a widget to receive events for multiple touch points, and that multiple
- widgets may be receiving touch events at the same time.
+ \section1 Event Delivery and Propagation
+
+ By default, QWidget::event() translates the first non-primary touch point in a QTouchEvent into
+ a QMouseEvent. This makes it possible to enable touch events on existing widgets that do not
+ normally handle QTouchEvent. See below for information on some special considerations needed
+ when doing this.
+
+ QEvent::TouchBegin is the first touch event sent to a widget. The QEvent::TouchBegin event
+ contains a special accept flag that indicates whether the receiver wants the event. By default,
+ the event is accepted. You should call ignore() if the touch event is not handled by your
+ widget. The QEvent::TouchBegin event is propagated up the parent widget chain until a widget
+ accepts it with accept(), or an event filter consumes it. For QGraphicsItems, the
+ QEvent::TouchBegin event is propagated to items under the mouse (similar to mouse event
+ propagation for QGraphicsItems).
\section1 Touch Point Grouping
@@ -3604,7 +3616,7 @@ QMenubarUpdatedEvent::QMenubarUpdatedEvent(QMenuBar * const menuBar)
\list
\i When the first touch point is detected, the destination widget is determined firstly by the
- location on screen first and secondly by the propagation rules.
+ location on screen and secondly by the propagation rules.
\i When additional touch points are detected, Qt first looks to see if there are any active
touch points on any ancestor or descendent of the widget under the new touch point. If there
@@ -3637,17 +3649,17 @@ QMenubarUpdatedEvent::QMenubarUpdatedEvent(QMenuBar * const menuBar)
events simultaneously. Combined with the default QWidget::event() handling for QTouchEvents,
this gives you great flexibility in designing multi-touch user interfaces. Be aware of the
implications. For example, is is possible that the user is moving a QSlider with one finger and
- pressing a QPushButton with another. The signals are emitted from these widgets will be
+ pressing a QPushButton with another. The signals emitted by these widgets will be
interleaved.
- \i Recursion into the event loop using one of the exec() methods (e.g. QDialog::exec() or
+ \i Recursion into the event loop using one of the exec() methods (e.g., QDialog::exec() or
QMenu::exec()) in a QTouchEvent event handler is not supported. Since there are multiple event
recipients, unexpected recursion may cause problems, including but not limited to lost events
and unexpected infinite recursion.
\i QTouchEvents are not affected by a \l{QWidget::grabMouse()}{mouse grab} or an
- \l{QApplication::activePopupWidget()}{active popup widget}. The behavior of QTouchEvents is
- undefined when opening a popup or grabbing the mouse while there are multiple active touch
+ \l{QApplication::activePopupWidget()}{active pop-up widget}. The behavior of QTouchEvents is
+ undefined when opening a pop-up or grabbing the mouse while there are multiple active touch
points.
\endlist
diff --git a/src/gui/kernel/qevent_p.h b/src/gui/kernel/qevent_p.h
index a26f585..11d3138 100644
--- a/src/gui/kernel/qevent_p.h
+++ b/src/gui/kernel/qevent_p.h
@@ -143,7 +143,7 @@ public:
Type gestureType;
float percentage;
QPoint position;
- QSize direction;
+ float angle;
#ifdef Q_WS_WIN
ulong sequenceId;
quint64 argument;
diff --git a/src/gui/kernel/qmime_mac.cpp b/src/gui/kernel/qmime_mac.cpp
index 9e8de67..2e9514d 100644
--- a/src/gui/kernel/qmime_mac.cpp
+++ b/src/gui/kernel/qmime_mac.cpp
@@ -68,6 +68,12 @@
#include "qmap.h"
#include <private/qt_mac_p.h>
+
+#ifdef Q_WS_MAC32
+#include <QuickTime/QuickTime.h>
+#include <qlibrary.h>
+#endif
+
QT_BEGIN_NAMESPACE
extern CGImageRef qt_mac_createCGImageFromQImage(const QImage &img, const QImage **imagePtr = 0); // qpaintengine_mac.cpp
@@ -503,9 +509,6 @@ QList<QByteArray> QMacPasteboardMimeHTMLText::convertFromMime(const QString &mim
// This can be removed once 10.6 is the minimum (or we have to require 64-bit) whichever comes first.
-#include <QuickTime/QuickTime.h>
-#include <qlibrary.h>
-
typedef ComponentResult (*PtrGraphicsImportSetDataHandle)(GraphicsImportComponent, Handle);
typedef ComponentResult (*PtrGraphicsImportCreateCGImage)(GraphicsImportComponent, CGImageRef*, UInt32);
typedef ComponentResult (*PtrGraphicsExportSetInputCGImage)(GraphicsExportComponent, CGImageRef);
@@ -636,7 +639,9 @@ QList<QByteArray> QMacPasteboardMimePict::convertFromMime(const QString &mime, Q
DisposeHandle(pic);
return ret;
}
-#endif
+
+
+#endif //Q_WS_MAC32
class QMacPasteboardMimeTiff : public QMacPasteboardMime {
public:
diff --git a/src/gui/kernel/qsound_qws.cpp b/src/gui/kernel/qsound_qws.cpp
index fa32dcd..83e9c5e 100644
--- a/src/gui/kernel/qsound_qws.cpp
+++ b/src/gui/kernel/qsound_qws.cpp
@@ -53,16 +53,16 @@
#include "qhash.h"
#include "qfileinfo.h"
-#ifdef MEDIA_SERVER
#include "qbytearray.h"
#include "quuid.h"
#include "qdatastream.h"
#include "qcopchannel_qws.h"
#include "qbuffer.h"
+
QT_BEGIN_NAMESPACE
-QT_USE_NAMESPACE
+#ifdef MEDIA_SERVER
#define SERVER_CHANNEL "QPE/MediaServer"
diff --git a/src/gui/kernel/qstandardgestures.cpp b/src/gui/kernel/qstandardgestures.cpp
index d798d32..de6e7c7 100644
--- a/src/gui/kernel/qstandardgestures.cpp
+++ b/src/gui/kernel/qstandardgestures.cpp
@@ -72,6 +72,7 @@ QWidgetPrivate *qt_widget_private(QWidget *widget);
QPanGesture::QPanGesture(QWidget *gestureTarget, QObject *parent)
: QGesture(*new QPanGesturePrivate, gestureTarget, parent)
{
+ setObjectName(QLatin1String("QPanGesture"));
}
void QPanGesturePrivate::setupGestureTarget(QObject *newGestureTarget)
@@ -80,16 +81,22 @@ void QPanGesturePrivate::setupGestureTarget(QObject *newGestureTarget)
if (gestureTarget && gestureTarget->isWidgetType()) {
QWidget *w = static_cast<QWidget*>(gestureTarget.data());
QApplicationPrivate::instance()->widgetGestures[w].pan = 0;
-#ifdef Q_WS_WIN
+#if defined(Q_WS_WIN)
qt_widget_private(w)->winSetupGestures();
+#elif defined(Q_WS_MAC)
+ w->setAttribute(Qt::WA_AcceptTouchEvents, false);
+ w->setAttribute(Qt::WA_TouchPadAcceptSingleTouchEvents, false);
#endif
}
if (newGestureTarget && newGestureTarget->isWidgetType()) {
QWidget *w = static_cast<QWidget*>(newGestureTarget);
QApplicationPrivate::instance()->widgetGestures[w].pan = q;
-#ifdef Q_WS_WIN
+#if defined(Q_WS_WIN)
qt_widget_private(w)->winSetupGestures();
+#elif defined(Q_WS_MAC)
+ w->setAttribute(Qt::WA_AcceptTouchEvents);
+ w->setAttribute(Qt::WA_TouchPadAcceptSingleTouchEvents);
#endif
}
QGesturePrivate::setupGestureTarget(newGestureTarget);
@@ -98,15 +105,13 @@ void QPanGesturePrivate::setupGestureTarget(QObject *newGestureTarget)
/*! \internal */
bool QPanGesture::event(QEvent *event)
{
-#if defined(Q_OS_MAC) && !defined(QT_MAC_USE_COCOA)
+#if defined(QT_MAC_USE_COCOA)
Q_D(QPanGesture);
if (event->type() == QEvent::Timer) {
const QTimerEvent *te = static_cast<QTimerEvent *>(event);
- if (te->timerId() == d->panFinishedTimer) {
- killTimer(d->panFinishedTimer);
- d->panFinishedTimer = 0;
- d->lastOffset = QSize(0, 0);
- updateState(Qt::GestureFinished);
+ if (te->timerId() == d->singleTouchPanTimer.timerId()) {
+ d->singleTouchPanTimer.stop();
+ updateState(Qt::GestureStarted);
}
}
#endif
@@ -164,8 +169,10 @@ bool QPanGesture::eventFilter(QObject *receiver, QEvent *event)
/*! \internal */
bool QPanGesture::filterEvent(QEvent *event)
{
+#if defined(Q_WS_WIN)
Q_D(QPanGesture);
const QTouchEvent *ev = static_cast<const QTouchEvent*>(event);
+
if (event->type() == QEvent::TouchBegin) {
QTouchEvent::TouchPoint p = ev->touchPoints().at(0);
d->lastPosition = p.pos().toPoint();
@@ -197,33 +204,55 @@ bool QPanGesture::filterEvent(QEvent *event)
}
}
}
-#ifdef Q_OS_MAC
- else if (event->type() == QEvent::Wheel) {
- // On Mac, there is really no native panning gesture. Instead, a two
- // finger pan is delivered as mouse wheel events. Otoh, on Windows, you
- // either get mouse wheel events or pan events. We have decided to make this
- // the Qt behaviour as well, meaning that on Mac, wheel
- // events will be masked away when listening for pan events.
-#ifndef QT_MAC_USE_COCOA
- // In Carbon we receive neither touch-, nor pan gesture events.
- // So we create pan gestures by converting wheel events. After all, this
- // is how things are supposed to work on mac in the first place.
- const QWheelEvent *wev = static_cast<const QWheelEvent*>(event);
- int offset = wev->delta() / -120;
- d->lastOffset = wev->orientation() == Qt::Horizontal ? QSize(offset, 0) : QSize(0, offset);
+#elif defined(QT_MAC_USE_COCOA)
+ // The following implements single touch
+ // panning on Mac:
+ Q_D(QPanGesture);
+ const int panBeginDelay = 300;
+ const int panBeginRadius = 3;
+ const QTouchEvent *ev = static_cast<const QTouchEvent*>(event);
- if (state() == Qt::NoGesture) {
- d->totalOffset = d->lastOffset;
- } else {
- d->totalOffset += d->lastOffset;
+ switch (event->type()) {
+ case QEvent::TouchBegin: {
+ if (ev->touchPoints().size() == 1) {
+ d->lastPosition = QCursor::pos();
+ d->singleTouchPanTimer.start(panBeginDelay, this);
}
-
- killTimer(d->panFinishedTimer);
- d->panFinishedTimer = startTimer(200);
- updateState(Qt::GestureUpdated);
-#endif
- return true;
+ break;}
+ case QEvent::TouchEnd: {
+ if (state() != Qt::NoGesture)
+ updateState(Qt::GestureFinished);
+ reset();
+ break;}
+ case QEvent::TouchUpdate: {
+ if (ev->touchPoints().size() == 1) {
+ if (state() == Qt::NoGesture) {
+ // INVARIANT: The singleTouchTimer has still not fired.
+ // Lets check if the user moved his finger so much from
+ // the starting point that it makes sense to cancel:
+ const QPointF startPos = ev->touchPoints().at(0).startPos().toPoint();
+ const QPointF p = ev->touchPoints().at(0).pos().toPoint();
+ if ((startPos - p).manhattanLength() > panBeginRadius)
+ reset();
+ else
+ d->lastPosition = QCursor::pos();
+ } else {
+ QPointF mousePos = QCursor::pos();
+ QPointF dist = mousePos - d->lastPosition;
+ d->lastPosition = mousePos;
+ d->lastOffset = QSizeF(dist.x(), dist.y());
+ d->totalOffset += d->lastOffset;
+ updateState(Qt::GestureUpdated);
+ }
+ } else if (state() == Qt::NoGesture) {
+ reset();
+ }
+ break;}
+ default:
+ return false;
}
+#else
+ Q_UNUSED(event);
#endif
return false;
}
@@ -232,14 +261,14 @@ bool QPanGesture::filterEvent(QEvent *event)
void QPanGesture::reset()
{
Q_D(QPanGesture);
- d->lastOffset = d->totalOffset = QSize();
- d->lastPosition = QPoint();
-#if defined(Q_OS_MAC) && !defined(QT_MAC_USE_COCOA)
- if (d->panFinishedTimer) {
- killTimer(d->panFinishedTimer);
- d->panFinishedTimer = 0;
- }
+ d->lastOffset = d->totalOffset = QSize(0, 0);
+ d->lastPosition = QPoint(0, 0);
+
+#if defined(QT_MAC_USE_COCOA)
+ d->singleTouchPanTimer.stop();
+ d->prevMousePos = QPointF(0, 0);
#endif
+
QGesture::reset();
}
@@ -248,7 +277,7 @@ void QPanGesture::reset()
Specifies a total pan offset since the start of the gesture.
*/
-QSize QPanGesture::totalOffset() const
+QSizeF QPanGesture::totalOffset() const
{
Q_D(const QPanGesture);
return d->totalOffset;
@@ -260,12 +289,13 @@ QSize QPanGesture::totalOffset() const
Specifies a pan offset since the last time the gesture was
triggered.
*/
-QSize QPanGesture::lastOffset() const
+QSizeF QPanGesture::lastOffset() const
{
Q_D(const QPanGesture);
return d->lastOffset;
}
+//////////////////////////////////////////////////////////////////////////////
/*!
\class QPinchGesture
@@ -285,6 +315,7 @@ QSize QPanGesture::lastOffset() const
QPinchGesture::QPinchGesture(QWidget *gestureTarget, QObject *parent)
: QGesture(*new QPinchGesturePrivate, gestureTarget, parent)
{
+ setObjectName(QLatin1String("QPinchGesture"));
}
void QPinchGesturePrivate::setupGestureTarget(QObject *newGestureTarget)
@@ -338,12 +369,13 @@ bool QPinchGesture::eventFilter(QObject *receiver, QEvent *event)
d->state = Qt::NoGesture;
d->scaleFactor = d->lastScaleFactor = 1;
d->rotationAngle = d->lastRotationAngle = 0;
- d->startCenterPoint = d->centerPoint = d->lastCenterPoint = QPoint();
+ d->startCenterPoint = d->centerPoint = d->lastCenterPoint = QPointF();
#if defined(Q_WS_WIN)
d->initialDistance = 0;
#endif
return false;
case QNativeGestureEvent::Rotate:
+ d->scaleFactor = 0;
d->lastRotationAngle = d->rotationAngle;
#if defined(Q_WS_WIN)
d->rotationAngle = -1 * GID_ROTATE_ANGLE_FROM_ARGUMENT(ev->argument);
@@ -354,6 +386,7 @@ bool QPinchGesture::eventFilter(QObject *receiver, QEvent *event)
event->accept();
break;
case QNativeGestureEvent::Zoom:
+ d->rotationAngle = 0;
#if defined(Q_WS_WIN)
if (d->initialDistance != 0) {
d->lastScaleFactor = d->scaleFactor;
@@ -402,7 +435,7 @@ void QPinchGesture::reset()
Q_D(QPinchGesture);
d->scaleFactor = d->lastScaleFactor = 0;
d->rotationAngle = d->lastRotationAngle = 0;
- d->startCenterPoint = d->centerPoint = d->lastCenterPoint = QPoint();
+ d->startCenterPoint = d->centerPoint = d->lastCenterPoint = QPointF();
QGesture::reset();
}
@@ -452,7 +485,7 @@ qreal QPinchGesture::lastRotationAngle() const
Specifies a center point of the gesture. The point can be used as a center
point that the object is rotated around.
*/
-QPoint QPinchGesture::centerPoint() const
+QPointF QPinchGesture::centerPoint() const
{
return d_func()->centerPoint;
}
@@ -462,7 +495,7 @@ QPoint QPinchGesture::centerPoint() const
Specifies a previous center point of the gesture.
*/
-QPoint QPinchGesture::lastCenterPoint() const
+QPointF QPinchGesture::lastCenterPoint() const
{
return d_func()->lastCenterPoint;
}
@@ -474,11 +507,117 @@ QPoint QPinchGesture::lastCenterPoint() const
startCenterPoint and the centerPoint is the distance at which pinching
fingers has shifted.
*/
-QPoint QPinchGesture::startCenterPoint() const
+QPointF QPinchGesture::startCenterPoint() const
{
return d_func()->startCenterPoint;
}
+//////////////////////////////////////////////////////////////////////////////
+
+/*!
+ \class QSwipeGesture
+ \since 4.6
+
+ \brief The QSwipeGesture class represents a swipe gesture,
+ providing additional information related to swiping.
+*/
+
+/*!
+ Creates a new Swipe gesture handler object and marks it as a child of \a
+ parent.
+
+ On some platform like Windows it's necessary to provide a non-null widget
+ as \a parent to get native gesture support.
+*/
+QSwipeGesture::QSwipeGesture(QWidget *gestureTarget, QObject *parent)
+ : QGesture(*new QSwipeGesturePrivate, gestureTarget, parent)
+{
+ setObjectName(QLatin1String("QSwipeGesture"));
+}
+
+void QSwipeGesturePrivate::setupGestureTarget(QObject *newGestureTarget)
+{
+ Q_Q(QSwipeGesture);
+ if (gestureTarget && gestureTarget->isWidgetType()) {
+ QWidget *w = static_cast<QWidget*>(gestureTarget.data());
+ QApplicationPrivate::instance()->widgetGestures[w].swipe = 0;
+#if defined(Q_WS_WIN)
+ qt_widget_private(w)->winSetupGestures();
+#endif
+ }
+
+ if (newGestureTarget && newGestureTarget->isWidgetType()) {
+ QWidget *w = static_cast<QWidget*>(newGestureTarget);
+ QApplicationPrivate::instance()->widgetGestures[w].swipe = q;
+#if defined(Q_WS_WIN)
+ qt_widget_private(w)->winSetupGestures();
+#endif
+ }
+ QGesturePrivate::setupGestureTarget(newGestureTarget);
+}
+
+qreal QSwipeGesture::swipeAngle() const
+{
+ Q_D(const QSwipeGesture);
+ return d->swipeAngle;
+}
+
+QSwipeGesture::SwipeDirection QSwipeGesture::horizontalDirection() const
+{
+ Q_D(const QSwipeGesture);
+ if (d->swipeAngle < 0 || d->swipeAngle == 90 || d->swipeAngle == 270)
+ return QSwipeGesture::NoDirection;
+ else if (d->swipeAngle < 90 || d->swipeAngle > 270)
+ return QSwipeGesture::Right;
+ else
+ return QSwipeGesture::Left;
+}
+
+QSwipeGesture::SwipeDirection QSwipeGesture::verticalDirection() const
+{
+ Q_D(const QSwipeGesture);
+ if (d->swipeAngle <= 0 || d->swipeAngle == 180)
+ return QSwipeGesture::NoDirection;
+ else if (d->swipeAngle < 180)
+ return QSwipeGesture::Up;
+ else
+ return QSwipeGesture::Down;
+}
+
+bool QSwipeGesture::eventFilter(QObject *receiver, QEvent *event)
+{
+ Q_D(QSwipeGesture);
+ if (receiver->isWidgetType() && event->type() == QEvent::NativeGesture) {
+ QNativeGestureEvent *ev = static_cast<QNativeGestureEvent*>(event);
+ switch (ev->gestureType) {
+ case QNativeGestureEvent::Swipe:
+ d->swipeAngle = ev->angle;
+ updateState(Qt::GestureStarted);
+ updateState(Qt::GestureUpdated);
+ updateState(Qt::GestureFinished);
+ break;
+ default:
+ return false;
+ }
+ return true;
+ }
+ return QGesture::eventFilter(receiver, event);
+}
+
+/*! \internal */
+bool QSwipeGesture::filterEvent(QEvent *)
+{
+ return false;
+}
+
+/*! \internal */
+void QSwipeGesture::reset()
+{
+ Q_D(QSwipeGesture);
+ d->swipeAngle = -1;
+ QGesture::reset();
+}
+
QT_END_NAMESPACE
#include "moc_qstandardgestures.cpp"
diff --git a/src/gui/kernel/qstandardgestures.h b/src/gui/kernel/qstandardgestures.h
index 0eb9d92..029e6dc 100644
--- a/src/gui/kernel/qstandardgestures.h
+++ b/src/gui/kernel/qstandardgestures.h
@@ -59,16 +59,16 @@ class Q_GUI_EXPORT QPanGesture : public QGesture
Q_OBJECT
Q_DECLARE_PRIVATE(QPanGesture)
- Q_PROPERTY(QSize totalOffset READ totalOffset)
- Q_PROPERTY(QSize lastOffset READ lastOffset)
+ Q_PROPERTY(QSizeF totalOffset READ totalOffset)
+ Q_PROPERTY(QSizeF lastOffset READ lastOffset)
public:
QPanGesture(QWidget *gestureTarget, QObject *parent = 0);
bool filterEvent(QEvent *event);
- QSize totalOffset() const;
- QSize lastOffset() const;
+ QSizeF totalOffset() const;
+ QSizeF lastOffset() const;
protected:
void reset();
@@ -92,9 +92,9 @@ class Q_GUI_EXPORT QPinchGesture : public QGesture
Q_PROPERTY(qreal rotationAngle READ rotationAngle)
Q_PROPERTY(qreal lastRotationAngle READ lastRotationAngle)
- Q_PROPERTY(QPoint startCenterPoint READ startCenterPoint)
- Q_PROPERTY(QPoint lastCenterPoint READ lastCenterPoint)
- Q_PROPERTY(QPoint centerPoint READ centerPoint)
+ Q_PROPERTY(QPointF startCenterPoint READ startCenterPoint)
+ Q_PROPERTY(QPointF lastCenterPoint READ lastCenterPoint)
+ Q_PROPERTY(QPointF centerPoint READ centerPoint)
public:
QPinchGesture(QWidget *gestureTarget, QObject *parent = 0);
@@ -102,9 +102,9 @@ public:
bool filterEvent(QEvent *event);
void reset();
- QPoint startCenterPoint() const;
- QPoint lastCenterPoint() const;
- QPoint centerPoint() const;
+ QPointF startCenterPoint() const;
+ QPointF lastCenterPoint() const;
+ QPointF centerPoint() const;
qreal scaleFactor() const;
qreal lastScaleFactor() const;
@@ -119,6 +119,34 @@ private:
friend class QWidget;
};
+class QSwipeGesturePrivate;
+class Q_GUI_EXPORT QSwipeGesture : public QGesture
+{
+ Q_OBJECT
+ Q_ENUMS(SwipeDirection)
+
+ Q_PROPERTY(SwipeDirection horizontalDirection READ horizontalDirection)
+ Q_PROPERTY(SwipeDirection verticalDirection READ verticalDirection)
+ Q_PROPERTY(qreal swipeAngle READ swipeAngle)
+
+ Q_DECLARE_PRIVATE(QSwipeGesture)
+
+public:
+ enum SwipeDirection { NoDirection, Left, Right, Up, Down };
+ QSwipeGesture(QWidget *gestureTarget, QObject *parent = 0);
+
+ bool filterEvent(QEvent *event);
+ void reset();
+
+ SwipeDirection horizontalDirection() const;
+ SwipeDirection verticalDirection() const;
+ qreal swipeAngle() const;
+
+private:
+ bool eventFilter(QObject *receiver, QEvent *event);
+
+ friend class QWidget;
+};
QT_END_NAMESPACE
QT_END_HEADER
diff --git a/src/gui/kernel/qstandardgestures_p.h b/src/gui/kernel/qstandardgestures_p.h
index 5fbcc5d..9829cf0 100644
--- a/src/gui/kernel/qstandardgestures_p.h
+++ b/src/gui/kernel/qstandardgestures_p.h
@@ -61,6 +61,7 @@
#include "qgesture_p.h"
#include "qstandardgestures.h"
+#include "qbasictimer.h"
QT_BEGIN_NAMESPACE
@@ -69,21 +70,15 @@ class QPanGesturePrivate : public QGesturePrivate
Q_DECLARE_PUBLIC(QPanGesture)
public:
- QPanGesturePrivate()
- {
-#if defined(Q_OS_MAC) && !defined(QT_MAC_USE_COCOA)
- panFinishedTimer = 0;
-#endif
- }
-
void setupGestureTarget(QObject *o);
- QSize totalOffset;
- QSize lastOffset;
- QPoint lastPosition;
+ QSizeF totalOffset;
+ QSizeF lastOffset;
+ QPointF lastPosition;
-#if defined(Q_OS_MAC) && !defined(QT_MAC_USE_COCOA)
- int panFinishedTimer;
+#if defined(QT_MAC_USE_COCOA)
+ QBasicTimer singleTouchPanTimer;
+ QPointF prevMousePos;
#endif
};
@@ -107,14 +102,28 @@ public:
qreal lastScaleFactor;
qreal rotationAngle;
qreal lastRotationAngle;
- QPoint startCenterPoint;
- QPoint lastCenterPoint;
- QPoint centerPoint;
+ QPointF startCenterPoint;
+ QPointF lastCenterPoint;
+ QPointF centerPoint;
#ifdef Q_WS_WIN
int initialDistance;
#endif
};
+class QSwipeGesturePrivate : public QGesturePrivate
+{
+ Q_DECLARE_PUBLIC(QSwipeGesture)
+
+public:
+ QSwipeGesturePrivate()
+ : swipeAngle(-1)
+ {
+ }
+
+ void setupGestureTarget(QObject *o);
+ qreal swipeAngle;
+};
+
QT_END_NAMESPACE
#endif // QSTANDARDGESTURES_P_H
diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp
index 6ffac2c..38b09ee 100644
--- a/src/gui/kernel/qwidget.cpp
+++ b/src/gui/kernel/qwidget.cpp
@@ -187,6 +187,9 @@ QWidgetPrivate::QWidgetPrivate(int version)
, extraPaintEngine(0)
, polished(0)
, graphicsEffect(0)
+#if !defined(QT_NO_IM)
+ , imHints(Qt::ImhNone)
+#endif
, inheritedFontResolveMask(0)
, inheritedPaletteResolveMask(0)
, leftmargin(0)
@@ -217,7 +220,6 @@ QWidgetPrivate::QWidgetPrivate(int version)
, window_event(0)
, qd_hd(0)
#endif
- ,imHints(Qt::ImhNone)
{
if (!qApp) {
qFatal("QWidget: Must construct a QApplication before a QPaintDevice");
@@ -971,7 +973,10 @@ struct QWidgetExceptionCleaner
/* this cleans up when the constructor throws an exception */
static inline void cleanup(QWidget *that, QWidgetPrivate *d)
{
-#ifndef QT_NO_EXCEPTIONS
+#ifdef QT_NO_EXCEPTIONS
+ Q_UNUSED(that);
+ Q_UNUSED(d);
+#else
QWidgetPrivate::allWidgets->remove(that);
if (d->focus_next != that) {
if (d->focus_next)
@@ -4172,6 +4177,10 @@ QPalette::ColorRole QWidget::backgroundRole() const
If \a role is QPalette::NoRole, then the widget inherits its
parent's background role.
+ Note that styles are free to choose any color from the palette.
+ You can modify the palette or set a style sheet if you don't
+ achieve the result you want with setBackgroundRole().
+
\sa backgroundRole(), foregroundRole()
*/
@@ -4234,6 +4243,10 @@ QPalette::ColorRole QWidget::foregroundRole() const
If \a role is QPalette::NoRole, the widget uses a foreground role
that contrasts with the background role.
+ Note that styles are free to choose any color from the palette.
+ You can modify the palette or set a style sheet if you don't
+ achieve the result you want with setForegroundRole().
+
\sa foregroundRole(), backgroundRole()
*/
void QWidget::setForegroundRole(QPalette::ColorRole role)
@@ -4965,6 +4978,13 @@ void QWidgetPrivate::setSoftKeys_sys(const QList<QAction*> &softkeys)
}
#endif // !defined(Q_OS_SYMBIAN)
+/*!
+ Returns a pointer to this widget's effect if it has one; otherwise 0.
+
+ \since 4.6
+
+ \sa setGraphicsEffect()
+*/
QGraphicsEffect *QWidget::graphicsEffect() const
{
Q_D(const QWidget);
@@ -4982,6 +5002,8 @@ QGraphicsEffect *QWidget::graphicsEffect() const
\note This function will apply the effect on itself and all its children.
\since 4.6
+
+ \sa graphicsEffect()
*/
void QWidget::setGraphicsEffect(QGraphicsEffect *effect)
{
@@ -11824,10 +11846,9 @@ const QList<QAction*>& QWidget::softKeys() const
\preliminary
\since 4.6
- Sets the softkey \a softkey to this widget's list of softkeys,
+ Sets the softkey \a softKey to this widget's list of softkeys.
Setting 0 as softkey will clear all the existing softkeys set
- to the widget
- A QWidget can have 0 or more softkeys
+ to the widget. A QWidget can have 0 or more softkeys.
\sa softKeys(), setSoftKeys()
*/
@@ -11844,8 +11865,8 @@ void QWidget::setSoftKey(QAction *softKey)
}
/*!
- Sets the list of softkeys \a softkeys to this widget's list of softkeys,
- A QWidget can have 0 or more softkeys
+ Sets the list of softkeys \a softKeys to this widget's list of softkeys.
+ A QWidget can have 0 or more softkeys.
\sa softKeys(), setSoftKey()
*/
diff --git a/src/gui/kernel/qwidget_mac.mm b/src/gui/kernel/qwidget_mac.mm
index 53d1b6e..cdf0706 100644
--- a/src/gui/kernel/qwidget_mac.mm
+++ b/src/gui/kernel/qwidget_mac.mm
@@ -1064,7 +1064,7 @@ OSStatus QWidgetPrivate::qt_window_event(EventHandlerCallRef er, EventRef event,
break;
}
qNGEvent.gestureType = QNativeGestureEvent::Rotate;
- qNGEvent.percentage = float(amount);
+ qNGEvent.percentage = float(-amount);
break; }
case kEventGestureSwipe: {
HIPoint swipeDirection;
@@ -1074,7 +1074,14 @@ OSStatus QWidgetPrivate::qt_window_event(EventHandlerCallRef er, EventRef event,
break;
}
qNGEvent.gestureType = QNativeGestureEvent::Swipe;
- qNGEvent.direction = QSize(-swipeDirection.x, -swipeDirection.y);
+ if (swipeDirection.x == 1)
+ qNGEvent.angle = 180.0f;
+ else if (swipeDirection.x == -1)
+ qNGEvent.angle = 0.0f;
+ else if (swipeDirection.y == 1)
+ qNGEvent.angle = 90.0f;
+ else if (swipeDirection.y == -1)
+ qNGEvent.angle = 270.0f;
break; }
case kEventGestureMagnify: {
CGFloat amount;
diff --git a/src/gui/math3d/qmatrix4x4.cpp b/src/gui/math3d/qmatrix4x4.cpp
index 36ffcbe..eb87052 100644
--- a/src/gui/math3d/qmatrix4x4.cpp
+++ b/src/gui/math3d/qmatrix4x4.cpp
@@ -1450,7 +1450,7 @@ static const qreal inv_dist_to_plane = 1. / 1024.;
value of 1024 corresponds to the projection factor used
by QTransform::rotate() for the x and y axes.
- If \a distToPlane is zero, then the returned QTransform
+ If \a distanceToPlane is zero, then the returned QTransform
is formed by simply dropping the third row and third column
of the QMatrix4x4. This is suitable for implementing
orthographic projections where the z co-ordinate should
diff --git a/src/gui/painting/qbackingstore.cpp b/src/gui/painting/qbackingstore.cpp
index 0fffaef..4665b66 100644
--- a/src/gui/painting/qbackingstore.cpp
+++ b/src/gui/painting/qbackingstore.cpp
@@ -1544,7 +1544,8 @@ void QWidgetPrivate::repaint_sys(const QRegion &rgn)
// QGLWidget does not support partial updates if:
// 1) The context is double buffered
// 2) The context is single buffered and auto-fill background is enabled.
- const bool noPartialUpdateSupport = (engine && engine->type() == QPaintEngine::OpenGL)
+ const bool noPartialUpdateSupport = (engine && (engine->type() == QPaintEngine::OpenGL
+ || engine->type() == QPaintEngine::OpenGL2))
&& (usesDoubleBufferedGLContext || q->autoFillBackground());
QRegion toBePainted(noPartialUpdateSupport ? q->rect() : rgn);
diff --git a/src/gui/painting/qpaintengine_raster.cpp b/src/gui/painting/qpaintengine_raster.cpp
index 72bb164..5f6e1d6 100644
--- a/src/gui/painting/qpaintengine_raster.cpp
+++ b/src/gui/painting/qpaintengine_raster.cpp
@@ -791,7 +791,7 @@ void QRasterPaintEngine::updatePen(const QPen &pen)
if(pen_style == Qt::SolidLine) {
s->stroker = &d->basicStroker;
} else if (pen_style != Qt::NoPen) {
- if (!d->dashStroker.data())
+ if (!d->dashStroker)
d->dashStroker.reset(new QDashStroker(&d->basicStroker));
if (pen.isCosmetic()) {
d->dashStroker->setClipRect(d->deviceRect);
diff --git a/src/gui/painting/qpaintengineex_p.h b/src/gui/painting/qpaintengineex_p.h
index cf3aad7..1ba2153 100644
--- a/src/gui/painting/qpaintengineex_p.h
+++ b/src/gui/painting/qpaintengineex_p.h
@@ -204,6 +204,9 @@ public:
virtual void sync() {}
+ virtual void beginNativePainting() {}
+ virtual void endNativePainting() {}
+
virtual QPixmapFilter *createPixmapFilter(int /*type*/) const { return 0; }
protected:
diff --git a/src/gui/painting/qpainter.cpp b/src/gui/painting/qpainter.cpp
index e1a6e80..699de4d 100644
--- a/src/gui/painting/qpainter.cpp
+++ b/src/gui/painting/qpainter.cpp
@@ -1889,6 +1889,45 @@ QPaintEngine *QPainter::paintEngine() const
return d->engine;
}
+/*!
+ Flushes the painting pipeline and prepares for the user issuing
+ native painting commands. Must be followed by a call to
+ endNativePainting().
+
+ \sa endNativePainting()
+*/
+void QPainter::beginNativePainting()
+{
+ Q_D(QPainter);
+ if (!d->engine) {
+ qWarning("QPainter::beginNativePainting: Painter not active");
+ return;
+ }
+
+ if (d->extended)
+ d->extended->beginNativePainting();
+}
+
+/*!
+ Restores the painter after manually issuing native painting commands.
+ Lets the painter restore any native state that it relies on before
+ calling any other painter commands.
+
+ \sa beginNativePainting()
+*/
+void QPainter::endNativePainting()
+{
+ Q_D(const QPainter);
+ if (!d->engine) {
+ qWarning("QPainter::beginNativePainting: Painter not active");
+ return;
+ }
+
+ if (d->extended)
+ d->extended->endNativePainting();
+ else
+ d->engine->syncState();
+}
/*!
Returns the font metrics for the painter if the painter is
@@ -7169,7 +7208,8 @@ QPoint QPainter::xFormDev(const QPoint &p) const
QRect transformed = painter.xFormDev(rectangle);
\newcode
QPainter painter(this);
- QRect transformed = painter.combinedTransform().inverted(rectangle);
+ QRegion region = QRegion(rectangle) * painter.combinedTransform().inverted();
+ QRect transformed = region.boundingRect();
\endcode
*/
diff --git a/src/gui/painting/qpainter.h b/src/gui/painting/qpainter.h
index 14d1cf8..1bb97c6 100644
--- a/src/gui/painting/qpainter.h
+++ b/src/gui/painting/qpainter.h
@@ -423,6 +423,9 @@ public:
static QPaintDevice *redirected(const QPaintDevice *device, QPoint *offset = 0);
static void restoreRedirected(const QPaintDevice *device);
+ void beginNativePainting();
+ void endNativePainting();
+
#ifdef QT3_SUPPORT
inline QT3_SUPPORT void setBackgroundColor(const QColor &color) { setBackground(color); }
diff --git a/src/gui/styles/images/defaults60theme.blob b/src/gui/styles/images/defaults60theme.blob
new file mode 100644
index 0000000..f3a5952
--- /dev/null
+++ b/src/gui/styles/images/defaults60theme.blob
Binary files differ
diff --git a/src/gui/styles/qcommonstyle.cpp b/src/gui/styles/qcommonstyle.cpp
index 2dab9b3..ee9827e 100644
--- a/src/gui/styles/qcommonstyle.cpp
+++ b/src/gui/styles/qcommonstyle.cpp
@@ -870,7 +870,6 @@ int QCommonStylePrivate::lookupToolButtonStyle() const
#ifndef QT_NO_ITEMVIEWS
-
QSize QCommonStylePrivate::viewItemSize(const QStyleOptionViewItemV4 *option, int role) const
{
Q_Q(const QCommonStyle);
@@ -1158,6 +1157,75 @@ void QCommonStylePrivate::viewItemLayout(const QStyleOptionViewItemV4 *opt, QRe
}
#endif // QT_NO_ITEMVIEWS
+
+#ifndef QT_NO_TABBAR
+/*! \internal
+ Compute the textRect and the pixmapRect from the opt rect
+
+ Uses the same computation than in QTabBar::tabSizeHint
+ */
+void QCommonStylePrivate::tabLayout(const QStyleOptionTabV3 *opt, const QWidget *widget, QRect *textRect, QRect *iconRect) const
+{
+ Q_ASSERT(textRect);
+ Q_ASSERT(iconRect);
+ QRect tr = opt->rect;
+ bool verticalTabs = opt->shape == QTabBar::RoundedEast
+ || opt->shape == QTabBar::RoundedWest
+ || opt->shape == QTabBar::TriangularEast
+ || opt->shape == QTabBar::TriangularWest;
+ if (verticalTabs)
+ tr.setRect(0, 0, tr.height(), tr.width()); //0, 0 as we will have a translate transform
+
+ int verticalShift = proxyStyle->pixelMetric(QStyle::PM_TabBarTabShiftVertical, opt, widget);
+ int horizontalShift = proxyStyle->pixelMetric(QStyle::PM_TabBarTabShiftHorizontal, opt, widget);
+ int hpadding = proxyStyle->pixelMetric(QStyle::PM_TabBarTabHSpace, opt, widget) / 2;
+ int vpadding = proxyStyle->pixelMetric(QStyle::PM_TabBarTabVSpace, opt, widget) / 2;
+ if (opt->shape == QTabBar::RoundedSouth || opt->shape == QTabBar::TriangularSouth)
+ verticalShift = -verticalShift;
+ tr.adjust(hpadding, vpadding, horizontalShift - hpadding, verticalShift - vpadding);
+ bool selected = opt->state & QStyle::State_Selected;
+ if (selected) {
+ tr.setBottom(tr.bottom() - verticalShift);
+ tr.setRight(tr.right() - horizontalShift);
+ }
+
+ // left widget
+ if (!opt->leftButtonSize.isEmpty()) {
+ tr.setLeft(tr.left() + 4 +
+ (verticalTabs ? opt->leftButtonSize.height() : opt->leftButtonSize.width()));
+ }
+ // right widget
+ if (!opt->rightButtonSize.isEmpty()) {
+ tr.setRight(tr.right() - 4 -
+ (verticalTabs ? opt->rightButtonSize.height() : opt->rightButtonSize.width()));
+ }
+
+ // icon
+ if (!opt->icon.isNull()) {
+ QSize iconSize = opt->iconSize;
+ if (!iconSize.isValid()) {
+ int iconExtent = proxyStyle->pixelMetric(QStyle::PM_SmallIconSize);
+ iconSize = QSize(iconExtent, iconExtent);
+ }
+ QSize tabIconSize = opt->icon.actualSize(iconSize,
+ (opt->state & QStyle::State_Enabled) ? QIcon::Normal : QIcon::Disabled,
+ (opt->state & QStyle::State_Selected) ? QIcon::On : QIcon::Off );
+
+ *iconRect = QRect(tr.left(), tr.center().y() - tabIconSize.height() / 2,
+ tabIconSize.width(), tabIconSize .height());
+ if (!verticalTabs)
+ *iconRect = proxyStyle->visualRect(opt->direction, opt->rect, *iconRect);
+ tr.setLeft(tr.left() + tabIconSize.width() + 4);
+ }
+
+ if (!verticalTabs)
+ tr = proxyStyle->visualRect(opt->direction, opt->rect, tr);
+
+ *textRect = tr;
+}
+#endif //QT_NO_TABBAR
+
+
/*!
\reimp
*/
@@ -1840,38 +1908,20 @@ void QCommonStyle::drawControl(ControlElement element, const QStyleOption *opt,
newY = tr.y() + tr.height();
newRot = -90;
}
- tr.setRect(0, 0, tr.height(), tr.width());
QTransform m = QTransform::fromTranslate(newX, newY);
m.rotate(newRot);
p->setTransform(m, true);
}
- tr = subElementRect(SE_TabBarTabText, opt, widget);
+ QRect iconRect;
+ d->tabLayout(&tabV2, widget, &tr, &iconRect);
+ tr = proxy()->subElementRect(SE_TabBarTabText, opt, widget); //we compute tr twice because the style may override subElementRect
if (!tabV2.icon.isNull()) {
- QSize iconSize = tabV2.iconSize;
- if (!iconSize.isValid()) {
- int iconExtent = proxy()->pixelMetric(PM_SmallIconSize);
- iconSize = QSize(iconExtent, iconExtent);
- }
- QSize tabIconSize = tabV2.icon.actualSize(iconSize,
- (tabV2.state & State_Enabled) ? QIcon::Normal
- : QIcon::Disabled);
- QPixmap tabIcon = tabV2.icon.pixmap(iconSize,
+ QPixmap tabIcon = tabV2.icon.pixmap(tabV2.iconSize,
(tabV2.state & State_Enabled) ? QIcon::Normal
: QIcon::Disabled,
(tabV2.state & State_Selected) ? QIcon::On
: QIcon::Off);
-
- int offset = 4;
- int left = opt->rect.left();
- if (tabV2.leftButtonSize.isEmpty())
- offset += 2;
- else
- left += tabV2.leftButtonSize.width() + (6 + 2) + 2;
- QRect iconRect = QRect(left + offset, tr.center().y() - tabIcon.height() / 2,
- tabIconSize.width(), tabIconSize.height());
- if (!verticalTabs)
- iconRect = visualRect(opt->direction, opt->rect, iconRect);
p->drawPixmap(iconRect.x(), iconRect.y(), tabIcon);
}
@@ -2718,65 +2768,10 @@ QRect QCommonStyle::subElementRect(SubElement sr, const QStyleOption *opt,
}
break;
case SE_TabBarTabText:
- // ### consider merging this with CE_TabBarTabLabel
if (const QStyleOptionTab *tab = qstyleoption_cast<const QStyleOptionTab *>(opt)) {
- QStyleOptionTabV3 tabV2(*tab);
- QRect tr = tabV2.rect;
- bool verticalTabs = tabV2.shape == QTabBar::RoundedEast
- || tabV2.shape == QTabBar::RoundedWest
- || tabV2.shape == QTabBar::TriangularEast
- || tabV2.shape == QTabBar::TriangularWest;
- if (verticalTabs)
- tr.setRect(0, 0, tr.height(), tr.width());
- int verticalShift = pixelMetric(QStyle::PM_TabBarTabShiftVertical, tab, widget);
- int horizontalShift = pixelMetric(QStyle::PM_TabBarTabShiftHorizontal, tab, widget);
- int hpadding = proxy()->pixelMetric(QStyle::PM_TabBarTabHSpace, opt, widget) / 2;
- int vpadding = proxy()->pixelMetric(QStyle::PM_TabBarTabVSpace, opt, widget) / 2;
- if (tabV2.shape == QTabBar::RoundedSouth || tabV2.shape == QTabBar::TriangularSouth)
- verticalShift = -verticalShift;
- tr.adjust(hpadding, vpadding, horizontalShift - hpadding, verticalShift - vpadding);
- bool selected = tabV2.state & State_Selected;
- if (selected) {
- tr.setBottom(tr.bottom() - verticalShift);
- tr.setRight(tr.right() - horizontalShift);
- }
-
- // left widget
- if (!tabV2.leftButtonSize.isEmpty()) {
- tr.setLeft(tr.left() + 6 + 2 +
- (verticalTabs ? tabV2.leftButtonSize.height() : tabV2.leftButtonSize.width()));
- }
-
- // icon
- if (!tabV2.icon.isNull()) {
- QSize iconSize = tabV2.iconSize;
- if (!iconSize.isValid()) {
- int iconExtent = proxy()->pixelMetric(PM_SmallIconSize);
- iconSize = QSize(iconExtent, iconExtent);
- }
- QSize tabIconSize = tabV2.icon.actualSize(iconSize,
- (tabV2.state & State_Enabled) ? QIcon::Normal
- : QIcon::Disabled);
- int offset = 4;
- if (tabV2.leftButtonSize.isEmpty())
- offset += 2;
-
- QRect iconRect = QRect(tr.left() + offset, tr.center().y() - tabIconSize.height() / 2,
- tabIconSize.width(), tabIconSize .height());
- if (!verticalTabs)
- iconRect = visualRect(opt->direction, opt->rect, iconRect);
- tr.setLeft(tr.left() + tabIconSize.width() + offset + 2);
- }
-
- // right widget
- if (!tabV2.rightButtonSize.isEmpty()) {
- tr.setRight(tr.right() - 6 - 2 -
- (verticalTabs ? tabV2.rightButtonSize.height() : tabV2.rightButtonSize.width()));
- }
-
- if (!verticalTabs)
- tr = visualRect(opt->direction, opt->rect, tr);
- r = tr;
+ QStyleOptionTabV3 tabV3(*tab);
+ QRect dummyIconRect;
+ d->tabLayout(&tabV3, widget, &r, &dummyIconRect);
}
break;
case SE_TabBarTabLeftButton:
@@ -2785,6 +2780,8 @@ QRect QCommonStyle::subElementRect(SubElement sr, const QStyleOption *opt,
bool selected = tab->state & State_Selected;
int verticalShift = proxy()->pixelMetric(QStyle::PM_TabBarTabShiftVertical, tab, widget);
int horizontalShift = proxy()->pixelMetric(QStyle::PM_TabBarTabShiftHorizontal, tab, widget);
+ int hpadding = proxy()->pixelMetric(QStyle::PM_TabBarTabHSpace, opt, widget) / 2;
+ hpadding = qMax(hpadding, 4); //workaround KStyle returning 0 because they workaround an old bug in Qt
bool verticalTabs = tab->shape == QTabBar::RoundedEast
|| tab->shape == QTabBar::RoundedWest
@@ -2827,16 +2824,16 @@ QRect QCommonStyle::subElementRect(SubElement sr, const QStyleOption *opt,
break;
default:
if (sr == SE_TabBarTabLeftButton)
- r = QRect(6 + tab->rect.x(), midHeight, w, h);
+ r = QRect(tab->rect.x() + hpadding, midHeight, w, h);
else
- r = QRect(tab->rect.right() - 6 - w, midHeight, w, h);
+ r = QRect(tab->rect.right() - w - hpadding, midHeight, w, h);
r = visualRect(tab->direction, tab->rect, r);
}
if (verticalTabs) {
if (atTheTop)
- r = QRect(midWidth, tr.y() + tab->rect.height() - 6 - h, w, h);
+ r = QRect(midWidth, tr.y() + tab->rect.height() - hpadding - h, w, h);
else
- r = QRect(midWidth, tr.y() + 6, w, h);
+ r = QRect(midWidth, tr.y() + hpadding, w, h);
}
}
diff --git a/src/gui/styles/qcommonstyle_p.h b/src/gui/styles/qcommonstyle_p.h
index 7e58b37..14f5558 100644
--- a/src/gui/styles/qcommonstyle_p.h
+++ b/src/gui/styles/qcommonstyle_p.h
@@ -123,6 +123,9 @@ public:
#endif
mutable QIcon tabBarcloseButtonIcon;
int lookupToolButtonStyle() const;
+#ifndef QT_NO_TABBAR
+ void tabLayout(const QStyleOptionTabV3 *opt, const QWidget *widget, QRect *textRect, QRect *pixmapRect) const;
+#endif
};
QT_END_NAMESPACE
diff --git a/src/gui/styles/qmacstyle_mac.mm b/src/gui/styles/qmacstyle_mac.mm
index 08b6ad8..905044c 100644
--- a/src/gui/styles/qmacstyle_mac.mm
+++ b/src/gui/styles/qmacstyle_mac.mm
@@ -5318,16 +5318,23 @@ QRect QMacStyle::subControlRect(ComplexControl cc, const QStyleOptionComplex *op
case SC_ComboBoxArrow:{
ret = QMacStylePrivate::comboboxEditBounds(combo->rect, bdi);
ret.setX(ret.x() + ret.width());
- ret.setWidth(combo->rect.width() - ret.width() - ret.x());
+ ret.setWidth(combo->rect.right() - ret.right());
break; }
case SC_ComboBoxListBoxPopup:{
if (combo->editable) {
HIRect inner = QMacStylePrivate::comboboxInnerBounds(qt_hirectForQRect(combo->rect), bdi.kind);
QRect editRect = QMacStylePrivate::comboboxEditBounds(combo->rect, bdi);
- ret.adjust(qRound(inner.origin.x), 0, qRound(inner.origin.x + inner.size.width), editRect.y() + editRect.height() + 2);
+ const int comboTop = combo->rect.top();
+ ret = QRect(qRound(inner.origin.x),
+ comboTop,
+ qRound(inner.origin.x - combo->rect.left() + inner.size.width),
+ editRect.bottom() - comboTop + 2);
} else {
QRect editRect = QMacStylePrivate::comboboxEditBounds(combo->rect, bdi);
- ret.adjust(4 - 11, 1, editRect.width() + 10 + 11, 1);
+ ret = QRect(combo->rect.x() + 4 - 11,
+ combo->rect.y() + 1,
+ editRect.width() + 10 + 11,
+ 1);
}
break; }
default:
diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp
index b05a1e9..3230c17 100644
--- a/src/gui/styles/qs60style.cpp
+++ b/src/gui/styles/qs60style.cpp
@@ -67,6 +67,7 @@
#include "qtoolbar.h"
#include "qtoolbutton.h"
#include "qtreeview.h"
+#include "qfocusframe.h"
#include "private/qtoolbarextension_p.h"
#include "private/qcombobox_p.h"
@@ -86,6 +87,8 @@ const QS60StylePrivate::SkinElementFlags QS60StylePrivate::KDefaultSkinElementFl
static const QByteArray propertyKeyLayouts = "layouts";
static const QByteArray propertyKeyCurrentlayout = "currentlayout";
+static const qreal goldenRatio = 1.618;
+
const layoutHeader QS60StylePrivate::m_layoutHeaders[] = {
// *** generated layout data ***
{240,320,1,14,true,"QVGA Landscape Mirrored"},
@@ -508,11 +511,6 @@ void QS60StylePrivate::deleteBackground()
}
}
-int QS60StylePrivate::focusRectPenWidth()
-{
- return pixelMetric(QS60Style::PM_DefaultFrameWidth);
-}
-
void QS60StylePrivate::setCurrentLayout(int index)
{
m_pmPointer = data[index];
@@ -950,13 +948,6 @@ void QS60Style::drawComplexControl(ComplexControl control, const QStyleOptionCom
const QS60StylePrivate::SkinElements handleElement =
horizontal ? QS60StylePrivate::SE_SliderHandleHorizontal : QS60StylePrivate::SE_SliderHandleVertical;
QS60StylePrivate::drawSkinElement(handleElement, painter, sliderHandle, flags);
-
- if (optionSlider->state & State_HasFocus) {
- QStyleOptionFocusRect fropt;
- fropt.QStyleOption::operator=(*optionSlider);
- fropt.rect = subElementRect(SE_SliderFocusRect, optionSlider, widget);
- drawPrimitive(PE_FrameFocusRect, &fropt, painter, widget);
- }
}
break;
#endif // QT_NO_SLIDER
@@ -991,17 +982,6 @@ void QS60Style::drawComplexControl(ComplexControl control, const QStyleOptionCom
drawPrimitive(PE_IndicatorSpinDown, &buttonOption, painter, widget);
painter->restore();
}
-
- if (cmb->subControls & SC_ComboBoxEditField) {
- if (cmb->state & State_HasFocus && !cmb->editable) {
- QStyleOptionFocusRect focus;
- focus.QStyleOption::operator=(*cmb);
- focus.rect = cmbxEditField;
- focus.state |= State_FocusAtBorder;
- focus.backgroundColor = cmb->palette.highlight().color();
- drawPrimitive(PE_FrameFocusRect, &focus, painter, widget);
- }
- }
}
break;
#endif // QT_NO_COMBOBOX
@@ -1079,13 +1059,6 @@ void QS60Style::drawComplexControl(ComplexControl control, const QStyleOptionCom
}
}
}
- if (toolBtn->state & State_HasFocus) {
- QStyleOptionFocusRect fr;
- fr.QStyleOption::operator=(*toolBtn);
- const int frameWidth = pixelMetric(PM_DefaultFrameWidth, option, widget);
- fr.rect.adjust(frameWidth, frameWidth, -frameWidth, -frameWidth);
- drawPrimitive(PE_FrameFocusRect, &fr, painter, widget);
- }
if (toolBtn->features & QStyleOptionToolButton::Arrow) {
QStyle::PrimitiveElement pe;
@@ -1209,13 +1182,6 @@ void QS60Style::drawComplexControl(ComplexControl control, const QStyleOptionCom
groupBox->palette, groupBox->state & State_Enabled, groupBox->text,
textColor.isValid() ? QPalette::NoRole : QPalette::WindowText);
painter->restore();
-
- if (groupBox->state & State_HasFocus) {
- QStyleOptionFocusRect fropt;
- fropt.QStyleOption::operator=(*groupBox);
- fropt.rect = textRect;
- drawPrimitive(PE_FrameFocusRect, &fropt, painter, widget);
- }
}
// Draw checkbox
@@ -1249,12 +1215,6 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option,
subopt.rect = subElementRect(SE_PushButtonContents, btn, widget);
drawControl(CE_PushButtonLabel, &subopt, painter, widget);
- if (btn->state & State_HasFocus) {
- QStyleOptionFocusRect fropt;
- fropt.QStyleOption::operator=(*btn);
- fropt.rect = subElementRect(SE_PushButtonFocusRect, btn, widget);
- drawPrimitive(PE_FrameFocusRect, &fropt, painter, widget);
- }
}
break;
case CE_PushButtonBevel:
@@ -1612,18 +1572,6 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option,
if (verticalTabs)
painter->restore();
- if (optionTab.state & State_HasFocus) {
- const int OFFSET = 1 + pixelMetric(PM_DefaultFrameWidth);
- const int leftBorder = optionTab.rect.left();
- const int rightBorder = optionTab.rect.right() - 1;
-
- QStyleOptionFocusRect fropt;
- fropt.QStyleOption::operator=(*tab);
- fropt.rect.setRect(leftBorder + 1 + OFFSET, optionTab.rect.y() + OFFSET,
- rightBorder - leftBorder - 2*OFFSET, optionTab.rect.height() - 2*OFFSET);
- drawPrimitive(PE_FrameFocusRect, &fropt, painter, widget);
- }
-
painter->restore();
}
break;
@@ -1875,11 +1823,48 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option,
} else if (qobject_cast<const QFrame *>(widget)) {
QCommonStyle::drawControl(element, option, painter, widget);
}
- if (option->state & State_HasFocus)
- drawPrimitive(PE_FrameFocusRect, option, painter, widget);
break;
case CE_MenuScroller:
break;
+ case CE_FocusFrame:
+ {
+ // The pen width should nearly fill the layoutspacings around the widget
+ const int penWidth =
+ qMin(pixelMetric(QS60Style::PM_LayoutVerticalSpacing), pixelMetric(QS60Style::PM_LayoutHorizontalSpacing))
+ - 2; // But keep 1 pixel distance to the focus widget and 1 pixel to the adjacent widgets
+
+#ifdef QT_KEYPAD_NAVIGATION
+ bool editFocus = false;
+ if (const QFocusFrame *focusFrame = qobject_cast<const QFocusFrame*>(widget)) {
+ if (focusFrame->widget() && focusFrame->widget()->hasEditFocus())
+ editFocus = true;
+ }
+ const qreal opacity = editFocus ? 0.65 : 0.45; // Trial and error factors. Feel free to improve.
+#else
+ const qreal opacity = 0.5;
+#endif
+ // Because of Qts coordinate system, we need to tweak the rect by .5 pixels, otherwise it gets blurred.
+ const qreal rectAdjustment = (penWidth % 2) ? -.5 : 0;
+
+ // Make sure that the pen stroke is inside the rect
+ const QRectF adjustedRect =
+ QRectF(option->rect).adjusted(
+ rectAdjustment + penWidth,
+ rectAdjustment + penWidth,
+ -rectAdjustment - penWidth,
+ -rectAdjustment - penWidth
+ );
+
+ const qreal roundRectRadius = penWidth * goldenRatio;
+
+ painter->save();
+ painter->setRenderHint(QPainter::Antialiasing);
+ painter->setOpacity(opacity);
+ painter->setPen(QPen(option->palette.color(QPalette::Highlight), penWidth));
+ painter->drawRoundedRect(adjustedRect, roundRectRadius, roundRectRadius);
+ painter->restore();
+ }
+ break;
default:
QCommonStyle::drawControl(element, option, painter, widget);
}
@@ -1901,9 +1886,6 @@ void QS60Style::drawPrimitive(PrimitiveElement element, const QStyleOption *opti
#endif
QS60StylePrivate::drawSkinElement(QS60StylePrivate::SE_FrameLineEdit,
painter, option->rect, flags);
-
- if (lineEdit->state & State_HasFocus)
- drawPrimitive(PE_FrameFocusRect, lineEdit, painter, widget);
}
break;
#endif // QT_NO_LINEEDIT
@@ -2030,50 +2012,6 @@ void QS60Style::drawPrimitive(PrimitiveElement element, const QStyleOption *opti
#endif //QT_NO_COMBOBOX
break;
#endif //QT_NO_SPINBOX
- case PE_FrameFocusRect:
-// Calendar widget and combox both do not use styled itemDelegate
- if (widget && !(false
-#ifndef QT_NO_CALENDARWIDGET
- || qobject_cast<const QCalendarWidget *>(widget->parent())
-#endif //QT_NO_CALENDARWIDGET
-#ifndef QT_NO_COMBOBOX
- || qobject_cast<const QComboBoxListView *>(widget)
-#endif //QT_NO_COMBOBOX
- )) {
- // no focus selection for touch
- if (option->state & State_HasFocus && !QS60StylePrivate::isTouchSupported()) {
- painter->save();
- const int penWidth = QS60StylePrivate::focusRectPenWidth();
-#ifdef QT_KEYPAD_NAVIGATION
- const Qt::PenStyle penStyle = widget->hasEditFocus() ? Qt::SolidLine :Qt::DashLine;
- const qreal opacity = widget->hasEditFocus() ? 0.6 : 0.4;
-#else
- const Qt::PenStyle penStyle = Qt::SolidLine;
- const qreal opacity = 0.5;
-#endif
- painter->setRenderHint(QPainter::Antialiasing);
- painter->setOpacity(opacity);
- // Because of Qts coordinate system, we need to tweak the rect by .5 pixels, otherwise it gets blurred.
- const qreal rectAdjustment = penWidth % 2?.5:0;
- // Also we try to stay inside the option->rect, with penWidth > 1. Therefore these +1/-1
- const QRectF adjustedRect = QRectF(option->rect).adjusted(
- rectAdjustment + penWidth - 1,
- rectAdjustment + penWidth - 1,
- -rectAdjustment - penWidth + 1,
- -rectAdjustment - penWidth + 1);
- const qreal roundRectRadius = penWidth * 1.5;
-#ifdef QT_KEYPAD_NAVIGATION
- if (penStyle != Qt::SolidLine) {
- painter->setPen(QPen(option->palette.color(QPalette::HighlightedText), penWidth, Qt::SolidLine));
- painter->drawRoundedRect(adjustedRect, roundRectRadius, roundRectRadius);
- }
-#endif
- painter->setPen(QPen((option->palette.color(QPalette::Text), penWidth, penStyle)));
- painter->drawRoundedRect(adjustedRect, roundRectRadius, roundRectRadius);
- painter->restore();
- }
- }
- break;
case PE_Widget:
if (QS60StylePrivate::drawsOwnThemeBackground(widget)
#ifndef QT_NO_COMBOBOX
@@ -2118,8 +2056,6 @@ void QS60Style::drawPrimitive(PrimitiveElement element, const QStyleOption *opti
Q_ASSERT(false);
break;
case PE_Frame:
- if (const QStyleOptionFrameV3 *frame = qstyleoption_cast<const QStyleOptionFrameV3 *>(option))
- drawPrimitive(PE_FrameFocusRect, frame, painter, widget);
break;
#ifndef QT_NO_ITEMVIEWS
case PE_PanelItemViewItem:
@@ -2668,16 +2604,6 @@ QRect QS60Style::subElementRect(SubElement element, const QStyleOption *opt, con
}
ret = visualRect(opt->direction, opt->rect, ret);
break;
- case SE_FrameContents:
- if (QS60StylePrivate::isTouchSupported()) {
- return QCommonStyle::subElementRect(element, opt, widget);
- } else if (const QStyleOptionFrameV2 *f = qstyleoption_cast<const QStyleOptionFrameV2 *>(opt)) {
- // We shrink the frame contents by focusFrameWidth, so that we can draw the frame around it in keypad navigation mode.
- const int frameWidth = QS60StylePrivate::focusRectPenWidth();
- ret = opt->rect.adjusted(frameWidth, frameWidth, -frameWidth, -frameWidth);
- ret = visualRect(opt->direction, opt->rect, ret);
- }
- break;
default:
ret = QCommonStyle::subElementRect(element, opt, widget);
}
@@ -2778,6 +2704,40 @@ QVariant QS60Style::styleProperty(const char *name) const
return d->styleProperty_specific(name);
}
+bool QS60Style::event(QEvent *e)
+{
+#ifdef QT_KEYPAD_NAVIGATION
+ if (QS60StylePrivate::isTouchSupported())
+ return false;
+ Q_D(QS60Style);
+ switch (e->type()) {
+ case QEvent::FocusIn:
+ if (QWidget *focusWidget = QApplication::focusWidget()) {
+ if (!d->m_focusFrame)
+ d->m_focusFrame = new QFocusFrame(focusWidget);
+ d->m_focusFrame->setWidget(focusWidget);
+ } else if (d->m_focusFrame) {
+ d->m_focusFrame->setWidget(0);
+ }
+ break;
+ case QEvent::FocusOut:
+ if (d->m_focusFrame)
+ d->m_focusFrame->setWidget(0);
+ break;
+ case QEvent::EnterEditFocus:
+ case QEvent::LeaveEditFocus:
+ if (d->m_focusFrame)
+ d->m_focusFrame->update();
+ break;
+ default:
+ break;
+ }
+#else
+ Q_UNUSED(e)
+#endif
+ return false;
+}
+
QIcon QS60Style::standardIconImplementation(StandardPixmap standardIcon,
const QStyleOption *option, const QWidget *widget) const
{
diff --git a/src/gui/styles/qs60style.h b/src/gui/styles/qs60style.h
index a03803b..c01c40a 100644
--- a/src/gui/styles/qs60style.h
+++ b/src/gui/styles/qs60style.h
@@ -80,6 +80,8 @@ public:
void setStyleProperty(const char *name, const QVariant &value);
QVariant styleProperty(const char *name) const;
+ bool event(QEvent *e);
+
#ifndef Q_WS_S60
static QStringList partKeys();
static QStringList colorListKeys();
diff --git a/src/gui/styles/qs60style_p.h b/src/gui/styles/qs60style_p.h
index 2e661c0..ed0abfa 100644
--- a/src/gui/styles/qs60style_p.h
+++ b/src/gui/styles/qs60style_p.h
@@ -292,6 +292,8 @@ public:
};
};
+class QFocusFrame;
+
// Private class
#ifdef Q_OS_SYMBIAN
NONSHARABLE_CLASS (QS60StylePrivate)
@@ -430,8 +432,6 @@ public:
//access to theme palette
static QPalette* themePalette();
- static int focusRectPenWidth();
-
static const layoutHeader m_layoutHeaders[];
static const short data[][MAX_PIXELMETRICS];
@@ -499,6 +499,8 @@ private:
// defined theme palette
static QPalette *m_themePalette;
QPalette m_originalPalette;
+
+ QPointer<QFocusFrame> m_focusFrame;
};
QT_END_NAMESPACE
diff --git a/src/gui/styles/qs60style_s60.cpp b/src/gui/styles/qs60style_s60.cpp
index bc218cd..1cf47cc 100644
--- a/src/gui/styles/qs60style_s60.cpp
+++ b/src/gui/styles/qs60style_s60.cpp
@@ -1350,9 +1350,6 @@ void QS60StyleModeSpecifics::colorGroupAndIndex(
}
}
-/*!
- Constructs a QS60Style object.
-*/
QS60Style::QS60Style()
: QCommonStyle(*new QS60StylePrivate)
{
diff --git a/src/gui/styles/qs60style_simulated.cpp b/src/gui/styles/qs60style_simulated.cpp
index 350ef51..2d185bd 100644
--- a/src/gui/styles/qs60style_simulated.cpp
+++ b/src/gui/styles/qs60style_simulated.cpp
@@ -366,8 +366,7 @@ QFont QS60StylePrivate::s60Font_specific(QS60StyleEnums::FontCategories fontCate
QS60Style::QS60Style()
: QCommonStyle(*new QS60StylePrivate)
{
- // Assume, that the resource system has a ':/s60Stylethemes/Default.blob'
- const QString defaultBlob = QString::fromLatin1(":/s60Stylethemes/Default.blob");
+ const QString defaultBlob = QString::fromLatin1(":/trolltech/styles/s60style/images/defaults60theme.blob");
if (QFile::exists(defaultBlob))
loadS60ThemeFromBlob(defaultBlob);
}
diff --git a/src/gui/styles/qstyle_s60_simulated.qrc b/src/gui/styles/qstyle_s60_simulated.qrc
index 72aab9e..969732e 100644
--- a/src/gui/styles/qstyle_s60_simulated.qrc
+++ b/src/gui/styles/qstyle_s60_simulated.qrc
@@ -1,6 +1,6 @@
<!DOCTYPE RCC>
<RCC version="1.0">
<qresource prefix="/trolltech/styles/s60style">
- <file>images/s60themes.dat</file>
+ <file>images/defaults60theme.blob</file>
</qresource>
</RCC>
diff --git a/src/gui/styles/qstylesheetstyle.cpp b/src/gui/styles/qstylesheetstyle.cpp
index 7acb3a6..da71ced 100644
--- a/src/gui/styles/qstylesheetstyle.cpp
+++ b/src/gui/styles/qstylesheetstyle.cpp
@@ -214,6 +214,7 @@ enum PseudoElement {
PseudoElement_ViewItemText,
PseudoElement_ViewItemIndicator,
PseudoElement_ScrollAreaCorner,
+ PseudoElement_TabBarTabCloseButton,
NumPseudoElements
};
@@ -223,7 +224,7 @@ struct PseudoElementInfo {
};
static const PseudoElementInfo knownPseudoElements[NumPseudoElements] = {
- { QStyle::SC_None, "", },
+ { QStyle::SC_None, "" },
{ QStyle::SC_None, "down-arrow" },
{ QStyle::SC_None, "up-arrow" },
{ QStyle::SC_None, "left-arrow" },
@@ -300,8 +301,9 @@ static const PseudoElementInfo knownPseudoElements[NumPseudoElements] = {
{ QStyle::SC_None, "item" },
{ QStyle::SC_None, "icon" },
{ QStyle::SC_None, "text" },
- { QStyle::SC_None, "indicator" } ,
- { QStyle::SC_None, "corner" }
+ { QStyle::SC_None, "indicator" },
+ { QStyle::SC_None, "corner" },
+ { QStyle::SC_None, "close-button" },
};
@@ -4370,6 +4372,12 @@ void QStyleSheetStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *op
case PE_IndicatorSpinPlus:
pseudoElement = PseudoElement_SpinBoxUpArrow;
break;
+#ifndef QT_NO_TABBAR
+ case PE_IndicatorTabClose:
+ if (w)
+ w = w->parentWidget(); //match on the QTabBar instead of the CloseButton
+ pseudoElement = PseudoElement_TabBarTabCloseButton;
+#endif
default:
break;
@@ -5104,6 +5112,18 @@ int QStyleSheetStyle::styleHint(StyleHint sh, const QStyleOption *opt, const QWi
#endif // QT_NO_TABWIDGET
s = QLatin1String("alignment");
break;
+#ifndef QT_NO_TABBAR
+ case SH_TabBar_CloseButtonPosition:
+ rule = renderRule(w, opt, PseudoElement_TabBarTabCloseButton);
+ if (rule.hasPosition()) {
+ Qt::Alignment align = rule.position()->position;
+ if (align & Qt::AlignLeft || align & Qt::AlignTop)
+ return QTabBar::LeftSide;
+ if (align & Qt::AlignRight || align & Qt::AlignBottom)
+ return QTabBar::RightSide;
+ }
+ break;
+#endif
case SH_TabBar_ElideMode: s = QLatin1String("tabbar-elide-mode"); break;
case SH_TabBar_PreferNoArrows: s = QLatin1String("tabbar-prefer-no-arrows"); break;
case SH_ComboBox_PopupFrameStyle:
diff --git a/src/gui/styles/styles.pri b/src/gui/styles/styles.pri
index 70ac6cb..767ade0 100644
--- a/src/gui/styles/styles.pri
+++ b/src/gui/styles/styles.pri
@@ -168,11 +168,10 @@ contains( styles, s60 ):contains(QT_CONFIG, s60) {
SOURCES += styles/qs60style.cpp
symbian {
SOURCES += styles/qs60style_s60.cpp
- # TODO: fix the following LIBS hack. Line 1 is for armv5, 2 for winscw
- LIBS += aknicon aknskins aknskinsrv fontutils
LIBS += -laknicon -laknskins -laknskinsrv -lfontutils
} else {
SOURCES += styles/qs60style_simulated.cpp
+ RESOURCES += styles/qstyle_s60_simulated.qrc
}
} else {
DEFINES += QT_NO_STYLE_S60
diff --git a/src/gui/text/qfontdatabase_s60.cpp b/src/gui/text/qfontdatabase_s60.cpp
index 058041b..fe90010 100644
--- a/src/gui/text/qfontdatabase_s60.cpp
+++ b/src/gui/text/qfontdatabase_s60.cpp
@@ -126,8 +126,13 @@ QFontDatabaseS60StoreImplementation::QFontDatabaseS60StoreImplementation()
}
QFontDatabaseS60StoreImplementation::~QFontDatabaseS60StoreImplementation()
{
- qDeleteAll(m_extensions);
- // TODO m_store cleanup removed because it was crashing
+ typedef QHash<QString, const QFontEngineS60Extensions *>::iterator iterator;
+ for (iterator p = m_extensions.begin(); p != m_extensions.end(); ++p) {
+ m_store->ReleaseFont((*p)->fontOwner());
+ delete *p;
+ }
+
+ delete m_store;
m_heap->Close();
}
@@ -140,7 +145,7 @@ const QFontEngineS60Extensions *QFontDatabaseS60StoreImplementation::extension(c
const TInt err = m_store->GetNearestFontToDesignHeightInPixels(font, spec);
Q_ASSERT(err == KErrNone && font);
CBitmapFont *bitmapFont = static_cast<CBitmapFont*>(font);
- m_extensions.insert(typeface, new QFontEngineS60Extensions(bitmapFont->OpenFont()));
+ m_extensions.insert(typeface, new QFontEngineS60Extensions(font, bitmapFont->OpenFont()));
}
return m_extensions.value(typeface);
}
diff --git a/src/gui/text/qfontengine_qpf.cpp b/src/gui/text/qfontengine_qpf.cpp
index e05a502..05dea6e 100644
--- a/src/gui/text/qfontengine_qpf.cpp
+++ b/src/gui/text/qfontengine_qpf.cpp
@@ -66,9 +66,10 @@ QT_BEGIN_NAMESPACE
#ifndef QT_NO_QWS_QPF2
-QT_BEGIN_INCLUDE_NAMESPACE
#include "qpfutil.cpp"
+QT_BEGIN_INCLUDE_NAMESPACE
+
#if defined(Q_WS_QWS)
# include "private/qwscommand_qws_p.h"
# include "qwsdisplay_qws.h"
diff --git a/src/gui/text/qfontengine_s60.cpp b/src/gui/text/qfontengine_s60.cpp
index eba21e8..ed6b1c1 100644
--- a/src/gui/text/qfontengine_s60.cpp
+++ b/src/gui/text/qfontengine_s60.cpp
@@ -54,10 +54,11 @@
QT_BEGIN_NAMESPACE
-QFontEngineS60Extensions::QFontEngineS60Extensions(COpenFont *font)
+QFontEngineS60Extensions::QFontEngineS60Extensions(CFont* fontOwner, COpenFont *font)
: m_font(font)
, m_cmap(0)
, m_symbolCMap(false)
+ , m_fontOwner(fontOwner)
{
TAny *shapingExtension = NULL;
m_font->ExtendedInterface(KUidOpenFontShapingExtension, shapingExtension);
@@ -109,6 +110,12 @@ QPainterPath QFontEngineS60Extensions::glyphOutline(glyph_t glyph) const
return result;
}
+CFont *QFontEngineS60Extensions::fontOwner() const
+{
+ return m_fontOwner;
+}
+
+
// duplicated from qfontengine_xyz.cpp
static inline unsigned int getChar(const QChar *str, int &i, const int len)
{
diff --git a/src/gui/text/qfontengine_s60_p.h b/src/gui/text/qfontengine_s60_p.h
index 0c1be8c..bbbc3d6 100644
--- a/src/gui/text/qfontengine_s60_p.h
+++ b/src/gui/text/qfontengine_s60_p.h
@@ -69,11 +69,12 @@ QT_BEGIN_NAMESPACE
class QFontEngineS60Extensions
{
public:
- QFontEngineS60Extensions(COpenFont *font);
+ QFontEngineS60Extensions(CFont* fontOwner, COpenFont *font);
QByteArray getSfntTable(uint tag) const;
const unsigned char *cmap() const;
QPainterPath glyphOutline(glyph_t glyph) const;
+ CFont *fontOwner() const;
private:
COpenFont *m_font;
@@ -82,6 +83,7 @@ private:
mutable const unsigned char *m_cmap;
mutable bool m_symbolCMap;
mutable QByteArray m_cmapTable;
+ CFont* m_fontOwner;
};
class QFontEngineS60 : public QFontEngine
diff --git a/src/gui/text/qfontengine_win.cpp b/src/gui/text/qfontengine_win.cpp
index 173b822..7a9d958 100644
--- a/src/gui/text/qfontengine_win.cpp
+++ b/src/gui/text/qfontengine_win.cpp
@@ -327,8 +327,10 @@ QFontEngineWin::QFontEngineWin(const QString &name, HFONT _hfont, bool stockFont
BOOL res = GetTextMetrics(hdc, &tm);
fontDef.fixedPitch = !(tm.tmPitchAndFamily & TMPF_FIXED_PITCH);
- if (!res)
+ if (!res) {
qErrnoWarning("QFontEngineWin: GetTextMetrics failed");
+ ZeroMemory(&tm, sizeof(TEXTMETRIC));
+ }
cache_cost = tm.tmHeight * tm.tmAveCharWidth * 2000;
getCMap();
diff --git a/src/gui/util/qsystemtrayicon_win.cpp b/src/gui/util/qsystemtrayicon_win.cpp
index 465c1d8..ea7fbde 100644
--- a/src/gui/util/qsystemtrayicon_win.cpp
+++ b/src/gui/util/qsystemtrayicon_win.cpp
@@ -132,11 +132,12 @@ QSystemTrayIconSys::QSystemTrayIconSys(QSystemTrayIcon *object)
: hIcon(0), q(object), ignoreNextMouseRelease(false)
{
- notifyIconSize = sizeof(NOTIFYICONDATA);
-#ifdef Q_OS_WINCE
- maxTipLength = 64;
-#else
+#ifndef Q_OS_WINCE
+ notifyIconSize = FIELD_OFFSET(NOTIFYICONDATA, guidItem); // NOTIFYICONDATAW_V2_SIZE;
maxTipLength = 128;
+#else
+ notifyIconSize = FIELD_OFFSET(NOTIFYICONDATA, szTip[64]); // NOTIFYICONDATAW_V1_SIZE;
+ maxTipLength = 64;
#endif
// For restoring the tray icon after explorer crashes
diff --git a/src/gui/widgets/qabstractscrollarea.cpp b/src/gui/widgets/qabstractscrollarea.cpp
index 1b4d41b..d1adfee 100644
--- a/src/gui/widgets/qabstractscrollarea.cpp
+++ b/src/gui/widgets/qabstractscrollarea.cpp
@@ -1356,7 +1356,7 @@ void QAbstractScrollAreaPrivate::_q_gestureTriggered()
return;
QScrollBar *hBar = q->horizontalScrollBar();
QScrollBar *vBar = q->verticalScrollBar();
- QSize delta = g->lastOffset();
+ QSizeF delta = g->lastOffset();
if (!delta.isNull()) {
if (QApplication::isRightToLeft())
delta.rwidth() *= -1;
diff --git a/src/gui/widgets/qcocoatoolbardelegate_mac.mm b/src/gui/widgets/qcocoatoolbardelegate_mac.mm
index 3b58a4e..2ef0ead 100644
--- a/src/gui/widgets/qcocoatoolbardelegate_mac.mm
+++ b/src/gui/widgets/qcocoatoolbardelegate_mac.mm
@@ -100,7 +100,8 @@ QT_FORWARD_DECLARE_CLASS(QCFString);
{
Q_UNUSED(flag);
Q_UNUSED(nstoolbar);
- QToolBar *tb = mainWindowLayout->cocoaItemIDToToolbarHash.value(qt_mac_NSStringToQString(itemIdentifier));
+ QToolBar *tb = mainWindowLayout->cocoaItemIDToToolbarHash.value(
+ QT_PREPEND_NAMESPACE(qt_mac_NSStringToQString)(itemIdentifier));
NSToolbarItem *item = nil;
if (tb) {
item = [[NSToolbarItem alloc] initWithItemIdentifier:itemIdentifier];
@@ -112,7 +113,8 @@ QT_FORWARD_DECLARE_CLASS(QCFString);
- (void)toolbarWillAddItem:(NSNotification *)notification
{
NSToolbarItem *item = [[notification userInfo] valueForKey:@"item"];
- QToolBar *tb = mainWindowLayout->cocoaItemIDToToolbarHash.value(qt_mac_NSStringToQString([item itemIdentifier]));
+ QToolBar *tb = mainWindowLayout->cocoaItemIDToToolbarHash.value(
+ QT_PREPEND_NAMESPACE(qt_mac_NSStringToQString)([item itemIdentifier]));
if (!tb)
return; // I can't really do anything about this.
[item retain];
diff --git a/src/gui/widgets/qlinecontrol_p.h b/src/gui/widgets/qlinecontrol_p.h
index adea742..0db6279 100644
--- a/src/gui/widgets/qlinecontrol_p.h
+++ b/src/gui/widgets/qlinecontrol_p.h
@@ -349,7 +349,7 @@ Q_SIGNALS:
protected:
virtual void timerEvent(QTimerEvent *event);
-private slots:
+private Q_SLOTS:
void _q_clipboardChanged();
void _q_deleteSelected();
diff --git a/src/gui/widgets/qlineedit.cpp b/src/gui/widgets/qlineedit.cpp
index 299ecfc..059aaf1 100644
--- a/src/gui/widgets/qlineedit.cpp
+++ b/src/gui/widgets/qlineedit.cpp
@@ -1395,7 +1395,7 @@ bool QLineEdit::event(QEvent * e)
if (e->type() == QEvent::EnterEditFocus) {
end(false);
d->setCursorVisible(true);
- d->control->setCursorBlinkPeriod(QApplication::cursorFlashTime()/2);
+ d->control->setCursorBlinkPeriod(QApplication::cursorFlashTime());
} else if (e->type() == QEvent::LeaveEditFocus) {
d->setCursorVisible(false);
d->control->setCursorBlinkPeriod(0);
@@ -1690,7 +1690,7 @@ void QLineEdit::focusInEvent(QFocusEvent *e)
#ifdef QT_KEYPAD_NAVIGATION
if (!QApplication::keypadNavigationEnabled() || (hasEditFocus() && e->reason() == Qt::PopupFocusReason)){
#endif
- d->control->setCursorBlinkPeriod(QApplication::cursorFlashTime()/2);
+ d->control->setCursorBlinkPeriod(QApplication::cursorFlashTime());
QStyleOptionFrameV2 opt;
initStyleOption(&opt);
if((!hasSelectedText() && d->control->preeditAreaText().isEmpty())
@@ -2002,7 +2002,7 @@ QMenu *QLineEdit::createStandardContextMenu()
action = popup->addAction(QLineEdit::tr("Delete"));
action->setEnabled(!d->control->isReadOnly() && !d->control->text().isEmpty() && d->control->hasSelectedText());
- connect(action, SIGNAL(triggered()), SLOT(_q_deleteSelected()));
+ connect(action, SIGNAL(triggered()), d->control, SLOT(_q_deleteSelected()));
popup->addSeparator();
diff --git a/src/gui/widgets/qlineedit.h b/src/gui/widgets/qlineedit.h
index 03d4376..cd37ad0 100644
--- a/src/gui/widgets/qlineedit.h
+++ b/src/gui/widgets/qlineedit.h
@@ -267,7 +267,6 @@ private:
Q_DISABLE_COPY(QLineEdit)
Q_DECLARE_PRIVATE(QLineEdit)
Q_PRIVATE_SLOT(d_func(), void _q_handleWindowActivate())
- Q_PRIVATE_SLOT(d_func(), void _q_deleteSelected())
Q_PRIVATE_SLOT(d_func(), void _q_textEdited(const QString &))
Q_PRIVATE_SLOT(d_func(), void _q_cursorPositionChanged(int, int))
#ifndef QT_NO_COMPLETER
diff --git a/src/gui/widgets/qlineedit_p.cpp b/src/gui/widgets/qlineedit_p.cpp
index cec34da..4218630 100644
--- a/src/gui/widgets/qlineedit_p.cpp
+++ b/src/gui/widgets/qlineedit_p.cpp
@@ -93,10 +93,6 @@ void QLineEditPrivate::_q_completionHighlighted(QString newText)
#endif // QT_NO_COMPLETER
-void QLineEditPrivate::_q_clipboardChanged()
-{
-}
-
void QLineEditPrivate::_q_handleWindowActivate()
{
Q_Q(QLineEdit);
@@ -104,10 +100,6 @@ void QLineEditPrivate::_q_handleWindowActivate()
control->deselect();
}
-void QLineEditPrivate::_q_deleteSelected()
-{
-}
-
void QLineEditPrivate::_q_textEdited(const QString &text)
{
Q_Q(QLineEdit);
diff --git a/src/gui/widgets/qlineedit_p.h b/src/gui/widgets/qlineedit_p.h
index 3521dcb..260bc19 100644
--- a/src/gui/widgets/qlineedit_p.h
+++ b/src/gui/widgets/qlineedit_p.h
@@ -122,9 +122,7 @@ public:
QRect adjustedContentsRect() const;
- void _q_clipboardChanged();
void _q_handleWindowActivate();
- void _q_deleteSelected();
void _q_textEdited(const QString &);
void _q_cursorPositionChanged(int, int);
#ifdef QT_KEYPAD_NAVIGATION
diff --git a/src/gui/widgets/qmenu.cpp b/src/gui/widgets/qmenu.cpp
index f0f425f..4734d22 100644
--- a/src/gui/widgets/qmenu.cpp
+++ b/src/gui/widgets/qmenu.cpp
@@ -368,7 +368,9 @@ QRect QMenuPrivate::actionRect(QAction *act) const
return actionRects.at(index);
}
+#if defined(Q_WS_MAC)
static const qreal MenuFadeTimeInSec = 0.150;
+#endif
void QMenuPrivate::hideUpToMenuBar()
{
diff --git a/src/gui/widgets/qmenu_mac.mm b/src/gui/widgets/qmenu_mac.mm
index 47a8042..8e28abe 100644
--- a/src/gui/widgets/qmenu_mac.mm
+++ b/src/gui/widgets/qmenu_mac.mm
@@ -607,6 +607,13 @@ static inline void syncNSMenuItemVisiblity(NSMenuItem *menuItem, bool actionVisi
[menuItem setHidden:!actionVisibility];
}
+static inline void syncNSMenuItemEnabled(NSMenuItem *menuItem, bool enabled)
+{
+ [menuItem setEnabled:NO];
+ [menuItem setEnabled:YES];
+ [menuItem setEnabled:enabled];
+}
+
static inline void syncMenuBarItemsVisiblity(const QMenuBarPrivate::QMacMenuBarPrivate *mac_menubar)
{
const QList<QMacMenuAction *> &menubarActions = mac_menubar->actionItems;
@@ -659,12 +666,12 @@ void qt_mac_set_modal_state_helper_recursive(OSMenuRef menu, OSMenuRef merge, bo
// The item should follow what the QAction has.
if ([item tag]) {
QAction *action = reinterpret_cast<QAction *>([item tag]);
- [item setEnabled:action->isEnabled()];
+ syncNSMenuItemEnabled(item, action->isEnabled());
} else {
- [item setEnabled:YES];
+ syncNSMenuItemEnabled(item, YES);
}
} else {
- [item setEnabled:NO];
+ syncNSMenuItemEnabled(item, NO);
}
}
}
diff --git a/src/gui/widgets/qplaintextedit.cpp b/src/gui/widgets/qplaintextedit.cpp
index e025876..6ac521b 100644
--- a/src/gui/widgets/qplaintextedit.cpp
+++ b/src/gui/widgets/qplaintextedit.cpp
@@ -379,7 +379,7 @@ void QPlainTextDocumentLayout::layoutBlock(const QTextBlock &block)
tl->beginLayout();
qreal availableWidth = d->width;
if (availableWidth <= 0) {
- availableWidth = INT_MAX; // similar to text edit with pageSize.width == 0
+ availableWidth = qreal(INT_MAX); // similar to text edit with pageSize.width == 0
}
availableWidth -= 2*margin + extraMargin;
while (1) {
@@ -2934,7 +2934,7 @@ void QPlainTextEditPrivate::_q_gestureTriggered()
QScrollBar *vBar = q->verticalScrollBar();
if (g->state() == Qt::GestureStarted)
originalOffsetY = vBar->value();
- QSize totalOffset = g->totalOffset();
+ QSizeF totalOffset = g->totalOffset();
if (!totalOffset.isNull()) {
if (QApplication::isRightToLeft())
totalOffset.rwidth() *= -1;
diff --git a/src/gui/widgets/qtabbar.cpp b/src/gui/widgets/qtabbar.cpp
index 5166390..531c429 100644
--- a/src/gui/widgets/qtabbar.cpp
+++ b/src/gui/widgets/qtabbar.cpp
@@ -1293,6 +1293,7 @@ QSize QTabBarPrivate::minimumTabSizeHint(int index)
*/
QSize QTabBar::tabSizeHint(int index) const
{
+ //Note: this must match with the computations in QCommonStylePrivate::tabLayout
Q_D(const QTabBar);
if (const QTabBarPrivate::Tab *tab = d->at(index)) {
QStyleOptionTabV3 opt;
@@ -1309,18 +1310,18 @@ QSize QTabBar::tabSizeHint(int index) const
int widgetWidth = 0;
int widgetHeight = 0;
int padding = 0;
- if (opt.leftButtonSize.isValid()) {
- padding += 6 + 2;
+ if (!opt.leftButtonSize.isEmpty()) {
+ padding += 4;
widgetWidth += opt.leftButtonSize.width();
widgetHeight += opt.leftButtonSize.height();
}
- if (opt.rightButtonSize.isValid()) {
- padding += 6 + 2;
+ if (!opt.rightButtonSize.isEmpty()) {
+ padding += 4;
widgetWidth += opt.rightButtonSize.width();
widgetHeight += opt.rightButtonSize.height();
}
- if (opt.iconSize.isValid())
- padding += 2;
+ if (!opt.icon.isNull())
+ padding += 4;
QSize csz;
if (verticalTabs(d->shape)) {
@@ -1836,7 +1837,8 @@ void QTabBarPrivate::moveTabFinished(int index)
}
#endif //QT_NO_ANIMATION
if (allAnimationsFinished && cleanup) {
- movingTab->setVisible(false); // We might not get a mouse release
+ if(movingTab)
+ movingTab->setVisible(false); // We might not get a mouse release
for (int i = 0; i < tabList.count(); ++i) {
tabList[i].dragOffset = 0;
}
diff --git a/src/gui/widgets/qtoolbar.cpp b/src/gui/widgets/qtoolbar.cpp
index bf44ea1..89e6d7a 100644
--- a/src/gui/widgets/qtoolbar.cpp
+++ b/src/gui/widgets/qtoolbar.cpp
@@ -391,7 +391,7 @@ bool QToolBarPrivate::mouseMoveEvent(QMouseEvent *event)
void QToolBarPrivate::unplug(const QRect &_r)
{
Q_Q(QToolBar);
-
+ layout->setExpanded(false, false);
QRect r = _r;
r.moveTopLeft(q->mapToGlobal(QPoint(0, 0)));
setWindowState(true, true, r);
diff --git a/src/gui/widgets/qtoolbarlayout.cpp b/src/gui/widgets/qtoolbarlayout.cpp
index d3c5b4b..1f2ca60 100644
--- a/src/gui/widgets/qtoolbarlayout.cpp
+++ b/src/gui/widgets/qtoolbarlayout.cpp
@@ -642,7 +642,7 @@ QSize QToolBarLayout::expandedSize(const QSize &size) const
return result;
}
-void QToolBarLayout::setExpanded(bool exp)
+void QToolBarLayout::setExpanded(bool exp, bool animated)
{
if (exp == expanded)
return;
@@ -665,7 +665,7 @@ void QToolBarLayout::setExpanded(bool exp)
layoutActions(rect.size());
}
}
- layout->layoutState.toolBarAreaLayout.apply(true);
+ layout->layoutState.toolBarAreaLayout.apply(animated);
}
}
diff --git a/src/gui/widgets/qtoolbarlayout_p.h b/src/gui/widgets/qtoolbarlayout_p.h
index fe81d2f..bb40e215 100644
--- a/src/gui/widgets/qtoolbarlayout_p.h
+++ b/src/gui/widgets/qtoolbarlayout_p.h
@@ -111,8 +111,8 @@ public:
void updateMarginAndSpacing();
bool hasExpandFlag() const;
-public slots:
- void setExpanded(bool b);
+public Q_SLOTS:
+ void setExpanded(bool b, bool animated = true);
private:
QList<QToolBarItem*> items;
diff --git a/src/multimedia/audio/qaudiodeviceinfo_alsa_p.cpp b/src/multimedia/audio/qaudiodeviceinfo_alsa_p.cpp
index f155770..d903f81 100644
--- a/src/multimedia/audio/qaudiodeviceinfo_alsa_p.cpp
+++ b/src/multimedia/audio/qaudiodeviceinfo_alsa_p.cpp
@@ -52,6 +52,8 @@
#include "qaudiodeviceinfo_alsa_p.h"
+QT_BEGIN_NAMESPACE
+
QAudioDeviceInfoPrivate::QAudioDeviceInfoPrivate(QByteArray dev, QAudio::Mode mode)
{
handle = 0;
@@ -391,4 +393,4 @@ QByteArray QAudioDeviceInfoPrivate::defaultOutputDevice()
return QByteArray("default");
}
-
+QT_END_NAMESPACE
diff --git a/src/multimedia/audio/qaudiodeviceinfo_alsa_p.h b/src/multimedia/audio/qaudiodeviceinfo_alsa_p.h
index ca8179f..5f17b71 100644
--- a/src/multimedia/audio/qaudiodeviceinfo_alsa_p.h
+++ b/src/multimedia/audio/qaudiodeviceinfo_alsa_p.h
@@ -65,6 +65,8 @@
#include <QtMultimedia/qaudiodeviceinfo.h>
#include <QtMultimedia/qaudioengine.h>
+QT_BEGIN_NAMESPACE
+
const unsigned int MAX_SAMPLE_RATES = 5;
const unsigned int SAMPLE_RATES[] =
{ 8000, 11025, 22050, 44100, 48000 };
@@ -109,5 +111,7 @@ private:
snd_pcm_hw_params_t *params;
};
+QT_END_NAMESPACE
+
#endif
diff --git a/src/multimedia/audio/qaudiodeviceinfo_win32_p.cpp b/src/multimedia/audio/qaudiodeviceinfo_win32_p.cpp
index 58e7f8b..21b0e9c 100644
--- a/src/multimedia/audio/qaudiodeviceinfo_win32_p.cpp
+++ b/src/multimedia/audio/qaudiodeviceinfo_win32_p.cpp
@@ -55,6 +55,8 @@
#include <mmsystem.h>
#include "qaudiodeviceinfo_win32_p.h"
+QT_BEGIN_NAMESPACE
+
// For mingw toolchain mmsystem.h only defines half the defines, so add if needed.
#ifndef WAVE_FORMAT_44M08
#define WAVE_FORMAT_44M08 0x00000100
@@ -376,3 +378,4 @@ QByteArray QAudioDeviceInfoPrivate::defaultInputDevice()
return QByteArray("default");
}
+QT_END_NAMESPACE
diff --git a/src/multimedia/audio/qaudiodeviceinfo_win32_p.h b/src/multimedia/audio/qaudiodeviceinfo_win32_p.h
index 9e0d1ea..f5f575b 100644
--- a/src/multimedia/audio/qaudiodeviceinfo_win32_p.h
+++ b/src/multimedia/audio/qaudiodeviceinfo_win32_p.h
@@ -63,6 +63,8 @@
#include <QtMultimedia/qaudioengine.h>
+QT_BEGIN_NAMESPACE
+
const unsigned int MAX_SAMPLE_RATES = 5;
const unsigned int SAMPLE_RATES[] = { 8000, 11025, 22050, 44100, 48000 };
@@ -105,4 +107,6 @@ private:
QList<QAudioFormat::SampleType> typez;
};
+QT_END_NAMESPACE
+
#endif
diff --git a/src/multimedia/audio/qaudioinput_alsa_p.cpp b/src/multimedia/audio/qaudioinput_alsa_p.cpp
index 595c9df..0b3d337 100644
--- a/src/multimedia/audio/qaudioinput_alsa_p.cpp
+++ b/src/multimedia/audio/qaudioinput_alsa_p.cpp
@@ -53,6 +53,8 @@
#include <QtCore/qcoreapplication.h>
#include "qaudioinput_alsa_p.h"
+QT_BEGIN_NAMESPACE
+
//#define DEBUG_AUDIO 1
QAudioInputPrivate::QAudioInputPrivate(const QByteArray &device, const QAudioFormat& audioFormat):
@@ -686,3 +688,4 @@ void InputPrivate::trigger()
emit readyRead();
}
+QT_END_NAMESPACE
diff --git a/src/multimedia/audio/qaudioinput_alsa_p.h b/src/multimedia/audio/qaudioinput_alsa_p.h
index 3f7c85e..400157e 100644
--- a/src/multimedia/audio/qaudioinput_alsa_p.h
+++ b/src/multimedia/audio/qaudioinput_alsa_p.h
@@ -67,6 +67,8 @@
#include <QtMultimedia/qaudiodeviceinfo.h>
#include <QtMultimedia/qaudioengine.h>
+QT_BEGIN_NAMESPACE
+
class InputPrivate;
class QAudioInputPrivate : public QAbstractAudioInput
@@ -148,4 +150,6 @@ private:
QAudioInputPrivate *audioDevice;
};
+QT_END_NAMESPACE
+
#endif
diff --git a/src/multimedia/audio/qaudioinput_win32_p.cpp b/src/multimedia/audio/qaudioinput_win32_p.cpp
index 6da80ee..fd6984f 100644
--- a/src/multimedia/audio/qaudioinput_win32_p.cpp
+++ b/src/multimedia/audio/qaudioinput_win32_p.cpp
@@ -53,6 +53,8 @@
#include "qaudioinput_win32_p.h"
+QT_BEGIN_NAMESPACE
+
//#define DEBUG_AUDIO 1
static CRITICAL_SECTION waveInCriticalSection;
@@ -539,3 +541,4 @@ void InputPrivate::trigger()
emit readyRead();
}
+QT_END_NAMESPACE
diff --git a/src/multimedia/audio/qaudioinput_win32_p.h b/src/multimedia/audio/qaudioinput_win32_p.h
index 7f7b823..f14ce96 100644
--- a/src/multimedia/audio/qaudioinput_win32_p.h
+++ b/src/multimedia/audio/qaudioinput_win32_p.h
@@ -68,6 +68,8 @@
#include <QtMultimedia/qaudioengine.h>
+QT_BEGIN_NAMESPACE
+
class QAudioInputPrivate : public QAbstractAudioInput
{
Q_OBJECT
@@ -149,4 +151,6 @@ private:
QAudioInputPrivate *audioDevice;
};
+QT_END_NAMESPACE
+
#endif
diff --git a/src/multimedia/audio/qaudiooutput_alsa_p.cpp b/src/multimedia/audio/qaudiooutput_alsa_p.cpp
index 5997d31..a5ac177 100644
--- a/src/multimedia/audio/qaudiooutput_alsa_p.cpp
+++ b/src/multimedia/audio/qaudiooutput_alsa_p.cpp
@@ -53,6 +53,8 @@
#include <QtCore/qcoreapplication.h>
#include "qaudiooutput_alsa_p.h"
+QT_BEGIN_NAMESPACE
+
//#define DEBUG_AUDIO 1
QAudioOutputPrivate::QAudioOutputPrivate(const QByteArray &device, const QAudioFormat& audioFormat):
@@ -704,3 +706,5 @@ qint64 OutputPrivate::writeData(const char* data, qint64 len)
return written;
}
+
+QT_END_NAMESPACE
diff --git a/src/multimedia/audio/qaudiooutput_alsa_p.h b/src/multimedia/audio/qaudiooutput_alsa_p.h
index 295927b..068428d 100644
--- a/src/multimedia/audio/qaudiooutput_alsa_p.h
+++ b/src/multimedia/audio/qaudiooutput_alsa_p.h
@@ -66,6 +66,8 @@
#include <QtMultimedia/qaudiodeviceinfo.h>
#include <QtMultimedia/qaudioengine.h>
+QT_BEGIN_NAMESPACE
+
class OutputPrivate;
class QAudioOutputPrivate : public QAbstractAudioOutput
@@ -156,4 +158,6 @@ private:
QAudioOutputPrivate *audioDevice;
};
+QT_END_NAMESPACE
+
#endif
diff --git a/src/multimedia/audio/qaudiooutput_win32_p.cpp b/src/multimedia/audio/qaudiooutput_win32_p.cpp
index bace4a6..99229df 100644
--- a/src/multimedia/audio/qaudiooutput_win32_p.cpp
+++ b/src/multimedia/audio/qaudiooutput_win32_p.cpp
@@ -54,6 +54,8 @@
//#define DEBUG_AUDIO 1
+QT_BEGIN_NAMESPACE
+
static CRITICAL_SECTION waveOutCriticalSection;
QAudioOutputPrivate::QAudioOutputPrivate(const QByteArray &device, const QAudioFormat& audioFormat):
@@ -502,3 +504,5 @@ qint64 OutputPrivate::writeData(const char* data, qint64 len)
}
return written;
}
+
+QT_END_NAMESPACE
diff --git a/src/multimedia/audio/qaudiooutput_win32_p.h b/src/multimedia/audio/qaudiooutput_win32_p.h
index c6c025f..3906d9d 100644
--- a/src/multimedia/audio/qaudiooutput_win32_p.h
+++ b/src/multimedia/audio/qaudiooutput_win32_p.h
@@ -67,6 +67,8 @@
#include <QtMultimedia/qaudioengine.h>
+QT_BEGIN_NAMESPACE
+
class QAudioOutputPrivate : public QAbstractAudioOutput
{
Q_OBJECT
@@ -149,4 +151,6 @@ private:
QAudioOutputPrivate *audioDevice;
};
+QT_END_NAMESPACE
+
#endif
diff --git a/src/multimedia/video/qimagevideobuffer.cpp b/src/multimedia/video/qimagevideobuffer.cpp
index d63f145..6af0c41 100644
--- a/src/multimedia/video/qimagevideobuffer.cpp
+++ b/src/multimedia/video/qimagevideobuffer.cpp
@@ -46,6 +46,8 @@
#include <qimage.h>
#include <qvariant.h>
+QT_BEGIN_NAMESPACE
+
class QImageVideoBufferPrivate : public QAbstractVideoBufferPrivate
{
public:
@@ -100,3 +102,5 @@ void QImageVideoBuffer::unmap()
d->mapMode = NotMapped;
}
+
+QT_END_NAMESPACE
diff --git a/src/network/access/qhttpnetworkconnection.cpp b/src/network/access/qhttpnetworkconnection.cpp
index 7b5a6e2..b111bec 100644
--- a/src/network/access/qhttpnetworkconnection.cpp
+++ b/src/network/access/qhttpnetworkconnection.cpp
@@ -65,7 +65,11 @@
QT_BEGIN_NAMESPACE
+#ifdef Q_OS_SYMBIAN
+const int QHttpNetworkConnectionPrivate::defaultChannelCount = 3;
+#else
const int QHttpNetworkConnectionPrivate::defaultChannelCount = 6;
+#endif
// the maximum amount of requests that might be pipelined into a socket
// from what was suggested, 3 seems to be OK
@@ -125,30 +129,6 @@ int QHttpNetworkConnectionPrivate::indexOf(QAbstractSocket *socket) const
return 0;
}
-bool QHttpNetworkConnectionPrivate::isSocketBusy(QAbstractSocket *socket) const
-{
- int i = indexOf(socket);
- return (channels[i].state & QHttpNetworkConnectionChannel::BusyState);
-}
-
-bool QHttpNetworkConnectionPrivate::isSocketWriting(QAbstractSocket *socket) const
-{
- int i = indexOf(socket);
- return (i != -1 && (channels[i].state & QHttpNetworkConnectionChannel::WritingState));
-}
-
-bool QHttpNetworkConnectionPrivate::isSocketWaiting(QAbstractSocket *socket) const
-{
- int i = indexOf(socket);
- return (i != -1 && (channels[i].state & QHttpNetworkConnectionChannel::WaitingState));
-}
-
-bool QHttpNetworkConnectionPrivate::isSocketReading(QAbstractSocket *socket) const
-{
- int i = indexOf(socket);
- return (i != -1 && (channels[i].state & QHttpNetworkConnectionChannel::ReadingState));
-}
-
qint64 QHttpNetworkConnectionPrivate::uncompressedBytesAvailable(const QHttpNetworkReply &reply) const
{
return reply.d_func()->responseData.byteAmount();
@@ -623,7 +603,7 @@ void QHttpNetworkConnectionPrivate::removeReply(QHttpNetworkReply *reply)
for (int i = 0; i < channelCount; ++i) {
if (channels[i].reply == reply) {
channels[i].reply = 0;
- if (reply->d_func()->connectionCloseEnabled())
+ if (reply->d_func()->isConnectionCloseEnabled())
channels[i].close();
QMetaObject::invokeMethod(q, "_q_startNextRequest", Qt::QueuedConnection);
return;
@@ -670,7 +650,7 @@ void QHttpNetworkConnectionPrivate::_q_startNextRequest()
for (int i = 0; i < channelCount; ++i) {
QAbstractSocket *chSocket = channels[i].socket;
// send the request using the idle socket
- if (!isSocketBusy(chSocket)) {
+ if (!channels[i].isSocketBusy()) {
socket = chSocket;
break;
}
diff --git a/src/network/access/qhttpnetworkconnection_p.h b/src/network/access/qhttpnetworkconnection_p.h
index 9d2c13f..92b758e 100644
--- a/src/network/access/qhttpnetworkconnection_p.h
+++ b/src/network/access/qhttpnetworkconnection_p.h
@@ -165,10 +165,6 @@ public:
enum { ChunkSize = 4096 };
int indexOf(QAbstractSocket *socket) const;
- bool isSocketBusy(QAbstractSocket *socket) const;
- bool isSocketWriting(QAbstractSocket *socket) const;
- bool isSocketWaiting(QAbstractSocket *socket) const;
- bool isSocketReading(QAbstractSocket *socket) const;
QHttpNetworkReply *queueRequest(const QHttpNetworkRequest &request);
void requeueRequest(const HttpMessagePair &pair); // e.g. after pipeline broke
diff --git a/src/network/access/qhttpnetworkconnectionchannel.cpp b/src/network/access/qhttpnetworkconnectionchannel.cpp
index 9d78c55..d880f60 100644
--- a/src/network/access/qhttpnetworkconnectionchannel.cpp
+++ b/src/network/access/qhttpnetworkconnectionchannel.cpp
@@ -524,7 +524,7 @@ void QHttpNetworkConnectionChannel::allDone()
handleStatus();
// ### at this point there should be no more data on the socket
// close if server requested
- if (reply->d_func()->connectionCloseEnabled())
+ if (reply->d_func()->isConnectionCloseEnabled())
close();
// queue the finished signal, this is required since we might send new requests from
// slot connected to it. The socket will not fire readyRead signal, if we are already
@@ -539,7 +539,7 @@ void QHttpNetworkConnectionChannel::allDone()
// move next from pipeline to current request
if (!alreadyPipelinedRequests.isEmpty()) {
- if (resendCurrent || reply->d_func()->connectionCloseEnabled() || socket->state() != QAbstractSocket::ConnectedState) {
+ if (resendCurrent || reply->d_func()->isConnectionCloseEnabled() || socket->state() != QAbstractSocket::ConnectedState) {
// move the pipelined ones back to the main queue
requeueCurrentlyPipelinedRequests();
} else {
@@ -584,7 +584,7 @@ void QHttpNetworkConnectionChannel::detectPipeliningSupport()
// check for HTTP/1.1
&& (reply->d_func()->majorVersion == 1 && reply->d_func()->minorVersion == 1)
// check for not having connection close
- && (!reply->d_func()->connectionCloseEnabled())
+ && (!reply->d_func()->isConnectionCloseEnabled())
// check if it is still connected
&& (socket->state() == QAbstractSocket::ConnectedState)
) {
@@ -705,10 +705,30 @@ void QHttpNetworkConnectionChannel::closeAndResendCurrentRequest()
QMetaObject::invokeMethod(connection, "_q_startNextRequest", Qt::QueuedConnection);
}
+bool QHttpNetworkConnectionChannel::isSocketBusy() const
+{
+ return (state & QHttpNetworkConnectionChannel::BusyState);
+}
+
+bool QHttpNetworkConnectionChannel::isSocketWriting() const
+{
+ return (state & QHttpNetworkConnectionChannel::WritingState);
+}
+
+bool QHttpNetworkConnectionChannel::isSocketWaiting() const
+{
+ return (state & QHttpNetworkConnectionChannel::WaitingState);
+}
+
+bool QHttpNetworkConnectionChannel::isSocketReading() const
+{
+ return (state & QHttpNetworkConnectionChannel::ReadingState);
+}
+
//private slots
void QHttpNetworkConnectionChannel::_q_readyRead()
{
- if (connection->d_func()->isSocketWaiting(socket) || connection->d_func()->isSocketReading(socket)) {
+ if (isSocketWaiting() || isSocketReading()) {
state = QHttpNetworkConnectionChannel::ReadingState;
if (reply)
receiveReply();
@@ -719,7 +739,7 @@ void QHttpNetworkConnectionChannel::_q_bytesWritten(qint64 bytes)
{
Q_UNUSED(bytes);
// bytes have been written to the socket. write even more of them :)
- if (connection->d_func()->isSocketWriting(socket))
+ if (isSocketWriting())
sendRequest();
// otherwise we do nothing
}
@@ -727,7 +747,7 @@ void QHttpNetworkConnectionChannel::_q_bytesWritten(qint64 bytes)
void QHttpNetworkConnectionChannel::_q_disconnected()
{
// read the available data before closing
- if (connection->d_func()->isSocketWaiting(socket) || connection->d_func()->isSocketReading(socket)) {
+ if (isSocketWaiting() || isSocketReading()) {
state = QHttpNetworkConnectionChannel::ReadingState;
if (reply)
receiveReply();
diff --git a/src/network/access/qhttpnetworkconnectionchannel_p.h b/src/network/access/qhttpnetworkconnectionchannel_p.h
index 220b72c..687ba47 100644
--- a/src/network/access/qhttpnetworkconnectionchannel_p.h
+++ b/src/network/access/qhttpnetworkconnectionchannel_p.h
@@ -160,6 +160,11 @@ public:
void eatWhitespace();
+ bool isSocketBusy() const;
+ bool isSocketWriting() const;
+ bool isSocketWaiting() const;
+ bool isSocketReading() const;
+
protected slots:
void _q_bytesWritten(qint64 bytes); // proceed sending
void _q_readyRead(); // pending data to read
diff --git a/src/network/access/qhttpnetworkreply.cpp b/src/network/access/qhttpnetworkreply.cpp
index ba429fd..ea2018d 100644
--- a/src/network/access/qhttpnetworkreply.cpp
+++ b/src/network/access/qhttpnetworkreply.cpp
@@ -196,7 +196,8 @@ bool QHttpNetworkReply::isPipeliningUsed() const
QHttpNetworkReplyPrivate::QHttpNetworkReplyPrivate(const QUrl &newUrl)
: QHttpNetworkHeaderPrivate(newUrl), state(NothingDoneState), statusCode(100),
majorVersion(0), minorVersion(0), bodyLength(0), contentRead(0), totalProgress(0),
- chunkedTransferEncoding(0),
+ chunkedTransferEncoding(false),
+ connectionCloseEnabled(true),
currentChunkSize(0), currentChunkRead(0), connection(0), initInflate(false),
autoDecompress(false), responseData(), requestIsPrepared(false)
,pipeliningUsed(false)
@@ -216,6 +217,7 @@ void QHttpNetworkReplyPrivate::clear()
totalProgress = 0;
currentChunkSize = 0;
currentChunkRead = 0;
+ connectionCloseEnabled = true;
connection = 0;
#ifndef QT_NO_COMPRESS
if (initInflate)
@@ -510,6 +512,13 @@ qint64 QHttpNetworkReplyPrivate::readHeader(QAbstractSocket *socket)
// cache isChunked() since it is called often
chunkedTransferEncoding = headerField("transfer-encoding").toLower().contains("chunked");
+
+ // cache isConnectionCloseEnabled since it is called often
+ QByteArray connectionHeaderField = headerField("connection");
+ // check for explicit indication of close or the implicit connection close of HTTP/1.0
+ connectionCloseEnabled = (connectionHeaderField.toLower().contains("close") ||
+ headerField("proxy-connection").toLower().contains("close")) ||
+ (majorVersion == 1 && minorVersion == 0 && connectionHeaderField.isEmpty());
}
return bytes;
}
@@ -553,10 +562,9 @@ bool QHttpNetworkReplyPrivate::isChunked()
return chunkedTransferEncoding;
}
-bool QHttpNetworkReplyPrivate::connectionCloseEnabled()
+bool QHttpNetworkReplyPrivate::isConnectionCloseEnabled()
{
- return (headerField("connection").toLower().contains("close") ||
- headerField("proxy-connection").toLower().contains("close"));
+ return connectionCloseEnabled;
}
// note this function can only be used for non-chunked, non-compressed with
diff --git a/src/network/access/qhttpnetworkreply_p.h b/src/network/access/qhttpnetworkreply_p.h
index 8d4d724..cfc1523 100644
--- a/src/network/access/qhttpnetworkreply_p.h
+++ b/src/network/access/qhttpnetworkreply_p.h
@@ -185,7 +185,7 @@ public:
qint64 bytesAvailable() const;
bool isChunked();
- bool connectionCloseEnabled();
+ bool isConnectionCloseEnabled();
bool isGzipped();
#ifndef QT_NO_COMPRESS
bool gzipCheckHeader(QByteArray &content, int &pos);
@@ -212,6 +212,7 @@ public:
qint64 totalProgress;
QByteArray fragment; // used for header, status, chunk header etc, not for reply data
bool chunkedTransferEncoding;
+ bool connectionCloseEnabled;
qint64 currentChunkSize;
qint64 currentChunkRead;
QPointer<QHttpNetworkConnection> connection;
diff --git a/src/network/access/qnetworkaccesshttpbackend.cpp b/src/network/access/qnetworkaccesshttpbackend.cpp
index 30f16da..faf04da 100644
--- a/src/network/access/qnetworkaccesshttpbackend.cpp
+++ b/src/network/access/qnetworkaccesshttpbackend.cpp
@@ -951,6 +951,12 @@ QNetworkCacheMetaData QNetworkAccessHttpBackend::fetchCacheMetaData(const QNetwo
if (hop_by_hop)
continue;
+ // Do not copy over the Date header because it will be
+ // different for every request and therefore cause a re-write to
+ // the disk when a 304 is received inside replyHeaderChanged()
+ if (header == "date")
+ continue;
+
// Don't store Warning 1xx headers
if (header == "warning") {
QByteArray v = rawHeader(header);
diff --git a/src/network/ssl/qsslsocket.cpp b/src/network/ssl/qsslsocket.cpp
index e9f62b6..94f1006 100644
--- a/src/network/ssl/qsslsocket.cpp
+++ b/src/network/ssl/qsslsocket.cpp
@@ -1297,10 +1297,8 @@ QList<QSslCertificate> QSslSocket::defaultCaCertificates()
}
/*!
- Returns the system default CA certificate database for your
- system. This database is normally found in a standard place for
- your system. If it is not found there, Qt will provide its own
- default CA certificate database. The CA certificate database
+ This function provides a default CA certificate database
+ shipped together with Qt. The CA certificate database
returned by this function is used to initialize the database
returned by defaultCaCertificates(). You can replace that database
with your own with setDefaultCaCertificates().
diff --git a/src/opengl/gl2paintengineex/qgl2pexvertexarray.cpp b/src/opengl/gl2paintengineex/qgl2pexvertexarray.cpp
index 8f9a6a9..425b877 100644
--- a/src/opengl/gl2paintengineex/qgl2pexvertexarray.cpp
+++ b/src/opengl/gl2paintengineex/qgl2pexvertexarray.cpp
@@ -98,7 +98,7 @@ void QGL2PEXVertexArray::addPath(const QVectorPath &path, GLfloat curveInverseSc
case QPainterPath::MoveToElement:
// qDebug("element[%d] is a MoveToElement", i);
vertexArrayStops.append(vertexArray.size());
- vertexArray.add(points[i]); // Add the moveTo as a new vertex
+ lineToArray(points[i].x(), points[i].y()); // Add the moveTo as a new vertex
break;
case QPainterPath::LineToElement:
// qDebug("element[%d] is a LineToElement", i);
diff --git a/src/opengl/gl2paintengineex/qglengineshadermanager_p.h b/src/opengl/gl2paintengineex/qglengineshadermanager_p.h
index d5241a8..ace6b63 100644
--- a/src/opengl/gl2paintengineex/qglengineshadermanager_p.h
+++ b/src/opengl/gl2paintengineex/qglengineshadermanager_p.h
@@ -209,7 +209,7 @@
(QGLCustomShaderStage). The shader will implement a pre-defined method name
which Qt's fragment pipeline will call:
- lowp vec4 customShader(sampler2d src, vec2 srcCoords)
+ lowp vec4 customShader(lowp sampler2d imageTexture, highp vec2 textureCoords)
The provided src and srcCoords parameters can be used to sample from the
source image.
diff --git a/src/opengl/gl2paintengineex/qglengineshadersource_p.h b/src/opengl/gl2paintengineex/qglengineshadersource_p.h
index cf930f3..c8e85ab 100644
--- a/src/opengl/gl2paintengineex/qglengineshadersource_p.h
+++ b/src/opengl/gl2paintengineex/qglengineshadersource_p.h
@@ -73,8 +73,8 @@ static const char* const qglslMainVertexShader = "\
}";
static const char* const qglslMainWithTexCoordsVertexShader = "\
- attribute mediump vec2 textureCoordArray; \
- varying mediump vec2 textureCoords; \
+ attribute highp vec2 textureCoordArray; \
+ varying highp vec2 textureCoords; \
uniform highp float depth;\
void setPosition();\
void main(void) \
@@ -105,9 +105,9 @@ static const char* const qglslPositionWithPatternBrushVertexShader = "\
attribute highp vec4 vertexCoordsArray; \
uniform highp mat4 pmvMatrix; \
uniform mediump vec2 halfViewportSize; \
- uniform mediump vec2 invertedTextureSize; \
- uniform mediump mat3 brushTransform; \
- varying mediump vec2 patternTexCoords; \
+ uniform highp vec2 invertedTextureSize; \
+ uniform highp mat3 brushTransform; \
+ varying highp vec2 patternTexCoords; \
void setPosition(void) { \
gl_Position = pmvMatrix * vertexCoordsArray;\
gl_Position.xy = gl_Position.xy / gl_Position.w; \
@@ -124,9 +124,9 @@ static const char* const qglslAffinePositionWithPatternBrushVertexShader
= qglslPositionWithPatternBrushVertexShader;
static const char* const qglslPatternBrushSrcFragmentShader = "\
- uniform sampler2D brushTexture;\
+ uniform lowp sampler2D brushTexture;\
uniform lowp vec4 patternColor; \
- varying mediump vec2 patternTexCoords;\
+ varying highp vec2 patternTexCoords;\
lowp vec4 srcPixel() { \
return patternColor * (1.0 - texture2D(brushTexture, patternTexCoords).r); \
}\n";
@@ -139,7 +139,7 @@ static const char* const qglslPositionWithLinearGradientBrushVertexShader = "\
uniform mediump vec2 halfViewportSize; \
uniform highp vec3 linearData; \
uniform highp mat3 brushTransform; \
- varying mediump float index ; \
+ varying mediump float index; \
void setPosition() { \
gl_Position = pmvMatrix * vertexCoordsArray;\
gl_Position.xy = gl_Position.xy / gl_Position.w; \
@@ -155,7 +155,7 @@ static const char* const qglslAffinePositionWithLinearGradientBrushVertexShader
= qglslPositionWithLinearGradientBrushVertexShader;
static const char* const qglslLinearGradientBrushSrcFragmentShader = "\
- uniform sampler2D brushTexture; \
+ uniform lowp sampler2D brushTexture; \
varying mediump float index; \
lowp vec4 srcPixel() { \
mediump vec2 val = vec2(index, 0.5); \
@@ -187,7 +187,7 @@ static const char* const qglslAffinePositionWithConicalGradientBrushVertexShader
static const char* const qglslConicalGradientBrushSrcFragmentShader = "\n\
#define INVERSE_2PI 0.1591549430918953358 \n\
- uniform sampler2D brushTexture; \n\
+ uniform lowp sampler2D brushTexture; \n\
uniform mediump float angle; \
varying highp vec2 A; \
lowp vec4 srcPixel() { \
@@ -226,7 +226,7 @@ static const char* const qglslAffinePositionWithRadialGradientBrushVertexShader
= qglslPositionWithRadialGradientBrushVertexShader;
static const char* const qglslRadialGradientBrushSrcFragmentShader = "\
- uniform sampler2D brushTexture; \
+ uniform lowp sampler2D brushTexture; \
uniform highp float fmp2_m_radius2; \
uniform highp float inverse_2_fmp2_m_radius2; \
varying highp float b; \
@@ -243,9 +243,9 @@ static const char* const qglslPositionWithTextureBrushVertexShader = "\
attribute highp vec4 vertexCoordsArray; \
uniform highp mat4 pmvMatrix; \
uniform mediump vec2 halfViewportSize; \
- uniform mediump vec2 invertedTextureSize; \
- uniform mediump mat3 brushTransform; \
- varying mediump vec2 brushTextureCoords; \
+ uniform highp vec2 invertedTextureSize; \
+ uniform highp mat3 brushTransform; \
+ varying highp vec2 brushTextureCoords; \
void setPosition(void) { \
gl_Position = pmvMatrix * vertexCoordsArray;\
gl_Position.xy = gl_Position.xy / gl_Position.w; \
@@ -255,23 +255,22 @@ static const char* const qglslPositionWithTextureBrushVertexShader = "\
gl_Position.xy = gl_Position.xy * invertedHTexCoordsZ; \
gl_Position.w = invertedHTexCoordsZ; \
brushTextureCoords.xy = (hTexCoords.xy * invertedTextureSize) * gl_Position.w; \
- brushTextureCoords.y = -brushTextureCoords.y; \
}";
static const char* const qglslAffinePositionWithTextureBrushVertexShader
= qglslPositionWithTextureBrushVertexShader;
static const char* const qglslTextureBrushSrcFragmentShader = "\
- varying mediump vec2 brushTextureCoords; \
- uniform sampler2D brushTexture; \
+ varying highp vec2 brushTextureCoords; \
+ uniform lowp sampler2D brushTexture; \
lowp vec4 srcPixel() { \
return texture2D(brushTexture, brushTextureCoords); \
}";
static const char* const qglslTextureBrushSrcWithPatternFragmentShader = "\
- varying mediump vec2 brushTextureCoords; \
+ varying highp vec2 brushTextureCoords; \
uniform lowp vec4 patternColor; \
- uniform sampler2D brushTexture; \
+ uniform lowp sampler2D brushTexture; \
lowp vec4 srcPixel() { \
return patternColor * (1.0 - texture2D(brushTexture, brushTextureCoords).r); \
}";
@@ -284,16 +283,16 @@ static const char* const qglslSolidBrushSrcFragmentShader = "\
}";
static const char* const qglslImageSrcFragmentShader = "\
- varying mediump vec2 textureCoords; \
- uniform sampler2D imageTexture; \
+ varying highp vec2 textureCoords; \
+ uniform lowp sampler2D imageTexture; \
lowp vec4 srcPixel() { \
return texture2D(imageTexture, textureCoords); \
}";
static const char* const qglslCustomSrcFragmentShader = "\
varying highp vec2 textureCoords; \
- uniform sampler2D imageTexture; \
- lowp vec4 customShader(sampler2D texture, vec2 coords); \
+ uniform lowp sampler2D imageTexture; \
+ lowp vec4 customShader(lowp sampler2D texture, highp vec2 coords); \
lowp vec4 srcPixel() { \
return customShader(imageTexture, textureCoords); \
}";
@@ -301,14 +300,14 @@ static const char* const qglslCustomSrcFragmentShader = "\
static const char* const qglslImageSrcWithPatternFragmentShader = "\
varying highp vec2 textureCoords; \
uniform lowp vec4 patternColor; \
- uniform sampler2D imageTexture; \
+ uniform lowp sampler2D imageTexture; \
lowp vec4 srcPixel() { \
return patternColor * (1.0 - texture2D(imageTexture, textureCoords).r); \
}\n";
static const char* const qglslNonPremultipliedImageSrcFragmentShader = "\
varying highp vec2 textureCoords; \
- uniform sampler2D imageTexture; \
+ uniform lowp sampler2D imageTexture; \
lowp vec4 srcPixel() { \
lowp vec4 sample = texture2D(imageTexture, textureCoords); \
sample.rgb = sample.rgb * sample.a; \
@@ -383,7 +382,7 @@ static const char* const qglslMainFragmentShader = "\
static const char* const qglslMaskFragmentShader = "\
varying highp vec2 textureCoords;\
- uniform sampler2D maskTexture;\
+ uniform lowp sampler2D maskTexture;\
lowp vec4 applyMask(lowp vec4 src) \
{\
lowp vec4 mask = texture2D(maskTexture, textureCoords); \
diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
index 2901c1e..f2aabd2 100644
--- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
+++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
@@ -219,6 +219,11 @@ void QGLTextureGlyphCache::resizeTextureData(int width, int height)
pex->transferMode(BrushDrawingMode);
+#ifndef QT_OPENGL_ES_2
+ if (pex->inRenderText)
+ glPushAttrib(GL_ENABLE_BIT | GL_VIEWPORT_BIT | GL_SCISSOR_BIT);
+#endif
+
glDisable(GL_DEPTH_TEST);
glDisable(GL_SCISSOR_TEST);
@@ -268,6 +273,11 @@ void QGLTextureGlyphCache::resizeTextureData(int width, int height)
glViewport(0, 0, pex->width, pex->height);
pex->updateDepthScissorTest();
+
+#ifndef QT_OPENGL_ES_2
+ if (pex->inRenderText)
+ glPopAttrib();
+#endif
}
void QGLTextureGlyphCache::fillTexture(const Coord &c, glyph_t glyph)
@@ -376,6 +386,7 @@ void QGL2PaintEngineExPrivate::useSimpleShader()
void QGL2PaintEngineExPrivate::updateBrushTexture()
{
+ Q_Q(QGL2PaintEngineEx);
// qDebug("QGL2PaintEngineExPrivate::updateBrushTexture()");
Qt::BrushStyle style = currentBrush->style();
@@ -384,8 +395,8 @@ void QGL2PaintEngineExPrivate::updateBrushTexture()
QImage texImage = qt_imageForBrush(style, false);
glActiveTexture(GL_TEXTURE0 + QT_BRUSH_TEXTURE_UNIT);
- ctx->d_func()->bindTexture(texImage, GL_TEXTURE_2D, GL_RGBA, true);
- updateTextureFilter(GL_TEXTURE_2D, GL_REPEAT, true);
+ ctx->d_func()->bindTexture(texImage, GL_TEXTURE_2D, GL_RGBA, true, QGLContext::InternalBindOption);
+ updateTextureFilter(GL_TEXTURE_2D, GL_REPEAT, q->state()->renderHints & QPainter::SmoothPixmapTransform);
}
else if (style >= Qt::LinearGradientPattern && style <= Qt::ConicalGradientPattern) {
// Gradiant brush: All the gradiants use the same texture
@@ -400,19 +411,18 @@ void QGL2PaintEngineExPrivate::updateBrushTexture()
glBindTexture(GL_TEXTURE_2D, texId);
if (g->spread() == QGradient::RepeatSpread || g->type() == QGradient::ConicalGradient)
- updateTextureFilter(GL_TEXTURE_2D, GL_REPEAT, true);
+ updateTextureFilter(GL_TEXTURE_2D, GL_REPEAT, q->state()->renderHints & QPainter::SmoothPixmapTransform);
else if (g->spread() == QGradient::ReflectSpread)
- updateTextureFilter(GL_TEXTURE_2D, GL_MIRRORED_REPEAT_IBM, true);
+ updateTextureFilter(GL_TEXTURE_2D, GL_MIRRORED_REPEAT_IBM, q->state()->renderHints & QPainter::SmoothPixmapTransform);
else
- updateTextureFilter(GL_TEXTURE_2D, GL_CLAMP_TO_EDGE, true);
+ updateTextureFilter(GL_TEXTURE_2D, GL_CLAMP_TO_EDGE, q->state()->renderHints & QPainter::SmoothPixmapTransform);
}
else if (style == Qt::TexturePattern) {
const QPixmap& texPixmap = currentBrush->texture();
glActiveTexture(GL_TEXTURE0 + QT_BRUSH_TEXTURE_UNIT);
- // TODO: Support y-inverted pixmaps as brushes
- ctx->d_func()->bindTexture(texPixmap, GL_TEXTURE_2D, GL_RGBA, true);
- updateTextureFilter(GL_TEXTURE_2D, GL_REPEAT, true);
+ ctx->d_func()->bindTexture(texPixmap, GL_TEXTURE_2D, GL_RGBA, QGLContext::InternalBindOption);
+ updateTextureFilter(GL_TEXTURE_2D, GL_REPEAT, q->state()->renderHints & QPainter::SmoothPixmapTransform);
}
brushTextureDirty = false;
}
@@ -667,7 +677,7 @@ void QGL2PaintEngineExPrivate::drawTexture(const QGLRect& dest, const QGLRect& s
GLfloat dx = 1.0 / textureSize.width();
GLfloat dy = 1.0 / textureSize.height();
- QGLRect srcTextureRect(src.left*dx, 1.0 - src.top*dy, src.right*dx, 1.0 - src.bottom*dy);
+ QGLRect srcTextureRect(src.left*dx, src.top*dy, src.right*dx, src.bottom*dy);
setCoords(staticVertexCoordinateArray, dest);
setCoords(staticTextureCoordinateArray, srcTextureRect);
@@ -675,7 +685,7 @@ void QGL2PaintEngineExPrivate::drawTexture(const QGLRect& dest, const QGLRect& s
glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
}
-void QGL2PaintEngineEx::sync()
+void QGL2PaintEngineEx::beginNativePainting()
{
Q_D(QGL2PaintEngineEx);
ensureActive();
@@ -709,15 +719,25 @@ void QGL2PaintEngineEx::sync()
#endif
d->lastTexture = GLuint(-1);
+ d->resetGLState();
+ d->needsSync = true;
+}
+
+void QGL2PaintEngineExPrivate::resetGLState()
+{
glDisable(GL_BLEND);
glActiveTexture(GL_TEXTURE0);
-
glDisable(GL_DEPTH_TEST);
+ glDisable(GL_SCISSOR_TEST);
glDepthFunc(GL_LESS);
glDepthMask(true);
glClearDepth(1);
+}
+void QGL2PaintEngineEx::endNativePainting()
+{
+ Q_D(QGL2PaintEngineEx);
d->needsSync = true;
}
@@ -826,6 +846,11 @@ void QGL2PaintEngineExPrivate::fill(const QVectorPath& path)
glEnable(GL_STENCIL_TEST);
prepareForDraw(currentBrush->isOpaque());
+
+#ifndef QT_OPENGL_ES_2
+ if (inRenderText)
+ shaderManager->currentProgram()->setUniformValue(location(QGLEngineShaderManager::Depth), zValueForRenderText());
+#endif
composite(vertexCoordinateArray.boundingRect());
glDisable(GL_STENCIL_TEST);
@@ -863,9 +888,21 @@ void QGL2PaintEngineExPrivate::fillStencilWithVertexArray(QGL2PEXVertexArray& ve
glEnable(GL_STENCIL_TEST); // For some reason, this has to happen _after_ the simple shader is use()'d
glDisable(GL_BLEND);
+#ifndef QT_OPENGL_ES_2
+ if (inRenderText) {
+ glPushAttrib(GL_ENABLE_BIT);
+ glDisable(GL_DEPTH_TEST);
+ }
+#endif
+
// Draw the vertecies into the stencil buffer:
drawVertexArrays(vertexArray, GL_TRIANGLE_FAN);
+#ifndef QT_OPENGL_ES_2
+ if (inRenderText)
+ glPopAttrib();
+#endif
+
// Enable color writes & disable stencil writes
glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
}
@@ -971,9 +1008,19 @@ void QGL2PaintEngineExPrivate::drawVertexArrays(QGL2PEXVertexArray& vertexArray,
glDisableVertexAttribArray(QT_VERTEX_COORDS_ATTR);
}
-
-
-
+float QGL2PaintEngineExPrivate::zValueForRenderText() const
+{
+#ifndef QT_OPENGL_ES_2
+ // Get the z translation value from the model view matrix and
+ // transform it using the ortogonal projection with z-near = 0,
+ // and z-far = 1, which is used in QGLWidget::renderText()
+ GLdouble model[4][4];
+ glGetDoublev(GL_MODELVIEW_MATRIX, &model[0][0]);
+ return -2 * model[3][2] - 1;
+#else
+ return 0;
+#endif
+}
/////////////////////////////////// Public Methods //////////////////////////////////////////
@@ -992,8 +1039,8 @@ void QGL2PaintEngineEx::fill(const QVectorPath &path, const QBrush &brush)
if (brush.style() == Qt::NoBrush)
return;
-
- ensureActive();
+ if (!d->inRenderText)
+ ensureActive();
d->setBrush(&brush);
d->fill(path);
d->setBrush(&(state()->brush)); // reset back to the state's brush
@@ -1074,6 +1121,7 @@ void QGL2PaintEngineEx::renderHintsChanged()
Q_D(QGL2PaintEngineEx);
d->lastTexture = GLuint(-1);
+ d->brushTextureDirty = true;
// qDebug("QGL2PaintEngineEx::renderHintsChanged() not implemented!");
}
@@ -1092,16 +1140,19 @@ void QGL2PaintEngineEx::drawPixmap(const QRectF& dest, const QPixmap & pixmap, c
QGLContext *ctx = d->ctx;
glActiveTexture(GL_TEXTURE0 + QT_IMAGE_TEXTURE_UNIT);
- QGLTexture *texture = ctx->d_func()->bindTexture(pixmap, GL_TEXTURE_2D, GL_RGBA, true, true);
+ QGLTexture *texture =
+ ctx->d_func()->bindTexture(pixmap, GL_TEXTURE_2D, GL_RGBA,
+ QGLContext::InternalBindOption
+ | QGLContext::CanFlipNativePixmapBindOption);
- GLfloat top = texture->yInverted ? (pixmap.height() - src.top()) : src.top();
- GLfloat bottom = texture->yInverted ? (pixmap.height() - src.bottom()) : src.bottom();
+ GLfloat top = texture->options & QGLContext::InvertedYBindOption ? (pixmap.height() - src.top()) : src.top();
+ GLfloat bottom = texture->options & QGLContext::InvertedYBindOption ? (pixmap.height() - src.bottom()) : src.bottom();
QGLRect srcRect(src.left(), top, src.right(), bottom);
bool isBitmap = pixmap.isQBitmap();
bool isOpaque = !isBitmap && !pixmap.hasAlphaChannel();
- d->updateTextureFilter(GL_TEXTURE_2D, GL_REPEAT,
+ d->updateTextureFilter(GL_TEXTURE_2D, GL_CLAMP_TO_EDGE,
state()->renderHints & QPainter::SmoothPixmapTransform, texture->id);
d->drawTexture(dest, srcRect, pixmap.size(), isOpaque, isBitmap);
}
@@ -1115,10 +1166,10 @@ void QGL2PaintEngineEx::drawImage(const QRectF& dest, const QImage& image, const
QGLContext *ctx = d->ctx;
glActiveTexture(GL_TEXTURE0 + QT_IMAGE_TEXTURE_UNIT);
- QGLTexture *texture = ctx->d_func()->bindTexture(image, GL_TEXTURE_2D, GL_RGBA, true);
+ QGLTexture *texture = ctx->d_func()->bindTexture(image, GL_TEXTURE_2D, GL_RGBA, QGLContext::InternalBindOption);
GLuint id = texture->id;
- d->updateTextureFilter(GL_TEXTURE_2D, GL_REPEAT,
+ d->updateTextureFilter(GL_TEXTURE_2D, GL_CLAMP_TO_EDGE,
state()->renderHints & QPainter::SmoothPixmapTransform, id);
d->drawTexture(dest, src, image.size(), !image.hasAlphaChannel());
}
@@ -1133,7 +1184,7 @@ void QGL2PaintEngineEx::drawTexture(const QRectF &dest, GLuint textureId, const
glActiveTexture(GL_TEXTURE0 + QT_IMAGE_TEXTURE_UNIT);
glBindTexture(GL_TEXTURE_2D, textureId);
- d->updateTextureFilter(GL_TEXTURE_2D, GL_REPEAT,
+ d->updateTextureFilter(GL_TEXTURE_2D, GL_CLAMP_TO_EDGE,
state()->renderHints & QPainter::SmoothPixmapTransform, textureId);
d->drawTexture(dest, src, size, false);
}
@@ -1142,7 +1193,8 @@ void QGL2PaintEngineEx::drawTextItem(const QPointF &p, const QTextItem &textItem
{
Q_D(QGL2PaintEngineEx);
- ensureActive();
+ if (!d->inRenderText)
+ ensureActive();
QOpenGL2PaintEngineState *s = state();
const QTextItemInt &ti = static_cast<const QTextItemInt &>(textItem);
@@ -1191,6 +1243,8 @@ void QGL2PaintEngineExPrivate::drawCachedGlyphs(const QPointF &p, const QTextIte
if (cache->width() == 0 || cache->height() == 0)
return;
+ if (inRenderText)
+ transferMode(BrushDrawingMode);
transferMode(TextDrawingMode);
if (glyphType == QFontEngineGlyphCache::Raster_A8)
@@ -1229,6 +1283,11 @@ void QGL2PaintEngineExPrivate::drawCachedGlyphs(const QPointF &p, const QTextIte
prepareForDraw(false); // Text always causes src pixels to be transparent
+#ifndef QT_OPENGL_ES_2
+ if (inRenderText)
+ shaderManager->currentProgram()->setUniformValue(location(QGLEngineShaderManager::Depth), zValueForRenderText());
+#endif
+
shaderManager->currentProgram()->setUniformValue(location(QGLEngineShaderManager::MaskTexture), QT_MASK_TEXTURE_UNIT);
if (vertexCoordinateArray.data() != oldVertexCoordinateDataPtr)
@@ -1274,12 +1333,6 @@ bool QGL2PaintEngineEx::begin(QPaintDevice *pdev)
glViewport(0, 0, d->width, d->height);
-// glClearColor(0.0, 1.0, 0.0, 1.0);
-// glClear(GL_COLOR_BUFFER_BIT);
-// d->ctx->swapBuffers();
-// qDebug("You should see green now");
-// sleep(5);
-
d->brushTextureDirty = true;
d->brushUniformsDirty = true;
d->matrixDirty = true;
@@ -1292,10 +1345,12 @@ bool QGL2PaintEngineEx::begin(QPaintDevice *pdev)
d->use_system_clip = !systemClip().isEmpty();
- glDisable(GL_DEPTH_TEST);
- glDisable(GL_SCISSOR_TEST);
- glDepthFunc(GL_LEQUAL);
- glDepthMask(false);
+ if (!d->inRenderText) {
+ glDisable(GL_DEPTH_TEST);
+ glDisable(GL_SCISSOR_TEST);
+ glDepthFunc(GL_LEQUAL);
+ glDepthMask(false);
+ }
#if !defined(QT_OPENGL_ES_2)
glDisable(GL_MULTISAMPLE);
@@ -1356,6 +1411,8 @@ bool QGL2PaintEngineEx::end()
d->drawable.doneCurrent();
d->ctx->d_ptr->active_engine = 0;
+ d->resetGLState();
+
return false;
}
@@ -1499,7 +1556,7 @@ void QGL2PaintEngineEx::clip(const QVectorPath &path, Qt::ClipOperation op)
if (op == Qt::ReplaceClip && !d->hasClipOperations())
op = Qt::IntersectClip;
- if (!path.isEmpty() && op == Qt::IntersectClip && (path.hints() & QVectorPath::RectangleHint)) {
+ if (!path.isEmpty() && op == Qt::IntersectClip && (path.shape() == QVectorPath::RectangleHint)) {
const QPointF* const points = reinterpret_cast<const QPointF*>(path.points());
QRectF rect(points[0], points[2]);
@@ -1598,7 +1655,11 @@ void QGL2PaintEngineExPrivate::regenerateDepthClip()
void QGL2PaintEngineExPrivate::systemStateChanged()
{
Q_Q(QGL2PaintEngineEx);
- use_system_clip = !systemClip.isEmpty();
+
+ if (q->paintDevice()->devType() == QInternal::Widget)
+ use_system_clip = false;
+ else
+ use_system_clip = !systemClip.isEmpty();
glDisable(GL_DEPTH_TEST);
q->state()->depthTestEnabled = false;
@@ -1714,6 +1775,12 @@ QPainterState *QGL2PaintEngineEx::createState(QPainterState *orig) const
return s;
}
+void QGL2PaintEngineEx::setRenderTextActive(bool active)
+{
+ Q_D(QGL2PaintEngineEx);
+ d->inRenderText = active;
+}
+
QOpenGL2PaintEngineState::QOpenGL2PaintEngineState(QOpenGL2PaintEngineState &other)
: QPainterState(other)
{
diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h b/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h
index 7b734e3..68447bc 100644
--- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h
+++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h
@@ -133,12 +133,16 @@ public:
inline const QOpenGL2PaintEngineState *state() const {
return static_cast<const QOpenGL2PaintEngineState *>(QPaintEngineEx::state());
}
- virtual void sync();
+
+ void beginNativePainting();
+ void endNativePainting();
const QGLContext* context();
QPixmapFilter *createPixmapFilter(int type) const;
+ void setRenderTextActive(bool);
+
private:
Q_DISABLE_COPY(QGL2PaintEngineEx)
};
@@ -154,7 +158,8 @@ public:
ctx(0),
currentBrush(0),
inverseScale(1),
- shaderManager(0)
+ shaderManager(0),
+ inRenderText(false)
{ }
~QGL2PaintEngineExPrivate();
@@ -168,6 +173,7 @@ public:
void setBrush(const QBrush* brush);
void transferMode(EngineMode newMode);
+ void resetGLState();
// fill, drawOutline, drawTexture & drawCachedGlyphs are the rendering entry points:
void fill(const QVectorPath &path);
@@ -188,6 +194,8 @@ public:
inline void useSimpleShader();
inline QColor premultiplyColor(QColor c, GLfloat opacity);
+ float zValueForRenderText() const;
+
QGL2PaintEngineEx* q;
QGLDrawable drawable;
int width, height;
@@ -237,6 +245,7 @@ public:
GLuint lastTexture;
bool needsSync;
+ bool inRenderText;
};
QT_END_NAMESPACE
diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp
index 57ef70c..f3265b4 100644
--- a/src/opengl/qgl.cpp
+++ b/src/opengl/qgl.cpp
@@ -1443,7 +1443,7 @@ bool QGLTextureCache::remove(QGLContext* ctx, GLuint textureId)
for (int i = 0; i < keys.size(); ++i) {
QGLTexture *tex = m_cache.object(keys.at(i));
if (tex->id == textureId && tex->context == ctx) {
- tex->clean = true; // forces a glDeleteTextures() call
+ tex->options |= QGLContext::MemoryManagedBindOption; // forces a glDeleteTextures() call
m_cache.remove(keys.at(i));
return true;
}
@@ -1479,7 +1479,7 @@ void QGLTextureCache::imageCleanupHook(qint64 cacheKey)
if (qApp->thread() != QThread::currentThread())
return;
QGLTexture *texture = instance()->getTexture(cacheKey);
- if (texture && texture->clean)
+ if (texture && texture->options & QGLContext::MemoryManagedBindOption)
instance()->remove(cacheKey);
}
@@ -1490,7 +1490,7 @@ void QGLTextureCache::pixmapCleanupHook(QPixmap* pixmap)
if (qApp->thread() == QThread::currentThread()) {
const qint64 cacheKey = pixmap->cacheKey();
QGLTexture *texture = instance()->getTexture(cacheKey);
- if (texture && texture->clean)
+ if (texture && texture->options & QGLContext::MemoryManagedBindOption)
instance()->remove(cacheKey);
}
#if defined(Q_WS_X11)
@@ -1578,6 +1578,45 @@ Q_OPENGL_EXPORT QGLShareRegister* qgl_share_reg()
Please note that QGLContext is not thread safe.
*/
+/*!
+ \enum QGLContext::BindOption
+ A set of options to decide how to bind a texture using bindTexture().
+
+ \value NoBindOption Don't do anything, pass the texture straight
+ thru.
+
+ \value InvertedYBindOption Specifies that the texture should be flipped
+ over the X axis so that the texture coordinate 0,0 corresponds to
+ the top left corner. Inverting the texture implies a deep copy
+ prior to upload.
+
+ \value MipmapBindOption Specifies that bindTexture should try
+ to generate mipmaps. If the GL implementation supports the \c
+ GL_SGIS_generate_mipmap extension, mipmaps will be automatically
+ generated for the texture. Mipmap generation is only supported for
+ the \c GL_TEXTURE_2D target.
+
+ \value PremultipliedAlphaBindOption Specifies that the image should be
+ uploaded with premultiplied alpha and does a conversion accordingly.
+
+ \value LinearFilteringBindOption Specifies that the texture filtering
+ should be set to GL_LINEAR. Default is GL_NEAREST. If mipmap is
+ also enabled, filtering will be set to GL_LINEAR_MIPMAP_LINEAR.
+
+ \value DefaultBindOption In Qt 4.5 and earlier, bindTexture()
+ would mirror the image and automatically generate mipmaps. This
+ option helps preserve this default behavior.
+
+ \omitvalue CanFlipNativePixmapBindOption Used by x11 from pixmap to choose
+ wether or not it can bind the pixmap upside down or not.
+
+ \omitvalue MemoryManagedBindOption Used by paint engines to
+ indicate that the pixmap should be memory managed along side with
+ the pixmap/image that it stems from, e.g. installing destruction
+ hooks in them.
+
+ \omitvalue InternalBindOption
+*/
/*!
\obsolete
@@ -1633,7 +1672,6 @@ QGLContext::QGLContext(const QGLFormat &format)
QGLContext::~QGLContext()
{
- Q_D(QGLContext);
// remove any textures cached in this context
QGLTextureCache::instance()->removeContextTextures(this);
QGLTextureCache::deleteIfEmpty(); // ### thread safety
@@ -1880,7 +1918,8 @@ QImage QGLContextPrivate::convertToGLFormat(const QImage &image, bool force_prem
}
/*! \internal */
-QGLTexture *QGLContextPrivate::bindTexture(const QImage &image, GLenum target, GLint format, bool clean)
+QGLTexture *QGLContextPrivate::bindTexture(const QImage &image, GLenum target, GLint format,
+ QGLContext::BindOptions options)
{
const qint64 key = image.cacheKey();
QGLTexture *texture = textureCacheLookup(key, target);
@@ -1890,7 +1929,7 @@ QGLTexture *QGLContextPrivate::bindTexture(const QImage &image, GLenum target, G
}
if (!texture)
- texture = bindTexture(image, target, format, key, clean);
+ texture = bindTexture(image, target, format, key, options);
// NOTE: bindTexture(const QImage&, GLenum, GLint, const qint64, bool) should never return null
Q_ASSERT(texture);
@@ -1900,68 +1939,128 @@ QGLTexture *QGLContextPrivate::bindTexture(const QImage &image, GLenum target, G
return texture;
}
+// #define QGL_BIND_TEXTURE_DEBUG
+
QGLTexture* QGLContextPrivate::bindTexture(const QImage &image, GLenum target, GLint format,
- const qint64 key, bool clean)
+ const qint64 key, QGLContext::BindOptions options)
{
Q_Q(QGLContext);
- QGLContext *ctx = q;
-
- // the GL_BGRA format is only present in GL version >= 1.2
- GLenum texture_format = (QGLFormat::openGLVersionFlags() & QGLFormat::OpenGL_Version_1_2)
- ? GL_BGRA : GL_RGBA;
+#ifdef QGL_BIND_TEXTURE_DEBUG
+ printf("QGLContextPrivate::bindTexture(), imageSize=(%d,%d), format=%x, options=%x\n",
+ image.width(), image.height(), format, int(options));
+#endif
// Scale the pixmap if needed. GL textures needs to have the
// dimensions 2^n+2(border) x 2^m+2(border), unless we're using GL
// 2.0 or use the GL_TEXTURE_RECTANGLE texture target
int tx_w = qt_next_power_of_two(image.width());
int tx_h = qt_next_power_of_two(image.height());
- bool scale = false;
QImage img = image;
if (( !(QGLFormat::openGLVersionFlags() & QGLFormat::OpenGL_Version_2_0) &&
!(QGLFormat::openGLVersionFlags() & QGLFormat::OpenGL_ES_Version_2_0) )
&& (target == GL_TEXTURE_2D && (tx_w != image.width() || tx_h != image.height())))
{
- scale = true;
+ img = img.scaled(tx_w, tx_h);
+#ifdef QGL_BIND_TEXTURE_DEBUG
+ printf(" - upscaled to %dx%d\n", tx_w, tx_h);
+#endif
}
+ GLuint filtering = options & QGLContext::LinearFilteringBindOption ? GL_LINEAR : GL_NEAREST;
+
GLuint tx_id;
glGenTextures(1, &tx_id);
glBindTexture(target, tx_id);
- glTexParameterf(target, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
+ glTexParameterf(target, GL_TEXTURE_MAG_FILTER, filtering);
+
if (glFormat.directRendering()
&& QGLExtensions::glExtensions & QGLExtensions::GenerateMipmap
- && target == GL_TEXTURE_2D && !clean)
+ && target == GL_TEXTURE_2D
+ && options & QGLContext::MipmapBindOption)
{
+#ifdef QGL_BIND_TEXTURE_DEBUG
+ printf(" - generating mipmaps\n");
+#endif
glHint(GL_GENERATE_MIPMAP_HINT_SGIS, GL_NICEST);
#ifndef QT_OPENGL_ES
glTexParameteri(target, GL_GENERATE_MIPMAP_SGIS, GL_TRUE);
#else
glTexParameterf(target, GL_GENERATE_MIPMAP_SGIS, GL_TRUE);
#endif
- glTexParameterf(target, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
+ glTexParameterf(target, GL_TEXTURE_MIN_FILTER, options & QGLContext::LinearFilteringBindOption
+ ? GL_LINEAR_MIPMAP_LINEAR : GL_NEAREST_MIPMAP_NEAREST);
} else {
- glTexParameterf(target, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
+ glTexParameterf(target, GL_TEXTURE_MIN_FILTER, filtering);
}
QImage::Format target_format = img.format();
- // Note: the clean param is only true when a texture is bound
- // from the QOpenGLPaintEngine - in that case we have to force
- // a premultiplied texture format
- if (clean || img.format() != QImage::Format_ARGB32)
- target_format = QImage::Format_ARGB32_Premultiplied;
- if (img.format() != target_format)
- img = img.convertToFormat(target_format);
+ bool premul = options & QGLContext::PremultipliedAlphaBindOption;
+ GLenum texture_format = QGLFormat::openGLVersionFlags() & QGLFormat::OpenGL_Version_1_2
+ ? GL_BGRA : GL_RGBA;
+ GLuint pixel_type = GL_UNSIGNED_BYTE;
+
+ switch (target_format) {
+ case QImage::Format_ARGB32:
+ if (premul) {
+ img = img.convertToFormat(target_format = QImage::Format_ARGB32_Premultiplied);
+#ifdef QGL_BIND_TEXTURE_DEBUG
+ printf(" - converting ARGB32 -> ARGB32_Premultiplied \n");
+#endif
+ }
+ break;
+ case QImage::Format_ARGB32_Premultiplied:
+ if (!premul) {
+ img = img.convertToFormat(target_format = QImage::Format_ARGB32);
+#ifdef QGL_BIND_TEXTURE_DEBUG
+ printf(" - converting ARGB32_Premultiplied -> ARGB32\n");
+#endif
+ }
+ break;
+ case QImage::Format_RGB16:
+ pixel_type = GL_UNSIGNED_SHORT_5_6_5;
+ texture_format = GL_RGB;
+ break;
+ case QImage::Format_RGB32:
+ if (format == GL_RGBA)
+ format = GL_RGB;
+ break;
+
+ default:
+ if (img.hasAlphaChannel()) {
+ img = img.convertToFormat(premul
+ ? QImage::Format_ARGB32_Premultiplied
+ : QImage::Format_ARGB32);
+#ifdef QGL_BIND_TEXTURE_DEBUG
+ printf(" - converting to 32-bit alpha format\n");
+#endif
+ } else {
+ img = img.convertToFormat(QImage::Format_RGB32);
+#ifdef QGL_BIND_TEXTURE_DEBUG
+ printf(" - converting to 32-bit\n");
+#endif
+ }
+ }
- QImage tx(scale ? QSize(tx_w, tx_h) : img.size(), target_format);
- convertToGLFormatHelper(tx, img, texture_format);
- glTexImage2D(target, 0, format, tx.width(), tx.height(), 0, texture_format,
- GL_UNSIGNED_BYTE, tx.bits());
+ if (options & QGLContext::InvertedYBindOption) {
+ int ipl = img.bytesPerLine() / 4;
+ int h = img.height();
+ for (int y=0; y<h/2; ++y) {
+ int *a = (int *) img.scanLine(y);
+ int *b = (int *) img.scanLine(h - y - 1);
+ for (int x=0; x<ipl; ++x)
+ qSwap(a[x], b[x]);
+ }
+ }
+
+ const QImage &constRef = img; // to avoid detach in bits()...
+ glTexImage2D(target, 0, format, img.width(), img.height(), 0, texture_format,
+ pixel_type, constRef.bits());
// this assumes the size of a texture is always smaller than the max cache size
int cost = img.width()*img.height()*4/1024;
- QGLTexture *texture = new QGLTexture(q, tx_id, target, clean, false);
+ QGLTexture *texture = new QGLTexture(q, tx_id, target, options);
QGLTextureCache::instance()->insert(q, key, texture, cost);
return texture;
}
@@ -1980,7 +2079,7 @@ QGLTexture *QGLContextPrivate::textureCacheLookup(const qint64 key, GLenum targe
/*! \internal */
-QGLTexture *QGLContextPrivate::bindTexture(const QPixmap &pixmap, GLenum target, GLint format, bool clean, bool canInvert)
+QGLTexture *QGLContextPrivate::bindTexture(const QPixmap &pixmap, GLenum target, GLint format, QGLContext::BindOptions options)
{
Q_Q(QGLContext);
QPixmapData *pd = pixmap.pixmapData();
@@ -2005,9 +2104,9 @@ QGLTexture *QGLContextPrivate::bindTexture(const QPixmap &pixmap, GLenum target,
#if defined(Q_WS_X11)
// Try to use texture_from_pixmap
if (pd->classId() == QPixmapData::X11Class) {
- texture = bindTextureFromNativePixmap(pd, key, canInvert);
+ texture = bindTextureFromNativePixmap(pd, key, options);
if (texture) {
- texture->clean = clean;
+ texture->options |= QGLContext::MemoryManagedBindOption;
texture->boundPixmap = pd;
boundPixmaps.insert(pd, QPixmap(pixmap));
}
@@ -2015,7 +2114,7 @@ QGLTexture *QGLContextPrivate::bindTexture(const QPixmap &pixmap, GLenum target,
#endif
if (!texture)
- texture = bindTexture(pixmap.toImage(), target, format, key, clean);
+ texture = bindTexture(pixmap.toImage(), target, format, key, options);
// NOTE: bindTexture(const QImage&, GLenum, GLint, const qint64, bool) should never return null
Q_ASSERT(texture);
@@ -2061,6 +2160,20 @@ int QGLContextPrivate::maxTextureSize()
}
/*!
+ Generates and binds a 2D GL texture to the current context, based
+ on \a image. The generated texture id is returned and can be used in
+ later \c glBindTexture() calls.
+
+ \overload
+*/
+GLuint QGLContext::bindTexture(const QImage &image, GLenum target, GLint format)
+{
+ Q_D(QGLContext);
+ QGLTexture *texture = d->bindTexture(image, target, format, false, DefaultBindOption);
+ return texture->id;
+}
+
+/*!
Generates and binds a 2D GL texture to the current context, based
on \a image. The generated texture id is returned and can be used
in later \c glBindTexture() calls.
@@ -2069,12 +2182,10 @@ int QGLContextPrivate::maxTextureSize()
target is \c GL_TEXTURE_2D.
The \a format parameter sets the internal format for the
- texture. The default format is \c GL_RGBA8.
+ texture. The default format is \c GL_RGBA.
- If the GL implementation supports the \c GL_SGIS_generate_mipmap
- extension, mipmaps will be automatically generated for the
- texture. Mipmap generation is only supported for the \c
- GL_TEXTURE_2D target.
+ The binding \a options are a set of options used to decide how to
+ bind the texture to the context.
The texture that is generated is cached, so multiple calls to
bindTexture() with the same QImage will return the same texture
@@ -2085,10 +2196,10 @@ int QGLContextPrivate::maxTextureSize()
\sa deleteTexture()
*/
-GLuint QGLContext::bindTexture(const QImage &image, GLenum target, GLint format)
+GLuint QGLContext::bindTexture(const QImage &image, GLenum target, GLint format, BindOptions options)
{
Q_D(QGLContext);
- QGLTexture *texture = d->bindTexture(image, target, format, false);
+ QGLTexture *texture = d->bindTexture(image, target, format, false, options);
return texture->id;
}
@@ -2097,7 +2208,16 @@ GLuint QGLContext::bindTexture(const QImage &image, GLenum target, GLint format)
GLuint QGLContext::bindTexture(const QImage &image, QMacCompatGLenum target, QMacCompatGLint format)
{
Q_D(QGLContext);
- QGLTexture *texture = d->bindTexture(image, GLenum(target), GLint(format), false);
+ QGLTexture *texture = d->bindTexture(image, GLenum(target), GLint(format), false, DefaultBindOption);
+ return texture->id;
+}
+
+/*! \internal */
+GLuint QGLContext::bindTexture(const QImage &image, QMacCompatGLenum target, QMacCompatGLint format,
+ BindOptions options)
+{
+ Q_D(QGLContext);
+ QGLTexture *texture = d->bindTexture(image, GLenum(target), GLint(format), false, options);
return texture->id;
}
#endif
@@ -2109,7 +2229,20 @@ GLuint QGLContext::bindTexture(const QImage &image, QMacCompatGLenum target, QMa
GLuint QGLContext::bindTexture(const QPixmap &pixmap, GLenum target, GLint format)
{
Q_D(QGLContext);
- QGLTexture *texture = d->bindTexture(pixmap, target, format, false, false);
+ QGLTexture *texture = d->bindTexture(pixmap, target, format, DefaultBindOption);
+ return texture->id;
+}
+
+/*!
+ \overload
+
+ Generates and binds a 2D GL texture to the current context, based
+ on \a pixmap.
+*/
+GLuint QGLContext::bindTexture(const QPixmap &pixmap, GLenum target, GLint format, BindOptions options)
+{
+ Q_D(QGLContext);
+ QGLTexture *texture = d->bindTexture(pixmap, target, format, options);
return texture->id;
}
@@ -2118,7 +2251,15 @@ GLuint QGLContext::bindTexture(const QPixmap &pixmap, GLenum target, GLint forma
GLuint QGLContext::bindTexture(const QPixmap &pixmap, QMacCompatGLenum target, QMacCompatGLint format)
{
Q_D(QGLContext);
- QGLTexture *texture = d->bindTexture(pixmap, GLenum(target), GLint(format), false, false);
+ QGLTexture *texture = d->bindTexture(pixmap, GLenum(target), GLint(format), DefaultBindOption);
+ return texture->id;
+}
+/*! \internal */
+GLuint QGLContext::bindTexture(const QPixmap &pixmap, QMacCompatGLenum target, QMacCompatGLint format,
+ BindOptions options)
+{
+ Q_D(QGLContext);
+ QGLTexture *texture = d->bindTexture(pixmap, GLenum(target), GLint(format), options);
return texture->id;
}
#endif
@@ -3937,6 +4078,10 @@ void QGLWidget::renderText(int x, int y, const QString &str, const QFont &font,
bool auto_swap = autoBufferSwap();
QPaintEngine *engine = paintEngine();
+#ifndef QT_OPENGL_ES
+ if (engine->type() == QPaintEngine::OpenGL2)
+ static_cast<QGL2PaintEngineEx *>(engine)->setRenderTextActive(true);
+#endif
QPainter *p;
bool reuse_painter = false;
if (engine->isActive()) {
@@ -3962,6 +4107,13 @@ void QGLWidget::renderText(int x, int y, const QString &str, const QFont &font,
setAutoBufferSwap(false);
// disable glClear() as a result of QPainter::begin()
d->glcx->d_func()->clear_on_painter_begin = false;
+ if (engine->type() == QPaintEngine::OpenGL2) {
+ qt_save_gl_state();
+#ifndef QT_OPENGL_ES_2
+ glMatrixMode(GL_MODELVIEW);
+ glLoadIdentity();
+#endif
+ }
p = new QPainter(this);
}
@@ -3985,7 +4137,13 @@ void QGLWidget::renderText(int x, int y, const QString &str, const QFont &font,
delete p;
setAutoBufferSwap(auto_swap);
d->glcx->d_func()->clear_on_painter_begin = true;
+ if (engine->type() == QPaintEngine::OpenGL2)
+ qt_restore_gl_state();
}
+#ifndef QT_OPENGL_ES
+ if (engine->type() == QPaintEngine::OpenGL2)
+ static_cast<QGL2PaintEngineEx *>(engine)->setRenderTextActive(false);
+#endif
}
/*! \overload
@@ -4018,6 +4176,10 @@ void QGLWidget::renderText(double x, double y, double z, const QString &str, con
win_y = height - win_y; // y is inverted
QPaintEngine *engine = paintEngine();
+#ifndef QT_OPENGL_ES
+ if (engine->type() == QPaintEngine::OpenGL2)
+ static_cast<QGL2PaintEngineEx *>(engine)->setRenderTextActive(true);
+#endif
QPainter *p;
bool reuse_painter = false;
#ifndef QT_OPENGL_ES
@@ -4036,6 +4198,8 @@ void QGLWidget::renderText(double x, double y, double z, const QString &str, con
setAutoBufferSwap(false);
// disable glClear() as a result of QPainter::begin()
d->glcx->d_func()->clear_on_painter_begin = false;
+ if (engine->type() == QPaintEngine::OpenGL2)
+ qt_save_gl_state();
p = new QPainter(this);
}
@@ -4074,9 +4238,15 @@ void QGLWidget::renderText(double x, double y, double z, const QString &str, con
} else {
p->end();
delete p;
+ if (engine->type() == QPaintEngine::OpenGL2)
+ qt_restore_gl_state();
setAutoBufferSwap(auto_swap);
d->glcx->d_func()->clear_on_painter_begin = true;
}
+#ifndef QT_OPENGL_ES
+ if (engine->type() == QPaintEngine::OpenGL2)
+ static_cast<QGL2PaintEngineEx *>(engine)->setRenderTextActive(false);
+#endif
}
QGLFormat QGLWidget::format() const
@@ -4118,15 +4288,35 @@ bool QGLWidget::autoBufferSwap() const
GLuint QGLWidget::bindTexture(const QImage &image, GLenum target, GLint format)
{
Q_D(QGLWidget);
- return d->glcx->bindTexture(image, target, format);
+ return d->glcx->bindTexture(image, target, format, QGLContext::DefaultBindOption);
+}
+
+/*!
+ \overload
+
+ The binding \a options are a set of options used to decide how to
+ bind the texture to the context.
+ */
+GLuint QGLWidget::bindTexture(const QImage &image, GLenum target, GLint format, QGLContext::BindOptions options)
+{
+ Q_D(QGLWidget);
+ return d->glcx->bindTexture(image, target, format, options);
}
+
#ifdef Q_MAC_COMPAT_GL_FUNCTIONS
/*! \internal */
GLuint QGLWidget::bindTexture(const QImage &image, QMacCompatGLenum target, QMacCompatGLint format)
{
Q_D(QGLWidget);
- return d->glcx->bindTexture(image, GLenum(target), GLint(format));
+ return d->glcx->bindTexture(image, GLenum(target), GLint(format), QGLContext::DefaultBindOption);
+}
+
+GLuint QGLWidget::bindTexture(const QImage &image, QMacCompatGLenum target, QMacCompatGLint format,
+ QGLContext::BindOptions options)
+{
+ Q_D(QGLWidget);
+ return d->glcx->bindTexture(image, GLenum(target), GLint(format), options);
}
#endif
@@ -4139,7 +4329,23 @@ GLuint QGLWidget::bindTexture(const QImage &image, QMacCompatGLenum target, QMac
GLuint QGLWidget::bindTexture(const QPixmap &pixmap, GLenum target, GLint format)
{
Q_D(QGLWidget);
- return d->glcx->bindTexture(pixmap, target, format);
+ return d->glcx->bindTexture(pixmap, target, format, QGLContext::DefaultBindOption);
+}
+
+/*!
+ \overload
+
+ Generates and binds a 2D GL texture to the current context, based
+ on \a pixmap. The generated texture id is returned and can be used in
+
+ The binding \a options are a set of options used to decide how to
+ bind the texture to the context.
+ */
+GLuint QGLWidget::bindTexture(const QPixmap &pixmap, GLenum target, GLint format,
+ QGLContext::BindOptions options)
+{
+ Q_D(QGLWidget);
+ return d->glcx->bindTexture(pixmap, target, format, options);
}
#ifdef Q_MAC_COMPAT_GL_FUNCTIONS
@@ -4147,7 +4353,14 @@ GLuint QGLWidget::bindTexture(const QPixmap &pixmap, GLenum target, GLint format
GLuint QGLWidget::bindTexture(const QPixmap &pixmap, QMacCompatGLenum target, QMacCompatGLint format)
{
Q_D(QGLWidget);
- return d->glcx->bindTexture(pixmap, target, format);
+ return d->glcx->bindTexture(pixmap, target, format, QGLContext::DefaultBindOption);
+}
+
+GLuint QGLWidget::bindTexture(const QPixmap &pixmap, QMacCompatGLenum target, QMacCompatGLint format,
+ QGLContext::BindOptions options)
+{
+ Q_D(QGLWidget);
+ return d->glcx->bindTexture(pixmap, target, format, options);
}
#endif
@@ -4264,10 +4477,10 @@ QPaintEngine *QGLWidget::paintEngine() const
#elif defined(QT_OPENGL_ES_2)
return qt_gl_2_engine();
#else
- if (!qt_gl_preferGL2Engine())
- return qt_gl_engine();
- else
+ if (qt_gl_preferGL2Engine())
return qt_gl_2_engine();
+ else
+ return qt_gl_engine();
#endif
}
@@ -4568,34 +4781,37 @@ QGLFormat QGLDrawable::format() const
return QGLFormat();
}
-GLuint QGLDrawable::bindTexture(const QImage &image, GLenum target, GLint format)
+GLuint QGLDrawable::bindTexture(const QImage &image, GLenum target, GLint format,
+ QGLContext::BindOptions options)
{
QGLTexture *texture = 0;
+ options |= QGLContext::MemoryManagedBindOption;
if (widget)
- texture = widget->d_func()->glcx->d_func()->bindTexture(image, target, format, true);
+ texture = widget->d_func()->glcx->d_func()->bindTexture(image, target, format, options);
else if (buffer)
- texture = buffer->d_func()->qctx->d_func()->bindTexture(image, target, format, true);
+ texture = buffer->d_func()->qctx->d_func()->bindTexture(image, target, format, options);
else if (fbo && QGLContext::currentContext())
- texture = const_cast<QGLContext *>(QGLContext::currentContext())->d_func()->bindTexture(image, target, format, true);
+ texture = const_cast<QGLContext *>(QGLContext::currentContext())->d_func()->bindTexture(image, target, format, options);
#if defined(Q_WS_QWS) || (!defined(QT_OPENGL_ES_1) && !defined(QT_OPENGL_ES_1_CL))
else if (wsurf)
- texture = wsurf->context()->d_func()->bindTexture(image, target, format, true);
+ texture = wsurf->context()->d_func()->bindTexture(image, target, format, options);
#endif
return texture->id;
}
-GLuint QGLDrawable::bindTexture(const QPixmap &pixmap, GLenum target, GLint format)
+GLuint QGLDrawable::bindTexture(const QPixmap &pixmap, GLenum target, GLint format,
+ QGLContext::BindOptions options)
{
QGLTexture *texture = 0;
if (widget)
- texture = widget->d_func()->glcx->d_func()->bindTexture(pixmap, target, format, true, true);
+ texture = widget->d_func()->glcx->d_func()->bindTexture(pixmap, target, format, options);
else if (buffer)
- texture = buffer->d_func()->qctx->d_func()->bindTexture(pixmap, target, format, true, true);
+ texture = buffer->d_func()->qctx->d_func()->bindTexture(pixmap, target, format, options);
else if (fbo && QGLContext::currentContext())
- texture = const_cast<QGLContext *>(QGLContext::currentContext())->d_func()->bindTexture(pixmap, target, format, true, true);
+ texture = const_cast<QGLContext *>(QGLContext::currentContext())->d_func()->bindTexture(pixmap, target, format, options);
#if defined(Q_WS_QWS) || (!defined(QT_OPENGL_ES_1) && !defined(QT_OPENGL_ES_1_CL))
else if (wsurf)
- texture = wsurf->context()->d_func()->bindTexture(pixmap, target, format, true, true);
+ texture = wsurf->context()->d_func()->bindTexture(pixmap, target, format, options);
#endif
return texture->id;
}
diff --git a/src/opengl/qgl.h b/src/opengl/qgl.h
index 678bbb7..96a8b08 100644
--- a/src/opengl/qgl.h
+++ b/src/opengl/qgl.h
@@ -288,6 +288,29 @@ public:
virtual void swapBuffers() const;
+ enum BindOption {
+ NoBindOption = 0x0000,
+ InvertedYBindOption = 0x0001,
+ MipmapBindOption = 0x0002,
+ PremultipliedAlphaBindOption = 0x0004,
+ LinearFilteringBindOption = 0x0008,
+
+ MemoryManagedBindOption = 0x0010, // internal flag
+ CanFlipNativePixmapBindOption = 0x0020, // internal flag
+
+ DefaultBindOption = LinearFilteringBindOption
+ | InvertedYBindOption
+ | MipmapBindOption,
+ InternalBindOption = MemoryManagedBindOption
+ | PremultipliedAlphaBindOption
+ };
+ Q_DECLARE_FLAGS(BindOptions, BindOption)
+
+ GLuint bindTexture(const QImage &image, GLenum target, GLint format,
+ BindOptions options);
+ GLuint bindTexture(const QPixmap &pixmap, GLenum target, GLint format,
+ BindOptions options);
+
GLuint bindTexture(const QImage &image, GLenum target = GL_TEXTURE_2D,
GLint format = GL_RGBA);
GLuint bindTexture(const QPixmap &pixmap, GLenum target = GL_TEXTURE_2D,
@@ -304,6 +327,10 @@ public:
QMacCompatGLint format = GL_RGBA);
GLuint bindTexture(const QPixmap &pixmap, QMacCompatGLenum = GL_TEXTURE_2D,
QMacCompatGLint format = GL_RGBA);
+ GLuint bindTexture(const QImage &image, QMacCompatGLenum, QMacCompatGLint format,
+ BindOptions);
+ GLuint bindTexture(const QPixmap &pixmap, QMacCompatGLenum, QMacCompatGLint format,
+ BindOptions);
void deleteTexture(QMacCompatGLuint tx_id);
@@ -384,6 +411,7 @@ private:
Q_DISABLE_COPY(QGLContext)
};
+Q_DECLARE_OPERATORS_FOR_FLAGS(QGLContext::BindOptions);
class Q_OPENGL_EXPORT QGLWidget : public QWidget
{
@@ -446,10 +474,16 @@ public:
const QFont & fnt = QFont(), int listBase = 2000);
QPaintEngine *paintEngine() const;
+ GLuint bindTexture(const QImage &image, GLenum target, GLint format,
+ QGLContext::BindOptions options);
+ GLuint bindTexture(const QPixmap &pixmap, GLenum target, GLint format,
+ QGLContext::BindOptions options);
+
GLuint bindTexture(const QImage &image, GLenum target = GL_TEXTURE_2D,
GLint format = GL_RGBA);
GLuint bindTexture(const QPixmap &pixmap, GLenum target = GL_TEXTURE_2D,
GLint format = GL_RGBA);
+
GLuint bindTexture(const QString &fileName);
void deleteTexture(GLuint tx_id);
@@ -462,6 +496,10 @@ public:
QMacCompatGLint format = GL_RGBA);
GLuint bindTexture(const QPixmap &pixmap, QMacCompatGLenum = GL_TEXTURE_2D,
QMacCompatGLint format = GL_RGBA);
+ GLuint bindTexture(const QImage &image, QMacCompatGLenum, QMacCompatGLint format,
+ QGLContext::BindOptions);
+ GLuint bindTexture(const QPixmap &pixmap, QMacCompatGLenum, QMacCompatGLint format,
+ QGLContext::BindOptions);
void deleteTexture(QMacCompatGLuint tx_id);
diff --git a/src/opengl/qgl_p.h b/src/opengl/qgl_p.h
index ab040ed..6905199 100644
--- a/src/opengl/qgl_p.h
+++ b/src/opengl/qgl_p.h
@@ -208,10 +208,12 @@ class QGLContextPrivate
public:
explicit QGLContextPrivate(QGLContext *context) : internal_context(false), q_ptr(context) {groupResources = new QGLContextGroupResources;}
~QGLContextPrivate() {if (!groupResources->refs.deref()) delete groupResources;}
- QGLTexture *bindTexture(const QImage &image, GLenum target, GLint format, bool clean);
+ QGLTexture *bindTexture(const QImage &image, GLenum target, GLint format,
+ QGLContext::BindOptions options);
QGLTexture *bindTexture(const QImage &image, GLenum target, GLint format, const qint64 key,
- bool clean = false);
- QGLTexture *bindTexture(const QPixmap &pixmap, GLenum target, GLint format, bool clean, bool canInvert = false);
+ QGLContext::BindOptions options);
+ QGLTexture *bindTexture(const QPixmap &pixmap, GLenum target, GLint format,
+ QGLContext::BindOptions options);
QGLTexture *textureCacheLookup(const qint64 key, GLenum target);
void init(QPaintDevice *dev, const QGLFormat &format);
QImage convertToGLFormat(const QImage &image, bool force_premul, GLenum texture_format);
@@ -241,7 +243,8 @@ public:
quint32 gpm;
int screen;
QHash<QPixmapData*, QPixmap> boundPixmaps;
- QGLTexture *bindTextureFromNativePixmap(QPixmapData*, const qint64 key, bool canInvert);
+ QGLTexture *bindTextureFromNativePixmap(QPixmapData*, const qint64 key,
+ QGLContext::BindOptions options);
static void destroyGlSurfaceForPixmap(QPixmapData*);
static void unbindPixmapFromTexture(QPixmapData*);
#endif
@@ -319,8 +322,10 @@ public:
void doneCurrent();
QSize size() const;
QGLFormat format() const;
- GLuint bindTexture(const QImage &image, GLenum target = GL_TEXTURE_2D, GLint format = GL_RGBA);
- GLuint bindTexture(const QPixmap &pixmap, GLenum target = GL_TEXTURE_2D, GLint format = GL_RGBA);
+ GLuint bindTexture(const QImage &image, GLenum target = GL_TEXTURE_2D, GLint format = GL_RGBA,
+ QGLContext::BindOptions = QGLContext::InternalBindOption);
+ GLuint bindTexture(const QPixmap &pixmap, GLenum target = GL_TEXTURE_2D, GLint format = GL_RGBA,
+ QGLContext::BindOptions = QGLContext::InternalBindOption);
QColor backgroundColor() const;
QGLContext *context() const;
bool autoFillBackground() const;
@@ -404,15 +409,18 @@ extern Q_OPENGL_EXPORT QGLShareRegister* qgl_share_reg();
class QGLTexture {
public:
QGLTexture(QGLContext *ctx = 0, GLuint tx_id = 0, GLenum tx_target = GL_TEXTURE_2D,
- bool _clean = false, bool _yInverted = false)
- : context(ctx), id(tx_id), target(tx_target), clean(_clean), yInverted(_yInverted)
+ QGLContext::BindOptions opt = QGLContext::DefaultBindOption)
+ : context(ctx),
+ id(tx_id),
+ target(tx_target),
+ options(opt)
#if defined(Q_WS_X11)
- , boundPixmap(0)
+ , boundPixmap(0)
#endif
{}
~QGLTexture() {
- if (clean) {
+ if (options & QGLContext::MemoryManagedBindOption) {
QGLContext *current = const_cast<QGLContext *>(QGLContext::currentContext());
QGLContext *ctx = const_cast<QGLContext *>(context);
Q_ASSERT(ctx);
@@ -436,8 +444,9 @@ public:
QGLContext *context;
GLuint id;
GLenum target;
- bool clean;
- bool yInverted; // NOTE: Y-Inverted textures are for internal use only!
+
+ QGLContext::BindOptions options;
+
#if defined(Q_WS_X11)
QPixmapData* boundPixmap;
#endif
diff --git a/src/opengl/qgl_x11.cpp b/src/opengl/qgl_x11.cpp
index dccdf63..a34ea37 100644
--- a/src/opengl/qgl_x11.cpp
+++ b/src/opengl/qgl_x11.cpp
@@ -1599,7 +1599,8 @@ bool qt_resolveTextureFromPixmap()
#endif //defined(GLX_VERSION_1_3) && !defined(Q_OS_HPUX)
-QGLTexture *QGLContextPrivate::bindTextureFromNativePixmap(QPixmapData *pmd, const qint64 key, bool canInvert)
+QGLTexture *QGLContextPrivate::bindTextureFromNativePixmap(QPixmapData *pmd, const qint64 key,
+ QGLContext::BindOptions options)
{
#if !defined(GLX_VERSION_1_3) || defined(Q_OS_HPUX)
return 0;
@@ -1632,7 +1633,7 @@ QGLTexture *QGLContextPrivate::bindTextureFromNativePixmap(QPixmapData *pmd, con
GLX_DRAWABLE_TYPE, GLX_PIXMAP_BIT,
GLX_BIND_TO_TEXTURE_TARGETS_EXT, GLX_TEXTURE_2D_BIT_EXT,
// QGLContext::bindTexture() can't return an inverted texture, but QPainter::drawPixmap() can:
- GLX_Y_INVERTED_EXT, canInvert ? GLX_DONT_CARE : False,
+ GLX_Y_INVERTED_EXT, options & QGLContext::CanFlipNativePixmapBindOption ? GLX_DONT_CARE : False,
XNone
};
configList = glXChooseFBConfig(x11Info.display(), x11Info.screen(), configAttribs, &configCount);
@@ -1693,9 +1694,11 @@ QGLTexture *QGLContextPrivate::bindTextureFromNativePixmap(QPixmapData *pmd, con
glBindTexture(GL_TEXTURE_2D, textureId);
- QGLTexture *texture = new QGLTexture(q, textureId, GL_TEXTURE_2D, canInvert, false);
- texture->yInverted = (hasAlpha && RGBAConfigInverted) || (!hasAlpha && RGBConfigInverted);
- if (texture->yInverted)
+ if (!((hasAlpha && RGBAConfigInverted) || (!hasAlpha && RGBConfigInverted)))
+ options &= ~QGLContext::InvertedYBindOption;
+
+ QGLTexture *texture = new QGLTexture(q, textureId, GL_TEXTURE_2D, options);
+ if (texture->options & QGLContext::InvertedYBindOption)
pixmapData->flags |= QX11PixmapData::InvertedWhenBoundToTexture;
// We assume the cost of bound pixmaps is zero
diff --git a/src/opengl/qgl_x11egl.cpp b/src/opengl/qgl_x11egl.cpp
index b982a19..f40cdc9 100644
--- a/src/opengl/qgl_x11egl.cpp
+++ b/src/opengl/qgl_x11egl.cpp
@@ -490,12 +490,13 @@ void QGLWidgetPrivate::recreateEglSurface(bool force)
}
-QGLTexture *QGLContextPrivate::bindTextureFromNativePixmap(QPixmapData* pd, const qint64 key, bool canInvert)
+QGLTexture *QGLContextPrivate::bindTextureFromNativePixmap(QPixmapData* pd, const qint64 key,
+ QGLContext::BindOptions options)
{
Q_Q(QGLContext);
// The EGL texture_from_pixmap has no facility to invert the y coordinate
- if (!canInvert)
+ if (!(options & QGLContext::CanFlipNativePixmapBindOption))
return 0;
Q_ASSERT(pd->classId() == QPixmapData::X11Class);
@@ -623,7 +624,10 @@ QGLTexture *QGLContextPrivate::bindTextureFromNativePixmap(QPixmapData* pd, cons
return 0;
}
- QGLTexture *texture = new QGLTexture(q, textureId, GL_TEXTURE_2D, canInvert, true);
+ // Always inverted because the opposite is not supported...
+ options |= QGLContext::InvertedYBindOption;
+
+ QGLTexture *texture = new QGLTexture(q, textureId, GL_TEXTURE_2D, options);
pixmapData->flags |= QX11PixmapData::InvertedWhenBoundToTexture;
// We assume the cost of bound pixmaps is zero
diff --git a/src/opengl/qglextensions_p.h b/src/opengl/qglextensions_p.h
index b03fdfa..a5f83a5 100644
--- a/src/opengl/qglextensions_p.h
+++ b/src/opengl/qglextensions_p.h
@@ -410,6 +410,14 @@ struct QGLExtensionFuncs
#define GL_BGRA 0x80E1
#endif
+#ifndef GL_RGB16
+#define GL_RGB16 32852
+#endif
+
+#ifndef GL_UNSIGNED_SHORT_5_6_5
+#define GL_UNSIGNED_SHORT_5_6_5 33635
+#endif
+
#ifndef GL_MULTISAMPLE
#define GL_MULTISAMPLE 0x809D
#endif
diff --git a/src/opengl/qglframebufferobject.cpp b/src/opengl/qglframebufferobject.cpp
index 52363cb..2b38e3d 100644
--- a/src/opengl/qglframebufferobject.cpp
+++ b/src/opengl/qglframebufferobject.cpp
@@ -516,12 +516,12 @@ void QGLFramebufferObjectPrivate::init(const QSize &sz, QGLFramebufferObject::At
framebuffer objects more portable.
\endlist
+ When using a QPainter to paint to a QGLFramebufferObject you should take
+ care that the QGLFramebufferObject is created with the CombinedDepthStencil
+ attachment for QPainter to be able to render correctly.
Note that you need to create a QGLFramebufferObject with more than one
sample per pixel for primitives to be antialiased when drawing using a
- QPainter, unless if the QPainter::HighQualityAntialiasing render hint is
- set. The QPainter::HighQualityAntialiasing render hint will enable
- antialiasing as long as the \c{GL_ARB_fragment_program} extension is
- present. To create a multisample framebuffer object you should use one of
+ QPainter. To create a multisample framebuffer object you should use one of
the constructors that take a QGLFramebufferObject parameter, and set the
QGLFramebufferObject::samples() property to a non-zero value.
@@ -896,7 +896,7 @@ QPaintEngine *QGLFramebufferObject::paintEngine() const
return qt_buffer_2_engine();
#else
Q_D(const QGLFramebufferObject);
- if (d->ctx->d_func()->internal_context || qt_gl_preferGL2Engine())
+ if (qt_gl_preferGL2Engine())
return qt_buffer_2_engine();
else
return qt_buffer_engine();
diff --git a/src/opengl/qglpixmapfilter.cpp b/src/opengl/qglpixmapfilter.cpp
index e1ee61a..0913606 100644
--- a/src/opengl/qglpixmapfilter.cpp
+++ b/src/opengl/qglpixmapfilter.cpp
@@ -60,7 +60,7 @@ QT_BEGIN_NAMESPACE
void QGLPixmapFilterBase::bindTexture(const QPixmap &src) const
{
- const_cast<QGLContext *>(QGLContext::currentContext())->d_func()->bindTexture(src, GL_TEXTURE_2D, GL_RGBA, true, false);
+ const_cast<QGLContext *>(QGLContext::currentContext())->d_func()->bindTexture(src, GL_TEXTURE_2D, GL_RGBA, QGLContext::BindOptions(QGLContext::DefaultBindOption | QGLContext::MemoryManagedBindOption));
}
void QGLPixmapFilterBase::drawImpl(QPainter *painter, const QPointF &pos, const QPixmap &src, const QRectF& source) const
@@ -338,7 +338,6 @@ bool QGLPixmapBlurFilter::processGL(QPainter *painter, const QPointF &pos, const
QGL2PaintEngineEx *engine = static_cast<QGL2PaintEngineEx *>(painter->paintEngine());
- engine->syncState();
painter->save();
// ensure GL_LINEAR filtering is used
@@ -418,7 +417,7 @@ QByteArray QGLPixmapBlurFilter::generateBlurShader(int radius, bool gaussianBlur
source.append("uniform highp vec4 clip;\n");
}
- source.append("lowp vec4 customShader(sampler2D src, vec2 srcCoords) {\n");
+ source.append("lowp vec4 customShader(lowp sampler2D src, highp vec2 srcCoords) {\n");
QVector<qreal> sampleOffsets;
QVector<qreal> weights;
diff --git a/src/opengl/qglshaderprogram.cpp b/src/opengl/qglshaderprogram.cpp
index f8bffd3..b07fb3b 100644
--- a/src/opengl/qglshaderprogram.cpp
+++ b/src/opengl/qglshaderprogram.cpp
@@ -104,7 +104,7 @@ QT_BEGIN_NAMESPACE
on desktop systems. The programmer should restrict themselves
to just features that are present in GLSL/ES, and avoid
standard variable names that only work on the desktop.
-
+
\section1 Simple shader example
\code
@@ -199,8 +199,11 @@ QT_BEGIN_NAMESPACE
\value VertexShader Vertex shader written in the OpenGL Shading Language (GLSL).
\value FragmentShader Fragment shader written in the OpenGL Shading Language (GLSL).
+
\value PartialVertexShader Partial vertex shader that will be concatenated with all other partial vertex shaders at link time.
\value PartialFragmentShader Partial fragment shader that will be concatenated with all other partial fragment shaders at link time.
+
+ \omitvalue PartialShader
*/
#ifndef GL_FRAGMENT_SHADER
@@ -251,8 +254,7 @@ public:
, shader(0)
, shaderType(type)
, compiled(false)
- , isPartial(type == QGLShader::PartialVertexShader ||
- type == QGLShader::PartialFragmentShader)
+ , isPartial((type & QGLShader::PartialShader) != 0)
, hasPartialSource(false)
{
}
@@ -348,31 +350,6 @@ QGLShader::QGLShader(QGLShader::ShaderType type, QObject *parent)
}
/*!
- Constructs a new QGLShader object from the source code in \a fileName
- and attaches it to \a parent. If the filename ends in \c{.fsh},
- it is assumed to be a fragment shader, otherwise it is assumed to
- be a vertex shader (normally the extension is \c{.vsh} for vertex shaders).
- If the shader could not be loaded, then isCompiled() will return false.
-
- The shader will be associated with the current QGLContext.
-
- \sa isCompiled()
-*/
-QGLShader::QGLShader(const QString& fileName, QObject *parent)
- : QObject(parent)
-{
- if (fileName.endsWith(QLatin1String(".fsh"), Qt::CaseInsensitive))
- d = new QGLShaderPrivate(QGLShader::FragmentShader, QGLContext::currentContext());
- else
- d = new QGLShaderPrivate(QGLShader::VertexShader, QGLContext::currentContext());
- if (d->create() && !compileFile(fileName)) {
- if (d->shader)
- glDeleteShader(d->shader);
- d->shader = 0;
- }
-}
-
-/*!
Constructs a new QGLShader object of the specified \a type from the
source code in \a fileName and attaches it to \a parent.
If the shader could not be loaded, then isCompiled() will return false.
@@ -413,31 +390,6 @@ QGLShader::QGLShader(QGLShader::ShaderType type, const QGLContext *context, QObj
}
/*!
- Constructs a new QGLShader object from the source code in \a fileName
- and attaches it to \a parent. If the filename ends in \c{.fsh},
- it is assumed to be a fragment shader, otherwise it is assumed to
- be a vertex shader (normally the extension is \c{.vsh} for vertex shaders).
- If the shader could not be loaded, then isCompiled() will return false.
-
- The shader will be associated with \a context.
-
- \sa isCompiled()
-*/
-QGLShader::QGLShader(const QString& fileName, const QGLContext *context, QObject *parent)
- : QObject(parent)
-{
- if (fileName.endsWith(QLatin1String(".fsh"), Qt::CaseInsensitive))
- d = new QGLShaderPrivate(QGLShader::FragmentShader, context);
- else
- d = new QGLShaderPrivate(QGLShader::VertexShader, context);
- if (d->create() && !compileFile(fileName)) {
- if (d->shader)
- glDeleteShader(d->shader);
- d->shader = 0;
- }
-}
-
-/*!
Constructs a new QGLShader object of the specified \a type from the
source code in \a fileName and attaches it to \a parent.
If the shader could not be loaded, then isCompiled() will return false.
@@ -489,6 +441,16 @@ static const char qualifierDefines[] =
"#define highp\n";
#endif
+// The "highp" qualifier doesn't exist in fragment shaders
+// on all ES platforms. When it doesn't exist, use "mediump".
+#ifdef QT_OPENGL_ES
+#define QGL_REDEFINE_HIGHP 1
+static const char redefineHighp[] =
+ "#ifndef GL_FRAGMENT_PRECISION_HIGH\n"
+ "#define highp mediump\n"
+ "#endif\n";
+#endif
+
/*!
Sets the \a source code for this shader and compiles it.
Returns true if the source was successfully compiled, false otherwise.
@@ -511,6 +473,11 @@ bool QGLShader::compile(const char *source)
#ifdef QGL_DEFINE_QUALIFIERS
src.append(qualifierDefines);
#endif
+#ifdef QGL_REDEFINE_HIGHP
+ if (d->shaderType == FragmentShader ||
+ d->shaderType == PartialFragmentShader)
+ src.append(redefineHighp);
+#endif
src.append(source);
glShaderSource(d->shader, src.size(), src.data(), 0);
return d->compile(this);
@@ -917,6 +884,33 @@ bool QGLShaderProgram::addShader(QGLShader::ShaderType type, const QString& sour
}
/*!
+ Compiles the contents of \a fileName as a shader of the specified
+ \a type and adds it to this shader program. Returns true if
+ compilation was successful, false otherwise. The compilation errors
+ and warnings will be made available via log().
+
+ This function is intended to be a short-cut for quickly
+ adding vertex and fragment shaders to a shader program without
+ creating an instance of QGLShader first.
+
+ \sa addShader()
+*/
+bool QGLShaderProgram::addShaderFromFile
+ (QGLShader::ShaderType type, const QString& fileName)
+{
+ if (!init())
+ return false;
+ QGLShader *shader = new QGLShader(type, this);
+ if (!shader->compileFile(fileName)) {
+ d->log = shader->log();
+ delete shader;
+ return false;
+ }
+ d->anonShaders.append(shader);
+ return addShader(shader);
+}
+
+/*!
Removes \a shader from this shader program. The object is not deleted.
\sa addShader(), link(), removeAllShaders()
@@ -2983,6 +2977,7 @@ bool QGLShaderProgram::hasShaderPrograms(const QGLContext *context)
#endif
}
+
#endif
QT_END_NAMESPACE
diff --git a/src/opengl/qglshaderprogram.h b/src/opengl/qglshaderprogram.h
index c5295eb..d747679 100644
--- a/src/opengl/qglshaderprogram.h
+++ b/src/opengl/qglshaderprogram.h
@@ -63,19 +63,21 @@ class Q_OPENGL_EXPORT QGLShader : public QObject
{
Q_OBJECT
public:
- enum ShaderType
+ enum ShaderTypeBits
{
- VertexShader,
- FragmentShader,
- PartialVertexShader,
- PartialFragmentShader
+ VertexShader = 0x0001,
+ FragmentShader = 0x0002,
+
+ PartialShader = 0x1000,
+
+ PartialVertexShader = PartialShader | VertexShader,
+ PartialFragmentShader = PartialShader | FragmentShader
};
+ Q_DECLARE_FLAGS(ShaderType, ShaderTypeBits)
explicit QGLShader(QGLShader::ShaderType type, QObject *parent = 0);
- explicit QGLShader(const QString& fileName, QObject *parent = 0);
QGLShader(const QString& fileName, QGLShader::ShaderType type, QObject *parent = 0);
QGLShader(QGLShader::ShaderType type, const QGLContext *context, QObject *parent = 0);
- QGLShader(const QString& fileName, const QGLContext *context, QObject *parent = 0);
QGLShader(const QString& fileName, QGLShader::ShaderType type, const QGLContext *context, QObject *parent = 0);
virtual ~QGLShader();
@@ -106,6 +108,9 @@ private:
Q_DISABLE_COPY(QGLShader)
};
+Q_DECLARE_OPERATORS_FOR_FLAGS(QGLShader::ShaderType)
+
+
class QGLShaderProgramPrivate;
class Q_OPENGL_EXPORT QGLShaderProgram : public QObject
@@ -123,6 +128,7 @@ public:
bool addShader(QGLShader::ShaderType type, const char *source);
bool addShader(QGLShader::ShaderType type, const QByteArray& source);
bool addShader(QGLShader::ShaderType type, const QString& source);
+ bool addShaderFromFile(QGLShader::ShaderType type, const QString& fileName);
void removeAllShaders();
diff --git a/src/opengl/qgraphicsshadereffect.cpp b/src/opengl/qgraphicsshadereffect.cpp
index d3f52f6..293413c 100644
--- a/src/opengl/qgraphicsshadereffect.cpp
+++ b/src/opengl/qgraphicsshadereffect.cpp
@@ -51,8 +51,6 @@
QT_BEGIN_NAMESPACE
-#if !defined(QT_NO_GRAPHICSVIEW) || (QT_EDITION & QT_MODULE_GRAPHICSVIEW) != QT_MODULE_GRAPHICSVIEW
-
/*!
\class QGraphicsShaderEffect
\brief The QGraphicsShaderEffect class is the base class for creating
@@ -64,7 +62,7 @@ QT_BEGIN_NAMESPACE
The specific effect is defined by a fragment of GLSL source code
supplied to setPixelShaderFragment(). This source code must define a
function with the signature
- \c{lowp vec4 customShader(sampler2D imageTexture, vec2 textureCoords)}
+ \c{lowp vec4 customShader(lowp sampler2D imageTexture, highp vec2 textureCoords)}
that returns the source pixel value
to use in the paint engine's shader program. The shader fragment
is linked with the regular shader code used by the GL2 paint engine
@@ -77,7 +75,7 @@ QT_BEGIN_NAMESPACE
\code
static char const colorizeShaderCode[] =
"uniform lowp vec4 effectColor;\n"
- "lowp vec4 customShader(sampler2D imageTexture, vec2 textureCoords) {\n"
+ "lowp vec4 customShader(lowp sampler2D imageTexture, highp vec2 textureCoords) {\n"
" vec4 src = texture2D(imageTexture, textureCoords);\n"
" float gray = dot(src.rgb, vec3(0.212671, 0.715160, 0.072169));\n"
" vec4 colorize = 1.0-((1.0-gray)*(1.0-effectColor));\n"
@@ -126,11 +124,11 @@ QT_BEGIN_NAMESPACE
the drawItem() method will draw its item argument directly with
no effect applied.
- \sa QGrapicsEffect
+ \sa QGraphicsEffect
*/
static const char qglslDefaultImageFragmentShader[] = "\
- lowp vec4 customShader(sampler2D imageTexture, vec2 textureCoords) { \
+ lowp vec4 customShader(lowp sampler2D imageTexture, highp vec2 textureCoords) { \
return texture2D(imageTexture, textureCoords); \
}\n";
@@ -215,13 +213,13 @@ QByteArray QGraphicsShaderEffect::pixelShaderFragment() const
this shader effect to \a code.
The \a code must define a GLSL function with the signature
- \c{lowp vec4 customShader(sampler2D imageTexture, vec2 textureCoords)}
+ \c{lowp vec4 customShader(lowp sampler2D imageTexture, highp vec2 textureCoords)}
that returns the source pixel value to use in the paint engine's
shader program. The following is the default pixel shader fragment,
which draws a pixmap with no effect applied:
\code
- lowp vec4 customShader(sampler2D imageTexture, vec2 textureCoords) {
+ lowp vec4 customShader(lowp sampler2D imageTexture, highp vec2 textureCoords) {
return texture2D(imageTexture, textureCoords);
}
\endcode
@@ -313,6 +311,4 @@ void QGraphicsShaderEffect::setUniforms(QGLShaderProgram *program)
Q_UNUSED(program);
}
-#endif // QT_NO_GRAPHICSVIEW
-
QT_END_NAMESPACE
diff --git a/src/opengl/qgraphicsshadereffect.h b/src/opengl/qgraphicsshadereffect.h
index c4637d7..672973b 100644
--- a/src/opengl/qgraphicsshadereffect.h
+++ b/src/opengl/qgraphicsshadereffect.h
@@ -50,8 +50,6 @@ QT_BEGIN_NAMESPACE
QT_MODULE(OpenGL)
-#if !defined(QT_NO_GRAPHICSVIEW) || (QT_EDITION & QT_MODULE_GRAPHICSVIEW) != QT_MODULE_GRAPHICSVIEW
-
class QGLShaderProgram;
class QGLCustomShaderEffectStage;
class QGraphicsShaderEffectPrivate;
@@ -78,8 +76,6 @@ private:
friend class QGLCustomShaderEffectStage;
};
-#endif // QT_NO_GRAPHICSVIEW
-
QT_END_NAMESPACE
QT_END_HEADER
diff --git a/src/opengl/qpaintengine_opengl.cpp b/src/opengl/qpaintengine_opengl.cpp
index 9434adf..ac41ab0 100644
--- a/src/opengl/qpaintengine_opengl.cpp
+++ b/src/opengl/qpaintengine_opengl.cpp
@@ -4351,13 +4351,6 @@ void QOpenGLPaintEngine::drawTiledPixmap(const QRectF &r, const QPixmap &pm, con
GLdouble tc_w = r.width()/pm.width();
GLdouble tc_h = r.height()/pm.height();
- // Rotate the texture so that it is aligned correctly and the
- // wrapping is done correctly
- glMatrixMode(GL_TEXTURE);
- glPushMatrix();
- glRotatef(180.0, 0.0, 1.0, 0.0);
- glRotatef(180.0, 0.0, 0.0, 1.0);
-
q_vertexType vertexArray[4*2];
q_vertexType texCoordArray[4*2];
@@ -4376,7 +4369,6 @@ void QOpenGLPaintEngine::drawTiledPixmap(const QRectF &r, const QPixmap &pm, con
glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
glDisableClientState(GL_VERTEX_ARRAY);
- glPopMatrix();
glDisable(GL_TEXTURE_2D);
#ifndef QT_OPENGL_ES
@@ -4433,13 +4425,13 @@ void QOpenGLPaintEngine::drawTextureRect(int tx_width, int tx_height, const QRec
if (target == GL_TEXTURE_2D) {
x1 = sr.x() / tx_width;
x2 = x1 + sr.width() / tx_width;
- y1 = 1.0 - (sr.bottom() / tx_height);
- y2 = 1.0 - (sr.y() / tx_height);
+ y1 = 1 - (sr.bottom() / tx_height);
+ y2 = 1 - (sr.y() / tx_height);
} else {
x1 = sr.x();
x2 = sr.right();
- y1 = tx_height - sr.bottom();
- y2 = tx_height - sr.y();
+ y1 = sr.bottom();
+ y2 = sr.y();
}
q_vertexType vertexArray[4*2];
diff --git a/src/opengl/qpixmapdata_gl.cpp b/src/opengl/qpixmapdata_gl.cpp
index 80e99a0..c193f12 100644
--- a/src/opengl/qpixmapdata_gl.cpp
+++ b/src/opengl/qpixmapdata_gl.cpp
@@ -271,7 +271,7 @@ void QGLPixmapData::ensureCreated() const
m_source = QImage();
}
- m_texture.clean = false;
+ m_texture.options &= ~QGLContext::MemoryManagedBindOption;
}
QGLFramebufferObject *QGLPixmapData::fbo() const
diff --git a/src/opengl/util/fragmentprograms_p.h b/src/opengl/util/fragmentprograms_p.h
index 9451eda..6decaca 100644
--- a/src/opengl/util/fragmentprograms_p.h
+++ b/src/opengl/util/fragmentprograms_p.h
@@ -1,57 +1,6 @@
-/****************************************************************************
-**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the QtOpenGL module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** No Commercial Usage
-** This file contains pre-release code and may not be distributed.
-** You may use this file in accordance with the terms and conditions
-** contained in the either Technology Preview License Agreement or the
-** Beta Release License Agreement.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain
-** additional rights. These rights are described in the Nokia Qt LGPL
-** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at http://qt.nokia.com/contact.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
#ifndef FRAGMENTPROGRAMS_H
#define FRAGMENTPROGRAMS_H
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
enum FragmentVariable {
VAR_BRUSH_TEXTURE,
VAR_LINEAR,
@@ -71,7 +20,7 @@ enum FragmentVariable {
VAR_FMP2_M_RADIUS2,
VAR_FMP,
VAR_INV_MATRIX_M0,
- VAR_ANGLE
+ VAR_ANGLE,
};
enum FragmentBrushType {
@@ -80,7 +29,7 @@ enum FragmentBrushType {
FRAGMENT_PROGRAM_BRUSH_CONICAL,
FRAGMENT_PROGRAM_BRUSH_LINEAR,
FRAGMENT_PROGRAM_BRUSH_TEXTURE,
- FRAGMENT_PROGRAM_BRUSH_PATTERN
+ FRAGMENT_PROGRAM_BRUSH_PATTERN,
};
enum FragmentCompositionModeType {
@@ -109,12 +58,12 @@ enum FragmentCompositionModeType {
COMPOSITION_MODES_DIFFERENCE_NOMASK,
COMPOSITION_MODES_EXCLUSION_NOMASK,
COMPOSITION_MODE_BLEND_MODE_MASK,
- COMPOSITION_MODE_BLEND_MODE_NOMASK
+ COMPOSITION_MODE_BLEND_MODE_NOMASK,
};
enum FragmentMaskType {
FRAGMENT_PROGRAM_MASK_TRAPEZOID_AA,
- FRAGMENT_PROGRAM_MASK_ELLIPSE_AA
+ FRAGMENT_PROGRAM_MASK_ELLIPSE_AA,
};
static const unsigned int num_fragment_variables = 19;
@@ -133,55 +82,55 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_MASK_TRAPEZOID_AA =
"TEMP R4;\n"
"ADD R4.x, fragment.position, c[0];\n"
"ADD R0.y, fragment.position, -c[0].x;\n"
- "MAX R2.x, R0.y, fragment.texcoord[0].y;\n"
+ "MAX R3.w, fragment.texcoord[0].y, R0.y;\n"
"ADD R0.x, fragment.position.y, c[0];\n"
- "MIN R2.y, R0.x, fragment.texcoord[0].x;\n"
- "ADD R3.x, fragment.position, -c[0];\n"
+ "MIN R3.z, R0.x, fragment.texcoord[0].x;\n"
+ "ADD R2.z, fragment.position.x, -c[0].x;\n"
+ "MOV R0.yw, R3.w;\n"
+ "MOV R0.xz, R3.z;\n"
+ "MAD R1, fragment.texcoord[1].xxzz, R0, fragment.texcoord[1].yyww;\n"
+ "MAD R1.zw, fragment.position.x, c[0].y, -R1;\n"
+ "MOV R0.z, R1.x;\n"
+ "MOV R0.w, R1.z;\n"
+ "MOV R0.y, R1.w;\n"
+ "MOV R0.x, R1.y;\n"
+ "MIN R2.xy, R0.zwzw, R0;\n"
+ "SGE R1.xy, R0, R0.zwzw;\n"
"ADD R1.zw, -fragment.texcoord[0], -fragment.texcoord[0];\n"
- "MOV R3.y, R4.x;\n"
- "MOV R0.yw, R2.x;\n"
- "MOV R0.xz, R2.y;\n"
- "MAD R0, fragment.texcoord[1].xxzz, R0, fragment.texcoord[1].yyww;\n"
- "MAD R1.xy, fragment.position.x, c[0].y, -R0.zwzw;\n"
- "MOV R0.w, R1.x;\n"
- "MOV R1.x, R0.y;\n"
- "MOV R0.z, R0.x;\n"
- "SGE R2.zw, R1.xyxy, R0;\n"
- "MAX R0.xy, R0.zwzw, R1;\n"
- "MIN R0.zw, R0, R1.xyxy;\n"
- "MAD R2.zw, R2, R1, fragment.texcoord[0];\n"
- "ADD R1, R3.xyxy, -R0.zzww;\n"
- "MAD R1, R1, R2.zzww, R2.x;\n"
- "ADD R3.zw, R0.xyxy, R0;\n"
- "ADD R3.y, R2, -R2.x;\n"
- "ADD R2.zw, R1.xyyw, -R2.x;\n"
- "ADD R4.zw, R4.x, -R0;\n"
- "MUL R2.zw, R4, R2;\n"
- "ADD R4.zw, R1.xyyw, R1.xyxz;\n"
- "ADD R1.xz, R2.y, -R1;\n"
- "MAD R2.zw, -R2, c[0].x, R3.y;\n"
- "MAD R3.zw, R3, c[0].x, -R3.x;\n"
- "MAD R3.zw, R3, R3.y, -R2;\n"
- "ADD R1.y, R4.x, -R3.x;\n"
- "MAD R4.zw, -R4, c[0].x, R2.y;\n"
- "MUL R4.zw, R4, R1.y;\n"
- "ADD R1.yw, R0.xxzy, -R3.x;\n"
- "MUL R1.xy, R1.xzzw, R1.ywzw;\n"
- "MAD R1.zw, R1.xyxy, c[0].x, -R4;\n"
- "SGE R1.xy, R4.x, R0;\n"
- "MUL R1.zw, R1.xyxy, R1;\n"
- "MAD R1.xy, R1, R3.zwzw, R2.zwzw;\n"
- "SGE R2.zw, R3.x, R0;\n"
- "ADD R1.zw, R4, R1;\n"
- "ADD R1.zw, R1, -R1.xyxy;\n"
- "MAD R1.xy, R2.zwzw, R1.zwzw, R1;\n"
- "ADD R1.xy, R1, -R3.y;\n"
- "SGE R0.zw, R4.x, R0;\n"
- "MAD R0.zw, R0, R1.xyxy, R3.y;\n"
- "SGE R0.xy, R0, R3.x;\n"
+ "MAX R0.xy, R0.zwzw, R0;\n"
+ "MAD R3.xy, R1, R1.zwzw, fragment.texcoord[0].zwzw;\n"
+ "MOV R2.w, R4.x;\n"
+ "ADD R1, -R2.xxyy, R2.zwzw;\n"
+ "MAD R1, R1, R3.xxyy, R3.w;\n"
+ "ADD R3.xy, R1.ywzw, R1.xzzw;\n"
+ "ADD R4.zw, R3.z, -R1.xyxz;\n"
+ "ADD R1.zw, -R3.w, R1.xyyw;\n"
+ "ADD R1.xy, R4.x, -R2;\n"
+ "MUL R1.xy, R1, R1.zwzw;\n"
+ "MAD R3.xy, -R3, c[0].x, R3.z;\n"
+ "ADD R2.w, R4.x, -R2.z;\n"
+ "MUL R0.zw, R3.xyxy, R2.w;\n"
+ "ADD R2.w, R3.z, -R3;\n"
+ "ADD R3.xy, -R2.z, R0;\n"
+ "MUL R3.xy, R4.zwzw, R3;\n"
+ "ADD R4.zw, R2.xyxy, R0.xyxy;\n"
+ "MAD R1.zw, R4, c[0].x, -R2.z;\n"
+ "MAD R1.xy, -R1, c[0].x, R2.w;\n"
+ "MAD R4.zw, R2.w, R1, -R1.xyxy;\n"
+ "SGE R1.zw, R4.x, R0.xyxy;\n"
+ "MAD R3.xy, R3, c[0].x, -R0.zwzw;\n"
+ "MAD R1.xy, R1.zwzw, R4.zwzw, R1;\n"
+ "MAD R0.zw, R1, R3.xyxy, R0;\n"
+ "ADD R1.zw, R0, -R1.xyxy;\n"
+ "SGE R0.zw, R2.z, R2.xyxy;\n"
+ "MAD R0.zw, R0, R1, R1.xyxy;\n"
+ "ADD R0.zw, -R2.w, R0;\n"
+ "SGE R1.xy, R4.x, R2;\n"
+ "MAD R0.zw, R1.xyxy, R0, R2.w;\n"
+ "SGE R0.xy, R0, R2.z;\n"
"MUL R0.xy, R0.zwzw, R0;\n"
- "ADD R0.x, R3.y, -R0;\n"
- "SGE R0.z, R2.y, R2.x;\n"
+ "ADD R0.x, R2.w, -R0;\n"
+ "SGE R0.z, R3, R3.w;\n"
"ADD R0.x, R0, -R0.y;\n"
"MUL result.color, R0.x, R0.z;\n"
"END\n"
@@ -195,20 +144,20 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_MASK_ELLIPSE_AA =
"TEMP R0;\n"
"TEMP R1;\n"
"TEMP R2;\n"
- "ADD R0.xy, fragment.position, c[0];\n"
- "MUL R1.xyz, R0.y, c[2];\n"
- "MAD R0.xyz, R0.x, c[1], R1;\n"
- "ADD R0.xyz, R0, c[3];\n"
+ "ADD R0.xy, fragment.position, c[3];\n"
+ "MUL R1.xyz, R0.y, c[1];\n"
+ "MAD R0.xyz, R0.x, c[0], R1;\n"
+ "ADD R0.xyz, R0, c[2];\n"
"RCP R2.z, R0.z;\n"
- "MUL R0.zw, R0.xyxy, R2.z;\n"
- "MUL R2.xy, R0.zwzw, fragment.texcoord[0];\n"
- "MOV R1.xy, c[1];\n"
- "MOV R1.zw, c[2].xyxy;\n"
- "MOV R0.x, c[1].z;\n"
- "MOV R0.y, c[2].z;\n"
- "MAD R0, -R0.xyxy, R0.zzww, R1.xzyw;\n"
+ "MUL R1.zw, R0.xyxy, R2.z;\n"
+ "MUL R2.xy, R1.zwzw, fragment.texcoord[0];\n"
+ "MOV R1.x, c[0].z;\n"
+ "MOV R1.y, c[1].z;\n"
+ "MOV R0.xy, c[0];\n"
+ "MOV R0.zw, c[1].xyxy;\n"
+ "MAD R0, R1.zzww, -R1.xyxy, R0.xzyw;\n"
"MUL R1.xy, R2, fragment.texcoord[0];\n"
- "MUL R0, R0, R2.z;\n"
+ "MUL R0, R2.z, R0;\n"
"MUL R1.xy, R1, c[4].x;\n"
"MUL R1.zw, R1.xyxy, R0.xyxz;\n"
"MUL R0.xy, R1, R0.ywzw;\n"
@@ -230,36 +179,34 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_MASK_ELLIPSE_AA =
static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_SOLID_COMPOSITION_MODES_SIMPLE_PORTER_DUFF =
"!!ARBfp1.0\n"
- "PARAM c[7] = { program.local[0..3],\n"
- " { 1 },\n"
- " program.local[5..6] };\n"
+ "PARAM c[7] = { program.local[0..5],\n"
+ " { 1 } };\n"
"TEMP R0;\n"
"TEMP R1;\n"
"TEMP R2;\n"
"TEMP R3;\n"
"MUL R0.xy, fragment.position, c[3];\n"
- "TEX R1, R0, texture[0], 2D;\n"
- "MUL R0.xyz, R1, c[6].y;\n"
- "MUL R2.xyz, R0, fragment.color.primary.w;\n"
- "MUL R0.xyz, fragment.color.primary, c[6].x;\n"
- "MAD R2.xyz, R0, R1.w, R2;\n"
- "ADD R3.xy, fragment.position, c[0];\n"
- "ADD R0.w, -R1, c[4].x;\n"
- "MUL R0.xyz, fragment.color.primary, c[5].y;\n"
- "MAD R2.xyz, R0, R0.w, R2;\n"
- "MUL R0.xyz, R1, c[5].z;\n"
- "ADD R0.w, -fragment.color.primary, c[4].x;\n"
- "MAD R2.xyz, R0, R0.w, R2;\n"
- "ADD R0.y, -R1.w, c[4].x;\n"
- "MUL R0.x, fragment.color.primary.w, R1.w;\n"
- "MUL R0.y, fragment.color.primary.w, R0;\n"
- "MUL R0.z, R1.w, R0.w;\n"
- "DP3 R2.w, R0, c[5];\n"
- "MUL R3.xy, R3, c[1];\n"
- "TEX R0, R3, texture[1], 2D;\n"
- "ADD R2, R2, -R1;\n"
- "DP4 R0.x, R0, c[2];\n"
- "MAD result.color, R0.x, R2, R1;\n"
+ "TEX R0, R0, texture[0], 2D;\n"
+ "MUL R1.xyz, R0, c[0].y;\n"
+ "MUL R2.xyz, fragment.color.primary.w, R1;\n"
+ "MUL R1.xyz, fragment.color.primary, c[0].x;\n"
+ "MAD R2.xyz, R0.w, R1, R2;\n"
+ "ADD R3.xy, fragment.position, c[4];\n"
+ "ADD R1.w, -R0, c[6].x;\n"
+ "MUL R1.xyz, fragment.color.primary, c[1].y;\n"
+ "MAD R2.xyz, R1.w, R1, R2;\n"
+ "MUL R1.xyz, R0, c[1].z;\n"
+ "ADD R2.w, -fragment.color.primary, c[6].x;\n"
+ "MAD R2.xyz, R2.w, R1, R2;\n"
+ "MUL R1.z, R0.w, R2.w;\n"
+ "MUL R1.x, fragment.color.primary.w, R0.w;\n"
+ "MUL R1.y, fragment.color.primary.w, R1.w;\n"
+ "DP3 R2.w, R1, c[1];\n"
+ "MUL R3.xy, R3, c[2];\n"
+ "TEX R1, R3, texture[1], 2D;\n"
+ "ADD R2, R2, -R0;\n"
+ "DP4 R1.x, R1, c[5];\n"
+ "MAD result.color, R1.x, R2, R0;\n"
"END\n"
;
@@ -270,21 +217,21 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_SOLID_COMPOSITION_MODE
"TEMP R0;\n"
"TEMP R1;\n"
"TEMP R2;\n"
- "MUL R0.xy, fragment.position, c[3];\n"
- "TEX R1, R0, texture[0], 2D;\n"
- "ADD R0.x, -R1.w, c[4];\n"
- "MUL R0.xyz, fragment.color.primary, R0.x;\n"
- "MAD R0.xyz, fragment.color.primary, R1, R0;\n"
- "ADD R0.w, -fragment.color.primary, c[4].x;\n"
- "MAD R2.xyz, R1, R0.w, R0;\n"
- "ADD R0.z, fragment.color.primary.w, R1.w;\n"
- "MAD R2.w, -fragment.color.primary, R1, R0.z;\n"
- "ADD R0.xy, fragment.position, c[0];\n"
- "MUL R0.xy, R0, c[1];\n"
- "TEX R0, R0, texture[1], 2D;\n"
- "ADD R2, R2, -R1;\n"
- "DP4 R0.x, R0, c[2];\n"
- "MAD result.color, R0.x, R2, R1;\n"
+ "MUL R0.xy, fragment.position, c[1];\n"
+ "TEX R0, R0, texture[0], 2D;\n"
+ "ADD R1.x, -R0.w, c[4];\n"
+ "MUL R1.xyz, fragment.color.primary, R1.x;\n"
+ "MAD R1.xyz, fragment.color.primary, R0, R1;\n"
+ "ADD R1.w, -fragment.color.primary, c[4].x;\n"
+ "MAD R2.xyz, R0, R1.w, R1;\n"
+ "ADD R1.z, fragment.color.primary.w, R0.w;\n"
+ "MAD R2.w, -fragment.color.primary, R0, R1.z;\n"
+ "ADD R1.xy, fragment.position, c[2];\n"
+ "MUL R1.xy, R1, c[0];\n"
+ "TEX R1, R1, texture[1], 2D;\n"
+ "ADD R2, R2, -R0;\n"
+ "DP4 R1.x, R1, c[3];\n"
+ "MAD result.color, R1.x, R2, R0;\n"
"END\n"
;
@@ -294,16 +241,16 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_SOLID_COMPOSITION_MODE
"TEMP R0;\n"
"TEMP R1;\n"
"TEMP R2;\n"
- "MUL R0.xy, fragment.position, c[3];\n"
- "TEX R1, R0, texture[0], 2D;\n"
- "ADD R0.xy, fragment.position, c[0];\n"
- "ADD R2, fragment.color.primary, R1;\n"
- "MUL R0.xy, R0, c[1];\n"
- "MAD R2, -fragment.color.primary, R1, R2;\n"
- "TEX R0, R0, texture[1], 2D;\n"
- "ADD R2, R2, -R1;\n"
- "DP4 R0.x, R0, c[2];\n"
- "MAD result.color, R0.x, R2, R1;\n"
+ "MUL R0.xy, fragment.position, c[1];\n"
+ "TEX R0, R0, texture[0], 2D;\n"
+ "ADD R1.xy, fragment.position, c[2];\n"
+ "ADD R2, fragment.color.primary, R0;\n"
+ "MUL R1.xy, R1, c[0];\n"
+ "MAD R2, -fragment.color.primary, R0, R2;\n"
+ "TEX R1, R1, texture[1], 2D;\n"
+ "ADD R2, R2, -R0;\n"
+ "DP4 R1.x, R1, c[3];\n"
+ "MAD result.color, R1.x, R2, R0;\n"
"END\n"
;
@@ -315,7 +262,7 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_SOLID_COMPOSITION_MODE
"TEMP R1;\n"
"TEMP R2;\n"
"TEMP R3;\n"
- "MUL R0.xy, fragment.position, c[3];\n"
+ "MUL R0.xy, fragment.position, c[1];\n"
"TEX R1, R0, texture[0], 2D;\n"
"ADD R0.w, -R1, c[4].y;\n"
"MUL R3.xyz, fragment.color.primary, R0.w;\n"
@@ -336,11 +283,11 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_SOLID_COMPOSITION_MODE
"MAD R2.xyz, R0, R3, R2;\n"
"ADD R0.z, fragment.color.primary.w, R1.w;\n"
"MAD R2.w, -fragment.color.primary, R1, R0.z;\n"
- "ADD R0.xy, fragment.position, c[0];\n"
- "MUL R0.xy, R0, c[1];\n"
+ "ADD R0.xy, fragment.position, c[2];\n"
+ "MUL R0.xy, R0, c[0];\n"
"TEX R0, R0, texture[1], 2D;\n"
"ADD R2, R2, -R1;\n"
- "DP4 R0.x, R0, c[2];\n"
+ "DP4 R0.x, R0, c[3];\n"
"MAD result.color, R0.x, R2, R1;\n"
"END\n"
;
@@ -352,23 +299,23 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_SOLID_COMPOSITION_MODE
"TEMP R0;\n"
"TEMP R1;\n"
"TEMP R2;\n"
- "MUL R0.xy, fragment.position, c[3];\n"
- "TEX R1, R0, texture[0], 2D;\n"
- "MUL R2.xyz, R1, fragment.color.primary.w;\n"
- "MUL R0.xyz, fragment.color.primary, R1.w;\n"
- "MIN R0.xyz, R0, R2;\n"
- "ADD R0.w, -R1, c[4].x;\n"
- "MAD R0.xyz, fragment.color.primary, R0.w, R0;\n"
- "ADD R0.w, -fragment.color.primary, c[4].x;\n"
- "MAD R2.xyz, R1, R0.w, R0;\n"
- "ADD R0.z, fragment.color.primary.w, R1.w;\n"
- "MAD R2.w, -fragment.color.primary, R1, R0.z;\n"
- "ADD R0.xy, fragment.position, c[0];\n"
- "MUL R0.xy, R0, c[1];\n"
- "TEX R0, R0, texture[1], 2D;\n"
- "ADD R2, R2, -R1;\n"
- "DP4 R0.x, R0, c[2];\n"
- "MAD result.color, R0.x, R2, R1;\n"
+ "MUL R0.xy, fragment.position, c[1];\n"
+ "TEX R0, R0, texture[0], 2D;\n"
+ "MUL R2.xyz, fragment.color.primary.w, R0;\n"
+ "MUL R1.xyz, fragment.color.primary, R0.w;\n"
+ "MIN R1.xyz, R1, R2;\n"
+ "ADD R1.w, -R0, c[4].x;\n"
+ "MAD R1.xyz, fragment.color.primary, R1.w, R1;\n"
+ "ADD R1.w, -fragment.color.primary, c[4].x;\n"
+ "MAD R2.xyz, R0, R1.w, R1;\n"
+ "ADD R1.z, fragment.color.primary.w, R0.w;\n"
+ "MAD R2.w, -fragment.color.primary, R0, R1.z;\n"
+ "ADD R1.xy, fragment.position, c[2];\n"
+ "MUL R1.xy, R1, c[0];\n"
+ "TEX R1, R1, texture[1], 2D;\n"
+ "ADD R2, R2, -R0;\n"
+ "DP4 R1.x, R1, c[3];\n"
+ "MAD result.color, R1.x, R2, R0;\n"
"END\n"
;
@@ -379,35 +326,35 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_SOLID_COMPOSITION_MODE
"TEMP R0;\n"
"TEMP R1;\n"
"TEMP R2;\n"
- "MUL R0.xy, fragment.position, c[3];\n"
- "TEX R1, R0, texture[0], 2D;\n"
- "MUL R2.xyz, R1, fragment.color.primary.w;\n"
- "MUL R0.xyz, fragment.color.primary, R1.w;\n"
- "MAX R0.xyz, R0, R2;\n"
- "ADD R0.w, -R1, c[4].x;\n"
- "MAD R0.xyz, fragment.color.primary, R0.w, R0;\n"
- "ADD R0.w, -fragment.color.primary, c[4].x;\n"
- "MAD R2.xyz, R1, R0.w, R0;\n"
- "ADD R0.z, fragment.color.primary.w, R1.w;\n"
- "MAD R2.w, -fragment.color.primary, R1, R0.z;\n"
- "ADD R0.xy, fragment.position, c[0];\n"
- "MUL R0.xy, R0, c[1];\n"
- "TEX R0, R0, texture[1], 2D;\n"
- "ADD R2, R2, -R1;\n"
- "DP4 R0.x, R0, c[2];\n"
- "MAD result.color, R0.x, R2, R1;\n"
+ "MUL R0.xy, fragment.position, c[1];\n"
+ "TEX R0, R0, texture[0], 2D;\n"
+ "MUL R2.xyz, fragment.color.primary.w, R0;\n"
+ "MUL R1.xyz, fragment.color.primary, R0.w;\n"
+ "MAX R1.xyz, R1, R2;\n"
+ "ADD R1.w, -R0, c[4].x;\n"
+ "MAD R1.xyz, fragment.color.primary, R1.w, R1;\n"
+ "ADD R1.w, -fragment.color.primary, c[4].x;\n"
+ "MAD R2.xyz, R0, R1.w, R1;\n"
+ "ADD R1.z, fragment.color.primary.w, R0.w;\n"
+ "MAD R2.w, -fragment.color.primary, R0, R1.z;\n"
+ "ADD R1.xy, fragment.position, c[2];\n"
+ "MUL R1.xy, R1, c[0];\n"
+ "TEX R1, R1, texture[1], 2D;\n"
+ "ADD R2, R2, -R0;\n"
+ "DP4 R1.x, R1, c[3];\n"
+ "MAD result.color, R1.x, R2, R0;\n"
"END\n"
;
static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_SOLID_COMPOSITION_MODES_COLORDODGE =
"!!ARBfp1.0\n"
"PARAM c[5] = { program.local[0..3],\n"
- " { 1, 1e-06 } };\n"
+ " { 1, 1e-006 } };\n"
"TEMP R0;\n"
"TEMP R1;\n"
"TEMP R2;\n"
"TEMP R3;\n"
- "MUL R0.xy, fragment.position, c[3];\n"
+ "MUL R0.xy, fragment.position, c[1];\n"
"TEX R0, R0, texture[0], 2D;\n"
"ADD R1.y, -fragment.color.primary.w, c[4].x;\n"
"MAX R1.x, fragment.color.primary.w, c[4].y;\n"
@@ -417,7 +364,7 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_SOLID_COMPOSITION_MODE
"RCP R1.x, R1.x;\n"
"MAD R1.xyz, -fragment.color.primary, R1.x, c[4].x;\n"
"MAX R1.xyz, R1, c[4].y;\n"
- "MUL R2.xyz, R0, fragment.color.primary.w;\n"
+ "MUL R2.xyz, fragment.color.primary.w, R0;\n"
"MUL R1.w, fragment.color.primary, R0;\n"
"RCP R1.x, R1.x;\n"
"RCP R1.y, R1.y;\n"
@@ -430,11 +377,11 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_SOLID_COMPOSITION_MODE
"MAD R2.xyz, R2, R3, R1;\n"
"ADD R1.z, fragment.color.primary.w, R0.w;\n"
"MAD R2.w, -fragment.color.primary, R0, R1.z;\n"
- "ADD R1.xy, fragment.position, c[0];\n"
- "MUL R1.xy, R1, c[1];\n"
+ "ADD R1.xy, fragment.position, c[2];\n"
+ "MUL R1.xy, R1, c[0];\n"
"TEX R1, R1, texture[1], 2D;\n"
"ADD R2, R2, -R0;\n"
- "DP4 R1.x, R1, c[2];\n"
+ "DP4 R1.x, R1, c[3];\n"
"MAD result.color, R1.x, R2, R0;\n"
"END\n"
;
@@ -442,29 +389,28 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_SOLID_COMPOSITION_MODE
static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_SOLID_COMPOSITION_MODES_COLORBURN =
"!!ARBfp1.0\n"
"PARAM c[5] = { program.local[0..3],\n"
- " { 1, 9.9999997e-06 } };\n"
+ " { 1, 9.9999997e-006 } };\n"
"TEMP R0;\n"
"TEMP R1;\n"
"TEMP R2;\n"
"TEMP R3;\n"
"TEMP R4;\n"
- "MUL R0.xy, fragment.position, c[3];\n"
+ "MUL R0.xy, fragment.position, c[1];\n"
"TEX R0, R0, texture[0], 2D;\n"
"ADD R1.w, -R0, c[4].x;\n"
- "MUL R1.xyz, R0, fragment.color.primary.w;\n"
+ "MUL R1.xyz, fragment.color.primary.w, R0;\n"
"MAD R2.xyz, fragment.color.primary, R0.w, R1;\n"
"MAD R1.xyz, -fragment.color.primary.w, R0.w, R2;\n"
"MUL R3.xyz, fragment.color.primary.w, R1;\n"
"MAX R1.xyz, fragment.color.primary, c[4].y;\n"
+ "ADD R2.w, -fragment.color.primary, c[4].x;\n"
"MUL R4.xyz, fragment.color.primary, R1.w;\n"
"RCP R1.x, R1.x;\n"
"RCP R1.y, R1.y;\n"
"RCP R1.z, R1.z;\n"
"MAD R3.xyz, R3, R1, R4;\n"
- "ADD R2.w, -fragment.color.primary, c[4].x;\n"
"MUL R1.xyz, R0, R2.w;\n"
"MAD R1.xyz, fragment.color.primary, R1.w, R1;\n"
- "ADD R2.w, -fragment.color.primary, c[4].x;\n"
"MAD R3.xyz, R0, R2.w, R3;\n"
"MUL R1.w, fragment.color.primary, R0;\n"
"ADD R3.xyz, R3, -R1;\n"
@@ -472,11 +418,11 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_SOLID_COMPOSITION_MODE
"MAD R2.xyz, R2, R3, R1;\n"
"ADD R1.z, fragment.color.primary.w, R0.w;\n"
"MAD R2.w, -fragment.color.primary, R0, R1.z;\n"
- "ADD R1.xy, fragment.position, c[0];\n"
- "MUL R1.xy, R1, c[1];\n"
+ "ADD R1.xy, fragment.position, c[2];\n"
+ "MUL R1.xy, R1, c[0];\n"
"TEX R1, R1, texture[1], 2D;\n"
"ADD R2, R2, -R0;\n"
- "DP4 R1.x, R1, c[2];\n"
+ "DP4 R1.x, R1, c[3];\n"
"MAD result.color, R1.x, R2, R0;\n"
"END\n"
;
@@ -489,7 +435,7 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_SOLID_COMPOSITION_MODE
"TEMP R1;\n"
"TEMP R2;\n"
"TEMP R3;\n"
- "MUL R0.xy, fragment.position, c[3];\n"
+ "MUL R0.xy, fragment.position, c[1];\n"
"TEX R1, R0, texture[0], 2D;\n"
"ADD R0.w, -R1, c[4].y;\n"
"MUL R3.xyz, fragment.color.primary, R0.w;\n"
@@ -510,11 +456,11 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_SOLID_COMPOSITION_MODE
"MAD R2.xyz, R0, R3, R2;\n"
"ADD R0.z, fragment.color.primary.w, R1.w;\n"
"MAD R2.w, -fragment.color.primary, R1, R0.z;\n"
- "ADD R0.xy, fragment.position, c[0];\n"
- "MUL R0.xy, R0, c[1];\n"
+ "ADD R0.xy, fragment.position, c[2];\n"
+ "MUL R0.xy, R0, c[0];\n"
"TEX R0, R0, texture[1], 2D;\n"
"ADD R2, R2, -R1;\n"
- "DP4 R0.x, R0, c[2];\n"
+ "DP4 R0.x, R0, c[3];\n"
"MAD result.color, R0.x, R2, R1;\n"
"END\n"
;
@@ -522,58 +468,56 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_SOLID_COMPOSITION_MODE
static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_SOLID_COMPOSITION_MODES_SOFTLIGHT =
"!!ARBfp1.0\n"
"PARAM c[6] = { program.local[0..3],\n"
- " { 1, 9.9999997e-06, 2, 8 },\n"
- " { 3 } };\n"
+ " { 1, 9.9999997e-006, 2, 3 },\n"
+ " { 8 } };\n"
"TEMP R0;\n"
"TEMP R1;\n"
"TEMP R2;\n"
"TEMP R3;\n"
"TEMP R4;\n"
"TEMP R5;\n"
- "MUL R0.xy, fragment.position, c[3];\n"
+ "MUL R0.xy, fragment.position, c[1];\n"
"TEX R0, R0, texture[0], 2D;\n"
"MAX R1.x, R0.w, c[4].y;\n"
"RCP R1.w, R1.x;\n"
"MUL R2.xyz, R0, R1.w;\n"
- "MUL R1.xyz, -R2, c[4].w;\n"
+ "MUL R1.xyz, -R2, c[5].x;\n"
"RSQ R2.w, R2.x;\n"
- "ADD R4.xyz, R1, c[5].x;\n"
+ "ADD R4.xyz, R1, c[4].w;\n"
"MAD R1.xyz, -R0, R1.w, c[4].x;\n"
"RSQ R2.z, R2.z;\n"
"RSQ R2.y, R2.y;\n"
"RCP R2.x, R2.w;\n"
"RCP R2.z, R2.z;\n"
"RCP R2.y, R2.y;\n"
- "MAD R5.xyz, R2, R0.w, -R0;\n"
+ "MAD R5.xyz, R0.w, R2, -R0;\n"
"MAD R2.xyz, fragment.color.primary, c[4].z, -fragment.color.primary.w;\n"
"MUL R3.xyz, R1, R2;\n"
"MAD R3.xyz, -R3, R4, fragment.color.primary.w;\n"
"MUL R4.xyz, R5, R2;\n"
"MAD R1.xyz, -R1, R2, fragment.color.primary.w;\n"
- "MAD R5.xyz, R0, fragment.color.primary.w, R4;\n"
"MUL R3.xyz, R0, R3;\n"
- "MUL R4.xyz, R0, c[4].w;\n"
- "ADD R5.xyz, R5, -R3;\n"
- "SGE R4.xyz, R4, R0.w;\n"
- "MUL R4.xyz, R4, R5;\n"
- "ADD R2.xyz, R3, R4;\n"
+ "MAD R4.xyz, fragment.color.primary.w, R0, R4;\n"
+ "ADD R5.xyz, R4, -R3;\n"
+ "MUL R4.xyz, R0, c[5].x;\n"
+ "SGE R2.xyz, R4, R0.w;\n"
+ "MAD R2.xyz, R2, R5, R3;\n"
"MUL R1.xyz, R0, R1;\n"
"MUL R3.xyz, fragment.color.primary, c[4].z;\n"
"ADD R2.xyz, R2, -R1;\n"
"SGE R3.xyz, R3, fragment.color.primary.w;\n"
- "MUL R2.xyz, R3, R2;\n"
- "ADD R1.xyz, R1, R2;\n"
+ "MAD R1.xyz, R3, R2, R1;\n"
"ADD R1.w, -R0, c[4].x;\n"
"MAD R1.xyz, fragment.color.primary, R1.w, R1;\n"
"ADD R1.w, -fragment.color.primary, c[4].x;\n"
"MAD R2.xyz, R0, R1.w, R1;\n"
"ADD R1.z, fragment.color.primary.w, R0.w;\n"
"MAD R2.w, -fragment.color.primary, R0, R1.z;\n"
- "ADD R1.xy, fragment.position, c[0];\n"
- "MUL R1.xy, R1, c[1];\n"
+ "ADD R1.xy, fragment.position, c[2];\n"
+ "MUL R1.xy, R1, c[0];\n"
"TEX R1, R1, texture[1], 2D;\n"
"ADD R2, R2, -R0;\n"
- "DP4 R1.x, R1, c[2];\n"
+ "DP4 R1.x, R1, c[3];\n"
"MAD result.color, R1.x, R2, R0;\n"
"END\n"
;
@@ -586,77 +530,75 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_SOLID_COMPOSITION_MODE
"TEMP R1;\n"
"TEMP R2;\n"
"TEMP R3;\n"
- "MUL R0.xy, fragment.position, c[3];\n"
- "TEX R1, R0, texture[0], 2D;\n"
- "MUL R2.xyz, R1, fragment.color.primary.w;\n"
- "MUL R0.xyz, fragment.color.primary, R1.w;\n"
- "MIN R0.xyz, R0, R2;\n"
- "ADD R3.xyz, fragment.color.primary, R1;\n"
- "MAD R2.xyz, -R0, c[4].x, R3;\n"
- "ADD R0.z, fragment.color.primary.w, R1.w;\n"
- "MAD R2.w, -fragment.color.primary, R1, R0.z;\n"
- "ADD R0.xy, fragment.position, c[0];\n"
- "MUL R0.xy, R0, c[1];\n"
- "TEX R0, R0, texture[1], 2D;\n"
- "ADD R2, R2, -R1;\n"
- "DP4 R0.x, R0, c[2];\n"
- "MAD result.color, R0.x, R2, R1;\n"
+ "MUL R0.xy, fragment.position, c[1];\n"
+ "TEX R0, R0, texture[0], 2D;\n"
+ "ADD R1.xyz, fragment.color.primary, R0;\n"
+ "MUL R3.xyz, fragment.color.primary.w, R0;\n"
+ "MUL R2.xyz, fragment.color.primary, R0.w;\n"
+ "MIN R2.xyz, R2, R3;\n"
+ "MAD R2.xyz, -R2, c[4].x, R1;\n"
+ "ADD R1.z, fragment.color.primary.w, R0.w;\n"
+ "MAD R2.w, -fragment.color.primary, R0, R1.z;\n"
+ "ADD R1.xy, fragment.position, c[2];\n"
+ "MUL R1.xy, R1, c[0];\n"
+ "TEX R1, R1, texture[1], 2D;\n"
+ "ADD R2, R2, -R0;\n"
+ "DP4 R1.x, R1, c[3];\n"
+ "MAD result.color, R1.x, R2, R0;\n"
"END\n"
;
static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_SOLID_COMPOSITION_MODES_EXCLUSION =
"!!ARBfp1.0\n"
"PARAM c[5] = { program.local[0..3],\n"
- " { 1, 2 } };\n"
+ " { 2, 1 } };\n"
"TEMP R0;\n"
"TEMP R1;\n"
"TEMP R2;\n"
- "MUL R0.xy, fragment.position, c[3];\n"
- "TEX R1, R0, texture[0], 2D;\n"
- "MUL R0.xyz, R1, fragment.color.primary.w;\n"
- "MAD R2.xyz, fragment.color.primary, R1.w, R0;\n"
- "MUL R0.xyz, fragment.color.primary, R1;\n"
- "MAD R0.xyz, -R0, c[4].y, R2;\n"
- "ADD R0.w, -R1, c[4].x;\n"
- "MAD R0.xyz, fragment.color.primary, R0.w, R0;\n"
- "ADD R0.w, -fragment.color.primary, c[4].x;\n"
- "MAD R2.xyz, R1, R0.w, R0;\n"
- "ADD R0.z, fragment.color.primary.w, R1.w;\n"
- "MAD R2.w, -fragment.color.primary, R1, R0.z;\n"
- "ADD R0.xy, fragment.position, c[0];\n"
- "MUL R0.xy, R0, c[1];\n"
- "TEX R0, R0, texture[1], 2D;\n"
- "ADD R2, R2, -R1;\n"
- "DP4 R0.x, R0, c[2];\n"
- "MAD result.color, R0.x, R2, R1;\n"
+ "MUL R0.xy, fragment.position, c[1];\n"
+ "TEX R0, R0, texture[0], 2D;\n"
+ "MUL R1.xyz, fragment.color.primary.w, R0;\n"
+ "MAD R2.xyz, fragment.color.primary, R0.w, R1;\n"
+ "MUL R1.xyz, fragment.color.primary, R0;\n"
+ "MAD R1.xyz, -R1, c[4].x, R2;\n"
+ "ADD R1.w, -R0, c[4].y;\n"
+ "MAD R1.xyz, fragment.color.primary, R1.w, R1;\n"
+ "ADD R1.w, -fragment.color.primary, c[4].y;\n"
+ "MAD R2.xyz, R0, R1.w, R1;\n"
+ "ADD R1.z, fragment.color.primary.w, R0.w;\n"
+ "MAD R2.w, -fragment.color.primary, R0, R1.z;\n"
+ "ADD R1.xy, fragment.position, c[2];\n"
+ "MUL R1.xy, R1, c[0];\n"
+ "TEX R1, R1, texture[1], 2D;\n"
+ "ADD R2, R2, -R0;\n"
+ "DP4 R1.x, R1, c[3];\n"
+ "MAD result.color, R1.x, R2, R0;\n"
"END\n"
;
static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_SOLID_COMPOSITION_MODES_SIMPLE_PORTER_DUFF_NOMASK =
"!!ARBfp1.0\n"
- "PARAM c[4] = { program.local[0],\n"
- " { 1 },\n"
- " program.local[2..3] };\n"
+ "PARAM c[4] = { program.local[0..2],\n"
+ " { 1 } };\n"
"TEMP R0;\n"
"TEMP R1;\n"
"TEMP R2;\n"
- "MUL R0.xy, fragment.position, c[0];\n"
+ "MUL R0.xy, fragment.position, c[2];\n"
"TEX R0, R0, texture[0], 2D;\n"
- "MUL R1.xyz, R0, c[3].y;\n"
- "MUL R2.xyz, R1, fragment.color.primary.w;\n"
- "MUL R1.xyz, fragment.color.primary, c[3].x;\n"
- "MAD R2.xyz, R1, R0.w, R2;\n"
- "MUL R0.xyz, R0, c[2].z;\n"
- "ADD R1.w, -R0, c[1].x;\n"
- "MUL R1.xyz, fragment.color.primary, c[2].y;\n"
- "MAD R1.xyz, R1, R1.w, R2;\n"
- "ADD R1.w, -fragment.color.primary, c[1].x;\n"
- "MAD result.color.xyz, R0, R1.w, R1;\n"
- "ADD R0.y, -R0.w, c[1].x;\n"
+ "MUL R1.xyz, R0, c[0].y;\n"
+ "MUL R2.xyz, fragment.color.primary.w, R1;\n"
+ "MUL R1.xyz, fragment.color.primary, c[0].x;\n"
+ "MAD R2.xyz, R0.w, R1, R2;\n"
+ "MUL R0.xyz, R0, c[1].z;\n"
+ "ADD R1.w, -R0, c[3].x;\n"
+ "MUL R1.xyz, fragment.color.primary, c[1].y;\n"
+ "MAD R1.xyz, R1.w, R1, R2;\n"
+ "ADD R2.x, -fragment.color.primary.w, c[3];\n"
+ "MAD result.color.xyz, R2.x, R0, R1;\n"
"MUL R0.x, fragment.color.primary.w, R0.w;\n"
- "MUL R0.z, R0.w, R1.w;\n"
- "MUL R0.y, fragment.color.primary.w, R0;\n"
- "DP3 result.color.w, R0, c[2];\n"
+ "MUL R0.z, R0.w, R2.x;\n"
+ "MUL R0.y, fragment.color.primary.w, R1.w;\n"
+ "DP3 result.color.w, R0, c[1];\n"
"END\n"
;
@@ -732,7 +674,7 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_SOLID_COMPOSITION_MODE
"TEMP R2;\n"
"MUL R0.xy, fragment.position, c[0];\n"
"TEX R0, R0, texture[0], 2D;\n"
- "MUL R2.xyz, R0, fragment.color.primary.w;\n"
+ "MUL R2.xyz, fragment.color.primary.w, R0;\n"
"MUL R1.xyz, fragment.color.primary, R0.w;\n"
"MIN R1.xyz, R1, R2;\n"
"ADD R1.w, -R0, c[1].x;\n"
@@ -753,7 +695,7 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_SOLID_COMPOSITION_MODE
"TEMP R2;\n"
"MUL R0.xy, fragment.position, c[0];\n"
"TEX R0, R0, texture[0], 2D;\n"
- "MUL R2.xyz, R0, fragment.color.primary.w;\n"
+ "MUL R2.xyz, fragment.color.primary.w, R0;\n"
"MUL R1.xyz, fragment.color.primary, R0.w;\n"
"MAX R1.xyz, R1, R2;\n"
"ADD R1.w, -R0, c[1].x;\n"
@@ -768,7 +710,7 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_SOLID_COMPOSITION_MODE
static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_SOLID_COMPOSITION_MODES_COLORDODGE_NOMASK =
"!!ARBfp1.0\n"
"PARAM c[2] = { program.local[0],\n"
- " { 1, 1e-06 } };\n"
+ " { 1, 1e-006 } };\n"
"TEMP R0;\n"
"TEMP R1;\n"
"TEMP R2;\n"
@@ -782,7 +724,7 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_SOLID_COMPOSITION_MODE
"MAD R1.xyz, fragment.color.primary, R1.w, R1;\n"
"MAD R2.xyz, -fragment.color.primary, R2.x, c[1].x;\n"
"MAX R2.xyz, R2, c[1].y;\n"
- "MUL R0.xyz, R0, fragment.color.primary.w;\n"
+ "MUL R0.xyz, fragment.color.primary.w, R0;\n"
"MUL R1.w, fragment.color.primary, R0;\n"
"RCP R2.x, R2.x;\n"
"RCP R2.y, R2.y;\n"
@@ -801,7 +743,7 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_SOLID_COMPOSITION_MODE
static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_SOLID_COMPOSITION_MODES_COLORBURN_NOMASK =
"!!ARBfp1.0\n"
"PARAM c[2] = { program.local[0],\n"
- " { 1, 9.9999997e-06 } };\n"
+ " { 1, 9.9999997e-006 } };\n"
"TEMP R0;\n"
"TEMP R1;\n"
"TEMP R2;\n"
@@ -809,7 +751,7 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_SOLID_COMPOSITION_MODE
"TEMP R4;\n"
"MUL R0.xy, fragment.position, c[0];\n"
"TEX R0, R0, texture[0], 2D;\n"
- "MUL R1.xyz, R0, fragment.color.primary.w;\n"
+ "MUL R1.xyz, fragment.color.primary.w, R0;\n"
"MAD R2.xyz, fragment.color.primary, R0.w, R1;\n"
"MAD R1.xyz, -fragment.color.primary.w, R0.w, R2;\n"
"MUL R3.xyz, fragment.color.primary.w, R1;\n"
@@ -822,7 +764,6 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_SOLID_COMPOSITION_MODE
"RCP R1.z, R1.z;\n"
"MAD R1.xyz, R3, R1, R4;\n"
"MUL R3.xyz, R0, R2.w;\n"
- "ADD R2.w, -fragment.color.primary, c[1].x;\n"
"MAD R0.xyz, R0, R2.w, R1;\n"
"MAD R1.xyz, fragment.color.primary, R1.w, R3;\n"
"MUL R1.w, fragment.color.primary, R0;\n"
@@ -869,8 +810,8 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_SOLID_COMPOSITION_MODE
static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_SOLID_COMPOSITION_MODES_SOFTLIGHT_NOMASK =
"!!ARBfp1.0\n"
"PARAM c[3] = { program.local[0],\n"
- " { 1, 9.9999997e-06, 2, 8 },\n"
- " { 3 } };\n"
+ " { 1, 9.9999997e-006, 2, 3 },\n"
+ " { 8 } };\n"
"TEMP R0;\n"
"TEMP R1;\n"
"TEMP R2;\n"
@@ -882,8 +823,8 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_SOLID_COMPOSITION_MODE
"MAX R1.x, R0.w, c[1].y;\n"
"RCP R1.w, R1.x;\n"
"MUL R2.xyz, R0, R1.w;\n"
- "MUL R1.xyz, -R2, c[1].w;\n"
- "ADD R4.xyz, R1, c[2].x;\n"
+ "MUL R1.xyz, -R2, c[2].x;\n"
+ "ADD R4.xyz, R1, c[1].w;\n"
"MAD R1.xyz, -R0, R1.w, c[1].x;\n"
"RSQ R2.w, R2.x;\n"
"RSQ R2.z, R2.z;\n"
@@ -891,25 +832,23 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_SOLID_COMPOSITION_MODE
"RCP R2.x, R2.w;\n"
"RCP R2.z, R2.z;\n"
"RCP R2.y, R2.y;\n"
- "MAD R5.xyz, R2, R0.w, -R0;\n"
+ "MAD R5.xyz, R0.w, R2, -R0;\n"
"MAD R2.xyz, fragment.color.primary, c[1].z, -fragment.color.primary.w;\n"
"MUL R3.xyz, R1, R2;\n"
"MAD R3.xyz, -R3, R4, fragment.color.primary.w;\n"
"MUL R4.xyz, R5, R2;\n"
"MAD R1.xyz, -R1, R2, fragment.color.primary.w;\n"
- "MAD R5.xyz, R0, fragment.color.primary.w, R4;\n"
"MUL R3.xyz, R0, R3;\n"
- "MUL R4.xyz, R0, c[1].w;\n"
- "ADD R5.xyz, R5, -R3;\n"
- "SGE R4.xyz, R4, R0.w;\n"
- "MUL R4.xyz, R4, R5;\n"
- "ADD R2.xyz, R3, R4;\n"
+ "MAD R4.xyz, fragment.color.primary.w, R0, R4;\n"
+ "ADD R5.xyz, R4, -R3;\n"
+ "MUL R4.xyz, R0, c[2].x;\n"
+ "SGE R2.xyz, R4, R0.w;\n"
+ "MAD R2.xyz, R2, R5, R3;\n"
"MUL R1.xyz, R0, R1;\n"
"MUL R3.xyz, fragment.color.primary, c[1].z;\n"
"ADD R2.xyz, R2, -R1;\n"
"SGE R3.xyz, R3, fragment.color.primary.w;\n"
- "MUL R2.xyz, R3, R2;\n"
- "ADD R1.xyz, R1, R2;\n"
+ "MAD R1.xyz, R3, R2, R1;\n"
"ADD R1.w, -R0, c[1].x;\n"
"MAD R1.xyz, fragment.color.primary, R1.w, R1;\n"
"ADD R1.w, fragment.color.primary, R0;\n"
@@ -928,7 +867,7 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_SOLID_COMPOSITION_MODE
"TEMP R2;\n"
"MUL R0.xy, fragment.position, c[0];\n"
"TEX R0, R0, texture[0], 2D;\n"
- "MUL R2.xyz, R0, fragment.color.primary.w;\n"
+ "MUL R2.xyz, fragment.color.primary.w, R0;\n"
"MUL R1.xyz, fragment.color.primary, R0.w;\n"
"ADD R1.w, fragment.color.primary, R0;\n"
"MIN R1.xyz, R1, R2;\n"
@@ -941,20 +880,20 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_SOLID_COMPOSITION_MODE
static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_SOLID_COMPOSITION_MODES_EXCLUSION_NOMASK =
"!!ARBfp1.0\n"
"PARAM c[2] = { program.local[0],\n"
- " { 1, 2 } };\n"
+ " { 2, 1 } };\n"
"TEMP R0;\n"
"TEMP R1;\n"
"TEMP R2;\n"
"MUL R0.xy, fragment.position, c[0];\n"
"TEX R0, R0, texture[0], 2D;\n"
- "MUL R1.xyz, R0, fragment.color.primary.w;\n"
+ "MUL R1.xyz, fragment.color.primary.w, R0;\n"
"MAD R2.xyz, fragment.color.primary, R0.w, R1;\n"
"MUL R1.xyz, fragment.color.primary, R0;\n"
- "MAD R1.xyz, -R1, c[1].y, R2;\n"
- "ADD R1.w, -R0, c[1].x;\n"
+ "MAD R1.xyz, -R1, c[1].x, R2;\n"
+ "ADD R1.w, -R0, c[1].y;\n"
"MAD R1.xyz, fragment.color.primary, R1.w, R1;\n"
"ADD R1.w, fragment.color.primary, R0;\n"
- "ADD R2.x, -fragment.color.primary.w, c[1];\n"
+ "ADD R2.x, -fragment.color.primary.w, c[1].y;\n"
"MAD result.color.xyz, R0, R2.x, R1;\n"
"MAD result.color.w, -fragment.color.primary, R0, R1;\n"
"END\n"
@@ -964,8 +903,8 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_SOLID_COMPOSITION_MODE
"!!ARBfp1.0\n"
"PARAM c[3] = { program.local[0..2] };\n"
"TEMP R0;\n"
- "ADD R0.xy, fragment.position, c[0];\n"
- "MUL R0.xy, R0, c[1];\n"
+ "ADD R0.xy, fragment.position, c[1];\n"
+ "MUL R0.xy, R0, c[0];\n"
"TEX R0, R0, texture[0], 2D;\n"
"DP4 R0.x, R0, c[2];\n"
"MUL result.color, fragment.color.primary, R0.x;\n"
@@ -974,359 +913,351 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_SOLID_COMPOSITION_MODE
static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_SOLID_COMPOSITION_MODE_BLEND_MODE_NOMASK =
"!!ARBfp1.0\n"
- "PARAM c[1] = { program.local[0] };\n"
"MOV result.color, fragment.color.primary;\n"
"END\n"
;
static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_RADIAL_COMPOSITION_MODES_SIMPLE_PORTER_DUFF =
"!!ARBfp1.0\n"
- "PARAM c[12] = { program.local[0..6],\n"
- " { 2, 4, 1 },\n"
- " program.local[8..11] };\n"
+ "PARAM c[12] = { program.local[0..10],\n"
+ " { 2, 4, 1 } };\n"
"TEMP R0;\n"
"TEMP R1;\n"
"TEMP R2;\n"
"TEMP R3;\n"
- "MUL R0.xyz, fragment.position.y, c[4];\n"
- "MAD R0.xyz, fragment.position.x, c[3], R0;\n"
- "ADD R0.xyz, R0, c[5];\n"
+ "MUL R0.xyz, fragment.position.y, c[3];\n"
+ "MAD R0.xyz, fragment.position.x, c[2], R0;\n"
+ "ADD R0.xyz, R0, c[4];\n"
"RCP R0.z, R0.z;\n"
"MUL R0.xy, R0, R0.z;\n"
"MUL R0.zw, R0.xyxy, R0.xyxy;\n"
"ADD R0.z, R0, R0.w;\n"
- "MUL R0.xy, R0, c[6];\n"
+ "MUL R0.xy, R0, c[0];\n"
"ADD R0.x, R0, R0.y;\n"
- "MUL R0.z, c[8].x, -R0;\n"
- "MUL R0.y, R0.z, c[7];\n"
- "MUL R0.x, R0, c[7];\n"
- "MAD R0.y, R0.x, R0.x, -R0;\n"
- "RSQ R0.z, R0.y;\n"
- "RCP R0.z, R0.z;\n"
- "ADD R0.x, -R0, R0.z;\n"
- "MUL R0.zw, fragment.position.xyxy, c[9].xyxy;\n"
- "TEX R1, R0.zwzw, texture[0], 2D;\n"
- "MOV R0.y, c[7].x;\n"
- "MUL R0.y, c[8].x, R0;\n"
- "RCP R0.y, R0.y;\n"
- "MUL R0.x, R0, R0.y;\n"
- "TEX R0, R0, texture[2], 1D;\n"
- "MUL R2.xyz, R1, c[11].y;\n"
- "MUL R3.xyz, R2, R0.w;\n"
- "MUL R2.xyz, R0, c[11].x;\n"
- "MAD R2.xyz, R2, R1.w, R3;\n"
- "ADD R3.xy, fragment.position, c[0];\n"
- "ADD R2.w, -R1, c[7].z;\n"
- "MUL R0.xyz, R0, c[10].y;\n"
- "MAD R2.xyz, R0, R2.w, R2;\n"
- "MUL R0.xyz, R1, c[10].z;\n"
- "ADD R3.z, -R0.w, c[7];\n"
- "MAD R2.xyz, R0, R3.z, R2;\n"
- "MUL R0.y, R0.w, R2.w;\n"
- "MUL R0.x, R0.w, R1.w;\n"
- "MUL R0.z, R1.w, R3;\n"
- "DP3 R2.w, R0, c[10];\n"
- "MUL R3.xy, R3, c[1];\n"
- "TEX R0, R3, texture[1], 2D;\n"
- "ADD R2, R2, -R1;\n"
- "DP4 R0.x, R0, c[2];\n"
- "MAD result.color, R0.x, R2, R1;\n"
+ "MUL R0.z, -R0, c[1].x;\n"
+ "MUL R0.y, R0.x, c[11].x;\n"
+ "MUL R0.z, R0, c[11].y;\n"
+ "MAD R0.x, R0.y, R0.y, -R0.z;\n"
+ "RSQ R0.x, R0.x;\n"
+ "RCP R0.z, R0.x;\n"
+ "ADD R1.x, -R0.y, R0.z;\n"
+ "MOV R0.x, c[11];\n"
+ "MUL R0.z, R0.x, c[1].x;\n"
+ "RCP R1.y, R0.z;\n"
+ "MUL R0.xy, fragment.position, c[8];\n"
+ "TEX R0, R0, texture[0], 2D;\n"
+ "MUL R1.x, R1, R1.y;\n"
+ "TEX R1, R1, texture[2], 1D;\n"
+ "MUL R2.xyz, R0, c[5].y;\n"
+ "MUL R3.xyz, R1.w, R2;\n"
+ "MUL R2.xyz, R1, c[5].x;\n"
+ "MAD R2.xyz, R0.w, R2, R3;\n"
+ "ADD R3.xy, fragment.position, c[9];\n"
+ "ADD R2.w, -R0, c[11].z;\n"
+ "MUL R1.xyz, R1, c[6].y;\n"
+ "MAD R2.xyz, R2.w, R1, R2;\n"
+ "MUL R1.xyz, R0, c[6].z;\n"
+ "ADD R3.z, -R1.w, c[11];\n"
+ "MAD R2.xyz, R3.z, R1, R2;\n"
+ "MUL R1.y, R1.w, R2.w;\n"
+ "MUL R1.x, R1.w, R0.w;\n"
+ "MUL R1.z, R0.w, R3;\n"
+ "DP3 R2.w, R1, c[6];\n"
+ "MUL R3.xy, R3, c[7];\n"
+ "TEX R1, R3, texture[1], 2D;\n"
+ "ADD R2, R2, -R0;\n"
+ "DP4 R1.x, R1, c[10];\n"
+ "MAD result.color, R1.x, R2, R0;\n"
"END\n"
;
static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_RADIAL_COMPOSITION_MODES_MULTIPLY =
"!!ARBfp1.0\n"
- "PARAM c[10] = { program.local[0..6],\n"
- " { 2, 4, 1 },\n"
- " program.local[8..9] };\n"
+ "PARAM c[10] = { program.local[0..8],\n"
+ " { 2, 4, 1 } };\n"
"TEMP R0;\n"
"TEMP R1;\n"
"TEMP R2;\n"
- "MUL R0.xyz, fragment.position.y, c[4];\n"
- "MAD R0.xyz, fragment.position.x, c[3], R0;\n"
- "ADD R0.xyz, R0, c[5];\n"
+ "MUL R0.xyz, fragment.position.y, c[3];\n"
+ "MAD R0.xyz, fragment.position.x, c[2], R0;\n"
+ "ADD R0.xyz, R0, c[4];\n"
"RCP R0.z, R0.z;\n"
"MUL R0.xy, R0, R0.z;\n"
"MUL R0.zw, R0.xyxy, R0.xyxy;\n"
- "MUL R0.xy, R0, c[6];\n"
"ADD R0.z, R0, R0.w;\n"
+ "MUL R0.xy, R0, c[0];\n"
"ADD R0.x, R0, R0.y;\n"
- "MUL R0.z, c[8].x, -R0;\n"
- "MUL R0.y, R0.z, c[7];\n"
- "MUL R0.x, R0, c[7];\n"
- "MAD R0.y, R0.x, R0.x, -R0;\n"
- "RSQ R0.y, R0.y;\n"
- "RCP R0.z, R0.y;\n"
- "ADD R0.x, -R0, R0.z;\n"
- "MUL R0.zw, fragment.position.xyxy, c[9].xyxy;\n"
- "TEX R1, R0.zwzw, texture[0], 2D;\n"
- "MOV R0.y, c[7].x;\n"
- "MUL R0.y, c[8].x, R0;\n"
- "RCP R0.y, R0.y;\n"
- "MUL R0.x, R0, R0.y;\n"
- "TEX R0, R0, texture[2], 1D;\n"
- "ADD R2.x, -R1.w, c[7].z;\n"
- "MUL R2.xyz, R0, R2.x;\n"
- "MAD R0.xyz, R0, R1, R2;\n"
- "ADD R2.x, -R0.w, c[7].z;\n"
- "MAD R2.xyz, R1, R2.x, R0;\n"
- "ADD R0.z, R0.w, R1.w;\n"
- "MAD R2.w, -R0, R1, R0.z;\n"
- "ADD R0.xy, fragment.position, c[0];\n"
- "MUL R0.xy, R0, c[1];\n"
- "TEX R0, R0, texture[1], 2D;\n"
- "ADD R2, R2, -R1;\n"
- "DP4 R0.x, R0, c[2];\n"
- "MAD result.color, R0.x, R2, R1;\n"
+ "MUL R0.z, -R0, c[1].x;\n"
+ "MUL R0.y, R0.x, c[9].x;\n"
+ "MUL R0.z, R0, c[9].y;\n"
+ "MAD R0.x, R0.y, R0.y, -R0.z;\n"
+ "RSQ R0.x, R0.x;\n"
+ "RCP R0.z, R0.x;\n"
+ "ADD R1.x, -R0.y, R0.z;\n"
+ "MOV R0.x, c[9];\n"
+ "MUL R0.z, R0.x, c[1].x;\n"
+ "RCP R1.y, R0.z;\n"
+ "MUL R0.xy, fragment.position, c[6];\n"
+ "TEX R0, R0, texture[0], 2D;\n"
+ "MUL R1.x, R1, R1.y;\n"
+ "TEX R1, R1, texture[2], 1D;\n"
+ "ADD R2.x, -R0.w, c[9].z;\n"
+ "MUL R2.xyz, R1, R2.x;\n"
+ "MAD R1.xyz, R1, R0, R2;\n"
+ "ADD R2.x, -R1.w, c[9].z;\n"
+ "MAD R2.xyz, R0, R2.x, R1;\n"
+ "ADD R1.z, R1.w, R0.w;\n"
+ "MAD R2.w, -R1, R0, R1.z;\n"
+ "ADD R1.xy, fragment.position, c[7];\n"
+ "MUL R1.xy, R1, c[5];\n"
+ "TEX R1, R1, texture[1], 2D;\n"
+ "ADD R2, R2, -R0;\n"
+ "DP4 R1.x, R1, c[8];\n"
+ "MAD result.color, R1.x, R2, R0;\n"
"END\n"
;
static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_RADIAL_COMPOSITION_MODES_SCREEN =
"!!ARBfp1.0\n"
- "PARAM c[10] = { program.local[0..6],\n"
- " { 2, 4 },\n"
- " program.local[8..9] };\n"
+ "PARAM c[10] = { program.local[0..8],\n"
+ " { 2, 4 } };\n"
"TEMP R0;\n"
"TEMP R1;\n"
"TEMP R2;\n"
"TEMP R3;\n"
- "MUL R0.xyz, fragment.position.y, c[4];\n"
- "MAD R0.xyz, fragment.position.x, c[3], R0;\n"
- "ADD R0.xyz, R0, c[5];\n"
+ "MUL R0.xyz, fragment.position.y, c[3];\n"
+ "MAD R0.xyz, fragment.position.x, c[2], R0;\n"
+ "ADD R0.xyz, R0, c[4];\n"
"RCP R0.z, R0.z;\n"
"MUL R0.xy, R0, R0.z;\n"
"MUL R0.zw, R0.xyxy, R0.xyxy;\n"
- "MUL R0.xy, R0, c[6];\n"
"ADD R0.z, R0, R0.w;\n"
+ "MUL R0.xy, R0, c[0];\n"
"ADD R0.x, R0, R0.y;\n"
- "MUL R0.z, c[8].x, -R0;\n"
- "MUL R0.y, R0.z, c[7];\n"
- "MUL R0.x, R0, c[7];\n"
- "MAD R0.y, R0.x, R0.x, -R0;\n"
- "MOV R0.z, c[7].x;\n"
- "RSQ R0.y, R0.y;\n"
- "RCP R0.y, R0.y;\n"
- "MUL R0.z, c[8].x, R0;\n"
- "MUL R1.xy, fragment.position, c[9];\n"
- "ADD R3.xy, fragment.position, c[0];\n"
- "TEX R1, R1, texture[0], 2D;\n"
- "ADD R0.x, -R0, R0.y;\n"
+ "MUL R0.z, -R0, c[1].x;\n"
+ "ADD R3.xy, fragment.position, c[7];\n"
+ "MUL R0.y, R0.z, c[9];\n"
+ "MUL R0.x, R0, c[9];\n"
+ "MAD R0.z, R0.x, R0.x, -R0.y;\n"
+ "MOV R0.y, c[9].x;\n"
+ "RSQ R0.z, R0.z;\n"
"RCP R0.z, R0.z;\n"
- "MUL R0.x, R0, R0.z;\n"
- "TEX R0, R0, texture[2], 1D;\n"
- "ADD R2, R0, R1;\n"
- "MAD R2, -R0, R1, R2;\n"
- "MUL R3.xy, R3, c[1];\n"
- "TEX R0, R3, texture[1], 2D;\n"
- "ADD R2, R2, -R1;\n"
- "DP4 R0.x, R0, c[2];\n"
- "MAD result.color, R0.x, R2, R1;\n"
+ "MUL R0.y, R0, c[1].x;\n"
+ "ADD R0.x, -R0, R0.z;\n"
+ "RCP R0.y, R0.y;\n"
+ "MUL R0.z, R0.x, R0.y;\n"
+ "TEX R1, R0.z, texture[2], 1D;\n"
+ "MUL R0.xy, fragment.position, c[6];\n"
+ "TEX R0, R0, texture[0], 2D;\n"
+ "ADD R2, R1, R0;\n"
+ "MAD R2, -R1, R0, R2;\n"
+ "MUL R3.xy, R3, c[5];\n"
+ "TEX R1, R3, texture[1], 2D;\n"
+ "ADD R2, R2, -R0;\n"
+ "DP4 R1.x, R1, c[8];\n"
+ "MAD result.color, R1.x, R2, R0;\n"
"END\n"
;
static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_RADIAL_COMPOSITION_MODES_OVERLAY =
"!!ARBfp1.0\n"
- "PARAM c[10] = { program.local[0..6],\n"
- " { 2, 4, 1 },\n"
- " program.local[8..9] };\n"
+ "PARAM c[10] = { program.local[0..8],\n"
+ " { 2, 4, 1 } };\n"
"TEMP R0;\n"
"TEMP R1;\n"
"TEMP R2;\n"
"TEMP R3;\n"
"TEMP R4;\n"
- "MUL R0.xyz, fragment.position.y, c[4];\n"
- "MAD R0.xyz, fragment.position.x, c[3], R0;\n"
- "ADD R0.xyz, R0, c[5];\n"
+ "MUL R0.xyz, fragment.position.y, c[3];\n"
+ "MAD R0.xyz, fragment.position.x, c[2], R0;\n"
+ "ADD R0.xyz, R0, c[4];\n"
"RCP R0.z, R0.z;\n"
"MUL R0.xy, R0, R0.z;\n"
"MUL R0.zw, R0.xyxy, R0.xyxy;\n"
- "MUL R0.xy, R0, c[6];\n"
+ "MUL R0.xy, R0, c[0];\n"
"ADD R0.z, R0, R0.w;\n"
"ADD R0.x, R0, R0.y;\n"
- "MUL R0.z, c[8].x, -R0;\n"
- "MUL R0.y, R0.z, c[7];\n"
- "MUL R0.x, R0, c[7];\n"
- "MAD R0.y, R0.x, R0.x, -R0;\n"
- "MOV R0.z, c[7].x;\n"
- "RSQ R0.y, R0.y;\n"
- "RCP R0.y, R0.y;\n"
- "MUL R0.z, c[8].x, R0;\n"
- "MUL R1.xy, fragment.position, c[9];\n"
+ "MUL R0.z, -R0, c[1].x;\n"
+ "MUL R1.xy, fragment.position, c[6];\n"
"TEX R1, R1, texture[0], 2D;\n"
- "ADD R0.x, -R0, R0.y;\n"
+ "MUL R0.y, R0.z, c[9];\n"
+ "MUL R0.x, R0, c[9];\n"
+ "MAD R0.z, R0.x, R0.x, -R0.y;\n"
+ "MOV R0.y, c[9].x;\n"
+ "RSQ R0.z, R0.z;\n"
"RCP R0.z, R0.z;\n"
- "MUL R0.x, R0, R0.z;\n"
+ "MUL R0.y, R0, c[1].x;\n"
+ "ADD R0.x, -R0, R0.z;\n"
+ "RCP R0.y, R0.y;\n"
+ "MUL R0.x, R0, R0.y;\n"
"TEX R0, R0, texture[2], 1D;\n"
- "ADD R2.w, -R1, c[7].z;\n"
+ "ADD R2.w, -R1, c[9].z;\n"
"ADD R3.xyz, R0.w, -R0;\n"
"ADD R2.xyz, R1.w, -R1;\n"
"MUL R2.xyz, R2, R3;\n"
- "MUL R2.xyz, R2, c[7].x;\n"
+ "MUL R2.xyz, R2, c[9].x;\n"
"MAD R2.xyz, R0.w, R1.w, -R2;\n"
"MUL R4.xyz, R0, R2.w;\n"
"MUL R3.xyz, R0, R1;\n"
"MAD R0.xyz, R0, R2.w, R2;\n"
- "ADD R2.x, -R0.w, c[7].z;\n"
- "MAD R3.xyz, R3, c[7].x, R4;\n"
+ "ADD R2.x, -R0.w, c[9].z;\n"
+ "MAD R3.xyz, R3, c[9].x, R4;\n"
"MAD R3.xyz, R1, R2.x, R3;\n"
"MAD R0.xyz, R1, R2.x, R0;\n"
- "MUL R2.xyz, R1, c[7].x;\n"
+ "MUL R2.xyz, R1, c[9].x;\n"
"ADD R0.xyz, R0, -R3;\n"
"SGE R2.xyz, R2, R1.w;\n"
"MAD R2.xyz, R2, R0, R3;\n"
"ADD R0.z, R0.w, R1.w;\n"
"MAD R2.w, -R0, R1, R0.z;\n"
- "ADD R0.xy, fragment.position, c[0];\n"
- "MUL R0.xy, R0, c[1];\n"
+ "ADD R0.xy, fragment.position, c[7];\n"
+ "MUL R0.xy, R0, c[5];\n"
"TEX R0, R0, texture[1], 2D;\n"
"ADD R2, R2, -R1;\n"
- "DP4 R0.x, R0, c[2];\n"
+ "DP4 R0.x, R0, c[8];\n"
"MAD result.color, R0.x, R2, R1;\n"
"END\n"
;
static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_RADIAL_COMPOSITION_MODES_DARKEN =
"!!ARBfp1.0\n"
- "PARAM c[10] = { program.local[0..6],\n"
- " { 2, 4, 1 },\n"
- " program.local[8..9] };\n"
+ "PARAM c[10] = { program.local[0..8],\n"
+ " { 2, 4, 1 } };\n"
"TEMP R0;\n"
"TEMP R1;\n"
"TEMP R2;\n"
"TEMP R3;\n"
- "MUL R0.xyz, fragment.position.y, c[4];\n"
- "MAD R0.xyz, fragment.position.x, c[3], R0;\n"
- "ADD R0.xyz, R0, c[5];\n"
+ "MUL R0.xyz, fragment.position.y, c[3];\n"
+ "MAD R0.xyz, fragment.position.x, c[2], R0;\n"
+ "ADD R0.xyz, R0, c[4];\n"
"RCP R0.z, R0.z;\n"
"MUL R0.xy, R0, R0.z;\n"
"MUL R0.zw, R0.xyxy, R0.xyxy;\n"
- "MUL R0.xy, R0, c[6];\n"
"ADD R0.z, R0, R0.w;\n"
+ "MUL R0.xy, R0, c[0];\n"
"ADD R0.x, R0, R0.y;\n"
- "MUL R0.z, c[8].x, -R0;\n"
- "MUL R0.y, R0.z, c[7];\n"
- "MUL R0.x, R0, c[7];\n"
- "MAD R0.y, R0.x, R0.x, -R0;\n"
- "MOV R0.z, c[7].x;\n"
- "RSQ R0.y, R0.y;\n"
- "RCP R0.y, R0.y;\n"
- "MUL R0.z, c[8].x, R0;\n"
- "MUL R1.xy, fragment.position, c[9];\n"
- "TEX R1, R1, texture[0], 2D;\n"
- "ADD R0.x, -R0, R0.y;\n"
- "RCP R0.z, R0.z;\n"
- "MUL R0.x, R0, R0.z;\n"
- "TEX R0, R0, texture[2], 1D;\n"
- "MUL R3.xyz, R1, R0.w;\n"
- "MUL R2.xyz, R0, R1.w;\n"
+ "MUL R0.z, -R0, c[1].x;\n"
+ "MUL R0.y, R0.x, c[9].x;\n"
+ "MUL R0.z, R0, c[9].y;\n"
+ "MAD R0.x, R0.y, R0.y, -R0.z;\n"
+ "RSQ R0.z, R0.x;\n"
+ "MOV R0.x, c[9];\n"
+ "MUL R0.x, R0, c[1];\n"
+ "RCP R0.z, R0.z;\n"
+ "ADD R0.z, -R0.y, R0;\n"
+ "RCP R0.w, R0.x;\n"
+ "MUL R1.x, R0.z, R0.w;\n"
+ "MUL R0.xy, fragment.position, c[6];\n"
+ "TEX R0, R0, texture[0], 2D;\n"
+ "TEX R1, R1, texture[2], 1D;\n"
+ "MUL R3.xyz, R1.w, R0;\n"
+ "MUL R2.xyz, R1, R0.w;\n"
"MIN R2.xyz, R2, R3;\n"
- "ADD R2.w, -R1, c[7].z;\n"
- "MAD R0.xyz, R0, R2.w, R2;\n"
- "ADD R2.x, -R0.w, c[7].z;\n"
- "MAD R2.xyz, R1, R2.x, R0;\n"
- "ADD R0.z, R0.w, R1.w;\n"
- "MAD R2.w, -R0, R1, R0.z;\n"
- "ADD R0.xy, fragment.position, c[0];\n"
- "MUL R0.xy, R0, c[1];\n"
- "TEX R0, R0, texture[1], 2D;\n"
- "ADD R2, R2, -R1;\n"
- "DP4 R0.x, R0, c[2];\n"
- "MAD result.color, R0.x, R2, R1;\n"
+ "ADD R2.w, -R0, c[9].z;\n"
+ "MAD R1.xyz, R1, R2.w, R2;\n"
+ "ADD R2.x, -R1.w, c[9].z;\n"
+ "MAD R2.xyz, R0, R2.x, R1;\n"
+ "ADD R1.z, R1.w, R0.w;\n"
+ "MAD R2.w, -R1, R0, R1.z;\n"
+ "ADD R1.xy, fragment.position, c[7];\n"
+ "MUL R1.xy, R1, c[5];\n"
+ "TEX R1, R1, texture[1], 2D;\n"
+ "ADD R2, R2, -R0;\n"
+ "DP4 R1.x, R1, c[8];\n"
+ "MAD result.color, R1.x, R2, R0;\n"
"END\n"
;
static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_RADIAL_COMPOSITION_MODES_LIGHTEN =
"!!ARBfp1.0\n"
- "PARAM c[10] = { program.local[0..6],\n"
- " { 2, 4, 1 },\n"
- " program.local[8..9] };\n"
+ "PARAM c[10] = { program.local[0..8],\n"
+ " { 2, 4, 1 } };\n"
"TEMP R0;\n"
"TEMP R1;\n"
"TEMP R2;\n"
"TEMP R3;\n"
- "MUL R0.xyz, fragment.position.y, c[4];\n"
- "MAD R0.xyz, fragment.position.x, c[3], R0;\n"
- "ADD R0.xyz, R0, c[5];\n"
+ "MUL R0.xyz, fragment.position.y, c[3];\n"
+ "MAD R0.xyz, fragment.position.x, c[2], R0;\n"
+ "ADD R0.xyz, R0, c[4];\n"
"RCP R0.z, R0.z;\n"
"MUL R0.xy, R0, R0.z;\n"
"MUL R0.zw, R0.xyxy, R0.xyxy;\n"
- "MUL R0.xy, R0, c[6];\n"
"ADD R0.z, R0, R0.w;\n"
+ "MUL R0.xy, R0, c[0];\n"
"ADD R0.x, R0, R0.y;\n"
- "MUL R0.z, c[8].x, -R0;\n"
- "MUL R0.y, R0.z, c[7];\n"
- "MUL R0.x, R0, c[7];\n"
- "MAD R0.y, R0.x, R0.x, -R0;\n"
- "MOV R0.z, c[7].x;\n"
- "RSQ R0.y, R0.y;\n"
- "RCP R0.y, R0.y;\n"
- "MUL R0.z, c[8].x, R0;\n"
- "MUL R1.xy, fragment.position, c[9];\n"
- "TEX R1, R1, texture[0], 2D;\n"
- "ADD R0.x, -R0, R0.y;\n"
- "RCP R0.z, R0.z;\n"
- "MUL R0.x, R0, R0.z;\n"
- "TEX R0, R0, texture[2], 1D;\n"
- "MUL R3.xyz, R1, R0.w;\n"
- "MUL R2.xyz, R0, R1.w;\n"
+ "MUL R0.z, -R0, c[1].x;\n"
+ "MUL R0.y, R0.x, c[9].x;\n"
+ "MUL R0.z, R0, c[9].y;\n"
+ "MAD R0.x, R0.y, R0.y, -R0.z;\n"
+ "RSQ R0.z, R0.x;\n"
+ "MOV R0.x, c[9];\n"
+ "MUL R0.x, R0, c[1];\n"
+ "RCP R0.z, R0.z;\n"
+ "ADD R0.z, -R0.y, R0;\n"
+ "RCP R0.w, R0.x;\n"
+ "MUL R1.x, R0.z, R0.w;\n"
+ "MUL R0.xy, fragment.position, c[6];\n"
+ "TEX R0, R0, texture[0], 2D;\n"
+ "TEX R1, R1, texture[2], 1D;\n"
+ "MUL R3.xyz, R1.w, R0;\n"
+ "MUL R2.xyz, R1, R0.w;\n"
"MAX R2.xyz, R2, R3;\n"
- "ADD R2.w, -R1, c[7].z;\n"
- "MAD R0.xyz, R0, R2.w, R2;\n"
- "ADD R2.x, -R0.w, c[7].z;\n"
- "MAD R2.xyz, R1, R2.x, R0;\n"
- "ADD R0.z, R0.w, R1.w;\n"
- "MAD R2.w, -R0, R1, R0.z;\n"
- "ADD R0.xy, fragment.position, c[0];\n"
- "MUL R0.xy, R0, c[1];\n"
- "TEX R0, R0, texture[1], 2D;\n"
- "ADD R2, R2, -R1;\n"
- "DP4 R0.x, R0, c[2];\n"
- "MAD result.color, R0.x, R2, R1;\n"
+ "ADD R2.w, -R0, c[9].z;\n"
+ "MAD R1.xyz, R1, R2.w, R2;\n"
+ "ADD R2.x, -R1.w, c[9].z;\n"
+ "MAD R2.xyz, R0, R2.x, R1;\n"
+ "ADD R1.z, R1.w, R0.w;\n"
+ "MAD R2.w, -R1, R0, R1.z;\n"
+ "ADD R1.xy, fragment.position, c[7];\n"
+ "MUL R1.xy, R1, c[5];\n"
+ "TEX R1, R1, texture[1], 2D;\n"
+ "ADD R2, R2, -R0;\n"
+ "DP4 R1.x, R1, c[8];\n"
+ "MAD result.color, R1.x, R2, R0;\n"
"END\n"
;
static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_RADIAL_COMPOSITION_MODES_COLORDODGE =
"!!ARBfp1.0\n"
- "PARAM c[10] = { program.local[0..6],\n"
- " { 2, 4, 1, 1e-06 },\n"
- " program.local[8..9] };\n"
+ "PARAM c[10] = { program.local[0..8],\n"
+ " { 2, 4, 1, 1e-006 } };\n"
"TEMP R0;\n"
"TEMP R1;\n"
"TEMP R2;\n"
"TEMP R3;\n"
"TEMP R4;\n"
- "MUL R0.xyz, fragment.position.y, c[4];\n"
- "MAD R0.xyz, fragment.position.x, c[3], R0;\n"
- "ADD R0.xyz, R0, c[5];\n"
+ "MUL R0.xyz, fragment.position.y, c[3];\n"
+ "MAD R0.xyz, fragment.position.x, c[2], R0;\n"
+ "ADD R0.xyz, R0, c[4];\n"
"RCP R0.z, R0.z;\n"
"MUL R0.xy, R0, R0.z;\n"
"MUL R0.zw, R0.xyxy, R0.xyxy;\n"
- "MUL R0.xy, R0, c[6];\n"
+ "MUL R0.xy, R0, c[0];\n"
"ADD R0.z, R0, R0.w;\n"
"ADD R0.x, R0, R0.y;\n"
- "MUL R0.z, c[8].x, -R0;\n"
- "MUL R0.y, R0.z, c[7];\n"
- "MUL R0.x, R0, c[7];\n"
- "MAD R0.y, R0.x, R0.x, -R0;\n"
- "MOV R0.z, c[7].x;\n"
- "RSQ R0.y, R0.y;\n"
- "RCP R0.y, R0.y;\n"
- "MUL R0.z, c[8].x, R0;\n"
- "ADD R0.x, -R0, R0.y;\n"
+ "MUL R0.z, -R0, c[1].x;\n"
+ "MUL R0.y, R0.z, c[9];\n"
+ "MUL R0.x, R0, c[9];\n"
+ "MAD R0.z, R0.x, R0.x, -R0.y;\n"
+ "MOV R0.y, c[9].x;\n"
+ "RSQ R0.z, R0.z;\n"
"RCP R0.z, R0.z;\n"
- "MUL R0.x, R0, R0.z;\n"
+ "MUL R0.y, R0, c[1].x;\n"
+ "ADD R0.x, -R0, R0.z;\n"
+ "RCP R0.y, R0.y;\n"
+ "MUL R0.x, R0, R0.y;\n"
"TEX R0, R0, texture[2], 1D;\n"
- "MAX R1.x, R0.w, c[7].w;\n"
+ "MAX R1.x, R0.w, c[9].w;\n"
"RCP R1.x, R1.x;\n"
- "MAD R1.xyz, -R0, R1.x, c[7].z;\n"
- "MAX R2.xyz, R1, c[7].w;\n"
- "MUL R1.xy, fragment.position, c[9];\n"
+ "MAD R1.xyz, -R0, R1.x, c[9].z;\n"
+ "MAX R2.xyz, R1, c[9].w;\n"
+ "MUL R1.xy, fragment.position, c[6];\n"
"TEX R1, R1, texture[0], 2D;\n"
- "ADD R2.w, -R0, c[7].z;\n"
+ "ADD R2.w, -R0, c[9].z;\n"
"MUL R3.xyz, R1, R2.w;\n"
- "ADD R2.w, -R1, c[7].z;\n"
+ "ADD R2.w, -R1, c[9].z;\n"
"MAD R4.xyz, R0, R2.w, R3;\n"
- "MUL R3.xyz, R1, R0.w;\n"
+ "MUL R3.xyz, R0.w, R1;\n"
"MUL R2.w, R0, R1;\n"
"MAD R0.xyz, R0, R1.w, R3;\n"
"SGE R0.xyz, R0, R2.w;\n"
@@ -1339,57 +1270,56 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_RADIAL_COMPOSITION_MOD
"MAD R2.xyz, R0, R4, R2;\n"
"ADD R0.z, R0.w, R1.w;\n"
"MAD R2.w, -R0, R1, R0.z;\n"
- "ADD R0.xy, fragment.position, c[0];\n"
- "MUL R0.xy, R0, c[1];\n"
+ "ADD R0.xy, fragment.position, c[7];\n"
+ "MUL R0.xy, R0, c[5];\n"
"TEX R0, R0, texture[1], 2D;\n"
"ADD R2, R2, -R1;\n"
- "DP4 R0.x, R0, c[2];\n"
+ "DP4 R0.x, R0, c[8];\n"
"MAD result.color, R0.x, R2, R1;\n"
"END\n"
;
static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_RADIAL_COMPOSITION_MODES_COLORBURN =
"!!ARBfp1.0\n"
- "PARAM c[10] = { program.local[0..6],\n"
- " { 2, 4, 1, 9.9999997e-06 },\n"
- " program.local[8..9] };\n"
+ "PARAM c[10] = { program.local[0..8],\n"
+ " { 2, 4, 1, 9.9999997e-006 } };\n"
"TEMP R0;\n"
"TEMP R1;\n"
"TEMP R2;\n"
"TEMP R3;\n"
"TEMP R4;\n"
"TEMP R5;\n"
- "MUL R0.xyz, fragment.position.y, c[4];\n"
- "MAD R0.xyz, fragment.position.x, c[3], R0;\n"
- "ADD R0.xyz, R0, c[5];\n"
+ "MUL R0.xyz, fragment.position.y, c[3];\n"
+ "MAD R0.xyz, fragment.position.x, c[2], R0;\n"
+ "ADD R0.xyz, R0, c[4];\n"
"RCP R0.z, R0.z;\n"
"MUL R0.xy, R0, R0.z;\n"
"MUL R0.zw, R0.xyxy, R0.xyxy;\n"
- "MUL R0.xy, R0, c[6];\n"
"ADD R0.z, R0, R0.w;\n"
+ "MUL R0.xy, R0, c[0];\n"
"ADD R0.x, R0, R0.y;\n"
- "MUL R0.z, c[8].x, -R0;\n"
- "MUL R0.y, R0.z, c[7];\n"
- "MUL R0.x, R0, c[7];\n"
+ "MUL R0.z, -R0, c[1].x;\n"
+ "MUL R0.y, R0.z, c[9];\n"
+ "MUL R0.x, R0, c[9];\n"
"MAD R0.y, R0.x, R0.x, -R0;\n"
- "MOV R0.z, c[7].x;\n"
- "RSQ R0.y, R0.y;\n"
- "RCP R0.y, R0.y;\n"
- "MUL R0.z, c[8].x, R0;\n"
- "MUL R1.xy, fragment.position, c[9];\n"
- "TEX R1, R1, texture[0], 2D;\n"
- "ADD R0.x, -R0, R0.y;\n"
+ "RSQ R0.z, R0.y;\n"
"RCP R0.z, R0.z;\n"
- "MUL R0.x, R0, R0.z;\n"
+ "ADD R0.x, -R0, R0.z;\n"
+ "MUL R0.zw, fragment.position.xyxy, c[6].xyxy;\n"
+ "TEX R1, R0.zwzw, texture[0], 2D;\n"
+ "MOV R0.y, c[9].x;\n"
+ "MUL R0.y, R0, c[1].x;\n"
+ "RCP R0.y, R0.y;\n"
+ "MUL R0.x, R0, R0.y;\n"
"TEX R0, R0, texture[2], 1D;\n"
- "MUL R2.xyz, R1, R0.w;\n"
+ "MUL R2.xyz, R0.w, R1;\n"
"MAD R3.xyz, R0, R1.w, R2;\n"
"MAD R2.xyz, -R0.w, R1.w, R3;\n"
"MUL R4.xyz, R0.w, R2;\n"
- "MAX R2.xyz, R0, c[7].w;\n"
- "ADD R2.w, -R1, c[7].z;\n"
+ "MAX R2.xyz, R0, c[9].w;\n"
+ "ADD R2.w, -R1, c[9].z;\n"
"MUL R5.xyz, R0, R2.w;\n"
- "ADD R3.w, -R0, c[7].z;\n"
+ "ADD R3.w, -R0, c[9].z;\n"
"RCP R2.x, R2.x;\n"
"RCP R2.y, R2.y;\n"
"RCP R2.z, R2.z;\n"
@@ -1403,60 +1333,59 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_RADIAL_COMPOSITION_MOD
"MAD R2.xyz, R3, R2, R0;\n"
"ADD R0.z, R0.w, R1.w;\n"
"MAD R2.w, -R0, R1, R0.z;\n"
- "ADD R0.xy, fragment.position, c[0];\n"
- "MUL R0.xy, R0, c[1];\n"
+ "ADD R0.xy, fragment.position, c[7];\n"
+ "MUL R0.xy, R0, c[5];\n"
"TEX R0, R0, texture[1], 2D;\n"
"ADD R2, R2, -R1;\n"
- "DP4 R0.x, R0, c[2];\n"
+ "DP4 R0.x, R0, c[8];\n"
"MAD result.color, R0.x, R2, R1;\n"
"END\n"
;
static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_RADIAL_COMPOSITION_MODES_HARDLIGHT =
"!!ARBfp1.0\n"
- "PARAM c[10] = { program.local[0..6],\n"
- " { 2, 4, 1 },\n"
- " program.local[8..9] };\n"
+ "PARAM c[10] = { program.local[0..8],\n"
+ " { 2, 4, 1 } };\n"
"TEMP R0;\n"
"TEMP R1;\n"
"TEMP R2;\n"
"TEMP R3;\n"
"TEMP R4;\n"
- "MUL R0.xyz, fragment.position.y, c[4];\n"
- "MAD R0.xyz, fragment.position.x, c[3], R0;\n"
- "ADD R0.xyz, R0, c[5];\n"
+ "MUL R0.xyz, fragment.position.y, c[3];\n"
+ "MAD R0.xyz, fragment.position.x, c[2], R0;\n"
+ "ADD R0.xyz, R0, c[4];\n"
"RCP R0.z, R0.z;\n"
"MUL R0.xy, R0, R0.z;\n"
"MUL R0.zw, R0.xyxy, R0.xyxy;\n"
- "MUL R0.xy, R0, c[6];\n"
+ "MUL R0.xy, R0, c[0];\n"
"ADD R0.z, R0, R0.w;\n"
"ADD R0.x, R0, R0.y;\n"
- "MUL R0.z, c[8].x, -R0;\n"
- "MUL R0.y, R0.z, c[7];\n"
- "MUL R0.x, R0, c[7];\n"
- "MAD R0.y, R0.x, R0.x, -R0;\n"
- "MOV R0.z, c[7].x;\n"
- "RSQ R0.y, R0.y;\n"
- "RCP R0.y, R0.y;\n"
- "MUL R0.z, c[8].x, R0;\n"
- "MUL R1.xy, fragment.position, c[9];\n"
+ "MUL R0.z, -R0, c[1].x;\n"
+ "MUL R1.xy, fragment.position, c[6];\n"
"TEX R1, R1, texture[0], 2D;\n"
- "ADD R0.x, -R0, R0.y;\n"
+ "MUL R0.y, R0.z, c[9];\n"
+ "MUL R0.x, R0, c[9];\n"
+ "MAD R0.z, R0.x, R0.x, -R0.y;\n"
+ "MOV R0.y, c[9].x;\n"
+ "RSQ R0.z, R0.z;\n"
"RCP R0.z, R0.z;\n"
- "MUL R0.x, R0, R0.z;\n"
+ "MUL R0.y, R0, c[1].x;\n"
+ "ADD R0.x, -R0, R0.z;\n"
+ "RCP R0.y, R0.y;\n"
+ "MUL R0.x, R0, R0.y;\n"
"TEX R0, R0, texture[2], 1D;\n"
- "ADD R2.w, -R1, c[7].z;\n"
+ "ADD R2.w, -R1, c[9].z;\n"
"ADD R3.xyz, R0.w, -R0;\n"
"ADD R2.xyz, R1.w, -R1;\n"
"MUL R2.xyz, R2, R3;\n"
- "MUL R2.xyz, R2, c[7].x;\n"
+ "MUL R2.xyz, R2, c[9].x;\n"
"MAD R2.xyz, R0.w, R1.w, -R2;\n"
"MUL R4.xyz, R0, R2.w;\n"
"MAD R2.xyz, R0, R2.w, R2;\n"
"MUL R3.xyz, R0, R1;\n"
- "ADD R2.w, -R0, c[7].z;\n"
- "MAD R3.xyz, R3, c[7].x, R4;\n"
- "MUL R0.xyz, R0, c[7].x;\n"
+ "ADD R2.w, -R0, c[9].z;\n"
+ "MAD R3.xyz, R3, c[9].x, R4;\n"
+ "MUL R0.xyz, R0, c[9].x;\n"
"SGE R0.xyz, R0, R0.w;\n"
"MAD R3.xyz, R1, R2.w, R3;\n"
"MAD R2.xyz, R1, R2.w, R2;\n"
@@ -1464,21 +1393,20 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_RADIAL_COMPOSITION_MOD
"MAD R2.xyz, R0, R2, R3;\n"
"ADD R0.z, R0.w, R1.w;\n"
"MAD R2.w, -R0, R1, R0.z;\n"
- "ADD R0.xy, fragment.position, c[0];\n"
- "MUL R0.xy, R0, c[1];\n"
+ "ADD R0.xy, fragment.position, c[7];\n"
+ "MUL R0.xy, R0, c[5];\n"
"TEX R0, R0, texture[1], 2D;\n"
"ADD R2, R2, -R1;\n"
- "DP4 R0.x, R0, c[2];\n"
+ "DP4 R0.x, R0, c[8];\n"
"MAD result.color, R0.x, R2, R1;\n"
"END\n"
;
static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_RADIAL_COMPOSITION_MODES_SOFTLIGHT =
"!!ARBfp1.0\n"
- "PARAM c[11] = { program.local[0..6],\n"
- " { 2, 4, 1, 9.9999997e-06 },\n"
- " program.local[8..9],\n"
- " { 8, 3 } };\n"
+ "PARAM c[11] = { program.local[0..8],\n"
+ " { 2, 4, 1, 9.9999997e-006 },\n"
+ " { 3, 8 } };\n"
"TEMP R0;\n"
"TEMP R1;\n"
"TEMP R2;\n"
@@ -1486,259 +1414,252 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_RADIAL_COMPOSITION_MOD
"TEMP R4;\n"
"TEMP R5;\n"
"TEMP R6;\n"
- "MUL R0.xyz, fragment.position.y, c[4];\n"
- "MAD R0.xyz, fragment.position.x, c[3], R0;\n"
- "ADD R0.xyz, R0, c[5];\n"
+ "MUL R0.xyz, fragment.position.y, c[3];\n"
+ "MAD R0.xyz, fragment.position.x, c[2], R0;\n"
+ "ADD R0.xyz, R0, c[4];\n"
"RCP R0.z, R0.z;\n"
"MUL R0.xy, R0, R0.z;\n"
"MUL R0.zw, R0.xyxy, R0.xyxy;\n"
- "MUL R0.xy, R0, c[6];\n"
+ "MUL R0.xy, R0, c[0];\n"
"ADD R0.z, R0, R0.w;\n"
"ADD R0.x, R0, R0.y;\n"
- "MUL R0.z, c[8].x, -R0;\n"
- "MUL R0.y, R0.z, c[7];\n"
- "MUL R0.zw, fragment.position.xyxy, c[9].xyxy;\n"
- "TEX R1, R0.zwzw, texture[0], 2D;\n"
- "MUL R0.x, R0, c[7];\n"
+ "MUL R0.z, -R0, c[1].x;\n"
+ "MUL R0.y, R0.z, c[9];\n"
+ "MUL R0.x, R0, c[9];\n"
"MAD R0.y, R0.x, R0.x, -R0;\n"
- "MAX R0.z, R1.w, c[7].w;\n"
- "RCP R2.w, R0.z;\n"
- "MUL R2.xyz, R1, R2.w;\n"
- "MUL R6.xyz, -R2, c[10].x;\n"
- "MAD R3.xyz, -R1, R2.w, c[7].z;\n"
+ "MOV R0.z, c[9].x;\n"
+ "MUL R1.y, R0.z, c[1].x;\n"
"RSQ R0.y, R0.y;\n"
"RCP R0.y, R0.y;\n"
- "ADD R0.x, -R0, R0.y;\n"
- "MOV R0.y, c[7].x;\n"
- "MUL R0.y, c[8].x, R0;\n"
- "RCP R0.y, R0.y;\n"
- "MUL R0.x, R0, R0.y;\n"
- "TEX R0, R0, texture[2], 1D;\n"
- "MAD R4.xyz, R0, c[7].x, -R0.w;\n"
+ "ADD R1.x, -R0, R0.y;\n"
+ "RCP R1.y, R1.y;\n"
+ "MUL R0.xy, fragment.position, c[6];\n"
+ "TEX R0, R0, texture[0], 2D;\n"
+ "MAX R1.z, R0.w, c[9].w;\n"
+ "RCP R2.w, R1.z;\n"
+ "MUL R2.xyz, R0, R2.w;\n"
+ "MAD R6.xyz, -R2, c[10].y, c[10].x;\n"
+ "MAD R3.xyz, -R0, R2.w, c[9].z;\n"
+ "RSQ R2.w, R2.x;\n"
+ "RCP R2.x, R2.w;\n"
+ "MUL R1.x, R1, R1.y;\n"
+ "TEX R1, R1, texture[2], 1D;\n"
+ "MAD R4.xyz, R1, c[9].x, -R1.w;\n"
"MUL R5.xyz, R3, R4;\n"
- "MAD R3.xyz, -R3, R4, R0.w;\n"
- "ADD R6.xyz, R6, c[10].y;\n"
- "RSQ R2.x, R2.x;\n"
+ "MAD R5.xyz, -R5, R6, R1.w;\n"
+ "MAD R3.xyz, -R3, R4, R1.w;\n"
"RSQ R2.z, R2.z;\n"
"RSQ R2.y, R2.y;\n"
- "MAD R5.xyz, -R5, R6, R0.w;\n"
- "MUL R3.xyz, R1, R3;\n"
- "ADD R2.w, -R1, c[7].z;\n"
- "RCP R2.x, R2.x;\n"
+ "MUL R5.xyz, R0, R5;\n"
+ "MUL R3.xyz, R0, R3;\n"
+ "ADD R2.w, -R0, c[9].z;\n"
"RCP R2.z, R2.z;\n"
"RCP R2.y, R2.y;\n"
- "MAD R2.xyz, R2, R1.w, -R1;\n"
- "MUL R6.xyz, R2, R4;\n"
- "MUL R2.xyz, R1, R5;\n"
- "MAD R6.xyz, R1, R0.w, R6;\n"
- "MUL R4.xyz, R0, c[7].x;\n"
- "MUL R5.xyz, R1, c[10].x;\n"
- "ADD R6.xyz, R6, -R2;\n"
- "SGE R5.xyz, R5, R1.w;\n"
- "MUL R5.xyz, R5, R6;\n"
- "ADD R2.xyz, R2, R5;\n"
- "SGE R4.xyz, R4, R0.w;\n"
+ "MAD R2.xyz, R0.w, R2, -R0;\n"
+ "MUL R2.xyz, R2, R4;\n"
+ "MAD R2.xyz, R1.w, R0, R2;\n"
+ "ADD R6.xyz, R2, -R5;\n"
+ "MUL R4.xyz, R1, c[9].x;\n"
+ "MUL R2.xyz, R0, c[10].y;\n"
+ "SGE R2.xyz, R2, R0.w;\n"
+ "MAD R2.xyz, R2, R6, R5;\n"
+ "SGE R4.xyz, R4, R1.w;\n"
"ADD R2.xyz, R2, -R3;\n"
- "MUL R2.xyz, R4, R2;\n"
- "ADD R2.xyz, R3, R2;\n"
- "MAD R0.xyz, R0, R2.w, R2;\n"
- "ADD R2.x, -R0.w, c[7].z;\n"
- "MAD R2.xyz, R1, R2.x, R0;\n"
- "ADD R0.z, R0.w, R1.w;\n"
- "MAD R2.w, -R0, R1, R0.z;\n"
- "ADD R0.xy, fragment.position, c[0];\n"
- "MUL R0.xy, R0, c[1];\n"
- "TEX R0, R0, texture[1], 2D;\n"
- "ADD R2, R2, -R1;\n"
- "DP4 R0.x, R0, c[2];\n"
- "MAD result.color, R0.x, R2, R1;\n"
+ "MAD R2.xyz, R4, R2, R3;\n"
+ "MAD R1.xyz, R1, R2.w, R2;\n"
+ "ADD R2.x, -R1.w, c[9].z;\n"
+ "MAD R2.xyz, R0, R2.x, R1;\n"
+ "ADD R1.z, R1.w, R0.w;\n"
+ "MAD R2.w, -R1, R0, R1.z;\n"
+ "ADD R1.xy, fragment.position, c[7];\n"
+ "MUL R1.xy, R1, c[5];\n"
+ "TEX R1, R1, texture[1], 2D;\n"
+ "ADD R2, R2, -R0;\n"
+ "DP4 R1.x, R1, c[8];\n"
+ "MAD result.color, R1.x, R2, R0;\n"
"END\n"
;
static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_RADIAL_COMPOSITION_MODES_DIFFERENCE =
"!!ARBfp1.0\n"
- "PARAM c[10] = { program.local[0..6],\n"
- " { 2, 4 },\n"
- " program.local[8..9] };\n"
+ "PARAM c[10] = { program.local[0..8],\n"
+ " { 2, 4 } };\n"
"TEMP R0;\n"
"TEMP R1;\n"
"TEMP R2;\n"
"TEMP R3;\n"
- "MUL R0.xyz, fragment.position.y, c[4];\n"
- "MAD R0.xyz, fragment.position.x, c[3], R0;\n"
- "ADD R0.xyz, R0, c[5];\n"
+ "MUL R0.xyz, fragment.position.y, c[3];\n"
+ "MAD R0.xyz, fragment.position.x, c[2], R0;\n"
+ "ADD R0.xyz, R0, c[4];\n"
"RCP R0.z, R0.z;\n"
"MUL R0.xy, R0, R0.z;\n"
"MUL R0.zw, R0.xyxy, R0.xyxy;\n"
"ADD R0.z, R0, R0.w;\n"
- "MUL R0.xy, R0, c[6];\n"
+ "MUL R0.xy, R0, c[0];\n"
"ADD R0.x, R0, R0.y;\n"
- "MUL R0.z, c[8].x, -R0;\n"
- "MUL R0.y, R0.z, c[7];\n"
- "MUL R0.x, R0, c[7];\n"
- "MAD R0.y, R0.x, R0.x, -R0;\n"
- "RSQ R0.z, R0.y;\n"
- "RCP R0.z, R0.z;\n"
- "ADD R0.x, -R0, R0.z;\n"
- "MUL R0.zw, fragment.position.xyxy, c[9].xyxy;\n"
- "MOV R0.y, c[7].x;\n"
- "MUL R0.y, c[8].x, R0;\n"
- "RCP R0.y, R0.y;\n"
- "TEX R1, R0.zwzw, texture[0], 2D;\n"
- "MUL R0.x, R0, R0.y;\n"
- "TEX R0, R0, texture[2], 1D;\n"
- "ADD R3.xyz, R0, R1;\n"
- "MUL R2.xyz, R1, R0.w;\n"
- "MUL R0.xyz, R0, R1.w;\n"
- "MIN R0.xyz, R0, R2;\n"
- "MAD R2.xyz, -R0, c[7].x, R3;\n"
- "ADD R0.z, R0.w, R1.w;\n"
- "MAD R2.w, -R0, R1, R0.z;\n"
- "ADD R0.xy, fragment.position, c[0];\n"
- "MUL R0.xy, R0, c[1];\n"
- "TEX R0, R0, texture[1], 2D;\n"
- "ADD R2, R2, -R1;\n"
- "DP4 R0.x, R0, c[2];\n"
- "MAD result.color, R0.x, R2, R1;\n"
+ "MUL R0.z, -R0, c[1].x;\n"
+ "MUL R0.y, R0.x, c[9].x;\n"
+ "MUL R0.z, R0, c[9].y;\n"
+ "MAD R0.x, R0.y, R0.y, -R0.z;\n"
+ "RSQ R0.z, R0.x;\n"
+ "MOV R0.x, c[9];\n"
+ "MUL R0.x, R0, c[1];\n"
+ "RCP R0.z, R0.z;\n"
+ "ADD R0.z, -R0.y, R0;\n"
+ "RCP R0.w, R0.x;\n"
+ "MUL R1.x, R0.z, R0.w;\n"
+ "MUL R0.xy, fragment.position, c[6];\n"
+ "TEX R0, R0, texture[0], 2D;\n"
+ "TEX R1, R1, texture[2], 1D;\n"
+ "ADD R2.xyz, R1, R0;\n"
+ "MUL R3.xyz, R1.w, R0;\n"
+ "MUL R1.xyz, R1, R0.w;\n"
+ "MIN R1.xyz, R1, R3;\n"
+ "MAD R2.xyz, -R1, c[9].x, R2;\n"
+ "ADD R1.z, R1.w, R0.w;\n"
+ "MAD R2.w, -R1, R0, R1.z;\n"
+ "ADD R1.xy, fragment.position, c[7];\n"
+ "MUL R1.xy, R1, c[5];\n"
+ "TEX R1, R1, texture[1], 2D;\n"
+ "ADD R2, R2, -R0;\n"
+ "DP4 R1.x, R1, c[8];\n"
+ "MAD result.color, R1.x, R2, R0;\n"
"END\n"
;
static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_RADIAL_COMPOSITION_MODES_EXCLUSION =
"!!ARBfp1.0\n"
- "PARAM c[10] = { program.local[0..6],\n"
- " { 2, 4, 1 },\n"
- " program.local[8..9] };\n"
+ "PARAM c[10] = { program.local[0..8],\n"
+ " { 2, 4, 1 } };\n"
"TEMP R0;\n"
"TEMP R1;\n"
"TEMP R2;\n"
"TEMP R3;\n"
- "MUL R0.xyz, fragment.position.y, c[4];\n"
- "MAD R0.xyz, fragment.position.x, c[3], R0;\n"
- "ADD R0.xyz, R0, c[5];\n"
+ "MUL R0.xyz, fragment.position.y, c[3];\n"
+ "MAD R0.xyz, fragment.position.x, c[2], R0;\n"
+ "ADD R0.xyz, R0, c[4];\n"
"RCP R0.z, R0.z;\n"
"MUL R0.xy, R0, R0.z;\n"
"MUL R0.zw, R0.xyxy, R0.xyxy;\n"
- "MUL R0.xy, R0, c[6];\n"
"ADD R0.z, R0, R0.w;\n"
+ "MUL R0.xy, R0, c[0];\n"
"ADD R0.x, R0, R0.y;\n"
- "MUL R0.z, c[8].x, -R0;\n"
- "MUL R0.y, R0.z, c[7];\n"
- "MUL R0.x, R0, c[7];\n"
- "MAD R0.y, R0.x, R0.x, -R0;\n"
- "MOV R0.z, c[7].x;\n"
- "RSQ R0.y, R0.y;\n"
- "RCP R0.y, R0.y;\n"
- "MUL R0.z, c[8].x, R0;\n"
- "MUL R1.xy, fragment.position, c[9];\n"
- "TEX R1, R1, texture[0], 2D;\n"
- "ADD R0.x, -R0, R0.y;\n"
- "RCP R0.z, R0.z;\n"
- "MUL R0.x, R0, R0.z;\n"
- "TEX R0, R0, texture[2], 1D;\n"
- "MUL R2.xyz, R1, R0.w;\n"
- "MAD R3.xyz, R0, R1.w, R2;\n"
- "MUL R2.xyz, R0, R1;\n"
- "MAD R2.xyz, -R2, c[7].x, R3;\n"
- "ADD R2.w, -R1, c[7].z;\n"
- "MAD R0.xyz, R0, R2.w, R2;\n"
- "ADD R2.x, -R0.w, c[7].z;\n"
- "MAD R2.xyz, R1, R2.x, R0;\n"
- "ADD R0.z, R0.w, R1.w;\n"
- "MAD R2.w, -R0, R1, R0.z;\n"
- "ADD R0.xy, fragment.position, c[0];\n"
- "MUL R0.xy, R0, c[1];\n"
- "TEX R0, R0, texture[1], 2D;\n"
- "ADD R2, R2, -R1;\n"
- "DP4 R0.x, R0, c[2];\n"
- "MAD result.color, R0.x, R2, R1;\n"
+ "MUL R0.z, -R0, c[1].x;\n"
+ "MUL R0.y, R0.x, c[9].x;\n"
+ "MUL R0.z, R0, c[9].y;\n"
+ "MAD R0.x, R0.y, R0.y, -R0.z;\n"
+ "RSQ R0.z, R0.x;\n"
+ "MOV R0.x, c[9];\n"
+ "MUL R0.x, R0, c[1];\n"
+ "RCP R0.z, R0.z;\n"
+ "ADD R0.z, -R0.y, R0;\n"
+ "RCP R0.w, R0.x;\n"
+ "MUL R1.x, R0.z, R0.w;\n"
+ "MUL R0.xy, fragment.position, c[6];\n"
+ "TEX R0, R0, texture[0], 2D;\n"
+ "TEX R1, R1, texture[2], 1D;\n"
+ "MUL R2.xyz, R1.w, R0;\n"
+ "MAD R3.xyz, R1, R0.w, R2;\n"
+ "MUL R2.xyz, R1, R0;\n"
+ "MAD R2.xyz, -R2, c[9].x, R3;\n"
+ "ADD R2.w, -R0, c[9].z;\n"
+ "MAD R1.xyz, R1, R2.w, R2;\n"
+ "ADD R2.x, -R1.w, c[9].z;\n"
+ "MAD R2.xyz, R0, R2.x, R1;\n"
+ "ADD R1.z, R1.w, R0.w;\n"
+ "MAD R2.w, -R1, R0, R1.z;\n"
+ "ADD R1.xy, fragment.position, c[7];\n"
+ "MUL R1.xy, R1, c[5];\n"
+ "TEX R1, R1, texture[1], 2D;\n"
+ "ADD R2, R2, -R0;\n"
+ "DP4 R1.x, R1, c[8];\n"
+ "MAD result.color, R1.x, R2, R0;\n"
"END\n"
;
static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_RADIAL_COMPOSITION_MODES_SIMPLE_PORTER_DUFF_NOMASK =
"!!ARBfp1.0\n"
- "PARAM c[9] = { program.local[0..3],\n"
- " { 2, 4, 1 },\n"
- " program.local[5..8] };\n"
+ "PARAM c[9] = { program.local[0..7],\n"
+ " { 2, 4, 1 } };\n"
"TEMP R0;\n"
"TEMP R1;\n"
"TEMP R2;\n"
"TEMP R3;\n"
- "MUL R0.xyz, fragment.position.y, c[1];\n"
- "MAD R0.xyz, fragment.position.x, c[0], R0;\n"
- "ADD R0.xyz, R0, c[2];\n"
+ "MUL R0.xyz, fragment.position.y, c[3];\n"
+ "MAD R0.xyz, fragment.position.x, c[2], R0;\n"
+ "ADD R0.xyz, R0, c[4];\n"
"RCP R0.z, R0.z;\n"
"MUL R0.xy, R0, R0.z;\n"
"MUL R0.zw, R0.xyxy, R0.xyxy;\n"
+ "MUL R0.xy, R0, c[0];\n"
"ADD R0.z, R0, R0.w;\n"
- "MUL R0.xy, R0, c[3];\n"
"ADD R0.x, R0, R0.y;\n"
- "MUL R0.z, c[5].x, -R0;\n"
- "MUL R0.y, R0.z, c[4];\n"
- "MUL R0.x, R0, c[4];\n"
+ "MUL R0.z, -R0, c[1].x;\n"
+ "MUL R0.y, R0.z, c[8];\n"
+ "MUL R0.x, R0, c[8];\n"
"MAD R0.y, R0.x, R0.x, -R0;\n"
- "RSQ R0.z, R0.y;\n"
- "RCP R0.z, R0.z;\n"
+ "RSQ R0.y, R0.y;\n"
+ "RCP R0.z, R0.y;\n"
"ADD R0.x, -R0, R0.z;\n"
- "MUL R0.zw, fragment.position.xyxy, c[6].xyxy;\n"
+ "MUL R0.zw, fragment.position.xyxy, c[7].xyxy;\n"
"TEX R1, R0.zwzw, texture[0], 2D;\n"
- "MUL R2.xyz, R1, c[8].y;\n"
- "MOV R0.y, c[4].x;\n"
- "MUL R0.y, c[5].x, R0;\n"
+ "MUL R2.xyz, R1, c[5].y;\n"
+ "MOV R0.y, c[8].x;\n"
+ "MUL R0.y, R0, c[1].x;\n"
"RCP R0.y, R0.y;\n"
"MUL R0.x, R0, R0.y;\n"
"TEX R0, R0, texture[1], 1D;\n"
- "MUL R3.xyz, R2, R0.w;\n"
- "MUL R2.xyz, R0, c[8].x;\n"
- "MAD R2.xyz, R2, R1.w, R3;\n"
- "ADD R2.w, -R1, c[4].z;\n"
- "MUL R0.xyz, R0, c[7].y;\n"
- "MAD R0.xyz, R0, R2.w, R2;\n"
- "ADD R2.x, -R0.w, c[4].z;\n"
- "MUL R1.xyz, R1, c[7].z;\n"
- "MAD result.color.xyz, R1, R2.x, R0;\n"
+ "MUL R3.xyz, R0.w, R2;\n"
+ "MUL R2.xyz, R0, c[5].x;\n"
+ "MAD R2.xyz, R1.w, R2, R3;\n"
+ "ADD R2.w, -R1, c[8].z;\n"
+ "MUL R0.xyz, R0, c[6].y;\n"
+ "MAD R0.xyz, R2.w, R0, R2;\n"
+ "ADD R2.x, -R0.w, c[8].z;\n"
+ "MUL R1.xyz, R1, c[6].z;\n"
+ "MAD result.color.xyz, R2.x, R1, R0;\n"
"MUL R0.x, R0.w, R1.w;\n"
"MUL R0.z, R1.w, R2.x;\n"
"MUL R0.y, R0.w, R2.w;\n"
- "DP3 result.color.w, R0, c[7];\n"
+ "DP3 result.color.w, R0, c[6];\n"
"END\n"
;
static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_RADIAL_COMPOSITION_MODES_MULTIPLY_NOMASK =
"!!ARBfp1.0\n"
- "PARAM c[7] = { program.local[0..3],\n"
- " { 2, 4, 1 },\n"
- " program.local[5..6] };\n"
+ "PARAM c[7] = { program.local[0..5],\n"
+ " { 2, 4, 1 } };\n"
"TEMP R0;\n"
"TEMP R1;\n"
"TEMP R2;\n"
- "MUL R0.xyz, fragment.position.y, c[1];\n"
- "MAD R0.xyz, fragment.position.x, c[0], R0;\n"
- "ADD R0.xyz, R0, c[2];\n"
+ "MUL R0.xyz, fragment.position.y, c[3];\n"
+ "MAD R0.xyz, fragment.position.x, c[2], R0;\n"
+ "ADD R0.xyz, R0, c[4];\n"
"RCP R0.z, R0.z;\n"
"MUL R0.xy, R0, R0.z;\n"
"MUL R0.zw, R0.xyxy, R0.xyxy;\n"
- "MUL R0.xy, R0, c[3];\n"
+ "MUL R0.xy, R0, c[0];\n"
"ADD R0.z, R0, R0.w;\n"
"ADD R0.x, R0, R0.y;\n"
- "MUL R0.z, c[5].x, -R0;\n"
- "MUL R0.y, R0.z, c[4];\n"
- "MUL R0.x, R0, c[4];\n"
+ "MUL R0.z, -R0, c[1].x;\n"
+ "MUL R0.y, R0.z, c[6];\n"
+ "MUL R0.x, R0, c[6];\n"
"MAD R0.y, R0.x, R0.x, -R0;\n"
"RSQ R0.y, R0.y;\n"
"RCP R0.z, R0.y;\n"
"ADD R0.x, -R0, R0.z;\n"
- "MUL R0.zw, fragment.position.xyxy, c[6].xyxy;\n"
+ "MUL R0.zw, fragment.position.xyxy, c[5].xyxy;\n"
"TEX R1, R0.zwzw, texture[0], 2D;\n"
- "MOV R0.y, c[4].x;\n"
- "MUL R0.y, c[5].x, R0;\n"
+ "MOV R0.y, c[6].x;\n"
+ "MUL R0.y, R0, c[1].x;\n"
"RCP R0.y, R0.y;\n"
"MUL R0.x, R0, R0.y;\n"
"TEX R0, R0, texture[1], 1D;\n"
- "ADD R2.x, -R1.w, c[4].z;\n"
+ "ADD R2.x, -R1.w, c[6].z;\n"
"MUL R2.xyz, R0, R2.x;\n"
"MAD R0.xyz, R0, R1, R2;\n"
"ADD R2.x, R0.w, R1.w;\n"
- "ADD R2.y, -R0.w, c[4].z;\n"
+ "ADD R2.y, -R0.w, c[6].z;\n"
"MAD result.color.xyz, R1, R2.y, R0;\n"
"MAD result.color.w, -R0, R1, R2.x;\n"
"END\n"
@@ -1746,31 +1667,30 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_RADIAL_COMPOSITION_MOD
static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_RADIAL_COMPOSITION_MODES_SCREEN_NOMASK =
"!!ARBfp1.0\n"
- "PARAM c[7] = { program.local[0..3],\n"
- " { 2, 4 },\n"
- " program.local[5..6] };\n"
+ "PARAM c[7] = { program.local[0..5],\n"
+ " { 2, 4 } };\n"
"TEMP R0;\n"
"TEMP R1;\n"
"TEMP R2;\n"
- "MUL R0.xyz, fragment.position.y, c[1];\n"
- "MAD R0.xyz, fragment.position.x, c[0], R0;\n"
- "ADD R0.xyz, R0, c[2];\n"
+ "MUL R0.xyz, fragment.position.y, c[3];\n"
+ "MAD R0.xyz, fragment.position.x, c[2], R0;\n"
+ "ADD R0.xyz, R0, c[4];\n"
"RCP R0.z, R0.z;\n"
"MUL R0.xy, R0, R0.z;\n"
"MUL R0.zw, R0.xyxy, R0.xyxy;\n"
"ADD R0.z, R0, R0.w;\n"
- "MUL R0.xy, R0, c[3];\n"
+ "MUL R0.xy, R0, c[0];\n"
"ADD R0.x, R0, R0.y;\n"
- "MUL R0.z, c[5].x, -R0;\n"
- "MUL R0.y, R0.z, c[4];\n"
- "MUL R0.x, R0, c[4];\n"
+ "MUL R0.z, -R0, c[1].x;\n"
+ "MUL R0.y, R0.z, c[6];\n"
+ "MUL R0.x, R0, c[6];\n"
"MAD R0.y, R0.x, R0.x, -R0;\n"
"RSQ R0.z, R0.y;\n"
"RCP R0.z, R0.z;\n"
"ADD R0.x, -R0, R0.z;\n"
- "MUL R0.zw, fragment.position.xyxy, c[6].xyxy;\n"
- "MOV R0.y, c[4].x;\n"
- "MUL R0.y, c[5].x, R0;\n"
+ "MUL R0.zw, fragment.position.xyxy, c[5].xyxy;\n"
+ "MOV R0.y, c[6].x;\n"
+ "MUL R0.y, R0, c[1].x;\n"
"RCP R0.y, R0.y;\n"
"TEX R1, R0.zwzw, texture[0], 2D;\n"
"MUL R0.x, R0, R0.y;\n"
@@ -1782,50 +1702,49 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_RADIAL_COMPOSITION_MOD
static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_RADIAL_COMPOSITION_MODES_OVERLAY_NOMASK =
"!!ARBfp1.0\n"
- "PARAM c[7] = { program.local[0..3],\n"
- " { 2, 4, 1 },\n"
- " program.local[5..6] };\n"
+ "PARAM c[7] = { program.local[0..5],\n"
+ " { 2, 4, 1 } };\n"
"TEMP R0;\n"
"TEMP R1;\n"
"TEMP R2;\n"
"TEMP R3;\n"
- "MUL R0.xyz, fragment.position.y, c[1];\n"
- "MAD R0.xyz, fragment.position.x, c[0], R0;\n"
- "ADD R0.xyz, R0, c[2];\n"
+ "MUL R0.xyz, fragment.position.y, c[3];\n"
+ "MAD R0.xyz, fragment.position.x, c[2], R0;\n"
+ "ADD R0.xyz, R0, c[4];\n"
"RCP R0.z, R0.z;\n"
"MUL R0.xy, R0, R0.z;\n"
"MUL R0.zw, R0.xyxy, R0.xyxy;\n"
- "MUL R0.xy, R0, c[3];\n"
+ "MUL R0.xy, R0, c[0];\n"
"ADD R0.z, R0, R0.w;\n"
"ADD R0.x, R0, R0.y;\n"
- "MUL R0.z, c[5].x, -R0;\n"
- "MUL R0.y, R0.z, c[4];\n"
- "MUL R0.x, R0, c[4];\n"
- "MAD R0.y, R0.x, R0.x, -R0;\n"
- "MOV R0.z, c[4].x;\n"
- "RSQ R0.y, R0.y;\n"
- "RCP R0.y, R0.y;\n"
- "MUL R0.z, c[5].x, R0;\n"
- "MUL R1.xy, fragment.position, c[6];\n"
+ "MUL R0.z, -R0, c[1].x;\n"
+ "MUL R1.xy, fragment.position, c[5];\n"
"TEX R1, R1, texture[0], 2D;\n"
- "ADD R0.x, -R0, R0.y;\n"
+ "MUL R0.y, R0.z, c[6];\n"
+ "MUL R0.x, R0, c[6];\n"
+ "MAD R0.z, R0.x, R0.x, -R0.y;\n"
+ "MOV R0.y, c[6].x;\n"
+ "RSQ R0.z, R0.z;\n"
"RCP R0.z, R0.z;\n"
- "MUL R0.x, R0, R0.z;\n"
+ "MUL R0.y, R0, c[1].x;\n"
+ "ADD R0.x, -R0, R0.z;\n"
+ "RCP R0.y, R0.y;\n"
+ "MUL R0.x, R0, R0.y;\n"
"TEX R0, R0, texture[1], 1D;\n"
"ADD R3.xyz, R0.w, -R0;\n"
"ADD R2.xyz, R1.w, -R1;\n"
"MUL R2.xyz, R2, R3;\n"
- "ADD R2.w, -R1, c[4].z;\n"
- "MUL R2.xyz, R2, c[4].x;\n"
+ "ADD R2.w, -R1, c[6].z;\n"
+ "MUL R2.xyz, R2, c[6].x;\n"
"MAD R2.xyz, R0.w, R1.w, -R2;\n"
"MAD R2.xyz, R0, R2.w, R2;\n"
"MUL R3.xyz, R0, R2.w;\n"
"MUL R0.xyz, R0, R1;\n"
- "ADD R2.w, -R0, c[4].z;\n"
- "MAD R0.xyz, R0, c[4].x, R3;\n"
+ "ADD R2.w, -R0, c[6].z;\n"
+ "MAD R0.xyz, R0, c[6].x, R3;\n"
"MAD R0.xyz, R1, R2.w, R0;\n"
"MAD R2.xyz, R1, R2.w, R2;\n"
- "MUL R1.xyz, R1, c[4].x;\n"
+ "MUL R1.xyz, R1, c[6].x;\n"
"ADD R2.w, R0, R1;\n"
"ADD R2.xyz, R2, -R0;\n"
"SGE R1.xyz, R1, R1.w;\n"
@@ -1836,43 +1755,42 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_RADIAL_COMPOSITION_MOD
static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_RADIAL_COMPOSITION_MODES_DARKEN_NOMASK =
"!!ARBfp1.0\n"
- "PARAM c[7] = { program.local[0..3],\n"
- " { 2, 4, 1 },\n"
- " program.local[5..6] };\n"
+ "PARAM c[7] = { program.local[0..5],\n"
+ " { 2, 4, 1 } };\n"
"TEMP R0;\n"
"TEMP R1;\n"
"TEMP R2;\n"
"TEMP R3;\n"
- "MUL R0.xyz, fragment.position.y, c[1];\n"
- "MAD R0.xyz, fragment.position.x, c[0], R0;\n"
- "ADD R0.xyz, R0, c[2];\n"
+ "MUL R0.xyz, fragment.position.y, c[3];\n"
+ "MAD R0.xyz, fragment.position.x, c[2], R0;\n"
+ "ADD R0.xyz, R0, c[4];\n"
"RCP R0.z, R0.z;\n"
"MUL R0.xy, R0, R0.z;\n"
"MUL R0.zw, R0.xyxy, R0.xyxy;\n"
- "MUL R0.xy, R0, c[3];\n"
"ADD R0.z, R0, R0.w;\n"
+ "MUL R0.xy, R0, c[0];\n"
"ADD R0.x, R0, R0.y;\n"
- "MUL R0.z, c[5].x, -R0;\n"
- "MUL R0.y, R0.z, c[4];\n"
- "MUL R0.x, R0, c[4];\n"
+ "MUL R0.z, -R0, c[1].x;\n"
+ "MUL R0.y, R0.z, c[6];\n"
+ "MUL R0.x, R0, c[6];\n"
"MAD R0.y, R0.x, R0.x, -R0;\n"
- "MOV R0.z, c[4].x;\n"
- "RSQ R0.y, R0.y;\n"
- "RCP R0.y, R0.y;\n"
- "MUL R0.z, c[5].x, R0;\n"
- "MUL R1.xy, fragment.position, c[6];\n"
- "TEX R1, R1, texture[0], 2D;\n"
- "ADD R0.x, -R0, R0.y;\n"
+ "RSQ R0.z, R0.y;\n"
"RCP R0.z, R0.z;\n"
- "MUL R0.x, R0, R0.z;\n"
+ "ADD R0.x, -R0, R0.z;\n"
+ "MUL R0.zw, fragment.position.xyxy, c[5].xyxy;\n"
+ "TEX R1, R0.zwzw, texture[0], 2D;\n"
+ "MOV R0.y, c[6].x;\n"
+ "MUL R0.y, R0, c[1].x;\n"
+ "RCP R0.y, R0.y;\n"
+ "MUL R0.x, R0, R0.y;\n"
"TEX R0, R0, texture[1], 1D;\n"
"MUL R2.xyz, R0, R1.w;\n"
- "MUL R3.xyz, R1, R0.w;\n"
+ "MUL R3.xyz, R0.w, R1;\n"
"MIN R2.xyz, R2, R3;\n"
- "ADD R2.w, -R1, c[4].z;\n"
+ "ADD R2.w, -R1, c[6].z;\n"
"MAD R0.xyz, R0, R2.w, R2;\n"
"ADD R2.x, R0.w, R1.w;\n"
- "ADD R2.y, -R0.w, c[4].z;\n"
+ "ADD R2.y, -R0.w, c[6].z;\n"
"MAD result.color.xyz, R1, R2.y, R0;\n"
"MAD result.color.w, -R0, R1, R2.x;\n"
"END\n"
@@ -1880,43 +1798,42 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_RADIAL_COMPOSITION_MOD
static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_RADIAL_COMPOSITION_MODES_LIGHTEN_NOMASK =
"!!ARBfp1.0\n"
- "PARAM c[7] = { program.local[0..3],\n"
- " { 2, 4, 1 },\n"
- " program.local[5..6] };\n"
+ "PARAM c[7] = { program.local[0..5],\n"
+ " { 2, 4, 1 } };\n"
"TEMP R0;\n"
"TEMP R1;\n"
"TEMP R2;\n"
"TEMP R3;\n"
- "MUL R0.xyz, fragment.position.y, c[1];\n"
- "MAD R0.xyz, fragment.position.x, c[0], R0;\n"
- "ADD R0.xyz, R0, c[2];\n"
+ "MUL R0.xyz, fragment.position.y, c[3];\n"
+ "MAD R0.xyz, fragment.position.x, c[2], R0;\n"
+ "ADD R0.xyz, R0, c[4];\n"
"RCP R0.z, R0.z;\n"
"MUL R0.xy, R0, R0.z;\n"
"MUL R0.zw, R0.xyxy, R0.xyxy;\n"
- "MUL R0.xy, R0, c[3];\n"
"ADD R0.z, R0, R0.w;\n"
+ "MUL R0.xy, R0, c[0];\n"
"ADD R0.x, R0, R0.y;\n"
- "MUL R0.z, c[5].x, -R0;\n"
- "MUL R0.y, R0.z, c[4];\n"
- "MUL R0.x, R0, c[4];\n"
+ "MUL R0.z, -R0, c[1].x;\n"
+ "MUL R0.y, R0.z, c[6];\n"
+ "MUL R0.x, R0, c[6];\n"
"MAD R0.y, R0.x, R0.x, -R0;\n"
- "MOV R0.z, c[4].x;\n"
- "RSQ R0.y, R0.y;\n"
- "RCP R0.y, R0.y;\n"
- "MUL R0.z, c[5].x, R0;\n"
- "MUL R1.xy, fragment.position, c[6];\n"
- "TEX R1, R1, texture[0], 2D;\n"
- "ADD R0.x, -R0, R0.y;\n"
+ "RSQ R0.z, R0.y;\n"
"RCP R0.z, R0.z;\n"
- "MUL R0.x, R0, R0.z;\n"
+ "ADD R0.x, -R0, R0.z;\n"
+ "MUL R0.zw, fragment.position.xyxy, c[5].xyxy;\n"
+ "TEX R1, R0.zwzw, texture[0], 2D;\n"
+ "MOV R0.y, c[6].x;\n"
+ "MUL R0.y, R0, c[1].x;\n"
+ "RCP R0.y, R0.y;\n"
+ "MUL R0.x, R0, R0.y;\n"
"TEX R0, R0, texture[1], 1D;\n"
"MUL R2.xyz, R0, R1.w;\n"
- "MUL R3.xyz, R1, R0.w;\n"
+ "MUL R3.xyz, R0.w, R1;\n"
"MAX R2.xyz, R2, R3;\n"
- "ADD R2.w, -R1, c[4].z;\n"
+ "ADD R2.w, -R1, c[6].z;\n"
"MAD R0.xyz, R0, R2.w, R2;\n"
"ADD R2.x, R0.w, R1.w;\n"
- "ADD R2.y, -R0.w, c[4].z;\n"
+ "ADD R2.y, -R0.w, c[6].z;\n"
"MAD result.color.xyz, R1, R2.y, R0;\n"
"MAD result.color.w, -R0, R1, R2.x;\n"
"END\n"
@@ -1924,45 +1841,44 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_RADIAL_COMPOSITION_MOD
static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_RADIAL_COMPOSITION_MODES_COLORDODGE_NOMASK =
"!!ARBfp1.0\n"
- "PARAM c[7] = { program.local[0..3],\n"
- " { 2, 4, 1, 1e-06 },\n"
- " program.local[5..6] };\n"
+ "PARAM c[7] = { program.local[0..5],\n"
+ " { 2, 4, 1, 1e-006 } };\n"
"TEMP R0;\n"
"TEMP R1;\n"
"TEMP R2;\n"
"TEMP R3;\n"
- "MUL R0.xyz, fragment.position.y, c[1];\n"
- "MAD R0.xyz, fragment.position.x, c[0], R0;\n"
- "ADD R0.xyz, R0, c[2];\n"
+ "MUL R0.xyz, fragment.position.y, c[3];\n"
+ "MAD R0.xyz, fragment.position.x, c[2], R0;\n"
+ "ADD R0.xyz, R0, c[4];\n"
"RCP R0.z, R0.z;\n"
"MUL R0.xy, R0, R0.z;\n"
"MUL R0.zw, R0.xyxy, R0.xyxy;\n"
- "MUL R0.xy, R0, c[3];\n"
+ "MUL R0.xy, R0, c[0];\n"
"ADD R0.z, R0, R0.w;\n"
"ADD R0.x, R0, R0.y;\n"
- "MUL R0.z, c[5].x, -R0;\n"
- "MUL R0.y, R0.z, c[4];\n"
- "MUL R0.x, R0, c[4];\n"
- "MAD R0.y, R0.x, R0.x, -R0;\n"
- "MOV R0.z, c[4].x;\n"
- "RSQ R0.y, R0.y;\n"
- "RCP R0.y, R0.y;\n"
- "MUL R0.z, c[5].x, R0;\n"
- "ADD R0.x, -R0, R0.y;\n"
+ "MUL R0.z, -R0, c[1].x;\n"
+ "MUL R0.y, R0.z, c[6];\n"
+ "MUL R0.x, R0, c[6];\n"
+ "MAD R0.z, R0.x, R0.x, -R0.y;\n"
+ "MOV R0.y, c[6].x;\n"
+ "RSQ R0.z, R0.z;\n"
"RCP R0.z, R0.z;\n"
- "MUL R0.x, R0, R0.z;\n"
+ "MUL R0.y, R0, c[1].x;\n"
+ "ADD R0.x, -R0, R0.z;\n"
+ "RCP R0.y, R0.y;\n"
+ "MUL R0.x, R0, R0.y;\n"
"TEX R0, R0, texture[1], 1D;\n"
- "MAX R1.x, R0.w, c[4].w;\n"
+ "MAX R1.x, R0.w, c[6].w;\n"
"RCP R1.x, R1.x;\n"
- "MAD R1.xyz, -R0, R1.x, c[4].z;\n"
- "MAX R2.xyz, R1, c[4].w;\n"
- "MUL R1.xy, fragment.position, c[6];\n"
+ "MAD R1.xyz, -R0, R1.x, c[6].z;\n"
+ "MAX R2.xyz, R1, c[6].w;\n"
+ "MUL R1.xy, fragment.position, c[5];\n"
"TEX R1, R1, texture[0], 2D;\n"
- "ADD R2.w, -R0, c[4].z;\n"
+ "ADD R2.w, -R0, c[6].z;\n"
"MUL R3.xyz, R1, R2.w;\n"
- "ADD R2.w, -R1, c[4].z;\n"
+ "ADD R2.w, -R1, c[6].z;\n"
"MAD R3.xyz, R0, R2.w, R3;\n"
- "MUL R1.xyz, R1, R0.w;\n"
+ "MUL R1.xyz, R0.w, R1;\n"
"MAD R0.xyz, R0, R1.w, R1;\n"
"MUL R2.w, R0, R1;\n"
"RCP R2.x, R2.x;\n"
@@ -1980,46 +1896,45 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_RADIAL_COMPOSITION_MOD
static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_RADIAL_COMPOSITION_MODES_COLORBURN_NOMASK =
"!!ARBfp1.0\n"
- "PARAM c[7] = { program.local[0..3],\n"
- " { 2, 4, 1, 9.9999997e-06 },\n"
- " program.local[5..6] };\n"
+ "PARAM c[7] = { program.local[0..5],\n"
+ " { 2, 4, 1, 9.9999997e-006 } };\n"
"TEMP R0;\n"
"TEMP R1;\n"
"TEMP R2;\n"
"TEMP R3;\n"
"TEMP R4;\n"
"TEMP R5;\n"
- "MUL R0.xyz, fragment.position.y, c[1];\n"
- "MAD R0.xyz, fragment.position.x, c[0], R0;\n"
- "ADD R0.xyz, R0, c[2];\n"
+ "MUL R0.xyz, fragment.position.y, c[3];\n"
+ "MAD R0.xyz, fragment.position.x, c[2], R0;\n"
+ "ADD R0.xyz, R0, c[4];\n"
"RCP R0.z, R0.z;\n"
"MUL R0.xy, R0, R0.z;\n"
"MUL R0.zw, R0.xyxy, R0.xyxy;\n"
- "MUL R0.xy, R0, c[3];\n"
"ADD R0.z, R0, R0.w;\n"
+ "MUL R0.xy, R0, c[0];\n"
"ADD R0.x, R0, R0.y;\n"
- "MUL R0.z, c[5].x, -R0;\n"
- "MUL R0.y, R0.z, c[4];\n"
- "MUL R0.x, R0, c[4];\n"
+ "MUL R0.z, -R0, c[1].x;\n"
+ "MUL R0.y, R0.z, c[6];\n"
+ "MUL R0.x, R0, c[6];\n"
"MAD R0.y, R0.x, R0.x, -R0;\n"
- "MOV R0.z, c[4].x;\n"
- "RSQ R0.y, R0.y;\n"
- "RCP R0.y, R0.y;\n"
- "MUL R0.z, c[5].x, R0;\n"
- "MUL R1.xy, fragment.position, c[6];\n"
- "TEX R1, R1, texture[0], 2D;\n"
- "ADD R0.x, -R0, R0.y;\n"
+ "RSQ R0.z, R0.y;\n"
"RCP R0.z, R0.z;\n"
- "MUL R0.x, R0, R0.z;\n"
+ "ADD R0.x, -R0, R0.z;\n"
+ "MUL R0.zw, fragment.position.xyxy, c[5].xyxy;\n"
+ "TEX R1, R0.zwzw, texture[0], 2D;\n"
+ "MOV R0.y, c[6].x;\n"
+ "MUL R0.y, R0, c[1].x;\n"
+ "RCP R0.y, R0.y;\n"
+ "MUL R0.x, R0, R0.y;\n"
"TEX R0, R0, texture[1], 1D;\n"
- "MUL R2.xyz, R1, R0.w;\n"
+ "MUL R2.xyz, R0.w, R1;\n"
"MAD R3.xyz, R0, R1.w, R2;\n"
- "ADD R2.w, -R1, c[4].z;\n"
+ "ADD R2.w, -R1, c[6].z;\n"
"MAD R2.xyz, -R0.w, R1.w, R3;\n"
"MUL R4.xyz, R0.w, R2;\n"
- "MAX R2.xyz, R0, c[4].w;\n"
+ "MAX R2.xyz, R0, c[6].w;\n"
"MUL R5.xyz, R0, R2.w;\n"
- "ADD R3.w, -R0, c[4].z;\n"
+ "ADD R3.w, -R0, c[6].z;\n"
"RCP R2.x, R2.x;\n"
"RCP R2.y, R2.y;\n"
"RCP R2.z, R2.z;\n"
@@ -2038,50 +1953,49 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_RADIAL_COMPOSITION_MOD
static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_RADIAL_COMPOSITION_MODES_HARDLIGHT_NOMASK =
"!!ARBfp1.0\n"
- "PARAM c[7] = { program.local[0..3],\n"
- " { 2, 4, 1 },\n"
- " program.local[5..6] };\n"
+ "PARAM c[7] = { program.local[0..5],\n"
+ " { 2, 4, 1 } };\n"
"TEMP R0;\n"
"TEMP R1;\n"
"TEMP R2;\n"
"TEMP R3;\n"
"TEMP R4;\n"
- "MUL R0.xyz, fragment.position.y, c[1];\n"
- "MAD R0.xyz, fragment.position.x, c[0], R0;\n"
- "ADD R0.xyz, R0, c[2];\n"
+ "MUL R0.xyz, fragment.position.y, c[3];\n"
+ "MAD R0.xyz, fragment.position.x, c[2], R0;\n"
+ "ADD R0.xyz, R0, c[4];\n"
"RCP R0.z, R0.z;\n"
"MUL R0.xy, R0, R0.z;\n"
"MUL R0.zw, R0.xyxy, R0.xyxy;\n"
- "MUL R0.xy, R0, c[3];\n"
+ "MUL R0.xy, R0, c[0];\n"
"ADD R0.z, R0, R0.w;\n"
"ADD R0.x, R0, R0.y;\n"
- "MUL R0.z, c[5].x, -R0;\n"
- "MUL R0.y, R0.z, c[4];\n"
- "MUL R0.x, R0, c[4];\n"
- "MAD R0.y, R0.x, R0.x, -R0;\n"
- "MOV R0.z, c[4].x;\n"
- "RSQ R0.y, R0.y;\n"
- "RCP R0.y, R0.y;\n"
- "MUL R0.z, c[5].x, R0;\n"
- "MUL R1.xy, fragment.position, c[6];\n"
+ "MUL R0.z, -R0, c[1].x;\n"
+ "MUL R1.xy, fragment.position, c[5];\n"
"TEX R1, R1, texture[0], 2D;\n"
- "ADD R0.x, -R0, R0.y;\n"
+ "MUL R0.y, R0.z, c[6];\n"
+ "MUL R0.x, R0, c[6];\n"
+ "MAD R0.z, R0.x, R0.x, -R0.y;\n"
+ "MOV R0.y, c[6].x;\n"
+ "RSQ R0.z, R0.z;\n"
"RCP R0.z, R0.z;\n"
- "MUL R0.x, R0, R0.z;\n"
+ "MUL R0.y, R0, c[1].x;\n"
+ "ADD R0.x, -R0, R0.z;\n"
+ "RCP R0.y, R0.y;\n"
+ "MUL R0.x, R0, R0.y;\n"
"TEX R0, R0, texture[1], 1D;\n"
- "ADD R2.w, -R1, c[4].z;\n"
+ "ADD R2.w, -R1, c[6].z;\n"
"ADD R3.xyz, R0.w, -R0;\n"
"ADD R2.xyz, R1.w, -R1;\n"
"MUL R2.xyz, R2, R3;\n"
- "MUL R2.xyz, R2, c[4].x;\n"
+ "MUL R2.xyz, R2, c[6].x;\n"
"MAD R2.xyz, R0.w, R1.w, -R2;\n"
"MUL R4.xyz, R0, R2.w;\n"
"MUL R3.xyz, R0, R1;\n"
"MAD R2.xyz, R0, R2.w, R2;\n"
- "ADD R2.w, -R0, c[4].z;\n"
- "MUL R0.xyz, R0, c[4].x;\n"
+ "ADD R2.w, -R0, c[6].z;\n"
+ "MUL R0.xyz, R0, c[6].x;\n"
"MAD R2.xyz, R1, R2.w, R2;\n"
- "MAD R3.xyz, R3, c[4].x, R4;\n"
+ "MAD R3.xyz, R3, c[6].x, R4;\n"
"MAD R1.xyz, R1, R2.w, R3;\n"
"ADD R2.w, R0, R1;\n"
"ADD R2.xyz, R2, -R1;\n"
@@ -2093,10 +2007,9 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_RADIAL_COMPOSITION_MOD
static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_RADIAL_COMPOSITION_MODES_SOFTLIGHT_NOMASK =
"!!ARBfp1.0\n"
- "PARAM c[8] = { program.local[0..3],\n"
- " { 2, 4, 1, 9.9999997e-06 },\n"
- " program.local[5..6],\n"
- " { 8, 3 } };\n"
+ "PARAM c[8] = { program.local[0..5],\n"
+ " { 2, 4, 1, 9.9999997e-006 },\n"
+ " { 3, 8 } };\n"
"TEMP R0;\n"
"TEMP R1;\n"
"TEMP R2;\n"
@@ -2104,64 +2017,61 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_RADIAL_COMPOSITION_MOD
"TEMP R4;\n"
"TEMP R5;\n"
"TEMP R6;\n"
- "MUL R0.xyz, fragment.position.y, c[1];\n"
- "MAD R0.xyz, fragment.position.x, c[0], R0;\n"
- "ADD R0.xyz, R0, c[2];\n"
+ "MUL R0.xyz, fragment.position.y, c[3];\n"
+ "MAD R0.xyz, fragment.position.x, c[2], R0;\n"
+ "ADD R0.xyz, R0, c[4];\n"
"RCP R0.z, R0.z;\n"
"MUL R0.xy, R0, R0.z;\n"
"MUL R0.zw, R0.xyxy, R0.xyxy;\n"
- "MUL R0.xy, R0, c[3];\n"
+ "MUL R0.xy, R0, c[0];\n"
"ADD R0.z, R0, R0.w;\n"
"ADD R0.x, R0, R0.y;\n"
- "MUL R0.z, c[5].x, -R0;\n"
- "MUL R0.y, R0.z, c[4];\n"
- "MUL R0.zw, fragment.position.xyxy, c[6].xyxy;\n"
+ "MUL R0.z, -R0, c[1].x;\n"
+ "MUL R0.y, R0.z, c[6];\n"
+ "MUL R0.zw, fragment.position.xyxy, c[5].xyxy;\n"
"TEX R1, R0.zwzw, texture[0], 2D;\n"
- "MUL R0.x, R0, c[4];\n"
+ "MUL R0.x, R0, c[6];\n"
"MAD R0.y, R0.x, R0.x, -R0;\n"
- "MAX R0.z, R1.w, c[4].w;\n"
+ "MAX R0.z, R1.w, c[6].w;\n"
"RCP R2.w, R0.z;\n"
"MUL R2.xyz, R1, R2.w;\n"
- "MUL R6.xyz, -R2, c[7].x;\n"
- "MAD R3.xyz, -R1, R2.w, c[4].z;\n"
+ "MAD R6.xyz, -R2, c[7].y, c[7].x;\n"
+ "MAD R3.xyz, -R1, R2.w, c[6].z;\n"
+ "RSQ R2.w, R2.x;\n"
+ "RCP R2.x, R2.w;\n"
"RSQ R0.y, R0.y;\n"
"RCP R0.y, R0.y;\n"
"ADD R0.x, -R0, R0.y;\n"
- "MOV R0.y, c[4].x;\n"
- "MUL R0.y, c[5].x, R0;\n"
+ "MOV R0.y, c[6].x;\n"
+ "MUL R0.y, R0, c[1].x;\n"
"RCP R0.y, R0.y;\n"
"MUL R0.x, R0, R0.y;\n"
"TEX R0, R0, texture[1], 1D;\n"
- "MAD R4.xyz, R0, c[4].x, -R0.w;\n"
+ "MAD R4.xyz, R0, c[6].x, -R0.w;\n"
"MUL R5.xyz, R3, R4;\n"
+ "MAD R5.xyz, -R5, R6, R0.w;\n"
"MAD R3.xyz, -R3, R4, R0.w;\n"
- "ADD R6.xyz, R6, c[7].y;\n"
- "RSQ R2.x, R2.x;\n"
"RSQ R2.z, R2.z;\n"
"RSQ R2.y, R2.y;\n"
- "MAD R5.xyz, -R5, R6, R0.w;\n"
+ "MUL R5.xyz, R1, R5;\n"
"MUL R3.xyz, R1, R3;\n"
- "RCP R2.x, R2.x;\n"
"RCP R2.z, R2.z;\n"
"RCP R2.y, R2.y;\n"
- "MAD R2.xyz, R2, R1.w, -R1;\n"
- "MUL R6.xyz, R2, R4;\n"
- "MUL R2.xyz, R1, R5;\n"
- "MUL R4.xyz, R0, c[4].x;\n"
- "MAD R6.xyz, R1, R0.w, R6;\n"
- "MUL R5.xyz, R1, c[7].x;\n"
- "ADD R6.xyz, R6, -R2;\n"
- "SGE R5.xyz, R5, R1.w;\n"
- "MUL R5.xyz, R5, R6;\n"
- "ADD R2.xyz, R2, R5;\n"
+ "MAD R2.xyz, R1.w, R2, -R1;\n"
+ "MUL R2.xyz, R2, R4;\n"
+ "MAD R2.xyz, R0.w, R1, R2;\n"
+ "ADD R6.xyz, R2, -R5;\n"
+ "MUL R4.xyz, R0, c[6].x;\n"
+ "MUL R2.xyz, R1, c[7].y;\n"
+ "SGE R2.xyz, R2, R1.w;\n"
+ "MAD R2.xyz, R2, R6, R5;\n"
"ADD R2.xyz, R2, -R3;\n"
"SGE R4.xyz, R4, R0.w;\n"
- "MUL R2.xyz, R4, R2;\n"
- "ADD R2.xyz, R3, R2;\n"
- "ADD R2.w, -R1, c[4].z;\n"
+ "MAD R2.xyz, R4, R2, R3;\n"
+ "ADD R2.w, -R1, c[6].z;\n"
"MAD R0.xyz, R0, R2.w, R2;\n"
"ADD R2.x, R0.w, R1.w;\n"
- "ADD R2.y, -R0.w, c[4].z;\n"
+ "ADD R2.y, -R0.w, c[6].z;\n"
"MAD result.color.xyz, R1, R2.y, R0;\n"
"MAD result.color.w, -R0, R1, R2.x;\n"
"END\n"
@@ -2169,86 +2079,84 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_RADIAL_COMPOSITION_MOD
static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_RADIAL_COMPOSITION_MODES_DIFFERENCE_NOMASK =
"!!ARBfp1.0\n"
- "PARAM c[7] = { program.local[0..3],\n"
- " { 2, 4 },\n"
- " program.local[5..6] };\n"
+ "PARAM c[7] = { program.local[0..5],\n"
+ " { 2, 4 } };\n"
"TEMP R0;\n"
"TEMP R1;\n"
"TEMP R2;\n"
"TEMP R3;\n"
- "MUL R0.xyz, fragment.position.y, c[1];\n"
- "MAD R0.xyz, fragment.position.x, c[0], R0;\n"
- "ADD R0.xyz, R0, c[2];\n"
+ "MUL R0.xyz, fragment.position.y, c[3];\n"
+ "MAD R0.xyz, fragment.position.x, c[2], R0;\n"
+ "ADD R0.xyz, R0, c[4];\n"
"RCP R0.z, R0.z;\n"
"MUL R0.xy, R0, R0.z;\n"
"MUL R0.zw, R0.xyxy, R0.xyxy;\n"
- "MUL R0.xy, R0, c[3];\n"
"ADD R0.z, R0, R0.w;\n"
+ "MUL R0.xy, R0, c[0];\n"
"ADD R0.x, R0, R0.y;\n"
- "MUL R0.z, c[5].x, -R0;\n"
- "MUL R0.y, R0.z, c[4];\n"
- "MUL R0.x, R0, c[4];\n"
+ "MUL R0.z, -R0, c[1].x;\n"
+ "MUL R0.y, R0.z, c[6];\n"
+ "MUL R0.x, R0, c[6];\n"
"MAD R0.y, R0.x, R0.x, -R0;\n"
- "MOV R0.z, c[4].x;\n"
- "RSQ R0.y, R0.y;\n"
- "RCP R0.y, R0.y;\n"
- "MUL R0.z, c[5].x, R0;\n"
- "MUL R1.xy, fragment.position, c[6];\n"
- "TEX R1, R1, texture[0], 2D;\n"
- "ADD R0.x, -R0, R0.y;\n"
+ "RSQ R0.z, R0.y;\n"
"RCP R0.z, R0.z;\n"
- "MUL R0.x, R0, R0.z;\n"
+ "ADD R0.x, -R0, R0.z;\n"
+ "MUL R0.zw, fragment.position.xyxy, c[5].xyxy;\n"
+ "MOV R0.y, c[6].x;\n"
+ "MUL R0.y, R0, c[1].x;\n"
+ "RCP R0.y, R0.y;\n"
+ "TEX R1, R0.zwzw, texture[0], 2D;\n"
+ "MUL R0.x, R0, R0.y;\n"
"TEX R0, R0, texture[1], 1D;\n"
"MUL R2.xyz, R0, R1.w;\n"
- "MUL R3.xyz, R1, R0.w;\n"
+ "MUL R3.xyz, R0.w, R1;\n"
"ADD R0.xyz, R0, R1;\n"
"MIN R2.xyz, R2, R3;\n"
"ADD R1.x, R0.w, R1.w;\n"
- "MAD result.color.xyz, -R2, c[4].x, R0;\n"
+ "MAD result.color.xyz, -R2, c[6].x, R0;\n"
"MAD result.color.w, -R0, R1, R1.x;\n"
"END\n"
;
static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_RADIAL_COMPOSITION_MODES_EXCLUSION_NOMASK =
"!!ARBfp1.0\n"
- "PARAM c[7] = { program.local[0..3],\n"
- " { 2, 4, 1 },\n"
- " program.local[5..6] };\n"
+ "PARAM c[7] = { program.local[0..5],\n"
+ " { 2, 4, 1 } };\n"
"TEMP R0;\n"
"TEMP R1;\n"
"TEMP R2;\n"
"TEMP R3;\n"
- "MUL R0.xyz, fragment.position.y, c[1];\n"
- "MAD R0.xyz, fragment.position.x, c[0], R0;\n"
- "ADD R0.xyz, R0, c[2];\n"
+ "MUL R0.xyz, fragment.position.y, c[3];\n"
+ "MAD R0.xyz, fragment.position.x, c[2], R0;\n"
+ "ADD R0.xyz, R0, c[4];\n"
"RCP R0.z, R0.z;\n"
"MUL R0.xy, R0, R0.z;\n"
"MUL R0.zw, R0.xyxy, R0.xyxy;\n"
- "MUL R0.xy, R0, c[3];\n"
"ADD R0.z, R0, R0.w;\n"
+ "MUL R0.xy, R0, c[0];\n"
"ADD R0.x, R0, R0.y;\n"
- "MUL R0.z, c[5].x, -R0;\n"
- "MUL R0.y, R0.z, c[4];\n"
- "MUL R0.x, R0, c[4];\n"
+ "MUL R0.z, -R0, c[1].x;\n"
+ "MUL R0.y, R0.z, c[6];\n"
+ "MUL R0.x, R0, c[6];\n"
"MAD R0.y, R0.x, R0.x, -R0;\n"
- "MOV R0.z, c[4].x;\n"
- "RSQ R0.y, R0.y;\n"
- "RCP R0.y, R0.y;\n"
- "MUL R0.z, c[5].x, R0;\n"
- "MUL R1.xy, fragment.position, c[6];\n"
- "TEX R1, R1, texture[0], 2D;\n"
- "ADD R0.x, -R0, R0.y;\n"
+ "RSQ R0.z, R0.y;\n"
"RCP R0.z, R0.z;\n"
- "MUL R0.x, R0, R0.z;\n"
+ "ADD R0.x, -R0, R0.z;\n"
+ "MUL R0.zw, fragment.position.xyxy, c[5].xyxy;\n"
+ "TEX R1, R0.zwzw, texture[0], 2D;\n"
+ "MOV R0.y, c[6].x;\n"
+ "MUL R0.y, R0, c[1].x;\n"
+ "RCP R0.y, R0.y;\n"
+ "MUL R0.x, R0, R0.y;\n"
"TEX R0, R0, texture[1], 1D;\n"
- "MUL R2.xyz, R1, R0.w;\n"
+ "MUL R2.xyz, R0.w, R1;\n"
"MAD R3.xyz, R0, R1.w, R2;\n"
"MUL R2.xyz, R0, R1;\n"
- "MAD R2.xyz, -R2, c[4].x, R3;\n"
- "ADD R2.w, -R1, c[4].z;\n"
+ "MAD R2.xyz, -R2, c[6].x, R3;\n"
+ "ADD R2.w, -R1, c[6].z;\n"
"MAD R0.xyz, R0, R2.w, R2;\n"
"ADD R2.x, R0.w, R1.w;\n"
- "ADD R2.y, -R0.w, c[4].z;\n"
+ "ADD R2.y, -R0.w, c[6].z;\n"
"MAD result.color.xyz, R1, R2.y, R0;\n"
"MAD result.color.w, -R0, R1, R2.x;\n"
"END\n"
@@ -2256,35 +2164,34 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_RADIAL_COMPOSITION_MOD
static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_RADIAL_COMPOSITION_MODE_BLEND_MODE_MASK =
"!!ARBfp1.0\n"
- "PARAM c[9] = { program.local[0..3],\n"
- " { 2, 4 },\n"
- " program.local[5..8] };\n"
+ "PARAM c[9] = { program.local[0..7],\n"
+ " { 2, 4 } };\n"
"TEMP R0;\n"
"TEMP R1;\n"
- "MUL R0.xyz, fragment.position.y, c[1];\n"
- "MAD R0.xyz, fragment.position.x, c[0], R0;\n"
- "ADD R0.xyz, R0, c[2];\n"
+ "MUL R0.xyz, fragment.position.y, c[3];\n"
+ "MAD R0.xyz, fragment.position.x, c[2], R0;\n"
+ "ADD R0.xyz, R0, c[4];\n"
"RCP R0.z, R0.z;\n"
"MUL R0.xy, R0, R0.z;\n"
"MUL R0.zw, R0.xyxy, R0.xyxy;\n"
- "MUL R0.xy, R0, c[3];\n"
+ "MUL R0.xy, R0, c[0];\n"
"ADD R0.z, R0, R0.w;\n"
"ADD R0.x, R0, R0.y;\n"
- "MUL R0.z, c[5].x, -R0;\n"
- "MUL R0.y, R0.z, c[4];\n"
- "MUL R0.x, R0, c[4];\n"
+ "MUL R0.z, -R0, c[1].x;\n"
+ "MUL R0.y, R0.z, c[8];\n"
+ "MUL R0.x, R0, c[8];\n"
"MAD R0.y, R0.x, R0.x, -R0;\n"
"RSQ R0.y, R0.y;\n"
"RCP R0.y, R0.y;\n"
"ADD R1.x, -R0, R0.y;\n"
- "MOV R0.z, c[4].x;\n"
- "MUL R0.z, c[5].x, R0;\n"
+ "MOV R0.z, c[8].x;\n"
+ "MUL R0.z, R0, c[1].x;\n"
"RCP R1.y, R0.z;\n"
"ADD R0.xy, fragment.position, c[6];\n"
- "MUL R0.xy, R0, c[7];\n"
+ "MUL R0.xy, R0, c[5];\n"
"TEX R0, R0, texture[0], 2D;\n"
"MUL R1.x, R1, R1.y;\n"
- "DP4 R1.y, R0, c[8];\n"
+ "DP4 R1.y, R0, c[7];\n"
"TEX R0, R1, texture[1], 1D;\n"
"MUL result.color, R0, R1.y;\n"
"END\n"
@@ -2292,480 +2199,479 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_RADIAL_COMPOSITION_MOD
static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_RADIAL_COMPOSITION_MODE_BLEND_MODE_NOMASK =
"!!ARBfp1.0\n"
- "PARAM c[6] = { program.local[0..3],\n"
- " { 2, 4 },\n"
- " program.local[5] };\n"
+ "PARAM c[6] = { program.local[0..4],\n"
+ " { 2, 4 } };\n"
"TEMP R0;\n"
- "MUL R0.xyz, fragment.position.y, c[1];\n"
- "MAD R0.xyz, fragment.position.x, c[0], R0;\n"
- "ADD R0.xyz, R0, c[2];\n"
+ "MUL R0.xyz, fragment.position.y, c[3];\n"
+ "MAD R0.xyz, fragment.position.x, c[2], R0;\n"
+ "ADD R0.xyz, R0, c[4];\n"
"RCP R0.z, R0.z;\n"
"MUL R0.xy, R0, R0.z;\n"
"MUL R0.zw, R0.xyxy, R0.xyxy;\n"
- "MUL R0.xy, R0, c[3];\n"
+ "MUL R0.xy, R0, c[0];\n"
"ADD R0.x, R0, R0.y;\n"
"ADD R0.z, R0, R0.w;\n"
- "MUL R0.z, c[5].x, -R0;\n"
- "MUL R0.y, R0.z, c[4];\n"
- "MUL R0.x, R0, c[4];\n"
- "MAD R0.y, R0.x, R0.x, -R0;\n"
- "MOV R0.z, c[4].x;\n"
- "RSQ R0.y, R0.y;\n"
- "MUL R0.z, c[5].x, R0;\n"
- "RCP R0.y, R0.y;\n"
+ "MUL R0.z, -R0, c[1].x;\n"
+ "MUL R0.y, R0.z, c[5];\n"
+ "MUL R0.x, R0, c[5];\n"
+ "MAD R0.z, R0.x, R0.x, -R0.y;\n"
+ "MOV R0.y, c[5].x;\n"
+ "RSQ R0.z, R0.z;\n"
+ "MUL R0.y, R0, c[1].x;\n"
"RCP R0.z, R0.z;\n"
- "ADD R0.x, -R0, R0.y;\n"
- "MUL R0.x, R0, R0.z;\n"
+ "RCP R0.y, R0.y;\n"
+ "ADD R0.x, -R0, R0.z;\n"
+ "MUL R0.x, R0, R0.y;\n"
"TEX result.color, R0, texture[0], 1D;\n"
"END\n"
;
static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MODES_SIMPLE_PORTER_DUFF =
"!!ARBfp1.0\n"
- "PARAM c[13] = { program.local[0..5],\n"
- " { 0.0020000001, 9.9999997e-10, 0.1963, 0.9817 },\n"
- " { 2.3561945, 0.78539819, -1, 1 },\n"
- " program.local[8],\n"
- " { 0.15915494 },\n"
- " program.local[10..12] };\n"
+ "PARAM c[13] = { program.local[0..9],\n"
+ " { 0.15915494, 0.0020000001, 3.1415927, 1.5707964 },\n"
+ " { -0.01348047, 0.057477314, 0.12123907, 0.19563593 },\n"
+ " { 0.33299461, 0.99999565, 1 } };\n"
"TEMP R0;\n"
"TEMP R1;\n"
"TEMP R2;\n"
"TEMP R3;\n"
- "MUL R0.xyz, fragment.position.y, c[4];\n"
- "MAD R0.xyz, fragment.position.x, c[3], R0;\n"
- "ADD R0.xyz, R0, c[5];\n"
+ "MUL R0.xyz, fragment.position.y, c[2];\n"
+ "MAD R0.xyz, fragment.position.x, c[1], R0;\n"
+ "ADD R0.xyz, R0, c[3];\n"
"RCP R0.z, R0.z;\n"
"MUL R0.xy, R0, R0.z;\n"
- "ABS R0.w, R0.x;\n"
- "ABS R0.z, R0.y;\n"
- "ADD R0.z, R0, -R0.w;\n"
- "ADD R0.w, R0.y, c[6].x;\n"
- "ABS R0.z, R0;\n"
- "CMP R0.y, -R0.z, R0, R0.w;\n"
- "ABS R0.z, -R0.y;\n"
- "ADD R0.z, R0, c[6].y;\n"
- "ADD R0.w, R0.x, R0.z;\n"
- "ADD R1.x, R0.z, -R0;\n"
- "RCP R1.y, R0.w;\n"
- "RCP R1.x, R1.x;\n"
- "MUL R0.w, R0, R1.x;\n"
- "ADD R0.z, R0.x, -R0;\n"
- "MUL R0.z, R0, R1.y;\n"
- "CMP R0.z, R0.x, R0.w, R0;\n"
- "MUL R0.w, R0.z, R0.z;\n"
- "MOV R1.x, c[7].y;\n"
- "CMP R0.x, R0, c[7], R1;\n"
- "MAD R0.w, R0, c[6].z, -c[6];\n"
- "MAD R0.x, R0.w, R0.z, R0;\n"
- "CMP R0.y, -R0, c[7].z, c[7].w;\n"
- "MAD R0.x, R0, R0.y, c[8];\n"
- "MUL R0.x, R0, c[9];\n"
- "FLR R0.y, R0.x;\n"
- "MUL R0.zw, fragment.position.xyxy, c[10].xyxy;\n"
- "TEX R1, R0.zwzw, texture[0], 2D;\n"
- "ADD R0.x, R0, -R0.y;\n"
- "TEX R0, R0, texture[2], 1D;\n"
- "MUL R2.xyz, R1, c[12].y;\n"
- "MUL R3.xyz, R2, R0.w;\n"
- "MUL R2.xyz, R0, c[12].x;\n"
- "MAD R2.xyz, R2, R1.w, R3;\n"
- "ADD R3.xy, fragment.position, c[0];\n"
- "ADD R2.w, -R1, c[7];\n"
- "MUL R0.xyz, R0, c[11].y;\n"
- "MAD R2.xyz, R0, R2.w, R2;\n"
- "MUL R0.xyz, R1, c[11].z;\n"
- "ADD R3.z, -R0.w, c[7].w;\n"
- "MAD R2.xyz, R0, R3.z, R2;\n"
- "MUL R0.y, R0.w, R2.w;\n"
- "MUL R0.x, R0.w, R1.w;\n"
- "MUL R0.z, R1.w, R3;\n"
- "DP3 R2.w, R0, c[11];\n"
- "MUL R3.xy, R3, c[1];\n"
- "TEX R0, R3, texture[1], 2D;\n"
- "ADD R2, R2, -R1;\n"
- "DP4 R0.x, R0, c[2];\n"
- "MAD result.color, R0.x, R2, R1;\n"
+ "ABS R0.z, R0.x;\n"
+ "ABS R0.w, R0.y;\n"
+ "ADD R0.w, R0, -R0.z;\n"
+ "ADD R1.x, R0.y, c[10].y;\n"
+ "ABS R0.w, R0;\n"
+ "CMP R0.y, -R0.w, R0, R1.x;\n"
+ "ABS R0.w, -R0.y;\n"
+ "MAX R1.x, R0.z, R0.w;\n"
+ "RCP R1.y, R1.x;\n"
+ "MIN R1.x, R0.z, R0.w;\n"
+ "MUL R1.x, R1, R1.y;\n"
+ "MUL R1.y, R1.x, R1.x;\n"
+ "MAD R1.z, R1.y, c[11].x, c[11].y;\n"
+ "MAD R1.z, R1, R1.y, -c[11];\n"
+ "MAD R1.z, R1, R1.y, c[11].w;\n"
+ "MAD R1.z, R1, R1.y, -c[12].x;\n"
+ "MAD R1.y, R1.z, R1, c[12];\n"
+ "MUL R1.x, R1.y, R1;\n"
+ "ADD R1.y, -R1.x, c[10].w;\n"
+ "ADD R0.z, -R0, R0.w;\n"
+ "CMP R0.z, -R0, R1.y, R1.x;\n"
+ "ADD R0.w, -R0.z, c[10].z;\n"
+ "CMP R0.x, R0, R0.w, R0.z;\n"
+ "CMP R0.x, -R0.y, -R0, R0;\n"
+ "ADD R0.x, R0, c[0];\n"
+ "MUL R1.x, R0, c[10];\n"
+ "FLR R1.y, R1.x;\n"
+ "MUL R0.xy, fragment.position, c[7];\n"
+ "TEX R0, R0, texture[0], 2D;\n"
+ "ADD R1.x, R1, -R1.y;\n"
+ "TEX R1, R1, texture[2], 1D;\n"
+ "MUL R2.xyz, R0, c[4].y;\n"
+ "MUL R3.xyz, R1.w, R2;\n"
+ "MUL R2.xyz, R1, c[4].x;\n"
+ "MAD R2.xyz, R0.w, R2, R3;\n"
+ "ADD R3.xy, fragment.position, c[8];\n"
+ "ADD R2.w, -R0, c[12].z;\n"
+ "MUL R1.xyz, R1, c[5].y;\n"
+ "MAD R2.xyz, R2.w, R1, R2;\n"
+ "MUL R1.xyz, R0, c[5].z;\n"
+ "ADD R3.z, -R1.w, c[12];\n"
+ "MAD R2.xyz, R3.z, R1, R2;\n"
+ "MUL R1.y, R1.w, R2.w;\n"
+ "MUL R1.x, R1.w, R0.w;\n"
+ "MUL R1.z, R0.w, R3;\n"
+ "DP3 R2.w, R1, c[5];\n"
+ "MUL R3.xy, R3, c[6];\n"
+ "TEX R1, R3, texture[1], 2D;\n"
+ "ADD R2, R2, -R0;\n"
+ "DP4 R1.x, R1, c[9];\n"
+ "MAD result.color, R1.x, R2, R0;\n"
"END\n"
;
static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MODES_MULTIPLY =
"!!ARBfp1.0\n"
- "PARAM c[11] = { program.local[0..5],\n"
- " { 0.0020000001, 9.9999997e-10, 0.1963, 0.9817 },\n"
- " { 2.3561945, 0.78539819, -1, 1 },\n"
- " program.local[8],\n"
- " { 0.15915494 },\n"
- " program.local[10] };\n"
+ "PARAM c[11] = { program.local[0..7],\n"
+ " { 0.15915494, 0.0020000001, 3.1415927, 1.5707964 },\n"
+ " { -0.01348047, 0.057477314, 0.12123907, 0.19563593 },\n"
+ " { 0.33299461, 0.99999565, 1 } };\n"
"TEMP R0;\n"
"TEMP R1;\n"
"TEMP R2;\n"
- "MUL R0.xyz, fragment.position.y, c[4];\n"
- "MAD R0.xyz, fragment.position.x, c[3], R0;\n"
- "ADD R0.xyz, R0, c[5];\n"
+ "MUL R0.xyz, fragment.position.y, c[2];\n"
+ "MAD R0.xyz, fragment.position.x, c[1], R0;\n"
+ "ADD R0.xyz, R0, c[3];\n"
"RCP R0.z, R0.z;\n"
"MUL R0.xy, R0, R0.z;\n"
- "ABS R0.w, R0.x;\n"
- "ABS R0.z, R0.y;\n"
- "ADD R0.z, R0, -R0.w;\n"
- "ADD R0.w, R0.y, c[6].x;\n"
- "ABS R0.z, R0;\n"
- "CMP R0.y, -R0.z, R0, R0.w;\n"
- "ABS R0.z, -R0.y;\n"
- "ADD R0.z, R0, c[6].y;\n"
- "ADD R0.w, R0.x, R0.z;\n"
- "ADD R1.x, R0.z, -R0;\n"
- "RCP R1.y, R0.w;\n"
- "RCP R1.x, R1.x;\n"
- "MUL R0.w, R0, R1.x;\n"
- "ADD R0.z, R0.x, -R0;\n"
- "MUL R0.z, R0, R1.y;\n"
- "CMP R0.z, R0.x, R0.w, R0;\n"
- "MUL R0.w, R0.z, R0.z;\n"
- "MOV R1.x, c[7].y;\n"
- "CMP R0.x, R0, c[7], R1;\n"
- "MAD R0.w, R0, c[6].z, -c[6];\n"
- "MAD R0.x, R0.w, R0.z, R0;\n"
- "CMP R0.y, -R0, c[7].z, c[7].w;\n"
- "MAD R0.x, R0, R0.y, c[8];\n"
- "MUL R0.x, R0, c[9];\n"
- "FLR R0.y, R0.x;\n"
- "MUL R0.zw, fragment.position.xyxy, c[10].xyxy;\n"
- "TEX R1, R0.zwzw, texture[0], 2D;\n"
- "ADD R0.x, R0, -R0.y;\n"
- "TEX R0, R0, texture[2], 1D;\n"
- "ADD R2.x, -R1.w, c[7].w;\n"
- "MUL R2.xyz, R0, R2.x;\n"
- "MAD R0.xyz, R0, R1, R2;\n"
- "ADD R2.x, -R0.w, c[7].w;\n"
- "MAD R2.xyz, R1, R2.x, R0;\n"
- "ADD R0.z, R0.w, R1.w;\n"
- "MAD R2.w, -R0, R1, R0.z;\n"
- "ADD R0.xy, fragment.position, c[0];\n"
- "MUL R0.xy, R0, c[1];\n"
- "TEX R0, R0, texture[1], 2D;\n"
- "ADD R2, R2, -R1;\n"
- "DP4 R0.x, R0, c[2];\n"
- "MAD result.color, R0.x, R2, R1;\n"
+ "ABS R0.z, R0.x;\n"
+ "ABS R0.w, R0.y;\n"
+ "ADD R0.w, R0, -R0.z;\n"
+ "ADD R1.x, R0.y, c[8].y;\n"
+ "ABS R0.w, R0;\n"
+ "CMP R0.y, -R0.w, R0, R1.x;\n"
+ "ABS R0.w, -R0.y;\n"
+ "MAX R1.x, R0.z, R0.w;\n"
+ "RCP R1.y, R1.x;\n"
+ "MIN R1.x, R0.z, R0.w;\n"
+ "MUL R1.x, R1, R1.y;\n"
+ "MUL R1.y, R1.x, R1.x;\n"
+ "MAD R1.z, R1.y, c[9].x, c[9].y;\n"
+ "MAD R1.z, R1, R1.y, -c[9];\n"
+ "MAD R1.z, R1, R1.y, c[9].w;\n"
+ "MAD R1.z, R1, R1.y, -c[10].x;\n"
+ "MAD R1.y, R1.z, R1, c[10];\n"
+ "MUL R1.x, R1.y, R1;\n"
+ "ADD R1.y, -R1.x, c[8].w;\n"
+ "ADD R0.z, -R0, R0.w;\n"
+ "CMP R0.z, -R0, R1.y, R1.x;\n"
+ "ADD R0.w, -R0.z, c[8].z;\n"
+ "CMP R0.x, R0, R0.w, R0.z;\n"
+ "CMP R0.x, -R0.y, -R0, R0;\n"
+ "ADD R0.x, R0, c[0];\n"
+ "MUL R1.x, R0, c[8];\n"
+ "FLR R1.y, R1.x;\n"
+ "MUL R0.xy, fragment.position, c[5];\n"
+ "TEX R0, R0, texture[0], 2D;\n"
+ "ADD R1.x, R1, -R1.y;\n"
+ "TEX R1, R1, texture[2], 1D;\n"
+ "ADD R2.x, -R0.w, c[10].z;\n"
+ "MUL R2.xyz, R1, R2.x;\n"
+ "MAD R1.xyz, R1, R0, R2;\n"
+ "ADD R2.x, -R1.w, c[10].z;\n"
+ "MAD R2.xyz, R0, R2.x, R1;\n"
+ "ADD R1.z, R1.w, R0.w;\n"
+ "MAD R2.w, -R1, R0, R1.z;\n"
+ "ADD R1.xy, fragment.position, c[6];\n"
+ "MUL R1.xy, R1, c[4];\n"
+ "TEX R1, R1, texture[1], 2D;\n"
+ "ADD R2, R2, -R0;\n"
+ "DP4 R1.x, R1, c[7];\n"
+ "MAD result.color, R1.x, R2, R0;\n"
"END\n"
;
static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MODES_SCREEN =
"!!ARBfp1.0\n"
- "PARAM c[11] = { program.local[0..5],\n"
- " { 0.0020000001, 9.9999997e-10, 0.1963, 0.9817 },\n"
- " { 2.3561945, 0.78539819, -1, 1 },\n"
- " program.local[8],\n"
- " { 0.15915494 },\n"
- " program.local[10] };\n"
+ "PARAM c[11] = { program.local[0..7],\n"
+ " { 0.15915494, 0.0020000001, 3.1415927, 1.5707964 },\n"
+ " { -0.01348047, 0.057477314, 0.12123907, 0.19563593 },\n"
+ " { 0.33299461, 0.99999565 } };\n"
"TEMP R0;\n"
"TEMP R1;\n"
"TEMP R2;\n"
"TEMP R3;\n"
- "MUL R0.xyz, fragment.position.y, c[4];\n"
- "MAD R0.xyz, fragment.position.x, c[3], R0;\n"
- "ADD R0.xyz, R0, c[5];\n"
+ "MUL R0.xyz, fragment.position.y, c[2];\n"
+ "MAD R0.xyz, fragment.position.x, c[1], R0;\n"
+ "ADD R0.xyz, R0, c[3];\n"
"RCP R0.z, R0.z;\n"
"MUL R0.xy, R0, R0.z;\n"
- "ADD R3.xy, fragment.position, c[0];\n"
- "ABS R0.w, R0.x;\n"
- "ABS R0.z, R0.y;\n"
- "ADD R0.z, R0, -R0.w;\n"
- "ADD R0.w, R0.y, c[6].x;\n"
- "ABS R0.z, R0;\n"
- "CMP R0.y, -R0.z, R0, R0.w;\n"
- "ABS R0.z, -R0.y;\n"
- "ADD R0.z, R0, c[6].y;\n"
- "ADD R0.w, R0.x, R0.z;\n"
- "ADD R1.x, R0.z, -R0;\n"
- "RCP R1.y, R0.w;\n"
- "RCP R1.x, R1.x;\n"
- "MUL R0.w, R0, R1.x;\n"
- "ADD R0.z, R0.x, -R0;\n"
- "MUL R0.z, R0, R1.y;\n"
- "CMP R0.z, R0.x, R0.w, R0;\n"
- "MUL R0.w, R0.z, R0.z;\n"
- "MOV R1.x, c[7].y;\n"
- "CMP R0.x, R0, c[7], R1;\n"
- "MAD R0.w, R0, c[6].z, -c[6];\n"
- "MUL R1.xy, fragment.position, c[10];\n"
- "TEX R1, R1, texture[0], 2D;\n"
- "CMP R0.y, -R0, c[7].z, c[7].w;\n"
- "MAD R0.x, R0.w, R0.z, R0;\n"
- "MAD R0.x, R0, R0.y, c[8];\n"
- "MUL R0.x, R0, c[9];\n"
+ "ADD R3.xy, fragment.position, c[6];\n"
+ "ABS R0.z, R0.x;\n"
+ "ABS R0.w, R0.y;\n"
+ "ADD R0.w, R0, -R0.z;\n"
+ "ADD R1.x, R0.y, c[8].y;\n"
+ "ABS R0.w, R0;\n"
+ "CMP R0.y, -R0.w, R0, R1.x;\n"
+ "ABS R0.w, -R0.y;\n"
+ "MAX R1.x, R0.z, R0.w;\n"
+ "RCP R1.y, R1.x;\n"
+ "MIN R1.x, R0.z, R0.w;\n"
+ "MUL R1.x, R1, R1.y;\n"
+ "MUL R1.y, R1.x, R1.x;\n"
+ "MAD R1.z, R1.y, c[9].x, c[9].y;\n"
+ "MAD R1.z, R1, R1.y, -c[9];\n"
+ "MAD R1.z, R1, R1.y, c[9].w;\n"
+ "MAD R1.z, R1, R1.y, -c[10].x;\n"
+ "MAD R1.y, R1.z, R1, c[10];\n"
+ "MUL R1.x, R1.y, R1;\n"
+ "ADD R0.z, -R0, R0.w;\n"
+ "ADD R1.y, -R1.x, c[8].w;\n"
+ "CMP R0.z, -R0, R1.y, R1.x;\n"
+ "ADD R0.w, -R0.z, c[8].z;\n"
+ "CMP R0.x, R0, R0.w, R0.z;\n"
+ "CMP R0.x, -R0.y, -R0, R0;\n"
+ "ADD R0.x, R0, c[0];\n"
+ "MUL R0.x, R0, c[8];\n"
"FLR R0.y, R0.x;\n"
- "ADD R0.x, R0, -R0.y;\n"
- "TEX R0, R0, texture[2], 1D;\n"
- "ADD R2, R0, R1;\n"
- "MAD R2, -R0, R1, R2;\n"
- "MUL R3.xy, R3, c[1];\n"
- "TEX R0, R3, texture[1], 2D;\n"
- "ADD R2, R2, -R1;\n"
- "DP4 R0.x, R0, c[2];\n"
- "MAD result.color, R0.x, R2, R1;\n"
+ "ADD R0.z, R0.x, -R0.y;\n"
+ "TEX R1, R0.z, texture[2], 1D;\n"
+ "MUL R0.xy, fragment.position, c[5];\n"
+ "TEX R0, R0, texture[0], 2D;\n"
+ "ADD R2, R1, R0;\n"
+ "MAD R2, -R1, R0, R2;\n"
+ "MUL R3.xy, R3, c[4];\n"
+ "TEX R1, R3, texture[1], 2D;\n"
+ "ADD R2, R2, -R0;\n"
+ "DP4 R1.x, R1, c[7];\n"
+ "MAD result.color, R1.x, R2, R0;\n"
"END\n"
;
static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MODES_OVERLAY =
"!!ARBfp1.0\n"
- "PARAM c[11] = { program.local[0..5],\n"
- " { 0.0020000001, 9.9999997e-10, 0.1963, 0.9817 },\n"
- " { 2.3561945, 0.78539819, -1, 1 },\n"
- " program.local[8],\n"
- " { 0.15915494, 2 },\n"
- " program.local[10] };\n"
+ "PARAM c[11] = { program.local[0..7],\n"
+ " { 0.0020000001, -0.01348047, 0.057477314, 0.12123907 },\n"
+ " { 0.19563593, 0.33299461, 0.99999565, 1.5707964 },\n"
+ " { 3.1415927, 0.15915494, 2, 1 } };\n"
"TEMP R0;\n"
"TEMP R1;\n"
"TEMP R2;\n"
"TEMP R3;\n"
"TEMP R4;\n"
- "MUL R0.xyz, fragment.position.y, c[4];\n"
- "MAD R0.xyz, fragment.position.x, c[3], R0;\n"
- "ADD R0.xyz, R0, c[5];\n"
+ "MUL R0.xyz, fragment.position.y, c[2];\n"
+ "MAD R0.xyz, fragment.position.x, c[1], R0;\n"
+ "ADD R0.xyz, R0, c[3];\n"
"RCP R0.z, R0.z;\n"
"MUL R0.xy, R0, R0.z;\n"
- "ABS R0.w, R0.x;\n"
- "ABS R0.z, R0.y;\n"
- "ADD R0.z, R0, -R0.w;\n"
- "ADD R0.w, R0.y, c[6].x;\n"
- "ABS R0.z, R0;\n"
- "CMP R0.y, -R0.z, R0, R0.w;\n"
- "ABS R0.z, -R0.y;\n"
- "ADD R0.z, R0, c[6].y;\n"
- "ADD R0.w, R0.x, R0.z;\n"
- "ADD R1.x, R0.z, -R0;\n"
- "RCP R1.y, R0.w;\n"
- "RCP R1.x, R1.x;\n"
- "MUL R0.w, R0, R1.x;\n"
- "ADD R0.z, R0.x, -R0;\n"
- "MUL R0.z, R0, R1.y;\n"
- "CMP R0.z, R0.x, R0.w, R0;\n"
- "MUL R0.w, R0.z, R0.z;\n"
- "MOV R1.x, c[7].y;\n"
- "CMP R0.x, R0, c[7], R1;\n"
- "MAD R0.w, R0, c[6].z, -c[6];\n"
- "MUL R1.xy, fragment.position, c[10];\n"
- "TEX R1, R1, texture[0], 2D;\n"
- "ADD R2.w, -R1, c[7];\n"
- "CMP R0.y, -R0, c[7].z, c[7].w;\n"
- "MAD R0.x, R0.w, R0.z, R0;\n"
- "MAD R0.x, R0, R0.y, c[8];\n"
- "MUL R0.x, R0, c[9];\n"
+ "ABS R0.z, R0.x;\n"
+ "ABS R0.w, R0.y;\n"
+ "ADD R0.w, R0, -R0.z;\n"
+ "ADD R1.x, R0.y, c[8];\n"
+ "ABS R0.w, R0;\n"
+ "CMP R0.y, -R0.w, R0, R1.x;\n"
+ "ABS R0.w, -R0.y;\n"
+ "MAX R1.x, R0.z, R0.w;\n"
+ "RCP R1.y, R1.x;\n"
+ "MIN R1.x, R0.z, R0.w;\n"
+ "MUL R1.x, R1, R1.y;\n"
+ "MUL R1.y, R1.x, R1.x;\n"
+ "MAD R1.z, R1.y, c[8].y, c[8];\n"
+ "MAD R1.z, R1, R1.y, -c[8].w;\n"
+ "MAD R1.z, R1, R1.y, c[9].x;\n"
+ "MAD R1.z, R1, R1.y, -c[9].y;\n"
+ "MAD R1.y, R1.z, R1, c[9].z;\n"
+ "MUL R1.x, R1.y, R1;\n"
+ "ADD R0.z, -R0, R0.w;\n"
+ "ADD R1.y, -R1.x, c[9].w;\n"
+ "CMP R0.z, -R0, R1.y, R1.x;\n"
+ "ADD R0.w, -R0.z, c[10].x;\n"
+ "CMP R0.x, R0, R0.w, R0.z;\n"
+ "CMP R0.x, -R0.y, -R0, R0;\n"
+ "ADD R0.x, R0, c[0];\n"
+ "MUL R0.x, R0, c[10].y;\n"
"FLR R0.y, R0.x;\n"
"ADD R0.x, R0, -R0.y;\n"
"TEX R0, R0, texture[2], 1D;\n"
+ "MUL R1.xy, fragment.position, c[5];\n"
+ "TEX R1, R1, texture[0], 2D;\n"
+ "ADD R2.w, -R1, c[10];\n"
"ADD R3.xyz, R0.w, -R0;\n"
"ADD R2.xyz, R1.w, -R1;\n"
"MUL R2.xyz, R2, R3;\n"
- "MUL R2.xyz, R2, c[9].y;\n"
+ "MUL R2.xyz, R2, c[10].z;\n"
"MAD R2.xyz, R0.w, R1.w, -R2;\n"
"MUL R4.xyz, R0, R2.w;\n"
"MUL R3.xyz, R0, R1;\n"
"MAD R0.xyz, R0, R2.w, R2;\n"
- "ADD R2.x, -R0.w, c[7].w;\n"
- "MAD R3.xyz, R3, c[9].y, R4;\n"
+ "ADD R2.x, -R0.w, c[10].w;\n"
+ "MAD R3.xyz, R3, c[10].z, R4;\n"
"MAD R3.xyz, R1, R2.x, R3;\n"
"MAD R0.xyz, R1, R2.x, R0;\n"
- "MUL R2.xyz, R1, c[9].y;\n"
+ "MUL R2.xyz, R1, c[10].z;\n"
"ADD R0.xyz, R0, -R3;\n"
"SGE R2.xyz, R2, R1.w;\n"
"MAD R2.xyz, R2, R0, R3;\n"
"ADD R0.z, R0.w, R1.w;\n"
"MAD R2.w, -R0, R1, R0.z;\n"
- "ADD R0.xy, fragment.position, c[0];\n"
- "MUL R0.xy, R0, c[1];\n"
+ "ADD R0.xy, fragment.position, c[6];\n"
+ "MUL R0.xy, R0, c[4];\n"
"TEX R0, R0, texture[1], 2D;\n"
"ADD R2, R2, -R1;\n"
- "DP4 R0.x, R0, c[2];\n"
+ "DP4 R0.x, R0, c[7];\n"
"MAD result.color, R0.x, R2, R1;\n"
"END\n"
;
static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MODES_DARKEN =
"!!ARBfp1.0\n"
- "PARAM c[11] = { program.local[0..5],\n"
- " { 0.0020000001, 9.9999997e-10, 0.1963, 0.9817 },\n"
- " { 2.3561945, 0.78539819, -1, 1 },\n"
- " program.local[8],\n"
- " { 0.15915494 },\n"
- " program.local[10] };\n"
+ "PARAM c[11] = { program.local[0..7],\n"
+ " { 0.15915494, 0.0020000001, 3.1415927, 1.5707964 },\n"
+ " { -0.01348047, 0.057477314, 0.12123907, 0.19563593 },\n"
+ " { 0.33299461, 0.99999565, 1 } };\n"
"TEMP R0;\n"
"TEMP R1;\n"
"TEMP R2;\n"
"TEMP R3;\n"
- "MUL R0.xyz, fragment.position.y, c[4];\n"
- "MAD R0.xyz, fragment.position.x, c[3], R0;\n"
- "ADD R0.xyz, R0, c[5];\n"
+ "MUL R0.xyz, fragment.position.y, c[2];\n"
+ "MAD R0.xyz, fragment.position.x, c[1], R0;\n"
+ "ADD R0.xyz, R0, c[3];\n"
"RCP R0.z, R0.z;\n"
"MUL R0.xy, R0, R0.z;\n"
- "ABS R0.w, R0.x;\n"
- "ABS R0.z, R0.y;\n"
- "ADD R0.z, R0, -R0.w;\n"
- "ADD R0.w, R0.y, c[6].x;\n"
- "ABS R0.z, R0;\n"
- "CMP R0.y, -R0.z, R0, R0.w;\n"
- "ABS R0.z, -R0.y;\n"
- "ADD R0.z, R0, c[6].y;\n"
- "ADD R0.w, R0.x, R0.z;\n"
- "ADD R1.x, R0.z, -R0;\n"
- "RCP R1.y, R0.w;\n"
- "RCP R1.x, R1.x;\n"
- "MUL R0.w, R0, R1.x;\n"
- "ADD R0.z, R0.x, -R0;\n"
- "MUL R0.z, R0, R1.y;\n"
- "CMP R0.z, R0.x, R0.w, R0;\n"
- "MUL R0.w, R0.z, R0.z;\n"
- "MOV R1.x, c[7].y;\n"
- "CMP R0.x, R0, c[7], R1;\n"
- "MAD R0.w, R0, c[6].z, -c[6];\n"
- "MUL R1.xy, fragment.position, c[10];\n"
- "TEX R1, R1, texture[0], 2D;\n"
- "CMP R0.y, -R0, c[7].z, c[7].w;\n"
- "MAD R0.x, R0.w, R0.z, R0;\n"
- "MAD R0.x, R0, R0.y, c[8];\n"
- "MUL R0.x, R0, c[9];\n"
- "FLR R0.y, R0.x;\n"
- "ADD R0.x, R0, -R0.y;\n"
- "TEX R0, R0, texture[2], 1D;\n"
- "MUL R3.xyz, R1, R0.w;\n"
- "MUL R2.xyz, R0, R1.w;\n"
+ "ABS R0.z, R0.x;\n"
+ "ABS R0.w, R0.y;\n"
+ "ADD R0.w, R0, -R0.z;\n"
+ "ADD R1.x, R0.y, c[8].y;\n"
+ "ABS R0.w, R0;\n"
+ "CMP R0.y, -R0.w, R0, R1.x;\n"
+ "ABS R0.w, -R0.y;\n"
+ "MAX R1.x, R0.z, R0.w;\n"
+ "RCP R1.y, R1.x;\n"
+ "MIN R1.x, R0.z, R0.w;\n"
+ "MUL R1.x, R1, R1.y;\n"
+ "MUL R1.y, R1.x, R1.x;\n"
+ "MAD R1.z, R1.y, c[9].x, c[9].y;\n"
+ "MAD R1.z, R1, R1.y, -c[9];\n"
+ "MAD R1.z, R1, R1.y, c[9].w;\n"
+ "MAD R1.z, R1, R1.y, -c[10].x;\n"
+ "MAD R1.y, R1.z, R1, c[10];\n"
+ "MUL R1.x, R1.y, R1;\n"
+ "ADD R1.y, -R1.x, c[8].w;\n"
+ "ADD R0.z, -R0, R0.w;\n"
+ "CMP R0.z, -R0, R1.y, R1.x;\n"
+ "ADD R0.w, -R0.z, c[8].z;\n"
+ "CMP R0.x, R0, R0.w, R0.z;\n"
+ "CMP R0.x, -R0.y, -R0, R0;\n"
+ "ADD R0.x, R0, c[0];\n"
+ "MUL R0.z, R0.x, c[8].x;\n"
+ "FLR R0.w, R0.z;\n"
+ "ADD R1.x, R0.z, -R0.w;\n"
+ "MUL R0.xy, fragment.position, c[5];\n"
+ "TEX R0, R0, texture[0], 2D;\n"
+ "TEX R1, R1, texture[2], 1D;\n"
+ "MUL R3.xyz, R1.w, R0;\n"
+ "MUL R2.xyz, R1, R0.w;\n"
"MIN R2.xyz, R2, R3;\n"
- "ADD R2.w, -R1, c[7];\n"
- "MAD R0.xyz, R0, R2.w, R2;\n"
- "ADD R2.x, -R0.w, c[7].w;\n"
- "MAD R2.xyz, R1, R2.x, R0;\n"
- "ADD R0.z, R0.w, R1.w;\n"
- "MAD R2.w, -R0, R1, R0.z;\n"
- "ADD R0.xy, fragment.position, c[0];\n"
- "MUL R0.xy, R0, c[1];\n"
- "TEX R0, R0, texture[1], 2D;\n"
- "ADD R2, R2, -R1;\n"
- "DP4 R0.x, R0, c[2];\n"
- "MAD result.color, R0.x, R2, R1;\n"
+ "ADD R2.w, -R0, c[10].z;\n"
+ "MAD R1.xyz, R1, R2.w, R2;\n"
+ "ADD R2.x, -R1.w, c[10].z;\n"
+ "MAD R2.xyz, R0, R2.x, R1;\n"
+ "ADD R1.z, R1.w, R0.w;\n"
+ "MAD R2.w, -R1, R0, R1.z;\n"
+ "ADD R1.xy, fragment.position, c[6];\n"
+ "MUL R1.xy, R1, c[4];\n"
+ "TEX R1, R1, texture[1], 2D;\n"
+ "ADD R2, R2, -R0;\n"
+ "DP4 R1.x, R1, c[7];\n"
+ "MAD result.color, R1.x, R2, R0;\n"
"END\n"
;
static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MODES_LIGHTEN =
"!!ARBfp1.0\n"
- "PARAM c[11] = { program.local[0..5],\n"
- " { 0.0020000001, 9.9999997e-10, 0.1963, 0.9817 },\n"
- " { 2.3561945, 0.78539819, -1, 1 },\n"
- " program.local[8],\n"
- " { 0.15915494 },\n"
- " program.local[10] };\n"
+ "PARAM c[11] = { program.local[0..7],\n"
+ " { 0.15915494, 0.0020000001, 3.1415927, 1.5707964 },\n"
+ " { -0.01348047, 0.057477314, 0.12123907, 0.19563593 },\n"
+ " { 0.33299461, 0.99999565, 1 } };\n"
"TEMP R0;\n"
"TEMP R1;\n"
"TEMP R2;\n"
"TEMP R3;\n"
- "MUL R0.xyz, fragment.position.y, c[4];\n"
- "MAD R0.xyz, fragment.position.x, c[3], R0;\n"
- "ADD R0.xyz, R0, c[5];\n"
+ "MUL R0.xyz, fragment.position.y, c[2];\n"
+ "MAD R0.xyz, fragment.position.x, c[1], R0;\n"
+ "ADD R0.xyz, R0, c[3];\n"
"RCP R0.z, R0.z;\n"
"MUL R0.xy, R0, R0.z;\n"
- "ABS R0.w, R0.x;\n"
- "ABS R0.z, R0.y;\n"
- "ADD R0.z, R0, -R0.w;\n"
- "ADD R0.w, R0.y, c[6].x;\n"
- "ABS R0.z, R0;\n"
- "CMP R0.y, -R0.z, R0, R0.w;\n"
- "ABS R0.z, -R0.y;\n"
- "ADD R0.z, R0, c[6].y;\n"
- "ADD R0.w, R0.x, R0.z;\n"
- "ADD R1.x, R0.z, -R0;\n"
- "RCP R1.y, R0.w;\n"
- "RCP R1.x, R1.x;\n"
- "MUL R0.w, R0, R1.x;\n"
- "ADD R0.z, R0.x, -R0;\n"
- "MUL R0.z, R0, R1.y;\n"
- "CMP R0.z, R0.x, R0.w, R0;\n"
- "MUL R0.w, R0.z, R0.z;\n"
- "MOV R1.x, c[7].y;\n"
- "CMP R0.x, R0, c[7], R1;\n"
- "MAD R0.w, R0, c[6].z, -c[6];\n"
- "MUL R1.xy, fragment.position, c[10];\n"
- "TEX R1, R1, texture[0], 2D;\n"
- "CMP R0.y, -R0, c[7].z, c[7].w;\n"
- "MAD R0.x, R0.w, R0.z, R0;\n"
- "MAD R0.x, R0, R0.y, c[8];\n"
- "MUL R0.x, R0, c[9];\n"
- "FLR R0.y, R0.x;\n"
- "ADD R0.x, R0, -R0.y;\n"
- "TEX R0, R0, texture[2], 1D;\n"
- "MUL R3.xyz, R1, R0.w;\n"
- "MUL R2.xyz, R0, R1.w;\n"
+ "ABS R0.z, R0.x;\n"
+ "ABS R0.w, R0.y;\n"
+ "ADD R0.w, R0, -R0.z;\n"
+ "ADD R1.x, R0.y, c[8].y;\n"
+ "ABS R0.w, R0;\n"
+ "CMP R0.y, -R0.w, R0, R1.x;\n"
+ "ABS R0.w, -R0.y;\n"
+ "MAX R1.x, R0.z, R0.w;\n"
+ "RCP R1.y, R1.x;\n"
+ "MIN R1.x, R0.z, R0.w;\n"
+ "MUL R1.x, R1, R1.y;\n"
+ "MUL R1.y, R1.x, R1.x;\n"
+ "MAD R1.z, R1.y, c[9].x, c[9].y;\n"
+ "MAD R1.z, R1, R1.y, -c[9];\n"
+ "MAD R1.z, R1, R1.y, c[9].w;\n"
+ "MAD R1.z, R1, R1.y, -c[10].x;\n"
+ "MAD R1.y, R1.z, R1, c[10];\n"
+ "MUL R1.x, R1.y, R1;\n"
+ "ADD R1.y, -R1.x, c[8].w;\n"
+ "ADD R0.z, -R0, R0.w;\n"
+ "CMP R0.z, -R0, R1.y, R1.x;\n"
+ "ADD R0.w, -R0.z, c[8].z;\n"
+ "CMP R0.x, R0, R0.w, R0.z;\n"
+ "CMP R0.x, -R0.y, -R0, R0;\n"
+ "ADD R0.x, R0, c[0];\n"
+ "MUL R0.z, R0.x, c[8].x;\n"
+ "FLR R0.w, R0.z;\n"
+ "ADD R1.x, R0.z, -R0.w;\n"
+ "MUL R0.xy, fragment.position, c[5];\n"
+ "TEX R0, R0, texture[0], 2D;\n"
+ "TEX R1, R1, texture[2], 1D;\n"
+ "MUL R3.xyz, R1.w, R0;\n"
+ "MUL R2.xyz, R1, R0.w;\n"
"MAX R2.xyz, R2, R3;\n"
- "ADD R2.w, -R1, c[7];\n"
- "MAD R0.xyz, R0, R2.w, R2;\n"
- "ADD R2.x, -R0.w, c[7].w;\n"
- "MAD R2.xyz, R1, R2.x, R0;\n"
- "ADD R0.z, R0.w, R1.w;\n"
- "MAD R2.w, -R0, R1, R0.z;\n"
- "ADD R0.xy, fragment.position, c[0];\n"
- "MUL R0.xy, R0, c[1];\n"
- "TEX R0, R0, texture[1], 2D;\n"
- "ADD R2, R2, -R1;\n"
- "DP4 R0.x, R0, c[2];\n"
- "MAD result.color, R0.x, R2, R1;\n"
+ "ADD R2.w, -R0, c[10].z;\n"
+ "MAD R1.xyz, R1, R2.w, R2;\n"
+ "ADD R2.x, -R1.w, c[10].z;\n"
+ "MAD R2.xyz, R0, R2.x, R1;\n"
+ "ADD R1.z, R1.w, R0.w;\n"
+ "MAD R2.w, -R1, R0, R1.z;\n"
+ "ADD R1.xy, fragment.position, c[6];\n"
+ "MUL R1.xy, R1, c[4];\n"
+ "TEX R1, R1, texture[1], 2D;\n"
+ "ADD R2, R2, -R0;\n"
+ "DP4 R1.x, R1, c[7];\n"
+ "MAD result.color, R1.x, R2, R0;\n"
"END\n"
;
static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MODES_COLORDODGE =
"!!ARBfp1.0\n"
- "PARAM c[11] = { program.local[0..5],\n"
- " { 0.0020000001, 9.9999997e-10, 0.1963, 0.9817 },\n"
- " { 2.3561945, 0.78539819, -1, 1 },\n"
- " program.local[8],\n"
- " { 0.15915494, 1e-06 },\n"
- " program.local[10] };\n"
+ "PARAM c[11] = { program.local[0..7],\n"
+ " { 0.0020000001, -0.01348047, 0.057477314, 0.12123907 },\n"
+ " { 0.19563593, 0.33299461, 0.99999565, 1.5707964 },\n"
+ " { 3.1415927, 0.15915494, 1, 1e-006 } };\n"
"TEMP R0;\n"
"TEMP R1;\n"
"TEMP R2;\n"
"TEMP R3;\n"
"TEMP R4;\n"
- "MUL R0.xyz, fragment.position.y, c[4];\n"
- "MAD R0.xyz, fragment.position.x, c[3], R0;\n"
- "ADD R0.xyz, R0, c[5];\n"
+ "MUL R0.xyz, fragment.position.y, c[2];\n"
+ "MAD R0.xyz, fragment.position.x, c[1], R0;\n"
+ "ADD R0.xyz, R0, c[3];\n"
"RCP R0.z, R0.z;\n"
"MUL R0.xy, R0, R0.z;\n"
- "ABS R0.w, R0.x;\n"
- "ABS R0.z, R0.y;\n"
- "ADD R0.z, R0, -R0.w;\n"
- "ADD R0.w, R0.y, c[6].x;\n"
- "ABS R0.z, R0;\n"
- "CMP R0.y, -R0.z, R0, R0.w;\n"
- "ABS R0.z, -R0.y;\n"
- "ADD R0.z, R0, c[6].y;\n"
- "ADD R0.w, R0.x, R0.z;\n"
- "ADD R1.x, R0.z, -R0;\n"
- "RCP R1.y, R0.w;\n"
- "RCP R1.x, R1.x;\n"
- "MUL R0.w, R0, R1.x;\n"
- "ADD R0.z, R0.x, -R0;\n"
- "MUL R0.z, R0, R1.y;\n"
- "CMP R0.z, R0.x, R0.w, R0;\n"
- "MUL R0.w, R0.z, R0.z;\n"
- "MOV R1.x, c[7].y;\n"
- "CMP R0.x, R0, c[7], R1;\n"
- "MAD R0.w, R0, c[6].z, -c[6];\n"
- "CMP R0.y, -R0, c[7].z, c[7].w;\n"
- "MAD R0.x, R0.w, R0.z, R0;\n"
- "MAD R0.x, R0, R0.y, c[8];\n"
- "MUL R0.x, R0, c[9];\n"
+ "ABS R0.z, R0.x;\n"
+ "ABS R0.w, R0.y;\n"
+ "ADD R0.w, R0, -R0.z;\n"
+ "ADD R1.x, R0.y, c[8];\n"
+ "ABS R0.w, R0;\n"
+ "CMP R0.y, -R0.w, R0, R1.x;\n"
+ "ABS R0.w, -R0.y;\n"
+ "MAX R1.x, R0.z, R0.w;\n"
+ "RCP R1.y, R1.x;\n"
+ "MIN R1.x, R0.z, R0.w;\n"
+ "MUL R1.x, R1, R1.y;\n"
+ "MUL R1.y, R1.x, R1.x;\n"
+ "MAD R1.z, R1.y, c[8].y, c[8];\n"
+ "MAD R1.z, R1, R1.y, -c[8].w;\n"
+ "MAD R1.z, R1, R1.y, c[9].x;\n"
+ "MAD R1.z, R1, R1.y, -c[9].y;\n"
+ "MAD R1.y, R1.z, R1, c[9].z;\n"
+ "MUL R1.x, R1.y, R1;\n"
+ "ADD R1.y, -R1.x, c[9].w;\n"
+ "ADD R0.z, -R0, R0.w;\n"
+ "CMP R0.z, -R0, R1.y, R1.x;\n"
+ "ADD R0.w, -R0.z, c[10].x;\n"
+ "CMP R0.x, R0, R0.w, R0.z;\n"
+ "CMP R0.x, -R0.y, -R0, R0;\n"
+ "ADD R0.x, R0, c[0];\n"
+ "MUL R0.x, R0, c[10].y;\n"
"FLR R0.y, R0.x;\n"
"ADD R0.x, R0, -R0.y;\n"
"TEX R0, R0, texture[2], 1D;\n"
- "MAX R1.x, R0.w, c[9].y;\n"
+ "MAX R1.x, R0.w, c[10].w;\n"
"RCP R1.x, R1.x;\n"
- "MAD R1.xyz, -R0, R1.x, c[7].w;\n"
- "MAX R2.xyz, R1, c[9].y;\n"
- "MUL R1.xy, fragment.position, c[10];\n"
+ "MAD R1.xyz, -R0, R1.x, c[10].z;\n"
+ "MAX R2.xyz, R1, c[10].w;\n"
+ "MUL R1.xy, fragment.position, c[5];\n"
"TEX R1, R1, texture[0], 2D;\n"
- "ADD R2.w, -R0, c[7];\n"
+ "ADD R2.w, -R0, c[10].z;\n"
"MUL R3.xyz, R1, R2.w;\n"
- "ADD R2.w, -R1, c[7];\n"
+ "ADD R2.w, -R1, c[10].z;\n"
"MAD R4.xyz, R0, R2.w, R3;\n"
- "MUL R3.xyz, R1, R0.w;\n"
+ "MUL R3.xyz, R0.w, R1;\n"
"MUL R2.w, R0, R1;\n"
"MAD R0.xyz, R0, R1.w, R3;\n"
"SGE R0.xyz, R0, R2.w;\n"
@@ -2778,70 +2684,70 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MO
"MAD R2.xyz, R0, R4, R2;\n"
"ADD R0.z, R0.w, R1.w;\n"
"MAD R2.w, -R0, R1, R0.z;\n"
- "ADD R0.xy, fragment.position, c[0];\n"
- "MUL R0.xy, R0, c[1];\n"
+ "ADD R0.xy, fragment.position, c[6];\n"
+ "MUL R0.xy, R0, c[4];\n"
"TEX R0, R0, texture[1], 2D;\n"
"ADD R2, R2, -R1;\n"
- "DP4 R0.x, R0, c[2];\n"
+ "DP4 R0.x, R0, c[7];\n"
"MAD result.color, R0.x, R2, R1;\n"
"END\n"
;
static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MODES_COLORBURN =
"!!ARBfp1.0\n"
- "PARAM c[11] = { program.local[0..5],\n"
- " { 0.0020000001, 9.9999997e-10, 0.1963, 0.9817 },\n"
- " { 2.3561945, 0.78539819, -1, 1 },\n"
- " program.local[8],\n"
- " { 0.15915494, 9.9999997e-06 },\n"
- " program.local[10] };\n"
+ "PARAM c[11] = { program.local[0..7],\n"
+ " { 0.0020000001, -0.01348047, 0.057477314, 0.12123907 },\n"
+ " { 0.19563593, 0.33299461, 0.99999565, 1.5707964 },\n"
+ " { 3.1415927, 0.15915494, 1, 9.9999997e-006 } };\n"
"TEMP R0;\n"
"TEMP R1;\n"
"TEMP R2;\n"
"TEMP R3;\n"
"TEMP R4;\n"
"TEMP R5;\n"
- "MUL R0.xyz, fragment.position.y, c[4];\n"
- "MAD R0.xyz, fragment.position.x, c[3], R0;\n"
- "ADD R0.xyz, R0, c[5];\n"
+ "MUL R0.xyz, fragment.position.y, c[2];\n"
+ "MAD R0.xyz, fragment.position.x, c[1], R0;\n"
+ "ADD R0.xyz, R0, c[3];\n"
"RCP R0.z, R0.z;\n"
"MUL R0.xy, R0, R0.z;\n"
- "ABS R0.w, R0.x;\n"
- "ABS R0.z, R0.y;\n"
- "ADD R0.z, R0, -R0.w;\n"
- "ADD R0.w, R0.y, c[6].x;\n"
- "ABS R0.z, R0;\n"
- "CMP R0.y, -R0.z, R0, R0.w;\n"
- "ABS R0.z, -R0.y;\n"
- "ADD R0.z, R0, c[6].y;\n"
- "ADD R0.w, R0.x, R0.z;\n"
- "ADD R1.x, R0.z, -R0;\n"
- "RCP R1.y, R0.w;\n"
- "RCP R1.x, R1.x;\n"
- "MUL R0.w, R0, R1.x;\n"
- "ADD R0.z, R0.x, -R0;\n"
- "MUL R0.z, R0, R1.y;\n"
- "CMP R0.z, R0.x, R0.w, R0;\n"
- "MUL R0.w, R0.z, R0.z;\n"
- "MOV R1.x, c[7].y;\n"
- "CMP R0.x, R0, c[7], R1;\n"
- "MAD R0.w, R0, c[6].z, -c[6];\n"
- "MUL R1.xy, fragment.position, c[10];\n"
- "TEX R1, R1, texture[0], 2D;\n"
- "ADD R2.w, -R1, c[7];\n"
- "CMP R0.y, -R0, c[7].z, c[7].w;\n"
- "MAD R0.x, R0.w, R0.z, R0;\n"
- "MAD R0.x, R0, R0.y, c[8];\n"
- "MUL R0.x, R0, c[9];\n"
+ "ABS R0.z, R0.x;\n"
+ "ABS R0.w, R0.y;\n"
+ "ADD R0.w, R0, -R0.z;\n"
+ "ADD R1.x, R0.y, c[8];\n"
+ "ABS R0.w, R0;\n"
+ "CMP R0.y, -R0.w, R0, R1.x;\n"
+ "ABS R0.w, -R0.y;\n"
+ "MAX R1.x, R0.z, R0.w;\n"
+ "RCP R1.y, R1.x;\n"
+ "MIN R1.x, R0.z, R0.w;\n"
+ "MUL R1.x, R1, R1.y;\n"
+ "MUL R1.y, R1.x, R1.x;\n"
+ "MAD R1.z, R1.y, c[8].y, c[8];\n"
+ "MAD R1.z, R1, R1.y, -c[8].w;\n"
+ "MAD R1.z, R1, R1.y, c[9].x;\n"
+ "MAD R1.z, R1, R1.y, -c[9].y;\n"
+ "MAD R1.y, R1.z, R1, c[9].z;\n"
+ "MUL R1.x, R1.y, R1;\n"
+ "ADD R0.z, -R0, R0.w;\n"
+ "ADD R1.y, -R1.x, c[9].w;\n"
+ "CMP R0.z, -R0, R1.y, R1.x;\n"
+ "ADD R0.w, -R0.z, c[10].x;\n"
+ "CMP R0.x, R0, R0.w, R0.z;\n"
+ "CMP R0.x, -R0.y, -R0, R0;\n"
+ "MUL R0.zw, fragment.position.xyxy, c[5].xyxy;\n"
+ "TEX R1, R0.zwzw, texture[0], 2D;\n"
+ "ADD R0.x, R0, c[0];\n"
+ "MUL R0.x, R0, c[10].y;\n"
"FLR R0.y, R0.x;\n"
"ADD R0.x, R0, -R0.y;\n"
"TEX R0, R0, texture[2], 1D;\n"
- "MUL R2.xyz, R1, R0.w;\n"
+ "MUL R2.xyz, R0.w, R1;\n"
"MAD R3.xyz, R0, R1.w, R2;\n"
"MAD R2.xyz, -R0.w, R1.w, R3;\n"
"MUL R4.xyz, R0.w, R2;\n"
- "MAX R2.xyz, R0, c[9].y;\n"
- "ADD R3.w, -R0, c[7];\n"
+ "MAX R2.xyz, R0, c[10].w;\n"
+ "ADD R2.w, -R1, c[10].z;\n"
+ "ADD R3.w, -R0, c[10].z;\n"
"MUL R5.xyz, R0, R2.w;\n"
"RCP R2.x, R2.x;\n"
"RCP R2.y, R2.y;\n"
@@ -2856,74 +2762,74 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MO
"MAD R2.xyz, R3, R2, R0;\n"
"ADD R0.z, R0.w, R1.w;\n"
"MAD R2.w, -R0, R1, R0.z;\n"
- "ADD R0.xy, fragment.position, c[0];\n"
- "MUL R0.xy, R0, c[1];\n"
+ "ADD R0.xy, fragment.position, c[6];\n"
+ "MUL R0.xy, R0, c[4];\n"
"TEX R0, R0, texture[1], 2D;\n"
"ADD R2, R2, -R1;\n"
- "DP4 R0.x, R0, c[2];\n"
+ "DP4 R0.x, R0, c[7];\n"
"MAD result.color, R0.x, R2, R1;\n"
"END\n"
;
static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MODES_HARDLIGHT =
"!!ARBfp1.0\n"
- "PARAM c[11] = { program.local[0..5],\n"
- " { 0.0020000001, 9.9999997e-10, 0.1963, 0.9817 },\n"
- " { 2.3561945, 0.78539819, -1, 1 },\n"
- " program.local[8],\n"
- " { 0.15915494, 2 },\n"
- " program.local[10] };\n"
+ "PARAM c[11] = { program.local[0..7],\n"
+ " { 0.0020000001, -0.01348047, 0.057477314, 0.12123907 },\n"
+ " { 0.19563593, 0.33299461, 0.99999565, 1.5707964 },\n"
+ " { 3.1415927, 0.15915494, 2, 1 } };\n"
"TEMP R0;\n"
"TEMP R1;\n"
"TEMP R2;\n"
"TEMP R3;\n"
"TEMP R4;\n"
- "MUL R0.xyz, fragment.position.y, c[4];\n"
- "MAD R0.xyz, fragment.position.x, c[3], R0;\n"
- "ADD R0.xyz, R0, c[5];\n"
+ "MUL R0.xyz, fragment.position.y, c[2];\n"
+ "MAD R0.xyz, fragment.position.x, c[1], R0;\n"
+ "ADD R0.xyz, R0, c[3];\n"
"RCP R0.z, R0.z;\n"
"MUL R0.xy, R0, R0.z;\n"
- "ABS R0.w, R0.x;\n"
- "ABS R0.z, R0.y;\n"
- "ADD R0.z, R0, -R0.w;\n"
- "ADD R0.w, R0.y, c[6].x;\n"
- "ABS R0.z, R0;\n"
- "CMP R0.y, -R0.z, R0, R0.w;\n"
- "ABS R0.z, -R0.y;\n"
- "ADD R0.z, R0, c[6].y;\n"
- "ADD R0.w, R0.x, R0.z;\n"
- "ADD R1.x, R0.z, -R0;\n"
- "RCP R1.y, R0.w;\n"
- "RCP R1.x, R1.x;\n"
- "MUL R0.w, R0, R1.x;\n"
- "ADD R0.z, R0.x, -R0;\n"
- "MUL R0.z, R0, R1.y;\n"
- "CMP R0.z, R0.x, R0.w, R0;\n"
- "MUL R0.w, R0.z, R0.z;\n"
- "MOV R1.x, c[7].y;\n"
- "CMP R0.x, R0, c[7], R1;\n"
- "MAD R0.w, R0, c[6].z, -c[6];\n"
- "MUL R1.xy, fragment.position, c[10];\n"
- "TEX R1, R1, texture[0], 2D;\n"
- "ADD R2.w, -R1, c[7];\n"
- "CMP R0.y, -R0, c[7].z, c[7].w;\n"
- "MAD R0.x, R0.w, R0.z, R0;\n"
- "MAD R0.x, R0, R0.y, c[8];\n"
- "MUL R0.x, R0, c[9];\n"
+ "ABS R0.z, R0.x;\n"
+ "ABS R0.w, R0.y;\n"
+ "ADD R0.w, R0, -R0.z;\n"
+ "ADD R1.x, R0.y, c[8];\n"
+ "ABS R0.w, R0;\n"
+ "CMP R0.y, -R0.w, R0, R1.x;\n"
+ "ABS R0.w, -R0.y;\n"
+ "MAX R1.x, R0.z, R0.w;\n"
+ "RCP R1.y, R1.x;\n"
+ "MIN R1.x, R0.z, R0.w;\n"
+ "MUL R1.x, R1, R1.y;\n"
+ "MUL R1.y, R1.x, R1.x;\n"
+ "MAD R1.z, R1.y, c[8].y, c[8];\n"
+ "MAD R1.z, R1, R1.y, -c[8].w;\n"
+ "MAD R1.z, R1, R1.y, c[9].x;\n"
+ "MAD R1.z, R1, R1.y, -c[9].y;\n"
+ "MAD R1.y, R1.z, R1, c[9].z;\n"
+ "MUL R1.x, R1.y, R1;\n"
+ "ADD R0.z, -R0, R0.w;\n"
+ "ADD R1.y, -R1.x, c[9].w;\n"
+ "CMP R0.z, -R0, R1.y, R1.x;\n"
+ "ADD R0.w, -R0.z, c[10].x;\n"
+ "CMP R0.x, R0, R0.w, R0.z;\n"
+ "CMP R0.x, -R0.y, -R0, R0;\n"
+ "ADD R0.x, R0, c[0];\n"
+ "MUL R0.x, R0, c[10].y;\n"
"FLR R0.y, R0.x;\n"
"ADD R0.x, R0, -R0.y;\n"
"TEX R0, R0, texture[2], 1D;\n"
+ "MUL R1.xy, fragment.position, c[5];\n"
+ "TEX R1, R1, texture[0], 2D;\n"
+ "ADD R2.w, -R1, c[10];\n"
"ADD R3.xyz, R0.w, -R0;\n"
"ADD R2.xyz, R1.w, -R1;\n"
"MUL R2.xyz, R2, R3;\n"
- "MUL R2.xyz, R2, c[9].y;\n"
+ "MUL R2.xyz, R2, c[10].z;\n"
"MAD R2.xyz, R0.w, R1.w, -R2;\n"
"MUL R4.xyz, R0, R2.w;\n"
"MAD R2.xyz, R0, R2.w, R2;\n"
"MUL R3.xyz, R0, R1;\n"
- "ADD R2.w, -R0, c[7];\n"
- "MAD R3.xyz, R3, c[9].y, R4;\n"
- "MUL R0.xyz, R0, c[9].y;\n"
+ "ADD R2.w, -R0, c[10];\n"
+ "MAD R3.xyz, R3, c[10].z, R4;\n"
+ "MUL R0.xyz, R0, c[10].z;\n"
"SGE R0.xyz, R0, R0.w;\n"
"MAD R3.xyz, R1, R2.w, R3;\n"
"MAD R2.xyz, R1, R2.w, R2;\n"
@@ -2931,24 +2837,22 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MO
"MAD R2.xyz, R0, R2, R3;\n"
"ADD R0.z, R0.w, R1.w;\n"
"MAD R2.w, -R0, R1, R0.z;\n"
- "ADD R0.xy, fragment.position, c[0];\n"
- "MUL R0.xy, R0, c[1];\n"
+ "ADD R0.xy, fragment.position, c[6];\n"
+ "MUL R0.xy, R0, c[4];\n"
"TEX R0, R0, texture[1], 2D;\n"
"ADD R2, R2, -R1;\n"
- "DP4 R0.x, R0, c[2];\n"
+ "DP4 R0.x, R0, c[7];\n"
"MAD result.color, R0.x, R2, R1;\n"
"END\n"
;
static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MODES_SOFTLIGHT =
"!!ARBfp1.0\n"
- "PARAM c[12] = { program.local[0..5],\n"
- " { 0.0020000001, 9.9999997e-10, 0.1963, 0.9817 },\n"
- " { 2.3561945, 0.78539819, -1, 1 },\n"
- " program.local[8],\n"
- " { 0.15915494, 9.9999997e-06, 2, 8 },\n"
- " program.local[10],\n"
- " { 3 } };\n"
+ "PARAM c[12] = { program.local[0..7],\n"
+ " { 0.15915494, 0.0020000001, 3.1415927, 1.5707964 },\n"
+ " { -0.01348047, 0.057477314, 0.12123907, 0.19563593 },\n"
+ " { 0.33299461, 0.99999565, 1, 9.9999997e-006 },\n"
+ " { 2, 3, 8 } };\n"
"TEMP R0;\n"
"TEMP R1;\n"
"TEMP R2;\n"
@@ -2956,326 +2860,325 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MO
"TEMP R4;\n"
"TEMP R5;\n"
"TEMP R6;\n"
- "MUL R0.xyz, fragment.position.y, c[4];\n"
- "MAD R0.xyz, fragment.position.x, c[3], R0;\n"
- "ADD R0.xyz, R0, c[5];\n"
+ "MUL R0.xyz, fragment.position.y, c[2];\n"
+ "MAD R0.xyz, fragment.position.x, c[1], R0;\n"
+ "ADD R0.xyz, R0, c[3];\n"
"RCP R0.z, R0.z;\n"
"MUL R0.xy, R0, R0.z;\n"
- "ABS R0.w, R0.x;\n"
- "ABS R0.z, R0.y;\n"
- "ADD R0.z, R0, -R0.w;\n"
- "ADD R0.w, R0.y, c[6].x;\n"
- "ABS R0.z, R0;\n"
- "CMP R0.y, -R0.z, R0, R0.w;\n"
- "ABS R0.z, -R0.y;\n"
- "ADD R0.z, R0, c[6].y;\n"
- "ADD R0.w, R0.x, R0.z;\n"
- "ADD R1.x, R0.z, -R0;\n"
- "RCP R1.y, R0.w;\n"
- "RCP R1.x, R1.x;\n"
- "MUL R0.w, R0, R1.x;\n"
- "ADD R0.z, R0.x, -R0;\n"
- "MUL R0.z, R0, R1.y;\n"
- "CMP R0.z, R0.x, R0.w, R0;\n"
- "MOV R1.x, c[7].y;\n"
- "MUL R0.w, R0.z, R0.z;\n"
- "CMP R0.x, R0, c[7], R1;\n"
- "MAD R0.w, R0, c[6].z, -c[6];\n"
- "MAD R0.x, R0.w, R0.z, R0;\n"
- "MUL R0.zw, fragment.position.xyxy, c[10].xyxy;\n"
- "TEX R1, R0.zwzw, texture[0], 2D;\n"
- "CMP R0.y, -R0, c[7].z, c[7].w;\n"
- "MAD R0.x, R0, R0.y, c[8];\n"
- "MUL R0.x, R0, c[9];\n"
- "FLR R0.y, R0.x;\n"
- "MAX R0.z, R1.w, c[9].y;\n"
- "RCP R2.w, R0.z;\n"
- "MUL R2.xyz, R1, R2.w;\n"
- "RSQ R3.w, R2.x;\n"
- "RSQ R4.y, R2.z;\n"
- "RCP R4.x, R3.w;\n"
- "ADD R0.x, R0, -R0.y;\n"
- "TEX R0, R0, texture[2], 1D;\n"
- "MAD R3.xyz, R0, c[9].z, -R0.w;\n"
- "RSQ R3.w, R2.y;\n"
- "RCP R4.z, R4.y;\n"
- "RCP R4.y, R3.w;\n"
- "MAD R4.xyz, R4, R1.w, -R1;\n"
- "MUL R6.xyz, R4, R3;\n"
- "MUL R4.xyz, -R2, c[9].w;\n"
- "MAD R2.xyz, -R1, R2.w, c[7].w;\n"
- "ADD R5.xyz, R4, c[11].x;\n"
- "MUL R4.xyz, R2, R3;\n"
- "MAD R4.xyz, -R4, R5, R0.w;\n"
- "MAD R2.xyz, -R2, R3, R0.w;\n"
- "MAD R5.xyz, R1, R0.w, R6;\n"
- "MUL R4.xyz, R1, R4;\n"
- "MUL R6.xyz, R1, c[9].w;\n"
- "ADD R5.xyz, R5, -R4;\n"
- "SGE R6.xyz, R6, R1.w;\n"
- "MUL R5.xyz, R6, R5;\n"
- "ADD R3.xyz, R4, R5;\n"
- "MUL R2.xyz, R1, R2;\n"
- "MUL R4.xyz, R0, c[9].z;\n"
- "ADD R3.xyz, R3, -R2;\n"
- "SGE R4.xyz, R4, R0.w;\n"
- "MUL R3.xyz, R4, R3;\n"
- "ADD R2.xyz, R2, R3;\n"
- "ADD R2.w, -R1, c[7];\n"
- "MAD R0.xyz, R0, R2.w, R2;\n"
- "ADD R2.x, -R0.w, c[7].w;\n"
- "MAD R2.xyz, R1, R2.x, R0;\n"
- "ADD R0.z, R0.w, R1.w;\n"
- "MAD R2.w, -R0, R1, R0.z;\n"
- "ADD R0.xy, fragment.position, c[0];\n"
- "MUL R0.xy, R0, c[1];\n"
- "TEX R0, R0, texture[1], 2D;\n"
- "ADD R2, R2, -R1;\n"
- "DP4 R0.x, R0, c[2];\n"
- "MAD result.color, R0.x, R2, R1;\n"
+ "ABS R0.z, R0.x;\n"
+ "ABS R0.w, R0.y;\n"
+ "ADD R0.w, R0, -R0.z;\n"
+ "ADD R1.x, R0.y, c[8].y;\n"
+ "ABS R0.w, R0;\n"
+ "CMP R0.y, -R0.w, R0, R1.x;\n"
+ "ABS R0.w, -R0.y;\n"
+ "MAX R1.x, R0.z, R0.w;\n"
+ "RCP R1.y, R1.x;\n"
+ "MIN R1.x, R0.z, R0.w;\n"
+ "MUL R1.x, R1, R1.y;\n"
+ "MUL R1.y, R1.x, R1.x;\n"
+ "MAD R1.z, R1.y, c[9].x, c[9].y;\n"
+ "MAD R1.z, R1, R1.y, -c[9];\n"
+ "MAD R1.z, R1, R1.y, c[9].w;\n"
+ "MAD R1.z, R1, R1.y, -c[10].x;\n"
+ "MAD R1.y, R1.z, R1, c[10];\n"
+ "MUL R1.x, R1.y, R1;\n"
+ "ADD R1.y, -R1.x, c[8].w;\n"
+ "ADD R0.z, -R0, R0.w;\n"
+ "CMP R0.z, -R0, R1.y, R1.x;\n"
+ "ADD R0.w, -R0.z, c[8].z;\n"
+ "CMP R0.x, R0, R0.w, R0.z;\n"
+ "CMP R0.x, -R0.y, -R0, R0;\n"
+ "ADD R0.x, R0, c[0];\n"
+ "MUL R1.x, R0, c[8];\n"
+ "FLR R1.y, R1.x;\n"
+ "MUL R0.xy, fragment.position, c[5];\n"
+ "TEX R0, R0, texture[0], 2D;\n"
+ "MAX R2.x, R0.w, c[10].w;\n"
+ "RCP R2.w, R2.x;\n"
+ "MUL R2.xyz, R0, R2.w;\n"
+ "MAD R6.xyz, -R2, c[11].z, c[11].y;\n"
+ "MAD R3.xyz, -R0, R2.w, c[10].z;\n"
+ "RSQ R2.w, R2.x;\n"
+ "RCP R2.x, R2.w;\n"
+ "ADD R1.x, R1, -R1.y;\n"
+ "TEX R1, R1, texture[2], 1D;\n"
+ "MAD R4.xyz, R1, c[11].x, -R1.w;\n"
+ "MUL R5.xyz, R3, R4;\n"
+ "MAD R5.xyz, -R5, R6, R1.w;\n"
+ "MAD R3.xyz, -R3, R4, R1.w;\n"
+ "RSQ R2.z, R2.z;\n"
+ "RSQ R2.y, R2.y;\n"
+ "MUL R5.xyz, R0, R5;\n"
+ "MUL R3.xyz, R0, R3;\n"
+ "ADD R2.w, -R0, c[10].z;\n"
+ "RCP R2.z, R2.z;\n"
+ "RCP R2.y, R2.y;\n"
+ "MAD R2.xyz, R0.w, R2, -R0;\n"
+ "MUL R2.xyz, R2, R4;\n"
+ "MAD R2.xyz, R1.w, R0, R2;\n"
+ "ADD R6.xyz, R2, -R5;\n"
+ "MUL R4.xyz, R1, c[11].x;\n"
+ "MUL R2.xyz, R0, c[11].z;\n"
+ "SGE R2.xyz, R2, R0.w;\n"
+ "MAD R2.xyz, R2, R6, R5;\n"
+ "SGE R4.xyz, R4, R1.w;\n"
+ "ADD R2.xyz, R2, -R3;\n"
+ "MAD R2.xyz, R4, R2, R3;\n"
+ "MAD R1.xyz, R1, R2.w, R2;\n"
+ "ADD R2.x, -R1.w, c[10].z;\n"
+ "MAD R2.xyz, R0, R2.x, R1;\n"
+ "ADD R1.z, R1.w, R0.w;\n"
+ "MAD R2.w, -R1, R0, R1.z;\n"
+ "ADD R1.xy, fragment.position, c[6];\n"
+ "MUL R1.xy, R1, c[4];\n"
+ "TEX R1, R1, texture[1], 2D;\n"
+ "ADD R2, R2, -R0;\n"
+ "DP4 R1.x, R1, c[7];\n"
+ "MAD result.color, R1.x, R2, R0;\n"
"END\n"
;
static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MODES_DIFFERENCE =
"!!ARBfp1.0\n"
- "PARAM c[11] = { program.local[0..5],\n"
- " { 0.0020000001, 9.9999997e-10, 0.1963, 0.9817 },\n"
- " { 2.3561945, 0.78539819, -1, 1 },\n"
- " program.local[8],\n"
- " { 0.15915494, 2 },\n"
- " program.local[10] };\n"
+ "PARAM c[11] = { program.local[0..7],\n"
+ " { 0.15915494, 0.0020000001, 3.1415927, 1.5707964 },\n"
+ " { -0.01348047, 0.057477314, 0.12123907, 0.19563593 },\n"
+ " { 0.33299461, 0.99999565, 2 } };\n"
"TEMP R0;\n"
"TEMP R1;\n"
"TEMP R2;\n"
"TEMP R3;\n"
- "MUL R0.xyz, fragment.position.y, c[4];\n"
- "MAD R0.xyz, fragment.position.x, c[3], R0;\n"
- "ADD R0.xyz, R0, c[5];\n"
+ "MUL R0.xyz, fragment.position.y, c[2];\n"
+ "MAD R0.xyz, fragment.position.x, c[1], R0;\n"
+ "ADD R0.xyz, R0, c[3];\n"
"RCP R0.z, R0.z;\n"
"MUL R0.xy, R0, R0.z;\n"
- "ABS R0.w, R0.x;\n"
- "ABS R0.z, R0.y;\n"
- "ADD R0.z, R0, -R0.w;\n"
- "ADD R0.w, R0.y, c[6].x;\n"
- "ABS R0.z, R0;\n"
- "CMP R0.y, -R0.z, R0, R0.w;\n"
- "ABS R0.z, -R0.y;\n"
- "ADD R0.z, R0, c[6].y;\n"
- "ADD R0.w, R0.x, R0.z;\n"
- "ADD R1.x, R0.z, -R0;\n"
- "RCP R1.y, R0.w;\n"
- "RCP R1.x, R1.x;\n"
- "MUL R0.w, R0, R1.x;\n"
- "ADD R0.z, R0.x, -R0;\n"
- "MUL R0.z, R0, R1.y;\n"
- "CMP R0.z, R0.x, R0.w, R0;\n"
- "MUL R0.w, R0.z, R0.z;\n"
- "MOV R1.x, c[7].y;\n"
- "CMP R0.x, R0, c[7], R1;\n"
- "MAD R0.w, R0, c[6].z, -c[6];\n"
- "MAD R0.x, R0.w, R0.z, R0;\n"
- "CMP R0.y, -R0, c[7].z, c[7].w;\n"
- "MAD R0.x, R0, R0.y, c[8];\n"
- "MUL R0.x, R0, c[9];\n"
- "FLR R0.y, R0.x;\n"
- "MUL R0.zw, fragment.position.xyxy, c[10].xyxy;\n"
- "TEX R1, R0.zwzw, texture[0], 2D;\n"
- "ADD R0.x, R0, -R0.y;\n"
- "TEX R0, R0, texture[2], 1D;\n"
- "ADD R3.xyz, R0, R1;\n"
- "MUL R2.xyz, R1, R0.w;\n"
- "MUL R0.xyz, R0, R1.w;\n"
- "MIN R0.xyz, R0, R2;\n"
- "MAD R2.xyz, -R0, c[9].y, R3;\n"
- "ADD R0.z, R0.w, R1.w;\n"
- "MAD R2.w, -R0, R1, R0.z;\n"
- "ADD R0.xy, fragment.position, c[0];\n"
- "MUL R0.xy, R0, c[1];\n"
- "TEX R0, R0, texture[1], 2D;\n"
- "ADD R2, R2, -R1;\n"
- "DP4 R0.x, R0, c[2];\n"
- "MAD result.color, R0.x, R2, R1;\n"
+ "ABS R0.z, R0.x;\n"
+ "ABS R0.w, R0.y;\n"
+ "ADD R0.w, R0, -R0.z;\n"
+ "ADD R1.x, R0.y, c[8].y;\n"
+ "ABS R0.w, R0;\n"
+ "CMP R0.y, -R0.w, R0, R1.x;\n"
+ "ABS R0.w, -R0.y;\n"
+ "MAX R1.x, R0.z, R0.w;\n"
+ "RCP R1.y, R1.x;\n"
+ "MIN R1.x, R0.z, R0.w;\n"
+ "MUL R1.x, R1, R1.y;\n"
+ "MUL R1.y, R1.x, R1.x;\n"
+ "MAD R1.z, R1.y, c[9].x, c[9].y;\n"
+ "MAD R1.z, R1, R1.y, -c[9];\n"
+ "MAD R1.z, R1, R1.y, c[9].w;\n"
+ "MAD R1.z, R1, R1.y, -c[10].x;\n"
+ "MAD R1.y, R1.z, R1, c[10];\n"
+ "MUL R1.x, R1.y, R1;\n"
+ "ADD R1.y, -R1.x, c[8].w;\n"
+ "ADD R0.z, -R0, R0.w;\n"
+ "CMP R0.z, -R0, R1.y, R1.x;\n"
+ "ADD R0.w, -R0.z, c[8].z;\n"
+ "CMP R0.x, R0, R0.w, R0.z;\n"
+ "CMP R0.x, -R0.y, -R0, R0;\n"
+ "ADD R0.x, R0, c[0];\n"
+ "MUL R0.z, R0.x, c[8].x;\n"
+ "FLR R0.w, R0.z;\n"
+ "ADD R1.x, R0.z, -R0.w;\n"
+ "MUL R0.xy, fragment.position, c[5];\n"
+ "TEX R0, R0, texture[0], 2D;\n"
+ "TEX R1, R1, texture[2], 1D;\n"
+ "ADD R2.xyz, R1, R0;\n"
+ "MUL R3.xyz, R1.w, R0;\n"
+ "MUL R1.xyz, R1, R0.w;\n"
+ "MIN R1.xyz, R1, R3;\n"
+ "MAD R2.xyz, -R1, c[10].z, R2;\n"
+ "ADD R1.z, R1.w, R0.w;\n"
+ "MAD R2.w, -R1, R0, R1.z;\n"
+ "ADD R1.xy, fragment.position, c[6];\n"
+ "MUL R1.xy, R1, c[4];\n"
+ "TEX R1, R1, texture[1], 2D;\n"
+ "ADD R2, R2, -R0;\n"
+ "DP4 R1.x, R1, c[7];\n"
+ "MAD result.color, R1.x, R2, R0;\n"
"END\n"
;
static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MODES_EXCLUSION =
"!!ARBfp1.0\n"
- "PARAM c[11] = { program.local[0..5],\n"
- " { 0.0020000001, 9.9999997e-10, 0.1963, 0.9817 },\n"
- " { 2.3561945, 0.78539819, -1, 1 },\n"
- " program.local[8],\n"
- " { 0.15915494, 2 },\n"
- " program.local[10] };\n"
+ "PARAM c[11] = { program.local[0..7],\n"
+ " { 0.15915494, 0.0020000001, 3.1415927, 1.5707964 },\n"
+ " { -0.01348047, 0.057477314, 0.12123907, 0.19563593 },\n"
+ " { 0.33299461, 0.99999565, 2, 1 } };\n"
"TEMP R0;\n"
"TEMP R1;\n"
"TEMP R2;\n"
"TEMP R3;\n"
- "MUL R0.xyz, fragment.position.y, c[4];\n"
- "MAD R0.xyz, fragment.position.x, c[3], R0;\n"
- "ADD R0.xyz, R0, c[5];\n"
+ "MUL R0.xyz, fragment.position.y, c[2];\n"
+ "MAD R0.xyz, fragment.position.x, c[1], R0;\n"
+ "ADD R0.xyz, R0, c[3];\n"
"RCP R0.z, R0.z;\n"
"MUL R0.xy, R0, R0.z;\n"
- "ABS R0.w, R0.x;\n"
- "ABS R0.z, R0.y;\n"
- "ADD R0.z, R0, -R0.w;\n"
- "ADD R0.w, R0.y, c[6].x;\n"
- "ABS R0.z, R0;\n"
- "CMP R0.y, -R0.z, R0, R0.w;\n"
- "ABS R0.z, -R0.y;\n"
- "ADD R0.z, R0, c[6].y;\n"
- "ADD R0.w, R0.x, R0.z;\n"
- "ADD R1.x, R0.z, -R0;\n"
- "RCP R1.y, R0.w;\n"
- "RCP R1.x, R1.x;\n"
- "MUL R0.w, R0, R1.x;\n"
- "ADD R0.z, R0.x, -R0;\n"
- "MUL R0.z, R0, R1.y;\n"
- "CMP R0.z, R0.x, R0.w, R0;\n"
- "MUL R0.w, R0.z, R0.z;\n"
- "MOV R1.x, c[7].y;\n"
- "CMP R0.x, R0, c[7], R1;\n"
- "MAD R0.w, R0, c[6].z, -c[6];\n"
- "MUL R1.xy, fragment.position, c[10];\n"
- "TEX R1, R1, texture[0], 2D;\n"
- "CMP R0.y, -R0, c[7].z, c[7].w;\n"
- "MAD R0.x, R0.w, R0.z, R0;\n"
- "MAD R0.x, R0, R0.y, c[8];\n"
- "MUL R0.x, R0, c[9];\n"
- "FLR R0.y, R0.x;\n"
- "ADD R0.x, R0, -R0.y;\n"
- "TEX R0, R0, texture[2], 1D;\n"
- "MUL R2.xyz, R1, R0.w;\n"
- "MAD R3.xyz, R0, R1.w, R2;\n"
- "MUL R2.xyz, R0, R1;\n"
- "MAD R2.xyz, -R2, c[9].y, R3;\n"
- "ADD R2.w, -R1, c[7];\n"
- "MAD R0.xyz, R0, R2.w, R2;\n"
- "ADD R2.x, -R0.w, c[7].w;\n"
- "MAD R2.xyz, R1, R2.x, R0;\n"
- "ADD R0.z, R0.w, R1.w;\n"
- "MAD R2.w, -R0, R1, R0.z;\n"
- "ADD R0.xy, fragment.position, c[0];\n"
- "MUL R0.xy, R0, c[1];\n"
- "TEX R0, R0, texture[1], 2D;\n"
- "ADD R2, R2, -R1;\n"
- "DP4 R0.x, R0, c[2];\n"
- "MAD result.color, R0.x, R2, R1;\n"
+ "ABS R0.z, R0.x;\n"
+ "ABS R0.w, R0.y;\n"
+ "ADD R0.w, R0, -R0.z;\n"
+ "ADD R1.x, R0.y, c[8].y;\n"
+ "ABS R0.w, R0;\n"
+ "CMP R0.y, -R0.w, R0, R1.x;\n"
+ "ABS R0.w, -R0.y;\n"
+ "MAX R1.x, R0.z, R0.w;\n"
+ "RCP R1.y, R1.x;\n"
+ "MIN R1.x, R0.z, R0.w;\n"
+ "MUL R1.x, R1, R1.y;\n"
+ "MUL R1.y, R1.x, R1.x;\n"
+ "MAD R1.z, R1.y, c[9].x, c[9].y;\n"
+ "MAD R1.z, R1, R1.y, -c[9];\n"
+ "MAD R1.z, R1, R1.y, c[9].w;\n"
+ "MAD R1.z, R1, R1.y, -c[10].x;\n"
+ "MAD R1.y, R1.z, R1, c[10];\n"
+ "MUL R1.x, R1.y, R1;\n"
+ "ADD R1.y, -R1.x, c[8].w;\n"
+ "ADD R0.z, -R0, R0.w;\n"
+ "CMP R0.z, -R0, R1.y, R1.x;\n"
+ "ADD R0.w, -R0.z, c[8].z;\n"
+ "CMP R0.x, R0, R0.w, R0.z;\n"
+ "CMP R0.x, -R0.y, -R0, R0;\n"
+ "ADD R0.x, R0, c[0];\n"
+ "MUL R0.z, R0.x, c[8].x;\n"
+ "FLR R0.w, R0.z;\n"
+ "ADD R1.x, R0.z, -R0.w;\n"
+ "MUL R0.xy, fragment.position, c[5];\n"
+ "TEX R0, R0, texture[0], 2D;\n"
+ "TEX R1, R1, texture[2], 1D;\n"
+ "MUL R2.xyz, R1.w, R0;\n"
+ "MAD R3.xyz, R1, R0.w, R2;\n"
+ "MUL R2.xyz, R1, R0;\n"
+ "MAD R2.xyz, -R2, c[10].z, R3;\n"
+ "ADD R2.w, -R0, c[10];\n"
+ "MAD R1.xyz, R1, R2.w, R2;\n"
+ "ADD R2.x, -R1.w, c[10].w;\n"
+ "MAD R2.xyz, R0, R2.x, R1;\n"
+ "ADD R1.z, R1.w, R0.w;\n"
+ "MAD R2.w, -R1, R0, R1.z;\n"
+ "ADD R1.xy, fragment.position, c[6];\n"
+ "MUL R1.xy, R1, c[4];\n"
+ "TEX R1, R1, texture[1], 2D;\n"
+ "ADD R2, R2, -R0;\n"
+ "DP4 R1.x, R1, c[7];\n"
+ "MAD result.color, R1.x, R2, R0;\n"
"END\n"
;
static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MODES_SIMPLE_PORTER_DUFF_NOMASK =
"!!ARBfp1.0\n"
- "PARAM c[10] = { program.local[0..2],\n"
- " { 0.0020000001, 9.9999997e-10, 0.1963, 0.9817 },\n"
- " { 2.3561945, 0.78539819, -1, 1 },\n"
- " program.local[5],\n"
- " { 0.15915494 },\n"
- " program.local[7..9] };\n"
+ "PARAM c[10] = { program.local[0..6],\n"
+ " { 0.15915494, 0.0020000001, 3.1415927, 1.5707964 },\n"
+ " { -0.01348047, 0.057477314, 0.12123907, 0.19563593 },\n"
+ " { 0.33299461, 0.99999565, 1 } };\n"
"TEMP R0;\n"
"TEMP R1;\n"
"TEMP R2;\n"
"TEMP R3;\n"
- "MUL R0.xyz, fragment.position.y, c[1];\n"
- "MAD R0.xyz, fragment.position.x, c[0], R0;\n"
- "ADD R0.xyz, R0, c[2];\n"
+ "MUL R0.xyz, fragment.position.y, c[2];\n"
+ "MAD R0.xyz, fragment.position.x, c[1], R0;\n"
+ "ADD R0.xyz, R0, c[3];\n"
"RCP R0.z, R0.z;\n"
"MUL R0.xy, R0, R0.z;\n"
- "ABS R0.w, R0.x;\n"
- "ABS R0.z, R0.y;\n"
- "ADD R0.z, R0, -R0.w;\n"
- "ADD R0.w, R0.y, c[3].x;\n"
- "ABS R0.z, R0;\n"
- "CMP R0.y, -R0.z, R0, R0.w;\n"
- "ABS R0.z, -R0.y;\n"
- "ADD R0.z, R0, c[3].y;\n"
- "ADD R0.w, R0.x, R0.z;\n"
- "ADD R1.x, R0.z, -R0;\n"
- "RCP R1.y, R0.w;\n"
- "RCP R1.x, R1.x;\n"
- "MUL R0.w, R0, R1.x;\n"
- "ADD R0.z, R0.x, -R0;\n"
- "MUL R0.z, R0, R1.y;\n"
- "CMP R0.z, R0.x, R0.w, R0;\n"
- "MUL R0.w, R0.z, R0.z;\n"
- "MOV R1.x, c[4].y;\n"
- "CMP R0.x, R0, c[4], R1;\n"
- "MAD R0.w, R0, c[3].z, -c[3];\n"
- "MAD R0.x, R0.w, R0.z, R0;\n"
- "CMP R0.y, -R0, c[4].z, c[4].w;\n"
- "MAD R0.x, R0, R0.y, c[5];\n"
- "MUL R0.x, R0, c[6];\n"
- "FLR R0.y, R0.x;\n"
- "MUL R0.zw, fragment.position.xyxy, c[7].xyxy;\n"
+ "ABS R0.z, R0.x;\n"
+ "ABS R0.w, R0.y;\n"
+ "ADD R0.w, R0, -R0.z;\n"
+ "ADD R1.x, R0.y, c[7].y;\n"
+ "ABS R0.w, R0;\n"
+ "CMP R0.y, -R0.w, R0, R1.x;\n"
+ "ABS R0.w, -R0.y;\n"
+ "MAX R1.x, R0.z, R0.w;\n"
+ "RCP R1.y, R1.x;\n"
+ "MIN R1.x, R0.z, R0.w;\n"
+ "MUL R1.x, R1, R1.y;\n"
+ "MUL R1.y, R1.x, R1.x;\n"
+ "MAD R1.z, R1.y, c[8].x, c[8].y;\n"
+ "MAD R1.z, R1, R1.y, -c[8];\n"
+ "MAD R1.z, R1, R1.y, c[8].w;\n"
+ "MAD R1.z, R1, R1.y, -c[9].x;\n"
+ "MAD R1.y, R1.z, R1, c[9];\n"
+ "MUL R1.x, R1.y, R1;\n"
+ "ADD R0.z, -R0, R0.w;\n"
+ "ADD R1.y, -R1.x, c[7].w;\n"
+ "CMP R0.z, -R0, R1.y, R1.x;\n"
+ "ADD R0.w, -R0.z, c[7].z;\n"
+ "CMP R0.x, R0, R0.w, R0.z;\n"
+ "CMP R0.x, -R0.y, -R0, R0;\n"
+ "MUL R0.zw, fragment.position.xyxy, c[6].xyxy;\n"
"TEX R1, R0.zwzw, texture[0], 2D;\n"
- "MUL R2.xyz, R1, c[9].y;\n"
+ "MUL R2.xyz, R1, c[4].y;\n"
+ "ADD R0.x, R0, c[0];\n"
+ "MUL R0.x, R0, c[7];\n"
+ "FLR R0.y, R0.x;\n"
"ADD R0.x, R0, -R0.y;\n"
"TEX R0, R0, texture[1], 1D;\n"
- "MUL R3.xyz, R2, R0.w;\n"
- "MUL R2.xyz, R0, c[9].x;\n"
- "MAD R2.xyz, R2, R1.w, R3;\n"
- "ADD R2.w, -R1, c[4];\n"
- "MUL R0.xyz, R0, c[8].y;\n"
- "MAD R0.xyz, R0, R2.w, R2;\n"
- "ADD R2.x, -R0.w, c[4].w;\n"
- "MUL R1.xyz, R1, c[8].z;\n"
- "MAD result.color.xyz, R1, R2.x, R0;\n"
+ "MUL R3.xyz, R0.w, R2;\n"
+ "MUL R2.xyz, R0, c[4].x;\n"
+ "MAD R2.xyz, R1.w, R2, R3;\n"
+ "ADD R2.w, -R1, c[9].z;\n"
+ "MUL R0.xyz, R0, c[5].y;\n"
+ "MAD R0.xyz, R2.w, R0, R2;\n"
+ "ADD R2.x, -R0.w, c[9].z;\n"
+ "MUL R1.xyz, R1, c[5].z;\n"
+ "MAD result.color.xyz, R2.x, R1, R0;\n"
"MUL R0.x, R0.w, R1.w;\n"
"MUL R0.z, R1.w, R2.x;\n"
"MUL R0.y, R0.w, R2.w;\n"
- "DP3 result.color.w, R0, c[8];\n"
+ "DP3 result.color.w, R0, c[5];\n"
"END\n"
;
static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MODES_MULTIPLY_NOMASK =
"!!ARBfp1.0\n"
- "PARAM c[8] = { program.local[0..2],\n"
- " { 0.0020000001, 9.9999997e-10, 0.1963, 0.9817 },\n"
- " { 2.3561945, 0.78539819, -1, 1 },\n"
- " program.local[5],\n"
- " { 0.15915494 },\n"
- " program.local[7] };\n"
+ "PARAM c[8] = { program.local[0..4],\n"
+ " { 0.15915494, 0.0020000001, 3.1415927, 1.5707964 },\n"
+ " { -0.01348047, 0.057477314, 0.12123907, 0.19563593 },\n"
+ " { 0.33299461, 0.99999565, 1 } };\n"
"TEMP R0;\n"
"TEMP R1;\n"
"TEMP R2;\n"
- "MUL R0.xyz, fragment.position.y, c[1];\n"
- "MAD R0.xyz, fragment.position.x, c[0], R0;\n"
- "ADD R0.xyz, R0, c[2];\n"
+ "MUL R0.xyz, fragment.position.y, c[2];\n"
+ "MAD R0.xyz, fragment.position.x, c[1], R0;\n"
+ "ADD R0.xyz, R0, c[3];\n"
"RCP R0.z, R0.z;\n"
"MUL R0.xy, R0, R0.z;\n"
- "ABS R0.w, R0.x;\n"
- "ABS R0.z, R0.y;\n"
- "ADD R0.z, R0, -R0.w;\n"
- "ADD R0.w, R0.y, c[3].x;\n"
- "ABS R0.z, R0;\n"
- "CMP R0.y, -R0.z, R0, R0.w;\n"
- "ABS R0.z, -R0.y;\n"
- "ADD R0.z, R0, c[3].y;\n"
- "ADD R0.w, R0.x, R0.z;\n"
- "ADD R1.x, R0.z, -R0;\n"
- "RCP R1.y, R0.w;\n"
- "RCP R1.x, R1.x;\n"
- "MUL R0.w, R0, R1.x;\n"
- "ADD R0.z, R0.x, -R0;\n"
- "MUL R0.z, R0, R1.y;\n"
- "CMP R0.z, R0.x, R0.w, R0;\n"
- "MUL R0.w, R0.z, R0.z;\n"
- "MOV R1.x, c[4].y;\n"
- "CMP R0.x, R0, c[4], R1;\n"
- "MAD R0.w, R0, c[3].z, -c[3];\n"
- "MAD R0.x, R0.w, R0.z, R0;\n"
- "CMP R0.y, -R0, c[4].z, c[4].w;\n"
- "MAD R0.x, R0, R0.y, c[5];\n"
- "MUL R0.x, R0, c[6];\n"
- "FLR R0.y, R0.x;\n"
- "MUL R0.zw, fragment.position.xyxy, c[7].xyxy;\n"
+ "ABS R0.z, R0.x;\n"
+ "ABS R0.w, R0.y;\n"
+ "ADD R0.w, R0, -R0.z;\n"
+ "ADD R1.x, R0.y, c[5].y;\n"
+ "ABS R0.w, R0;\n"
+ "CMP R0.y, -R0.w, R0, R1.x;\n"
+ "ABS R0.w, -R0.y;\n"
+ "MAX R1.x, R0.z, R0.w;\n"
+ "RCP R1.y, R1.x;\n"
+ "MIN R1.x, R0.z, R0.w;\n"
+ "MUL R1.x, R1, R1.y;\n"
+ "MUL R1.y, R1.x, R1.x;\n"
+ "MAD R1.z, R1.y, c[6].x, c[6].y;\n"
+ "MAD R1.z, R1, R1.y, -c[6];\n"
+ "MAD R1.z, R1, R1.y, c[6].w;\n"
+ "MAD R1.z, R1, R1.y, -c[7].x;\n"
+ "MAD R1.y, R1.z, R1, c[7];\n"
+ "MUL R1.x, R1.y, R1;\n"
+ "ADD R0.z, -R0, R0.w;\n"
+ "ADD R1.y, -R1.x, c[5].w;\n"
+ "CMP R0.z, -R0, R1.y, R1.x;\n"
+ "ADD R0.w, -R0.z, c[5].z;\n"
+ "CMP R0.x, R0, R0.w, R0.z;\n"
+ "CMP R0.x, -R0.y, -R0, R0;\n"
+ "MUL R0.zw, fragment.position.xyxy, c[4].xyxy;\n"
"TEX R1, R0.zwzw, texture[0], 2D;\n"
+ "ADD R0.x, R0, c[0];\n"
+ "MUL R0.x, R0, c[5];\n"
+ "FLR R0.y, R0.x;\n"
"ADD R0.x, R0, -R0.y;\n"
"TEX R0, R0, texture[1], 1D;\n"
- "ADD R2.x, -R1.w, c[4].w;\n"
+ "ADD R2.x, -R1.w, c[7].z;\n"
"MUL R2.xyz, R0, R2.x;\n"
"MAD R0.xyz, R0, R1, R2;\n"
"ADD R2.x, R0.w, R1.w;\n"
- "ADD R2.y, -R0.w, c[4].w;\n"
+ "ADD R2.y, -R0.w, c[7].z;\n"
"MAD result.color.xyz, R1, R2.y, R0;\n"
"MAD result.color.w, -R0, R1, R2.x;\n"
"END\n"
@@ -3283,46 +3186,46 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MO
static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MODES_SCREEN_NOMASK =
"!!ARBfp1.0\n"
- "PARAM c[8] = { program.local[0..2],\n"
- " { 0.0020000001, 9.9999997e-10, 0.1963, 0.9817 },\n"
- " { 2.3561945, 0.78539819, -1, 1 },\n"
- " program.local[5],\n"
- " { 0.15915494 },\n"
- " program.local[7] };\n"
+ "PARAM c[8] = { program.local[0..4],\n"
+ " { 0.15915494, 0.0020000001, 3.1415927, 1.5707964 },\n"
+ " { -0.01348047, 0.057477314, 0.12123907, 0.19563593 },\n"
+ " { 0.33299461, 0.99999565 } };\n"
"TEMP R0;\n"
"TEMP R1;\n"
"TEMP R2;\n"
- "MUL R0.xyz, fragment.position.y, c[1];\n"
- "MAD R0.xyz, fragment.position.x, c[0], R0;\n"
- "ADD R0.xyz, R0, c[2];\n"
+ "MUL R0.xyz, fragment.position.y, c[2];\n"
+ "MAD R0.xyz, fragment.position.x, c[1], R0;\n"
+ "ADD R0.xyz, R0, c[3];\n"
"RCP R0.z, R0.z;\n"
"MUL R0.xy, R0, R0.z;\n"
- "ABS R0.w, R0.x;\n"
- "ABS R0.z, R0.y;\n"
- "ADD R0.z, R0, -R0.w;\n"
- "ADD R0.w, R0.y, c[3].x;\n"
- "ABS R0.z, R0;\n"
- "CMP R0.y, -R0.z, R0, R0.w;\n"
- "ABS R0.z, -R0.y;\n"
- "ADD R0.z, R0, c[3].y;\n"
- "ADD R0.w, R0.x, R0.z;\n"
- "ADD R1.x, R0.z, -R0;\n"
- "RCP R1.y, R0.w;\n"
- "RCP R1.x, R1.x;\n"
- "MUL R0.w, R0, R1.x;\n"
- "ADD R0.z, R0.x, -R0;\n"
- "MUL R0.z, R0, R1.y;\n"
- "CMP R0.z, R0.x, R0.w, R0;\n"
- "MUL R0.w, R0.z, R0.z;\n"
- "MOV R1.x, c[4].y;\n"
- "CMP R0.x, R0, c[4], R1;\n"
- "MAD R0.w, R0, c[3].z, -c[3];\n"
- "MAD R0.x, R0.w, R0.z, R0;\n"
- "CMP R0.y, -R0, c[4].z, c[4].w;\n"
- "MAD R0.x, R0, R0.y, c[5];\n"
- "MUL R0.x, R0, c[6];\n"
+ "ABS R0.z, R0.x;\n"
+ "ABS R0.w, R0.y;\n"
+ "ADD R0.w, R0, -R0.z;\n"
+ "ADD R1.x, R0.y, c[5].y;\n"
+ "ABS R0.w, R0;\n"
+ "CMP R0.y, -R0.w, R0, R1.x;\n"
+ "ABS R0.w, -R0.y;\n"
+ "MAX R1.x, R0.z, R0.w;\n"
+ "RCP R1.y, R1.x;\n"
+ "MIN R1.x, R0.z, R0.w;\n"
+ "MUL R1.x, R1, R1.y;\n"
+ "MUL R1.y, R1.x, R1.x;\n"
+ "MAD R1.z, R1.y, c[6].x, c[6].y;\n"
+ "MAD R1.z, R1, R1.y, -c[6];\n"
+ "MAD R1.z, R1, R1.y, c[6].w;\n"
+ "MAD R1.z, R1, R1.y, -c[7].x;\n"
+ "MAD R1.y, R1.z, R1, c[7];\n"
+ "MUL R1.x, R1.y, R1;\n"
+ "ADD R0.z, -R0, R0.w;\n"
+ "ADD R1.y, -R1.x, c[5].w;\n"
+ "CMP R0.z, -R0, R1.y, R1.x;\n"
+ "ADD R0.w, -R0.z, c[5].z;\n"
+ "CMP R0.x, R0, R0.w, R0.z;\n"
+ "CMP R0.x, -R0.y, -R0, R0;\n"
+ "MUL R0.zw, fragment.position.xyxy, c[4].xyxy;\n"
+ "ADD R0.x, R0, c[0];\n"
+ "MUL R0.x, R0, c[5];\n"
"FLR R0.y, R0.x;\n"
- "MUL R0.zw, fragment.position.xyxy, c[7].xyxy;\n"
"TEX R1, R0.zwzw, texture[0], 2D;\n"
"ADD R0.x, R0, -R0.y;\n"
"TEX R0, R0, texture[1], 1D;\n"
@@ -3333,64 +3236,64 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MO
static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MODES_OVERLAY_NOMASK =
"!!ARBfp1.0\n"
- "PARAM c[8] = { program.local[0..2],\n"
- " { 0.0020000001, 9.9999997e-10, 0.1963, 0.9817 },\n"
- " { 2.3561945, 0.78539819, -1, 1 },\n"
- " program.local[5],\n"
- " { 0.15915494, 2 },\n"
- " program.local[7] };\n"
+ "PARAM c[8] = { program.local[0..4],\n"
+ " { 0.0020000001, -0.01348047, 0.057477314, 0.12123907 },\n"
+ " { 0.19563593, 0.33299461, 0.99999565, 1.5707964 },\n"
+ " { 3.1415927, 0.15915494, 2, 1 } };\n"
"TEMP R0;\n"
"TEMP R1;\n"
"TEMP R2;\n"
"TEMP R3;\n"
- "MUL R0.xyz, fragment.position.y, c[1];\n"
- "MAD R0.xyz, fragment.position.x, c[0], R0;\n"
- "ADD R0.xyz, R0, c[2];\n"
+ "MUL R0.xyz, fragment.position.y, c[2];\n"
+ "MAD R0.xyz, fragment.position.x, c[1], R0;\n"
+ "ADD R0.xyz, R0, c[3];\n"
"RCP R0.z, R0.z;\n"
"MUL R0.xy, R0, R0.z;\n"
- "ABS R0.w, R0.x;\n"
- "ABS R0.z, R0.y;\n"
- "ADD R0.z, R0, -R0.w;\n"
- "ADD R0.w, R0.y, c[3].x;\n"
- "ABS R0.z, R0;\n"
- "CMP R0.y, -R0.z, R0, R0.w;\n"
- "ABS R0.z, -R0.y;\n"
- "ADD R0.z, R0, c[3].y;\n"
- "ADD R0.w, R0.x, R0.z;\n"
- "ADD R1.x, R0.z, -R0;\n"
- "RCP R1.y, R0.w;\n"
- "RCP R1.x, R1.x;\n"
- "MUL R0.w, R0, R1.x;\n"
- "ADD R0.z, R0.x, -R0;\n"
- "MUL R0.z, R0, R1.y;\n"
- "CMP R0.z, R0.x, R0.w, R0;\n"
- "MUL R0.w, R0.z, R0.z;\n"
- "MOV R1.x, c[4].y;\n"
- "CMP R0.x, R0, c[4], R1;\n"
- "MAD R0.w, R0, c[3].z, -c[3];\n"
- "MUL R1.xy, fragment.position, c[7];\n"
- "TEX R1, R1, texture[0], 2D;\n"
- "ADD R2.w, -R1, c[4];\n"
- "CMP R0.y, -R0, c[4].z, c[4].w;\n"
- "MAD R0.x, R0.w, R0.z, R0;\n"
- "MAD R0.x, R0, R0.y, c[5];\n"
- "MUL R0.x, R0, c[6];\n"
+ "ABS R0.z, R0.x;\n"
+ "ABS R0.w, R0.y;\n"
+ "ADD R0.w, R0, -R0.z;\n"
+ "ADD R1.x, R0.y, c[5];\n"
+ "ABS R0.w, R0;\n"
+ "CMP R0.y, -R0.w, R0, R1.x;\n"
+ "ABS R0.w, -R0.y;\n"
+ "MAX R1.x, R0.z, R0.w;\n"
+ "RCP R1.y, R1.x;\n"
+ "MIN R1.x, R0.z, R0.w;\n"
+ "MUL R1.x, R1, R1.y;\n"
+ "MUL R1.y, R1.x, R1.x;\n"
+ "MAD R1.z, R1.y, c[5].y, c[5];\n"
+ "MAD R1.z, R1, R1.y, -c[5].w;\n"
+ "MAD R1.z, R1, R1.y, c[6].x;\n"
+ "MAD R1.z, R1, R1.y, -c[6].y;\n"
+ "MAD R1.y, R1.z, R1, c[6].z;\n"
+ "MUL R1.x, R1.y, R1;\n"
+ "ADD R0.z, -R0, R0.w;\n"
+ "ADD R1.y, -R1.x, c[6].w;\n"
+ "CMP R0.z, -R0, R1.y, R1.x;\n"
+ "ADD R0.w, -R0.z, c[7].x;\n"
+ "CMP R0.x, R0, R0.w, R0.z;\n"
+ "CMP R0.x, -R0.y, -R0, R0;\n"
+ "ADD R0.x, R0, c[0];\n"
+ "MUL R0.x, R0, c[7].y;\n"
"FLR R0.y, R0.x;\n"
"ADD R0.x, R0, -R0.y;\n"
"TEX R0, R0, texture[1], 1D;\n"
+ "MUL R1.xy, fragment.position, c[4];\n"
+ "TEX R1, R1, texture[0], 2D;\n"
"ADD R3.xyz, R0.w, -R0;\n"
"ADD R2.xyz, R1.w, -R1;\n"
"MUL R2.xyz, R2, R3;\n"
- "MUL R2.xyz, R2, c[6].y;\n"
+ "ADD R2.w, -R1, c[7];\n"
+ "MUL R2.xyz, R2, c[7].z;\n"
"MAD R2.xyz, R0.w, R1.w, -R2;\n"
"MAD R2.xyz, R0, R2.w, R2;\n"
"MUL R3.xyz, R0, R2.w;\n"
"MUL R0.xyz, R0, R1;\n"
- "ADD R2.w, -R0, c[4];\n"
- "MAD R0.xyz, R0, c[6].y, R3;\n"
+ "ADD R2.w, -R0, c[7];\n"
+ "MAD R0.xyz, R0, c[7].z, R3;\n"
"MAD R0.xyz, R1, R2.w, R0;\n"
"MAD R2.xyz, R1, R2.w, R2;\n"
- "MUL R1.xyz, R1, c[6].y;\n"
+ "MUL R1.xyz, R1, c[7].z;\n"
"ADD R2.w, R0, R1;\n"
"ADD R2.xyz, R2, -R0;\n"
"SGE R1.xyz, R1, R1.w;\n"
@@ -3401,57 +3304,57 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MO
static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MODES_DARKEN_NOMASK =
"!!ARBfp1.0\n"
- "PARAM c[8] = { program.local[0..2],\n"
- " { 0.0020000001, 9.9999997e-10, 0.1963, 0.9817 },\n"
- " { 2.3561945, 0.78539819, -1, 1 },\n"
- " program.local[5],\n"
- " { 0.15915494 },\n"
- " program.local[7] };\n"
+ "PARAM c[8] = { program.local[0..4],\n"
+ " { 0.15915494, 0.0020000001, 3.1415927, 1.5707964 },\n"
+ " { -0.01348047, 0.057477314, 0.12123907, 0.19563593 },\n"
+ " { 0.33299461, 0.99999565, 1 } };\n"
"TEMP R0;\n"
"TEMP R1;\n"
"TEMP R2;\n"
"TEMP R3;\n"
- "MUL R0.xyz, fragment.position.y, c[1];\n"
- "MAD R0.xyz, fragment.position.x, c[0], R0;\n"
- "ADD R0.xyz, R0, c[2];\n"
+ "MUL R0.xyz, fragment.position.y, c[2];\n"
+ "MAD R0.xyz, fragment.position.x, c[1], R0;\n"
+ "ADD R0.xyz, R0, c[3];\n"
"RCP R0.z, R0.z;\n"
"MUL R0.xy, R0, R0.z;\n"
- "ABS R0.w, R0.x;\n"
- "ABS R0.z, R0.y;\n"
- "ADD R0.z, R0, -R0.w;\n"
- "ADD R0.w, R0.y, c[3].x;\n"
- "ABS R0.z, R0;\n"
- "CMP R0.y, -R0.z, R0, R0.w;\n"
- "ABS R0.z, -R0.y;\n"
- "ADD R0.z, R0, c[3].y;\n"
- "ADD R0.w, R0.x, R0.z;\n"
- "ADD R1.x, R0.z, -R0;\n"
- "RCP R1.y, R0.w;\n"
- "RCP R1.x, R1.x;\n"
- "MUL R0.w, R0, R1.x;\n"
- "ADD R0.z, R0.x, -R0;\n"
- "MUL R0.z, R0, R1.y;\n"
- "CMP R0.z, R0.x, R0.w, R0;\n"
- "MUL R0.w, R0.z, R0.z;\n"
- "MOV R1.x, c[4].y;\n"
- "CMP R0.x, R0, c[4], R1;\n"
- "MAD R0.w, R0, c[3].z, -c[3];\n"
- "MUL R1.xy, fragment.position, c[7];\n"
- "TEX R1, R1, texture[0], 2D;\n"
- "CMP R0.y, -R0, c[4].z, c[4].w;\n"
- "MAD R0.x, R0.w, R0.z, R0;\n"
- "MAD R0.x, R0, R0.y, c[5];\n"
- "MUL R0.x, R0, c[6];\n"
+ "ABS R0.z, R0.x;\n"
+ "ABS R0.w, R0.y;\n"
+ "ADD R0.w, R0, -R0.z;\n"
+ "ADD R1.x, R0.y, c[5].y;\n"
+ "ABS R0.w, R0;\n"
+ "CMP R0.y, -R0.w, R0, R1.x;\n"
+ "ABS R0.w, -R0.y;\n"
+ "MAX R1.x, R0.z, R0.w;\n"
+ "RCP R1.y, R1.x;\n"
+ "MIN R1.x, R0.z, R0.w;\n"
+ "MUL R1.x, R1, R1.y;\n"
+ "MUL R1.y, R1.x, R1.x;\n"
+ "MAD R1.z, R1.y, c[6].x, c[6].y;\n"
+ "MAD R1.z, R1, R1.y, -c[6];\n"
+ "MAD R1.z, R1, R1.y, c[6].w;\n"
+ "MAD R1.z, R1, R1.y, -c[7].x;\n"
+ "MAD R1.y, R1.z, R1, c[7];\n"
+ "MUL R1.x, R1.y, R1;\n"
+ "ADD R0.z, -R0, R0.w;\n"
+ "ADD R1.y, -R1.x, c[5].w;\n"
+ "CMP R0.z, -R0, R1.y, R1.x;\n"
+ "ADD R0.w, -R0.z, c[5].z;\n"
+ "CMP R0.x, R0, R0.w, R0.z;\n"
+ "CMP R0.x, -R0.y, -R0, R0;\n"
+ "MUL R0.zw, fragment.position.xyxy, c[4].xyxy;\n"
+ "TEX R1, R0.zwzw, texture[0], 2D;\n"
+ "ADD R0.x, R0, c[0];\n"
+ "MUL R0.x, R0, c[5];\n"
"FLR R0.y, R0.x;\n"
"ADD R0.x, R0, -R0.y;\n"
"TEX R0, R0, texture[1], 1D;\n"
"MUL R2.xyz, R0, R1.w;\n"
- "MUL R3.xyz, R1, R0.w;\n"
+ "MUL R3.xyz, R0.w, R1;\n"
"MIN R2.xyz, R2, R3;\n"
- "ADD R2.w, -R1, c[4];\n"
+ "ADD R2.w, -R1, c[7].z;\n"
"MAD R0.xyz, R0, R2.w, R2;\n"
"ADD R2.x, R0.w, R1.w;\n"
- "ADD R2.y, -R0.w, c[4].w;\n"
+ "ADD R2.y, -R0.w, c[7].z;\n"
"MAD result.color.xyz, R1, R2.y, R0;\n"
"MAD result.color.w, -R0, R1, R2.x;\n"
"END\n"
@@ -3459,57 +3362,57 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MO
static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MODES_LIGHTEN_NOMASK =
"!!ARBfp1.0\n"
- "PARAM c[8] = { program.local[0..2],\n"
- " { 0.0020000001, 9.9999997e-10, 0.1963, 0.9817 },\n"
- " { 2.3561945, 0.78539819, -1, 1 },\n"
- " program.local[5],\n"
- " { 0.15915494 },\n"
- " program.local[7] };\n"
+ "PARAM c[8] = { program.local[0..4],\n"
+ " { 0.15915494, 0.0020000001, 3.1415927, 1.5707964 },\n"
+ " { -0.01348047, 0.057477314, 0.12123907, 0.19563593 },\n"
+ " { 0.33299461, 0.99999565, 1 } };\n"
"TEMP R0;\n"
"TEMP R1;\n"
"TEMP R2;\n"
"TEMP R3;\n"
- "MUL R0.xyz, fragment.position.y, c[1];\n"
- "MAD R0.xyz, fragment.position.x, c[0], R0;\n"
- "ADD R0.xyz, R0, c[2];\n"
+ "MUL R0.xyz, fragment.position.y, c[2];\n"
+ "MAD R0.xyz, fragment.position.x, c[1], R0;\n"
+ "ADD R0.xyz, R0, c[3];\n"
"RCP R0.z, R0.z;\n"
"MUL R0.xy, R0, R0.z;\n"
- "ABS R0.w, R0.x;\n"
- "ABS R0.z, R0.y;\n"
- "ADD R0.z, R0, -R0.w;\n"
- "ADD R0.w, R0.y, c[3].x;\n"
- "ABS R0.z, R0;\n"
- "CMP R0.y, -R0.z, R0, R0.w;\n"
- "ABS R0.z, -R0.y;\n"
- "ADD R0.z, R0, c[3].y;\n"
- "ADD R0.w, R0.x, R0.z;\n"
- "ADD R1.x, R0.z, -R0;\n"
- "RCP R1.y, R0.w;\n"
- "RCP R1.x, R1.x;\n"
- "MUL R0.w, R0, R1.x;\n"
- "ADD R0.z, R0.x, -R0;\n"
- "MUL R0.z, R0, R1.y;\n"
- "CMP R0.z, R0.x, R0.w, R0;\n"
- "MUL R0.w, R0.z, R0.z;\n"
- "MOV R1.x, c[4].y;\n"
- "CMP R0.x, R0, c[4], R1;\n"
- "MAD R0.w, R0, c[3].z, -c[3];\n"
- "MUL R1.xy, fragment.position, c[7];\n"
- "TEX R1, R1, texture[0], 2D;\n"
- "CMP R0.y, -R0, c[4].z, c[4].w;\n"
- "MAD R0.x, R0.w, R0.z, R0;\n"
- "MAD R0.x, R0, R0.y, c[5];\n"
- "MUL R0.x, R0, c[6];\n"
+ "ABS R0.z, R0.x;\n"
+ "ABS R0.w, R0.y;\n"
+ "ADD R0.w, R0, -R0.z;\n"
+ "ADD R1.x, R0.y, c[5].y;\n"
+ "ABS R0.w, R0;\n"
+ "CMP R0.y, -R0.w, R0, R1.x;\n"
+ "ABS R0.w, -R0.y;\n"
+ "MAX R1.x, R0.z, R0.w;\n"
+ "RCP R1.y, R1.x;\n"
+ "MIN R1.x, R0.z, R0.w;\n"
+ "MUL R1.x, R1, R1.y;\n"
+ "MUL R1.y, R1.x, R1.x;\n"
+ "MAD R1.z, R1.y, c[6].x, c[6].y;\n"
+ "MAD R1.z, R1, R1.y, -c[6];\n"
+ "MAD R1.z, R1, R1.y, c[6].w;\n"
+ "MAD R1.z, R1, R1.y, -c[7].x;\n"
+ "MAD R1.y, R1.z, R1, c[7];\n"
+ "MUL R1.x, R1.y, R1;\n"
+ "ADD R0.z, -R0, R0.w;\n"
+ "ADD R1.y, -R1.x, c[5].w;\n"
+ "CMP R0.z, -R0, R1.y, R1.x;\n"
+ "ADD R0.w, -R0.z, c[5].z;\n"
+ "CMP R0.x, R0, R0.w, R0.z;\n"
+ "CMP R0.x, -R0.y, -R0, R0;\n"
+ "MUL R0.zw, fragment.position.xyxy, c[4].xyxy;\n"
+ "TEX R1, R0.zwzw, texture[0], 2D;\n"
+ "ADD R0.x, R0, c[0];\n"
+ "MUL R0.x, R0, c[5];\n"
"FLR R0.y, R0.x;\n"
"ADD R0.x, R0, -R0.y;\n"
"TEX R0, R0, texture[1], 1D;\n"
"MUL R2.xyz, R0, R1.w;\n"
- "MUL R3.xyz, R1, R0.w;\n"
+ "MUL R3.xyz, R0.w, R1;\n"
"MAX R2.xyz, R2, R3;\n"
- "ADD R2.w, -R1, c[4];\n"
+ "ADD R2.w, -R1, c[7].z;\n"
"MAD R0.xyz, R0, R2.w, R2;\n"
"ADD R2.x, R0.w, R1.w;\n"
- "ADD R2.y, -R0.w, c[4].w;\n"
+ "ADD R2.y, -R0.w, c[7].z;\n"
"MAD result.color.xyz, R1, R2.y, R0;\n"
"MAD result.color.w, -R0, R1, R2.x;\n"
"END\n"
@@ -3517,59 +3420,59 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MO
static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MODES_COLORDODGE_NOMASK =
"!!ARBfp1.0\n"
- "PARAM c[8] = { program.local[0..2],\n"
- " { 0.0020000001, 9.9999997e-10, 0.1963, 0.9817 },\n"
- " { 2.3561945, 0.78539819, -1, 1 },\n"
- " program.local[5],\n"
- " { 0.15915494, 1e-06 },\n"
- " program.local[7] };\n"
+ "PARAM c[8] = { program.local[0..4],\n"
+ " { 0.0020000001, -0.01348047, 0.057477314, 0.12123907 },\n"
+ " { 0.19563593, 0.33299461, 0.99999565, 1.5707964 },\n"
+ " { 3.1415927, 0.15915494, 1, 1e-006 } };\n"
"TEMP R0;\n"
"TEMP R1;\n"
"TEMP R2;\n"
"TEMP R3;\n"
- "MUL R0.xyz, fragment.position.y, c[1];\n"
- "MAD R0.xyz, fragment.position.x, c[0], R0;\n"
- "ADD R0.xyz, R0, c[2];\n"
+ "MUL R0.xyz, fragment.position.y, c[2];\n"
+ "MAD R0.xyz, fragment.position.x, c[1], R0;\n"
+ "ADD R0.xyz, R0, c[3];\n"
"RCP R0.z, R0.z;\n"
"MUL R0.xy, R0, R0.z;\n"
- "ABS R0.w, R0.x;\n"
- "ABS R0.z, R0.y;\n"
- "ADD R0.z, R0, -R0.w;\n"
- "ADD R0.w, R0.y, c[3].x;\n"
- "ABS R0.z, R0;\n"
- "CMP R0.y, -R0.z, R0, R0.w;\n"
- "ABS R0.z, -R0.y;\n"
- "ADD R0.z, R0, c[3].y;\n"
- "ADD R0.w, R0.x, R0.z;\n"
- "ADD R1.x, R0.z, -R0;\n"
- "RCP R1.y, R0.w;\n"
- "RCP R1.x, R1.x;\n"
- "MUL R0.w, R0, R1.x;\n"
- "ADD R0.z, R0.x, -R0;\n"
- "MUL R0.z, R0, R1.y;\n"
- "CMP R0.z, R0.x, R0.w, R0;\n"
- "MUL R0.w, R0.z, R0.z;\n"
- "MOV R1.x, c[4].y;\n"
- "CMP R0.x, R0, c[4], R1;\n"
- "MAD R0.w, R0, c[3].z, -c[3];\n"
- "CMP R0.y, -R0, c[4].z, c[4].w;\n"
- "MAD R0.x, R0.w, R0.z, R0;\n"
- "MAD R0.x, R0, R0.y, c[5];\n"
- "MUL R0.x, R0, c[6];\n"
+ "ABS R0.z, R0.x;\n"
+ "ABS R0.w, R0.y;\n"
+ "ADD R0.w, R0, -R0.z;\n"
+ "ADD R1.x, R0.y, c[5];\n"
+ "ABS R0.w, R0;\n"
+ "CMP R0.y, -R0.w, R0, R1.x;\n"
+ "ABS R0.w, -R0.y;\n"
+ "MAX R1.x, R0.z, R0.w;\n"
+ "RCP R1.y, R1.x;\n"
+ "MIN R1.x, R0.z, R0.w;\n"
+ "MUL R1.x, R1, R1.y;\n"
+ "MUL R1.y, R1.x, R1.x;\n"
+ "MAD R1.z, R1.y, c[5].y, c[5];\n"
+ "MAD R1.z, R1, R1.y, -c[5].w;\n"
+ "MAD R1.z, R1, R1.y, c[6].x;\n"
+ "MAD R1.z, R1, R1.y, -c[6].y;\n"
+ "MAD R1.y, R1.z, R1, c[6].z;\n"
+ "MUL R1.x, R1.y, R1;\n"
+ "ADD R1.y, -R1.x, c[6].w;\n"
+ "ADD R0.z, -R0, R0.w;\n"
+ "CMP R0.z, -R0, R1.y, R1.x;\n"
+ "ADD R0.w, -R0.z, c[7].x;\n"
+ "CMP R0.x, R0, R0.w, R0.z;\n"
+ "CMP R0.x, -R0.y, -R0, R0;\n"
+ "ADD R0.x, R0, c[0];\n"
+ "MUL R0.x, R0, c[7].y;\n"
"FLR R0.y, R0.x;\n"
"ADD R0.x, R0, -R0.y;\n"
"TEX R0, R0, texture[1], 1D;\n"
- "MAX R1.x, R0.w, c[6].y;\n"
+ "MAX R1.x, R0.w, c[7].w;\n"
"RCP R1.x, R1.x;\n"
- "MAD R1.xyz, -R0, R1.x, c[4].w;\n"
- "MAX R2.xyz, R1, c[6].y;\n"
- "MUL R1.xy, fragment.position, c[7];\n"
+ "MAD R1.xyz, -R0, R1.x, c[7].z;\n"
+ "MAX R2.xyz, R1, c[7].w;\n"
+ "MUL R1.xy, fragment.position, c[4];\n"
"TEX R1, R1, texture[0], 2D;\n"
- "ADD R2.w, -R0, c[4];\n"
+ "ADD R2.w, -R0, c[7].z;\n"
"MUL R3.xyz, R1, R2.w;\n"
- "ADD R2.w, -R1, c[4];\n"
+ "ADD R2.w, -R1, c[7].z;\n"
"MAD R3.xyz, R0, R2.w, R3;\n"
- "MUL R1.xyz, R1, R0.w;\n"
+ "MUL R1.xyz, R0.w, R1;\n"
"MAD R0.xyz, R0, R1.w, R1;\n"
"MUL R2.w, R0, R1;\n"
"RCP R2.x, R2.x;\n"
@@ -3587,60 +3490,60 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MO
static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MODES_COLORBURN_NOMASK =
"!!ARBfp1.0\n"
- "PARAM c[8] = { program.local[0..2],\n"
- " { 0.0020000001, 9.9999997e-10, 0.1963, 0.9817 },\n"
- " { 2.3561945, 0.78539819, -1, 1 },\n"
- " program.local[5],\n"
- " { 0.15915494, 9.9999997e-06 },\n"
- " program.local[7] };\n"
+ "PARAM c[8] = { program.local[0..4],\n"
+ " { 0.0020000001, -0.01348047, 0.057477314, 0.12123907 },\n"
+ " { 0.19563593, 0.33299461, 0.99999565, 1.5707964 },\n"
+ " { 3.1415927, 0.15915494, 1, 9.9999997e-006 } };\n"
"TEMP R0;\n"
"TEMP R1;\n"
"TEMP R2;\n"
"TEMP R3;\n"
"TEMP R4;\n"
"TEMP R5;\n"
- "MUL R0.xyz, fragment.position.y, c[1];\n"
- "MAD R0.xyz, fragment.position.x, c[0], R0;\n"
- "ADD R0.xyz, R0, c[2];\n"
+ "MUL R0.xyz, fragment.position.y, c[2];\n"
+ "MAD R0.xyz, fragment.position.x, c[1], R0;\n"
+ "ADD R0.xyz, R0, c[3];\n"
"RCP R0.z, R0.z;\n"
"MUL R0.xy, R0, R0.z;\n"
- "ABS R0.w, R0.x;\n"
- "ABS R0.z, R0.y;\n"
- "ADD R0.z, R0, -R0.w;\n"
- "ADD R0.w, R0.y, c[3].x;\n"
- "ABS R0.z, R0;\n"
- "CMP R0.y, -R0.z, R0, R0.w;\n"
- "ABS R0.z, -R0.y;\n"
- "ADD R0.z, R0, c[3].y;\n"
- "ADD R0.w, R0.x, R0.z;\n"
- "ADD R1.x, R0.z, -R0;\n"
- "RCP R1.y, R0.w;\n"
- "RCP R1.x, R1.x;\n"
- "MUL R0.w, R0, R1.x;\n"
- "ADD R0.z, R0.x, -R0;\n"
- "MUL R0.z, R0, R1.y;\n"
- "CMP R0.z, R0.x, R0.w, R0;\n"
- "MUL R0.w, R0.z, R0.z;\n"
- "MOV R1.x, c[4].y;\n"
- "CMP R0.x, R0, c[4], R1;\n"
- "MAD R0.w, R0, c[3].z, -c[3];\n"
- "MUL R1.xy, fragment.position, c[7];\n"
- "TEX R1, R1, texture[0], 2D;\n"
- "ADD R2.w, -R1, c[4];\n"
- "CMP R0.y, -R0, c[4].z, c[4].w;\n"
- "MAD R0.x, R0.w, R0.z, R0;\n"
- "MAD R0.x, R0, R0.y, c[5];\n"
- "MUL R0.x, R0, c[6];\n"
+ "ABS R0.z, R0.x;\n"
+ "ABS R0.w, R0.y;\n"
+ "ADD R0.w, R0, -R0.z;\n"
+ "ADD R1.x, R0.y, c[5];\n"
+ "ABS R0.w, R0;\n"
+ "CMP R0.y, -R0.w, R0, R1.x;\n"
+ "ABS R0.w, -R0.y;\n"
+ "MAX R1.x, R0.z, R0.w;\n"
+ "RCP R1.y, R1.x;\n"
+ "MIN R1.x, R0.z, R0.w;\n"
+ "MUL R1.x, R1, R1.y;\n"
+ "MUL R1.y, R1.x, R1.x;\n"
+ "MAD R1.z, R1.y, c[5].y, c[5];\n"
+ "MAD R1.z, R1, R1.y, -c[5].w;\n"
+ "MAD R1.z, R1, R1.y, c[6].x;\n"
+ "MAD R1.z, R1, R1.y, -c[6].y;\n"
+ "MAD R1.y, R1.z, R1, c[6].z;\n"
+ "MUL R1.x, R1.y, R1;\n"
+ "ADD R0.z, -R0, R0.w;\n"
+ "ADD R1.y, -R1.x, c[6].w;\n"
+ "CMP R0.z, -R0, R1.y, R1.x;\n"
+ "ADD R0.w, -R0.z, c[7].x;\n"
+ "CMP R0.x, R0, R0.w, R0.z;\n"
+ "CMP R0.x, -R0.y, -R0, R0;\n"
+ "MUL R0.zw, fragment.position.xyxy, c[4].xyxy;\n"
+ "TEX R1, R0.zwzw, texture[0], 2D;\n"
+ "ADD R0.x, R0, c[0];\n"
+ "MUL R0.x, R0, c[7].y;\n"
"FLR R0.y, R0.x;\n"
"ADD R0.x, R0, -R0.y;\n"
"TEX R0, R0, texture[1], 1D;\n"
- "MUL R2.xyz, R1, R0.w;\n"
+ "MUL R2.xyz, R0.w, R1;\n"
"MAD R3.xyz, R0, R1.w, R2;\n"
+ "ADD R2.w, -R1, c[7].z;\n"
"MAD R2.xyz, -R0.w, R1.w, R3;\n"
"MUL R4.xyz, R0.w, R2;\n"
- "MAX R2.xyz, R0, c[6].y;\n"
+ "MAX R2.xyz, R0, c[7].w;\n"
"MUL R5.xyz, R0, R2.w;\n"
- "ADD R3.w, -R0, c[4];\n"
+ "ADD R3.w, -R0, c[7].z;\n"
"RCP R2.x, R2.x;\n"
"RCP R2.y, R2.y;\n"
"RCP R2.z, R2.z;\n"
@@ -3659,64 +3562,64 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MO
static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MODES_HARDLIGHT_NOMASK =
"!!ARBfp1.0\n"
- "PARAM c[8] = { program.local[0..2],\n"
- " { 0.0020000001, 9.9999997e-10, 0.1963, 0.9817 },\n"
- " { 2.3561945, 0.78539819, -1, 1 },\n"
- " program.local[5],\n"
- " { 0.15915494, 2 },\n"
- " program.local[7] };\n"
+ "PARAM c[8] = { program.local[0..4],\n"
+ " { 0.0020000001, -0.01348047, 0.057477314, 0.12123907 },\n"
+ " { 0.19563593, 0.33299461, 0.99999565, 1.5707964 },\n"
+ " { 3.1415927, 0.15915494, 2, 1 } };\n"
"TEMP R0;\n"
"TEMP R1;\n"
"TEMP R2;\n"
"TEMP R3;\n"
"TEMP R4;\n"
- "MUL R0.xyz, fragment.position.y, c[1];\n"
- "MAD R0.xyz, fragment.position.x, c[0], R0;\n"
- "ADD R0.xyz, R0, c[2];\n"
+ "MUL R0.xyz, fragment.position.y, c[2];\n"
+ "MAD R0.xyz, fragment.position.x, c[1], R0;\n"
+ "ADD R0.xyz, R0, c[3];\n"
"RCP R0.z, R0.z;\n"
"MUL R0.xy, R0, R0.z;\n"
- "ABS R0.w, R0.x;\n"
- "ABS R0.z, R0.y;\n"
- "ADD R0.z, R0, -R0.w;\n"
- "ADD R0.w, R0.y, c[3].x;\n"
- "ABS R0.z, R0;\n"
- "CMP R0.y, -R0.z, R0, R0.w;\n"
- "ABS R0.z, -R0.y;\n"
- "ADD R0.z, R0, c[3].y;\n"
- "ADD R0.w, R0.x, R0.z;\n"
- "ADD R1.x, R0.z, -R0;\n"
- "RCP R1.y, R0.w;\n"
- "RCP R1.x, R1.x;\n"
- "MUL R0.w, R0, R1.x;\n"
- "ADD R0.z, R0.x, -R0;\n"
- "MUL R0.z, R0, R1.y;\n"
- "CMP R0.z, R0.x, R0.w, R0;\n"
- "MUL R0.w, R0.z, R0.z;\n"
- "MOV R1.x, c[4].y;\n"
- "CMP R0.x, R0, c[4], R1;\n"
- "MAD R0.w, R0, c[3].z, -c[3];\n"
- "MUL R1.xy, fragment.position, c[7];\n"
- "TEX R1, R1, texture[0], 2D;\n"
- "ADD R2.w, -R1, c[4];\n"
- "CMP R0.y, -R0, c[4].z, c[4].w;\n"
- "MAD R0.x, R0.w, R0.z, R0;\n"
- "MAD R0.x, R0, R0.y, c[5];\n"
- "MUL R0.x, R0, c[6];\n"
+ "ABS R0.z, R0.x;\n"
+ "ABS R0.w, R0.y;\n"
+ "ADD R0.w, R0, -R0.z;\n"
+ "ADD R1.x, R0.y, c[5];\n"
+ "ABS R0.w, R0;\n"
+ "CMP R0.y, -R0.w, R0, R1.x;\n"
+ "ABS R0.w, -R0.y;\n"
+ "MAX R1.x, R0.z, R0.w;\n"
+ "RCP R1.y, R1.x;\n"
+ "MIN R1.x, R0.z, R0.w;\n"
+ "MUL R1.x, R1, R1.y;\n"
+ "MUL R1.y, R1.x, R1.x;\n"
+ "MAD R1.z, R1.y, c[5].y, c[5];\n"
+ "MAD R1.z, R1, R1.y, -c[5].w;\n"
+ "MAD R1.z, R1, R1.y, c[6].x;\n"
+ "MAD R1.z, R1, R1.y, -c[6].y;\n"
+ "MAD R1.y, R1.z, R1, c[6].z;\n"
+ "MUL R1.x, R1.y, R1;\n"
+ "ADD R0.z, -R0, R0.w;\n"
+ "ADD R1.y, -R1.x, c[6].w;\n"
+ "CMP R0.z, -R0, R1.y, R1.x;\n"
+ "ADD R0.w, -R0.z, c[7].x;\n"
+ "CMP R0.x, R0, R0.w, R0.z;\n"
+ "CMP R0.x, -R0.y, -R0, R0;\n"
+ "ADD R0.x, R0, c[0];\n"
+ "MUL R0.x, R0, c[7].y;\n"
"FLR R0.y, R0.x;\n"
"ADD R0.x, R0, -R0.y;\n"
"TEX R0, R0, texture[1], 1D;\n"
+ "MUL R1.xy, fragment.position, c[4];\n"
+ "TEX R1, R1, texture[0], 2D;\n"
+ "ADD R2.w, -R1, c[7];\n"
"ADD R3.xyz, R0.w, -R0;\n"
"ADD R2.xyz, R1.w, -R1;\n"
"MUL R2.xyz, R2, R3;\n"
- "MUL R2.xyz, R2, c[6].y;\n"
+ "MUL R2.xyz, R2, c[7].z;\n"
"MAD R2.xyz, R0.w, R1.w, -R2;\n"
"MUL R4.xyz, R0, R2.w;\n"
"MUL R3.xyz, R0, R1;\n"
"MAD R2.xyz, R0, R2.w, R2;\n"
- "ADD R2.w, -R0, c[4];\n"
- "MUL R0.xyz, R0, c[6].y;\n"
+ "ADD R2.w, -R0, c[7];\n"
+ "MUL R0.xyz, R0, c[7].z;\n"
"MAD R2.xyz, R1, R2.w, R2;\n"
- "MAD R3.xyz, R3, c[6].y, R4;\n"
+ "MAD R3.xyz, R3, c[7].z, R4;\n"
"MAD R1.xyz, R1, R2.w, R3;\n"
"ADD R2.w, R0, R1;\n"
"ADD R2.xyz, R2, -R1;\n"
@@ -3728,13 +3631,11 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MO
static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MODES_SOFTLIGHT_NOMASK =
"!!ARBfp1.0\n"
- "PARAM c[9] = { program.local[0..2],\n"
- " { 0.0020000001, 9.9999997e-10, 0.1963, 0.9817 },\n"
- " { 2.3561945, 0.78539819, -1, 1 },\n"
- " program.local[5],\n"
- " { 0.15915494, 9.9999997e-06, 2, 8 },\n"
- " program.local[7],\n"
- " { 3 } };\n"
+ "PARAM c[9] = { program.local[0..4],\n"
+ " { 0.15915494, 0.0020000001, 3.1415927, 1.5707964 },\n"
+ " { -0.01348047, 0.057477314, 0.12123907, 0.19563593 },\n"
+ " { 0.33299461, 0.99999565, 1, 9.9999997e-006 },\n"
+ " { 2, 3, 8 } };\n"
"TEMP R0;\n"
"TEMP R1;\n"
"TEMP R2;\n"
@@ -3742,75 +3643,74 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MO
"TEMP R4;\n"
"TEMP R5;\n"
"TEMP R6;\n"
- "MUL R0.xyz, fragment.position.y, c[1];\n"
- "MAD R0.xyz, fragment.position.x, c[0], R0;\n"
- "ADD R0.xyz, R0, c[2];\n"
+ "MUL R0.xyz, fragment.position.y, c[2];\n"
+ "MAD R0.xyz, fragment.position.x, c[1], R0;\n"
+ "ADD R0.xyz, R0, c[3];\n"
"RCP R0.z, R0.z;\n"
"MUL R0.xy, R0, R0.z;\n"
- "ABS R0.w, R0.x;\n"
- "ABS R0.z, R0.y;\n"
- "ADD R0.z, R0, -R0.w;\n"
- "ADD R0.w, R0.y, c[3].x;\n"
- "ABS R0.z, R0;\n"
- "CMP R0.y, -R0.z, R0, R0.w;\n"
- "ABS R0.z, -R0.y;\n"
- "ADD R0.z, R0, c[3].y;\n"
- "ADD R0.w, R0.x, R0.z;\n"
- "ADD R1.x, R0.z, -R0;\n"
- "RCP R1.y, R0.w;\n"
- "RCP R1.x, R1.x;\n"
- "MUL R0.w, R0, R1.x;\n"
- "ADD R0.z, R0.x, -R0;\n"
- "MUL R0.z, R0, R1.y;\n"
- "CMP R0.z, R0.x, R0.w, R0;\n"
- "MOV R1.x, c[4].y;\n"
- "MUL R0.w, R0.z, R0.z;\n"
- "CMP R0.x, R0, c[4], R1;\n"
- "MAD R0.w, R0, c[3].z, -c[3];\n"
- "MAD R0.x, R0.w, R0.z, R0;\n"
- "MUL R0.zw, fragment.position.xyxy, c[7].xyxy;\n"
+ "ABS R0.z, R0.x;\n"
+ "ABS R0.w, R0.y;\n"
+ "ADD R0.w, R0, -R0.z;\n"
+ "ADD R1.x, R0.y, c[5].y;\n"
+ "ABS R0.w, R0;\n"
+ "CMP R0.y, -R0.w, R0, R1.x;\n"
+ "ABS R0.w, -R0.y;\n"
+ "MAX R1.x, R0.z, R0.w;\n"
+ "RCP R1.y, R1.x;\n"
+ "MIN R1.x, R0.z, R0.w;\n"
+ "MUL R1.x, R1, R1.y;\n"
+ "MUL R1.y, R1.x, R1.x;\n"
+ "MAD R1.z, R1.y, c[6].x, c[6].y;\n"
+ "MAD R1.z, R1, R1.y, -c[6];\n"
+ "MAD R1.z, R1, R1.y, c[6].w;\n"
+ "MAD R1.z, R1, R1.y, -c[7].x;\n"
+ "MAD R1.y, R1.z, R1, c[7];\n"
+ "MUL R1.x, R1.y, R1;\n"
+ "ADD R0.z, -R0, R0.w;\n"
+ "ADD R1.y, -R1.x, c[5].w;\n"
+ "CMP R0.z, -R0, R1.y, R1.x;\n"
+ "ADD R0.w, -R0.z, c[5].z;\n"
+ "CMP R0.x, R0, R0.w, R0.z;\n"
+ "CMP R0.x, -R0.y, -R0, R0;\n"
+ "MUL R0.zw, fragment.position.xyxy, c[4].xyxy;\n"
"TEX R1, R0.zwzw, texture[0], 2D;\n"
- "CMP R0.y, -R0, c[4].z, c[4].w;\n"
- "MAD R0.x, R0, R0.y, c[5];\n"
- "MUL R0.x, R0, c[6];\n"
- "FLR R0.y, R0.x;\n"
- "MAX R0.z, R1.w, c[6].y;\n"
- "RCP R2.w, R0.z;\n"
+ "MAX R2.x, R1.w, c[7].w;\n"
+ "RCP R2.w, R2.x;\n"
"MUL R2.xyz, R1, R2.w;\n"
- "RSQ R3.w, R2.x;\n"
- "RSQ R4.y, R2.z;\n"
- "RCP R4.x, R3.w;\n"
+ "MAD R6.xyz, -R2, c[8].z, c[8].y;\n"
+ "MAD R3.xyz, -R1, R2.w, c[7].z;\n"
+ "RSQ R2.w, R2.x;\n"
+ "RCP R2.x, R2.w;\n"
+ "ADD R0.x, R0, c[0];\n"
+ "MUL R0.x, R0, c[5];\n"
+ "FLR R0.y, R0.x;\n"
"ADD R0.x, R0, -R0.y;\n"
"TEX R0, R0, texture[1], 1D;\n"
- "MAD R3.xyz, R0, c[6].z, -R0.w;\n"
- "RSQ R3.w, R2.y;\n"
- "RCP R4.z, R4.y;\n"
- "RCP R4.y, R3.w;\n"
- "MAD R4.xyz, R4, R1.w, -R1;\n"
- "MUL R6.xyz, R4, R3;\n"
- "MUL R4.xyz, -R2, c[6].w;\n"
- "MAD R2.xyz, -R1, R2.w, c[4].w;\n"
- "ADD R5.xyz, R4, c[8].x;\n"
- "MUL R4.xyz, R2, R3;\n"
- "MAD R4.xyz, -R4, R5, R0.w;\n"
- "MAD R2.xyz, -R2, R3, R0.w;\n"
- "MAD R5.xyz, R1, R0.w, R6;\n"
- "MUL R4.xyz, R1, R4;\n"
- "MUL R6.xyz, R1, c[6].w;\n"
- "ADD R5.xyz, R5, -R4;\n"
- "SGE R6.xyz, R6, R1.w;\n"
- "MUL R5.xyz, R6, R5;\n"
- "ADD R3.xyz, R4, R5;\n"
- "MUL R2.xyz, R1, R2;\n"
- "MUL R4.xyz, R0, c[6].z;\n"
- "ADD R3.xyz, R3, -R2;\n"
+ "MAD R4.xyz, R0, c[8].x, -R0.w;\n"
+ "MUL R5.xyz, R3, R4;\n"
+ "MAD R5.xyz, -R5, R6, R0.w;\n"
+ "MAD R3.xyz, -R3, R4, R0.w;\n"
+ "RSQ R2.z, R2.z;\n"
+ "RSQ R2.y, R2.y;\n"
+ "MUL R5.xyz, R1, R5;\n"
+ "MUL R3.xyz, R1, R3;\n"
+ "RCP R2.z, R2.z;\n"
+ "RCP R2.y, R2.y;\n"
+ "MAD R2.xyz, R1.w, R2, -R1;\n"
+ "MUL R2.xyz, R2, R4;\n"
+ "MAD R2.xyz, R0.w, R1, R2;\n"
+ "ADD R6.xyz, R2, -R5;\n"
+ "MUL R4.xyz, R0, c[8].x;\n"
+ "MUL R2.xyz, R1, c[8].z;\n"
+ "SGE R2.xyz, R2, R1.w;\n"
+ "MAD R2.xyz, R2, R6, R5;\n"
+ "ADD R2.xyz, R2, -R3;\n"
"SGE R4.xyz, R4, R0.w;\n"
- "MUL R3.xyz, R4, R3;\n"
- "ADD R2.xyz, R2, R3;\n"
- "ADD R2.w, -R1, c[4];\n"
+ "MAD R2.xyz, R4, R2, R3;\n"
+ "ADD R2.w, -R1, c[7].z;\n"
"MAD R0.xyz, R0, R2.w, R2;\n"
"ADD R2.x, R0.w, R1.w;\n"
- "ADD R2.y, -R0.w, c[4].w;\n"
+ "ADD R2.y, -R0.w, c[7].z;\n"
"MAD result.color.xyz, R1, R2.y, R0;\n"
"MAD result.color.w, -R0, R1, R2.x;\n"
"END\n"
@@ -3818,114 +3718,114 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MO
static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MODES_DIFFERENCE_NOMASK =
"!!ARBfp1.0\n"
- "PARAM c[8] = { program.local[0..2],\n"
- " { 0.0020000001, 9.9999997e-10, 0.1963, 0.9817 },\n"
- " { 2.3561945, 0.78539819, -1, 1 },\n"
- " program.local[5],\n"
- " { 0.15915494, 2 },\n"
- " program.local[7] };\n"
+ "PARAM c[8] = { program.local[0..4],\n"
+ " { 0.15915494, 0.0020000001, 3.1415927, 1.5707964 },\n"
+ " { -0.01348047, 0.057477314, 0.12123907, 0.19563593 },\n"
+ " { 0.33299461, 0.99999565, 2 } };\n"
"TEMP R0;\n"
"TEMP R1;\n"
"TEMP R2;\n"
"TEMP R3;\n"
- "MUL R0.xyz, fragment.position.y, c[1];\n"
- "MAD R0.xyz, fragment.position.x, c[0], R0;\n"
- "ADD R0.xyz, R0, c[2];\n"
+ "MUL R0.xyz, fragment.position.y, c[2];\n"
+ "MAD R0.xyz, fragment.position.x, c[1], R0;\n"
+ "ADD R0.xyz, R0, c[3];\n"
"RCP R0.z, R0.z;\n"
"MUL R0.xy, R0, R0.z;\n"
- "ABS R0.w, R0.x;\n"
- "ABS R0.z, R0.y;\n"
- "ADD R0.z, R0, -R0.w;\n"
- "ADD R0.w, R0.y, c[3].x;\n"
- "ABS R0.z, R0;\n"
- "CMP R0.y, -R0.z, R0, R0.w;\n"
- "ABS R0.z, -R0.y;\n"
- "ADD R0.z, R0, c[3].y;\n"
- "ADD R0.w, R0.x, R0.z;\n"
- "ADD R1.x, R0.z, -R0;\n"
- "RCP R1.y, R0.w;\n"
- "RCP R1.x, R1.x;\n"
- "MUL R0.w, R0, R1.x;\n"
- "ADD R0.z, R0.x, -R0;\n"
- "MUL R0.z, R0, R1.y;\n"
- "CMP R0.z, R0.x, R0.w, R0;\n"
- "MUL R0.w, R0.z, R0.z;\n"
- "MOV R1.x, c[4].y;\n"
- "CMP R0.x, R0, c[4], R1;\n"
- "MAD R0.w, R0, c[3].z, -c[3];\n"
- "MUL R1.xy, fragment.position, c[7];\n"
- "TEX R1, R1, texture[0], 2D;\n"
- "CMP R0.y, -R0, c[4].z, c[4].w;\n"
- "MAD R0.x, R0.w, R0.z, R0;\n"
- "MAD R0.x, R0, R0.y, c[5];\n"
- "MUL R0.x, R0, c[6];\n"
+ "ABS R0.z, R0.x;\n"
+ "ABS R0.w, R0.y;\n"
+ "ADD R0.w, R0, -R0.z;\n"
+ "ADD R1.x, R0.y, c[5].y;\n"
+ "ABS R0.w, R0;\n"
+ "CMP R0.y, -R0.w, R0, R1.x;\n"
+ "ABS R0.w, -R0.y;\n"
+ "MAX R1.x, R0.z, R0.w;\n"
+ "RCP R1.y, R1.x;\n"
+ "MIN R1.x, R0.z, R0.w;\n"
+ "MUL R1.x, R1, R1.y;\n"
+ "MUL R1.y, R1.x, R1.x;\n"
+ "MAD R1.z, R1.y, c[6].x, c[6].y;\n"
+ "MAD R1.z, R1, R1.y, -c[6];\n"
+ "MAD R1.z, R1, R1.y, c[6].w;\n"
+ "MAD R1.z, R1, R1.y, -c[7].x;\n"
+ "MAD R1.y, R1.z, R1, c[7];\n"
+ "MUL R1.x, R1.y, R1;\n"
+ "ADD R0.z, -R0, R0.w;\n"
+ "ADD R1.y, -R1.x, c[5].w;\n"
+ "CMP R0.z, -R0, R1.y, R1.x;\n"
+ "ADD R0.w, -R0.z, c[5].z;\n"
+ "CMP R0.x, R0, R0.w, R0.z;\n"
+ "CMP R0.x, -R0.y, -R0, R0;\n"
+ "MUL R0.zw, fragment.position.xyxy, c[4].xyxy;\n"
+ "ADD R0.x, R0, c[0];\n"
+ "MUL R0.x, R0, c[5];\n"
"FLR R0.y, R0.x;\n"
+ "TEX R1, R0.zwzw, texture[0], 2D;\n"
"ADD R0.x, R0, -R0.y;\n"
"TEX R0, R0, texture[1], 1D;\n"
"MUL R2.xyz, R0, R1.w;\n"
- "MUL R3.xyz, R1, R0.w;\n"
+ "MUL R3.xyz, R0.w, R1;\n"
"ADD R0.xyz, R0, R1;\n"
"MIN R2.xyz, R2, R3;\n"
"ADD R1.x, R0.w, R1.w;\n"
- "MAD result.color.xyz, -R2, c[6].y, R0;\n"
+ "MAD result.color.xyz, -R2, c[7].z, R0;\n"
"MAD result.color.w, -R0, R1, R1.x;\n"
"END\n"
;
static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MODES_EXCLUSION_NOMASK =
"!!ARBfp1.0\n"
- "PARAM c[8] = { program.local[0..2],\n"
- " { 0.0020000001, 9.9999997e-10, 0.1963, 0.9817 },\n"
- " { 2.3561945, 0.78539819, -1, 1 },\n"
- " program.local[5],\n"
- " { 0.15915494, 2 },\n"
- " program.local[7] };\n"
+ "PARAM c[8] = { program.local[0..4],\n"
+ " { 0.15915494, 0.0020000001, 3.1415927, 1.5707964 },\n"
+ " { -0.01348047, 0.057477314, 0.12123907, 0.19563593 },\n"
+ " { 0.33299461, 0.99999565, 2, 1 } };\n"
"TEMP R0;\n"
"TEMP R1;\n"
"TEMP R2;\n"
"TEMP R3;\n"
- "MUL R0.xyz, fragment.position.y, c[1];\n"
- "MAD R0.xyz, fragment.position.x, c[0], R0;\n"
- "ADD R0.xyz, R0, c[2];\n"
+ "MUL R0.xyz, fragment.position.y, c[2];\n"
+ "MAD R0.xyz, fragment.position.x, c[1], R0;\n"
+ "ADD R0.xyz, R0, c[3];\n"
"RCP R0.z, R0.z;\n"
"MUL R0.xy, R0, R0.z;\n"
- "ABS R0.w, R0.x;\n"
- "ABS R0.z, R0.y;\n"
- "ADD R0.z, R0, -R0.w;\n"
- "ADD R0.w, R0.y, c[3].x;\n"
- "ABS R0.z, R0;\n"
- "CMP R0.y, -R0.z, R0, R0.w;\n"
- "ABS R0.z, -R0.y;\n"
- "ADD R0.z, R0, c[3].y;\n"
- "ADD R0.w, R0.x, R0.z;\n"
- "ADD R1.x, R0.z, -R0;\n"
- "RCP R1.y, R0.w;\n"
- "RCP R1.x, R1.x;\n"
- "MUL R0.w, R0, R1.x;\n"
- "ADD R0.z, R0.x, -R0;\n"
- "MUL R0.z, R0, R1.y;\n"
- "CMP R0.z, R0.x, R0.w, R0;\n"
- "MUL R0.w, R0.z, R0.z;\n"
- "MOV R1.x, c[4].y;\n"
- "CMP R0.x, R0, c[4], R1;\n"
- "MAD R0.w, R0, c[3].z, -c[3];\n"
- "MUL R1.xy, fragment.position, c[7];\n"
- "TEX R1, R1, texture[0], 2D;\n"
- "CMP R0.y, -R0, c[4].z, c[4].w;\n"
- "MAD R0.x, R0.w, R0.z, R0;\n"
- "MAD R0.x, R0, R0.y, c[5];\n"
- "MUL R0.x, R0, c[6];\n"
+ "ABS R0.z, R0.x;\n"
+ "ABS R0.w, R0.y;\n"
+ "ADD R0.w, R0, -R0.z;\n"
+ "ADD R1.x, R0.y, c[5].y;\n"
+ "ABS R0.w, R0;\n"
+ "CMP R0.y, -R0.w, R0, R1.x;\n"
+ "ABS R0.w, -R0.y;\n"
+ "MAX R1.x, R0.z, R0.w;\n"
+ "RCP R1.y, R1.x;\n"
+ "MIN R1.x, R0.z, R0.w;\n"
+ "MUL R1.x, R1, R1.y;\n"
+ "MUL R1.y, R1.x, R1.x;\n"
+ "MAD R1.z, R1.y, c[6].x, c[6].y;\n"
+ "MAD R1.z, R1, R1.y, -c[6];\n"
+ "MAD R1.z, R1, R1.y, c[6].w;\n"
+ "MAD R1.z, R1, R1.y, -c[7].x;\n"
+ "MAD R1.y, R1.z, R1, c[7];\n"
+ "MUL R1.x, R1.y, R1;\n"
+ "ADD R0.z, -R0, R0.w;\n"
+ "ADD R1.y, -R1.x, c[5].w;\n"
+ "CMP R0.z, -R0, R1.y, R1.x;\n"
+ "ADD R0.w, -R0.z, c[5].z;\n"
+ "CMP R0.x, R0, R0.w, R0.z;\n"
+ "CMP R0.x, -R0.y, -R0, R0;\n"
+ "MUL R0.zw, fragment.position.xyxy, c[4].xyxy;\n"
+ "TEX R1, R0.zwzw, texture[0], 2D;\n"
+ "ADD R0.x, R0, c[0];\n"
+ "MUL R0.x, R0, c[5];\n"
"FLR R0.y, R0.x;\n"
"ADD R0.x, R0, -R0.y;\n"
"TEX R0, R0, texture[1], 1D;\n"
- "MUL R2.xyz, R1, R0.w;\n"
+ "MUL R2.xyz, R0.w, R1;\n"
"MAD R3.xyz, R0, R1.w, R2;\n"
"MUL R2.xyz, R0, R1;\n"
- "MAD R2.xyz, -R2, c[6].y, R3;\n"
- "ADD R2.w, -R1, c[4];\n"
+ "MAD R2.xyz, -R2, c[7].z, R3;\n"
+ "ADD R2.w, -R1, c[7];\n"
"MAD R0.xyz, R0, R2.w, R2;\n"
"ADD R2.x, R0.w, R1.w;\n"
- "ADD R2.y, -R0.w, c[4].w;\n"
+ "ADD R2.y, -R0.w, c[7].w;\n"
"MAD result.color.xyz, R1, R2.y, R0;\n"
"MAD result.color.w, -R0, R1, R2.x;\n"
"END\n"
@@ -3933,49 +3833,49 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MO
static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MODE_BLEND_MODE_MASK =
"!!ARBfp1.0\n"
- "PARAM c[10] = { program.local[0..2],\n"
- " { 0.0020000001, 9.9999997e-10, 0.1963, 0.9817 },\n"
- " { 2.3561945, 0.78539819, -1, 1 },\n"
- " program.local[5],\n"
- " { 0.15915494 },\n"
- " program.local[7..9] };\n"
+ "PARAM c[10] = { program.local[0..6],\n"
+ " { 0.15915494, 0.0020000001, 3.1415927, 1.5707964 },\n"
+ " { -0.01348047, 0.057477314, 0.12123907, 0.19563593 },\n"
+ " { 0.33299461, 0.99999565 } };\n"
"TEMP R0;\n"
"TEMP R1;\n"
- "MUL R0.xyz, fragment.position.y, c[1];\n"
- "MAD R0.xyz, fragment.position.x, c[0], R0;\n"
- "ADD R0.xyz, R0, c[2];\n"
+ "MUL R0.xyz, fragment.position.y, c[2];\n"
+ "MAD R0.xyz, fragment.position.x, c[1], R0;\n"
+ "ADD R0.xyz, R0, c[3];\n"
"RCP R0.z, R0.z;\n"
"MUL R0.xy, R0, R0.z;\n"
- "ABS R0.w, R0.x;\n"
- "ABS R0.z, R0.y;\n"
- "ADD R0.z, R0, -R0.w;\n"
- "ADD R0.w, R0.y, c[3].x;\n"
- "ABS R0.z, R0;\n"
- "CMP R0.y, -R0.z, R0, R0.w;\n"
- "ABS R0.z, -R0.y;\n"
- "ADD R0.z, R0, c[3].y;\n"
- "ADD R0.w, R0.x, R0.z;\n"
- "ADD R1.x, R0.z, -R0;\n"
- "RCP R1.y, R0.w;\n"
- "RCP R1.x, R1.x;\n"
- "MUL R0.w, R0, R1.x;\n"
- "ADD R0.z, R0.x, -R0;\n"
- "MUL R0.z, R0, R1.y;\n"
- "CMP R0.z, R0.x, R0.w, R0;\n"
- "MUL R0.w, R0.z, R0.z;\n"
- "MOV R1.x, c[4].y;\n"
- "CMP R0.x, R0, c[4], R1;\n"
- "MAD R0.w, R0, c[3].z, -c[3];\n"
- "MAD R0.x, R0.w, R0.z, R0;\n"
- "CMP R0.y, -R0, c[4].z, c[4].w;\n"
- "MAD R0.z, R0.x, R0.y, c[5].x;\n"
- "MUL R1.x, R0.z, c[6];\n"
+ "ABS R0.z, R0.x;\n"
+ "ABS R0.w, R0.y;\n"
+ "ADD R0.w, R0, -R0.z;\n"
+ "ADD R1.x, R0.y, c[7].y;\n"
+ "ABS R0.w, R0;\n"
+ "CMP R0.y, -R0.w, R0, R1.x;\n"
+ "ABS R0.w, -R0.y;\n"
+ "MAX R1.x, R0.z, R0.w;\n"
+ "RCP R1.y, R1.x;\n"
+ "MIN R1.x, R0.z, R0.w;\n"
+ "MUL R1.x, R1, R1.y;\n"
+ "MUL R1.y, R1.x, R1.x;\n"
+ "MAD R1.z, R1.y, c[8].x, c[8].y;\n"
+ "MAD R1.z, R1, R1.y, -c[8];\n"
+ "MAD R1.z, R1, R1.y, c[8].w;\n"
+ "MAD R1.z, R1, R1.y, -c[9].x;\n"
+ "MAD R1.y, R1.z, R1, c[9];\n"
+ "MUL R1.x, R1.y, R1;\n"
+ "ADD R1.y, -R1.x, c[7].w;\n"
+ "ADD R0.z, -R0, R0.w;\n"
+ "CMP R0.z, -R0, R1.y, R1.x;\n"
+ "ADD R0.w, -R0.z, c[7].z;\n"
+ "CMP R0.x, R0, R0.w, R0.z;\n"
+ "CMP R0.x, -R0.y, -R0, R0;\n"
+ "ADD R0.z, R0.x, c[0].x;\n"
+ "MUL R1.x, R0.z, c[7];\n"
"FLR R1.y, R1.x;\n"
- "ADD R0.xy, fragment.position, c[7];\n"
- "MUL R0.xy, R0, c[8];\n"
+ "ADD R0.xy, fragment.position, c[5];\n"
+ "MUL R0.xy, R0, c[4];\n"
"TEX R0, R0, texture[0], 2D;\n"
"ADD R1.x, R1, -R1.y;\n"
- "DP4 R1.y, R0, c[9];\n"
+ "DP4 R1.y, R0, c[6];\n"
"TEX R0, R1, texture[1], 1D;\n"
"MUL result.color, R0, R1.y;\n"
"END\n"
@@ -3983,42 +3883,43 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MO
static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MODE_BLEND_MODE_NOMASK =
"!!ARBfp1.0\n"
- "PARAM c[7] = { program.local[0..2],\n"
- " { 0.0020000001, 9.9999997e-10, 0.1963, 0.9817 },\n"
- " { 2.3561945, 0.78539819, -1, 1 },\n"
- " program.local[5],\n"
- " { 0.15915494 } };\n"
+ "PARAM c[7] = { program.local[0..3],\n"
+ " { 0.15915494, 0.0020000001, 3.1415927, 1.5707964 },\n"
+ " { -0.01348047, 0.057477314, 0.12123907, 0.19563593 },\n"
+ " { 0.33299461, 0.99999565 } };\n"
"TEMP R0;\n"
"TEMP R1;\n"
- "MUL R0.xyz, fragment.position.y, c[1];\n"
- "MAD R0.xyz, fragment.position.x, c[0], R0;\n"
- "ADD R0.xyz, R0, c[2];\n"
+ "MUL R0.xyz, fragment.position.y, c[2];\n"
+ "MAD R0.xyz, fragment.position.x, c[1], R0;\n"
+ "ADD R0.xyz, R0, c[3];\n"
"RCP R0.z, R0.z;\n"
"MUL R0.xy, R0, R0.z;\n"
- "ABS R0.w, R0.x;\n"
- "ABS R0.z, R0.y;\n"
- "ADD R0.z, R0, -R0.w;\n"
- "ADD R0.w, R0.y, c[3].x;\n"
- "ABS R0.z, R0;\n"
- "CMP R0.y, -R0.z, R0, R0.w;\n"
- "ABS R0.z, -R0.y;\n"
- "ADD R0.z, R0, c[3].y;\n"
- "ADD R0.w, R0.x, R0.z;\n"
- "ADD R1.x, R0.z, -R0;\n"
- "RCP R1.x, R1.x;\n"
- "RCP R1.y, R0.w;\n"
- "MUL R0.w, R0, R1.x;\n"
- "ADD R0.z, R0.x, -R0;\n"
- "MUL R0.z, R0, R1.y;\n"
- "CMP R0.z, R0.x, R0.w, R0;\n"
- "MUL R0.w, R0.z, R0.z;\n"
- "MOV R1.x, c[4].y;\n"
- "CMP R0.y, -R0, c[4].z, c[4].w;\n"
- "MAD R0.w, R0, c[3].z, -c[3];\n"
- "CMP R0.x, R0, c[4], R1;\n"
- "MAD R0.x, R0.w, R0.z, R0;\n"
- "MAD R0.x, R0, R0.y, c[5];\n"
- "MUL R0.x, R0, c[6];\n"
+ "ABS R0.z, R0.x;\n"
+ "ABS R0.w, R0.y;\n"
+ "ADD R0.w, R0, -R0.z;\n"
+ "ADD R1.x, R0.y, c[4].y;\n"
+ "ABS R0.w, R0;\n"
+ "CMP R0.y, -R0.w, R0, R1.x;\n"
+ "ABS R0.w, -R0.y;\n"
+ "MAX R1.x, R0.z, R0.w;\n"
+ "RCP R1.y, R1.x;\n"
+ "MIN R1.x, R0.z, R0.w;\n"
+ "MUL R1.x, R1, R1.y;\n"
+ "MUL R1.y, R1.x, R1.x;\n"
+ "MAD R1.z, R1.y, c[5].x, c[5].y;\n"
+ "MAD R1.z, R1, R1.y, -c[5];\n"
+ "MAD R1.z, R1, R1.y, c[5].w;\n"
+ "MAD R1.z, R1, R1.y, -c[6].x;\n"
+ "MAD R1.y, R1.z, R1, c[6];\n"
+ "MUL R1.x, R1.y, R1;\n"
+ "ADD R0.z, -R0, R0.w;\n"
+ "ADD R1.y, -R1.x, c[4].w;\n"
+ "CMP R0.z, -R0, R1.y, R1.x;\n"
+ "ADD R0.w, -R0.z, c[4].z;\n"
+ "CMP R0.x, R0, R0.w, R0.z;\n"
+ "CMP R0.x, -R0.y, -R0, R0;\n"
+ "ADD R0.x, R0, c[0];\n"
+ "MUL R0.x, R0, c[4];\n"
"FLR R0.y, R0.x;\n"
"ADD R0.x, R0, -R0.y;\n"
"TEX result.color, R0, texture[0], 1D;\n"
@@ -4027,45 +3928,43 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MO
static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_LINEAR_COMPOSITION_MODES_SIMPLE_PORTER_DUFF =
"!!ARBfp1.0\n"
- "PARAM c[11] = { program.local[0..7],\n"
- " { 1 },\n"
- " program.local[9..10] };\n"
+ "PARAM c[11] = { program.local[0..9],\n"
+ " { 1 } };\n"
"TEMP R0;\n"
"TEMP R1;\n"
"TEMP R2;\n"
"TEMP R3;\n"
- "MUL R0.xyz, fragment.position.y, c[4];\n"
- "MAD R0.xyz, fragment.position.x, c[3], R0;\n"
- "ADD R0.xyz, R0, c[5];\n"
+ "MUL R0.xyz, fragment.position.y, c[2];\n"
+ "MAD R0.xyz, fragment.position.x, c[1], R0;\n"
+ "ADD R0.xyz, R0, c[3];\n"
"RCP R0.z, R0.z;\n"
"MUL R0.xy, R0, R0.z;\n"
- "MUL R0.xy, R0, c[6];\n"
- "ADD R0.x, R0, R0.y;\n"
- "MUL R0.zw, fragment.position.xyxy, c[7].xyxy;\n"
- "TEX R1, R0.zwzw, texture[0], 2D;\n"
- "MUL R0.x, R0, c[6].z;\n"
- "TEX R0, R0, texture[2], 1D;\n"
- "MUL R2.xyz, R1, c[10].y;\n"
- "MUL R3.xyz, R2, R0.w;\n"
- "MUL R2.xyz, R0, c[10].x;\n"
- "MAD R2.xyz, R2, R1.w, R3;\n"
- "ADD R3.xy, fragment.position, c[0];\n"
- "MUL R0.xyz, R0, c[9].y;\n"
- "ADD R2.w, -R1, c[8].x;\n"
- "MAD R2.xyz, R0, R2.w, R2;\n"
- "MUL R0.xyz, R1, c[9].z;\n"
- "ADD R2.w, -R0, c[8].x;\n"
- "MAD R2.xyz, R0, R2.w, R2;\n"
- "ADD R0.y, -R1.w, c[8].x;\n"
- "MUL R0.z, R1.w, R2.w;\n"
- "MUL R0.x, R0.w, R1.w;\n"
- "MUL R0.y, R0.w, R0;\n"
- "DP3 R2.w, R0, c[9];\n"
- "MUL R3.xy, R3, c[1];\n"
- "TEX R0, R3, texture[1], 2D;\n"
- "ADD R2, R2, -R1;\n"
- "DP4 R0.x, R0, c[2];\n"
- "MAD result.color, R0.x, R2, R1;\n"
+ "MUL R0.zw, R0.xyxy, c[0].xyxy;\n"
+ "ADD R1.x, R0.z, R0.w;\n"
+ "MUL R0.xy, fragment.position, c[7];\n"
+ "TEX R0, R0, texture[0], 2D;\n"
+ "MUL R1.x, R1, c[0].z;\n"
+ "TEX R1, R1, texture[2], 1D;\n"
+ "MUL R2.xyz, R0, c[4].y;\n"
+ "MUL R3.xyz, R1.w, R2;\n"
+ "MUL R2.xyz, R1, c[4].x;\n"
+ "MAD R2.xyz, R0.w, R2, R3;\n"
+ "ADD R3.xy, fragment.position, c[8];\n"
+ "ADD R2.w, -R0, c[10].x;\n"
+ "MUL R1.xyz, R1, c[5].y;\n"
+ "MAD R2.xyz, R2.w, R1, R2;\n"
+ "MUL R1.xyz, R0, c[5].z;\n"
+ "ADD R3.z, -R1.w, c[10].x;\n"
+ "MAD R2.xyz, R3.z, R1, R2;\n"
+ "MUL R1.y, R1.w, R2.w;\n"
+ "MUL R1.x, R1.w, R0.w;\n"
+ "MUL R1.z, R0.w, R3;\n"
+ "DP3 R2.w, R1, c[5];\n"
+ "MUL R3.xy, R3, c[6];\n"
+ "TEX R1, R3, texture[1], 2D;\n"
+ "ADD R2, R2, -R0;\n"
+ "DP4 R1.x, R1, c[9];\n"
+ "MAD result.color, R1.x, R2, R0;\n"
"END\n"
;
@@ -4076,30 +3975,30 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_LINEAR_COMPOSITION_MOD
"TEMP R0;\n"
"TEMP R1;\n"
"TEMP R2;\n"
- "MUL R0.xyz, fragment.position.y, c[4];\n"
- "MAD R0.xyz, fragment.position.x, c[3], R0;\n"
- "ADD R0.xyz, R0, c[5];\n"
+ "MUL R0.xyz, fragment.position.y, c[2];\n"
+ "MAD R0.xyz, fragment.position.x, c[1], R0;\n"
+ "ADD R0.xyz, R0, c[3];\n"
"RCP R0.z, R0.z;\n"
"MUL R0.xy, R0, R0.z;\n"
- "MUL R0.xy, R0, c[6];\n"
- "ADD R0.x, R0, R0.y;\n"
- "MUL R0.zw, fragment.position.xyxy, c[7].xyxy;\n"
- "TEX R1, R0.zwzw, texture[0], 2D;\n"
- "MUL R0.x, R0, c[6].z;\n"
- "TEX R0, R0, texture[2], 1D;\n"
- "ADD R2.x, -R1.w, c[8];\n"
- "MUL R2.xyz, R0, R2.x;\n"
- "MAD R0.xyz, R0, R1, R2;\n"
+ "MUL R0.zw, R0.xyxy, c[0].xyxy;\n"
+ "ADD R1.x, R0.z, R0.w;\n"
+ "MUL R0.xy, fragment.position, c[5];\n"
+ "TEX R0, R0, texture[0], 2D;\n"
+ "MUL R1.x, R1, c[0].z;\n"
+ "TEX R1, R1, texture[2], 1D;\n"
"ADD R2.x, -R0.w, c[8];\n"
- "MAD R2.xyz, R1, R2.x, R0;\n"
- "ADD R0.z, R0.w, R1.w;\n"
- "MAD R2.w, -R0, R1, R0.z;\n"
- "ADD R0.xy, fragment.position, c[0];\n"
- "MUL R0.xy, R0, c[1];\n"
- "TEX R0, R0, texture[1], 2D;\n"
- "ADD R2, R2, -R1;\n"
- "DP4 R0.x, R0, c[2];\n"
- "MAD result.color, R0.x, R2, R1;\n"
+ "MUL R2.xyz, R1, R2.x;\n"
+ "MAD R1.xyz, R1, R0, R2;\n"
+ "ADD R2.x, -R1.w, c[8];\n"
+ "MAD R2.xyz, R0, R2.x, R1;\n"
+ "ADD R1.z, R1.w, R0.w;\n"
+ "MAD R2.w, -R1, R0, R1.z;\n"
+ "ADD R1.xy, fragment.position, c[6];\n"
+ "MUL R1.xy, R1, c[4];\n"
+ "TEX R1, R1, texture[1], 2D;\n"
+ "ADD R2, R2, -R0;\n"
+ "DP4 R1.x, R1, c[7];\n"
+ "MAD result.color, R1.x, R2, R0;\n"
"END\n"
;
@@ -4110,25 +4009,25 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_LINEAR_COMPOSITION_MOD
"TEMP R1;\n"
"TEMP R2;\n"
"TEMP R3;\n"
- "MUL R0.xyz, fragment.position.y, c[4];\n"
- "MAD R0.xyz, fragment.position.x, c[3], R0;\n"
- "ADD R0.xyz, R0, c[5];\n"
+ "MUL R0.xyz, fragment.position.y, c[2];\n"
+ "MAD R0.xyz, fragment.position.x, c[1], R0;\n"
+ "ADD R0.xyz, R0, c[3];\n"
"RCP R0.z, R0.z;\n"
"MUL R0.xy, R0, R0.z;\n"
- "MUL R0.xy, R0, c[6];\n"
+ "MUL R0.xy, R0, c[0];\n"
"ADD R0.x, R0, R0.y;\n"
- "MUL R0.x, R0, c[6].z;\n"
- "MUL R1.xy, fragment.position, c[7];\n"
- "ADD R3.xy, fragment.position, c[0];\n"
- "TEX R1, R1, texture[0], 2D;\n"
- "TEX R0, R0, texture[2], 1D;\n"
- "ADD R2, R0, R1;\n"
- "MAD R2, -R0, R1, R2;\n"
- "MUL R3.xy, R3, c[1];\n"
- "TEX R0, R3, texture[1], 2D;\n"
- "ADD R2, R2, -R1;\n"
- "DP4 R0.x, R0, c[2];\n"
- "MAD result.color, R0.x, R2, R1;\n"
+ "MUL R0.z, R0.x, c[0];\n"
+ "ADD R3.xy, fragment.position, c[6];\n"
+ "TEX R1, R0.z, texture[2], 1D;\n"
+ "MUL R0.xy, fragment.position, c[5];\n"
+ "TEX R0, R0, texture[0], 2D;\n"
+ "ADD R2, R1, R0;\n"
+ "MAD R2, -R1, R0, R2;\n"
+ "MUL R3.xy, R3, c[4];\n"
+ "TEX R1, R3, texture[1], 2D;\n"
+ "ADD R2, R2, -R0;\n"
+ "DP4 R1.x, R1, c[7];\n"
+ "MAD result.color, R1.x, R2, R0;\n"
"END\n"
;
@@ -4141,16 +4040,16 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_LINEAR_COMPOSITION_MOD
"TEMP R2;\n"
"TEMP R3;\n"
"TEMP R4;\n"
- "MUL R0.xyz, fragment.position.y, c[4];\n"
- "MAD R0.xyz, fragment.position.x, c[3], R0;\n"
- "ADD R0.xyz, R0, c[5];\n"
+ "MUL R0.xyz, fragment.position.y, c[2];\n"
+ "MAD R0.xyz, fragment.position.x, c[1], R0;\n"
+ "ADD R0.xyz, R0, c[3];\n"
"RCP R0.z, R0.z;\n"
"MUL R0.xy, R0, R0.z;\n"
- "MUL R0.xy, R0, c[6];\n"
+ "MUL R0.xy, R0, c[0];\n"
"ADD R0.x, R0, R0.y;\n"
- "MUL R0.x, R0, c[6].z;\n"
+ "MUL R0.x, R0, c[0].z;\n"
"TEX R0, R0, texture[2], 1D;\n"
- "MUL R1.xy, fragment.position, c[7];\n"
+ "MUL R1.xy, fragment.position, c[5];\n"
"TEX R1, R1, texture[0], 2D;\n"
"ADD R2.w, -R1, c[8].y;\n"
"ADD R3.xyz, R0.w, -R0;\n"
@@ -4171,11 +4070,11 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_LINEAR_COMPOSITION_MOD
"MAD R2.xyz, R2, R0, R3;\n"
"ADD R0.z, R0.w, R1.w;\n"
"MAD R2.w, -R0, R1, R0.z;\n"
- "ADD R0.xy, fragment.position, c[0];\n"
- "MUL R0.xy, R0, c[1];\n"
+ "ADD R0.xy, fragment.position, c[6];\n"
+ "MUL R0.xy, R0, c[4];\n"
"TEX R0, R0, texture[1], 2D;\n"
"ADD R2, R2, -R1;\n"
- "DP4 R0.x, R0, c[2];\n"
+ "DP4 R0.x, R0, c[7];\n"
"MAD result.color, R0.x, R2, R1;\n"
"END\n"
;
@@ -4188,32 +4087,32 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_LINEAR_COMPOSITION_MOD
"TEMP R1;\n"
"TEMP R2;\n"
"TEMP R3;\n"
- "MUL R0.xyz, fragment.position.y, c[4];\n"
- "MAD R0.xyz, fragment.position.x, c[3], R0;\n"
- "ADD R0.xyz, R0, c[5];\n"
+ "MUL R0.xyz, fragment.position.y, c[2];\n"
+ "MAD R0.xyz, fragment.position.x, c[1], R0;\n"
+ "ADD R0.xyz, R0, c[3];\n"
"RCP R0.z, R0.z;\n"
"MUL R0.xy, R0, R0.z;\n"
- "MUL R0.xy, R0, c[6];\n"
- "ADD R0.x, R0, R0.y;\n"
- "MUL R0.x, R0, c[6].z;\n"
- "MUL R1.xy, fragment.position, c[7];\n"
- "TEX R1, R1, texture[0], 2D;\n"
- "TEX R0, R0, texture[2], 1D;\n"
- "MUL R3.xyz, R1, R0.w;\n"
- "MUL R2.xyz, R0, R1.w;\n"
+ "MUL R0.xy, R0, c[0];\n"
+ "ADD R0.z, R0.x, R0.y;\n"
+ "MUL R1.x, R0.z, c[0].z;\n"
+ "MUL R0.xy, fragment.position, c[5];\n"
+ "TEX R0, R0, texture[0], 2D;\n"
+ "TEX R1, R1, texture[2], 1D;\n"
+ "MUL R3.xyz, R1.w, R0;\n"
+ "MUL R2.xyz, R1, R0.w;\n"
"MIN R2.xyz, R2, R3;\n"
- "ADD R2.w, -R1, c[8].x;\n"
- "MAD R0.xyz, R0, R2.w, R2;\n"
- "ADD R2.x, -R0.w, c[8];\n"
- "MAD R2.xyz, R1, R2.x, R0;\n"
- "ADD R0.z, R0.w, R1.w;\n"
- "MAD R2.w, -R0, R1, R0.z;\n"
- "ADD R0.xy, fragment.position, c[0];\n"
- "MUL R0.xy, R0, c[1];\n"
- "TEX R0, R0, texture[1], 2D;\n"
- "ADD R2, R2, -R1;\n"
- "DP4 R0.x, R0, c[2];\n"
- "MAD result.color, R0.x, R2, R1;\n"
+ "ADD R2.w, -R0, c[8].x;\n"
+ "MAD R1.xyz, R1, R2.w, R2;\n"
+ "ADD R2.x, -R1.w, c[8];\n"
+ "MAD R2.xyz, R0, R2.x, R1;\n"
+ "ADD R1.z, R1.w, R0.w;\n"
+ "MAD R2.w, -R1, R0, R1.z;\n"
+ "ADD R1.xy, fragment.position, c[6];\n"
+ "MUL R1.xy, R1, c[4];\n"
+ "TEX R1, R1, texture[1], 2D;\n"
+ "ADD R2, R2, -R0;\n"
+ "DP4 R1.x, R1, c[7];\n"
+ "MAD result.color, R1.x, R2, R0;\n"
"END\n"
;
@@ -4225,64 +4124,64 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_LINEAR_COMPOSITION_MOD
"TEMP R1;\n"
"TEMP R2;\n"
"TEMP R3;\n"
- "MUL R0.xyz, fragment.position.y, c[4];\n"
- "MAD R0.xyz, fragment.position.x, c[3], R0;\n"
- "ADD R0.xyz, R0, c[5];\n"
+ "MUL R0.xyz, fragment.position.y, c[2];\n"
+ "MAD R0.xyz, fragment.position.x, c[1], R0;\n"
+ "ADD R0.xyz, R0, c[3];\n"
"RCP R0.z, R0.z;\n"
"MUL R0.xy, R0, R0.z;\n"
- "MUL R0.xy, R0, c[6];\n"
- "ADD R0.x, R0, R0.y;\n"
- "MUL R0.x, R0, c[6].z;\n"
- "MUL R1.xy, fragment.position, c[7];\n"
- "TEX R1, R1, texture[0], 2D;\n"
- "TEX R0, R0, texture[2], 1D;\n"
- "MUL R3.xyz, R1, R0.w;\n"
- "MUL R2.xyz, R0, R1.w;\n"
+ "MUL R0.xy, R0, c[0];\n"
+ "ADD R0.z, R0.x, R0.y;\n"
+ "MUL R1.x, R0.z, c[0].z;\n"
+ "MUL R0.xy, fragment.position, c[5];\n"
+ "TEX R0, R0, texture[0], 2D;\n"
+ "TEX R1, R1, texture[2], 1D;\n"
+ "MUL R3.xyz, R1.w, R0;\n"
+ "MUL R2.xyz, R1, R0.w;\n"
"MAX R2.xyz, R2, R3;\n"
- "ADD R2.w, -R1, c[8].x;\n"
- "MAD R0.xyz, R0, R2.w, R2;\n"
- "ADD R2.x, -R0.w, c[8];\n"
- "MAD R2.xyz, R1, R2.x, R0;\n"
- "ADD R0.z, R0.w, R1.w;\n"
- "MAD R2.w, -R0, R1, R0.z;\n"
- "ADD R0.xy, fragment.position, c[0];\n"
- "MUL R0.xy, R0, c[1];\n"
- "TEX R0, R0, texture[1], 2D;\n"
- "ADD R2, R2, -R1;\n"
- "DP4 R0.x, R0, c[2];\n"
- "MAD result.color, R0.x, R2, R1;\n"
+ "ADD R2.w, -R0, c[8].x;\n"
+ "MAD R1.xyz, R1, R2.w, R2;\n"
+ "ADD R2.x, -R1.w, c[8];\n"
+ "MAD R2.xyz, R0, R2.x, R1;\n"
+ "ADD R1.z, R1.w, R0.w;\n"
+ "MAD R2.w, -R1, R0, R1.z;\n"
+ "ADD R1.xy, fragment.position, c[6];\n"
+ "MUL R1.xy, R1, c[4];\n"
+ "TEX R1, R1, texture[1], 2D;\n"
+ "ADD R2, R2, -R0;\n"
+ "DP4 R1.x, R1, c[7];\n"
+ "MAD result.color, R1.x, R2, R0;\n"
"END\n"
;
static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_LINEAR_COMPOSITION_MODES_COLORDODGE =
"!!ARBfp1.0\n"
"PARAM c[9] = { program.local[0..7],\n"
- " { 1, 1e-06 } };\n"
+ " { 1, 1e-006 } };\n"
"TEMP R0;\n"
"TEMP R1;\n"
"TEMP R2;\n"
"TEMP R3;\n"
"TEMP R4;\n"
- "MUL R0.xyz, fragment.position.y, c[4];\n"
- "MAD R0.xyz, fragment.position.x, c[3], R0;\n"
- "ADD R0.xyz, R0, c[5];\n"
+ "MUL R0.xyz, fragment.position.y, c[2];\n"
+ "MAD R0.xyz, fragment.position.x, c[1], R0;\n"
+ "ADD R0.xyz, R0, c[3];\n"
"RCP R0.z, R0.z;\n"
"MUL R0.xy, R0, R0.z;\n"
- "MUL R0.xy, R0, c[6];\n"
+ "MUL R0.xy, R0, c[0];\n"
"ADD R0.x, R0, R0.y;\n"
- "MUL R0.x, R0, c[6].z;\n"
+ "MUL R0.x, R0, c[0].z;\n"
"TEX R0, R0, texture[2], 1D;\n"
"MAX R1.x, R0.w, c[8].y;\n"
"RCP R1.x, R1.x;\n"
"MAD R2.xyz, -R0, R1.x, c[8].x;\n"
"MAX R2.xyz, R2, c[8].y;\n"
- "MUL R1.xy, fragment.position, c[7];\n"
+ "MUL R1.xy, fragment.position, c[5];\n"
"TEX R1, R1, texture[0], 2D;\n"
"ADD R2.w, -R0, c[8].x;\n"
"MUL R3.xyz, R1, R2.w;\n"
"ADD R2.w, -R1, c[8].x;\n"
"MAD R4.xyz, R0, R2.w, R3;\n"
- "MUL R3.xyz, R1, R0.w;\n"
+ "MUL R3.xyz, R0.w, R1;\n"
"MUL R2.w, R0, R1;\n"
"MAD R0.xyz, R0, R1.w, R3;\n"
"SGE R0.xyz, R0, R2.w;\n"
@@ -4295,11 +4194,11 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_LINEAR_COMPOSITION_MOD
"MAD R2.xyz, R0, R4, R2;\n"
"ADD R0.z, R0.w, R1.w;\n"
"MAD R2.w, -R0, R1, R0.z;\n"
- "ADD R0.xy, fragment.position, c[0];\n"
- "MUL R0.xy, R0, c[1];\n"
+ "ADD R0.xy, fragment.position, c[6];\n"
+ "MUL R0.xy, R0, c[4];\n"
"TEX R0, R0, texture[1], 2D;\n"
"ADD R2, R2, -R1;\n"
- "DP4 R0.x, R0, c[2];\n"
+ "DP4 R0.x, R0, c[7];\n"
"MAD result.color, R0.x, R2, R1;\n"
"END\n"
;
@@ -4307,25 +4206,25 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_LINEAR_COMPOSITION_MOD
static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_LINEAR_COMPOSITION_MODES_COLORBURN =
"!!ARBfp1.0\n"
"PARAM c[9] = { program.local[0..7],\n"
- " { 1, 9.9999997e-06 } };\n"
+ " { 1, 9.9999997e-006 } };\n"
"TEMP R0;\n"
"TEMP R1;\n"
"TEMP R2;\n"
"TEMP R3;\n"
"TEMP R4;\n"
"TEMP R5;\n"
- "MUL R0.xyz, fragment.position.y, c[4];\n"
- "MAD R0.xyz, fragment.position.x, c[3], R0;\n"
- "ADD R0.xyz, R0, c[5];\n"
+ "MUL R0.xyz, fragment.position.y, c[2];\n"
+ "MAD R0.xyz, fragment.position.x, c[1], R0;\n"
+ "ADD R0.xyz, R0, c[3];\n"
"RCP R0.z, R0.z;\n"
"MUL R0.xy, R0, R0.z;\n"
- "MUL R0.xy, R0, c[6];\n"
+ "MUL R0.xy, R0, c[0];\n"
"ADD R0.x, R0, R0.y;\n"
- "MUL R0.x, R0, c[6].z;\n"
+ "MUL R0.zw, fragment.position.xyxy, c[5].xyxy;\n"
+ "TEX R1, R0.zwzw, texture[0], 2D;\n"
+ "MUL R0.x, R0, c[0].z;\n"
"TEX R0, R0, texture[2], 1D;\n"
- "MUL R1.xy, fragment.position, c[7];\n"
- "TEX R1, R1, texture[0], 2D;\n"
- "MUL R2.xyz, R1, R0.w;\n"
+ "MUL R2.xyz, R0.w, R1;\n"
"MAD R3.xyz, R0, R1.w, R2;\n"
"MAD R2.xyz, -R0.w, R1.w, R3;\n"
"MUL R4.xyz, R0.w, R2;\n"
@@ -4340,18 +4239,17 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_LINEAR_COMPOSITION_MOD
"MUL R4.xyz, R1, R3.w;\n"
"MAD R0.xyz, R0, R2.w, R4;\n"
"MUL R2.w, R0, R1;\n"
- "ADD R3.w, -R0, c[8].x;\n"
"MAD R2.xyz, R1, R3.w, R2;\n"
"ADD R2.xyz, R2, -R0;\n"
"SGE R3.xyz, R3, R2.w;\n"
"MAD R2.xyz, R3, R2, R0;\n"
"ADD R0.z, R0.w, R1.w;\n"
"MAD R2.w, -R0, R1, R0.z;\n"
- "ADD R0.xy, fragment.position, c[0];\n"
- "MUL R0.xy, R0, c[1];\n"
+ "ADD R0.xy, fragment.position, c[6];\n"
+ "MUL R0.xy, R0, c[4];\n"
"TEX R0, R0, texture[1], 2D;\n"
"ADD R2, R2, -R1;\n"
- "DP4 R0.x, R0, c[2];\n"
+ "DP4 R0.x, R0, c[7];\n"
"MAD result.color, R0.x, R2, R1;\n"
"END\n"
;
@@ -4365,16 +4263,16 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_LINEAR_COMPOSITION_MOD
"TEMP R2;\n"
"TEMP R3;\n"
"TEMP R4;\n"
- "MUL R0.xyz, fragment.position.y, c[4];\n"
- "MAD R0.xyz, fragment.position.x, c[3], R0;\n"
- "ADD R0.xyz, R0, c[5];\n"
+ "MUL R0.xyz, fragment.position.y, c[2];\n"
+ "MAD R0.xyz, fragment.position.x, c[1], R0;\n"
+ "ADD R0.xyz, R0, c[3];\n"
"RCP R0.z, R0.z;\n"
"MUL R0.xy, R0, R0.z;\n"
- "MUL R0.xy, R0, c[6];\n"
+ "MUL R0.xy, R0, c[0];\n"
"ADD R0.x, R0, R0.y;\n"
- "MUL R0.x, R0, c[6].z;\n"
+ "MUL R0.x, R0, c[0].z;\n"
"TEX R0, R0, texture[2], 1D;\n"
- "MUL R1.xy, fragment.position, c[7];\n"
+ "MUL R1.xy, fragment.position, c[5];\n"
"TEX R1, R1, texture[0], 2D;\n"
"ADD R2.w, -R1, c[8].y;\n"
"ADD R3.xyz, R0.w, -R0;\n"
@@ -4395,11 +4293,11 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_LINEAR_COMPOSITION_MOD
"MAD R2.xyz, R0, R2, R3;\n"
"ADD R0.z, R0.w, R1.w;\n"
"MAD R2.w, -R0, R1, R0.z;\n"
- "ADD R0.xy, fragment.position, c[0];\n"
- "MUL R0.xy, R0, c[1];\n"
+ "ADD R0.xy, fragment.position, c[6];\n"
+ "MUL R0.xy, R0, c[4];\n"
"TEX R0, R0, texture[1], 2D;\n"
"ADD R2, R2, -R1;\n"
- "DP4 R0.x, R0, c[2];\n"
+ "DP4 R0.x, R0, c[7];\n"
"MAD result.color, R0.x, R2, R1;\n"
"END\n"
;
@@ -4407,8 +4305,8 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_LINEAR_COMPOSITION_MOD
static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_LINEAR_COMPOSITION_MODES_SOFTLIGHT =
"!!ARBfp1.0\n"
"PARAM c[10] = { program.local[0..7],\n"
- " { 1, 9.9999997e-06, 2, 8 },\n"
- " { 3 } };\n"
+ " { 1, 9.9999997e-006, 2, 3 },\n"
+ " { 8 } };\n"
"TEMP R0;\n"
"TEMP R1;\n"
"TEMP R2;\n"
@@ -4416,60 +4314,58 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_LINEAR_COMPOSITION_MOD
"TEMP R4;\n"
"TEMP R5;\n"
"TEMP R6;\n"
- "MUL R2.xyz, fragment.position.y, c[4];\n"
- "MAD R3.xyz, fragment.position.x, c[3], R2;\n"
- "MUL R0.xy, fragment.position, c[7];\n"
- "TEX R1, R0, texture[0], 2D;\n"
- "MAX R0.x, R1.w, c[8].y;\n"
- "RCP R2.w, R0.x;\n"
- "MUL R0.xyz, R1, R2.w;\n"
- "RSQ R0.w, R0.x;\n"
- "RSQ R2.y, R0.y;\n"
- "ADD R3.xyz, R3, c[5];\n"
- "RCP R2.x, R0.w;\n"
- "RCP R0.w, R3.z;\n"
- "MUL R3.xy, R3, R0.w;\n"
- "RSQ R0.w, R0.z;\n"
- "RCP R2.z, R0.w;\n"
+ "MUL R2.xyz, fragment.position.y, c[2];\n"
+ "MAD R3.xyz, fragment.position.x, c[1], R2;\n"
+ "MUL R0.xy, fragment.position, c[5];\n"
+ "TEX R0, R0, texture[0], 2D;\n"
+ "MAX R1.x, R0.w, c[8].y;\n"
+ "RCP R2.w, R1.x;\n"
+ "MUL R1.xyz, R0, R2.w;\n"
+ "RSQ R1.w, R1.x;\n"
+ "RSQ R2.y, R1.y;\n"
+ "ADD R3.xyz, R3, c[3];\n"
+ "RCP R2.x, R1.w;\n"
+ "RCP R1.w, R3.z;\n"
+ "MUL R3.xy, R3, R1.w;\n"
+ "RSQ R1.w, R1.z;\n"
+ "RCP R2.z, R1.w;\n"
"RCP R2.y, R2.y;\n"
- "MAD R6.xyz, R2, R1.w, -R1;\n"
- "MUL R2.xyz, -R0, c[8].w;\n"
- "ADD R5.xyz, R2, c[9].x;\n"
- "MAD R2.xyz, -R1, R2.w, c[8].x;\n"
- "MUL R3.xy, R3, c[6];\n"
- "ADD R0.w, R3.x, R3.y;\n"
- "MUL R0.w, R0, c[6].z;\n"
- "TEX R0, R0.w, texture[2], 1D;\n"
- "MAD R3.xyz, R0, c[8].z, -R0.w;\n"
+ "MAD R6.xyz, R0.w, R2, -R0;\n"
+ "MUL R2.xyz, -R1, c[9].x;\n"
+ "ADD R5.xyz, R2, c[8].w;\n"
+ "MAD R2.xyz, -R0, R2.w, c[8].x;\n"
+ "MUL R3.xy, R3, c[0];\n"
+ "ADD R1.w, R3.x, R3.y;\n"
+ "MUL R1.w, R1, c[0].z;\n"
+ "TEX R1, R1.w, texture[2], 1D;\n"
+ "MAD R3.xyz, R1, c[8].z, -R1.w;\n"
"MUL R4.xyz, R2, R3;\n"
- "MAD R4.xyz, -R4, R5, R0.w;\n"
+ "MAD R4.xyz, -R4, R5, R1.w;\n"
+ "MAD R2.xyz, -R2, R3, R1.w;\n"
"MUL R5.xyz, R6, R3;\n"
- "MAD R2.xyz, -R2, R3, R0.w;\n"
- "MAD R6.xyz, R1, R0.w, R5;\n"
- "MUL R4.xyz, R1, R4;\n"
- "MUL R5.xyz, R1, c[8].w;\n"
- "ADD R6.xyz, R6, -R4;\n"
- "SGE R5.xyz, R5, R1.w;\n"
- "MUL R5.xyz, R5, R6;\n"
- "ADD R3.xyz, R4, R5;\n"
- "MUL R2.xyz, R1, R2;\n"
- "MUL R4.xyz, R0, c[8].z;\n"
+ "MUL R4.xyz, R0, R4;\n"
+ "MAD R5.xyz, R1.w, R0, R5;\n"
+ "ADD R6.xyz, R5, -R4;\n"
+ "MUL R5.xyz, R0, c[9].x;\n"
+ "SGE R3.xyz, R5, R0.w;\n"
+ "MAD R3.xyz, R3, R6, R4;\n"
+ "MUL R2.xyz, R0, R2;\n"
+ "MUL R4.xyz, R1, c[8].z;\n"
+ "SGE R4.xyz, R4, R1.w;\n"
"ADD R3.xyz, R3, -R2;\n"
- "SGE R4.xyz, R4, R0.w;\n"
- "MUL R3.xyz, R4, R3;\n"
- "ADD R2.xyz, R2, R3;\n"
- "ADD R2.w, -R1, c[8].x;\n"
- "MAD R0.xyz, R0, R2.w, R2;\n"
- "ADD R2.x, -R0.w, c[8];\n"
- "MAD R2.xyz, R1, R2.x, R0;\n"
- "ADD R0.z, R0.w, R1.w;\n"
- "MAD R2.w, -R0, R1, R0.z;\n"
- "ADD R0.xy, fragment.position, c[0];\n"
- "MUL R0.xy, R0, c[1];\n"
- "TEX R0, R0, texture[1], 2D;\n"
- "ADD R2, R2, -R1;\n"
- "DP4 R0.x, R0, c[2];\n"
- "MAD result.color, R0.x, R2, R1;\n"
+ "MAD R2.xyz, R4, R3, R2;\n"
+ "ADD R2.w, -R0, c[8].x;\n"
+ "MAD R1.xyz, R1, R2.w, R2;\n"
+ "ADD R2.x, -R1.w, c[8];\n"
+ "MAD R2.xyz, R0, R2.x, R1;\n"
+ "ADD R1.z, R1.w, R0.w;\n"
+ "MAD R2.w, -R1, R0, R1.z;\n"
+ "ADD R1.xy, fragment.position, c[6];\n"
+ "MUL R1.xy, R1, c[4];\n"
+ "TEX R1, R1, texture[1], 2D;\n"
+ "ADD R2, R2, -R0;\n"
+ "DP4 R1.x, R1, c[7];\n"
+ "MAD result.color, R1.x, R2, R0;\n"
"END\n"
;
@@ -4481,106 +4377,104 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_LINEAR_COMPOSITION_MOD
"TEMP R1;\n"
"TEMP R2;\n"
"TEMP R3;\n"
- "MUL R0.xyz, fragment.position.y, c[4];\n"
- "MAD R0.xyz, fragment.position.x, c[3], R0;\n"
- "ADD R0.xyz, R0, c[5];\n"
+ "MUL R0.xyz, fragment.position.y, c[2];\n"
+ "MAD R0.xyz, fragment.position.x, c[1], R0;\n"
+ "ADD R0.xyz, R0, c[3];\n"
"RCP R0.z, R0.z;\n"
"MUL R0.xy, R0, R0.z;\n"
- "MUL R0.xy, R0, c[6];\n"
- "ADD R0.x, R0, R0.y;\n"
- "MUL R0.zw, fragment.position.xyxy, c[7].xyxy;\n"
- "TEX R1, R0.zwzw, texture[0], 2D;\n"
- "MUL R0.x, R0, c[6].z;\n"
- "TEX R0, R0, texture[2], 1D;\n"
- "ADD R3.xyz, R0, R1;\n"
- "MUL R2.xyz, R1, R0.w;\n"
- "MUL R0.xyz, R0, R1.w;\n"
- "MIN R0.xyz, R0, R2;\n"
- "MAD R2.xyz, -R0, c[8].x, R3;\n"
- "ADD R0.z, R0.w, R1.w;\n"
- "MAD R2.w, -R0, R1, R0.z;\n"
- "ADD R0.xy, fragment.position, c[0];\n"
- "MUL R0.xy, R0, c[1];\n"
- "TEX R0, R0, texture[1], 2D;\n"
- "ADD R2, R2, -R1;\n"
- "DP4 R0.x, R0, c[2];\n"
- "MAD result.color, R0.x, R2, R1;\n"
+ "MUL R0.xy, R0, c[0];\n"
+ "ADD R0.z, R0.x, R0.y;\n"
+ "MUL R1.x, R0.z, c[0].z;\n"
+ "MUL R0.xy, fragment.position, c[5];\n"
+ "TEX R0, R0, texture[0], 2D;\n"
+ "TEX R1, R1, texture[2], 1D;\n"
+ "ADD R2.xyz, R1, R0;\n"
+ "MUL R3.xyz, R1.w, R0;\n"
+ "MUL R1.xyz, R1, R0.w;\n"
+ "MIN R1.xyz, R1, R3;\n"
+ "MAD R2.xyz, -R1, c[8].x, R2;\n"
+ "ADD R1.z, R1.w, R0.w;\n"
+ "MAD R2.w, -R1, R0, R1.z;\n"
+ "ADD R1.xy, fragment.position, c[6];\n"
+ "MUL R1.xy, R1, c[4];\n"
+ "TEX R1, R1, texture[1], 2D;\n"
+ "ADD R2, R2, -R0;\n"
+ "DP4 R1.x, R1, c[7];\n"
+ "MAD result.color, R1.x, R2, R0;\n"
"END\n"
;
static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_LINEAR_COMPOSITION_MODES_EXCLUSION =
"!!ARBfp1.0\n"
"PARAM c[9] = { program.local[0..7],\n"
- " { 1, 2 } };\n"
+ " { 2, 1 } };\n"
"TEMP R0;\n"
"TEMP R1;\n"
"TEMP R2;\n"
"TEMP R3;\n"
- "MUL R0.xyz, fragment.position.y, c[4];\n"
- "MAD R0.xyz, fragment.position.x, c[3], R0;\n"
- "ADD R0.xyz, R0, c[5];\n"
+ "MUL R0.xyz, fragment.position.y, c[2];\n"
+ "MAD R0.xyz, fragment.position.x, c[1], R0;\n"
+ "ADD R0.xyz, R0, c[3];\n"
"RCP R0.z, R0.z;\n"
"MUL R0.xy, R0, R0.z;\n"
- "MUL R0.xy, R0, c[6];\n"
- "ADD R0.x, R0, R0.y;\n"
- "MUL R0.x, R0, c[6].z;\n"
- "MUL R1.xy, fragment.position, c[7];\n"
- "TEX R1, R1, texture[0], 2D;\n"
- "TEX R0, R0, texture[2], 1D;\n"
- "MUL R2.xyz, R1, R0.w;\n"
- "MAD R3.xyz, R0, R1.w, R2;\n"
- "MUL R2.xyz, R0, R1;\n"
- "MAD R2.xyz, -R2, c[8].y, R3;\n"
- "ADD R2.w, -R1, c[8].x;\n"
- "MAD R0.xyz, R0, R2.w, R2;\n"
- "ADD R2.x, -R0.w, c[8];\n"
- "MAD R2.xyz, R1, R2.x, R0;\n"
- "ADD R0.z, R0.w, R1.w;\n"
- "MAD R2.w, -R0, R1, R0.z;\n"
- "ADD R0.xy, fragment.position, c[0];\n"
- "MUL R0.xy, R0, c[1];\n"
- "TEX R0, R0, texture[1], 2D;\n"
- "ADD R2, R2, -R1;\n"
- "DP4 R0.x, R0, c[2];\n"
- "MAD result.color, R0.x, R2, R1;\n"
+ "MUL R0.xy, R0, c[0];\n"
+ "ADD R0.z, R0.x, R0.y;\n"
+ "MUL R1.x, R0.z, c[0].z;\n"
+ "MUL R0.xy, fragment.position, c[5];\n"
+ "TEX R0, R0, texture[0], 2D;\n"
+ "TEX R1, R1, texture[2], 1D;\n"
+ "MUL R2.xyz, R1.w, R0;\n"
+ "MAD R3.xyz, R1, R0.w, R2;\n"
+ "MUL R2.xyz, R1, R0;\n"
+ "MAD R2.xyz, -R2, c[8].x, R3;\n"
+ "ADD R2.w, -R0, c[8].y;\n"
+ "MAD R1.xyz, R1, R2.w, R2;\n"
+ "ADD R2.x, -R1.w, c[8].y;\n"
+ "MAD R2.xyz, R0, R2.x, R1;\n"
+ "ADD R1.z, R1.w, R0.w;\n"
+ "MAD R2.w, -R1, R0, R1.z;\n"
+ "ADD R1.xy, fragment.position, c[6];\n"
+ "MUL R1.xy, R1, c[4];\n"
+ "TEX R1, R1, texture[1], 2D;\n"
+ "ADD R2, R2, -R0;\n"
+ "DP4 R1.x, R1, c[7];\n"
+ "MAD result.color, R1.x, R2, R0;\n"
"END\n"
;
static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_LINEAR_COMPOSITION_MODES_SIMPLE_PORTER_DUFF_NOMASK =
"!!ARBfp1.0\n"
- "PARAM c[8] = { program.local[0..4],\n"
- " { 1 },\n"
- " program.local[6..7] };\n"
+ "PARAM c[8] = { program.local[0..6],\n"
+ " { 1 } };\n"
"TEMP R0;\n"
"TEMP R1;\n"
"TEMP R2;\n"
"TEMP R3;\n"
- "MUL R0.xyz, fragment.position.y, c[1];\n"
- "MAD R0.xyz, fragment.position.x, c[0], R0;\n"
- "ADD R0.xyz, R0, c[2];\n"
+ "MUL R0.xyz, fragment.position.y, c[2];\n"
+ "MAD R0.xyz, fragment.position.x, c[1], R0;\n"
+ "ADD R0.xyz, R0, c[3];\n"
"RCP R0.z, R0.z;\n"
"MUL R0.xy, R0, R0.z;\n"
- "MUL R0.xy, R0, c[3];\n"
+ "MUL R0.xy, R0, c[0];\n"
"ADD R0.x, R0, R0.y;\n"
- "MUL R0.zw, fragment.position.xyxy, c[4].xyxy;\n"
+ "MUL R0.zw, fragment.position.xyxy, c[6].xyxy;\n"
"TEX R1, R0.zwzw, texture[0], 2D;\n"
- "MUL R2.xyz, R1, c[7].y;\n"
- "MUL R0.x, R0, c[3].z;\n"
+ "MUL R2.xyz, R1, c[4].y;\n"
+ "MUL R0.x, R0, c[0].z;\n"
"TEX R0, R0, texture[1], 1D;\n"
- "MUL R3.xyz, R2, R0.w;\n"
- "MUL R2.xyz, R0, c[7].x;\n"
- "MAD R2.xyz, R2, R1.w, R3;\n"
- "MUL R0.xyz, R0, c[6].y;\n"
- "ADD R2.w, -R1, c[5].x;\n"
- "MAD R0.xyz, R0, R2.w, R2;\n"
- "ADD R2.x, -R0.w, c[5];\n"
- "MUL R1.xyz, R1, c[6].z;\n"
- "MAD result.color.xyz, R1, R2.x, R0;\n"
- "ADD R0.y, -R1.w, c[5].x;\n"
+ "MUL R3.xyz, R0.w, R2;\n"
+ "MUL R2.xyz, R0, c[4].x;\n"
+ "MAD R2.xyz, R1.w, R2, R3;\n"
+ "ADD R2.w, -R1, c[7].x;\n"
+ "MUL R0.xyz, R0, c[5].y;\n"
+ "MAD R0.xyz, R2.w, R0, R2;\n"
+ "ADD R2.x, -R0.w, c[7];\n"
+ "MUL R1.xyz, R1, c[5].z;\n"
+ "MAD result.color.xyz, R2.x, R1, R0;\n"
"MUL R0.x, R0.w, R1.w;\n"
"MUL R0.z, R1.w, R2.x;\n"
- "MUL R0.y, R0.w, R0;\n"
- "DP3 result.color.w, R0, c[6];\n"
+ "MUL R0.y, R0.w, R2.w;\n"
+ "DP3 result.color.w, R0, c[5];\n"
"END\n"
;
@@ -4591,16 +4485,16 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_LINEAR_COMPOSITION_MOD
"TEMP R0;\n"
"TEMP R1;\n"
"TEMP R2;\n"
- "MUL R0.xyz, fragment.position.y, c[1];\n"
- "MAD R0.xyz, fragment.position.x, c[0], R0;\n"
- "ADD R0.xyz, R0, c[2];\n"
+ "MUL R0.xyz, fragment.position.y, c[2];\n"
+ "MAD R0.xyz, fragment.position.x, c[1], R0;\n"
+ "ADD R0.xyz, R0, c[3];\n"
"RCP R0.z, R0.z;\n"
"MUL R0.xy, R0, R0.z;\n"
- "MUL R0.xy, R0, c[3];\n"
+ "MUL R0.xy, R0, c[0];\n"
"ADD R0.x, R0, R0.y;\n"
"MUL R0.zw, fragment.position.xyxy, c[4].xyxy;\n"
"TEX R1, R0.zwzw, texture[0], 2D;\n"
- "MUL R0.x, R0, c[3].z;\n"
+ "MUL R0.x, R0, c[0].z;\n"
"TEX R0, R0, texture[1], 1D;\n"
"ADD R2.x, -R1.w, c[5];\n"
"MUL R2.xyz, R0, R2.x;\n"
@@ -4618,16 +4512,16 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_LINEAR_COMPOSITION_MOD
"TEMP R0;\n"
"TEMP R1;\n"
"TEMP R2;\n"
- "MUL R0.xyz, fragment.position.y, c[1];\n"
- "MAD R0.xyz, fragment.position.x, c[0], R0;\n"
- "ADD R0.xyz, R0, c[2];\n"
+ "MUL R0.xyz, fragment.position.y, c[2];\n"
+ "MAD R0.xyz, fragment.position.x, c[1], R0;\n"
+ "ADD R0.xyz, R0, c[3];\n"
"RCP R0.z, R0.z;\n"
"MUL R0.xy, R0, R0.z;\n"
- "MUL R0.xy, R0, c[3];\n"
+ "MUL R0.xy, R0, c[0];\n"
"ADD R0.x, R0, R0.y;\n"
"MUL R0.zw, fragment.position.xyxy, c[4].xyxy;\n"
"TEX R1, R0.zwzw, texture[0], 2D;\n"
- "MUL R0.x, R0, c[3].z;\n"
+ "MUL R0.x, R0, c[0].z;\n"
"TEX R0, R0, texture[1], 1D;\n"
"ADD R2, R0, R1;\n"
"MAD result.color, -R0, R1, R2;\n"
@@ -4642,14 +4536,14 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_LINEAR_COMPOSITION_MOD
"TEMP R1;\n"
"TEMP R2;\n"
"TEMP R3;\n"
- "MUL R0.xyz, fragment.position.y, c[1];\n"
- "MAD R0.xyz, fragment.position.x, c[0], R0;\n"
- "ADD R0.xyz, R0, c[2];\n"
+ "MUL R0.xyz, fragment.position.y, c[2];\n"
+ "MAD R0.xyz, fragment.position.x, c[1], R0;\n"
+ "ADD R0.xyz, R0, c[3];\n"
"RCP R0.z, R0.z;\n"
"MUL R0.xy, R0, R0.z;\n"
- "MUL R0.xy, R0, c[3];\n"
+ "MUL R0.xy, R0, c[0];\n"
"ADD R0.x, R0, R0.y;\n"
- "MUL R0.x, R0, c[3].z;\n"
+ "MUL R0.x, R0, c[0].z;\n"
"TEX R0, R0, texture[1], 1D;\n"
"MUL R1.xy, fragment.position, c[4];\n"
"TEX R1, R1, texture[0], 2D;\n"
@@ -4683,19 +4577,19 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_LINEAR_COMPOSITION_MOD
"TEMP R1;\n"
"TEMP R2;\n"
"TEMP R3;\n"
- "MUL R0.xyz, fragment.position.y, c[1];\n"
- "MAD R0.xyz, fragment.position.x, c[0], R0;\n"
- "ADD R0.xyz, R0, c[2];\n"
+ "MUL R0.xyz, fragment.position.y, c[2];\n"
+ "MAD R0.xyz, fragment.position.x, c[1], R0;\n"
+ "ADD R0.xyz, R0, c[3];\n"
"RCP R0.z, R0.z;\n"
"MUL R0.xy, R0, R0.z;\n"
- "MUL R0.xy, R0, c[3];\n"
+ "MUL R0.xy, R0, c[0];\n"
"ADD R0.x, R0, R0.y;\n"
- "MUL R0.x, R0, c[3].z;\n"
- "MUL R1.xy, fragment.position, c[4];\n"
- "TEX R1, R1, texture[0], 2D;\n"
+ "MUL R0.zw, fragment.position.xyxy, c[4].xyxy;\n"
+ "TEX R1, R0.zwzw, texture[0], 2D;\n"
+ "MUL R0.x, R0, c[0].z;\n"
"TEX R0, R0, texture[1], 1D;\n"
"MUL R2.xyz, R0, R1.w;\n"
- "MUL R3.xyz, R1, R0.w;\n"
+ "MUL R3.xyz, R0.w, R1;\n"
"MIN R2.xyz, R2, R3;\n"
"ADD R2.w, -R1, c[5].x;\n"
"MAD R0.xyz, R0, R2.w, R2;\n"
@@ -4714,19 +4608,19 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_LINEAR_COMPOSITION_MOD
"TEMP R1;\n"
"TEMP R2;\n"
"TEMP R3;\n"
- "MUL R0.xyz, fragment.position.y, c[1];\n"
- "MAD R0.xyz, fragment.position.x, c[0], R0;\n"
- "ADD R0.xyz, R0, c[2];\n"
+ "MUL R0.xyz, fragment.position.y, c[2];\n"
+ "MAD R0.xyz, fragment.position.x, c[1], R0;\n"
+ "ADD R0.xyz, R0, c[3];\n"
"RCP R0.z, R0.z;\n"
"MUL R0.xy, R0, R0.z;\n"
- "MUL R0.xy, R0, c[3];\n"
+ "MUL R0.xy, R0, c[0];\n"
"ADD R0.x, R0, R0.y;\n"
- "MUL R0.x, R0, c[3].z;\n"
- "MUL R1.xy, fragment.position, c[4];\n"
- "TEX R1, R1, texture[0], 2D;\n"
+ "MUL R0.zw, fragment.position.xyxy, c[4].xyxy;\n"
+ "TEX R1, R0.zwzw, texture[0], 2D;\n"
+ "MUL R0.x, R0, c[0].z;\n"
"TEX R0, R0, texture[1], 1D;\n"
"MUL R2.xyz, R0, R1.w;\n"
- "MUL R3.xyz, R1, R0.w;\n"
+ "MUL R3.xyz, R0.w, R1;\n"
"MAX R2.xyz, R2, R3;\n"
"ADD R2.w, -R1, c[5].x;\n"
"MAD R0.xyz, R0, R2.w, R2;\n"
@@ -4740,19 +4634,19 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_LINEAR_COMPOSITION_MOD
static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_LINEAR_COMPOSITION_MODES_COLORDODGE_NOMASK =
"!!ARBfp1.0\n"
"PARAM c[6] = { program.local[0..4],\n"
- " { 1, 1e-06 } };\n"
+ " { 1, 1e-006 } };\n"
"TEMP R0;\n"
"TEMP R1;\n"
"TEMP R2;\n"
"TEMP R3;\n"
- "MUL R0.xyz, fragment.position.y, c[1];\n"
- "MAD R0.xyz, fragment.position.x, c[0], R0;\n"
- "ADD R0.xyz, R0, c[2];\n"
+ "MUL R0.xyz, fragment.position.y, c[2];\n"
+ "MAD R0.xyz, fragment.position.x, c[1], R0;\n"
+ "ADD R0.xyz, R0, c[3];\n"
"RCP R0.z, R0.z;\n"
"MUL R0.xy, R0, R0.z;\n"
- "MUL R0.xy, R0, c[3];\n"
+ "MUL R0.xy, R0, c[0];\n"
"ADD R0.x, R0, R0.y;\n"
- "MUL R0.x, R0, c[3].z;\n"
+ "MUL R0.x, R0, c[0].z;\n"
"TEX R0, R0, texture[1], 1D;\n"
"MAX R1.x, R0.w, c[5].y;\n"
"RCP R1.x, R1.x;\n"
@@ -4764,7 +4658,7 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_LINEAR_COMPOSITION_MOD
"MUL R2.xyz, R1, R2.x;\n"
"ADD R2.w, -R1, c[5].x;\n"
"MAD R2.xyz, R0, R2.w, R2;\n"
- "MUL R1.xyz, R1, R0.w;\n"
+ "MUL R1.xyz, R0.w, R1;\n"
"MAD R0.xyz, R0, R1.w, R1;\n"
"MUL R2.w, R0, R1;\n"
"RCP R3.x, R3.x;\n"
@@ -4783,25 +4677,25 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_LINEAR_COMPOSITION_MOD
static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_LINEAR_COMPOSITION_MODES_COLORBURN_NOMASK =
"!!ARBfp1.0\n"
"PARAM c[6] = { program.local[0..4],\n"
- " { 1, 9.9999997e-06 } };\n"
+ " { 1, 9.9999997e-006 } };\n"
"TEMP R0;\n"
"TEMP R1;\n"
"TEMP R2;\n"
"TEMP R3;\n"
"TEMP R4;\n"
"TEMP R5;\n"
- "MUL R0.xyz, fragment.position.y, c[1];\n"
- "MAD R0.xyz, fragment.position.x, c[0], R0;\n"
- "ADD R0.xyz, R0, c[2];\n"
+ "MUL R0.xyz, fragment.position.y, c[2];\n"
+ "MAD R0.xyz, fragment.position.x, c[1], R0;\n"
+ "ADD R0.xyz, R0, c[3];\n"
"RCP R0.z, R0.z;\n"
"MUL R0.xy, R0, R0.z;\n"
- "MUL R0.xy, R0, c[3];\n"
+ "MUL R0.xy, R0, c[0];\n"
"ADD R0.x, R0, R0.y;\n"
- "MUL R0.x, R0, c[3].z;\n"
+ "MUL R0.zw, fragment.position.xyxy, c[4].xyxy;\n"
+ "TEX R1, R0.zwzw, texture[0], 2D;\n"
+ "MUL R0.x, R0, c[0].z;\n"
"TEX R0, R0, texture[1], 1D;\n"
- "MUL R1.xy, fragment.position, c[4];\n"
- "TEX R1, R1, texture[0], 2D;\n"
- "MUL R2.xyz, R1, R0.w;\n"
+ "MUL R2.xyz, R0.w, R1;\n"
"MAD R3.xyz, R0, R1.w, R2;\n"
"ADD R2.w, -R1, c[5].x;\n"
"MAD R2.xyz, -R0.w, R1.w, R3;\n"
@@ -4814,9 +4708,8 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_LINEAR_COMPOSITION_MOD
"RCP R2.z, R2.z;\n"
"MAD R2.xyz, R4, R2, R5;\n"
"MUL R4.xyz, R1, R3.w;\n"
- "MAD R0.xyz, R0, R2.w, R4;\n"
- "ADD R3.w, -R0, c[5].x;\n"
"MAD R1.xyz, R1, R3.w, R2;\n"
+ "MAD R0.xyz, R0, R2.w, R4;\n"
"MUL R2.x, R0.w, R1.w;\n"
"ADD R2.w, R0, R1;\n"
"ADD R1.xyz, R1, -R0;\n"
@@ -4835,14 +4728,14 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_LINEAR_COMPOSITION_MOD
"TEMP R2;\n"
"TEMP R3;\n"
"TEMP R4;\n"
- "MUL R0.xyz, fragment.position.y, c[1];\n"
- "MAD R0.xyz, fragment.position.x, c[0], R0;\n"
- "ADD R0.xyz, R0, c[2];\n"
+ "MUL R0.xyz, fragment.position.y, c[2];\n"
+ "MAD R0.xyz, fragment.position.x, c[1], R0;\n"
+ "ADD R0.xyz, R0, c[3];\n"
"RCP R0.z, R0.z;\n"
"MUL R0.xy, R0, R0.z;\n"
- "MUL R0.xy, R0, c[3];\n"
+ "MUL R0.xy, R0, c[0];\n"
"ADD R0.x, R0, R0.y;\n"
- "MUL R0.x, R0, c[3].z;\n"
+ "MUL R0.x, R0, c[0].z;\n"
"TEX R0, R0, texture[1], 1D;\n"
"MUL R1.xy, fragment.position, c[4];\n"
"TEX R1, R1, texture[0], 2D;\n"
@@ -4871,8 +4764,8 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_LINEAR_COMPOSITION_MOD
static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_LINEAR_COMPOSITION_MODES_SOFTLIGHT_NOMASK =
"!!ARBfp1.0\n"
"PARAM c[7] = { program.local[0..4],\n"
- " { 1, 9.9999997e-06, 2, 8 },\n"
- " { 3 } };\n"
+ " { 1, 9.9999997e-006, 2, 3 },\n"
+ " { 8 } };\n"
"TEMP R0;\n"
"TEMP R1;\n"
"TEMP R2;\n"
@@ -4880,8 +4773,8 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_LINEAR_COMPOSITION_MOD
"TEMP R4;\n"
"TEMP R5;\n"
"TEMP R6;\n"
- "MUL R2.xyz, fragment.position.y, c[1];\n"
- "MAD R3.xyz, fragment.position.x, c[0], R2;\n"
+ "MUL R2.xyz, fragment.position.y, c[2];\n"
+ "MAD R3.xyz, fragment.position.x, c[1], R2;\n"
"MUL R0.xy, fragment.position, c[4];\n"
"TEX R1, R0, texture[0], 2D;\n"
"MAX R0.x, R1.w, c[5].y;\n"
@@ -4889,39 +4782,37 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_LINEAR_COMPOSITION_MOD
"MUL R0.xyz, R1, R2.w;\n"
"RSQ R0.w, R0.x;\n"
"RSQ R2.y, R0.y;\n"
- "ADD R3.xyz, R3, c[2];\n"
+ "ADD R3.xyz, R3, c[3];\n"
"RCP R2.x, R0.w;\n"
"RCP R0.w, R3.z;\n"
"MUL R3.xy, R3, R0.w;\n"
"RSQ R0.w, R0.z;\n"
"RCP R2.z, R0.w;\n"
"RCP R2.y, R2.y;\n"
- "MAD R6.xyz, R2, R1.w, -R1;\n"
- "MUL R2.xyz, -R0, c[5].w;\n"
- "ADD R5.xyz, R2, c[6].x;\n"
+ "MAD R6.xyz, R1.w, R2, -R1;\n"
+ "MUL R2.xyz, -R0, c[6].x;\n"
+ "ADD R5.xyz, R2, c[5].w;\n"
"MAD R2.xyz, -R1, R2.w, c[5].x;\n"
- "MUL R3.xy, R3, c[3];\n"
+ "MUL R3.xy, R3, c[0];\n"
"ADD R0.w, R3.x, R3.y;\n"
- "MUL R0.w, R0, c[3].z;\n"
+ "MUL R0.w, R0, c[0].z;\n"
"TEX R0, R0.w, texture[1], 1D;\n"
"MAD R3.xyz, R0, c[5].z, -R0.w;\n"
"MUL R4.xyz, R2, R3;\n"
"MAD R4.xyz, -R4, R5, R0.w;\n"
"MUL R5.xyz, R6, R3;\n"
"MAD R2.xyz, -R2, R3, R0.w;\n"
- "MAD R6.xyz, R1, R0.w, R5;\n"
"MUL R4.xyz, R1, R4;\n"
- "MUL R5.xyz, R1, c[5].w;\n"
- "ADD R6.xyz, R6, -R4;\n"
- "SGE R5.xyz, R5, R1.w;\n"
- "MUL R5.xyz, R5, R6;\n"
- "ADD R3.xyz, R4, R5;\n"
+ "MAD R5.xyz, R0.w, R1, R5;\n"
+ "ADD R6.xyz, R5, -R4;\n"
+ "MUL R5.xyz, R1, c[6].x;\n"
+ "SGE R3.xyz, R5, R1.w;\n"
+ "MAD R3.xyz, R3, R6, R4;\n"
"MUL R2.xyz, R1, R2;\n"
"MUL R4.xyz, R0, c[5].z;\n"
"ADD R3.xyz, R3, -R2;\n"
"SGE R4.xyz, R4, R0.w;\n"
- "MUL R3.xyz, R4, R3;\n"
- "ADD R2.xyz, R2, R3;\n"
+ "MAD R2.xyz, R4, R3, R2;\n"
"ADD R2.w, -R1, c[5].x;\n"
"MAD R0.xyz, R0, R2.w, R2;\n"
"ADD R2.x, R0.w, R1.w;\n"
@@ -4939,19 +4830,19 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_LINEAR_COMPOSITION_MOD
"TEMP R1;\n"
"TEMP R2;\n"
"TEMP R3;\n"
- "MUL R0.xyz, fragment.position.y, c[1];\n"
- "MAD R0.xyz, fragment.position.x, c[0], R0;\n"
- "ADD R0.xyz, R0, c[2];\n"
+ "MUL R0.xyz, fragment.position.y, c[2];\n"
+ "MAD R0.xyz, fragment.position.x, c[1], R0;\n"
+ "ADD R0.xyz, R0, c[3];\n"
"RCP R0.z, R0.z;\n"
"MUL R0.xy, R0, R0.z;\n"
- "MUL R0.xy, R0, c[3];\n"
+ "MUL R0.xy, R0, c[0];\n"
"ADD R0.x, R0, R0.y;\n"
- "MUL R0.x, R0, c[3].z;\n"
- "MUL R1.xy, fragment.position, c[4];\n"
+ "MUL R0.zw, fragment.position.xyxy, c[4].xyxy;\n"
+ "TEX R1, R0.zwzw, texture[0], 2D;\n"
+ "MUL R0.x, R0, c[0].z;\n"
"TEX R0, R0, texture[1], 1D;\n"
- "TEX R1, R1, texture[0], 2D;\n"
"MUL R2.xyz, R0, R1.w;\n"
- "MUL R3.xyz, R1, R0.w;\n"
+ "MUL R3.xyz, R0.w, R1;\n"
"ADD R0.xyz, R0, R1;\n"
"MIN R2.xyz, R2, R3;\n"
"ADD R1.x, R0.w, R1.w;\n"
@@ -4963,30 +4854,30 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_LINEAR_COMPOSITION_MOD
static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_LINEAR_COMPOSITION_MODES_EXCLUSION_NOMASK =
"!!ARBfp1.0\n"
"PARAM c[6] = { program.local[0..4],\n"
- " { 1, 2 } };\n"
+ " { 2, 1 } };\n"
"TEMP R0;\n"
"TEMP R1;\n"
"TEMP R2;\n"
"TEMP R3;\n"
- "MUL R0.xyz, fragment.position.y, c[1];\n"
- "MAD R0.xyz, fragment.position.x, c[0], R0;\n"
- "ADD R0.xyz, R0, c[2];\n"
+ "MUL R0.xyz, fragment.position.y, c[2];\n"
+ "MAD R0.xyz, fragment.position.x, c[1], R0;\n"
+ "ADD R0.xyz, R0, c[3];\n"
"RCP R0.z, R0.z;\n"
"MUL R0.xy, R0, R0.z;\n"
- "MUL R0.xy, R0, c[3];\n"
+ "MUL R0.xy, R0, c[0];\n"
"ADD R0.x, R0, R0.y;\n"
- "MUL R0.x, R0, c[3].z;\n"
- "MUL R1.xy, fragment.position, c[4];\n"
- "TEX R1, R1, texture[0], 2D;\n"
+ "MUL R0.zw, fragment.position.xyxy, c[4].xyxy;\n"
+ "TEX R1, R0.zwzw, texture[0], 2D;\n"
+ "MUL R0.x, R0, c[0].z;\n"
"TEX R0, R0, texture[1], 1D;\n"
- "MUL R2.xyz, R1, R0.w;\n"
+ "MUL R2.xyz, R0.w, R1;\n"
"MAD R3.xyz, R0, R1.w, R2;\n"
"MUL R2.xyz, R0, R1;\n"
- "MAD R2.xyz, -R2, c[5].y, R3;\n"
- "ADD R2.w, -R1, c[5].x;\n"
+ "MAD R2.xyz, -R2, c[5].x, R3;\n"
+ "ADD R2.w, -R1, c[5].y;\n"
"MAD R0.xyz, R0, R2.w, R2;\n"
"ADD R2.x, R0.w, R1.w;\n"
- "ADD R2.y, -R0.w, c[5].x;\n"
+ "ADD R2.y, -R0.w, c[5];\n"
"MAD result.color.xyz, R1, R2.y, R0;\n"
"MAD result.color.w, -R0, R1, R2.x;\n"
"END\n"
@@ -4997,18 +4888,18 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_LINEAR_COMPOSITION_MOD
"PARAM c[7] = { program.local[0..6] };\n"
"TEMP R0;\n"
"TEMP R1;\n"
- "MUL R0.xyz, fragment.position.y, c[1];\n"
- "MAD R0.xyz, fragment.position.x, c[0], R0;\n"
- "ADD R0.xyz, R0, c[2];\n"
+ "MUL R0.xyz, fragment.position.y, c[2];\n"
+ "MAD R0.xyz, fragment.position.x, c[1], R0;\n"
+ "ADD R0.xyz, R0, c[3];\n"
"RCP R0.z, R0.z;\n"
"MUL R0.zw, R0.xyxy, R0.z;\n"
- "MUL R0.zw, R0, c[3].xyxy;\n"
+ "MUL R0.zw, R0, c[0].xyxy;\n"
"ADD R1.x, R0.z, R0.w;\n"
- "ADD R0.xy, fragment.position, c[4];\n"
- "MUL R0.xy, R0, c[5];\n"
+ "ADD R0.xy, fragment.position, c[5];\n"
+ "MUL R0.xy, R0, c[4];\n"
"TEX R0, R0, texture[0], 2D;\n"
"DP4 R1.y, R0, c[6];\n"
- "MUL R1.x, R1, c[3].z;\n"
+ "MUL R1.x, R1, c[0].z;\n"
"TEX R0, R1, texture[1], 1D;\n"
"MUL result.color, R0, R1.y;\n"
"END\n"
@@ -5018,58 +4909,55 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_LINEAR_COMPOSITION_MOD
"!!ARBfp1.0\n"
"PARAM c[4] = { program.local[0..3] };\n"
"TEMP R0;\n"
- "MUL R0.xyz, fragment.position.y, c[1];\n"
- "MAD R0.xyz, fragment.position.x, c[0], R0;\n"
- "ADD R0.xyz, R0, c[2];\n"
+ "MUL R0.xyz, fragment.position.y, c[2];\n"
+ "MAD R0.xyz, fragment.position.x, c[1], R0;\n"
+ "ADD R0.xyz, R0, c[3];\n"
"RCP R0.z, R0.z;\n"
"MUL R0.xy, R0, R0.z;\n"
- "MUL R0.xy, R0, c[3];\n"
+ "MUL R0.xy, R0, c[0];\n"
"ADD R0.x, R0, R0.y;\n"
- "MUL R0.x, R0, c[3].z;\n"
+ "MUL R0.x, R0, c[0].z;\n"
"TEX result.color, R0, texture[0], 1D;\n"
"END\n"
;
static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_TEXTURE_COMPOSITION_MODES_SIMPLE_PORTER_DUFF =
"!!ARBfp1.0\n"
- "PARAM c[11] = { program.local[0..7],\n"
- " { 1 },\n"
- " program.local[9..10] };\n"
+ "PARAM c[11] = { program.local[0..9],\n"
+ " { 1 } };\n"
"TEMP R0;\n"
"TEMP R1;\n"
"TEMP R2;\n"
"TEMP R3;\n"
- "MUL R0.xyz, fragment.position.y, c[4];\n"
- "MAD R0.xyz, fragment.position.x, c[3], R0;\n"
- "ADD R0.xyz, R0, c[5];\n"
- "RCP R0.z, R0.z;\n"
- "MUL R0.xy, R0, R0.z;\n"
- "MUL R0.xy, R0, c[6];\n"
- "MUL R0.zw, fragment.position.xyxy, c[7].xyxy;\n"
- "TEX R1, R0.zwzw, texture[0], 2D;\n"
- "MOV R0.y, -R0;\n"
- "TEX R0, R0, texture[2], 2D;\n"
- "MUL R2.xyz, R1, c[10].y;\n"
- "MUL R3.xyz, R2, R0.w;\n"
- "MUL R2.xyz, R0, c[10].x;\n"
- "MAD R2.xyz, R2, R1.w, R3;\n"
- "ADD R3.xy, fragment.position, c[0];\n"
- "MUL R0.xyz, R0, c[9].y;\n"
- "ADD R2.w, -R1, c[8].x;\n"
- "MAD R2.xyz, R0, R2.w, R2;\n"
- "ADD R2.w, -R0, c[8].x;\n"
- "MUL R0.xyz, R1, c[9].z;\n"
- "MAD R2.xyz, R0, R2.w, R2;\n"
- "ADD R0.y, -R1.w, c[8].x;\n"
- "MUL R0.z, R1.w, R2.w;\n"
- "MUL R0.x, R0.w, R1.w;\n"
- "MUL R0.y, R0.w, R0;\n"
- "DP3 R2.w, R0, c[9];\n"
- "MUL R3.xy, R3, c[1];\n"
- "TEX R0, R3, texture[1], 2D;\n"
- "ADD R2, R2, -R1;\n"
- "DP4 R0.x, R0, c[2];\n"
- "MAD result.color, R0.x, R2, R1;\n"
+ "MUL R0.xyz, fragment.position.y, c[2];\n"
+ "MAD R0.xyz, fragment.position.x, c[1], R0;\n"
+ "ADD R1.xyz, R0, c[3];\n"
+ "RCP R0.z, R1.z;\n"
+ "MUL R1.xy, R1, R0.z;\n"
+ "MUL R0.xy, fragment.position, c[7];\n"
+ "TEX R0, R0, texture[0], 2D;\n"
+ "MUL R1.xy, R1, c[0];\n"
+ "TEX R1, R1, texture[2], 2D;\n"
+ "MUL R2.xyz, R0, c[4].y;\n"
+ "MUL R3.xyz, R1.w, R2;\n"
+ "MUL R2.xyz, R1, c[4].x;\n"
+ "MAD R2.xyz, R0.w, R2, R3;\n"
+ "ADD R3.xy, fragment.position, c[8];\n"
+ "ADD R2.w, -R0, c[10].x;\n"
+ "MUL R1.xyz, R1, c[5].y;\n"
+ "MAD R2.xyz, R2.w, R1, R2;\n"
+ "MUL R1.xyz, R0, c[5].z;\n"
+ "ADD R3.z, -R1.w, c[10].x;\n"
+ "MAD R2.xyz, R3.z, R1, R2;\n"
+ "MUL R1.y, R1.w, R2.w;\n"
+ "MUL R1.x, R1.w, R0.w;\n"
+ "MUL R1.z, R0.w, R3;\n"
+ "DP3 R2.w, R1, c[5];\n"
+ "MUL R3.xy, R3, c[6];\n"
+ "TEX R1, R3, texture[1], 2D;\n"
+ "ADD R2, R2, -R0;\n"
+ "DP4 R1.x, R1, c[9];\n"
+ "MAD result.color, R1.x, R2, R0;\n"
"END\n"
;
@@ -5080,29 +4968,28 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_TEXTURE_COMPOSITION_MO
"TEMP R0;\n"
"TEMP R1;\n"
"TEMP R2;\n"
- "MUL R0.xyz, fragment.position.y, c[4];\n"
- "MAD R0.xyz, fragment.position.x, c[3], R0;\n"
- "ADD R0.xyz, R0, c[5];\n"
- "RCP R1.x, R0.z;\n"
- "MUL R0.xy, R0, R1.x;\n"
- "MUL R0.xy, R0, c[6];\n"
- "MUL R0.zw, fragment.position.xyxy, c[7].xyxy;\n"
- "TEX R1, R0.zwzw, texture[0], 2D;\n"
- "MOV R0.y, -R0;\n"
- "TEX R0, R0, texture[2], 2D;\n"
- "ADD R2.x, -R1.w, c[8];\n"
- "MUL R2.xyz, R0, R2.x;\n"
- "MAD R0.xyz, R0, R1, R2;\n"
+ "MUL R0.xyz, fragment.position.y, c[2];\n"
+ "MAD R0.xyz, fragment.position.x, c[1], R0;\n"
+ "ADD R1.xyz, R0, c[3];\n"
+ "RCP R0.z, R1.z;\n"
+ "MUL R1.xy, R1, R0.z;\n"
+ "MUL R0.xy, fragment.position, c[5];\n"
+ "TEX R0, R0, texture[0], 2D;\n"
+ "MUL R1.xy, R1, c[0];\n"
+ "TEX R1, R1, texture[2], 2D;\n"
"ADD R2.x, -R0.w, c[8];\n"
- "MAD R2.xyz, R1, R2.x, R0;\n"
- "ADD R0.z, R0.w, R1.w;\n"
- "MAD R2.w, -R0, R1, R0.z;\n"
- "ADD R0.xy, fragment.position, c[0];\n"
- "MUL R0.xy, R0, c[1];\n"
- "TEX R0, R0, texture[1], 2D;\n"
- "ADD R2, R2, -R1;\n"
- "DP4 R0.x, R0, c[2];\n"
- "MAD result.color, R0.x, R2, R1;\n"
+ "MUL R2.xyz, R1, R2.x;\n"
+ "MAD R1.xyz, R1, R0, R2;\n"
+ "ADD R2.x, -R1.w, c[8];\n"
+ "MAD R2.xyz, R0, R2.x, R1;\n"
+ "ADD R1.z, R1.w, R0.w;\n"
+ "MAD R2.w, -R1, R0, R1.z;\n"
+ "ADD R1.xy, fragment.position, c[6];\n"
+ "MUL R1.xy, R1, c[4];\n"
+ "TEX R1, R1, texture[1], 2D;\n"
+ "ADD R2, R2, -R0;\n"
+ "DP4 R1.x, R1, c[7];\n"
+ "MAD result.color, R1.x, R2, R0;\n"
"END\n"
;
@@ -5113,24 +5000,23 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_TEXTURE_COMPOSITION_MO
"TEMP R1;\n"
"TEMP R2;\n"
"TEMP R3;\n"
- "MUL R0.xyz, fragment.position.y, c[4];\n"
- "MAD R0.xyz, fragment.position.x, c[3], R0;\n"
- "ADD R0.xyz, R0, c[5];\n"
+ "MUL R0.xyz, fragment.position.y, c[2];\n"
+ "MAD R0.xyz, fragment.position.x, c[1], R0;\n"
+ "ADD R0.xyz, R0, c[3];\n"
"RCP R0.z, R0.z;\n"
"MUL R0.xy, R0, R0.z;\n"
- "MUL R0.xy, R0, c[6];\n"
- "MOV R0.y, -R0;\n"
- "MUL R1.xy, fragment.position, c[7];\n"
- "ADD R3.xy, fragment.position, c[0];\n"
- "TEX R1, R1, texture[0], 2D;\n"
- "TEX R0, R0, texture[2], 2D;\n"
- "ADD R2, R0, R1;\n"
- "MAD R2, -R0, R1, R2;\n"
- "MUL R3.xy, R3, c[1];\n"
- "TEX R0, R3, texture[1], 2D;\n"
- "ADD R2, R2, -R1;\n"
- "DP4 R0.x, R0, c[2];\n"
- "MAD result.color, R0.x, R2, R1;\n"
+ "MUL R0.zw, R0.xyxy, c[0].xyxy;\n"
+ "ADD R3.xy, fragment.position, c[6];\n"
+ "TEX R1, R0.zwzw, texture[2], 2D;\n"
+ "MUL R0.xy, fragment.position, c[5];\n"
+ "TEX R0, R0, texture[0], 2D;\n"
+ "ADD R2, R1, R0;\n"
+ "MAD R2, -R1, R0, R2;\n"
+ "MUL R3.xy, R3, c[4];\n"
+ "TEX R1, R3, texture[1], 2D;\n"
+ "ADD R2, R2, -R0;\n"
+ "DP4 R1.x, R1, c[7];\n"
+ "MAD result.color, R1.x, R2, R0;\n"
"END\n"
;
@@ -5143,15 +5029,14 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_TEXTURE_COMPOSITION_MO
"TEMP R2;\n"
"TEMP R3;\n"
"TEMP R4;\n"
- "MUL R0.xyz, fragment.position.y, c[4];\n"
- "MAD R0.xyz, fragment.position.x, c[3], R0;\n"
- "ADD R0.xyz, R0, c[5];\n"
+ "MUL R0.xyz, fragment.position.y, c[2];\n"
+ "MAD R0.xyz, fragment.position.x, c[1], R0;\n"
+ "ADD R0.xyz, R0, c[3];\n"
"RCP R0.z, R0.z;\n"
"MUL R0.xy, R0, R0.z;\n"
- "MUL R0.xy, R0, c[6];\n"
- "MOV R0.y, -R0;\n"
+ "MUL R0.xy, R0, c[0];\n"
"TEX R0, R0, texture[2], 2D;\n"
- "MUL R1.xy, fragment.position, c[7];\n"
+ "MUL R1.xy, fragment.position, c[5];\n"
"TEX R1, R1, texture[0], 2D;\n"
"ADD R2.w, -R1, c[8].y;\n"
"ADD R3.xyz, R0.w, -R0;\n"
@@ -5172,11 +5057,11 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_TEXTURE_COMPOSITION_MO
"MAD R2.xyz, R2, R0, R3;\n"
"ADD R0.z, R0.w, R1.w;\n"
"MAD R2.w, -R0, R1, R0.z;\n"
- "ADD R0.xy, fragment.position, c[0];\n"
- "MUL R0.xy, R0, c[1];\n"
+ "ADD R0.xy, fragment.position, c[6];\n"
+ "MUL R0.xy, R0, c[4];\n"
"TEX R0, R0, texture[1], 2D;\n"
"ADD R2, R2, -R1;\n"
- "DP4 R0.x, R0, c[2];\n"
+ "DP4 R0.x, R0, c[7];\n"
"MAD result.color, R0.x, R2, R1;\n"
"END\n"
;
@@ -5189,31 +5074,30 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_TEXTURE_COMPOSITION_MO
"TEMP R1;\n"
"TEMP R2;\n"
"TEMP R3;\n"
- "MUL R0.xyz, fragment.position.y, c[4];\n"
- "MAD R0.xyz, fragment.position.x, c[3], R0;\n"
- "ADD R0.xyz, R0, c[5];\n"
+ "MUL R0.xyz, fragment.position.y, c[2];\n"
+ "MAD R0.xyz, fragment.position.x, c[1], R0;\n"
+ "ADD R0.xyz, R0, c[3];\n"
"RCP R0.z, R0.z;\n"
- "MUL R0.xy, R0, R0.z;\n"
- "MUL R0.xy, R0, c[6];\n"
- "MOV R0.y, -R0;\n"
- "MUL R1.xy, fragment.position, c[7];\n"
- "TEX R1, R1, texture[0], 2D;\n"
- "TEX R0, R0, texture[2], 2D;\n"
- "MUL R3.xyz, R1, R0.w;\n"
- "MUL R2.xyz, R0, R1.w;\n"
+ "MUL R0.zw, R0.xyxy, R0.z;\n"
+ "MUL R1.xy, R0.zwzw, c[0];\n"
+ "MUL R0.xy, fragment.position, c[5];\n"
+ "TEX R0, R0, texture[0], 2D;\n"
+ "TEX R1, R1, texture[2], 2D;\n"
+ "MUL R3.xyz, R1.w, R0;\n"
+ "MUL R2.xyz, R1, R0.w;\n"
"MIN R2.xyz, R2, R3;\n"
- "ADD R2.w, -R1, c[8].x;\n"
- "MAD R0.xyz, R0, R2.w, R2;\n"
- "ADD R2.x, -R0.w, c[8];\n"
- "MAD R2.xyz, R1, R2.x, R0;\n"
- "ADD R0.z, R0.w, R1.w;\n"
- "MAD R2.w, -R0, R1, R0.z;\n"
- "ADD R0.xy, fragment.position, c[0];\n"
- "MUL R0.xy, R0, c[1];\n"
- "TEX R0, R0, texture[1], 2D;\n"
- "ADD R2, R2, -R1;\n"
- "DP4 R0.x, R0, c[2];\n"
- "MAD result.color, R0.x, R2, R1;\n"
+ "ADD R2.w, -R0, c[8].x;\n"
+ "MAD R1.xyz, R1, R2.w, R2;\n"
+ "ADD R2.x, -R1.w, c[8];\n"
+ "MAD R2.xyz, R0, R2.x, R1;\n"
+ "ADD R1.z, R1.w, R0.w;\n"
+ "MAD R2.w, -R1, R0, R1.z;\n"
+ "ADD R1.xy, fragment.position, c[6];\n"
+ "MUL R1.xy, R1, c[4];\n"
+ "TEX R1, R1, texture[1], 2D;\n"
+ "ADD R2, R2, -R0;\n"
+ "DP4 R1.x, R1, c[7];\n"
+ "MAD result.color, R1.x, R2, R0;\n"
"END\n"
;
@@ -5225,62 +5109,60 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_TEXTURE_COMPOSITION_MO
"TEMP R1;\n"
"TEMP R2;\n"
"TEMP R3;\n"
- "MUL R0.xyz, fragment.position.y, c[4];\n"
- "MAD R0.xyz, fragment.position.x, c[3], R0;\n"
- "ADD R0.xyz, R0, c[5];\n"
+ "MUL R0.xyz, fragment.position.y, c[2];\n"
+ "MAD R0.xyz, fragment.position.x, c[1], R0;\n"
+ "ADD R0.xyz, R0, c[3];\n"
"RCP R0.z, R0.z;\n"
- "MUL R0.xy, R0, R0.z;\n"
- "MUL R0.xy, R0, c[6];\n"
- "MOV R0.y, -R0;\n"
- "MUL R1.xy, fragment.position, c[7];\n"
- "TEX R1, R1, texture[0], 2D;\n"
- "TEX R0, R0, texture[2], 2D;\n"
- "MUL R3.xyz, R1, R0.w;\n"
- "MUL R2.xyz, R0, R1.w;\n"
+ "MUL R0.zw, R0.xyxy, R0.z;\n"
+ "MUL R1.xy, R0.zwzw, c[0];\n"
+ "MUL R0.xy, fragment.position, c[5];\n"
+ "TEX R0, R0, texture[0], 2D;\n"
+ "TEX R1, R1, texture[2], 2D;\n"
+ "MUL R3.xyz, R1.w, R0;\n"
+ "MUL R2.xyz, R1, R0.w;\n"
"MAX R2.xyz, R2, R3;\n"
- "ADD R2.w, -R1, c[8].x;\n"
- "MAD R0.xyz, R0, R2.w, R2;\n"
- "ADD R2.x, -R0.w, c[8];\n"
- "MAD R2.xyz, R1, R2.x, R0;\n"
- "ADD R0.z, R0.w, R1.w;\n"
- "MAD R2.w, -R0, R1, R0.z;\n"
- "ADD R0.xy, fragment.position, c[0];\n"
- "MUL R0.xy, R0, c[1];\n"
- "TEX R0, R0, texture[1], 2D;\n"
- "ADD R2, R2, -R1;\n"
- "DP4 R0.x, R0, c[2];\n"
- "MAD result.color, R0.x, R2, R1;\n"
+ "ADD R2.w, -R0, c[8].x;\n"
+ "MAD R1.xyz, R1, R2.w, R2;\n"
+ "ADD R2.x, -R1.w, c[8];\n"
+ "MAD R2.xyz, R0, R2.x, R1;\n"
+ "ADD R1.z, R1.w, R0.w;\n"
+ "MAD R2.w, -R1, R0, R1.z;\n"
+ "ADD R1.xy, fragment.position, c[6];\n"
+ "MUL R1.xy, R1, c[4];\n"
+ "TEX R1, R1, texture[1], 2D;\n"
+ "ADD R2, R2, -R0;\n"
+ "DP4 R1.x, R1, c[7];\n"
+ "MAD result.color, R1.x, R2, R0;\n"
"END\n"
;
static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_TEXTURE_COMPOSITION_MODES_COLORDODGE =
"!!ARBfp1.0\n"
"PARAM c[9] = { program.local[0..7],\n"
- " { 1, 1e-06 } };\n"
+ " { 1, 1e-006 } };\n"
"TEMP R0;\n"
"TEMP R1;\n"
"TEMP R2;\n"
"TEMP R3;\n"
"TEMP R4;\n"
- "MUL R0.xyz, fragment.position.y, c[4];\n"
- "MAD R0.xyz, fragment.position.x, c[3], R0;\n"
- "ADD R0.xyz, R0, c[5];\n"
+ "MUL R0.xyz, fragment.position.y, c[2];\n"
+ "MAD R0.xyz, fragment.position.x, c[1], R0;\n"
+ "ADD R0.xyz, R0, c[3];\n"
"RCP R0.z, R0.z;\n"
"MUL R0.xy, R0, R0.z;\n"
- "MUL R0.xy, R0, c[6];\n"
- "MOV R0.y, -R0;\n"
+ "MUL R0.xy, R0, c[0];\n"
"TEX R0, R0, texture[2], 2D;\n"
"MAX R1.x, R0.w, c[8].y;\n"
"RCP R1.x, R1.x;\n"
- "MAD R1.xyz, -R0, R1.x, c[8].x;\n"
- "MAX R2.xyz, R1, c[8].y;\n"
- "MUL R1.xy, fragment.position, c[7];\n"
+ "MAD R2.xyz, -R0, R1.x, c[8].x;\n"
+ "MAX R2.xyz, R2, c[8].y;\n"
+ "MUL R1.xy, fragment.position, c[5];\n"
"TEX R1, R1, texture[0], 2D;\n"
"ADD R2.w, -R0, c[8].x;\n"
"MUL R3.xyz, R1, R2.w;\n"
"ADD R2.w, -R1, c[8].x;\n"
"MAD R4.xyz, R0, R2.w, R3;\n"
- "MUL R3.xyz, R1, R0.w;\n"
+ "MUL R3.xyz, R0.w, R1;\n"
"MUL R2.w, R0, R1;\n"
"MAD R0.xyz, R0, R1.w, R3;\n"
"SGE R0.xyz, R0, R2.w;\n"
@@ -5293,11 +5175,11 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_TEXTURE_COMPOSITION_MO
"MAD R2.xyz, R0, R4, R2;\n"
"ADD R0.z, R0.w, R1.w;\n"
"MAD R2.w, -R0, R1, R0.z;\n"
- "ADD R0.xy, fragment.position, c[0];\n"
- "MUL R0.xy, R0, c[1];\n"
+ "ADD R0.xy, fragment.position, c[6];\n"
+ "MUL R0.xy, R0, c[4];\n"
"TEX R0, R0, texture[1], 2D;\n"
"ADD R2, R2, -R1;\n"
- "DP4 R0.x, R0, c[2];\n"
+ "DP4 R0.x, R0, c[7];\n"
"MAD result.color, R0.x, R2, R1;\n"
"END\n"
;
@@ -5305,24 +5187,23 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_TEXTURE_COMPOSITION_MO
static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_TEXTURE_COMPOSITION_MODES_COLORBURN =
"!!ARBfp1.0\n"
"PARAM c[9] = { program.local[0..7],\n"
- " { 1, 9.9999997e-06 } };\n"
+ " { 1, 9.9999997e-006 } };\n"
"TEMP R0;\n"
"TEMP R1;\n"
"TEMP R2;\n"
"TEMP R3;\n"
"TEMP R4;\n"
"TEMP R5;\n"
- "MUL R0.xyz, fragment.position.y, c[4];\n"
- "MAD R0.xyz, fragment.position.x, c[3], R0;\n"
- "ADD R0.xyz, R0, c[5];\n"
+ "MUL R0.xyz, fragment.position.y, c[2];\n"
+ "MAD R0.xyz, fragment.position.x, c[1], R0;\n"
+ "ADD R0.xyz, R0, c[3];\n"
"RCP R0.z, R0.z;\n"
"MUL R0.xy, R0, R0.z;\n"
- "MUL R0.xy, R0, c[6];\n"
- "MOV R0.y, -R0;\n"
+ "MUL R0.zw, fragment.position.xyxy, c[5].xyxy;\n"
+ "TEX R1, R0.zwzw, texture[0], 2D;\n"
+ "MUL R0.xy, R0, c[0];\n"
"TEX R0, R0, texture[2], 2D;\n"
- "MUL R1.xy, fragment.position, c[7];\n"
- "TEX R1, R1, texture[0], 2D;\n"
- "MUL R2.xyz, R1, R0.w;\n"
+ "MUL R2.xyz, R0.w, R1;\n"
"MAD R3.xyz, R0, R1.w, R2;\n"
"MAD R2.xyz, -R0.w, R1.w, R3;\n"
"MUL R4.xyz, R0.w, R2;\n"
@@ -5337,18 +5218,17 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_TEXTURE_COMPOSITION_MO
"MUL R4.xyz, R1, R3.w;\n"
"MAD R0.xyz, R0, R2.w, R4;\n"
"MUL R2.w, R0, R1;\n"
- "ADD R3.w, -R0, c[8].x;\n"
"MAD R2.xyz, R1, R3.w, R2;\n"
"ADD R2.xyz, R2, -R0;\n"
"SGE R3.xyz, R3, R2.w;\n"
"MAD R2.xyz, R3, R2, R0;\n"
"ADD R0.z, R0.w, R1.w;\n"
"MAD R2.w, -R0, R1, R0.z;\n"
- "ADD R0.xy, fragment.position, c[0];\n"
- "MUL R0.xy, R0, c[1];\n"
+ "ADD R0.xy, fragment.position, c[6];\n"
+ "MUL R0.xy, R0, c[4];\n"
"TEX R0, R0, texture[1], 2D;\n"
"ADD R2, R2, -R1;\n"
- "DP4 R0.x, R0, c[2];\n"
+ "DP4 R0.x, R0, c[7];\n"
"MAD result.color, R0.x, R2, R1;\n"
"END\n"
;
@@ -5362,15 +5242,14 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_TEXTURE_COMPOSITION_MO
"TEMP R2;\n"
"TEMP R3;\n"
"TEMP R4;\n"
- "MUL R0.xyz, fragment.position.y, c[4];\n"
- "MAD R0.xyz, fragment.position.x, c[3], R0;\n"
- "ADD R0.xyz, R0, c[5];\n"
+ "MUL R0.xyz, fragment.position.y, c[2];\n"
+ "MAD R0.xyz, fragment.position.x, c[1], R0;\n"
+ "ADD R0.xyz, R0, c[3];\n"
"RCP R0.z, R0.z;\n"
"MUL R0.xy, R0, R0.z;\n"
- "MUL R0.xy, R0, c[6];\n"
- "MOV R0.y, -R0;\n"
+ "MUL R0.xy, R0, c[0];\n"
"TEX R0, R0, texture[2], 2D;\n"
- "MUL R1.xy, fragment.position, c[7];\n"
+ "MUL R1.xy, fragment.position, c[5];\n"
"TEX R1, R1, texture[0], 2D;\n"
"ADD R2.w, -R1, c[8].y;\n"
"ADD R3.xyz, R0.w, -R0;\n"
@@ -5391,11 +5270,11 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_TEXTURE_COMPOSITION_MO
"MAD R2.xyz, R0, R2, R3;\n"
"ADD R0.z, R0.w, R1.w;\n"
"MAD R2.w, -R0, R1, R0.z;\n"
- "ADD R0.xy, fragment.position, c[0];\n"
- "MUL R0.xy, R0, c[1];\n"
+ "ADD R0.xy, fragment.position, c[6];\n"
+ "MUL R0.xy, R0, c[4];\n"
"TEX R0, R0, texture[1], 2D;\n"
"ADD R2, R2, -R1;\n"
- "DP4 R0.x, R0, c[2];\n"
+ "DP4 R0.x, R0, c[7];\n"
"MAD result.color, R0.x, R2, R1;\n"
"END\n"
;
@@ -5403,8 +5282,8 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_TEXTURE_COMPOSITION_MO
static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_TEXTURE_COMPOSITION_MODES_SOFTLIGHT =
"!!ARBfp1.0\n"
"PARAM c[10] = { program.local[0..7],\n"
- " { 1, 9.9999997e-06, 2, 8 },\n"
- " { 3 } };\n"
+ " { 1, 9.9999997e-006, 2, 3 },\n"
+ " { 8 } };\n"
"TEMP R0;\n"
"TEMP R1;\n"
"TEMP R2;\n"
@@ -5412,59 +5291,56 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_TEXTURE_COMPOSITION_MO
"TEMP R4;\n"
"TEMP R5;\n"
"TEMP R6;\n"
- "MUL R0.xyz, fragment.position.y, c[4];\n"
- "MAD R0.xyz, fragment.position.x, c[3], R0;\n"
- "ADD R0.xyz, R0, c[5];\n"
- "RCP R0.z, R0.z;\n"
- "MUL R0.xy, R0, R0.z;\n"
- "MUL R0.xy, R0, c[6];\n"
- "MUL R1.xy, fragment.position, c[7];\n"
- "TEX R1, R1, texture[0], 2D;\n"
- "MAX R0.z, R1.w, c[8].y;\n"
- "RCP R2.w, R0.z;\n"
- "MUL R2.xyz, R1, R2.w;\n"
- "MUL R6.xyz, -R2, c[8].w;\n"
- "MAD R3.xyz, -R1, R2.w, c[8].x;\n"
- "MOV R0.y, -R0;\n"
- "TEX R0, R0, texture[2], 2D;\n"
- "MAD R4.xyz, R0, c[8].z, -R0.w;\n"
- "MUL R5.xyz, R3, R4;\n"
- "MAD R3.xyz, -R3, R4, R0.w;\n"
- "ADD R6.xyz, R6, c[9].x;\n"
- "RSQ R2.x, R2.x;\n"
- "RSQ R2.z, R2.z;\n"
- "RSQ R2.y, R2.y;\n"
- "MAD R5.xyz, -R5, R6, R0.w;\n"
- "MUL R3.xyz, R1, R3;\n"
- "ADD R2.w, -R1, c[8].x;\n"
- "RCP R2.x, R2.x;\n"
+ "MUL R0.xy, fragment.position, c[5];\n"
+ "TEX R0, R0, texture[0], 2D;\n"
+ "MAX R1.x, R0.w, c[8].y;\n"
+ "RCP R2.w, R1.x;\n"
+ "MUL R1.xyz, R0, R2.w;\n"
+ "RSQ R1.w, R1.x;\n"
+ "RCP R2.x, R1.w;\n"
+ "RSQ R1.w, R1.y;\n"
+ "RSQ R2.z, R1.z;\n"
+ "MUL R3.xyz, fragment.position.y, c[2];\n"
+ "MAD R3.xyz, fragment.position.x, c[1], R3;\n"
+ "ADD R3.xyz, R3, c[3];\n"
+ "RCP R2.y, R1.w;\n"
+ "RCP R1.w, R3.z;\n"
+ "MUL R3.xy, R3, R1.w;\n"
"RCP R2.z, R2.z;\n"
- "RCP R2.y, R2.y;\n"
- "MAD R2.xyz, R2, R1.w, -R1;\n"
- "MUL R6.xyz, R2, R4;\n"
- "MUL R2.xyz, R1, R5;\n"
- "MAD R6.xyz, R1, R0.w, R6;\n"
- "MUL R4.xyz, R0, c[8].z;\n"
- "MUL R5.xyz, R1, c[8].w;\n"
- "ADD R6.xyz, R6, -R2;\n"
- "SGE R5.xyz, R5, R1.w;\n"
- "MUL R5.xyz, R5, R6;\n"
- "ADD R2.xyz, R2, R5;\n"
- "SGE R4.xyz, R4, R0.w;\n"
- "ADD R2.xyz, R2, -R3;\n"
- "MUL R2.xyz, R4, R2;\n"
- "ADD R2.xyz, R3, R2;\n"
- "MAD R0.xyz, R0, R2.w, R2;\n"
- "ADD R2.x, -R0.w, c[8];\n"
- "MAD R2.xyz, R1, R2.x, R0;\n"
- "ADD R0.z, R0.w, R1.w;\n"
- "MAD R2.w, -R0, R1, R0.z;\n"
- "ADD R0.xy, fragment.position, c[0];\n"
- "MUL R0.xy, R0, c[1];\n"
- "TEX R0, R0, texture[1], 2D;\n"
- "ADD R2, R2, -R1;\n"
- "DP4 R0.x, R0, c[2];\n"
- "MAD result.color, R0.x, R2, R1;\n"
+ "MAD R6.xyz, R0.w, R2, -R0;\n"
+ "MUL R2.xyz, -R1, c[9].x;\n"
+ "ADD R5.xyz, R2, c[8].w;\n"
+ "MAD R2.xyz, -R0, R2.w, c[8].x;\n"
+ "MUL R3.xy, R3, c[0];\n"
+ "TEX R1, R3, texture[2], 2D;\n"
+ "MAD R3.xyz, R1, c[8].z, -R1.w;\n"
+ "MUL R4.xyz, R2, R3;\n"
+ "MAD R4.xyz, -R4, R5, R1.w;\n"
+ "MAD R2.xyz, -R2, R3, R1.w;\n"
+ "MUL R5.xyz, R6, R3;\n"
+ "MUL R4.xyz, R0, R4;\n"
+ "MAD R5.xyz, R1.w, R0, R5;\n"
+ "ADD R6.xyz, R5, -R4;\n"
+ "MUL R5.xyz, R0, c[9].x;\n"
+ "SGE R3.xyz, R5, R0.w;\n"
+ "MAD R3.xyz, R3, R6, R4;\n"
+ "MUL R2.xyz, R0, R2;\n"
+ "MUL R4.xyz, R1, c[8].z;\n"
+ "SGE R4.xyz, R4, R1.w;\n"
+ "ADD R3.xyz, R3, -R2;\n"
+ "MAD R2.xyz, R4, R3, R2;\n"
+ "ADD R2.w, -R0, c[8].x;\n"
+ "MAD R1.xyz, R1, R2.w, R2;\n"
+ "ADD R2.x, -R1.w, c[8];\n"
+ "MAD R2.xyz, R0, R2.x, R1;\n"
+ "ADD R1.z, R1.w, R0.w;\n"
+ "MAD R2.w, -R1, R0, R1.z;\n"
+ "ADD R1.xy, fragment.position, c[6];\n"
+ "MUL R1.xy, R1, c[4];\n"
+ "TEX R1, R1, texture[1], 2D;\n"
+ "ADD R2, R2, -R0;\n"
+ "DP4 R1.x, R1, c[7];\n"
+ "MAD result.color, R1.x, R2, R0;\n"
"END\n"
;
@@ -5476,103 +5352,98 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_TEXTURE_COMPOSITION_MO
"TEMP R1;\n"
"TEMP R2;\n"
"TEMP R3;\n"
- "MUL R0.xyz, fragment.position.y, c[4];\n"
- "MAD R0.xyz, fragment.position.x, c[3], R0;\n"
- "ADD R0.xyz, R0, c[5];\n"
+ "MUL R0.xyz, fragment.position.y, c[2];\n"
+ "MAD R0.xyz, fragment.position.x, c[1], R0;\n"
+ "ADD R0.xyz, R0, c[3];\n"
"RCP R0.z, R0.z;\n"
- "MUL R0.xy, R0, R0.z;\n"
- "MUL R0.xy, R0, c[6];\n"
- "MUL R0.zw, fragment.position.xyxy, c[7].xyxy;\n"
- "TEX R1, R0.zwzw, texture[0], 2D;\n"
- "MOV R0.y, -R0;\n"
- "TEX R0, R0, texture[2], 2D;\n"
- "ADD R3.xyz, R0, R1;\n"
- "MUL R2.xyz, R1, R0.w;\n"
- "MUL R0.xyz, R0, R1.w;\n"
- "MIN R0.xyz, R0, R2;\n"
- "MAD R2.xyz, -R0, c[8].x, R3;\n"
- "ADD R0.z, R0.w, R1.w;\n"
- "MAD R2.w, -R0, R1, R0.z;\n"
- "ADD R0.xy, fragment.position, c[0];\n"
- "MUL R0.xy, R0, c[1];\n"
- "TEX R0, R0, texture[1], 2D;\n"
- "ADD R2, R2, -R1;\n"
- "DP4 R0.x, R0, c[2];\n"
- "MAD result.color, R0.x, R2, R1;\n"
+ "MUL R0.zw, R0.xyxy, R0.z;\n"
+ "MUL R1.xy, R0.zwzw, c[0];\n"
+ "MUL R0.xy, fragment.position, c[5];\n"
+ "TEX R0, R0, texture[0], 2D;\n"
+ "TEX R1, R1, texture[2], 2D;\n"
+ "ADD R2.xyz, R1, R0;\n"
+ "MUL R3.xyz, R1.w, R0;\n"
+ "MUL R1.xyz, R1, R0.w;\n"
+ "MIN R1.xyz, R1, R3;\n"
+ "MAD R2.xyz, -R1, c[8].x, R2;\n"
+ "ADD R1.z, R1.w, R0.w;\n"
+ "MAD R2.w, -R1, R0, R1.z;\n"
+ "ADD R1.xy, fragment.position, c[6];\n"
+ "MUL R1.xy, R1, c[4];\n"
+ "TEX R1, R1, texture[1], 2D;\n"
+ "ADD R2, R2, -R0;\n"
+ "DP4 R1.x, R1, c[7];\n"
+ "MAD result.color, R1.x, R2, R0;\n"
"END\n"
;
static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_TEXTURE_COMPOSITION_MODES_EXCLUSION =
"!!ARBfp1.0\n"
"PARAM c[9] = { program.local[0..7],\n"
- " { 1, 2 } };\n"
+ " { 2, 1 } };\n"
"TEMP R0;\n"
"TEMP R1;\n"
"TEMP R2;\n"
"TEMP R3;\n"
- "MUL R0.xyz, fragment.position.y, c[4];\n"
- "MAD R0.xyz, fragment.position.x, c[3], R0;\n"
- "ADD R0.xyz, R0, c[5];\n"
+ "MUL R0.xyz, fragment.position.y, c[2];\n"
+ "MAD R0.xyz, fragment.position.x, c[1], R0;\n"
+ "ADD R0.xyz, R0, c[3];\n"
"RCP R0.z, R0.z;\n"
- "MUL R0.xy, R0, R0.z;\n"
- "MUL R0.xy, R0, c[6];\n"
- "MOV R0.y, -R0;\n"
- "MUL R1.xy, fragment.position, c[7];\n"
- "TEX R1, R1, texture[0], 2D;\n"
- "TEX R0, R0, texture[2], 2D;\n"
- "MUL R2.xyz, R1, R0.w;\n"
- "MAD R3.xyz, R0, R1.w, R2;\n"
- "MUL R2.xyz, R0, R1;\n"
- "MAD R2.xyz, -R2, c[8].y, R3;\n"
- "ADD R2.w, -R1, c[8].x;\n"
- "MAD R0.xyz, R0, R2.w, R2;\n"
- "ADD R2.x, -R0.w, c[8];\n"
- "MAD R2.xyz, R1, R2.x, R0;\n"
- "ADD R0.z, R0.w, R1.w;\n"
- "MAD R2.w, -R0, R1, R0.z;\n"
- "ADD R0.xy, fragment.position, c[0];\n"
- "MUL R0.xy, R0, c[1];\n"
- "TEX R0, R0, texture[1], 2D;\n"
- "ADD R2, R2, -R1;\n"
- "DP4 R0.x, R0, c[2];\n"
- "MAD result.color, R0.x, R2, R1;\n"
+ "MUL R0.zw, R0.xyxy, R0.z;\n"
+ "MUL R1.xy, R0.zwzw, c[0];\n"
+ "MUL R0.xy, fragment.position, c[5];\n"
+ "TEX R0, R0, texture[0], 2D;\n"
+ "TEX R1, R1, texture[2], 2D;\n"
+ "MUL R2.xyz, R1.w, R0;\n"
+ "MAD R3.xyz, R1, R0.w, R2;\n"
+ "MUL R2.xyz, R1, R0;\n"
+ "MAD R2.xyz, -R2, c[8].x, R3;\n"
+ "ADD R2.w, -R0, c[8].y;\n"
+ "MAD R1.xyz, R1, R2.w, R2;\n"
+ "ADD R2.x, -R1.w, c[8].y;\n"
+ "MAD R2.xyz, R0, R2.x, R1;\n"
+ "ADD R1.z, R1.w, R0.w;\n"
+ "MAD R2.w, -R1, R0, R1.z;\n"
+ "ADD R1.xy, fragment.position, c[6];\n"
+ "MUL R1.xy, R1, c[4];\n"
+ "TEX R1, R1, texture[1], 2D;\n"
+ "ADD R2, R2, -R0;\n"
+ "DP4 R1.x, R1, c[7];\n"
+ "MAD result.color, R1.x, R2, R0;\n"
"END\n"
;
static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_TEXTURE_COMPOSITION_MODES_SIMPLE_PORTER_DUFF_NOMASK =
"!!ARBfp1.0\n"
- "PARAM c[8] = { program.local[0..4],\n"
- " { 1 },\n"
- " program.local[6..7] };\n"
+ "PARAM c[8] = { program.local[0..6],\n"
+ " { 1 } };\n"
"TEMP R0;\n"
"TEMP R1;\n"
"TEMP R2;\n"
"TEMP R3;\n"
- "MUL R0.xyz, fragment.position.y, c[1];\n"
- "MAD R0.xyz, fragment.position.x, c[0], R0;\n"
- "ADD R0.xyz, R0, c[2];\n"
- "RCP R0.z, R0.z;\n"
- "MUL R0.xy, R0, R0.z;\n"
- "MUL R0.xy, R0, c[3];\n"
- "MUL R0.zw, fragment.position.xyxy, c[4].xyxy;\n"
+ "MUL R0.xyz, fragment.position.y, c[2];\n"
+ "MAD R0.xyz, fragment.position.x, c[1], R0;\n"
+ "ADD R0.xyz, R0, c[3];\n"
+ "RCP R1.x, R0.z;\n"
+ "MUL R0.xy, R0, R1.x;\n"
+ "MUL R0.zw, fragment.position.xyxy, c[6].xyxy;\n"
"TEX R1, R0.zwzw, texture[0], 2D;\n"
- "MUL R2.xyz, R1, c[7].y;\n"
- "MOV R0.y, -R0;\n"
+ "MUL R2.xyz, R1, c[4].y;\n"
+ "MUL R0.xy, R0, c[0];\n"
"TEX R0, R0, texture[1], 2D;\n"
- "MUL R3.xyz, R2, R0.w;\n"
- "MUL R2.xyz, R0, c[7].x;\n"
- "MAD R2.xyz, R2, R1.w, R3;\n"
- "MUL R0.xyz, R0, c[6].y;\n"
- "ADD R2.w, -R1, c[5].x;\n"
- "MAD R0.xyz, R0, R2.w, R2;\n"
- "ADD R2.x, -R0.w, c[5];\n"
- "MUL R1.xyz, R1, c[6].z;\n"
- "MAD result.color.xyz, R1, R2.x, R0;\n"
- "ADD R0.y, -R1.w, c[5].x;\n"
+ "MUL R3.xyz, R0.w, R2;\n"
+ "MUL R2.xyz, R0, c[4].x;\n"
+ "MAD R2.xyz, R1.w, R2, R3;\n"
+ "ADD R2.w, -R1, c[7].x;\n"
+ "MUL R0.xyz, R0, c[5].y;\n"
+ "MAD R0.xyz, R2.w, R0, R2;\n"
+ "ADD R2.x, -R0.w, c[7];\n"
+ "MUL R1.xyz, R1, c[5].z;\n"
+ "MAD result.color.xyz, R2.x, R1, R0;\n"
"MUL R0.x, R0.w, R1.w;\n"
"MUL R0.z, R1.w, R2.x;\n"
- "MUL R0.y, R0.w, R0;\n"
- "DP3 result.color.w, R0, c[6];\n"
+ "MUL R0.y, R0.w, R2.w;\n"
+ "DP3 result.color.w, R0, c[5];\n"
"END\n"
;
@@ -5583,15 +5454,14 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_TEXTURE_COMPOSITION_MO
"TEMP R0;\n"
"TEMP R1;\n"
"TEMP R2;\n"
- "MUL R0.xyz, fragment.position.y, c[1];\n"
- "MAD R0.xyz, fragment.position.x, c[0], R0;\n"
- "ADD R0.xyz, R0, c[2];\n"
+ "MUL R0.xyz, fragment.position.y, c[2];\n"
+ "MAD R0.xyz, fragment.position.x, c[1], R0;\n"
+ "ADD R0.xyz, R0, c[3];\n"
"RCP R1.x, R0.z;\n"
"MUL R0.xy, R0, R1.x;\n"
- "MUL R0.xy, R0, c[3];\n"
"MUL R0.zw, fragment.position.xyxy, c[4].xyxy;\n"
"TEX R1, R0.zwzw, texture[0], 2D;\n"
- "MOV R0.y, -R0;\n"
+ "MUL R0.xy, R0, c[0];\n"
"TEX R0, R0, texture[1], 2D;\n"
"ADD R2.x, -R1.w, c[5];\n"
"MUL R2.xyz, R0, R2.x;\n"
@@ -5609,15 +5479,14 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_TEXTURE_COMPOSITION_MO
"TEMP R0;\n"
"TEMP R1;\n"
"TEMP R2;\n"
- "MUL R0.xyz, fragment.position.y, c[1];\n"
- "MAD R0.xyz, fragment.position.x, c[0], R0;\n"
- "ADD R0.xyz, R0, c[2];\n"
+ "MUL R0.xyz, fragment.position.y, c[2];\n"
+ "MAD R0.xyz, fragment.position.x, c[1], R0;\n"
+ "ADD R0.xyz, R0, c[3];\n"
"RCP R0.z, R0.z;\n"
"MUL R0.xy, R0, R0.z;\n"
- "MUL R0.xy, R0, c[3];\n"
"MUL R0.zw, fragment.position.xyxy, c[4].xyxy;\n"
"TEX R1, R0.zwzw, texture[0], 2D;\n"
- "MOV R0.y, -R0;\n"
+ "MUL R0.xy, R0, c[0];\n"
"TEX R0, R0, texture[1], 2D;\n"
"ADD R2, R0, R1;\n"
"MAD result.color, -R0, R1, R2;\n"
@@ -5632,13 +5501,12 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_TEXTURE_COMPOSITION_MO
"TEMP R1;\n"
"TEMP R2;\n"
"TEMP R3;\n"
- "MUL R0.xyz, fragment.position.y, c[1];\n"
- "MAD R0.xyz, fragment.position.x, c[0], R0;\n"
- "ADD R0.xyz, R0, c[2];\n"
+ "MUL R0.xyz, fragment.position.y, c[2];\n"
+ "MAD R0.xyz, fragment.position.x, c[1], R0;\n"
+ "ADD R0.xyz, R0, c[3];\n"
"RCP R0.z, R0.z;\n"
"MUL R0.xy, R0, R0.z;\n"
- "MUL R0.xy, R0, c[3];\n"
- "MOV R0.y, -R0;\n"
+ "MUL R0.xy, R0, c[0];\n"
"TEX R0, R0, texture[1], 2D;\n"
"MUL R1.xy, fragment.position, c[4];\n"
"TEX R1, R1, texture[0], 2D;\n"
@@ -5672,18 +5540,17 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_TEXTURE_COMPOSITION_MO
"TEMP R1;\n"
"TEMP R2;\n"
"TEMP R3;\n"
- "MUL R0.xyz, fragment.position.y, c[1];\n"
- "MAD R0.xyz, fragment.position.x, c[0], R0;\n"
- "ADD R0.xyz, R0, c[2];\n"
+ "MUL R0.xyz, fragment.position.y, c[2];\n"
+ "MAD R0.xyz, fragment.position.x, c[1], R0;\n"
+ "ADD R0.xyz, R0, c[3];\n"
"RCP R0.z, R0.z;\n"
"MUL R0.xy, R0, R0.z;\n"
- "MUL R0.xy, R0, c[3];\n"
- "MOV R0.y, -R0;\n"
- "MUL R1.xy, fragment.position, c[4];\n"
- "TEX R1, R1, texture[0], 2D;\n"
+ "MUL R0.zw, fragment.position.xyxy, c[4].xyxy;\n"
+ "TEX R1, R0.zwzw, texture[0], 2D;\n"
+ "MUL R0.xy, R0, c[0];\n"
"TEX R0, R0, texture[1], 2D;\n"
"MUL R2.xyz, R0, R1.w;\n"
- "MUL R3.xyz, R1, R0.w;\n"
+ "MUL R3.xyz, R0.w, R1;\n"
"MIN R2.xyz, R2, R3;\n"
"ADD R2.w, -R1, c[5].x;\n"
"MAD R0.xyz, R0, R2.w, R2;\n"
@@ -5702,18 +5569,17 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_TEXTURE_COMPOSITION_MO
"TEMP R1;\n"
"TEMP R2;\n"
"TEMP R3;\n"
- "MUL R0.xyz, fragment.position.y, c[1];\n"
- "MAD R0.xyz, fragment.position.x, c[0], R0;\n"
- "ADD R0.xyz, R0, c[2];\n"
+ "MUL R0.xyz, fragment.position.y, c[2];\n"
+ "MAD R0.xyz, fragment.position.x, c[1], R0;\n"
+ "ADD R0.xyz, R0, c[3];\n"
"RCP R0.z, R0.z;\n"
"MUL R0.xy, R0, R0.z;\n"
- "MUL R0.xy, R0, c[3];\n"
- "MOV R0.y, -R0;\n"
- "MUL R1.xy, fragment.position, c[4];\n"
- "TEX R1, R1, texture[0], 2D;\n"
+ "MUL R0.zw, fragment.position.xyxy, c[4].xyxy;\n"
+ "TEX R1, R0.zwzw, texture[0], 2D;\n"
+ "MUL R0.xy, R0, c[0];\n"
"TEX R0, R0, texture[1], 2D;\n"
"MUL R2.xyz, R0, R1.w;\n"
- "MUL R3.xyz, R1, R0.w;\n"
+ "MUL R3.xyz, R0.w, R1;\n"
"MAX R2.xyz, R2, R3;\n"
"ADD R2.w, -R1, c[5].x;\n"
"MAD R0.xyz, R0, R2.w, R2;\n"
@@ -5727,41 +5593,40 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_TEXTURE_COMPOSITION_MO
static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_TEXTURE_COMPOSITION_MODES_COLORDODGE_NOMASK =
"!!ARBfp1.0\n"
"PARAM c[6] = { program.local[0..4],\n"
- " { 1, 1e-06 } };\n"
+ " { 1, 1e-006 } };\n"
"TEMP R0;\n"
"TEMP R1;\n"
"TEMP R2;\n"
"TEMP R3;\n"
- "MUL R0.xyz, fragment.position.y, c[1];\n"
- "MAD R0.xyz, fragment.position.x, c[0], R0;\n"
- "ADD R0.xyz, R0, c[2];\n"
+ "MUL R0.xyz, fragment.position.y, c[2];\n"
+ "MAD R0.xyz, fragment.position.x, c[1], R0;\n"
+ "ADD R0.xyz, R0, c[3];\n"
"RCP R0.z, R0.z;\n"
"MUL R0.xy, R0, R0.z;\n"
- "MUL R0.xy, R0, c[3];\n"
- "MOV R0.y, -R0;\n"
+ "MUL R0.xy, R0, c[0];\n"
"TEX R0, R0, texture[1], 2D;\n"
"MAX R1.x, R0.w, c[5].y;\n"
"RCP R1.x, R1.x;\n"
- "MAD R1.xyz, -R0, R1.x, c[5].x;\n"
- "MAX R2.xyz, R1, c[5].y;\n"
+ "MAD R3.xyz, -R0, R1.x, c[5].x;\n"
+ "MAX R3.xyz, R3, c[5].y;\n"
"MUL R1.xy, fragment.position, c[4];\n"
"TEX R1, R1, texture[0], 2D;\n"
- "ADD R2.w, -R0, c[5].x;\n"
- "MUL R3.xyz, R1, R2.w;\n"
+ "ADD R2.x, -R0.w, c[5];\n"
+ "MUL R2.xyz, R1, R2.x;\n"
"ADD R2.w, -R1, c[5].x;\n"
- "MAD R3.xyz, R0, R2.w, R3;\n"
- "MUL R1.xyz, R1, R0.w;\n"
+ "MAD R2.xyz, R0, R2.w, R2;\n"
+ "MUL R1.xyz, R0.w, R1;\n"
"MAD R0.xyz, R0, R1.w, R1;\n"
"MUL R2.w, R0, R1;\n"
- "RCP R2.x, R2.x;\n"
- "RCP R2.y, R2.y;\n"
- "RCP R2.z, R2.z;\n"
- "MAD R2.xyz, R1, R2, R3;\n"
- "MAD R3.xyz, R0.w, R1.w, R3;\n"
+ "RCP R3.x, R3.x;\n"
+ "RCP R3.y, R3.y;\n"
+ "RCP R3.z, R3.z;\n"
+ "MAD R3.xyz, R1, R3, R2;\n"
+ "MAD R2.xyz, R0.w, R1.w, R2;\n"
"ADD R1.x, R0.w, R1.w;\n"
- "ADD R3.xyz, R3, -R2;\n"
+ "ADD R2.xyz, R2, -R3;\n"
"SGE R0.xyz, R0, R2.w;\n"
- "MAD result.color.xyz, R0, R3, R2;\n"
+ "MAD result.color.xyz, R0, R2, R3;\n"
"MAD result.color.w, -R0, R1, R1.x;\n"
"END\n"
;
@@ -5769,24 +5634,23 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_TEXTURE_COMPOSITION_MO
static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_TEXTURE_COMPOSITION_MODES_COLORBURN_NOMASK =
"!!ARBfp1.0\n"
"PARAM c[6] = { program.local[0..4],\n"
- " { 1, 9.9999997e-06 } };\n"
+ " { 1, 9.9999997e-006 } };\n"
"TEMP R0;\n"
"TEMP R1;\n"
"TEMP R2;\n"
"TEMP R3;\n"
"TEMP R4;\n"
"TEMP R5;\n"
- "MUL R0.xyz, fragment.position.y, c[1];\n"
- "MAD R0.xyz, fragment.position.x, c[0], R0;\n"
- "ADD R0.xyz, R0, c[2];\n"
+ "MUL R0.xyz, fragment.position.y, c[2];\n"
+ "MAD R0.xyz, fragment.position.x, c[1], R0;\n"
+ "ADD R0.xyz, R0, c[3];\n"
"RCP R0.z, R0.z;\n"
"MUL R0.xy, R0, R0.z;\n"
- "MUL R0.xy, R0, c[3];\n"
- "MOV R0.y, -R0;\n"
+ "MUL R0.zw, fragment.position.xyxy, c[4].xyxy;\n"
+ "TEX R1, R0.zwzw, texture[0], 2D;\n"
+ "MUL R0.xy, R0, c[0];\n"
"TEX R0, R0, texture[1], 2D;\n"
- "MUL R1.xy, fragment.position, c[4];\n"
- "TEX R1, R1, texture[0], 2D;\n"
- "MUL R2.xyz, R1, R0.w;\n"
+ "MUL R2.xyz, R0.w, R1;\n"
"MAD R3.xyz, R0, R1.w, R2;\n"
"ADD R2.w, -R1, c[5].x;\n"
"MAD R2.xyz, -R0.w, R1.w, R3;\n"
@@ -5799,9 +5663,8 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_TEXTURE_COMPOSITION_MO
"RCP R2.z, R2.z;\n"
"MAD R2.xyz, R4, R2, R5;\n"
"MUL R4.xyz, R1, R3.w;\n"
- "MAD R0.xyz, R0, R2.w, R4;\n"
- "ADD R3.w, -R0, c[5].x;\n"
"MAD R1.xyz, R1, R3.w, R2;\n"
+ "MAD R0.xyz, R0, R2.w, R4;\n"
"MUL R2.x, R0.w, R1.w;\n"
"ADD R2.w, R0, R1;\n"
"ADD R1.xyz, R1, -R0;\n"
@@ -5820,13 +5683,12 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_TEXTURE_COMPOSITION_MO
"TEMP R2;\n"
"TEMP R3;\n"
"TEMP R4;\n"
- "MUL R0.xyz, fragment.position.y, c[1];\n"
- "MAD R0.xyz, fragment.position.x, c[0], R0;\n"
- "ADD R0.xyz, R0, c[2];\n"
+ "MUL R0.xyz, fragment.position.y, c[2];\n"
+ "MAD R0.xyz, fragment.position.x, c[1], R0;\n"
+ "ADD R0.xyz, R0, c[3];\n"
"RCP R0.z, R0.z;\n"
"MUL R0.xy, R0, R0.z;\n"
- "MUL R0.xy, R0, c[3];\n"
- "MOV R0.y, -R0;\n"
+ "MUL R0.xy, R0, c[0];\n"
"TEX R0, R0, texture[1], 2D;\n"
"MUL R1.xy, fragment.position, c[4];\n"
"TEX R1, R1, texture[0], 2D;\n"
@@ -5836,27 +5698,27 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_TEXTURE_COMPOSITION_MO
"MUL R2.xyz, R2, R3;\n"
"MUL R2.xyz, R2, c[5].x;\n"
"MAD R2.xyz, R0.w, R1.w, -R2;\n"
+ "MAD R2.xyz, R0, R2.w, R2;\n"
"MUL R4.xyz, R0, R2.w;\n"
"MUL R3.xyz, R0, R1;\n"
- "MAD R2.xyz, R0, R2.w, R2;\n"
- "ADD R2.w, -R0, c[5].y;\n"
"MUL R0.xyz, R0, c[5].x;\n"
- "MAD R2.xyz, R1, R2.w, R2;\n"
+ "ADD R2.w, -R0, c[5].y;\n"
"MAD R3.xyz, R3, c[5].x, R4;\n"
- "MAD R1.xyz, R1, R2.w, R3;\n"
- "ADD R2.w, R0, R1;\n"
- "ADD R2.xyz, R2, -R1;\n"
+ "MAD R3.xyz, R1, R2.w, R3;\n"
+ "MAD R1.xyz, R1, R2.w, R2;\n"
+ "ADD R2.x, R0.w, R1.w;\n"
+ "ADD R1.xyz, R1, -R3;\n"
"SGE R0.xyz, R0, R0.w;\n"
- "MAD result.color.xyz, R0, R2, R1;\n"
- "MAD result.color.w, -R0, R1, R2;\n"
+ "MAD result.color.xyz, R0, R1, R3;\n"
+ "MAD result.color.w, -R0, R1, R2.x;\n"
"END\n"
;
static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_TEXTURE_COMPOSITION_MODES_SOFTLIGHT_NOMASK =
"!!ARBfp1.0\n"
"PARAM c[7] = { program.local[0..4],\n"
- " { 1, 9.9999997e-06, 2, 8 },\n"
- " { 3 } };\n"
+ " { 1, 9.9999997e-006, 2, 3 },\n"
+ " { 8 } };\n"
"TEMP R0;\n"
"TEMP R1;\n"
"TEMP R2;\n"
@@ -5864,47 +5726,44 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_TEXTURE_COMPOSITION_MO
"TEMP R4;\n"
"TEMP R5;\n"
"TEMP R6;\n"
- "MUL R0.xyz, fragment.position.y, c[1];\n"
- "MAD R0.xyz, fragment.position.x, c[0], R0;\n"
- "ADD R0.xyz, R0, c[2];\n"
- "RCP R0.z, R0.z;\n"
- "MUL R0.xy, R0, R0.z;\n"
- "MUL R0.xy, R0, c[3];\n"
- "MUL R1.xy, fragment.position, c[4];\n"
- "TEX R1, R1, texture[0], 2D;\n"
- "MAX R0.z, R1.w, c[5].y;\n"
- "RCP R2.w, R0.z;\n"
- "MUL R2.xyz, R1, R2.w;\n"
- "MUL R6.xyz, -R2, c[5].w;\n"
- "MAD R3.xyz, -R1, R2.w, c[5].x;\n"
- "MOV R0.y, -R0;\n"
- "TEX R0, R0, texture[1], 2D;\n"
- "MAD R4.xyz, R0, c[5].z, -R0.w;\n"
- "MUL R5.xyz, R3, R4;\n"
- "MAD R3.xyz, -R3, R4, R0.w;\n"
- "ADD R6.xyz, R6, c[6].x;\n"
- "RSQ R2.x, R2.x;\n"
- "RSQ R2.z, R2.z;\n"
- "RSQ R2.y, R2.y;\n"
- "MAD R5.xyz, -R5, R6, R0.w;\n"
- "MUL R3.xyz, R1, R3;\n"
- "RCP R2.x, R2.x;\n"
+ "MUL R0.xy, fragment.position, c[4];\n"
+ "TEX R1, R0, texture[0], 2D;\n"
+ "MAX R0.x, R1.w, c[5].y;\n"
+ "RCP R2.w, R0.x;\n"
+ "MUL R0.xyz, R1, R2.w;\n"
+ "RSQ R0.w, R0.x;\n"
+ "RCP R2.x, R0.w;\n"
+ "RSQ R0.w, R0.y;\n"
+ "RSQ R2.z, R0.z;\n"
+ "MUL R3.xyz, fragment.position.y, c[2];\n"
+ "MAD R3.xyz, fragment.position.x, c[1], R3;\n"
+ "ADD R3.xyz, R3, c[3];\n"
+ "RCP R2.y, R0.w;\n"
+ "RCP R0.w, R3.z;\n"
+ "MUL R3.xy, R3, R0.w;\n"
"RCP R2.z, R2.z;\n"
- "RCP R2.y, R2.y;\n"
- "MAD R2.xyz, R2, R1.w, -R1;\n"
- "MUL R6.xyz, R2, R4;\n"
- "MUL R2.xyz, R1, R5;\n"
+ "MAD R6.xyz, R1.w, R2, -R1;\n"
+ "MUL R2.xyz, -R0, c[6].x;\n"
+ "ADD R5.xyz, R2, c[5].w;\n"
+ "MAD R2.xyz, -R1, R2.w, c[5].x;\n"
+ "MUL R3.xy, R3, c[0];\n"
+ "TEX R0, R3, texture[1], 2D;\n"
+ "MAD R3.xyz, R0, c[5].z, -R0.w;\n"
+ "MUL R4.xyz, R2, R3;\n"
+ "MAD R4.xyz, -R4, R5, R0.w;\n"
+ "MUL R5.xyz, R6, R3;\n"
+ "MAD R2.xyz, -R2, R3, R0.w;\n"
+ "MUL R4.xyz, R1, R4;\n"
+ "MAD R5.xyz, R0.w, R1, R5;\n"
+ "ADD R6.xyz, R5, -R4;\n"
+ "MUL R5.xyz, R1, c[6].x;\n"
+ "SGE R3.xyz, R5, R1.w;\n"
+ "MAD R3.xyz, R3, R6, R4;\n"
+ "MUL R2.xyz, R1, R2;\n"
"MUL R4.xyz, R0, c[5].z;\n"
- "MAD R6.xyz, R1, R0.w, R6;\n"
- "MUL R5.xyz, R1, c[5].w;\n"
- "ADD R6.xyz, R6, -R2;\n"
- "SGE R5.xyz, R5, R1.w;\n"
- "MUL R5.xyz, R5, R6;\n"
- "ADD R2.xyz, R2, R5;\n"
- "ADD R2.xyz, R2, -R3;\n"
+ "ADD R3.xyz, R3, -R2;\n"
"SGE R4.xyz, R4, R0.w;\n"
- "MUL R2.xyz, R4, R2;\n"
- "ADD R2.xyz, R3, R2;\n"
+ "MAD R2.xyz, R4, R3, R2;\n"
"ADD R2.w, -R1, c[5].x;\n"
"MAD R0.xyz, R0, R2.w, R2;\n"
"ADD R2.x, R0.w, R1.w;\n"
@@ -5922,18 +5781,17 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_TEXTURE_COMPOSITION_MO
"TEMP R1;\n"
"TEMP R2;\n"
"TEMP R3;\n"
- "MUL R0.xyz, fragment.position.y, c[1];\n"
- "MAD R0.xyz, fragment.position.x, c[0], R0;\n"
- "ADD R0.xyz, R0, c[2];\n"
+ "MUL R0.xyz, fragment.position.y, c[2];\n"
+ "MAD R0.xyz, fragment.position.x, c[1], R0;\n"
+ "ADD R0.xyz, R0, c[3];\n"
"RCP R0.z, R0.z;\n"
"MUL R0.xy, R0, R0.z;\n"
- "MUL R0.xy, R0, c[3];\n"
- "MOV R0.y, -R0;\n"
- "MUL R1.xy, fragment.position, c[4];\n"
+ "MUL R0.zw, fragment.position.xyxy, c[4].xyxy;\n"
+ "TEX R1, R0.zwzw, texture[0], 2D;\n"
+ "MUL R0.xy, R0, c[0];\n"
"TEX R0, R0, texture[1], 2D;\n"
- "TEX R1, R1, texture[0], 2D;\n"
"MUL R2.xyz, R0, R1.w;\n"
- "MUL R3.xyz, R1, R0.w;\n"
+ "MUL R3.xyz, R0.w, R1;\n"
"ADD R0.xyz, R0, R1;\n"
"MIN R2.xyz, R2, R3;\n"
"ADD R1.x, R0.w, R1.w;\n"
@@ -5945,29 +5803,28 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_TEXTURE_COMPOSITION_MO
static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_TEXTURE_COMPOSITION_MODES_EXCLUSION_NOMASK =
"!!ARBfp1.0\n"
"PARAM c[6] = { program.local[0..4],\n"
- " { 1, 2 } };\n"
+ " { 2, 1 } };\n"
"TEMP R0;\n"
"TEMP R1;\n"
"TEMP R2;\n"
"TEMP R3;\n"
- "MUL R0.xyz, fragment.position.y, c[1];\n"
- "MAD R0.xyz, fragment.position.x, c[0], R0;\n"
- "ADD R0.xyz, R0, c[2];\n"
+ "MUL R0.xyz, fragment.position.y, c[2];\n"
+ "MAD R0.xyz, fragment.position.x, c[1], R0;\n"
+ "ADD R0.xyz, R0, c[3];\n"
"RCP R0.z, R0.z;\n"
"MUL R0.xy, R0, R0.z;\n"
- "MUL R0.xy, R0, c[3];\n"
- "MOV R0.y, -R0;\n"
- "MUL R1.xy, fragment.position, c[4];\n"
- "TEX R1, R1, texture[0], 2D;\n"
+ "MUL R0.zw, fragment.position.xyxy, c[4].xyxy;\n"
+ "TEX R1, R0.zwzw, texture[0], 2D;\n"
+ "MUL R0.xy, R0, c[0];\n"
"TEX R0, R0, texture[1], 2D;\n"
- "MUL R2.xyz, R1, R0.w;\n"
+ "MUL R2.xyz, R0.w, R1;\n"
"MAD R3.xyz, R0, R1.w, R2;\n"
"MUL R2.xyz, R0, R1;\n"
- "MAD R2.xyz, -R2, c[5].y, R3;\n"
- "ADD R2.w, -R1, c[5].x;\n"
+ "MAD R2.xyz, -R2, c[5].x, R3;\n"
+ "ADD R2.w, -R1, c[5].y;\n"
"MAD R0.xyz, R0, R2.w, R2;\n"
"ADD R2.x, R0.w, R1.w;\n"
- "ADD R2.y, -R0.w, c[5].x;\n"
+ "ADD R2.y, -R0.w, c[5];\n"
"MAD result.color.xyz, R1, R2.y, R0;\n"
"MAD result.color.w, -R0, R1, R2.x;\n"
"END\n"
@@ -5978,19 +5835,17 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_TEXTURE_COMPOSITION_MO
"PARAM c[7] = { program.local[0..6] };\n"
"TEMP R0;\n"
"TEMP R1;\n"
- "MUL R0.xyz, fragment.position.y, c[1];\n"
- "MAD R0.xyz, fragment.position.x, c[0], R0;\n"
- "ADD R1.xyz, R0, c[2];\n"
+ "MUL R0.xyz, fragment.position.y, c[2];\n"
+ "MAD R0.xyz, fragment.position.x, c[1], R0;\n"
+ "ADD R1.xyz, R0, c[3];\n"
"RCP R0.z, R1.z;\n"
"MUL R1.xy, R1, R0.z;\n"
- "ADD R0.xy, fragment.position, c[4];\n"
- "MUL R0.xy, R0, c[5];\n"
+ "ADD R0.xy, fragment.position, c[5];\n"
+ "MUL R0.xy, R0, c[4];\n"
"TEX R0, R0, texture[0], 2D;\n"
"DP4 R1.z, R0, c[6];\n"
- "MUL R1.xy, R1, c[3];\n"
- "MOV R0.x, R1;\n"
- "MOV R0.y, -R1;\n"
- "TEX R0, R0, texture[1], 2D;\n"
+ "MUL R1.xy, R1, c[0];\n"
+ "TEX R0, R1, texture[1], 2D;\n"
"MUL result.color, R0, R1.z;\n"
"END\n"
;
@@ -5999,58 +5854,55 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_TEXTURE_COMPOSITION_MO
"!!ARBfp1.0\n"
"PARAM c[4] = { program.local[0..3] };\n"
"TEMP R0;\n"
- "MUL R0.xyz, fragment.position.y, c[1];\n"
- "MAD R0.xyz, fragment.position.x, c[0], R0;\n"
- "ADD R0.xyz, R0, c[2];\n"
+ "MUL R0.xyz, fragment.position.y, c[2];\n"
+ "MAD R0.xyz, fragment.position.x, c[1], R0;\n"
+ "ADD R0.xyz, R0, c[3];\n"
"RCP R0.z, R0.z;\n"
"MUL R0.xy, R0, R0.z;\n"
- "MUL R0.xy, R0, c[3];\n"
- "MOV R0.y, -R0;\n"
+ "MUL R0.xy, R0, c[0];\n"
"TEX result.color, R0, texture[0], 2D;\n"
"END\n"
;
static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MODES_SIMPLE_PORTER_DUFF =
"!!ARBfp1.0\n"
- "PARAM c[11] = { program.local[0..7],\n"
- " { 1 },\n"
- " program.local[9..10] };\n"
+ "PARAM c[11] = { program.local[0..9],\n"
+ " { 1 } };\n"
"TEMP R0;\n"
"TEMP R1;\n"
"TEMP R2;\n"
"TEMP R3;\n"
- "MUL R0.xyz, fragment.position.y, c[4];\n"
- "MAD R0.xyz, fragment.position.x, c[3], R0;\n"
- "ADD R0.xyz, R0, c[5];\n"
+ "MUL R0.xyz, fragment.position.y, c[2];\n"
+ "MAD R0.xyz, fragment.position.x, c[1], R0;\n"
+ "ADD R0.xyz, R0, c[3];\n"
"RCP R0.z, R0.z;\n"
- "MUL R0.xy, R0, R0.z;\n"
- "MUL R0.xy, R0, c[6];\n"
- "MOV R0.y, -R0;\n"
- "MUL R0.zw, fragment.position.xyxy, c[7].xyxy;\n"
- "TEX R1, R0.zwzw, texture[0], 2D;\n"
- "TEX R0.x, R0, texture[2], 2D;\n"
- "MUL R0, fragment.color.primary, R0.x;\n"
- "MUL R2.xyz, R1, c[10].y;\n"
- "MUL R3.xyz, R2, R0.w;\n"
- "MUL R2.xyz, R0, c[10].x;\n"
- "MAD R2.xyz, R2, R1.w, R3;\n"
- "ADD R3.xy, fragment.position, c[0];\n"
- "MUL R0.xyz, R0, c[9].y;\n"
- "ADD R2.w, -R1, c[8].x;\n"
- "MAD R2.xyz, R0, R2.w, R2;\n"
- "ADD R2.w, -R0, c[8].x;\n"
- "MUL R0.xyz, R1, c[9].z;\n"
- "MAD R2.xyz, R0, R2.w, R2;\n"
- "ADD R0.y, -R1.w, c[8].x;\n"
- "MUL R0.z, R1.w, R2.w;\n"
- "MUL R0.x, R0.w, R1.w;\n"
- "MUL R0.y, R0.w, R0;\n"
- "DP3 R2.w, R0, c[9];\n"
- "MUL R3.xy, R3, c[1];\n"
- "TEX R0, R3, texture[1], 2D;\n"
- "ADD R2, R2, -R1;\n"
- "DP4 R0.x, R0, c[2];\n"
- "MAD result.color, R0.x, R2, R1;\n"
+ "MUL R0.zw, R0.xyxy, R0.z;\n"
+ "MUL R1.xy, R0.zwzw, c[0];\n"
+ "MOV R1.y, -R1;\n"
+ "MUL R0.xy, fragment.position, c[7];\n"
+ "TEX R0, R0, texture[0], 2D;\n"
+ "TEX R1.x, R1, texture[2], 2D;\n"
+ "MUL R1, fragment.color.primary, R1.x;\n"
+ "MUL R2.xyz, R0, c[4].y;\n"
+ "MUL R3.xyz, R1.w, R2;\n"
+ "MUL R2.xyz, R1, c[4].x;\n"
+ "MAD R2.xyz, R0.w, R2, R3;\n"
+ "ADD R3.xy, fragment.position, c[8];\n"
+ "ADD R2.w, -R0, c[10].x;\n"
+ "MUL R1.xyz, R1, c[5].y;\n"
+ "MAD R2.xyz, R2.w, R1, R2;\n"
+ "MUL R1.xyz, R0, c[5].z;\n"
+ "ADD R3.z, -R1.w, c[10].x;\n"
+ "MAD R2.xyz, R3.z, R1, R2;\n"
+ "MUL R1.y, R1.w, R2.w;\n"
+ "MUL R1.x, R1.w, R0.w;\n"
+ "MUL R1.z, R0.w, R3;\n"
+ "DP3 R2.w, R1, c[5];\n"
+ "MUL R3.xy, R3, c[6];\n"
+ "TEX R1, R3, texture[1], 2D;\n"
+ "ADD R2, R2, -R0;\n"
+ "DP4 R1.x, R1, c[9];\n"
+ "MAD result.color, R1.x, R2, R0;\n"
"END\n"
;
@@ -6061,30 +5913,30 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MO
"TEMP R0;\n"
"TEMP R1;\n"
"TEMP R2;\n"
- "MUL R0.xyz, fragment.position.y, c[4];\n"
- "MAD R0.xyz, fragment.position.x, c[3], R0;\n"
- "ADD R0.xyz, R0, c[5];\n"
+ "MUL R0.xyz, fragment.position.y, c[2];\n"
+ "MAD R0.xyz, fragment.position.x, c[1], R0;\n"
+ "ADD R0.xyz, R0, c[3];\n"
"RCP R0.z, R0.z;\n"
- "MUL R0.xy, R0, R0.z;\n"
- "MUL R0.xy, R0, c[6];\n"
- "MUL R0.zw, fragment.position.xyxy, c[7].xyxy;\n"
- "TEX R1, R0.zwzw, texture[0], 2D;\n"
- "MOV R0.y, -R0;\n"
- "TEX R0.x, R0, texture[2], 2D;\n"
- "MUL R0, fragment.color.primary, R0.x;\n"
- "ADD R2.x, -R1.w, c[8];\n"
- "MUL R2.xyz, R0, R2.x;\n"
- "MAD R0.xyz, R0, R1, R2;\n"
+ "MUL R0.zw, R0.xyxy, R0.z;\n"
+ "MUL R1.xy, R0.zwzw, c[0];\n"
+ "MOV R1.y, -R1;\n"
+ "MUL R0.xy, fragment.position, c[5];\n"
+ "TEX R0, R0, texture[0], 2D;\n"
+ "TEX R1.x, R1, texture[2], 2D;\n"
+ "MUL R1, fragment.color.primary, R1.x;\n"
"ADD R2.x, -R0.w, c[8];\n"
- "MAD R2.xyz, R1, R2.x, R0;\n"
- "ADD R0.z, R0.w, R1.w;\n"
- "MAD R2.w, -R0, R1, R0.z;\n"
- "ADD R0.xy, fragment.position, c[0];\n"
- "MUL R0.xy, R0, c[1];\n"
- "TEX R0, R0, texture[1], 2D;\n"
- "ADD R2, R2, -R1;\n"
- "DP4 R0.x, R0, c[2];\n"
- "MAD result.color, R0.x, R2, R1;\n"
+ "MUL R2.xyz, R1, R2.x;\n"
+ "MAD R1.xyz, R1, R0, R2;\n"
+ "ADD R2.x, -R1.w, c[8];\n"
+ "MAD R2.xyz, R0, R2.x, R1;\n"
+ "ADD R1.z, R1.w, R0.w;\n"
+ "MAD R2.w, -R1, R0, R1.z;\n"
+ "ADD R1.xy, fragment.position, c[6];\n"
+ "MUL R1.xy, R1, c[4];\n"
+ "TEX R1, R1, texture[1], 2D;\n"
+ "ADD R2, R2, -R0;\n"
+ "DP4 R1.x, R1, c[7];\n"
+ "MAD result.color, R1.x, R2, R0;\n"
"END\n"
;
@@ -6095,24 +5947,24 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MO
"TEMP R1;\n"
"TEMP R2;\n"
"TEMP R3;\n"
- "MUL R0.xyz, fragment.position.y, c[4];\n"
- "MAD R0.xyz, fragment.position.x, c[3], R0;\n"
- "ADD R0.xyz, R0, c[5];\n"
+ "MUL R0.xyz, fragment.position.y, c[2];\n"
+ "MAD R0.xyz, fragment.position.x, c[1], R0;\n"
+ "ADD R0.xyz, R0, c[3];\n"
"RCP R0.z, R0.z;\n"
"MUL R0.xy, R0, R0.z;\n"
- "MUL R0.xy, R0, c[6];\n"
+ "MUL R0.xy, R0, c[0];\n"
"MOV R0.y, -R0;\n"
"TEX R1.x, R0, texture[2], 2D;\n"
- "MUL R0.xy, fragment.position, c[7];\n"
- "ADD R3.xy, fragment.position, c[0];\n"
+ "MUL R0.xy, fragment.position, c[5];\n"
+ "ADD R3.xy, fragment.position, c[6];\n"
"TEX R0, R0, texture[0], 2D;\n"
"MUL R1, fragment.color.primary, R1.x;\n"
"ADD R2, R1, R0;\n"
"MAD R2, -R1, R0, R2;\n"
- "MUL R3.xy, R3, c[1];\n"
+ "MUL R3.xy, R3, c[4];\n"
"TEX R1, R3, texture[1], 2D;\n"
"ADD R2, R2, -R0;\n"
- "DP4 R1.x, R1, c[2];\n"
+ "DP4 R1.x, R1, c[7];\n"
"MAD result.color, R1.x, R2, R0;\n"
"END\n"
;
@@ -6126,16 +5978,16 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MO
"TEMP R2;\n"
"TEMP R3;\n"
"TEMP R4;\n"
- "MUL R0.xyz, fragment.position.y, c[4];\n"
- "MAD R0.xyz, fragment.position.x, c[3], R0;\n"
- "ADD R0.xyz, R0, c[5];\n"
+ "MUL R0.xyz, fragment.position.y, c[2];\n"
+ "MAD R0.xyz, fragment.position.x, c[1], R0;\n"
+ "ADD R0.xyz, R0, c[3];\n"
"RCP R0.z, R0.z;\n"
"MUL R0.xy, R0, R0.z;\n"
- "MUL R0.xy, R0, c[6];\n"
+ "MUL R0.xy, R0, c[0];\n"
"MOV R0.y, -R0;\n"
"TEX R1.x, R0, texture[2], 2D;\n"
"MUL R1, fragment.color.primary, R1.x;\n"
- "MUL R0.xy, fragment.position, c[7];\n"
+ "MUL R0.xy, fragment.position, c[5];\n"
"TEX R0, R0, texture[0], 2D;\n"
"ADD R2.w, -R0, c[8].y;\n"
"ADD R3.xyz, R1.w, -R1;\n"
@@ -6156,11 +6008,11 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MO
"MAD R2.xyz, R2, R1, R3;\n"
"ADD R1.z, R1.w, R0.w;\n"
"MAD R2.w, -R1, R0, R1.z;\n"
- "ADD R1.xy, fragment.position, c[0];\n"
- "MUL R1.xy, R1, c[1];\n"
+ "ADD R1.xy, fragment.position, c[6];\n"
+ "MUL R1.xy, R1, c[4];\n"
"TEX R1, R1, texture[1], 2D;\n"
"ADD R2, R2, -R0;\n"
- "DP4 R1.x, R1, c[2];\n"
+ "DP4 R1.x, R1, c[7];\n"
"MAD result.color, R1.x, R2, R0;\n"
"END\n"
;
@@ -6173,32 +6025,33 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MO
"TEMP R1;\n"
"TEMP R2;\n"
"TEMP R3;\n"
- "MUL R0.xyz, fragment.position.y, c[4];\n"
- "MAD R0.xyz, fragment.position.x, c[3], R0;\n"
- "ADD R0.xyz, R0, c[5];\n"
+ "MUL R0.xyz, fragment.position.y, c[2];\n"
+ "MAD R0.xyz, fragment.position.x, c[1], R0;\n"
+ "ADD R0.xyz, R0, c[3];\n"
"RCP R0.z, R0.z;\n"
"MUL R0.xy, R0, R0.z;\n"
- "MUL R0.xy, R0, c[6];\n"
- "MOV R0.y, -R0;\n"
- "TEX R0.x, R0, texture[2], 2D;\n"
- "MUL R1.xy, fragment.position, c[7];\n"
- "TEX R1, R1, texture[0], 2D;\n"
- "MUL R0, fragment.color.primary, R0.x;\n"
- "MUL R3.xyz, R1, R0.w;\n"
- "MUL R2.xyz, R0, R1.w;\n"
+ "MUL R0.xy, R0, c[0];\n"
+ "MOV R0.w, -R0.y;\n"
+ "MOV R0.z, R0.x;\n"
+ "TEX R1.x, R0.zwzw, texture[2], 2D;\n"
+ "MUL R0.xy, fragment.position, c[5];\n"
+ "TEX R0, R0, texture[0], 2D;\n"
+ "MUL R1, fragment.color.primary, R1.x;\n"
+ "MUL R3.xyz, R1.w, R0;\n"
+ "MUL R2.xyz, R1, R0.w;\n"
"MIN R2.xyz, R2, R3;\n"
- "ADD R2.w, -R1, c[8].x;\n"
- "MAD R0.xyz, R0, R2.w, R2;\n"
- "ADD R2.x, -R0.w, c[8];\n"
- "MAD R2.xyz, R1, R2.x, R0;\n"
- "ADD R0.z, R0.w, R1.w;\n"
- "MAD R2.w, -R0, R1, R0.z;\n"
- "ADD R0.xy, fragment.position, c[0];\n"
- "MUL R0.xy, R0, c[1];\n"
- "TEX R0, R0, texture[1], 2D;\n"
- "ADD R2, R2, -R1;\n"
- "DP4 R0.x, R0, c[2];\n"
- "MAD result.color, R0.x, R2, R1;\n"
+ "ADD R2.w, -R0, c[8].x;\n"
+ "MAD R1.xyz, R1, R2.w, R2;\n"
+ "ADD R2.x, -R1.w, c[8];\n"
+ "MAD R2.xyz, R0, R2.x, R1;\n"
+ "ADD R1.z, R1.w, R0.w;\n"
+ "MAD R2.w, -R1, R0, R1.z;\n"
+ "ADD R1.xy, fragment.position, c[6];\n"
+ "MUL R1.xy, R1, c[4];\n"
+ "TEX R1, R1, texture[1], 2D;\n"
+ "ADD R2, R2, -R0;\n"
+ "DP4 R1.x, R1, c[7];\n"
+ "MAD result.color, R1.x, R2, R0;\n"
"END\n"
;
@@ -6210,50 +6063,51 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MO
"TEMP R1;\n"
"TEMP R2;\n"
"TEMP R3;\n"
- "MUL R0.xyz, fragment.position.y, c[4];\n"
- "MAD R0.xyz, fragment.position.x, c[3], R0;\n"
- "ADD R0.xyz, R0, c[5];\n"
+ "MUL R0.xyz, fragment.position.y, c[2];\n"
+ "MAD R0.xyz, fragment.position.x, c[1], R0;\n"
+ "ADD R0.xyz, R0, c[3];\n"
"RCP R0.z, R0.z;\n"
"MUL R0.xy, R0, R0.z;\n"
- "MUL R0.xy, R0, c[6];\n"
- "MOV R0.y, -R0;\n"
- "TEX R0.x, R0, texture[2], 2D;\n"
- "MUL R1.xy, fragment.position, c[7];\n"
- "TEX R1, R1, texture[0], 2D;\n"
- "MUL R0, fragment.color.primary, R0.x;\n"
- "MUL R3.xyz, R1, R0.w;\n"
- "MUL R2.xyz, R0, R1.w;\n"
+ "MUL R0.xy, R0, c[0];\n"
+ "MOV R0.w, -R0.y;\n"
+ "MOV R0.z, R0.x;\n"
+ "TEX R1.x, R0.zwzw, texture[2], 2D;\n"
+ "MUL R0.xy, fragment.position, c[5];\n"
+ "TEX R0, R0, texture[0], 2D;\n"
+ "MUL R1, fragment.color.primary, R1.x;\n"
+ "MUL R3.xyz, R1.w, R0;\n"
+ "MUL R2.xyz, R1, R0.w;\n"
"MAX R2.xyz, R2, R3;\n"
- "ADD R2.w, -R1, c[8].x;\n"
- "MAD R0.xyz, R0, R2.w, R2;\n"
- "ADD R2.x, -R0.w, c[8];\n"
- "MAD R2.xyz, R1, R2.x, R0;\n"
- "ADD R0.z, R0.w, R1.w;\n"
- "MAD R2.w, -R0, R1, R0.z;\n"
- "ADD R0.xy, fragment.position, c[0];\n"
- "MUL R0.xy, R0, c[1];\n"
- "TEX R0, R0, texture[1], 2D;\n"
- "ADD R2, R2, -R1;\n"
- "DP4 R0.x, R0, c[2];\n"
- "MAD result.color, R0.x, R2, R1;\n"
+ "ADD R2.w, -R0, c[8].x;\n"
+ "MAD R1.xyz, R1, R2.w, R2;\n"
+ "ADD R2.x, -R1.w, c[8];\n"
+ "MAD R2.xyz, R0, R2.x, R1;\n"
+ "ADD R1.z, R1.w, R0.w;\n"
+ "MAD R2.w, -R1, R0, R1.z;\n"
+ "ADD R1.xy, fragment.position, c[6];\n"
+ "MUL R1.xy, R1, c[4];\n"
+ "TEX R1, R1, texture[1], 2D;\n"
+ "ADD R2, R2, -R0;\n"
+ "DP4 R1.x, R1, c[7];\n"
+ "MAD result.color, R1.x, R2, R0;\n"
"END\n"
;
static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MODES_COLORDODGE =
"!!ARBfp1.0\n"
"PARAM c[9] = { program.local[0..7],\n"
- " { 1, 1e-06 } };\n"
+ " { 1, 1e-006 } };\n"
"TEMP R0;\n"
"TEMP R1;\n"
"TEMP R2;\n"
"TEMP R3;\n"
"TEMP R4;\n"
- "MUL R0.xyz, fragment.position.y, c[4];\n"
- "MAD R0.xyz, fragment.position.x, c[3], R0;\n"
- "ADD R0.xyz, R0, c[5];\n"
+ "MUL R0.xyz, fragment.position.y, c[2];\n"
+ "MAD R0.xyz, fragment.position.x, c[1], R0;\n"
+ "ADD R0.xyz, R0, c[3];\n"
"RCP R0.z, R0.z;\n"
"MUL R0.xy, R0, R0.z;\n"
- "MUL R0.xy, R0, c[6];\n"
+ "MUL R0.xy, R0, c[0];\n"
"MOV R0.y, -R0;\n"
"TEX R0.x, R0, texture[2], 2D;\n"
"MUL R1, fragment.color.primary, R0.x;\n"
@@ -6261,13 +6115,13 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MO
"RCP R0.x, R0.x;\n"
"MAD R0.xyz, -R1, R0.x, c[8].x;\n"
"MAX R2.xyz, R0, c[8].y;\n"
- "MUL R0.xy, fragment.position, c[7];\n"
+ "MUL R0.xy, fragment.position, c[5];\n"
"TEX R0, R0, texture[0], 2D;\n"
"ADD R2.w, -R1, c[8].x;\n"
"MUL R3.xyz, R0, R2.w;\n"
"ADD R2.w, -R0, c[8].x;\n"
"MAD R4.xyz, R1, R2.w, R3;\n"
- "MUL R3.xyz, R0, R1.w;\n"
+ "MUL R3.xyz, R1.w, R0;\n"
"MUL R2.w, R1, R0;\n"
"MAD R1.xyz, R1, R0.w, R3;\n"
"SGE R1.xyz, R1, R2.w;\n"
@@ -6280,11 +6134,11 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MO
"MAD R2.xyz, R1, R4, R2;\n"
"ADD R1.z, R1.w, R0.w;\n"
"MAD R2.w, -R1, R0, R1.z;\n"
- "ADD R1.xy, fragment.position, c[0];\n"
- "MUL R1.xy, R1, c[1];\n"
+ "ADD R1.xy, fragment.position, c[6];\n"
+ "MUL R1.xy, R1, c[4];\n"
"TEX R1, R1, texture[1], 2D;\n"
"ADD R2, R2, -R0;\n"
- "DP4 R1.x, R1, c[2];\n"
+ "DP4 R1.x, R1, c[7];\n"
"MAD result.color, R1.x, R2, R0;\n"
"END\n"
;
@@ -6292,25 +6146,26 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MO
static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MODES_COLORBURN =
"!!ARBfp1.0\n"
"PARAM c[9] = { program.local[0..7],\n"
- " { 1, 9.9999997e-06 } };\n"
+ " { 1, 9.9999997e-006 } };\n"
"TEMP R0;\n"
"TEMP R1;\n"
"TEMP R2;\n"
"TEMP R3;\n"
"TEMP R4;\n"
"TEMP R5;\n"
- "MUL R0.xyz, fragment.position.y, c[4];\n"
- "MAD R0.xyz, fragment.position.x, c[3], R0;\n"
- "ADD R0.xyz, R0, c[5];\n"
+ "MUL R0.xyz, fragment.position.y, c[2];\n"
+ "MAD R0.xyz, fragment.position.x, c[1], R0;\n"
+ "ADD R0.xyz, R0, c[3];\n"
"RCP R0.z, R0.z;\n"
"MUL R0.xy, R0, R0.z;\n"
- "MUL R0.xy, R0, c[6];\n"
- "MOV R0.y, -R0;\n"
- "TEX R1.x, R0, texture[2], 2D;\n"
+ "MUL R0.xy, R0, c[0];\n"
+ "MOV R0.w, -R0.y;\n"
+ "MOV R0.z, R0.x;\n"
+ "TEX R1.x, R0.zwzw, texture[2], 2D;\n"
"MUL R1, fragment.color.primary, R1.x;\n"
- "MUL R0.xy, fragment.position, c[7];\n"
+ "MUL R0.xy, fragment.position, c[5];\n"
"TEX R0, R0, texture[0], 2D;\n"
- "MUL R2.xyz, R0, R1.w;\n"
+ "MUL R2.xyz, R1.w, R0;\n"
"MAD R3.xyz, R1, R0.w, R2;\n"
"MAD R2.xyz, -R1.w, R0.w, R3;\n"
"MUL R4.xyz, R1.w, R2;\n"
@@ -6325,18 +6180,17 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MO
"MUL R4.xyz, R0, R3.w;\n"
"MAD R1.xyz, R1, R2.w, R4;\n"
"MUL R2.w, R1, R0;\n"
- "ADD R3.w, -R1, c[8].x;\n"
"MAD R2.xyz, R0, R3.w, R2;\n"
"ADD R2.xyz, R2, -R1;\n"
"SGE R3.xyz, R3, R2.w;\n"
"MAD R2.xyz, R3, R2, R1;\n"
"ADD R1.z, R1.w, R0.w;\n"
"MAD R2.w, -R1, R0, R1.z;\n"
- "ADD R1.xy, fragment.position, c[0];\n"
- "MUL R1.xy, R1, c[1];\n"
+ "ADD R1.xy, fragment.position, c[6];\n"
+ "MUL R1.xy, R1, c[4];\n"
"TEX R1, R1, texture[1], 2D;\n"
"ADD R2, R2, -R0;\n"
- "DP4 R1.x, R1, c[2];\n"
+ "DP4 R1.x, R1, c[7];\n"
"MAD result.color, R1.x, R2, R0;\n"
"END\n"
;
@@ -6350,16 +6204,16 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MO
"TEMP R2;\n"
"TEMP R3;\n"
"TEMP R4;\n"
- "MUL R0.xyz, fragment.position.y, c[4];\n"
- "MAD R0.xyz, fragment.position.x, c[3], R0;\n"
- "ADD R0.xyz, R0, c[5];\n"
+ "MUL R0.xyz, fragment.position.y, c[2];\n"
+ "MAD R0.xyz, fragment.position.x, c[1], R0;\n"
+ "ADD R0.xyz, R0, c[3];\n"
"RCP R0.z, R0.z;\n"
"MUL R0.xy, R0, R0.z;\n"
- "MUL R0.xy, R0, c[6];\n"
+ "MUL R0.xy, R0, c[0];\n"
"MOV R0.y, -R0;\n"
"TEX R1.x, R0, texture[2], 2D;\n"
"MUL R1, fragment.color.primary, R1.x;\n"
- "MUL R0.xy, fragment.position, c[7];\n"
+ "MUL R0.xy, fragment.position, c[5];\n"
"TEX R0, R0, texture[0], 2D;\n"
"ADD R2.w, -R0, c[8].y;\n"
"ADD R3.xyz, R1.w, -R1;\n"
@@ -6380,11 +6234,11 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MO
"MAD R2.xyz, R1, R2, R3;\n"
"ADD R1.z, R1.w, R0.w;\n"
"MAD R2.w, -R1, R0, R1.z;\n"
- "ADD R1.xy, fragment.position, c[0];\n"
- "MUL R1.xy, R1, c[1];\n"
+ "ADD R1.xy, fragment.position, c[6];\n"
+ "MUL R1.xy, R1, c[4];\n"
"TEX R1, R1, texture[1], 2D;\n"
"ADD R2, R2, -R0;\n"
- "DP4 R1.x, R1, c[2];\n"
+ "DP4 R1.x, R1, c[7];\n"
"MAD result.color, R1.x, R2, R0;\n"
"END\n"
;
@@ -6392,68 +6246,66 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MO
static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MODES_SOFTLIGHT =
"!!ARBfp1.0\n"
"PARAM c[10] = { program.local[0..7],\n"
- " { 1, 9.9999997e-06, 2, 8 },\n"
- " { 3 } };\n"
+ " { 1, 9.9999997e-006, 2, 3 },\n"
+ " { 8 } };\n"
"TEMP R0;\n"
"TEMP R1;\n"
"TEMP R2;\n"
"TEMP R3;\n"
"TEMP R4;\n"
"TEMP R5;\n"
- "MUL R0.xyz, fragment.position.y, c[4];\n"
- "MAD R0.xyz, fragment.position.x, c[3], R0;\n"
- "ADD R1.xyz, R0, c[5];\n"
+ "TEMP R6;\n"
+ "MUL R0.xyz, fragment.position.y, c[2];\n"
+ "MAD R0.xyz, fragment.position.x, c[1], R0;\n"
+ "ADD R1.xyz, R0, c[3];\n"
"RCP R0.z, R1.z;\n"
"MUL R1.xy, R1, R0.z;\n"
- "MUL R1.xy, R1, c[6];\n"
+ "MUL R1.xy, R1, c[0];\n"
"MOV R1.y, -R1;\n"
- "MUL R0.xy, fragment.position, c[7];\n"
+ "MUL R0.xy, fragment.position, c[5];\n"
"TEX R0, R0, texture[0], 2D;\n"
"MAX R1.z, R0.w, c[8].y;\n"
"RCP R2.w, R1.z;\n"
"MUL R2.xyz, R0, R2.w;\n"
- "MUL R5.xyz, -R2, c[8].w;\n"
- "MAD R4.xyz, -R0, R2.w, c[8].x;\n"
+ "MUL R6.xyz, -R2, c[9].x;\n"
+ "MAD R3.xyz, -R0, R2.w, c[8].x;\n"
"TEX R1.x, R1, texture[2], 2D;\n"
"MUL R1, fragment.color.primary, R1.x;\n"
- "MAD R3.xyz, R1, c[8].z, -R1.w;\n"
+ "MAD R4.xyz, R1, c[8].z, -R1.w;\n"
+ "MUL R5.xyz, R3, R4;\n"
+ "MAD R3.xyz, -R3, R4, R1.w;\n"
+ "ADD R6.xyz, R6, c[8].w;\n"
+ "MAD R5.xyz, -R5, R6, R1.w;\n"
"RSQ R2.x, R2.x;\n"
"RSQ R2.z, R2.z;\n"
"RSQ R2.y, R2.y;\n"
- "MUL R4.xyz, R4, R3;\n"
- "ADD R5.xyz, R5, c[9].x;\n"
- "MUL R5.xyz, R4, R5;\n"
- "ADD R4.xyz, R1.w, -R4;\n"
+ "MUL R5.xyz, R0, R5;\n"
+ "MUL R3.xyz, R0, R3;\n"
"ADD R2.w, -R0, c[8].x;\n"
"RCP R2.x, R2.x;\n"
"RCP R2.z, R2.z;\n"
"RCP R2.y, R2.y;\n"
- "MAD R2.xyz, R2, R0.w, -R0;\n"
- "MUL R3.xyz, R2, R3;\n"
- "ADD R2.xyz, R1.w, -R5;\n"
- "MAD R5.xyz, R0, R1.w, R3;\n"
- "MUL R2.xyz, R0, R2;\n"
- "MUL R3.xyz, R0, c[8].w;\n"
- "ADD R5.xyz, R5, -R2;\n"
- "SGE R3.xyz, R3, R0.w;\n"
- "MUL R3.xyz, R3, R5;\n"
- "ADD R2.xyz, R2, R3;\n"
- "MUL R3.xyz, R0, R4;\n"
+ "MAD R2.xyz, R0.w, R2, -R0;\n"
+ "MUL R2.xyz, R2, R4;\n"
+ "MAD R2.xyz, R1.w, R0, R2;\n"
+ "ADD R6.xyz, R2, -R5;\n"
"MUL R4.xyz, R1, c[8].z;\n"
+ "MUL R2.xyz, R0, c[9].x;\n"
+ "SGE R2.xyz, R2, R0.w;\n"
+ "MAD R2.xyz, R2, R6, R5;\n"
"SGE R4.xyz, R4, R1.w;\n"
"ADD R2.xyz, R2, -R3;\n"
- "MUL R2.xyz, R4, R2;\n"
- "ADD R2.xyz, R3, R2;\n"
+ "MAD R2.xyz, R4, R2, R3;\n"
"MAD R1.xyz, R1, R2.w, R2;\n"
"ADD R2.x, -R1.w, c[8];\n"
"MAD R2.xyz, R0, R2.x, R1;\n"
"ADD R1.z, R1.w, R0.w;\n"
"MAD R2.w, -R1, R0, R1.z;\n"
- "ADD R1.xy, fragment.position, c[0];\n"
- "MUL R1.xy, R1, c[1];\n"
+ "ADD R1.xy, fragment.position, c[6];\n"
+ "MUL R1.xy, R1, c[4];\n"
"TEX R1, R1, texture[1], 2D;\n"
"ADD R2, R2, -R0;\n"
- "DP4 R1.x, R1, c[2];\n"
+ "DP4 R1.x, R1, c[7];\n"
"MAD result.color, R1.x, R2, R0;\n"
"END\n"
;
@@ -6466,107 +6318,106 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MO
"TEMP R1;\n"
"TEMP R2;\n"
"TEMP R3;\n"
- "MUL R0.xyz, fragment.position.y, c[4];\n"
- "MAD R0.xyz, fragment.position.x, c[3], R0;\n"
- "ADD R0.xyz, R0, c[5];\n"
+ "MUL R0.xyz, fragment.position.y, c[2];\n"
+ "MAD R0.xyz, fragment.position.x, c[1], R0;\n"
+ "ADD R0.xyz, R0, c[3];\n"
"RCP R0.z, R0.z;\n"
"MUL R0.xy, R0, R0.z;\n"
- "MUL R0.xy, R0, c[6];\n"
- "MOV R0.y, -R0;\n"
- "MUL R0.zw, fragment.position.xyxy, c[7].xyxy;\n"
- "TEX R1, R0.zwzw, texture[0], 2D;\n"
- "TEX R0.x, R0, texture[2], 2D;\n"
- "MUL R0, fragment.color.primary, R0.x;\n"
- "ADD R3.xyz, R0, R1;\n"
- "MUL R2.xyz, R1, R0.w;\n"
- "MUL R0.xyz, R0, R1.w;\n"
- "MIN R0.xyz, R0, R2;\n"
- "MAD R2.xyz, -R0, c[8].x, R3;\n"
- "ADD R0.z, R0.w, R1.w;\n"
- "MAD R2.w, -R0, R1, R0.z;\n"
- "ADD R0.xy, fragment.position, c[0];\n"
- "MUL R0.xy, R0, c[1];\n"
- "TEX R0, R0, texture[1], 2D;\n"
- "ADD R2, R2, -R1;\n"
- "DP4 R0.x, R0, c[2];\n"
- "MAD result.color, R0.x, R2, R1;\n"
+ "MUL R0.xy, R0, c[0];\n"
+ "MOV R0.w, -R0.y;\n"
+ "MOV R0.z, R0.x;\n"
+ "TEX R1.x, R0.zwzw, texture[2], 2D;\n"
+ "MUL R0.xy, fragment.position, c[5];\n"
+ "TEX R0, R0, texture[0], 2D;\n"
+ "MUL R1, fragment.color.primary, R1.x;\n"
+ "ADD R2.xyz, R1, R0;\n"
+ "MUL R3.xyz, R1.w, R0;\n"
+ "MUL R1.xyz, R1, R0.w;\n"
+ "MIN R1.xyz, R1, R3;\n"
+ "MAD R2.xyz, -R1, c[8].x, R2;\n"
+ "ADD R1.z, R1.w, R0.w;\n"
+ "MAD R2.w, -R1, R0, R1.z;\n"
+ "ADD R1.xy, fragment.position, c[6];\n"
+ "MUL R1.xy, R1, c[4];\n"
+ "TEX R1, R1, texture[1], 2D;\n"
+ "ADD R2, R2, -R0;\n"
+ "DP4 R1.x, R1, c[7];\n"
+ "MAD result.color, R1.x, R2, R0;\n"
"END\n"
;
static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MODES_EXCLUSION =
"!!ARBfp1.0\n"
"PARAM c[9] = { program.local[0..7],\n"
- " { 1, 2 } };\n"
+ " { 2, 1 } };\n"
"TEMP R0;\n"
"TEMP R1;\n"
"TEMP R2;\n"
"TEMP R3;\n"
- "MUL R0.xyz, fragment.position.y, c[4];\n"
- "MAD R0.xyz, fragment.position.x, c[3], R0;\n"
- "ADD R0.xyz, R0, c[5];\n"
+ "MUL R0.xyz, fragment.position.y, c[2];\n"
+ "MAD R0.xyz, fragment.position.x, c[1], R0;\n"
+ "ADD R0.xyz, R0, c[3];\n"
"RCP R0.z, R0.z;\n"
"MUL R0.xy, R0, R0.z;\n"
- "MUL R0.xy, R0, c[6];\n"
- "MOV R0.y, -R0;\n"
- "TEX R0.x, R0, texture[2], 2D;\n"
- "MUL R1.xy, fragment.position, c[7];\n"
- "TEX R1, R1, texture[0], 2D;\n"
- "MUL R0, fragment.color.primary, R0.x;\n"
- "MUL R2.xyz, R1, R0.w;\n"
- "MAD R3.xyz, R0, R1.w, R2;\n"
- "MUL R2.xyz, R0, R1;\n"
- "MAD R2.xyz, -R2, c[8].y, R3;\n"
- "ADD R2.w, -R1, c[8].x;\n"
- "MAD R0.xyz, R0, R2.w, R2;\n"
- "ADD R2.x, -R0.w, c[8];\n"
- "MAD R2.xyz, R1, R2.x, R0;\n"
- "ADD R0.z, R0.w, R1.w;\n"
- "MAD R2.w, -R0, R1, R0.z;\n"
- "ADD R0.xy, fragment.position, c[0];\n"
- "MUL R0.xy, R0, c[1];\n"
- "TEX R0, R0, texture[1], 2D;\n"
- "ADD R2, R2, -R1;\n"
- "DP4 R0.x, R0, c[2];\n"
- "MAD result.color, R0.x, R2, R1;\n"
+ "MUL R0.xy, R0, c[0];\n"
+ "MOV R0.w, -R0.y;\n"
+ "MOV R0.z, R0.x;\n"
+ "TEX R1.x, R0.zwzw, texture[2], 2D;\n"
+ "MUL R0.xy, fragment.position, c[5];\n"
+ "TEX R0, R0, texture[0], 2D;\n"
+ "MUL R1, fragment.color.primary, R1.x;\n"
+ "MUL R2.xyz, R1.w, R0;\n"
+ "MAD R3.xyz, R1, R0.w, R2;\n"
+ "MUL R2.xyz, R1, R0;\n"
+ "MAD R2.xyz, -R2, c[8].x, R3;\n"
+ "ADD R2.w, -R0, c[8].y;\n"
+ "MAD R1.xyz, R1, R2.w, R2;\n"
+ "ADD R2.x, -R1.w, c[8].y;\n"
+ "MAD R2.xyz, R0, R2.x, R1;\n"
+ "ADD R1.z, R1.w, R0.w;\n"
+ "MAD R2.w, -R1, R0, R1.z;\n"
+ "ADD R1.xy, fragment.position, c[6];\n"
+ "MUL R1.xy, R1, c[4];\n"
+ "TEX R1, R1, texture[1], 2D;\n"
+ "ADD R2, R2, -R0;\n"
+ "DP4 R1.x, R1, c[7];\n"
+ "MAD result.color, R1.x, R2, R0;\n"
"END\n"
;
static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MODES_SIMPLE_PORTER_DUFF_NOMASK =
"!!ARBfp1.0\n"
- "PARAM c[8] = { program.local[0..4],\n"
- " { 1 },\n"
- " program.local[6..7] };\n"
+ "PARAM c[8] = { program.local[0..6],\n"
+ " { 1 } };\n"
"TEMP R0;\n"
"TEMP R1;\n"
"TEMP R2;\n"
"TEMP R3;\n"
- "MUL R0.xyz, fragment.position.y, c[1];\n"
- "MAD R0.xyz, fragment.position.x, c[0], R0;\n"
- "ADD R0.xyz, R0, c[2];\n"
+ "MUL R0.xyz, fragment.position.y, c[2];\n"
+ "MAD R0.xyz, fragment.position.x, c[1], R0;\n"
+ "ADD R0.xyz, R0, c[3];\n"
"RCP R0.z, R0.z;\n"
- "MUL R0.xy, R0, R0.z;\n"
- "MUL R0.xy, R0, c[3];\n"
- "MOV R0.w, -R0.y;\n"
- "MOV R0.z, R0.x;\n"
- "TEX R1.x, R0.zwzw, texture[1], 2D;\n"
- "MUL R0.xy, fragment.position, c[4];\n"
+ "MUL R0.zw, R0.xyxy, R0.z;\n"
+ "MUL R1.xy, R0.zwzw, c[0];\n"
+ "MOV R1.y, -R1;\n"
+ "MUL R0.xy, fragment.position, c[6];\n"
"TEX R0, R0, texture[0], 2D;\n"
- "MUL R2.xyz, R0, c[7].y;\n"
+ "MUL R2.xyz, R0, c[4].y;\n"
+ "TEX R1.x, R1, texture[1], 2D;\n"
"MUL R1, fragment.color.primary, R1.x;\n"
- "MUL R3.xyz, R2, R1.w;\n"
- "MUL R2.xyz, R1, c[7].x;\n"
- "MUL R0.xyz, R0, c[6].z;\n"
- "MAD R2.xyz, R2, R0.w, R3;\n"
- "MUL R1.xyz, R1, c[6].y;\n"
- "ADD R2.w, -R0, c[5].x;\n"
- "MAD R1.xyz, R1, R2.w, R2;\n"
- "ADD R2.x, -R1.w, c[5];\n"
- "MAD result.color.xyz, R0, R2.x, R1;\n"
- "ADD R0.y, -R0.w, c[5].x;\n"
+ "MUL R3.xyz, R1.w, R2;\n"
+ "MUL R2.xyz, R1, c[4].x;\n"
+ "MUL R0.xyz, R0, c[5].z;\n"
+ "MAD R2.xyz, R0.w, R2, R3;\n"
+ "ADD R2.w, -R0, c[7].x;\n"
+ "MUL R1.xyz, R1, c[5].y;\n"
+ "MAD R1.xyz, R2.w, R1, R2;\n"
+ "ADD R2.x, -R1.w, c[7];\n"
+ "MAD result.color.xyz, R2.x, R0, R1;\n"
"MUL R0.x, R1.w, R0.w;\n"
"MUL R0.z, R0.w, R2.x;\n"
- "MUL R0.y, R1.w, R0;\n"
- "DP3 result.color.w, R0, c[6];\n"
+ "MUL R0.y, R1.w, R2.w;\n"
+ "DP3 result.color.w, R0, c[5];\n"
"END\n"
;
@@ -6577,12 +6428,12 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MO
"TEMP R0;\n"
"TEMP R1;\n"
"TEMP R2;\n"
- "MUL R0.xyz, fragment.position.y, c[1];\n"
- "MAD R0.xyz, fragment.position.x, c[0], R0;\n"
- "ADD R0.xyz, R0, c[2];\n"
+ "MUL R0.xyz, fragment.position.y, c[2];\n"
+ "MAD R0.xyz, fragment.position.x, c[1], R0;\n"
+ "ADD R0.xyz, R0, c[3];\n"
"RCP R0.z, R0.z;\n"
"MUL R0.zw, R0.xyxy, R0.z;\n"
- "MUL R1.xy, R0.zwzw, c[3];\n"
+ "MUL R1.xy, R0.zwzw, c[0];\n"
"MOV R1.y, -R1;\n"
"MUL R0.xy, fragment.position, c[4];\n"
"TEX R0, R0, texture[0], 2D;\n"
@@ -6604,12 +6455,12 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MO
"TEMP R0;\n"
"TEMP R1;\n"
"TEMP R2;\n"
- "MUL R0.xyz, fragment.position.y, c[1];\n"
- "MAD R0.xyz, fragment.position.x, c[0], R0;\n"
- "ADD R0.xyz, R0, c[2];\n"
+ "MUL R0.xyz, fragment.position.y, c[2];\n"
+ "MAD R0.xyz, fragment.position.x, c[1], R0;\n"
+ "ADD R0.xyz, R0, c[3];\n"
"RCP R0.z, R0.z;\n"
"MUL R0.xy, R0, R0.z;\n"
- "MUL R0.xy, R0, c[3];\n"
+ "MUL R0.xy, R0, c[0];\n"
"MOV R0.w, -R0.y;\n"
"MOV R0.z, R0.x;\n"
"TEX R1.x, R0.zwzw, texture[1], 2D;\n"
@@ -6629,12 +6480,12 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MO
"TEMP R1;\n"
"TEMP R2;\n"
"TEMP R3;\n"
- "MUL R0.xyz, fragment.position.y, c[1];\n"
- "MAD R0.xyz, fragment.position.x, c[0], R0;\n"
- "ADD R0.xyz, R0, c[2];\n"
+ "MUL R0.xyz, fragment.position.y, c[2];\n"
+ "MAD R0.xyz, fragment.position.x, c[1], R0;\n"
+ "ADD R0.xyz, R0, c[3];\n"
"RCP R0.z, R0.z;\n"
"MUL R0.xy, R0, R0.z;\n"
- "MUL R0.xy, R0, c[3];\n"
+ "MUL R0.xy, R0, c[0];\n"
"MOV R0.y, -R0;\n"
"TEX R1.x, R0, texture[1], 2D;\n"
"MUL R1, fragment.color.primary, R1.x;\n"
@@ -6670,19 +6521,20 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MO
"TEMP R1;\n"
"TEMP R2;\n"
"TEMP R3;\n"
- "MUL R0.xyz, fragment.position.y, c[1];\n"
- "MAD R0.xyz, fragment.position.x, c[0], R0;\n"
- "ADD R0.xyz, R0, c[2];\n"
+ "MUL R0.xyz, fragment.position.y, c[2];\n"
+ "MAD R0.xyz, fragment.position.x, c[1], R0;\n"
+ "ADD R0.xyz, R0, c[3];\n"
"RCP R0.z, R0.z;\n"
"MUL R0.xy, R0, R0.z;\n"
- "MUL R0.xy, R0, c[3];\n"
- "MOV R0.y, -R0;\n"
- "TEX R1.x, R0, texture[1], 2D;\n"
+ "MUL R0.xy, R0, c[0];\n"
+ "MOV R0.w, -R0.y;\n"
+ "MOV R0.z, R0.x;\n"
+ "TEX R1.x, R0.zwzw, texture[1], 2D;\n"
"MUL R0.xy, fragment.position, c[4];\n"
"TEX R0, R0, texture[0], 2D;\n"
"MUL R1, fragment.color.primary, R1.x;\n"
"MUL R2.xyz, R1, R0.w;\n"
- "MUL R3.xyz, R0, R1.w;\n"
+ "MUL R3.xyz, R1.w, R0;\n"
"MIN R2.xyz, R2, R3;\n"
"ADD R2.w, -R0, c[5].x;\n"
"MAD R1.xyz, R1, R2.w, R2;\n"
@@ -6701,19 +6553,20 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MO
"TEMP R1;\n"
"TEMP R2;\n"
"TEMP R3;\n"
- "MUL R0.xyz, fragment.position.y, c[1];\n"
- "MAD R0.xyz, fragment.position.x, c[0], R0;\n"
- "ADD R0.xyz, R0, c[2];\n"
+ "MUL R0.xyz, fragment.position.y, c[2];\n"
+ "MAD R0.xyz, fragment.position.x, c[1], R0;\n"
+ "ADD R0.xyz, R0, c[3];\n"
"RCP R0.z, R0.z;\n"
"MUL R0.xy, R0, R0.z;\n"
- "MUL R0.xy, R0, c[3];\n"
- "MOV R0.y, -R0;\n"
- "TEX R1.x, R0, texture[1], 2D;\n"
+ "MUL R0.xy, R0, c[0];\n"
+ "MOV R0.w, -R0.y;\n"
+ "MOV R0.z, R0.x;\n"
+ "TEX R1.x, R0.zwzw, texture[1], 2D;\n"
"MUL R0.xy, fragment.position, c[4];\n"
"TEX R0, R0, texture[0], 2D;\n"
"MUL R1, fragment.color.primary, R1.x;\n"
"MUL R2.xyz, R1, R0.w;\n"
- "MUL R3.xyz, R0, R1.w;\n"
+ "MUL R3.xyz, R1.w, R0;\n"
"MAX R2.xyz, R2, R3;\n"
"ADD R2.w, -R0, c[5].x;\n"
"MAD R1.xyz, R1, R2.w, R2;\n"
@@ -6727,17 +6580,17 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MO
static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MODES_COLORDODGE_NOMASK =
"!!ARBfp1.0\n"
"PARAM c[6] = { program.local[0..4],\n"
- " { 1, 1e-06 } };\n"
+ " { 1, 1e-006 } };\n"
"TEMP R0;\n"
"TEMP R1;\n"
"TEMP R2;\n"
"TEMP R3;\n"
- "MUL R0.xyz, fragment.position.y, c[1];\n"
- "MAD R0.xyz, fragment.position.x, c[0], R0;\n"
- "ADD R0.xyz, R0, c[2];\n"
+ "MUL R0.xyz, fragment.position.y, c[2];\n"
+ "MAD R0.xyz, fragment.position.x, c[1], R0;\n"
+ "ADD R0.xyz, R0, c[3];\n"
"RCP R0.z, R0.z;\n"
"MUL R0.xy, R0, R0.z;\n"
- "MUL R0.xy, R0, c[3];\n"
+ "MUL R0.xy, R0, c[0];\n"
"MOV R0.y, -R0;\n"
"TEX R0.x, R0, texture[1], 2D;\n"
"MUL R1, fragment.color.primary, R0.x;\n"
@@ -6751,7 +6604,7 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MO
"MUL R3.xyz, R0, R2.w;\n"
"ADD R2.w, -R0, c[5].x;\n"
"MAD R3.xyz, R1, R2.w, R3;\n"
- "MUL R0.xyz, R0, R1.w;\n"
+ "MUL R0.xyz, R1.w, R0;\n"
"RCP R2.x, R2.x;\n"
"RCP R2.y, R2.y;\n"
"RCP R2.z, R2.z;\n"
@@ -6770,25 +6623,26 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MO
static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MODES_COLORBURN_NOMASK =
"!!ARBfp1.0\n"
"PARAM c[6] = { program.local[0..4],\n"
- " { 1, 9.9999997e-06 } };\n"
+ " { 1, 9.9999997e-006 } };\n"
"TEMP R0;\n"
"TEMP R1;\n"
"TEMP R2;\n"
"TEMP R3;\n"
"TEMP R4;\n"
"TEMP R5;\n"
- "MUL R0.xyz, fragment.position.y, c[1];\n"
- "MAD R0.xyz, fragment.position.x, c[0], R0;\n"
- "ADD R0.xyz, R0, c[2];\n"
+ "MUL R0.xyz, fragment.position.y, c[2];\n"
+ "MAD R0.xyz, fragment.position.x, c[1], R0;\n"
+ "ADD R0.xyz, R0, c[3];\n"
"RCP R0.z, R0.z;\n"
"MUL R0.xy, R0, R0.z;\n"
- "MUL R0.xy, R0, c[3];\n"
- "MOV R0.y, -R0;\n"
- "TEX R1.x, R0, texture[1], 2D;\n"
+ "MUL R0.xy, R0, c[0];\n"
+ "MOV R0.w, -R0.y;\n"
+ "MOV R0.z, R0.x;\n"
+ "TEX R1.x, R0.zwzw, texture[1], 2D;\n"
"MUL R1, fragment.color.primary, R1.x;\n"
"MUL R0.xy, fragment.position, c[4];\n"
"TEX R0, R0, texture[0], 2D;\n"
- "MUL R2.xyz, R0, R1.w;\n"
+ "MUL R2.xyz, R1.w, R0;\n"
"MAD R3.xyz, R1, R0.w, R2;\n"
"ADD R2.w, -R0, c[5].x;\n"
"MAD R2.xyz, -R1.w, R0.w, R3;\n"
@@ -6801,9 +6655,8 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MO
"RCP R2.z, R2.z;\n"
"MAD R2.xyz, R4, R2, R5;\n"
"MUL R4.xyz, R0, R3.w;\n"
- "MAD R1.xyz, R1, R2.w, R4;\n"
- "ADD R3.w, -R1, c[5].x;\n"
"MAD R0.xyz, R0, R3.w, R2;\n"
+ "MAD R1.xyz, R1, R2.w, R4;\n"
"MUL R2.x, R1.w, R0.w;\n"
"ADD R2.w, R1, R0;\n"
"ADD R0.xyz, R0, -R1;\n"
@@ -6822,12 +6675,12 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MO
"TEMP R2;\n"
"TEMP R3;\n"
"TEMP R4;\n"
- "MUL R0.xyz, fragment.position.y, c[1];\n"
- "MAD R0.xyz, fragment.position.x, c[0], R0;\n"
- "ADD R0.xyz, R0, c[2];\n"
+ "MUL R0.xyz, fragment.position.y, c[2];\n"
+ "MAD R0.xyz, fragment.position.x, c[1], R0;\n"
+ "ADD R0.xyz, R0, c[3];\n"
"RCP R0.z, R0.z;\n"
"MUL R0.xy, R0, R0.z;\n"
- "MUL R0.xy, R0, c[3];\n"
+ "MUL R0.xy, R0, c[0];\n"
"MOV R0.y, -R0;\n"
"TEX R1.x, R0, texture[1], 2D;\n"
"MUL R1, fragment.color.primary, R1.x;\n"
@@ -6858,57 +6711,55 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MO
static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MODES_SOFTLIGHT_NOMASK =
"!!ARBfp1.0\n"
"PARAM c[7] = { program.local[0..4],\n"
- " { 1, 9.9999997e-06, 2, 8 },\n"
- " { 3 } };\n"
+ " { 1, 9.9999997e-006, 2, 3 },\n"
+ " { 8 } };\n"
"TEMP R0;\n"
"TEMP R1;\n"
"TEMP R2;\n"
"TEMP R3;\n"
"TEMP R4;\n"
"TEMP R5;\n"
- "MUL R0.xyz, fragment.position.y, c[1];\n"
- "MAD R0.xyz, fragment.position.x, c[0], R0;\n"
- "ADD R1.xyz, R0, c[2];\n"
+ "TEMP R6;\n"
+ "MUL R0.xyz, fragment.position.y, c[2];\n"
+ "MAD R0.xyz, fragment.position.x, c[1], R0;\n"
+ "ADD R1.xyz, R0, c[3];\n"
"RCP R0.z, R1.z;\n"
"MUL R1.xy, R1, R0.z;\n"
- "MUL R1.xy, R1, c[3];\n"
+ "MUL R1.xy, R1, c[0];\n"
"MOV R1.y, -R1;\n"
"MUL R0.xy, fragment.position, c[4];\n"
"TEX R0, R0, texture[0], 2D;\n"
"MAX R1.z, R0.w, c[5].y;\n"
"RCP R2.w, R1.z;\n"
"MUL R2.xyz, R0, R2.w;\n"
- "MUL R5.xyz, -R2, c[5].w;\n"
- "MAD R4.xyz, -R0, R2.w, c[5].x;\n"
+ "MUL R6.xyz, -R2, c[6].x;\n"
+ "MAD R3.xyz, -R0, R2.w, c[5].x;\n"
"TEX R1.x, R1, texture[1], 2D;\n"
"MUL R1, fragment.color.primary, R1.x;\n"
- "MAD R3.xyz, R1, c[5].z, -R1.w;\n"
+ "MAD R4.xyz, R1, c[5].z, -R1.w;\n"
+ "MUL R5.xyz, R3, R4;\n"
+ "MAD R3.xyz, -R3, R4, R1.w;\n"
+ "ADD R6.xyz, R6, c[5].w;\n"
+ "MAD R5.xyz, -R5, R6, R1.w;\n"
"RSQ R2.x, R2.x;\n"
"RSQ R2.z, R2.z;\n"
"RSQ R2.y, R2.y;\n"
- "MUL R4.xyz, R4, R3;\n"
- "ADD R5.xyz, R5, c[6].x;\n"
- "MUL R5.xyz, R4, R5;\n"
- "ADD R4.xyz, R1.w, -R4;\n"
+ "MUL R5.xyz, R0, R5;\n"
+ "MUL R3.xyz, R0, R3;\n"
"RCP R2.x, R2.x;\n"
"RCP R2.z, R2.z;\n"
"RCP R2.y, R2.y;\n"
- "MAD R2.xyz, R2, R0.w, -R0;\n"
- "MUL R3.xyz, R2, R3;\n"
- "ADD R2.xyz, R1.w, -R5;\n"
- "MAD R5.xyz, R0, R1.w, R3;\n"
- "MUL R2.xyz, R0, R2;\n"
- "MUL R3.xyz, R0, c[5].w;\n"
- "ADD R5.xyz, R5, -R2;\n"
- "SGE R3.xyz, R3, R0.w;\n"
- "MUL R3.xyz, R3, R5;\n"
- "ADD R2.xyz, R2, R3;\n"
- "MUL R3.xyz, R0, R4;\n"
+ "MAD R2.xyz, R0.w, R2, -R0;\n"
+ "MUL R2.xyz, R2, R4;\n"
+ "MAD R2.xyz, R1.w, R0, R2;\n"
+ "ADD R6.xyz, R2, -R5;\n"
"MUL R4.xyz, R1, c[5].z;\n"
+ "MUL R2.xyz, R0, c[6].x;\n"
+ "SGE R2.xyz, R2, R0.w;\n"
+ "MAD R2.xyz, R2, R6, R5;\n"
"ADD R2.xyz, R2, -R3;\n"
"SGE R4.xyz, R4, R1.w;\n"
- "MUL R2.xyz, R4, R2;\n"
- "ADD R2.xyz, R3, R2;\n"
+ "MAD R2.xyz, R4, R2, R3;\n"
"ADD R2.w, -R0, c[5].x;\n"
"MAD R1.xyz, R1, R2.w, R2;\n"
"ADD R2.x, R1.w, R0.w;\n"
@@ -6926,18 +6777,19 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MO
"TEMP R1;\n"
"TEMP R2;\n"
"TEMP R3;\n"
- "MUL R0.xyz, fragment.position.y, c[1];\n"
- "MAD R0.xyz, fragment.position.x, c[0], R0;\n"
- "ADD R0.xyz, R0, c[2];\n"
+ "MUL R0.xyz, fragment.position.y, c[2];\n"
+ "MAD R0.xyz, fragment.position.x, c[1], R0;\n"
+ "ADD R0.xyz, R0, c[3];\n"
"RCP R0.z, R0.z;\n"
"MUL R0.xy, R0, R0.z;\n"
- "MUL R0.xy, R0, c[3];\n"
- "MOV R0.y, -R0;\n"
- "TEX R1.x, R0, texture[1], 2D;\n"
+ "MUL R0.xy, R0, c[0];\n"
+ "MOV R0.w, -R0.y;\n"
+ "MOV R0.z, R0.x;\n"
+ "TEX R1.x, R0.zwzw, texture[1], 2D;\n"
"MUL R0.xy, fragment.position, c[4];\n"
- "MUL R1, fragment.color.primary, R1.x;\n"
"TEX R0, R0, texture[0], 2D;\n"
- "MUL R3.xyz, R0, R1.w;\n"
+ "MUL R1, fragment.color.primary, R1.x;\n"
+ "MUL R3.xyz, R1.w, R0;\n"
"MUL R2.xyz, R1, R0.w;\n"
"ADD R0.xyz, R1, R0;\n"
"MIN R2.xyz, R2, R3;\n"
@@ -6950,30 +6802,31 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MO
static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MODES_EXCLUSION_NOMASK =
"!!ARBfp1.0\n"
"PARAM c[6] = { program.local[0..4],\n"
- " { 1, 2 } };\n"
+ " { 2, 1 } };\n"
"TEMP R0;\n"
"TEMP R1;\n"
"TEMP R2;\n"
"TEMP R3;\n"
- "MUL R0.xyz, fragment.position.y, c[1];\n"
- "MAD R0.xyz, fragment.position.x, c[0], R0;\n"
- "ADD R0.xyz, R0, c[2];\n"
+ "MUL R0.xyz, fragment.position.y, c[2];\n"
+ "MAD R0.xyz, fragment.position.x, c[1], R0;\n"
+ "ADD R0.xyz, R0, c[3];\n"
"RCP R0.z, R0.z;\n"
"MUL R0.xy, R0, R0.z;\n"
- "MUL R0.xy, R0, c[3];\n"
- "MOV R0.y, -R0;\n"
- "TEX R1.x, R0, texture[1], 2D;\n"
+ "MUL R0.xy, R0, c[0];\n"
+ "MOV R0.w, -R0.y;\n"
+ "MOV R0.z, R0.x;\n"
+ "TEX R1.x, R0.zwzw, texture[1], 2D;\n"
"MUL R0.xy, fragment.position, c[4];\n"
"TEX R0, R0, texture[0], 2D;\n"
"MUL R1, fragment.color.primary, R1.x;\n"
- "MUL R2.xyz, R0, R1.w;\n"
+ "MUL R2.xyz, R1.w, R0;\n"
"MAD R3.xyz, R1, R0.w, R2;\n"
"MUL R2.xyz, R1, R0;\n"
- "MAD R2.xyz, -R2, c[5].y, R3;\n"
- "ADD R2.w, -R0, c[5].x;\n"
+ "MAD R2.xyz, -R2, c[5].x, R3;\n"
+ "ADD R2.w, -R0, c[5].y;\n"
"MAD R1.xyz, R1, R2.w, R2;\n"
"ADD R2.x, R1.w, R0.w;\n"
- "ADD R2.y, -R1.w, c[5].x;\n"
+ "ADD R2.y, -R1.w, c[5];\n"
"MAD result.color.xyz, R0, R2.y, R1;\n"
"MAD result.color.w, -R1, R0, R2.x;\n"
"END\n"
@@ -6984,15 +6837,15 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MO
"PARAM c[7] = { program.local[0..6] };\n"
"TEMP R0;\n"
"TEMP R1;\n"
- "MUL R0.xyz, fragment.position.y, c[1];\n"
- "MAD R0.xyz, fragment.position.x, c[0], R0;\n"
- "ADD R1.xyz, R0, c[2];\n"
+ "MUL R0.xyz, fragment.position.y, c[2];\n"
+ "MAD R0.xyz, fragment.position.x, c[1], R0;\n"
+ "ADD R1.xyz, R0, c[3];\n"
"RCP R0.z, R1.z;\n"
"MUL R0.zw, R1.xyxy, R0.z;\n"
- "MUL R1.xy, R0.zwzw, c[3];\n"
+ "MUL R1.xy, R0.zwzw, c[0];\n"
"MOV R1.y, -R1;\n"
- "ADD R0.xy, fragment.position, c[4];\n"
- "MUL R0.xy, R0, c[5];\n"
+ "ADD R0.xy, fragment.position, c[5];\n"
+ "MUL R0.xy, R0, c[4];\n"
"TEX R0, R0, texture[0], 2D;\n"
"TEX R1.x, R1, texture[1], 2D;\n"
"DP4 R0.x, R0, c[6];\n"
@@ -7005,12 +6858,12 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MO
"!!ARBfp1.0\n"
"PARAM c[4] = { program.local[0..3] };\n"
"TEMP R0;\n"
- "MUL R0.xyz, fragment.position.y, c[1];\n"
- "MAD R0.xyz, fragment.position.x, c[0], R0;\n"
- "ADD R0.xyz, R0, c[2];\n"
+ "MUL R0.xyz, fragment.position.y, c[2];\n"
+ "MAD R0.xyz, fragment.position.x, c[1], R0;\n"
+ "ADD R0.xyz, R0, c[3];\n"
"RCP R0.z, R0.z;\n"
"MUL R0.xy, R0, R0.z;\n"
- "MUL R0.xy, R0, c[3];\n"
+ "MUL R0.xy, R0, c[0];\n"
"MOV R0.y, -R0;\n"
"TEX R0.x, R0, texture[0], 2D;\n"
"MUL result.color, fragment.color.primary, R0.x;\n"
@@ -7195,19 +7048,19 @@ static const char *painter_fragment_program_sources[num_fragment_brushes][num_fr
static int painter_variable_locations[num_fragment_brushes][num_fragment_composition_modes][num_fragment_variables] = {
{
- { -1, -1, -1, 1, -1, 6, 2, -1, 5, 3, 1, 0, -1, 0, -1, -1, -1, -1, -1, },
- { -1, -1, -1, 1, -1, -1, 2, -1, -1, 3, 1, 0, -1, 0, -1, -1, -1, -1, -1, },
- { -1, -1, -1, 1, -1, -1, 2, -1, -1, 3, 1, 0, -1, 0, -1, -1, -1, -1, -1, },
- { -1, -1, -1, 1, -1, -1, 2, -1, -1, 3, 1, 0, -1, 0, -1, -1, -1, -1, -1, },
- { -1, -1, -1, 1, -1, -1, 2, -1, -1, 3, 1, 0, -1, 0, -1, -1, -1, -1, -1, },
- { -1, -1, -1, 1, -1, -1, 2, -1, -1, 3, 1, 0, -1, 0, -1, -1, -1, -1, -1, },
- { -1, -1, -1, 1, -1, -1, 2, -1, -1, 3, 1, 0, -1, 0, -1, -1, -1, -1, -1, },
- { -1, -1, -1, 1, -1, -1, 2, -1, -1, 3, 1, 0, -1, 0, -1, -1, -1, -1, -1, },
- { -1, -1, -1, 1, -1, -1, 2, -1, -1, 3, 1, 0, -1, 0, -1, -1, -1, -1, -1, },
- { -1, -1, -1, 1, -1, -1, 2, -1, -1, 3, 1, 0, -1, 0, -1, -1, -1, -1, -1, },
- { -1, -1, -1, 1, -1, -1, 2, -1, -1, 3, 1, 0, -1, 0, -1, -1, -1, -1, -1, },
- { -1, -1, -1, 1, -1, -1, 2, -1, -1, 3, 1, 0, -1, 0, -1, -1, -1, -1, -1, },
- { -1, -1, -1, -1, -1, 3, -1, -1, 2, 0, -1, 0, -1, -1, -1, -1, -1, -1, -1, },
+ { -1, -1, -1, 2, -1, 0, 5, -1, 1, 3, 1, 0, -1, 4, -1, -1, -1, -1, -1, },
+ { -1, -1, -1, 0, -1, -1, 3, -1, -1, 1, 1, 0, -1, 2, -1, -1, -1, -1, -1, },
+ { -1, -1, -1, 0, -1, -1, 3, -1, -1, 1, 1, 0, -1, 2, -1, -1, -1, -1, -1, },
+ { -1, -1, -1, 0, -1, -1, 3, -1, -1, 1, 1, 0, -1, 2, -1, -1, -1, -1, -1, },
+ { -1, -1, -1, 0, -1, -1, 3, -1, -1, 1, 1, 0, -1, 2, -1, -1, -1, -1, -1, },
+ { -1, -1, -1, 0, -1, -1, 3, -1, -1, 1, 1, 0, -1, 2, -1, -1, -1, -1, -1, },
+ { -1, -1, -1, 0, -1, -1, 3, -1, -1, 1, 1, 0, -1, 2, -1, -1, -1, -1, -1, },
+ { -1, -1, -1, 0, -1, -1, 3, -1, -1, 1, 1, 0, -1, 2, -1, -1, -1, -1, -1, },
+ { -1, -1, -1, 0, -1, -1, 3, -1, -1, 1, 1, 0, -1, 2, -1, -1, -1, -1, -1, },
+ { -1, -1, -1, 0, -1, -1, 3, -1, -1, 1, 1, 0, -1, 2, -1, -1, -1, -1, -1, },
+ { -1, -1, -1, 0, -1, -1, 3, -1, -1, 1, 1, 0, -1, 2, -1, -1, -1, -1, -1, },
+ { -1, -1, -1, 0, -1, -1, 3, -1, -1, 1, 1, 0, -1, 2, -1, -1, -1, -1, -1, },
+ { -1, -1, -1, -1, -1, 0, -1, -1, 1, 2, -1, 0, -1, -1, -1, -1, -1, -1, -1, },
{ -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, -1, 0, -1, -1, -1, -1, -1, -1, -1, },
{ -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, -1, 0, -1, -1, -1, -1, -1, -1, -1, },
{ -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, -1, 0, -1, -1, -1, -1, -1, -1, -1, },
@@ -7219,154 +7072,154 @@ static int painter_variable_locations[num_fragment_brushes][num_fragment_composi
{ -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, -1, 0, -1, -1, -1, -1, -1, -1, -1, },
{ -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, -1, 0, -1, -1, -1, -1, -1, -1, -1, },
{ -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, -1, 0, -1, -1, -1, -1, -1, -1, -1, },
- { -1, -1, -1, 1, -1, -1, 2, -1, -1, -1, 0, -1, -1, 0, -1, -1, -1, -1, -1, },
+ { -1, -1, -1, 0, -1, -1, 2, -1, -1, -1, 0, -1, -1, 1, -1, -1, -1, -1, -1, },
{ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
},
{
- { -1, -1, 4, 1, 5, 11, 2, -1, 10, 9, 1, 0, 2, 0, -1, 8, 6, 3, -1, },
- { -1, -1, 4, 1, 5, -1, 2, -1, -1, 9, 1, 0, 2, 0, -1, 8, 6, 3, -1, },
- { -1, -1, 4, 1, 5, -1, 2, -1, -1, 9, 1, 0, 2, 0, -1, 8, 6, 3, -1, },
- { -1, -1, 4, 1, 5, -1, 2, -1, -1, 9, 1, 0, 2, 0, -1, 8, 6, 3, -1, },
- { -1, -1, 4, 1, 5, -1, 2, -1, -1, 9, 1, 0, 2, 0, -1, 8, 6, 3, -1, },
- { -1, -1, 4, 1, 5, -1, 2, -1, -1, 9, 1, 0, 2, 0, -1, 8, 6, 3, -1, },
- { -1, -1, 4, 1, 5, -1, 2, -1, -1, 9, 1, 0, 2, 0, -1, 8, 6, 3, -1, },
- { -1, -1, 4, 1, 5, -1, 2, -1, -1, 9, 1, 0, 2, 0, -1, 8, 6, 3, -1, },
- { -1, -1, 4, 1, 5, -1, 2, -1, -1, 9, 1, 0, 2, 0, -1, 8, 6, 3, -1, },
- { -1, -1, 4, 1, 5, -1, 2, -1, -1, 9, 1, 0, 2, 0, -1, 8, 6, 3, -1, },
- { -1, -1, 4, 1, 5, -1, 2, -1, -1, 9, 1, 0, 2, 0, -1, 8, 6, 3, -1, },
- { -1, -1, 4, 1, 5, -1, 2, -1, -1, 9, 1, 0, 2, 0, -1, 8, 6, 3, -1, },
- { -1, -1, 1, -1, 2, 8, -1, -1, 7, 6, -1, 0, 1, -1, -1, 5, 3, 0, -1, },
- { -1, -1, 1, -1, 2, -1, -1, -1, -1, 6, -1, 0, 1, -1, -1, 5, 3, 0, -1, },
- { -1, -1, 1, -1, 2, -1, -1, -1, -1, 6, -1, 0, 1, -1, -1, 5, 3, 0, -1, },
- { -1, -1, 1, -1, 2, -1, -1, -1, -1, 6, -1, 0, 1, -1, -1, 5, 3, 0, -1, },
- { -1, -1, 1, -1, 2, -1, -1, -1, -1, 6, -1, 0, 1, -1, -1, 5, 3, 0, -1, },
- { -1, -1, 1, -1, 2, -1, -1, -1, -1, 6, -1, 0, 1, -1, -1, 5, 3, 0, -1, },
- { -1, -1, 1, -1, 2, -1, -1, -1, -1, 6, -1, 0, 1, -1, -1, 5, 3, 0, -1, },
- { -1, -1, 1, -1, 2, -1, -1, -1, -1, 6, -1, 0, 1, -1, -1, 5, 3, 0, -1, },
- { -1, -1, 1, -1, 2, -1, -1, -1, -1, 6, -1, 0, 1, -1, -1, 5, 3, 0, -1, },
- { -1, -1, 1, -1, 2, -1, -1, -1, -1, 6, -1, 0, 1, -1, -1, 5, 3, 0, -1, },
- { -1, -1, 1, -1, 2, -1, -1, -1, -1, 6, -1, 0, 1, -1, -1, 5, 3, 0, -1, },
- { -1, -1, 1, -1, 2, -1, -1, -1, -1, 6, -1, 0, 1, -1, -1, 5, 3, 0, -1, },
- { -1, -1, 1, 7, 2, -1, 8, -1, -1, -1, 0, -1, 1, 6, -1, 5, 3, 0, -1, },
- { -1, -1, 1, -1, 2, -1, -1, -1, -1, -1, -1, -1, 0, -1, -1, 5, 3, 0, -1, },
+ { -1, -1, 3, 7, 4, 5, 10, -1, 6, 8, 1, 0, 2, 9, -1, 1, 0, 2, -1, },
+ { -1, -1, 3, 5, 4, -1, 8, -1, -1, 6, 1, 0, 2, 7, -1, 1, 0, 2, -1, },
+ { -1, -1, 3, 5, 4, -1, 8, -1, -1, 6, 1, 0, 2, 7, -1, 1, 0, 2, -1, },
+ { -1, -1, 3, 5, 4, -1, 8, -1, -1, 6, 1, 0, 2, 7, -1, 1, 0, 2, -1, },
+ { -1, -1, 3, 5, 4, -1, 8, -1, -1, 6, 1, 0, 2, 7, -1, 1, 0, 2, -1, },
+ { -1, -1, 3, 5, 4, -1, 8, -1, -1, 6, 1, 0, 2, 7, -1, 1, 0, 2, -1, },
+ { -1, -1, 3, 5, 4, -1, 8, -1, -1, 6, 1, 0, 2, 7, -1, 1, 0, 2, -1, },
+ { -1, -1, 3, 5, 4, -1, 8, -1, -1, 6, 1, 0, 2, 7, -1, 1, 0, 2, -1, },
+ { -1, -1, 3, 5, 4, -1, 8, -1, -1, 6, 1, 0, 2, 7, -1, 1, 0, 2, -1, },
+ { -1, -1, 3, 5, 4, -1, 8, -1, -1, 6, 1, 0, 2, 7, -1, 1, 0, 2, -1, },
+ { -1, -1, 3, 5, 4, -1, 8, -1, -1, 6, 1, 0, 2, 7, -1, 1, 0, 2, -1, },
+ { -1, -1, 3, 5, 4, -1, 8, -1, -1, 6, 1, 0, 2, 7, -1, 1, 0, 2, -1, },
+ { -1, -1, 3, -1, 4, 5, -1, -1, 6, 7, -1, 0, 1, -1, -1, 1, 0, 2, -1, },
+ { -1, -1, 3, -1, 4, -1, -1, -1, -1, 5, -1, 0, 1, -1, -1, 1, 0, 2, -1, },
+ { -1, -1, 3, -1, 4, -1, -1, -1, -1, 5, -1, 0, 1, -1, -1, 1, 0, 2, -1, },
+ { -1, -1, 3, -1, 4, -1, -1, -1, -1, 5, -1, 0, 1, -1, -1, 1, 0, 2, -1, },
+ { -1, -1, 3, -1, 4, -1, -1, -1, -1, 5, -1, 0, 1, -1, -1, 1, 0, 2, -1, },
+ { -1, -1, 3, -1, 4, -1, -1, -1, -1, 5, -1, 0, 1, -1, -1, 1, 0, 2, -1, },
+ { -1, -1, 3, -1, 4, -1, -1, -1, -1, 5, -1, 0, 1, -1, -1, 1, 0, 2, -1, },
+ { -1, -1, 3, -1, 4, -1, -1, -1, -1, 5, -1, 0, 1, -1, -1, 1, 0, 2, -1, },
+ { -1, -1, 3, -1, 4, -1, -1, -1, -1, 5, -1, 0, 1, -1, -1, 1, 0, 2, -1, },
+ { -1, -1, 3, -1, 4, -1, -1, -1, -1, 5, -1, 0, 1, -1, -1, 1, 0, 2, -1, },
+ { -1, -1, 3, -1, 4, -1, -1, -1, -1, 5, -1, 0, 1, -1, -1, 1, 0, 2, -1, },
+ { -1, -1, 3, -1, 4, -1, -1, -1, -1, 5, -1, 0, 1, -1, -1, 1, 0, 2, -1, },
+ { -1, -1, 3, 5, 4, -1, 7, -1, -1, -1, 0, -1, 1, 6, -1, 1, 0, 2, -1, },
+ { -1, -1, 3, -1, 4, -1, -1, -1, -1, -1, -1, -1, 0, -1, -1, 1, 0, 2, -1, },
},
{
- { -1, -1, 4, 1, 5, 12, 2, -1, 11, 10, 1, 0, 2, 0, -1, -1, -1, 3, 8, },
- { -1, -1, 4, 1, 5, -1, 2, -1, -1, 10, 1, 0, 2, 0, -1, -1, -1, 3, 8, },
- { -1, -1, 4, 1, 5, -1, 2, -1, -1, 10, 1, 0, 2, 0, -1, -1, -1, 3, 8, },
- { -1, -1, 4, 1, 5, -1, 2, -1, -1, 10, 1, 0, 2, 0, -1, -1, -1, 3, 8, },
- { -1, -1, 4, 1, 5, -1, 2, -1, -1, 10, 1, 0, 2, 0, -1, -1, -1, 3, 8, },
- { -1, -1, 4, 1, 5, -1, 2, -1, -1, 10, 1, 0, 2, 0, -1, -1, -1, 3, 8, },
- { -1, -1, 4, 1, 5, -1, 2, -1, -1, 10, 1, 0, 2, 0, -1, -1, -1, 3, 8, },
- { -1, -1, 4, 1, 5, -1, 2, -1, -1, 10, 1, 0, 2, 0, -1, -1, -1, 3, 8, },
- { -1, -1, 4, 1, 5, -1, 2, -1, -1, 10, 1, 0, 2, 0, -1, -1, -1, 3, 8, },
- { -1, -1, 4, 1, 5, -1, 2, -1, -1, 10, 1, 0, 2, 0, -1, -1, -1, 3, 8, },
- { -1, -1, 4, 1, 5, -1, 2, -1, -1, 10, 1, 0, 2, 0, -1, -1, -1, 3, 8, },
- { -1, -1, 4, 1, 5, -1, 2, -1, -1, 10, 1, 0, 2, 0, -1, -1, -1, 3, 8, },
- { -1, -1, 1, -1, 2, 9, -1, -1, 8, 7, -1, 0, 1, -1, -1, -1, -1, 0, 5, },
- { -1, -1, 1, -1, 2, -1, -1, -1, -1, 7, -1, 0, 1, -1, -1, -1, -1, 0, 5, },
- { -1, -1, 1, -1, 2, -1, -1, -1, -1, 7, -1, 0, 1, -1, -1, -1, -1, 0, 5, },
- { -1, -1, 1, -1, 2, -1, -1, -1, -1, 7, -1, 0, 1, -1, -1, -1, -1, 0, 5, },
- { -1, -1, 1, -1, 2, -1, -1, -1, -1, 7, -1, 0, 1, -1, -1, -1, -1, 0, 5, },
- { -1, -1, 1, -1, 2, -1, -1, -1, -1, 7, -1, 0, 1, -1, -1, -1, -1, 0, 5, },
- { -1, -1, 1, -1, 2, -1, -1, -1, -1, 7, -1, 0, 1, -1, -1, -1, -1, 0, 5, },
- { -1, -1, 1, -1, 2, -1, -1, -1, -1, 7, -1, 0, 1, -1, -1, -1, -1, 0, 5, },
- { -1, -1, 1, -1, 2, -1, -1, -1, -1, 7, -1, 0, 1, -1, -1, -1, -1, 0, 5, },
- { -1, -1, 1, -1, 2, -1, -1, -1, -1, 7, -1, 0, 1, -1, -1, -1, -1, 0, 5, },
- { -1, -1, 1, -1, 2, -1, -1, -1, -1, 7, -1, 0, 1, -1, -1, -1, -1, 0, 5, },
- { -1, -1, 1, -1, 2, -1, -1, -1, -1, 7, -1, 0, 1, -1, -1, -1, -1, 0, 5, },
- { -1, -1, 1, 8, 2, -1, 9, -1, -1, -1, 0, -1, 1, 7, -1, -1, -1, 0, 5, },
- { -1, -1, 1, -1, 2, -1, -1, -1, -1, -1, -1, -1, 0, -1, -1, -1, -1, 0, 5, },
+ { -1, -1, 2, 6, 3, 4, 9, -1, 5, 7, 1, 0, 2, 8, -1, -1, -1, 1, 0, },
+ { -1, -1, 2, 4, 3, -1, 7, -1, -1, 5, 1, 0, 2, 6, -1, -1, -1, 1, 0, },
+ { -1, -1, 2, 4, 3, -1, 7, -1, -1, 5, 1, 0, 2, 6, -1, -1, -1, 1, 0, },
+ { -1, -1, 2, 4, 3, -1, 7, -1, -1, 5, 1, 0, 2, 6, -1, -1, -1, 1, 0, },
+ { -1, -1, 2, 4, 3, -1, 7, -1, -1, 5, 1, 0, 2, 6, -1, -1, -1, 1, 0, },
+ { -1, -1, 2, 4, 3, -1, 7, -1, -1, 5, 1, 0, 2, 6, -1, -1, -1, 1, 0, },
+ { -1, -1, 2, 4, 3, -1, 7, -1, -1, 5, 1, 0, 2, 6, -1, -1, -1, 1, 0, },
+ { -1, -1, 2, 4, 3, -1, 7, -1, -1, 5, 1, 0, 2, 6, -1, -1, -1, 1, 0, },
+ { -1, -1, 2, 4, 3, -1, 7, -1, -1, 5, 1, 0, 2, 6, -1, -1, -1, 1, 0, },
+ { -1, -1, 2, 4, 3, -1, 7, -1, -1, 5, 1, 0, 2, 6, -1, -1, -1, 1, 0, },
+ { -1, -1, 2, 4, 3, -1, 7, -1, -1, 5, 1, 0, 2, 6, -1, -1, -1, 1, 0, },
+ { -1, -1, 2, 4, 3, -1, 7, -1, -1, 5, 1, 0, 2, 6, -1, -1, -1, 1, 0, },
+ { -1, -1, 2, -1, 3, 4, -1, -1, 5, 6, -1, 0, 1, -1, -1, -1, -1, 1, 0, },
+ { -1, -1, 2, -1, 3, -1, -1, -1, -1, 4, -1, 0, 1, -1, -1, -1, -1, 1, 0, },
+ { -1, -1, 2, -1, 3, -1, -1, -1, -1, 4, -1, 0, 1, -1, -1, -1, -1, 1, 0, },
+ { -1, -1, 2, -1, 3, -1, -1, -1, -1, 4, -1, 0, 1, -1, -1, -1, -1, 1, 0, },
+ { -1, -1, 2, -1, 3, -1, -1, -1, -1, 4, -1, 0, 1, -1, -1, -1, -1, 1, 0, },
+ { -1, -1, 2, -1, 3, -1, -1, -1, -1, 4, -1, 0, 1, -1, -1, -1, -1, 1, 0, },
+ { -1, -1, 2, -1, 3, -1, -1, -1, -1, 4, -1, 0, 1, -1, -1, -1, -1, 1, 0, },
+ { -1, -1, 2, -1, 3, -1, -1, -1, -1, 4, -1, 0, 1, -1, -1, -1, -1, 1, 0, },
+ { -1, -1, 2, -1, 3, -1, -1, -1, -1, 4, -1, 0, 1, -1, -1, -1, -1, 1, 0, },
+ { -1, -1, 2, -1, 3, -1, -1, -1, -1, 4, -1, 0, 1, -1, -1, -1, -1, 1, 0, },
+ { -1, -1, 2, -1, 3, -1, -1, -1, -1, 4, -1, 0, 1, -1, -1, -1, -1, 1, 0, },
+ { -1, -1, 2, -1, 3, -1, -1, -1, -1, 4, -1, 0, 1, -1, -1, -1, -1, 1, 0, },
+ { -1, -1, 2, 4, 3, -1, 6, -1, -1, -1, 0, -1, 1, 5, -1, -1, -1, 1, 0, },
+ { -1, -1, 2, -1, 3, -1, -1, -1, -1, -1, -1, -1, 0, -1, -1, -1, -1, 1, 0, },
},
{
- { -1, 6, 4, 1, 5, 10, 2, -1, 9, 7, 1, 0, 2, 0, -1, -1, -1, 3, -1, },
- { -1, 6, 4, 1, 5, -1, 2, -1, -1, 7, 1, 0, 2, 0, -1, -1, -1, 3, -1, },
- { -1, 6, 4, 1, 5, -1, 2, -1, -1, 7, 1, 0, 2, 0, -1, -1, -1, 3, -1, },
- { -1, 6, 4, 1, 5, -1, 2, -1, -1, 7, 1, 0, 2, 0, -1, -1, -1, 3, -1, },
- { -1, 6, 4, 1, 5, -1, 2, -1, -1, 7, 1, 0, 2, 0, -1, -1, -1, 3, -1, },
- { -1, 6, 4, 1, 5, -1, 2, -1, -1, 7, 1, 0, 2, 0, -1, -1, -1, 3, -1, },
- { -1, 6, 4, 1, 5, -1, 2, -1, -1, 7, 1, 0, 2, 0, -1, -1, -1, 3, -1, },
- { -1, 6, 4, 1, 5, -1, 2, -1, -1, 7, 1, 0, 2, 0, -1, -1, -1, 3, -1, },
- { -1, 6, 4, 1, 5, -1, 2, -1, -1, 7, 1, 0, 2, 0, -1, -1, -1, 3, -1, },
- { -1, 6, 4, 1, 5, -1, 2, -1, -1, 7, 1, 0, 2, 0, -1, -1, -1, 3, -1, },
- { -1, 6, 4, 1, 5, -1, 2, -1, -1, 7, 1, 0, 2, 0, -1, -1, -1, 3, -1, },
- { -1, 6, 4, 1, 5, -1, 2, -1, -1, 7, 1, 0, 2, 0, -1, -1, -1, 3, -1, },
- { -1, 3, 1, -1, 2, 7, -1, -1, 6, 4, -1, 0, 1, -1, -1, -1, -1, 0, -1, },
- { -1, 3, 1, -1, 2, -1, -1, -1, -1, 4, -1, 0, 1, -1, -1, -1, -1, 0, -1, },
- { -1, 3, 1, -1, 2, -1, -1, -1, -1, 4, -1, 0, 1, -1, -1, -1, -1, 0, -1, },
- { -1, 3, 1, -1, 2, -1, -1, -1, -1, 4, -1, 0, 1, -1, -1, -1, -1, 0, -1, },
- { -1, 3, 1, -1, 2, -1, -1, -1, -1, 4, -1, 0, 1, -1, -1, -1, -1, 0, -1, },
- { -1, 3, 1, -1, 2, -1, -1, -1, -1, 4, -1, 0, 1, -1, -1, -1, -1, 0, -1, },
- { -1, 3, 1, -1, 2, -1, -1, -1, -1, 4, -1, 0, 1, -1, -1, -1, -1, 0, -1, },
- { -1, 3, 1, -1, 2, -1, -1, -1, -1, 4, -1, 0, 1, -1, -1, -1, -1, 0, -1, },
- { -1, 3, 1, -1, 2, -1, -1, -1, -1, 4, -1, 0, 1, -1, -1, -1, -1, 0, -1, },
- { -1, 3, 1, -1, 2, -1, -1, -1, -1, 4, -1, 0, 1, -1, -1, -1, -1, 0, -1, },
- { -1, 3, 1, -1, 2, -1, -1, -1, -1, 4, -1, 0, 1, -1, -1, -1, -1, 0, -1, },
- { -1, 3, 1, -1, 2, -1, -1, -1, -1, 4, -1, 0, 1, -1, -1, -1, -1, 0, -1, },
- { -1, 3, 1, 5, 2, -1, 6, -1, -1, -1, 0, -1, 1, 4, -1, -1, -1, 0, -1, },
- { -1, 3, 1, -1, 2, -1, -1, -1, -1, -1, -1, -1, 0, -1, -1, -1, -1, 0, -1, },
+ { -1, 0, 2, 6, 3, 4, 9, -1, 5, 7, 1, 0, 2, 8, -1, -1, -1, 1, -1, },
+ { -1, 0, 2, 4, 3, -1, 7, -1, -1, 5, 1, 0, 2, 6, -1, -1, -1, 1, -1, },
+ { -1, 0, 2, 4, 3, -1, 7, -1, -1, 5, 1, 0, 2, 6, -1, -1, -1, 1, -1, },
+ { -1, 0, 2, 4, 3, -1, 7, -1, -1, 5, 1, 0, 2, 6, -1, -1, -1, 1, -1, },
+ { -1, 0, 2, 4, 3, -1, 7, -1, -1, 5, 1, 0, 2, 6, -1, -1, -1, 1, -1, },
+ { -1, 0, 2, 4, 3, -1, 7, -1, -1, 5, 1, 0, 2, 6, -1, -1, -1, 1, -1, },
+ { -1, 0, 2, 4, 3, -1, 7, -1, -1, 5, 1, 0, 2, 6, -1, -1, -1, 1, -1, },
+ { -1, 0, 2, 4, 3, -1, 7, -1, -1, 5, 1, 0, 2, 6, -1, -1, -1, 1, -1, },
+ { -1, 0, 2, 4, 3, -1, 7, -1, -1, 5, 1, 0, 2, 6, -1, -1, -1, 1, -1, },
+ { -1, 0, 2, 4, 3, -1, 7, -1, -1, 5, 1, 0, 2, 6, -1, -1, -1, 1, -1, },
+ { -1, 0, 2, 4, 3, -1, 7, -1, -1, 5, 1, 0, 2, 6, -1, -1, -1, 1, -1, },
+ { -1, 0, 2, 4, 3, -1, 7, -1, -1, 5, 1, 0, 2, 6, -1, -1, -1, 1, -1, },
+ { -1, 0, 2, -1, 3, 4, -1, -1, 5, 6, -1, 0, 1, -1, -1, -1, -1, 1, -1, },
+ { -1, 0, 2, -1, 3, -1, -1, -1, -1, 4, -1, 0, 1, -1, -1, -1, -1, 1, -1, },
+ { -1, 0, 2, -1, 3, -1, -1, -1, -1, 4, -1, 0, 1, -1, -1, -1, -1, 1, -1, },
+ { -1, 0, 2, -1, 3, -1, -1, -1, -1, 4, -1, 0, 1, -1, -1, -1, -1, 1, -1, },
+ { -1, 0, 2, -1, 3, -1, -1, -1, -1, 4, -1, 0, 1, -1, -1, -1, -1, 1, -1, },
+ { -1, 0, 2, -1, 3, -1, -1, -1, -1, 4, -1, 0, 1, -1, -1, -1, -1, 1, -1, },
+ { -1, 0, 2, -1, 3, -1, -1, -1, -1, 4, -1, 0, 1, -1, -1, -1, -1, 1, -1, },
+ { -1, 0, 2, -1, 3, -1, -1, -1, -1, 4, -1, 0, 1, -1, -1, -1, -1, 1, -1, },
+ { -1, 0, 2, -1, 3, -1, -1, -1, -1, 4, -1, 0, 1, -1, -1, -1, -1, 1, -1, },
+ { -1, 0, 2, -1, 3, -1, -1, -1, -1, 4, -1, 0, 1, -1, -1, -1, -1, 1, -1, },
+ { -1, 0, 2, -1, 3, -1, -1, -1, -1, 4, -1, 0, 1, -1, -1, -1, -1, 1, -1, },
+ { -1, 0, 2, -1, 3, -1, -1, -1, -1, 4, -1, 0, 1, -1, -1, -1, -1, 1, -1, },
+ { -1, 0, 2, 4, 3, -1, 6, -1, -1, -1, 0, -1, 1, 5, -1, -1, -1, 1, -1, },
+ { -1, 0, 2, -1, 3, -1, -1, -1, -1, -1, -1, -1, 0, -1, -1, -1, -1, 1, -1, },
},
{
- { 2, -1, 4, 1, 5, 10, 2, -1, 9, 7, 1, 0, -1, 0, 6, -1, -1, 3, -1, },
- { 2, -1, 4, 1, 5, -1, 2, -1, -1, 7, 1, 0, -1, 0, 6, -1, -1, 3, -1, },
- { 2, -1, 4, 1, 5, -1, 2, -1, -1, 7, 1, 0, -1, 0, 6, -1, -1, 3, -1, },
- { 2, -1, 4, 1, 5, -1, 2, -1, -1, 7, 1, 0, -1, 0, 6, -1, -1, 3, -1, },
- { 2, -1, 4, 1, 5, -1, 2, -1, -1, 7, 1, 0, -1, 0, 6, -1, -1, 3, -1, },
- { 2, -1, 4, 1, 5, -1, 2, -1, -1, 7, 1, 0, -1, 0, 6, -1, -1, 3, -1, },
- { 2, -1, 4, 1, 5, -1, 2, -1, -1, 7, 1, 0, -1, 0, 6, -1, -1, 3, -1, },
- { 2, -1, 4, 1, 5, -1, 2, -1, -1, 7, 1, 0, -1, 0, 6, -1, -1, 3, -1, },
- { 2, -1, 4, 1, 5, -1, 2, -1, -1, 7, 1, 0, -1, 0, 6, -1, -1, 3, -1, },
- { 2, -1, 4, 1, 5, -1, 2, -1, -1, 7, 1, 0, -1, 0, 6, -1, -1, 3, -1, },
- { 2, -1, 4, 1, 5, -1, 2, -1, -1, 7, 1, 0, -1, 0, 6, -1, -1, 3, -1, },
- { 2, -1, 4, 1, 5, -1, 2, -1, -1, 7, 1, 0, -1, 0, 6, -1, -1, 3, -1, },
- { 1, -1, 1, -1, 2, 7, -1, -1, 6, 4, -1, 0, -1, -1, 3, -1, -1, 0, -1, },
- { 1, -1, 1, -1, 2, -1, -1, -1, -1, 4, -1, 0, -1, -1, 3, -1, -1, 0, -1, },
- { 1, -1, 1, -1, 2, -1, -1, -1, -1, 4, -1, 0, -1, -1, 3, -1, -1, 0, -1, },
- { 1, -1, 1, -1, 2, -1, -1, -1, -1, 4, -1, 0, -1, -1, 3, -1, -1, 0, -1, },
- { 1, -1, 1, -1, 2, -1, -1, -1, -1, 4, -1, 0, -1, -1, 3, -1, -1, 0, -1, },
- { 1, -1, 1, -1, 2, -1, -1, -1, -1, 4, -1, 0, -1, -1, 3, -1, -1, 0, -1, },
- { 1, -1, 1, -1, 2, -1, -1, -1, -1, 4, -1, 0, -1, -1, 3, -1, -1, 0, -1, },
- { 1, -1, 1, -1, 2, -1, -1, -1, -1, 4, -1, 0, -1, -1, 3, -1, -1, 0, -1, },
- { 1, -1, 1, -1, 2, -1, -1, -1, -1, 4, -1, 0, -1, -1, 3, -1, -1, 0, -1, },
- { 1, -1, 1, -1, 2, -1, -1, -1, -1, 4, -1, 0, -1, -1, 3, -1, -1, 0, -1, },
- { 1, -1, 1, -1, 2, -1, -1, -1, -1, 4, -1, 0, -1, -1, 3, -1, -1, 0, -1, },
- { 1, -1, 1, -1, 2, -1, -1, -1, -1, 4, -1, 0, -1, -1, 3, -1, -1, 0, -1, },
- { 1, -1, 1, 5, 2, -1, 6, -1, -1, -1, 0, -1, -1, 4, 3, -1, -1, 0, -1, },
- { 0, -1, 1, -1, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3, -1, -1, 0, -1, },
+ { 2, -1, 2, 6, 3, 4, 9, -1, 5, 7, 1, 0, -1, 8, 0, -1, -1, 1, -1, },
+ { 2, -1, 2, 4, 3, -1, 7, -1, -1, 5, 1, 0, -1, 6, 0, -1, -1, 1, -1, },
+ { 2, -1, 2, 4, 3, -1, 7, -1, -1, 5, 1, 0, -1, 6, 0, -1, -1, 1, -1, },
+ { 2, -1, 2, 4, 3, -1, 7, -1, -1, 5, 1, 0, -1, 6, 0, -1, -1, 1, -1, },
+ { 2, -1, 2, 4, 3, -1, 7, -1, -1, 5, 1, 0, -1, 6, 0, -1, -1, 1, -1, },
+ { 2, -1, 2, 4, 3, -1, 7, -1, -1, 5, 1, 0, -1, 6, 0, -1, -1, 1, -1, },
+ { 2, -1, 2, 4, 3, -1, 7, -1, -1, 5, 1, 0, -1, 6, 0, -1, -1, 1, -1, },
+ { 2, -1, 2, 4, 3, -1, 7, -1, -1, 5, 1, 0, -1, 6, 0, -1, -1, 1, -1, },
+ { 2, -1, 2, 4, 3, -1, 7, -1, -1, 5, 1, 0, -1, 6, 0, -1, -1, 1, -1, },
+ { 2, -1, 2, 4, 3, -1, 7, -1, -1, 5, 1, 0, -1, 6, 0, -1, -1, 1, -1, },
+ { 2, -1, 2, 4, 3, -1, 7, -1, -1, 5, 1, 0, -1, 6, 0, -1, -1, 1, -1, },
+ { 2, -1, 2, 4, 3, -1, 7, -1, -1, 5, 1, 0, -1, 6, 0, -1, -1, 1, -1, },
+ { 1, -1, 2, -1, 3, 4, -1, -1, 5, 6, -1, 0, -1, -1, 0, -1, -1, 1, -1, },
+ { 1, -1, 2, -1, 3, -1, -1, -1, -1, 4, -1, 0, -1, -1, 0, -1, -1, 1, -1, },
+ { 1, -1, 2, -1, 3, -1, -1, -1, -1, 4, -1, 0, -1, -1, 0, -1, -1, 1, -1, },
+ { 1, -1, 2, -1, 3, -1, -1, -1, -1, 4, -1, 0, -1, -1, 0, -1, -1, 1, -1, },
+ { 1, -1, 2, -1, 3, -1, -1, -1, -1, 4, -1, 0, -1, -1, 0, -1, -1, 1, -1, },
+ { 1, -1, 2, -1, 3, -1, -1, -1, -1, 4, -1, 0, -1, -1, 0, -1, -1, 1, -1, },
+ { 1, -1, 2, -1, 3, -1, -1, -1, -1, 4, -1, 0, -1, -1, 0, -1, -1, 1, -1, },
+ { 1, -1, 2, -1, 3, -1, -1, -1, -1, 4, -1, 0, -1, -1, 0, -1, -1, 1, -1, },
+ { 1, -1, 2, -1, 3, -1, -1, -1, -1, 4, -1, 0, -1, -1, 0, -1, -1, 1, -1, },
+ { 1, -1, 2, -1, 3, -1, -1, -1, -1, 4, -1, 0, -1, -1, 0, -1, -1, 1, -1, },
+ { 1, -1, 2, -1, 3, -1, -1, -1, -1, 4, -1, 0, -1, -1, 0, -1, -1, 1, -1, },
+ { 1, -1, 2, -1, 3, -1, -1, -1, -1, 4, -1, 0, -1, -1, 0, -1, -1, 1, -1, },
+ { 1, -1, 2, 4, 3, -1, 6, -1, -1, -1, 0, -1, -1, 5, 0, -1, -1, 1, -1, },
+ { 0, -1, 2, -1, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, -1, -1, 1, -1, },
},
{
- { 2, -1, 4, 1, 5, 10, 2, -1, 9, 7, 1, 0, -1, 0, 6, -1, -1, 3, -1, },
- { 2, -1, 4, 1, 5, -1, 2, -1, -1, 7, 1, 0, -1, 0, 6, -1, -1, 3, -1, },
- { 2, -1, 4, 1, 5, -1, 2, -1, -1, 7, 1, 0, -1, 0, 6, -1, -1, 3, -1, },
- { 2, -1, 4, 1, 5, -1, 2, -1, -1, 7, 1, 0, -1, 0, 6, -1, -1, 3, -1, },
- { 2, -1, 4, 1, 5, -1, 2, -1, -1, 7, 1, 0, -1, 0, 6, -1, -1, 3, -1, },
- { 2, -1, 4, 1, 5, -1, 2, -1, -1, 7, 1, 0, -1, 0, 6, -1, -1, 3, -1, },
- { 2, -1, 4, 1, 5, -1, 2, -1, -1, 7, 1, 0, -1, 0, 6, -1, -1, 3, -1, },
- { 2, -1, 4, 1, 5, -1, 2, -1, -1, 7, 1, 0, -1, 0, 6, -1, -1, 3, -1, },
- { 2, -1, 4, 1, 5, -1, 2, -1, -1, 7, 1, 0, -1, 0, 6, -1, -1, 3, -1, },
- { 2, -1, 4, 1, 5, -1, 2, -1, -1, 7, 1, 0, -1, 0, 6, -1, -1, 3, -1, },
- { 2, -1, 4, 1, 5, -1, 2, -1, -1, 7, 1, 0, -1, 0, 6, -1, -1, 3, -1, },
- { 2, -1, 4, 1, 5, -1, 2, -1, -1, 7, 1, 0, -1, 0, 6, -1, -1, 3, -1, },
- { 1, -1, 1, -1, 2, 7, -1, -1, 6, 4, -1, 0, -1, -1, 3, -1, -1, 0, -1, },
- { 1, -1, 1, -1, 2, -1, -1, -1, -1, 4, -1, 0, -1, -1, 3, -1, -1, 0, -1, },
- { 1, -1, 1, -1, 2, -1, -1, -1, -1, 4, -1, 0, -1, -1, 3, -1, -1, 0, -1, },
- { 1, -1, 1, -1, 2, -1, -1, -1, -1, 4, -1, 0, -1, -1, 3, -1, -1, 0, -1, },
- { 1, -1, 1, -1, 2, -1, -1, -1, -1, 4, -1, 0, -1, -1, 3, -1, -1, 0, -1, },
- { 1, -1, 1, -1, 2, -1, -1, -1, -1, 4, -1, 0, -1, -1, 3, -1, -1, 0, -1, },
- { 1, -1, 1, -1, 2, -1, -1, -1, -1, 4, -1, 0, -1, -1, 3, -1, -1, 0, -1, },
- { 1, -1, 1, -1, 2, -1, -1, -1, -1, 4, -1, 0, -1, -1, 3, -1, -1, 0, -1, },
- { 1, -1, 1, -1, 2, -1, -1, -1, -1, 4, -1, 0, -1, -1, 3, -1, -1, 0, -1, },
- { 1, -1, 1, -1, 2, -1, -1, -1, -1, 4, -1, 0, -1, -1, 3, -1, -1, 0, -1, },
- { 1, -1, 1, -1, 2, -1, -1, -1, -1, 4, -1, 0, -1, -1, 3, -1, -1, 0, -1, },
- { 1, -1, 1, -1, 2, -1, -1, -1, -1, 4, -1, 0, -1, -1, 3, -1, -1, 0, -1, },
- { 1, -1, 1, 5, 2, -1, 6, -1, -1, -1, 0, -1, -1, 4, 3, -1, -1, 0, -1, },
- { 0, -1, 1, -1, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3, -1, -1, 0, -1, },
+ { 2, -1, 2, 6, 3, 4, 9, -1, 5, 7, 1, 0, -1, 8, 0, -1, -1, 1, -1, },
+ { 2, -1, 2, 4, 3, -1, 7, -1, -1, 5, 1, 0, -1, 6, 0, -1, -1, 1, -1, },
+ { 2, -1, 2, 4, 3, -1, 7, -1, -1, 5, 1, 0, -1, 6, 0, -1, -1, 1, -1, },
+ { 2, -1, 2, 4, 3, -1, 7, -1, -1, 5, 1, 0, -1, 6, 0, -1, -1, 1, -1, },
+ { 2, -1, 2, 4, 3, -1, 7, -1, -1, 5, 1, 0, -1, 6, 0, -1, -1, 1, -1, },
+ { 2, -1, 2, 4, 3, -1, 7, -1, -1, 5, 1, 0, -1, 6, 0, -1, -1, 1, -1, },
+ { 2, -1, 2, 4, 3, -1, 7, -1, -1, 5, 1, 0, -1, 6, 0, -1, -1, 1, -1, },
+ { 2, -1, 2, 4, 3, -1, 7, -1, -1, 5, 1, 0, -1, 6, 0, -1, -1, 1, -1, },
+ { 2, -1, 2, 4, 3, -1, 7, -1, -1, 5, 1, 0, -1, 6, 0, -1, -1, 1, -1, },
+ { 2, -1, 2, 4, 3, -1, 7, -1, -1, 5, 1, 0, -1, 6, 0, -1, -1, 1, -1, },
+ { 2, -1, 2, 4, 3, -1, 7, -1, -1, 5, 1, 0, -1, 6, 0, -1, -1, 1, -1, },
+ { 2, -1, 2, 4, 3, -1, 7, -1, -1, 5, 1, 0, -1, 6, 0, -1, -1, 1, -1, },
+ { 1, -1, 2, -1, 3, 4, -1, -1, 5, 6, -1, 0, -1, -1, 0, -1, -1, 1, -1, },
+ { 1, -1, 2, -1, 3, -1, -1, -1, -1, 4, -1, 0, -1, -1, 0, -1, -1, 1, -1, },
+ { 1, -1, 2, -1, 3, -1, -1, -1, -1, 4, -1, 0, -1, -1, 0, -1, -1, 1, -1, },
+ { 1, -1, 2, -1, 3, -1, -1, -1, -1, 4, -1, 0, -1, -1, 0, -1, -1, 1, -1, },
+ { 1, -1, 2, -1, 3, -1, -1, -1, -1, 4, -1, 0, -1, -1, 0, -1, -1, 1, -1, },
+ { 1, -1, 2, -1, 3, -1, -1, -1, -1, 4, -1, 0, -1, -1, 0, -1, -1, 1, -1, },
+ { 1, -1, 2, -1, 3, -1, -1, -1, -1, 4, -1, 0, -1, -1, 0, -1, -1, 1, -1, },
+ { 1, -1, 2, -1, 3, -1, -1, -1, -1, 4, -1, 0, -1, -1, 0, -1, -1, 1, -1, },
+ { 1, -1, 2, -1, 3, -1, -1, -1, -1, 4, -1, 0, -1, -1, 0, -1, -1, 1, -1, },
+ { 1, -1, 2, -1, 3, -1, -1, -1, -1, 4, -1, 0, -1, -1, 0, -1, -1, 1, -1, },
+ { 1, -1, 2, -1, 3, -1, -1, -1, -1, 4, -1, 0, -1, -1, 0, -1, -1, 1, -1, },
+ { 1, -1, 2, -1, 3, -1, -1, -1, -1, 4, -1, 0, -1, -1, 0, -1, -1, 1, -1, },
+ { 1, -1, 2, 4, 3, -1, 6, -1, -1, -1, 0, -1, -1, 5, 0, -1, -1, 1, -1, },
+ { 0, -1, 2, -1, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, -1, -1, 1, -1, },
},
};
static int mask_variable_locations[num_fragment_masks][num_fragment_variables] = {
{ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
- { -1, -1, 2, -1, 3, -1, -1, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, -1, },
+ { -1, -1, 1, -1, 2, -1, -1, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, -1, },
};
#endif
diff --git a/src/opengl/util/generator.pro b/src/opengl/util/generator.pro
index 9425dbe..ac71934 100644
--- a/src/opengl/util/generator.pro
+++ b/src/opengl/util/generator.pro
@@ -9,3 +9,5 @@ INCLUDEPATH += .
# Input
SOURCES += generator.cpp
+
+CONFIG += console
diff --git a/src/opengl/util/texture_brush.glsl b/src/opengl/util/texture_brush.glsl
index 93865b8..9498255 100644
--- a/src/opengl/util/texture_brush.glsl
+++ b/src/opengl/util/texture_brush.glsl
@@ -17,7 +17,5 @@ vec4 brush()
coords *= inv_brush_texture_size;
- coords.y = -coords.y;
-
return texture2D(brush_texture, coords);
}
diff --git a/src/openvg/qpaintengine_vg.cpp b/src/openvg/qpaintengine_vg.cpp
index d2c7b8b..09eb646 100644
--- a/src/openvg/qpaintengine_vg.cpp
+++ b/src/openvg/qpaintengine_vg.cpp
@@ -3072,43 +3072,42 @@ void QVGPaintEngine::setState(QPainterState *s)
}
}
-// Called from QPaintEngine::syncState() to force a state flush.
-// This should be called before and after raw VG operations.
-void QVGPaintEngine::updateState(const QPaintEngineState &state)
+void QVGPaintEngine::beginNativePainting()
{
- Q_UNUSED(state);
Q_D(QVGPaintEngine);
- if (!(d->rawVG)) {
- // About to enter raw VG mode: flush pending changes and make
- // sure that all matrices are set to the current transformation.
- QVGPainterState *s = this->state();
- d->ensurePen(s->pen);
- d->ensureBrush(s->brush);
- d->ensurePathTransform();
- d->setTransform(VG_MATRIX_IMAGE_USER_TO_SURFACE, d->imageTransform);
+ // About to enter raw VG mode: flush pending changes and make
+ // sure that all matrices are set to the current transformation.
+ QVGPainterState *s = this->state();
+ d->ensurePen(s->pen);
+ d->ensureBrush(s->brush);
+ d->ensurePathTransform();
+ d->setTransform(VG_MATRIX_IMAGE_USER_TO_SURFACE, d->imageTransform);
#if !defined(QVG_NO_DRAW_GLYPHS)
- d->setTransform(VG_MATRIX_GLYPH_USER_TO_SURFACE, d->pathTransform);
+ d->setTransform(VG_MATRIX_GLYPH_USER_TO_SURFACE, d->pathTransform);
#endif
- d->rawVG = true;
- } else {
- // Exiting raw VG mode: force all state values to be
- // explicitly set on the VG engine to undo any changes
- // that were made by the raw VG function calls.
- QPaintEngine::DirtyFlags dirty = d->dirty;
- d->clearModes();
- d->forcePenChange = true;
- d->forceBrushChange = true;
- d->penType = (VGPaintType)0;
- d->brushType = (VGPaintType)0;
- d->clearColor = QColor();
- d->fillPaint = d->brushPaint;
- restoreState(QPaintEngine::AllDirty);
- d->dirty = dirty;
- d->rawVG = false;
- vgSetPaint(d->penPaint, VG_STROKE_PATH);
- vgSetPaint(d->brushPaint, VG_FILL_PATH);
- }
+ d->rawVG = true;
+}
+
+void QVGPaintEngine::endNativePainting()
+{
+ Q_D(QVGPaintEngine);
+ // Exiting raw VG mode: force all state values to be
+ // explicitly set on the VG engine to undo any changes
+ // that were made by the raw VG function calls.
+ QPaintEngine::DirtyFlags dirty = d->dirty;
+ d->clearModes();
+ d->forcePenChange = true;
+ d->forceBrushChange = true;
+ d->penType = (VGPaintType)0;
+ d->brushType = (VGPaintType)0;
+ d->clearColor = QColor();
+ d->fillPaint = d->brushPaint;
+ restoreState(QPaintEngine::AllDirty);
+ d->dirty = dirty;
+ d->rawVG = false;
+ vgSetPaint(d->penPaint, VG_STROKE_PATH);
+ vgSetPaint(d->brushPaint, VG_FILL_PATH);
}
QPixmapFilter *QVGPaintEngine::createPixmapFilter(int type) const
diff --git a/src/openvg/qpaintengine_vg_p.h b/src/openvg/qpaintengine_vg_p.h
index 469ec9e..f0a7838 100644
--- a/src/openvg/qpaintengine_vg_p.h
+++ b/src/openvg/qpaintengine_vg_p.h
@@ -140,7 +140,8 @@ public:
QVGPainterState *state() { return static_cast<QVGPainterState *>(QPaintEngineEx::state()); }
const QVGPainterState *state() const { return static_cast<const QVGPainterState *>(QPaintEngineEx::state()); }
- void updateState(const QPaintEngineState &state);
+ void beginNativePainting();
+ void endNativePainting();
QPixmapFilter *createPixmapFilter(int type) const;
diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp
index 70a6e02..146a920 100644
--- a/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp
+++ b/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp
@@ -209,66 +209,60 @@ bool QDirectFBPixmapData::fromData(const uchar *buffer, uint len, const char *fo
return QPixmapData::fromData(buffer, len, format, flags);
}
-template <typename T> class QDirectFBPointer
+template <typename T> struct QDirectFBInterfaceCleanupHandler
{
-public:
- QDirectFBPointer(T *tt = 0) : t(tt) {}
- ~QDirectFBPointer() { if (t) t->Release(t); }
-
- inline T* operator->() { return t; }
- inline operator T*() { return t; }
-
- inline T** operator&() { return &t; }
- inline bool operator!() const { return !t; }
- inline T *data() { return t; }
- inline const T *data() const { return t; }
+ static void cleanup(T *t) { if (t) t->Release(t); }
+};
- T *t;
+template <typename T>
+class QDirectFBPointer : public QScopedPointer<T, QDirectFBInterfaceCleanupHandler<T> >
+{
+public:
+ QDirectFBPointer(T *t = 0)
+ : QScopedPointer<T, QDirectFBInterfaceCleanupHandler<T> >(t)
+ {}
};
bool QDirectFBPixmapData::fromDataBufferDescription(const DFBDataBufferDescription &dataBufferDescription)
{
IDirectFB *dfb = screen->dfb();
Q_ASSERT(dfb);
- QDirectFBPointer<IDirectFBDataBuffer> dataBuffer;
DFBResult result = DFB_OK;
- if ((result = dfb->CreateDataBuffer(dfb, &dataBufferDescription, &dataBuffer)) != DFB_OK) {
+ IDirectFBDataBuffer *dataBufferPtr;
+ if ((result = dfb->CreateDataBuffer(dfb, &dataBufferDescription, &dataBufferPtr)) != DFB_OK) {
DirectFBError("QDirectFBPixmapData::fromDataBufferDescription()", result);
return false;
}
+ QDirectFBPointer<IDirectFBDataBuffer> dataBuffer(dataBufferPtr);
-#if defined QT_DIRECTFB_IMAGEPROVIDER_KEEPALIVE
- IDirectFBImageProvider *provider = 0;
-#else
- QDirectFBPointer<IDirectFBImageProvider> provider;
-#endif
- if ((result = dataBuffer->CreateImageProvider(dataBuffer, &provider)) != DFB_OK) {
+ IDirectFBImageProvider *providerPtr;
+ if ((result = dataBuffer->CreateImageProvider(dataBuffer.data(), &providerPtr)) != DFB_OK) {
DirectFBError("QDirectFBPixmapData::fromDataBufferDescription(): Can't create image provider", result);
return false;
}
-#if defined QT_DIRECTFB_IMAGEPROVIDER_KEEPALIVE
- screen->setDirectFBImageProvider(provider);
-#endif
+ QDirectFBPointer<IDirectFBImageProvider> provider(providerPtr);
+
DFBSurfaceDescription surfaceDescription;
- if ((result = provider->GetSurfaceDescription(provider, &surfaceDescription)) != DFB_OK) {
+ if ((result = provider->GetSurfaceDescription(provider.data(), &surfaceDescription)) != DFB_OK) {
DirectFBError("QDirectFBPixmapData::fromDataBufferDescription(): Can't get surface description", result);
return false;
}
- QDirectFBPointer<IDirectFBSurface> surfaceFromDescription = screen->createDFBSurface(surfaceDescription, QDirectFBScreen::DontTrackSurface, &result);
+ QDirectFBPointer<IDirectFBSurface> surfaceFromDescription;
+ surfaceFromDescription.reset(screen->createDFBSurface(surfaceDescription, QDirectFBScreen::DontTrackSurface, &result));
if (!surfaceFromDescription) {
DirectFBError("QDirectFBPixmapData::fromSurfaceDescription(): Can't create surface", result);
return false;
}
- result = provider->RenderTo(provider, surfaceFromDescription, 0);
+ result = provider->RenderTo(provider.data(), surfaceFromDescription.data(), 0);
if (result != DFB_OK) {
DirectFBError("QDirectFBPixmapData::fromSurfaceDescription(): Can't render to surface", result);
return false;
}
DFBImageDescription imageDescription;
- result = provider->GetImageDescription(provider, &imageDescription);
+ result = provider->GetImageDescription(provider.data(), &imageDescription);
if (result != DFB_OK) {
DirectFBError("QDirectFBPixmapData::fromSurfaceDescription(): Can't get image description", result);
return false;
@@ -285,7 +279,7 @@ bool QDirectFBPixmapData::fromDataBufferDescription(const DFBDataBufferDescripti
DFBSurfaceBlittingFlags blittingFlags = DSBLIT_NOFX;
if (imageDescription.caps & DICAPS_COLORKEY) {
blittingFlags |= DSBLIT_SRC_COLORKEY;
- result = surfaceFromDescription->SetSrcColorKey(surfaceFromDescription,
+ result = surfaceFromDescription->SetSrcColorKey(surfaceFromDescription.data(),
imageDescription.colorkey_r,
imageDescription.colorkey_g,
imageDescription.colorkey_b);
@@ -305,7 +299,7 @@ bool QDirectFBPixmapData::fromDataBufferDescription(const DFBDataBufferDescripti
return false;
}
- result = dfbSurface->Blit(dfbSurface, surfaceFromDescription, 0, 0, 0);
+ result = dfbSurface->Blit(dfbSurface, surfaceFromDescription.data(), 0, 0, 0);
if (result != DFB_OK) {
DirectFBError("QDirectFBPixmapData::fromSurfaceDescription: Can't blit to surface", result);
invalidate(); // release dfbSurface
@@ -324,6 +318,11 @@ bool QDirectFBPixmapData::fromDataBufferDescription(const DFBDataBufferDescripti
#if (Q_DIRECTFB_VERSION >= 0x010000)
dfbSurface->ReleaseSource(dfbSurface);
#endif
+#if defined QT_DIRECTFB_IMAGEPROVIDER_KEEPALIVE
+ screen->setDirectFBImageProvider(providerPtr);
+ provider.take();
+#endif
+
return true;
}
diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp
index dbe8926..4542051 100644
--- a/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp
+++ b/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp
@@ -1509,10 +1509,10 @@ bool QDirectFBScreen::initSurfaceDescriptionPixelFormat(DFBSurfaceDescription *d
return true;
}
-uchar *QDirectFBScreen::lockSurface(IDirectFBSurface *surface, uint flags, int *bpl)
+uchar *QDirectFBScreen::lockSurface(IDirectFBSurface *surface, DFBSurfaceLockFlags flags, int *bpl)
{
void *mem;
- const DFBResult result = surface->Lock(surface, static_cast<DFBSurfaceLockFlags>(flags), static_cast<void**>(&mem), bpl);
+ const DFBResult result = surface->Lock(surface, flags, &mem, bpl);
if (result != DFB_OK) {
DirectFBError("QDirectFBScreen::lockSurface()", result);
}
@@ -1557,5 +1557,36 @@ void QDirectFBScreen::setDirectFBImageProvider(IDirectFBImageProvider *provider)
}
#endif
+IDirectFBSurface * QDirectFBScreen::surfaceForWidget(const QWidget *widget, QRect *rect) const
+{
+ Q_ASSERT(widget);
+ if (!widget->isVisible() || widget->size().isNull())
+ return 0;
+
+ const QWSWindowSurface *surface = static_cast<const QWSWindowSurface*>(widget->windowSurface());
+ if (surface && surface->key() == QLatin1String("directfb")) {
+ return static_cast<const QDirectFBWindowSurface*>(surface)->surfaceForWidget(widget, rect);
+ }
+ return 0;
+}
+IDirectFBSurface *QDirectFBScreen::subSurfaceForWidget(const QWidget *widget, const QRect &area) const
+{
+ Q_ASSERT(widget);
+ QRect rect;
+ IDirectFBSurface *surface = surfaceForWidget(widget, &rect);
+ IDirectFBSurface *subSurface = 0;
+ if (surface) {
+ if (!area.isNull())
+ rect &= area.translated(widget->mapTo(widget->window(), QPoint(0, 0)));
+ if (!rect.isNull()) {
+ const DFBRectangle subRect = {rect.x(), rect.y(), rect.width(), rect.height() };
+ const DFBResult result = surface->GetSubSurface(surface, &subRect, &subSurface);
+ if (result != DFB_OK) {
+ DirectFBError("QDirectFBScreen::subSurface(): Can't get sub surface", result);
+ }
+ }
+ }
+ return subSurface;
+}
diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbscreen.h b/src/plugins/gfxdrivers/directfb/qdirectfbscreen.h
index 8ec91c7..4b6c01f 100644
--- a/src/plugins/gfxdrivers/directfb/qdirectfbscreen.h
+++ b/src/plugins/gfxdrivers/directfb/qdirectfbscreen.h
@@ -152,6 +152,9 @@ public:
return static_cast<QDirectFBScreen*>(inst);
}
+ IDirectFBSurface *surfaceForWidget(const QWidget *widget, QRect *rect) const;
+ IDirectFBSurface *subSurfaceForWidget(const QWidget *widget, const QRect &area = QRect()) const;
+
IDirectFB *dfb();
#ifdef QT_NO_DIRECTFB_WM
IDirectFBSurface *primarySurface();
@@ -207,7 +210,7 @@ public:
const QImage &image);
#endif
- static uchar *lockSurface(IDirectFBSurface *surface, uint flags, int *bpl = 0);
+ static uchar *lockSurface(IDirectFBSurface *surface, DFBSurfaceLockFlags flags, int *bpl = 0);
#if defined QT_DIRECTFB_IMAGEPROVIDER && defined QT_DIRECTFB_IMAGEPROVIDER_KEEPALIVE
void setDirectFBImageProvider(IDirectFBImageProvider *provider);
#endif
diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp
index 2f240fb..9de1ca5 100644
--- a/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp
+++ b/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp
@@ -48,8 +48,6 @@
#include <qpaintdevice.h>
#include <qvarlengtharray.h>
-//#define QT_DIRECTFB_DEBUG_SURFACES 1
-
QDirectFBWindowSurface::QDirectFBWindowSurface(DFBSurfaceFlipFlags flip, QDirectFBScreen *scr)
: QDirectFBPaintDevice(scr)
#ifndef QT_NO_DIRECTFB_WM
@@ -245,22 +243,19 @@ void QDirectFBWindowSurface::setGeometry(const QRect &rect)
QByteArray QDirectFBWindowSurface::permanentState() const
{
- QByteArray state;
#ifdef QT_DIRECTFB_WM
- QDataStream ds(&state, QIODevice::WriteOnly);
- ds << reinterpret_cast<quintptr>(this);
-#endif
+ QByteArray state(sizeof(this), 0);
+ *reinterpret_cast<const QDirectFBWindowSurface**>(state.data()) = this;
return state;
+#endif
+ return QByteArray();
}
void QDirectFBWindowSurface::setPermanentState(const QByteArray &state)
{
#ifdef QT_DIRECTFB_WM
- if (state.size() == sizeof(quintptr)) {
- QDataStream ds(state);
- quintptr ptr;
- ds >> ptr;
- sibling = reinterpret_cast<QDirectFBWindowSurface*>(ptr);
+ if (state.size() == sizeof(this)) {
+ sibling = *reinterpret_cast<QDirectFBWindowSurface *const*>(state.constData());
}
#else
Q_UNUSED(state);
@@ -418,7 +413,6 @@ void QDirectFBWindowSurface::flush(QWidget *, const QRegion &region,
#endif
}
-
void QDirectFBWindowSurface::beginPaint(const QRegion &)
{
if (!engine)
@@ -427,43 +421,28 @@ void QDirectFBWindowSurface::beginPaint(const QRegion &)
void QDirectFBWindowSurface::endPaint(const QRegion &)
{
-#ifdef QT_DIRECTFB_DEBUG_SURFACES
- if (bufferImages.count()) {
- qDebug("QDirectFBWindowSurface::endPaint() this=%p", this);
-
- foreach(QImage* bufferImg, bufferImages)
- qDebug(" Deleting buffer image %p", bufferImg);
- }
-#endif
-
- qDeleteAll(bufferImages);
- bufferImages.clear();
unlockDirectFB();
}
-
-QImage *QDirectFBWindowSurface::buffer(const QWidget *widget)
+IDirectFBSurface *QDirectFBWindowSurface::surfaceForWidget(const QWidget *widget, QRect *rect) const
{
- if (!lockedImage)
+ Q_ASSERT(widget);
+ if (!dfbSurface) {
+ if (sibling && (!sibling->sibling || sibling->dfbSurface))
+ return sibling->surfaceForWidget(widget, rect);
return 0;
-
- const QRect rect = QRect(offset(widget), widget->size())
- & lockedImage->rect();
- if (rect.isEmpty())
- return 0;
-
- QImage *img = new QImage(lockedImage->scanLine(rect.y())
- + rect.x() * (lockedImage->depth() / 8),
- rect.width(), rect.height(),
- lockedImage->bytesPerLine(),
- lockedImage->format());
- bufferImages.append(img);
-
-#ifdef QT_DIRECTFB_DEBUG_SURFACES
- qDebug("QDirectFBWindowSurface::buffer() Created & returned %p", img);
-#endif
-
- return img;
+ }
+ QWidget *win = window();
+ Q_ASSERT(win);
+ if (rect) {
+ if (win == widget) {
+ *rect = widget->rect();
+ } else {
+ *rect = QRect(widget->mapTo(win, QPoint(0, 0)), widget->size());
+ }
+ }
+ Q_ASSERT(win == widget || widget->isAncestorOf(win));
+ return dfbSurface;
}
void QDirectFBWindowSurface::updateFormat()
diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.h b/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.h
index 0da3a98..f8c0aae 100644
--- a/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.h
+++ b/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.h
@@ -88,23 +88,20 @@ public:
void beginPaint(const QRegion &);
void endPaint(const QRegion &);
- QImage *buffer(const QWidget *widget);
+ IDirectFBSurface *surfaceForWidget(const QWidget *widget, QRect *rect) const;
private:
void updateFormat();
#ifdef QT_DIRECTFB_WM
void createWindow();
IDirectFBWindow *dfbWindow;
QDirectFBWindowSurface *sibling;
-#endif
-
-#ifdef QT_NO_DIRECTFB_WM
+#else
enum Mode {
Primary,
Offscreen
} mode;
#endif
- QList<QImage*> bufferImages;
DFBSurfaceFlipFlags flipFlags;
bool boundingRectFlip;
#ifdef QT_DIRECTFB_TIMING
diff --git a/src/plugins/imageformats/jpeg/qjpeghandler.cpp b/src/plugins/imageformats/jpeg/qjpeghandler.cpp
index 395adca..910366c 100644
--- a/src/plugins/imageformats/jpeg/qjpeghandler.cpp
+++ b/src/plugins/imageformats/jpeg/qjpeghandler.cpp
@@ -493,7 +493,16 @@ private:
in--;
out[i] = qRgb(*in, *in, *in);
}
- } else {
+ } else if (cinfo->out_color_space == JCS_CMYK) {
+ int cols32Bit = scaledWidth() * 4;
+ in = (uchar*)out + cols32Bit;
+ for (uint i = scaledWidth(); i--; ) {
+ in -= 4;
+ int k = in[3];
+ out[i] = qRgb(k * in[0] / 255, k * in[1] / 255, k * in[2] / 255);
+ //out[i] = qRgb(in[0], in[1], in[2]);
+ }
+ } else {
in = (uchar*)out + cols24Bit;
for (uint i = scaledWidth(); i--; ) {
in -= 3;
diff --git a/src/plugins/s60/src/qdesktopservices_3_2.cpp b/src/plugins/s60/src/qdesktopservices_3_2.cpp
index fab1237..e8f4a27 100644
--- a/src/plugins/s60/src/qdesktopservices_3_2.cpp
+++ b/src/plugins/s60/src/qdesktopservices_3_2.cpp
@@ -50,6 +50,7 @@
EXPORT_C QString localizedDirectoryName(QString& rawPath)
{
QString ret;
+ std::exception dummy; // voodoo fix for "Undefined symbol typeinfo for std::exception" in armv5 build
TRAPD(err,
QT_TRYCATCH_LEAVING(
diff --git a/src/s60installs/qt_libs.pro b/src/s60installs/s60installs.pro
index f24a03f..0314958 100644
--- a/src/s60installs/qt_libs.pro
+++ b/src/s60installs/s60installs.pro
@@ -5,7 +5,8 @@ symbian: {
load(data_caging_paths)
SUBDIRS=
- TARGET = "QtLibs pre-release"
+ # WARNING: Changing TARGET name will break Symbian SISX upgrade functionality
+ TARGET = "Qt for S60"
TARGET.UID3 = 0x2001E61C
VERSION=$${QT_MAJOR_VERSION}.$${QT_MINOR_VERSION}.$${QT_PATCH_VERSION}
diff --git a/src/script/api/qscriptcontextinfo.cpp b/src/script/api/qscriptcontextinfo.cpp
index e59b773..890ed9d 100644
--- a/src/script/api/qscriptcontextinfo.cpp
+++ b/src/script/api/qscriptcontextinfo.cpp
@@ -50,6 +50,9 @@
#include <QtCore/qmetaobject.h>
#include "CodeBlock.h"
#include "JSFunction.h"
+#if ENABLE(JIT)
+#include "MacroAssemblerCodeRef.h"
+#endif
QT_BEGIN_NAMESPACE
@@ -154,7 +157,7 @@ QScriptContextInfoPrivate::QScriptContextInfoPrivate(const QScriptContext *conte
lineNumber = -1;
columnNumber = -1;
- const JSC::ExecState *frame = QScriptEnginePrivate::frameForContext(context);
+ JSC::CallFrame *frame = const_cast<JSC::CallFrame *>(QScriptEnginePrivate::frameForContext(context));
// Get the line number:
@@ -171,8 +174,13 @@ QScriptContextInfoPrivate::QScriptContextInfoPrivate(const QScriptContext *conte
JSC::Instruction *returnPC = aboveFrame->returnPC();
JSC::CodeBlock *codeBlock = frame->codeBlock();
if (returnPC && codeBlock) {
- lineNumber = codeBlock->lineNumberForBytecodeOffset(const_cast<JSC::ExecState *>(frame),
- returnPC - codeBlock->instructions().begin() -1);
+#if ENABLE(JIT)
+ unsigned bytecodeOffset = codeBlock->getBytecodeIndex(frame, JSC::ReturnAddressPtr(returnPC));
+#else
+ unsigned bytecodeOffset = returnPC - codeBlock->instructions().begin();
+#endif
+ bytecodeOffset--; //because returnPC is on the next instruction. We want the current one
+ lineNumber = codeBlock->lineNumberForBytecodeOffset(const_cast<JSC::ExecState *>(frame), bytecodeOffset);
}
}
} else {
diff --git a/src/script/api/qscriptengine.cpp b/src/script/api/qscriptengine.cpp
index c14e38a..46c6abb 100644
--- a/src/script/api/qscriptengine.cpp
+++ b/src/script/api/qscriptengine.cpp
@@ -468,7 +468,7 @@ bool isFunction(JSC::JSValue value)
static JSC::JSValue JSC_HOST_CALL functionConnect(JSC::ExecState*, JSC::JSObject*, JSC::JSValue, const JSC::ArgList&);
static JSC::JSValue JSC_HOST_CALL functionDisconnect(JSC::ExecState*, JSC::JSObject*, JSC::JSValue, const JSC::ArgList&);
-JSC::JSValue JSC_HOST_CALL functionDisconnect(JSC::ExecState *exec, JSC::JSObject */*callee*/, JSC::JSValue thisObject, const JSC::ArgList &args)
+JSC::JSValue JSC_HOST_CALL functionDisconnect(JSC::ExecState *exec, JSC::JSObject * /*callee*/, JSC::JSValue thisObject, const JSC::ArgList &args)
{
#ifndef QT_NO_QOBJECT
if (args.size() == 0) {
@@ -533,7 +533,7 @@ JSC::JSValue JSC_HOST_CALL functionDisconnect(JSC::ExecState *exec, JSC::JSObjec
#endif // QT_NO_QOBJECT
}
-JSC::JSValue JSC_HOST_CALL functionConnect(JSC::ExecState *exec, JSC::JSObject */*callee*/, JSC::JSValue thisObject, const JSC::ArgList &args)
+JSC::JSValue JSC_HOST_CALL functionConnect(JSC::ExecState *exec, JSC::JSObject * /*callee*/, JSC::JSValue thisObject, const JSC::ArgList &args)
{
#ifndef QT_NO_QOBJECT
if (args.size() == 0) {
@@ -2259,8 +2259,11 @@ JSC::CallFrame *QScriptEnginePrivate::pushContext(JSC::CallFrame *exec, JSC::JSV
if (calledAsConstructor)
flags |= CalledAsConstructorContext;
+ //build a frame
JSC::CallFrame *newCallFrame = exec;
- if (callee == 0 || !(exec->callee() == callee && exec->returnPC() != 0)) {
+ if (callee == 0 //called from public QScriptEngine::pushContext
+ || exec->returnPC() == 0 || (contextFlags(exec) & NativeContext) //called from native-native call
+ || (exec->codeBlock() && exec->callee() != callee)) { //the interpreter did not build a frame for us.
//We need to check if the Interpreter might have already created a frame for function called from JS.
JSC::Interpreter *interp = exec->interpreter();
JSC::Register *oldEnd = interp->registerFile().end();
@@ -2278,6 +2281,9 @@ JSC::CallFrame *QScriptEnginePrivate::pushContext(JSC::CallFrame *exec, JSC::JSV
newCallFrame->init(0, /*vPC=*/0, exec->scopeChain(), exec, flags, argc, callee);
} else {
setContextFlags(newCallFrame, flags);
+#if ENABLE(JIT)
+ exec->registers()[JSC::RegisterFile::Callee] = JSC::JSValue(callee); //JIT let the callee set the 'callee'
+#endif
if (calledAsConstructor) {
//update the new created this
JSC::Register* thisRegister = newCallFrame->registers() - JSC::RegisterFile::CallFrameHeaderSize - newCallFrame->argumentCount();
@@ -3783,4 +3789,15 @@ QScriptSyntaxCheckResult &QScriptSyntaxCheckResult::operator=(const QScriptSynta
return *this;
}
+#ifdef QT_BUILD_INTERNAL
+Q_AUTOTEST_EXPORT bool qt_script_isJITEnabled()
+{
+#if ENABLE(JIT)
+ return true;
+#else
+ return false;
+#endif
+}
+#endif
+
QT_END_NAMESPACE
diff --git a/src/script/api/qscriptvalue.cpp b/src/script/api/qscriptvalue.cpp
index 1d08676..d5aaed7 100644
--- a/src/script/api/qscriptvalue.cpp
+++ b/src/script/api/qscriptvalue.cpp
@@ -278,7 +278,7 @@ qsreal ToInteger(qsreal n)
QScriptValue QScriptValuePrivate::property(const JSC::Identifier &id, int resolveMode) const
{
- Q_ASSERT(isJSC());
+ Q_ASSERT(isObject());
JSC::ExecState *exec = engine->currentFrame;
JSC::JSObject *object = jscValue.getObject();
JSC::PropertySlot slot(const_cast<JSC::JSObject*>(object));
@@ -301,7 +301,7 @@ QScriptValue QScriptValuePrivate::property(const JSC::Identifier &id, int resolv
QScriptValue QScriptValuePrivate::property(quint32 index, int resolveMode) const
{
- Q_ASSERT(isJSC());
+ Q_ASSERT(isObject());
JSC::ExecState *exec = engine->currentFrame;
JSC::JSObject *object = jscValue.getObject();
JSC::PropertySlot slot(const_cast<JSC::JSObject*>(object));
@@ -393,6 +393,37 @@ void QScriptValuePrivate::setProperty(const JSC::Identifier &id, const QScriptVa
}
}
+QScriptValue::PropertyFlags QScriptValuePrivate::propertyFlags(const JSC::Identifier &id,
+ const QScriptValue::ResolveFlags &mode) const
+{
+ JSC::ExecState *exec = engine->currentFrame;
+ JSC::JSObject *object = JSC::asObject(jscValue);
+ unsigned attribs = 0;
+ if (!object->getPropertyAttributes(exec, id, attribs)) {
+ if ((mode & QScriptValue::ResolvePrototype) && object->prototype() && object->prototype().isObject()) {
+ QScriptValue proto = engine->scriptValueFromJSCValue(object->prototype());
+ return QScriptValuePrivate::get(proto)->propertyFlags(id, mode);
+ }
+ return 0;
+ }
+ QScriptValue::PropertyFlags result = 0;
+ if (attribs & JSC::ReadOnly)
+ result |= QScriptValue::ReadOnly;
+ if (attribs & JSC::DontEnum)
+ result |= QScriptValue::SkipInEnumeration;
+ if (attribs & JSC::DontDelete)
+ result |= QScriptValue::Undeletable;
+ //We cannot rely on attribs JSC::Setter/Getter because they are not necesserly set by JSC (bug?)
+ if (attribs & JSC::Getter || !object->lookupGetter(exec, id).isUndefinedOrNull())
+ result |= QScriptValue::PropertyGetter;
+ if (attribs & JSC::Setter || !object->lookupSetter(exec, id).isUndefinedOrNull())
+ result |= QScriptValue::PropertySetter;
+ if (attribs & QScript::QObjectMemberAttribute)
+ result |= QScriptValue::QObjectMember;
+ result |= QScriptValue::PropertyFlag(attribs & QScriptValue::UserRange);
+ return result;
+}
+
QVariant &QScriptValuePrivate::variantValue() const
{
Q_ASSERT(jscValue.isObject(&QScriptObject::info));
@@ -753,7 +784,7 @@ QScriptValue &QScriptValue::operator=(const QScriptValue &other)
bool QScriptValue::isError() const
{
Q_D(const QScriptValue);
- if (!d || !d->isJSC() || !d->jscValue.isObject())
+ if (!d || !d->isObject())
return false;
return d->jscValue.isObject(&JSC::ErrorInstance::info);
}
@@ -767,7 +798,7 @@ bool QScriptValue::isError() const
bool QScriptValue::isArray() const
{
Q_D(const QScriptValue);
- if (!d || !d->isJSC() || !d->jscValue.isObject())
+ if (!d || !d->isObject())
return false;
return d->jscValue.isObject(&JSC::JSArray::info);
}
@@ -781,7 +812,7 @@ bool QScriptValue::isArray() const
bool QScriptValue::isDate() const
{
Q_D(const QScriptValue);
- if (!d || !d->isJSC() || !d->jscValue.isObject())
+ if (!d || !d->isObject())
return false;
return d->jscValue.isObject(&JSC::DateInstance::info);
}
@@ -795,7 +826,7 @@ bool QScriptValue::isDate() const
bool QScriptValue::isRegExp() const
{
Q_D(const QScriptValue);
- if (!d || !d->isJSC() || !d->jscValue.isObject())
+ if (!d || !d->isObject())
return false;
return d->jscValue.isObject(&JSC::RegExpObject::info);
}
@@ -810,7 +841,7 @@ bool QScriptValue::isRegExp() const
QScriptValue QScriptValue::prototype() const
{
Q_D(const QScriptValue);
- if (!d || !d->isJSC() || !d->jscValue.isObject())
+ if (!d || !d->isObject())
return QScriptValue();
return d->engine->scriptValueFromJSCValue(JSC::asObject(d->jscValue)->prototype());
}
@@ -829,7 +860,7 @@ QScriptValue QScriptValue::prototype() const
void QScriptValue::setPrototype(const QScriptValue &prototype)
{
Q_D(QScriptValue);
- if (!d || !d->isJSC() || !d->jscValue.isObject())
+ if (!d || !d->isObject())
return;
if (prototype.isValid() && prototype.engine()
&& (prototype.engine() != engine())) {
@@ -859,7 +890,7 @@ void QScriptValue::setPrototype(const QScriptValue &prototype)
QScriptValue QScriptValue::scope() const
{
Q_D(const QScriptValue);
- if (!d || !d->isJSC() || !d->jscValue.isObject())
+ if (!d || !d->isObject())
return QScriptValue();
// ### make hidden property
return d->property(QLatin1String("__qt_scope__"), QScriptValue::ResolveLocal);
@@ -871,7 +902,7 @@ QScriptValue QScriptValue::scope() const
void QScriptValue::setScope(const QScriptValue &scope)
{
Q_D(QScriptValue);
- if (!d || !d->isJSC() || !d->jscValue.isObject())
+ if (!d || !d->isObject())
return;
if (scope.isValid() && scope.engine()
&& (scope.engine() != engine())) {
@@ -903,7 +934,7 @@ void QScriptValue::setScope(const QScriptValue &scope)
bool QScriptValue::instanceOf(const QScriptValue &other) const
{
Q_D(const QScriptValue);
- if (!d || !d->isJSC() || !d->jscValue.isObject() || !other.isObject())
+ if (!d || !d->isObject() || !other.isObject())
return false;
if (other.engine() != engine()) {
qWarning("QScriptValue::instanceof: "
@@ -1662,7 +1693,7 @@ void QScriptValue::setProperty(const QString &name, const QScriptValue &value,
const PropertyFlags &flags)
{
Q_D(QScriptValue);
- if (!d || !d->isJSC() || !d->jscValue.isObject())
+ if (!d || !d->isObject())
return;
JSC::ExecState *exec = d->engine->currentFrame;
d->setProperty(JSC::Identifier(exec, name), value, flags);
@@ -1687,7 +1718,7 @@ QScriptValue QScriptValue::property(const QString &name,
const ResolveFlags &mode) const
{
Q_D(const QScriptValue);
- if (!d || !d->isJSC() || !d->jscValue.isObject())
+ if (!d || !d->isObject())
return QScriptValue();
return d->property(name, mode);
}
@@ -1709,7 +1740,7 @@ QScriptValue QScriptValue::property(quint32 arrayIndex,
const ResolveFlags &mode) const
{
Q_D(const QScriptValue);
- if (!d || !d->isJSC() || !d->jscValue.isObject())
+ if (!d || !d->isObject())
return QScriptValue();
return d->property(arrayIndex, mode);
}
@@ -1730,7 +1761,7 @@ void QScriptValue::setProperty(quint32 arrayIndex, const QScriptValue &value,
const PropertyFlags &flags)
{
Q_D(const QScriptValue);
- if (!d || !d->isJSC() || !d->jscValue.isObject())
+ if (!d || !d->isObject())
return;
if (value.engine() && (value.engine() != engine())) {
qWarning("QScriptValue::setProperty() failed: "
@@ -1780,7 +1811,7 @@ QScriptValue QScriptValue::property(const QScriptString &name,
const ResolveFlags &mode) const
{
Q_D(const QScriptValue);
- if (!d || !d->isJSC() || !d->jscValue.isObject() || !name.isValid())
+ if (!d || !d->isObject() || !name.isValid())
return QScriptValue();
return d->property(name.d_ptr->identifier, mode);
}
@@ -1803,7 +1834,7 @@ void QScriptValue::setProperty(const QScriptString &name,
const PropertyFlags &flags)
{
Q_D(QScriptValue);
- if (!d || !d->isJSC() || !d->jscValue.isObject() || !name.isValid())
+ if (!d || !d->isObject() || !name.isValid())
return;
d->setProperty(name.d_ptr->identifier, value, flags);
}
@@ -1817,9 +1848,11 @@ void QScriptValue::setProperty(const QScriptString &name,
QScriptValue::PropertyFlags QScriptValue::propertyFlags(const QString &name,
const ResolveFlags &mode) const
{
- if (!isObject())
+ Q_D(const QScriptValue);
+ if (!d || !d->isObject())
return 0;
- return propertyFlags(engine()->toStringHandle(name), mode);
+ JSC::ExecState *exec = d->engine->currentFrame;
+ return d->propertyFlags(JSC::Identifier(exec, name), mode);
}
@@ -1835,33 +1868,9 @@ QScriptValue::PropertyFlags QScriptValue::propertyFlags(const QScriptString &nam
const ResolveFlags &mode) const
{
Q_D(const QScriptValue);
- if (!isObject())
+ if (!d || !d->isObject() || !name.isValid())
return 0;
- JSC::ExecState *exec = d->engine->currentFrame;
- JSC::JSObject *object = JSC::asObject(d->jscValue);
- JSC::Identifier id = name.d_ptr->identifier;
- unsigned attribs = 0;
- if (!object->getPropertyAttributes(exec, id, attribs)) {
- if ((mode & QScriptValue::ResolvePrototype) && object->prototype())
- return d->engine->scriptValueFromJSCValue(object->prototype()).propertyFlags(name, mode);
- return 0;
- }
- QScriptValue::PropertyFlags result = 0;
- if (attribs & JSC::ReadOnly)
- result |= QScriptValue::ReadOnly;
- if (attribs & JSC::DontEnum)
- result |= QScriptValue::SkipInEnumeration;
- if (attribs & JSC::DontDelete)
- result |= QScriptValue::Undeletable;
- //We cannot rely on attribs JSC::Setter/Getter because they are not necesserly set by JSC (bug?)
- if (attribs & JSC::Getter || !object->lookupGetter(exec, id).isUndefinedOrNull())
- result |= QScriptValue::PropertyGetter;
- if (attribs & JSC::Setter || !object->lookupSetter(exec, id).isUndefinedOrNull())
- result |= QScriptValue::PropertySetter;
- if (attribs & QScript::QObjectMemberAttribute)
- result |= QScriptValue::QObjectMember;
- result |= QScriptValue::PropertyFlag(attribs & QScriptValue::UserRange);
- return result;
+ return d->propertyFlags(name.d_ptr->identifier, mode);
}
/*!
@@ -2263,7 +2272,7 @@ bool QScriptValue::isUndefined() const
bool QScriptValue::isObject() const
{
Q_D(const QScriptValue);
- return d && d->isJSC() && d->jscValue.isObject();
+ return d && d->isObject();
}
/*!
@@ -2310,10 +2319,9 @@ bool QScriptValue::isQObject() const
bool QScriptValue::isQMetaObject() const
{
Q_D(const QScriptValue);
- if (!d || !d->isJSC() || !d->jscValue.isObject())
+ if (!d || !d->isObject())
return false;
return JSC::asObject(d->jscValue)->isObject(&QScript::QMetaObjectWrapperObject::info);
- return false;
}
/*!
@@ -2337,7 +2345,7 @@ bool QScriptValue::isValid() const
QScriptValue QScriptValue::data() const
{
Q_D(const QScriptValue);
- if (!d || !d->isJSC() || !d->jscValue.isObject())
+ if (!d || !d->isObject())
return QScriptValue();
if (d->jscValue.isObject(&QScriptObject::info)) {
QScriptObject *scriptObject = static_cast<QScriptObject*>(JSC::asObject(d->jscValue));
@@ -2359,7 +2367,7 @@ QScriptValue QScriptValue::data() const
void QScriptValue::setData(const QScriptValue &data)
{
Q_D(QScriptValue);
- if (!d || !d->isJSC() || !d->jscValue.isObject())
+ if (!d || !d->isObject())
return;
JSC::JSValue other = d->engine->scriptValueToJSCValue(data);
if (d->jscValue.isObject(&QScriptObject::info)) {
@@ -2413,8 +2421,13 @@ QScriptClass *QScriptValue::scriptClass() const
void QScriptValue::setScriptClass(QScriptClass *scriptClass)
{
Q_D(QScriptValue);
- if (!d || !d->isJSC() || !d->jscValue.isObject(&QScriptObject::info))
+ if (!d || !d->isObject())
+ return;
+ if (!d->jscValue.isObject(&QScriptObject::info)) {
+ qWarning("QScriptValue::setScriptClass() failed: "
+ "cannot change class of non-QScriptObject");
return;
+ }
QScriptObject *scriptObject = static_cast<QScriptObject*>(JSC::asObject(d->jscValue));
QScriptObjectDelegate *delegate = scriptObject->delegate();
if (!delegate || (delegate->type() != QScriptObjectDelegate::ClassObject)) {
diff --git a/src/script/api/qscriptvalue_p.h b/src/script/api/qscriptvalue_p.h
index 3e952af..6d57d32 100644
--- a/src/script/api/qscriptvalue_p.h
+++ b/src/script/api/qscriptvalue_p.h
@@ -85,6 +85,7 @@ public:
inline void initFrom(const QString &value);
inline bool isJSC() const;
+ inline bool isObject() const;
QVariant &variantValue() const;
void setVariantValue(const QVariant &value);
@@ -104,6 +105,8 @@ public:
inline QScriptValue property(const QString &, int resolveMode) const;
void setProperty(const JSC::Identifier &id, const QScriptValue &value,
const QScriptValue::PropertyFlags &flags);
+ QScriptValue::PropertyFlags propertyFlags(
+ const JSC::Identifier &id, const QScriptValue::ResolveFlags &mode) const;
void detachFromEngine();
@@ -142,6 +145,11 @@ inline bool QScriptValuePrivate::isJSC() const
return (type == JSC);
}
+inline bool QScriptValuePrivate::isObject() const
+{
+ return isJSC() && jscValue && jscValue.isObject();
+}
+
// Rest of inline functions implemented in qscriptengine_p.h
QT_END_NAMESPACE
diff --git a/src/script/bridge/qscriptglobalobject.cpp b/src/script/bridge/qscriptglobalobject.cpp
index c929e12..3fa5879 100644
--- a/src/script/bridge/qscriptglobalobject.cpp
+++ b/src/script/bridge/qscriptglobalobject.cpp
@@ -100,6 +100,15 @@ void GlobalObject::put(JSC::ExecState* exec, const JSC::Identifier& propertyName
JSC::JSGlobalObject::put(exec, propertyName, value, slot);
}
+void GlobalObject::putWithAttributes(JSC::ExecState* exec, const JSC::Identifier& propertyName,
+ JSC::JSValue value, unsigned attributes)
+{
+ if (customGlobalObject)
+ customGlobalObject->putWithAttributes(exec, propertyName, value, attributes);
+ else
+ JSC::JSGlobalObject::putWithAttributes(exec, propertyName, value, attributes);
+}
+
bool GlobalObject::deleteProperty(JSC::ExecState* exec,
const JSC::Identifier& propertyName, bool checkDontDelete)
{
diff --git a/src/script/bridge/qscriptglobalobject_p.h b/src/script/bridge/qscriptglobalobject_p.h
index eff24a2..11b1482 100644
--- a/src/script/bridge/qscriptglobalobject_p.h
+++ b/src/script/bridge/qscriptglobalobject_p.h
@@ -74,6 +74,8 @@ public:
JSC::PropertySlot&);
virtual void put(JSC::ExecState* exec, const JSC::Identifier& propertyName,
JSC::JSValue, JSC::PutPropertySlot&);
+ virtual void putWithAttributes(JSC::ExecState* exec, const JSC::Identifier& propertyName,
+ JSC::JSValue value, unsigned attributes);
virtual bool deleteProperty(JSC::ExecState*,
const JSC::Identifier& propertyName,
bool checkDontDelete = true);
@@ -115,6 +117,8 @@ public:
virtual void put(JSC::ExecState* exec, const JSC::Identifier& propertyName,
JSC::JSValue value, JSC::PutPropertySlot& slot)
{ originalGlobalObject->JSC::JSGlobalObject::put(exec, propertyName, value, slot); }
+ virtual void putWithAttributes(JSC::ExecState* exec, const JSC::Identifier& propertyName, JSC::JSValue value, unsigned attributes)
+ { originalGlobalObject->JSC::JSGlobalObject::putWithAttributes(exec, propertyName, value, attributes); }
virtual bool deleteProperty(JSC::ExecState* exec,
const JSC::Identifier& propertyName, bool checkDontDelete = true)
{ return originalGlobalObject->JSC::JSGlobalObject::deleteProperty(exec, propertyName, checkDontDelete); }
diff --git a/src/script/bridge/qscriptvariant.cpp b/src/script/bridge/qscriptvariant.cpp
index c4a152a..ab75a02 100644
--- a/src/script/bridge/qscriptvariant.cpp
+++ b/src/script/bridge/qscriptvariant.cpp
@@ -137,7 +137,7 @@ static JSC::JSValue JSC_HOST_CALL variantProtoFuncToString(JSC::ExecState *exec,
JSC::JSValue value = variantProtoFuncValueOf(exec, callee, thisValue, args);
if (value.isObject()) {
result = v.toString();
- if (result.isEmpty()) {
+ if (result.isEmpty() && !v.canConvert(QVariant::String)) {
result = "QVariant(";
result += v.typeName();
result += ")";
diff --git a/src/script/script.pro b/src/script/script.pro
index 5844620..301386d 100644
--- a/src/script/script.pro
+++ b/src/script/script.pro
@@ -10,6 +10,9 @@ unix:QMAKE_PKGCONFIG_REQUIRES = QtCore
include(../qbase.pri)
+# Disable a few warnings on Windows.
+win32-msvc*: QMAKE_CXXFLAGS += -wd4291 -wd4344 -wd4503 -wd4800 -wd4819 -wd4996 -wd4396 -wd4099
+
# disable JIT for now
DEFINES += ENABLE_JIT=0
# FIXME: shared the statically built JavaScriptCore
diff --git a/src/script/utils/qscriptdate.cpp b/src/script/utils/qscriptdate.cpp
index a6abe4a..2445ebf 100644
--- a/src/script/utils/qscriptdate.cpp
+++ b/src/script/utils/qscriptdate.cpp
@@ -330,7 +330,7 @@ static qsreal getLocalTZA()
/*!
\internal
- Converts the QDateTime \dt to an ECMA Date value (in UTC form).
+ Converts the QDateTime \a dt to an ECMA Date value (in UTC form).
*/
qsreal FromDateTime(const QDateTime &dt)
{
diff --git a/src/sql/drivers/odbc/qsql_odbc.cpp b/src/sql/drivers/odbc/qsql_odbc.cpp
index 6a8609e..06ee3e1 100644
--- a/src/sql/drivers/odbc/qsql_odbc.cpp
+++ b/src/sql/drivers/odbc/qsql_odbc.cpp
@@ -743,37 +743,31 @@ void QODBCDriverPrivate::splitTableQualifier(const QString & qualifier, QString
QODBCDriverPrivate::DefaultCase QODBCDriverPrivate::defaultCase() const
{
- static bool isInitialized = false;
- static DefaultCase ret;
-
- if (!isInitialized) {
- SQLUSMALLINT casing;
- int r = SQLGetInfo(hDbc,
- SQL_IDENTIFIER_CASE,
- &casing,
- sizeof(casing),
- NULL);
- if ( r != SQL_SUCCESS)
- ret = Lower;//arbitrary case if driver cannot be queried
- else {
- switch (casing) {
- case (SQL_IC_UPPER):
- ret = Upper;
- break;
- case (SQL_IC_LOWER):
- ret = Lower;
- break;
- case (SQL_IC_SENSITIVE):
- ret = Sensitive;
- break;
- case (SQL_IC_MIXED):
- ret = Mixed;
- break;
- default:
- ret = Upper;
- }
+ DefaultCase ret;
+ SQLUSMALLINT casing;
+ int r = SQLGetInfo(hDbc,
+ SQL_IDENTIFIER_CASE,
+ &casing,
+ sizeof(casing),
+ NULL);
+ if ( r != SQL_SUCCESS)
+ ret = Mixed;//arbitrary case if driver cannot be queried
+ else {
+ switch (casing) {
+ case (SQL_IC_UPPER):
+ ret = Upper;
+ break;
+ case (SQL_IC_LOWER):
+ ret = Lower;
+ break;
+ case (SQL_IC_SENSITIVE):
+ ret = Sensitive;
+ break;
+ case (SQL_IC_MIXED):
+ default:
+ ret = Mixed;
+ break;
}
- isInitialized = true;
}
return ret;
}
diff --git a/src/src.pro b/src/src.pro
index 48d647d..63f50ba 100644
--- a/src/src.pro
+++ b/src/src.pro
@@ -6,8 +6,7 @@ win32:SRC_SUBDIRS += src_winmain
wince*:{
SRC_SUBDIRS += src_corelib src_xml src_gui src_sql src_network src_testlib
} else:symbian {
- SRC_SUBDIRS += src_s60main src_corelib src_xml src_gui src_network src_sql src_testlib
- SRC_SUBDIRS += $$QT_SOURCE_TREE/src/s60installs/qt_libs.pro
+ SRC_SUBDIRS += src_s60main src_corelib src_xml src_gui src_network src_sql src_testlib src_s60installs
} else {
SRC_SUBDIRS += src_tools_bootstrap src_tools_moc src_tools_rcc src_tools_uic src_corelib src_xml src_network src_gui src_sql src_testlib
!vxworks:contains(QT_CONFIG, qt3support): SRC_SUBDIRS += src_qt3support
@@ -38,6 +37,8 @@ SRC_SUBDIRS += src_plugins
src_s60main.subdir = $$QT_SOURCE_TREE/src/s60main
src_s60main.target = sub-s60main
+src_s60installs.subdir = $$QT_SOURCE_TREE/src/s60installs
+src_s60installs.target = sub-s60installs
src_winmain.subdir = $$QT_SOURCE_TREE/src/winmain
src_winmain.target = sub-winmain
src_tools_bootstrap.subdir = $$QT_SOURCE_TREE/src/tools/bootstrap
diff --git a/src/svg/qsvgtinydocument.cpp b/src/svg/qsvgtinydocument.cpp
index d7cbcb2..e6b0e8e 100644
--- a/src/svg/qsvgtinydocument.cpp
+++ b/src/svg/qsvgtinydocument.cpp
@@ -240,7 +240,7 @@ void QSvgTinyDocument::draw(QPainter *p, const QRectF &bounds)
//sets default style on the painter
//### not the most optimal way
mapSourceToTarget(p, bounds);
- QPen pen(QBrush(Qt::NoBrush), 1, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
+ QPen pen(Qt::NoBrush, 1, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
pen.setMiterLimit(4);
p->setPen(pen);
p->setBrush(Qt::black);
@@ -283,7 +283,7 @@ void QSvgTinyDocument::draw(QPainter *p, const QString &id,
QTransform originalTransform = p->worldTransform();
//XXX set default style on the painter
- QPen pen(QBrush(Qt::NoBrush), 1, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
+ QPen pen(Qt::NoBrush, 1, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
pen.setMiterLimit(4);
p->setPen(pen);
p->setBrush(Qt::black);
diff --git a/src/tools/moc/generator.cpp b/src/tools/moc/generator.cpp
index cc6fa88..95e8386 100644
--- a/src/tools/moc/generator.cpp
+++ b/src/tools/moc/generator.cpp
@@ -302,13 +302,18 @@ void Generator::generateCode()
}
}
if (!extraList.isEmpty()) {
+ fprintf(out, "#ifdef Q_NO_DATA_RELOCATION\n");
+ fprintf(out, "static const QMetaObjectAccessor qt_meta_extradata_%s[] = {\n ", qualifiedClassNameIdentifier.constData());
+ for (int i = 0; i < extraList.count(); ++i) {
+ fprintf(out, " %s::getStaticMetaObject,\n", extraList.at(i).constData());
+ }
+ fprintf(out, "#else\n");
fprintf(out, "static const QMetaObject *qt_meta_extradata_%s[] = {\n ", qualifiedClassNameIdentifier.constData());
for (int i = 0; i < extraList.count(); ++i) {
- if (i)
- fprintf(out, ",\n ");
- fprintf(out, " &%s::staticMetaObject", extraList.at(i).constData());
+ fprintf(out, " &%s::staticMetaObject,\n", extraList.at(i).constData());
}
- fprintf(out, ",0\n};\n\n");
+ fprintf(out, "#endif //Q_NO_DATA_RELOCATION\n");
+ fprintf(out, " 0\n};\n\n");
}
if (isConstructible || !extraList.isEmpty()) {
@@ -328,7 +333,6 @@ void Generator::generateCode()
//
// Finally create and initialize the static meta object
//
-
if (isQt)
fprintf(out, "const QMetaObject QObject::staticQtMetaObject = {\n");
else
@@ -348,11 +352,22 @@ void Generator::generateCode()
fprintf(out, "&qt_meta_extradata2_%s }\n", qualifiedClassNameIdentifier.constData());
fprintf(out, "};\n");
- if (isQt || !cdef->hasQObject)
+ if(isQt)
+ return;
+
+//
+// Generate static meta object accessor (needed for symbian, because DLLs do not support data imports.
+//
+ fprintf(out, "\n#ifdef Q_NO_DATA_RELOCATION\n");
+ fprintf(out, "const QMetaObject &%s::getStaticMetaObject() { return staticMetaObject; }\n", cdef->qualified.constData());
+ fprintf(out, "#endif //Q_NO_DATA_RELOCATION\n");
+
+ if (!cdef->hasQObject)
return;
fprintf(out, "\nconst QMetaObject *%s::metaObject() const\n{\n return QObject::d_ptr->metaObject ? QObject::d_ptr->metaObject : &staticMetaObject;\n}\n",
cdef->qualified.constData());
+
//
// Generate smart cast function
//
diff --git a/src/xml/dom/qdom.cpp b/src/xml/dom/qdom.cpp
index 7709c28..ac6ba37 100644
--- a/src/xml/dom/qdom.cpp
+++ b/src/xml/dom/qdom.cpp
@@ -7406,7 +7406,9 @@ bool QDomHandler::startElement(const QString& nsURI, const QString&, const QStri
} else {
n = doc->createElement(qName);
}
- n->setLocation(locator->lineNumber(), locator->columnNumber());
+
+ if (n)
+ n->setLocation(locator->lineNumber(), locator->columnNumber());
node->appendChild(n);
node = n;
@@ -7426,7 +7428,7 @@ bool QDomHandler::startElement(const QString& nsURI, const QString&, const QStri
bool QDomHandler::endElement(const QString&, const QString&, const QString&)
{
- if (node == doc)
+ if (!node || node == doc)
return false;
node = node->parent();
diff --git a/src/xmlpatterns/parser/qquerytransformparser_p.h b/src/xmlpatterns/parser/qquerytransformparser_p.h
index 195e597..7f68d92 100644
--- a/src/xmlpatterns/parser/qquerytransformparser_p.h
+++ b/src/xmlpatterns/parser/qquerytransformparser_p.h
@@ -49,57 +49,6 @@
//
// We mean it.
-/****************************************************************************
-**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the QtXmlPatterns of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** No Commercial Usage
-** This file contains pre-release code and may not be distributed.
-** You may use this file in accordance with the terms and conditions
-** contained in the either Technology Preview License Agreement or the
-** Beta Release License Agreement.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain
-** additional rights. These rights are described in the Nokia Qt LGPL
-** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at http://qt.nokia.com/contact.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-
/* A Bison parser, made by GNU Bison 2.3a. */
/* Skeleton interface for Bison's Yacc-like parsers in C