summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@nokia.com>2010-04-01 23:07:37 +0200
committerThiago Macieira <thiago.macieira@nokia.com>2010-04-01 23:07:37 +0200
commit23eb677daea8e084fcaa1256f1a9433e324b1474 (patch)
treea21225293db6881174814290ad7298120c4a078b
parent1f327a1de8db245d0b28e7dfdc5bca1af0b56782 (diff)
parent37e8fd4e09c1221efde3e67e6acd5cfbb35686fd (diff)
Merge remote branch 'origin/4.7' into HEAD
Conflicts: examples/declarative/proxywidgets/proxywidgets.pro examples/declarative/widgets/mywidgets.pro examples/declarative/widgets/widgets.pro
-rw-r--r--demos/declarative/minehunt/minehunt.pro2
-rw-r--r--doc/src/declarative/advtutorial.qdoc413
-rw-r--r--doc/src/declarative/elements.qdoc26
-rw-r--r--doc/src/declarative/modules.qdoc8
-rw-r--r--doc/src/declarative/pics/qmldebugger-creator.pngbin170972 -> 0 bytes
-rw-r--r--doc/src/declarative/qdeclarativedebugging.qdoc57
-rw-r--r--doc/src/declarative/tutorial.qdoc6
-rw-r--r--doc/src/legal/3rdparty.qdoc39
-rw-r--r--doc/src/modules.qdoc5
-rw-r--r--examples/declarative/declarative.pro2
-rw-r--r--examples/declarative/imageprovider/imageprovider.pro4
-rw-r--r--examples/declarative/plugins/plugin.cpp18
-rw-r--r--examples/declarative/plugins/plugins.pro7
-rw-r--r--examples/declarative/proxywidgets/ProxyWidgets/qmldir1
-rw-r--r--examples/declarative/proxywidgets/README (renamed from examples/declarative/widgets/README)2
-rw-r--r--examples/declarative/proxywidgets/proxywidgets.cpp (renamed from examples/declarative/widgets/mywidgets.cpp)6
-rw-r--r--examples/declarative/proxywidgets/proxywidgets.pro (renamed from examples/declarative/widgets/widgets.pro)11
-rw-r--r--examples/declarative/proxywidgets/proxywidgets.qml (renamed from examples/declarative/widgets/mywidgets.qml)2
-rw-r--r--examples/declarative/tutorials/helloworld/Cell.qml6
-rw-r--r--examples/declarative/tutorials/helloworld/tutorial2.qml14
-rw-r--r--examples/declarative/tutorials/helloworld/tutorial3.qml19
-rw-r--r--examples/declarative/tutorials/samegame/samegame1/Button.qml4
-rw-r--r--examples/declarative/tutorials/samegame/samegame1/samegame.qml2
-rw-r--r--examples/declarative/tutorials/samegame/samegame2/Button.qml4
-rw-r--r--examples/declarative/tutorials/samegame/samegame2/samegame.js6
-rw-r--r--examples/declarative/tutorials/samegame/samegame2/samegame.qml8
-rw-r--r--examples/declarative/tutorials/samegame/samegame3/Button.qml4
-rw-r--r--examples/declarative/tutorials/samegame/samegame3/Dialog.qml2
-rw-r--r--examples/declarative/tutorials/samegame/samegame3/samegame.js6
-rw-r--r--examples/declarative/tutorials/samegame/samegame3/samegame.qml7
-rw-r--r--examples/declarative/tutorials/samegame/samegame4/content/BoomBlock.qml2
-rw-r--r--examples/declarative/tutorials/samegame/samegame4/content/Button.qml4
-rw-r--r--examples/declarative/tutorials/samegame/samegame4/content/Dialog.qml2
-rw-r--r--examples/declarative/tutorials/samegame/samegame4/samegame.qml11
-rw-r--r--examples/declarative/widgets/MyWidgets/qmldir1
-rw-r--r--examples/graphicsview/weatheranchorlayout/main.cpp11
-rw-r--r--examples/script/qstetrix/tetrixboard.cpp13
-rw-r--r--examples/script/qstetrix/tetrixboard.h10
-rw-r--r--qmake/project.cpp2
-rw-r--r--src/3rdparty/harfbuzz/src/harfbuzz-greek.c27
-rw-r--r--src/3rdparty/harfbuzz/tests/shaping/main.cpp40
-rw-r--r--src/3rdparty/phonon/ds9/iodevicereader.cpp7
-rw-r--r--src/3rdparty/pixman/README26
-rw-r--r--src/3rdparty/pixman/pixman-arm-neon-asm.S1709
-rw-r--r--src/3rdparty/pixman/pixman-arm-neon-asm.h906
-rw-r--r--src/corelib/kernel/qmetaobject_p.h7
-rw-r--r--src/corelib/kernel/qobject.cpp2
-rw-r--r--src/corelib/tools/qdatetime.cpp5
-rw-r--r--src/corelib/tools/qvarlengtharray.h19
-rw-r--r--src/corelib/tools/qvarlengtharray.qdoc32
-rw-r--r--src/declarative/graphicsitems/qdeclarativeanchors.cpp4
-rw-r--r--src/declarative/graphicsitems/qdeclarativeflickable.cpp6
-rw-r--r--src/declarative/graphicsitems/qdeclarativeitem.cpp15
-rw-r--r--src/declarative/graphicsitems/qdeclarativepositioners.cpp39
-rw-r--r--src/declarative/graphicsitems/qdeclarativepositioners_p.h18
-rw-r--r--src/declarative/graphicsitems/qdeclarativepositioners_p_p.h5
-rw-r--r--src/declarative/graphicsitems/qdeclarativerectangle.cpp3
-rw-r--r--src/declarative/qml/parser/qdeclarativejs.g50
-rw-r--r--src/declarative/qml/parser/qdeclarativejsast.cpp1
-rw-r--r--src/declarative/qml/parser/qdeclarativejsast_p.h10
-rw-r--r--src/declarative/qml/parser/qdeclarativejsgrammar.cpp1665
-rw-r--r--src/declarative/qml/parser/qdeclarativejsgrammar_p.h12
-rw-r--r--src/declarative/qml/parser/qdeclarativejsparser.cpp422
-rw-r--r--src/declarative/qml/parser/qdeclarativejsparser_p.h4
-rw-r--r--src/declarative/qml/qdeclarativecompositetypemanager.cpp50
-rw-r--r--src/declarative/qml/qdeclarativeengine.cpp5
-rw-r--r--src/declarative/qml/qdeclarativescriptparser.cpp13
-rw-r--r--src/declarative/util/qdeclarativelistmodel.cpp4
-rw-r--r--src/gui/dialogs/qdialog.cpp4
-rw-r--r--src/gui/dialogs/qfiledialog.cpp6
-rw-r--r--src/gui/egl/qegl.cpp13
-rw-r--r--src/gui/egl/qegl_p.h53
-rw-r--r--src/gui/graphicsview/qgraphicsitem.cpp163
-rw-r--r--src/gui/graphicsview/qgraphicsitem.h12
-rw-r--r--src/gui/gui.pro1
-rw-r--r--src/gui/image/qimage.cpp4
-rw-r--r--src/gui/image/qpicture.cpp9
-rw-r--r--src/gui/image/qpixmap_raster.cpp4
-rw-r--r--src/gui/itemviews/qitemdelegate.cpp4
-rw-r--r--src/gui/kernel/qapplication.h1
-rw-r--r--src/gui/painting/painting.pri16
-rw-r--r--src/gui/painting/qblendfunctions.cpp446
-rw-r--r--src/gui/painting/qblendfunctions_p.h497
-rw-r--r--src/gui/painting/qdrawhelper.cpp22
-rw-r--r--src/gui/painting/qdrawhelper_neon.cpp409
-rw-r--r--src/gui/painting/qdrawhelper_neon_asm.S192
-rw-r--r--src/gui/painting/qdrawhelper_neon_p.h58
-rw-r--r--src/gui/painting/qpaintbuffer.cpp326
-rw-r--r--src/gui/painting/qpaintbuffer_p.h8
-rw-r--r--src/gui/painting/qpainter.cpp66
-rw-r--r--src/gui/painting/qpainter.h6
-rw-r--r--src/gui/painting/qtransform.cpp15
-rw-r--r--src/gui/text/qfont.cpp2
-rw-r--r--src/gui/text/qfont.h23
-rw-r--r--src/gui/text/qfontengine_mac.mm102
-rw-r--r--src/gui/text/qfontmetrics.cpp4
-rw-r--r--src/gui/text/qstatictext.cpp169
-rw-r--r--src/gui/text/qstatictext.h8
-rw-r--r--src/gui/text/qstatictext_p.h13
-rw-r--r--src/gui/widgets/qlabel.cpp5
-rw-r--r--src/gui/widgets/qlinecontrol_p.h611
-rw-r--r--src/imports/multimedia/qdeclarativeaudio.cpp5
-rw-r--r--src/imports/multimedia/qdeclarativevideo.cpp5
-rw-r--r--src/imports/particles/qdeclarativeparticles.cpp2
-rw-r--r--src/imports/webkit/qdeclarativewebview.cpp2
-rw-r--r--src/multimedia/audio/qaudiooutput_win32_p.cpp2
-rw-r--r--src/multimedia/effects/qsoundeffect.cpp25
-rw-r--r--src/network/ssl/qsslsocket_openssl.cpp2
-rw-r--r--src/opengl/opengl.pro1
-rw-r--r--src/opengl/qgl.cpp2
-rw-r--r--src/opengl/qgl_egl_p.h1
-rw-r--r--src/opengl/qgl_p.h2
-rw-r--r--src/opengl/qgl_x11.cpp6
-rw-r--r--src/opengl/qgl_x11egl.cpp147
-rw-r--r--src/opengl/qglextensions.cpp11
-rw-r--r--src/opengl/qglextensions_p.h36
-rw-r--r--src/openvg/qpixmapdata_vg.cpp11
-rw-r--r--src/plugins/imageformats/svg/main.cpp16
-rw-r--r--src/plugins/imageformats/svg/qsvgiohandler.cpp157
-rw-r--r--src/plugins/imageformats/tiff/qtiffhandler.cpp4
-rw-r--r--src/script/api/qscriptengine.cpp11
-rw-r--r--src/script/api/qscriptprogram.cpp2
-rw-r--r--src/script/api/qscriptstring.cpp2
-rw-r--r--src/script/api/qscriptvalue.cpp80
-rw-r--r--src/script/api/qscriptvalueiterator.cpp21
-rw-r--r--tests/auto/declarative/qdeclarativeanchors/tst_qdeclarativeanchors.cpp4
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/LocalLast.qml2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/lib/com/nokia/installedtest/LocalLast.qml2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/lib/com/nokia/installedtest/qmldir1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp8
-rw-r--r--tests/auto/declarative/qdeclarativelistmodel/tst_qdeclarativelistmodel.cpp26
-rw-r--r--tests/auto/declarative/qdeclarativepositioners/data/flowtest.qml3
-rw-r--r--tests/auto/declarative/qdeclarativepositioners/data/grid-animated.qml1
-rw-r--r--tests/auto/declarative/qdeclarativepositioners/data/grid-spacing.qml1
-rw-r--r--tests/auto/declarative/qdeclarativepositioners/data/gridtest.qml1
-rw-r--r--tests/auto/declarative/qdeclarativepositioners/data/horizontal-animated.qml1
-rw-r--r--tests/auto/declarative/qdeclarativepositioners/data/horizontal-spacing.qml1
-rw-r--r--tests/auto/declarative/qdeclarativepositioners/data/horizontal.qml1
-rw-r--r--tests/auto/declarative/qdeclarativepositioners/data/vertical-animated.qml1
-rw-r--r--tests/auto/declarative/qdeclarativepositioners/data/vertical-spacing.qml1
-rw-r--r--tests/auto/declarative/qdeclarativepositioners/data/vertical.qml1
-rw-r--r--tests/auto/declarative/qdeclarativepositioners/tst_qdeclarativepositioners.cpp54
-rw-r--r--tests/auto/declarative/qdeclarativerepeater/data/itemlist.qml8
-rw-r--r--tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp2
-rw-r--r--tests/auto/declarative/qdeclarativevaluetypes/tst_qdeclarativevaluetypes.cpp1
-rw-r--r--tests/auto/moc/tst_moc.cpp20
-rw-r--r--tests/auto/qdate/tst_qdate.cpp50
-rw-r--r--tests/auto/qfontmetrics/tst_qfontmetrics.cpp2
-rw-r--r--tests/auto/qgl/qgl.pro1
-rw-r--r--tests/auto/qglbuffer/qglbuffer.pro2
-rw-r--r--tests/auto/qglthreads/qglthreads.pro2
-rw-r--r--tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp156
-rw-r--r--tests/auto/qimagereader/images/corrupt.svg32
-rw-r--r--tests/auto/qimagereader/images/corrupt.svgzbin0 -> 407 bytes
-rw-r--r--tests/auto/qimagereader/images/rect.svg462
-rw-r--r--tests/auto/qimagereader/images/rect.svgzbin0 -> 5082 bytes
-rw-r--r--tests/auto/qimagereader/qimagereader.pro1
-rw-r--r--tests/auto/qimagereader/qimagereader.qrc4
-rw-r--r--tests/auto/qimagereader/tst_qimagereader.cpp64
-rw-r--r--tests/auto/qmetaobject/tst_qmetaobject.cpp14
-rw-r--r--tests/auto/qobject/tst_qobject.cpp20
-rw-r--r--tests/auto/qscriptengine/tst_qscriptengine.cpp21
-rw-r--r--tests/auto/qstatictext/tst_qstatictext.cpp171
-rw-r--r--tests/auto/qtextcodec/tst_qtextcodec.cpp39
-rw-r--r--tests/auto/qtextscriptengine/tst_qtextscriptengine.cpp36
-rw-r--r--tests/auto/qtreeview/tst_qtreeview.cpp39
-rw-r--r--tests/auto/qvarlengtharray/tst_qvarlengtharray.cpp13
-rw-r--r--tests/benchmarks/declarative/typeimports/data/QmlTestType1.qml2
-rw-r--r--tests/benchmarks/declarative/typeimports/data/QmlTestType2.qml2
-rw-r--r--tests/benchmarks/declarative/typeimports/data/QmlTestType3.qml2
-rw-r--r--tests/benchmarks/declarative/typeimports/data/QmlTestType4.qml2
-rw-r--r--tests/benchmarks/declarative/typeimports/data/cpp.qml15
-rw-r--r--tests/benchmarks/declarative/typeimports/data/qml.qml13
-rw-r--r--tests/benchmarks/declarative/typeimports/tst_typeimports.cpp138
-rw-r--r--tests/benchmarks/declarative/typeimports/typeimports.pro15
-rw-r--r--tools/configure/configureapp.cpp4
-rw-r--r--tools/qdoc3/doc/examples/main.cpp2
-rw-r--r--tools/qdoc3/doc/qdoc-manual.qdoc106
-rw-r--r--tools/qdoc3/generator.cpp14
-rw-r--r--tools/qdoc3/node.cpp10
-rw-r--r--tools/qtestlib/wince/cetest/cetcpsyncconnection.cpp21
-rw-r--r--tools/qtestlib/wince/cetest/cetcpsyncconnection.h3
-rw-r--r--tools/qtestlib/wince/cetest/cetest.pro5
-rw-r--r--tools/qttracereplay/main.cpp99
184 files changed, 8575 insertions, 2825 deletions
diff --git a/demos/declarative/minehunt/minehunt.pro b/demos/declarative/minehunt/minehunt.pro
index 03059c7444..da46dfc464 100644
--- a/demos/declarative/minehunt/minehunt.pro
+++ b/demos/declarative/minehunt/minehunt.pro
@@ -9,7 +9,6 @@ DESTDIR = MinehuntCore
# Input
SOURCES += minehunt.cpp
-
sources.files = minehunt.qml minehunt.pro
sources.path = $$[QT_INSTALL_DEMOS]/declarative/minehunt
@@ -26,7 +25,6 @@ INSTALLS = sources MinehuntCore_sources target
symbian:{
load(data_caging_paths)
TARGET.EPOCALLOWDLLDATA = 1
- TARGET.CAPABILITY = CAP_GENERAL_DLL
include($$QT_SOURCE_TREE/demos/symbianpkgrules.pri)
importFiles.sources = minehunt.dll \
diff --git a/doc/src/declarative/advtutorial.qdoc b/doc/src/declarative/advtutorial.qdoc
index e420e6dd4d..598f47b1ae 100644
--- a/doc/src/declarative/advtutorial.qdoc
+++ b/doc/src/declarative/advtutorial.qdoc
@@ -45,11 +45,12 @@
\brief A more advanced tutorial, showing how to use QML to create a game.
\nextpage QML Advanced Tutorial 1 - Creating the Game Canvas and Blocks
-This tutorial goes step-by-step through creating a full application using just QML.
-It is assumed that you already know basic QML (such as from doing the simple tutorial) and the focus is on showing
-how to turn that knowledge into a complete and functioning application.
+This tutorial walks step-by-step through the creation of a full application using QML.
-This tutorial involves a significant amount of JavaScript to implement the game logic. An understanding of JavaScript is helpful to understand the JavaScript parts of this tutorial, but if you don't understand JavaScript you can still get a feel for how to integrate QML elements with backend logic which creates and controls them. From the QML perspective, there is little difference between integrating with backend logic written in C++ and backend logic written in JavaScript.
+It is assumed that you already know the basics of QML (for example, from reading the \l{QML Tutorial}{simple tutorial}) and this
+tutorial focuses on using that knowledge to produce a complete and functioning application.
+
+The tutorial involves a significant amount of JavaScript to implement the game logic. An understanding of JavaScript is helpful to understand parts of this tutorial, but if you don't understand JavaScript you can still get a feel for how you can integrate backend logic to create and control QML elements. From the QML perspective, there is little difference between integrating QML with backend logic written in C++ and backend logic written in JavaScript.
In this tutorial we recreate, step by step, a version of the Same Game demo in $QTDIR/demos/declarative/samegame.qml.
The results of the individual steps are in the $QTDIR/examples/declarative/tutorials/samegame directory.
@@ -75,45 +76,62 @@ Tutorial chapters:
\previouspage QML Advanced Tutorial
\nextpage QML Advanced Tutorial 2 - Populating the Game Canvas
-The first step is to create the items in your application. In Same Game we have a main game screen and the blocks that populate it.
+In this chapter:
+
+\tableofcontents
+
+The files referenced on this page can be found in \c $QTDIR\examples\tutorials\samegame\samegame1.
+
+\section2 Creating the application screen
+
+The first step is to create the basic QML items in your application.
+
+To begin with, we create our Same Game application with a main screen like this:
\image declarative-adv-tutorial1.png
-Here is the QML code for the basic elements. The game window:
+This is defined by the main application file, \c samegame.qml, which looks like this:
\snippet declarative/tutorials/samegame/samegame1/samegame.qml 0
-This gives you a basic game window, with room for the game canvas. A new game
-button and room to display the score. The one thing you may not recognize here
-is the \l SystemPalette item. This item provides access to the Qt system palette
-and is used to make the button look more like a system button (for exact native
-feel you would use a \l QPushButton). Since we want a fully functional button,
-we use the QML elements Text and MouseArea inside a Rectangle to assemble a
-button. Below is the code which we wrote to do this:
+This gives you a basic game window that includes the main canvas for the
+blocks, a "New Game" button and a score display.
-\snippet declarative/tutorials/samegame/samegame1/Button.qml 0
+One item you may not recognize here
+is the \l SystemPalette item. This provides access to the Qt system palette
+and is used to give the button a more native look-and-feel.
+
+\section2 Adding \c Button and \c Block components
-Note that this Button component was written to be fairly generic, in case we
-want to use a similarly styled button later.
+The \c Button item in the code above is defined in a separate file named \c Button.qml.
+To create a functional button, we use the QML elements \l Text and \l MouseArea inside a \l Rectangle.
+Here is the \c Button.qml code:
+
+\snippet declarative/tutorials/samegame/samegame1/Button.qml 0
-And here is a simple block:
+In Same Game, the screen is filled with small blocks when the game begins.
+Each block is just an item that contains an image. The block
+code is defined in a separate \c Block.qml file:
\snippet declarative/tutorials/samegame/samegame1/Block.qml 0
-Since it doesn't do anything yet it's very simple, just an image. As the
-tutorial progresses and the block starts doing things the file will become
-more than just an image. Note that we've set the image to be the size of the item.
-This will be used later, when we dynamically create and size the block items the image will be scaled automatically
-to the correct size.
+At the moment, the block doesn't do anything; it is just an image. As the
+tutorial progresses we will animate and give behaviors to the blocks.
+We have not added any code yet to create the blocks; we will do this
+in the next chapter.
-Note that because there are several stages to this tutorial they share images. This is done by having a shared resources
-folder containing the images, and all stages of the tutorial refer to the same shared folder. This is the reason for the
-'../shared/pics' part of the image source. The image source can be any relative or absolute path, and it is relative to the
-location of the file the Image element is in, with ../ meaning to go up one level.
+We have set the image to be the size of its parent Item using \c {anchors.fill: parent}.
+This means that when we dynamically create and resize the block items
+later on in the tutorial, the image will be scaled automatically to the
+correct size.
-You should be familiar with all that goes on in these files so far. This is a
-very basic start and doesn't move at all - next we will populate the game canvas
-with some blocks.
+Notice the relative path for the Image element's \c source property.
+This path is relative to the location of the file that contains the \l Image element.
+Alternatively, you could set the Image source to an absolute file path or a URL
+that contains an image.
+
+You should be familiar with the code so far. We have just created some basic
+elements to get started. Next, we will populate the game canvas with some blocks.
*/
@@ -124,64 +142,69 @@ with some blocks.
\previouspage QML Advanced Tutorial 1 - Creating the Game Canvas and Blocks
\nextpage QML Advanced Tutorial 3 - Implementing the Game Logic
-Now that we've written some basic elements, let's start writing the game. The
-first thing to do is to generate all of the blocks. Now we need to dynamically
-generate all of these blocks, because you have a new, random set of blocks
-every time. As they are dynamically generated every time the new game button is
-clicked, as opposed to on startup, we will be dynamically generating the blocks
-in the JavaScript, as opposed to using a \l Repeater.
+In this chapter:
+
+\tableofcontents
+
+The files referenced on this page can be found in \c $QTDIR\examples\tutorials\samegame\samegame2.
+
+
+\section2 Generating the blocks in JavaScript
-This adds enough script to justify a new file, \c{samegame.js}, the intial version
-of which is shown below
+Now that we've written some basic elements, let's start writing the game.
+
+The first task is to generate the game blocks. Each time the New Game button
+is clicked, the game canvas is populated with a new, random set of
+blocks. Since we need to dynamically generate new blocks for each new game,
+we cannot use \l Repeater to define the blocks. Instead, we will
+create the blocks in JavaScript.
+
+Here is the JavaScript code for generating the blocks, contained in a new
+file, \c samegame.js:
\snippet declarative/tutorials/samegame/samegame2/samegame.js 0
-The gist of this code is that we create the blocks dynamically, as many as will fit, and then store them in an array for future reference.
-The \c initBoard function will be hooked up to the new game button soon, and should be fairly straight forward.
-
-The \c createBlock function is a lot bigger, and I'll explain it block by block.
-First we ensure that the component has been constructed. QML elements, including composite ones like the \c Block.qml
-that we've written, are never created directly in script. While there is a function to parse and create an arbitrary QML string,
-in the case where you are repeatedly creating the same item you will want to use the \c createComponent function. \c createComponent is
-a built-in function in the declarative JavaScript, and returns a component object.
-A component object prepares and stores a QML element (usually a composite element) for easy and efficient use.
-When the component is ready, you can create a new instance of the loaded QML with the \c createObject method.
-If the component is loaded remotely (over HTTP for example) then you will have to wait for the component to finish loading
-before calling \c createObject. Since we don't wait here (the waiting is asyncronous, the component object will send a signal to tell
-you when it's done) this code will only work if the block QML is a local file.
-
-As we aren't waiting for the component, the next block of code creates a game block with \c{component.createObject}.
-Since there could be an error in the QML file you are trying to load, success is not guaranteed.
-The first bit of error checkign code comes right after \c{createObject()}, to ensure that the object loaded correctly.
-If it did not load correctly the function returns false, but we don't have that hooked up to the main UI to indicate
-that something has gone wrong. Instead we print out error messages to the console, because an error here means an invalid
-QML file and should only happen while you are developing and testing the UI.
-
-Next we start to set up our dynamically created block.
-Because the \c{Block.qml} file is generic it needs to be placed in the main scene, and in the right place.
-This is why \c parent, \c x, \c y, \c width and \c height are set. We then store it in the board array for later use.
-
-Finally, we have some more error handling. You can only call \c{createObject} if the component has loaded.
-If it has not loaded, either it is still loading or there was an error loading (such as a missing file).
-Since we don't request remote files the problem is likely to be a missing or misplaced file.
-Again we print this to the console to aid debugging.
-
-You now have the code to create a field of blocks dynamically, like below:
+The main function here is \c initBoard(). It creates an array to store all the game
+blocks, then calls \c createBlock() to create enough blocks to fill the game canvas.
-\image declarative-adv-tutorial2.png
+The \c createBlock() function creates a block using the \c Block.qml file
+and moves the new block to its position on the game canvas. This involves several steps:
-To hook this code up to the \e{New Game} button, you alter it as below:
+\list
+\o \l {createComponent(url file)} is called to generate an element from \c Block.qml.
+ If the component is ready, we can call \c createObject() to create an instance of the \c Block item.
+ (If a component is loaded remotely - over HTTP for example - then we would have to wait for the
+ component to finish loading before calling \c createObject()).
+\o If \c createObject() returned null (i.e. if there was an error while
+ loading the object), print the error information.
+\o Place the block in its position on the board and set its width and height.
+ Also, store in the blocks array for future reference.
+\o Finally, print error information to the console if the component could not be
+ loaded for some reason (for example, if the file is missing).
+\endlist
-\snippet declarative/tutorials/samegame/samegame2/samegame.qml 1
-We have just replaced the \c{onClicked: console.log("Implement me!")} with \c{onClicked: initBoard()}.
-Note that in order to have the function available, you'll need to include the script in the main file,
-by adding a script element to it.
+\section2 Connecting JavaScript components to QML
+
+Now we need to call the JavaScript code in \c samegame.js from our QML files.
+To do this, we add this line to \c samegame.qml which imports
+the JavaScript file as a \l{Modules#QML Modules}{module}:
\snippet declarative/tutorials/samegame/samegame2/samegame.qml 2
-With those two changes, and the script file, you are now dynamically creating a field of blocks you can play with.
-They don't do anything now though; the next chapter will add the game mechanics.
+This allows us to refer to any functions within \c samegame.js using "SameGame"
+as a prefix: for example, \c SameGame.initBoard() or \c SameGame.createBlock().
+This means we can now connect the New Game button's \c onClicked handler to the \c initBoard()
+function, like this:
+
+\snippet declarative/tutorials/samegame/samegame2/samegame.qml 1
+
+So, when you click the New Game button, \c initBoard() is called and generates a field of blocks, like this:
+
+\image declarative-adv-tutorial2.png
+
+Now, we have a screen of blocks, and we can begin to add the game mechanics.
+
*/
/*!
@@ -191,11 +214,20 @@ They don't do anything now though; the next chapter will add the game mechanics.
\previouspage QML Advanced Tutorial 2 - Populating the Game Canvas
\nextpage QML Advanced Tutorial 4 - Finishing Touches
-First we add to the \c initBoard function clearing of the board before filling it up again, so that clicking new game won't leave the previous game
-lying around in the background. To the \c createComponent function we have added setting the type of the block to a number between
-one and three - it's fundamental to the game logic that the blocks be different types if you want a fun game.
+In this chapter:
+
+\tableofcontents
+
+The files referenced on this page can be found in \c $QTDIR\examples\tutorials\samegame\samegame3.
+
+\section2 Making a playable game
+
+Now that we have all the game components, we can add the game logic that
+dictates how a player interacts with the blocks and plays the game
+until it is won or lost.
+
+To do this, we have added the following functions to \c samegame.js:
-The main change was adding the following game logic functions:
\list
\o function \c{handleClick(x,y)}
\o function \c{floodFill(xIdx,yIdx,type)}
@@ -204,59 +236,65 @@ The main change was adding the following game logic functions:
\o function \c{floodMoveCheck(xIdx, yIdx, type)}
\endlist
-As this is a tutorial about QML, not game design, these functions will not be discussed in detail. The game logic here
-was written in script, but it could have been written in C++ and had these functions exposed in the same way (except probably faster).
-The interfacing of these functions and QML is what we will focus on. Of these functions, only \c handleClick and \c victoryCheck
-interface closely with the QML. Those functions are shown below (the rest are still in the code for this tutorial located at
-\c{$QTDIR/examples/declarative/tutorials/samegame}).
+As this is a tutorial about QML, not game design, we will only discuss \c handleClick() and \c victoryCheck() below since they interface directly with the QML elements. Note that although the game logic here is written in JavaScript, it could have been written in C++ and then exposed to JavaScript.
-\snippet declarative/tutorials/samegame/samegame3/samegame.js 1
-\snippet declarative/tutorials/samegame/samegame3/samegame.js 2
+\section3 Enabling mouse click interaction
-You'll notice them referring to the \c gameCanvas item. This is an item that has been added to the QML for easier interfacing with the game logic.
-It is placed next to the background image and replaces the background as the item to create the blocks in.
-Its code is shown below:
+To make it easier for the JavaScript code to interface with the QML elements, we have added an Item called \c gameCanvas to \c samegame.qml. It replaces the background as the item which contains the blocks, and accepts mouse input from the user. Here is the item code:
\snippet declarative/tutorials/samegame/samegame3/samegame.qml 1
-This item is the exact size of the board, contains a score property, and a mouse region for input.
-The blocks are now created as its children, and its size is used to determining the board size, so as to scale to the available screen size.
-Since it needs to bind its size to a multiple of \c tileSize, \c tileSize needs to be moved into a QML property and out of the script file.
+The \c gameCanvas item is the exact size of the board, and has a \c score property and a \l MouseArea for input.
+The blocks are now created as its children, and its dimensions are used to determine the board size so that
+the application scales to the available screen size.
+Since its size is bound to a multiple of \c tileSize, \c tileSize needs to be moved out of \c samegame.js and into \c samegame.qml as a QML property.
Note that it can still be accessed from the script.
-The mouse region simply calls \c{handleClick()}, which deals with the input events.
-Should those events cause the player to score, \c{gameCanvas.score} is updated.
-The score display text item has also been changed to bind its text property to \c{gamecanvas.score}.
-Note that if score was a global variable in the \c{samegame.js} file you could not bind to it. You can only bind to QML properties.
+The \l MouseArea simply calls \c{handleClick()} in \c samegame.js, which determines whether the player's click should cause any blocks to be removed, and updates \c gameCanvas.score with the current score if necessary. Here is the \c handleClick() function:
+
+\snippet declarative/tutorials/samegame/samegame3/samegame.js 1
+
+Note that if \c score was a global variable in the \c{samegame.js} file you would not be able to bind to it. You can only bind to QML properties.
-\c victoryCheck() primarily updates the score variable. But it also pops up a dialog saying \e {Game Over} when the game is over.
-In this example we wanted a pure-QML, animated dialog, and since QML doesn't contain one, we wrote our own.
-Below is the code for the \c Dialog element, note how it's designed so as to be usable imperatively from within the script file (via the functions and signals):
+\section3 Updating the score
+
+When the player clicks a block and triggers \c handleClick(), \c handleClick() also calls victoryCheck() to update the score and to check whether the player has completed the game. Here is the \c victoryCheck() code:
+
+\snippet declarative/tutorials/samegame/samegame3/samegame.js 2
+
+This updates the \c gameCanvas.score value and displays a "Game Over" dialog if the game is finished.
+
+The Game Over dialog is created using a \c Dialog element that is defined in \c Dialog.qml. Here is the \c Dialog.qml code. Notice how it is designed to be usable imperatively from the script file, via the functions and signals:
\snippet declarative/tutorials/samegame/samegame3/Dialog.qml 0
-And this is how it's used in the main QML file:
+And this is how it is used in the main \c samegame.qml file:
\snippet declarative/tutorials/samegame/samegame3/samegame.qml 2
-Combined with the line of code in \c victoryCheck, this causes a dialog to appear when the game is over, informing the user of that fact.
-We now have a working game! The blocks can be clicked, the player can score, and the game can end (and then you start a new one).
-Below is a screenshot of what has been accomplished so far:
+\section3 A dash of color
-\image declarative-adv-tutorial3.png
+It's not much fun to play Same Game if all the blocks are the same color, so we've modified the \c createBlock() function in \c samegame.js to randomly create a different type of block (for either red, green or blue) each time it is called. \c Block.qml has also changed so that each block contains a different image depending on its type:
-Here is the QML code as it is now for the main file:
+\snippet declarative/tutorials/samegame/samegame3/Block.qml 0
-\snippet declarative/tutorials/samegame/samegame3/samegame.qml 0
-And the code for the block:
+\section2 A working game
-\snippet declarative/tutorials/samegame/samegame3/Block.qml 0
+Now we now have a working game! The blocks can be clicked, the player can score, and the game can end (and then you can start a new one).
+Here is a screenshot of what has been accomplished so far:
+
+\image declarative-adv-tutorial3.png
+
+Here is the QML code as it is now in \c samegame.qml:
+
+\snippet declarative/tutorials/samegame/samegame3/samegame.qml 0
The game works, but it's a little boring right now. Where are the smooth animated transitions? Where are the high scores?
-If you were a QML expert you could have written these in for the first iteration, but in this tutorial they've been saved
+If you were a QML expert you could have written these in the first iteration, but in this tutorial they've been saved
until the next chapter - where your application becomes alive!
+
*/
/*!
@@ -265,115 +303,146 @@ until the next chapter - where your application becomes alive!
\contentspage QML Advanced Tutorial
\previouspage QML Advanced Tutorial 3 - Implementing the Game Logic
-Now we're going to do two things to liven the game up. Animate the blocks and add a web-based high score system.
+In this chapter:
-If you compare the \c samegame3 directory with \c samegame4, you'll noticed that we've cleaned the directory structure up.
-We now have a lot of files, and so they've been split up into folders - the most notable one being a content folder
-which we've placed all the QML but the main file.
+\tableofcontents
-\section2 Animated Blocks
+The files referenced on this page can be found in \c $QTDIR\examples\tutorials\samegame\samegame4.
-The most vital animations are that the blocks move fluidly around the board. QML has many tools for fluid behavior,
-and in this case we're going to use the \l SpringFollow element. By having the script set \c targetX and \c targetY, instead of \c x
-and \c y directly, we can set the \c x and \c y of the block to a follow. \l SpringFollow is a property value source, which means
-that you can set a property to be one of these elements and it will automatically bind the property to the element's value.
-The SpringFollow's value follows another value over time, when the value it is tracking changes the SpringFollow's
-value will also change, but it will move smoothly there over time with a spring-like movement (based on the spring
-parameters specified). This is shown in the below snippet of code from \c Block.qml:
+\section2 Adding some flair
-\code
- property int targetX: 0
- property int targetY: 0
+Now we're going to do two things to liven up the game: animate the blocks and add a High Score system.
- x: SpringFollow { source: targetX; spring: 2; damping: 0.2 }
- y: SpringFollow { source: targetY; spring: 2; damping: 0.2 }
-\endcode
+We've also cleaned up the directory structure for our application files. We now have a lot of files, so all the
+JavaScript and QML files outside of \c samegame.qml have been moved into a new sub-directory named "content".
+
+In anticipation of the new block animations, \c Block.qml file is now renamed to \c BoomBlock.qml.
+
+\section3 Animating block movement
-We also have to change the \c{samegame.js} code, so that wherever it was setting the \c x or \c y it now sets \c targetX and \c targetY
-(including when creating the block). This simple change is all you need to get spring moving blocks that no longer teleport
-around the board. If you try doing just this though, you'll notice that they now never jump from one point to another, even in
-the initialization! This gives an odd effect of having them all slide out of the corner (0,0) on start up. We'd rather that they
-fall down from the top in rows. To do this, we disable the \c x follow (but not the \c y follow) and only enable it after we've set
-the \c x in the \c createBlock function. The above snippet now becomes:
+First we will animate the blocks so that they move in a fluid manner. QML has a number of methods for adding fluid
+movement, and in this case we're going to use the \l SpringFollow element to add an animation with a spring-like
+movement. In \c BoomBlock.qml, we apply a \l SpringFollow
+to the \c x and \c y properties so that the block will follow and animate its movement towards the
+position specified by the new \c targetX and \c targetY properties (whose values will be set by \c samegame.js).
+Here is the code added to \c BoomBlock.qml:
\snippet declarative/tutorials/samegame/samegame4/content/BoomBlock.qml 1
-The next-most vital animation is a smooth exit. For this animation, we'll use a \l Behavior element. A Behavior is also a property
-value source, and it is much like SpringFollow except that it doesn't model the behavior of a spring. You specify how a Behavior
-transitions using the standard animations. As we want the blocks to smoothly fade in and out we'll set a Behavior on the block
-image's opacity, like so:
+The \c spring and \c damping values can be changed to modify the spring-like effect of the animation.
+
+The \c {enabled: spawned} setting refers to the \c spawned value that is set from \c createBlock() in \c samegame.js.
+This ensures the \l SpringFollow on the \c x is only enabled after \c createBlock() has set the block to
+the correct position. Otherwise, the blocks will slide out of the corner (0,0) when a game begins, instead of falling
+from the top in rows. (Try commenting out \c {enabled: spawned} and see for yourself.)
+
+\section3 Animating block opacity changes
+
+Next, we will add a smooth exit animation. For this, we'll use a \l Behavior element, which allows us to specify
+a default animation when a property change occurs. In this case, when the \c opacity of a Block changes, we will
+animate the opacity value so that it gradually fades in and out, instead of abruptly changing between fully
+visible and invisible. To do this, we'll apply a \l Behavior on the \c opacity property of the \c Image
+element in \c BoomBlock.qml:
\snippet declarative/tutorials/samegame/samegame4/content/BoomBlock.qml 2
-Note that the \c{opacity: 0} makes it start out transparent. We could set the opacity in the script file when we create and destroy the blocks,
-but instead we use states (as this is useful for the next animation we'll implement). The below snippet is set on the root
-element of \c{Block.qml}:
+Note the \c{opacity: 0} which means the block is transparent when it is first created. We could set the opacity
+in \c samegame.js when we create and destroy the blocks,
+but instead we'll use \l{QML States}{states}, since this is useful for the next animation we're going to add.
+Initially, we add these States to the root element of \c{BoomBlock.qml}:
\code
property bool dying: false
states: [
State{ name: "AliveState"; when: spawned == true && dying == false
PropertyChanges { target: img; opacity: 1 }
- }, State{ name: "DeathState"; when: dying == true
+ },
+ State{ name: "DeathState"; when: dying == true
PropertyChanges { target: img; opacity: 0 }
}
]
\endcode
-Now it will automatically fade in, as we set spawned to true already when implementing the block movement animations.
-To fade out, we set 'dying' to true instead of setting opacity to 0 when a block is destroyed (in the \c floodFill function).
+Now blocks will automatically fade in, as we already set \c spawned to true when we implemented the block animations.
+To fade out, we set \c dying to true instead of setting opacity to 0 when a block is destroyed (in the \c floodFill() function).
-The least vital animations are a cool-looking particle effect when they get destroyed. First we create a \l Particles element in
-the block, like so:
+\section3 Adding particle effects
+
+Finally, we'll add a cool-looking particle effect to the blocks when they are destroyed. To do this, we first add a \l Particles element in
+\c BoomBlock.qml, like so:
\snippet declarative/tutorials/samegame/samegame4/content/BoomBlock.qml 3
-To fully understand this you'll want to look at the Particles element documentation, but it's important to note that emissionRate is set
-to zero, so that no particles are emitted normally.
-We next extend the 'dying' state, which creates a burst of particles by calling the burst method on the particles element. The code for the states now look
+To fully understand this you should read the \l Particles documentation, but it's important to note that \c emissionRate is set
+to zero so that particles are not emitted normally.
+Also, we extend the \c dying State, which creates a burst of particles by calling the \c burst() method on the particles element. The code for the states now look
like this:
\snippet declarative/tutorials/samegame/samegame4/content/BoomBlock.qml 4
-And now the game should be beautifully animated and smooth, with a subtle (or not-so-subtle) animation added for all of the
-player's actions. The end result is shown below, with a different set of images to demonstrate basic themeing:
+Now the game is beautifully animated, with subtle (or not-so-subtle) animations added for all of the
+player's actions. The end result is shown below, with a different set of images to demonstrate basic theming:
\image declarative-adv-tutorial4.gif
-The basic theme change there is the result of simply replacing the images. This can be done at run time by setting the source property, so a further advanced feature to try on your own is to add a button which toggles between two different themes.
+The theme change here is produced simply by replacing the block images. This can be done at runtime by changing the \l Image \c source property, so for a further challenge, you could add a button that toggles between themes with different images.
+
+\section2 Keeping a High Scores table
+
+Another feature we might want to add to the game is a method of storing and retrieving high scores.
+
+In \c samegame.qml we now pop up a dialog when the game is over and requests the player's name so it can be added to a High Scores table. The dialog is created using \c Dialog.qml:
+
+\snippet declarative/tutorials/samegame/samegame4/samegame.qml 0
+
+When the dialog is closed, we call the new \c saveHighScore() function in \c samegame.js, which stores the high score locally in an SQL database and also send the score to an online database if possible.
+
-\section2 Offline High Scores
-Another extension we might want for the game is some way of storing and retrieving high scores. This tutorial contains both online and offline high score storage.
+\section3 Storing high scores offline
-For better high score data, we want the name and time of the player. The time is obtained in the script fairly simply, but we
-have to ask the player for their name. We thus re-use the dialog QML file to pop up a dialog asking for the player's name (and
-if they exit this dialog without entering it they have a way to opt out of posting their high score). When the dialog is closed we store the name and high score, using the code below.
+Here is the \c saveHighScore() function in \c samegame.js:
\snippet declarative/tutorials/samegame/samegame4/content/samegame.js 2
-For offline storage, we use the HTML 5 offline storage JavaScript API to maintain a persistant SQL database unique to this application. This first line in this function calls the function for the web-based high scores, described later, if it has been setup. Next we create an offline storage database for the high scores using openDatabase and prepare the data and SQL query that we want to use to save it. The offline storage API uses SQL queries for data manipulation and retrival, and in the db.transaction call we use three SQL queries to initialize the database (if necessary), and then add to and retrieve high scores. To use the returned data, we turn it into a string with one line per row returned, and show a dialog containing that string. For a more detailed explanation of the offline storage API in QML, consult the global object documentation.
+First we call \c sendHighScore() (explained in the section below) if it is possible to send the high scores to an online database.
-This is one way of storing and displaying high scores locally, but not the only way. A more complex alternative would have been to create a high score dialog component, and pass the results to it for processing and display (instead of resusing the Dialog). This would allow a more themable dialog that could present the high scores better. If your QML is the UI for a C++ application, you could also have passed the score to a C++ function to store it locally in a variety of ways, including a simple format without SQL or in another SQL database.
+Then, we use the \l{Offline Storage API} to maintain a persistant SQL database unique to this application. We create an offline storage database for the high scores using \c openDatabase() and prepare the data and SQL query that we want to use to save it. The offline storage API uses SQL queries for data manipulation and retrival, and in the \c db.transaction() call we use three SQL queries to initialize the database (if necessary), and then add to and retrieve high scores. To use the returned data, we turn it into a string with one line per row returned, and show a dialog containing that string.
-\section2 Web-based High Scores
+This is one way of storing and displaying high scores locally, but certainly not the only way. A more complex alternative would be to create a high score dialog component, and pass it the results for processing and display (instead of reusing the \c Dialog). This would allow a more themeable dialog that could beter present the high scores. If your QML is the UI for a C++ application, you could also have passed the score to a C++ function to store it locally in a variety of ways, including a simple format without SQL or in another SQL database.
-You've seen how to store high scores locally, but it is also easy to integrate a web enabled high score storage into your QML application. This tutorial also shows you how to communicate the high scores to a web server. The implementation we've done is very
-simple - the high score data is posted to a php script running on a server somewhere, and that server then stores it and
-displays it to visitors. You could request an XML or QML file from that same server, which contained and displayed the scores,
-but that's beyond the scope of this tutorial. The php script we've used is available in the examples directory.
+\section3 Storing high scores online
-if the player entered their name we can send the data to the web service in the following snippet out of the script file:
+You've seen how you can store high scores locally, but it is also easy to integrate a web-enabled high score storage into your QML application. The implementation we've done her is very
+simple: the high score data is posted to a php script running on a server somewhere, and that server then stores it and
+displays it to visitors. You could also request an XML or QML file from that same server, which contains and displays the scores,
+but that's beyond the scope of this tutorial. The php script we use here is available in the \c examples directory.
+
+If the player entered their name we can send the data to the web service us
+
+If the player enters a name, we send the data to the service using this code in \c samegame.js:
\snippet declarative/tutorials/samegame/samegame4/content/samegame.js 1
-This is the same \c XMLHttpRequest() as you'll find in browser JavaScript, and can be used in the same way to dynamically get XML
-or QML from the web service to display the high scores. We don't worry about the response in this case, we just post the high
+The \c XMLHttpRequest in this code is the same \c XMLHttpRequest() as you'll find in standard browser JavaScript, and can be used in the same way to dynamically get XML
+or QML from the web service to display the high scores. We don't worry about the response in this case - we just post the high
score data to the web server. If it had returned a QML file (or a URL to a QML file) you could instantiate it in much the same
-way as you did the blocks.
+way as you did with the blocks.
-An alternate way to access and submit web-based data would be to use QML elements designed for this purpose - XmlListModel
+An alternate way to access and submit web-based data would be to use QML elements designed for this purpose. XmlListModel
makes it very easy to fetch and display XML based data such as RSS in a QML application (see the Flickr demo for an example).
-By following this tutorial you've now ben shown how to write a fully functional application in QML, with the application logic
-written in a script file and with both many fluid animations and being web-enabled. Congratulations, you should now be skilled
-enough to write entire applications in QML.
+
+\section2 That's it!
+
+By following this tutorial you've seen how you can write a fully functional application in QML:
+
+\list
+\o Build your application with \l {{QML Elements}}{QML elements}
+\o Add application logic \l{Integrating JavaScript}{with JavaScript code}
+\o Add animations with \l {Behavior}{Behaviors} and \l{QML States}{states}
+\o Store persistent application data through online and offline methods
+\endlist
+
+There is so much more to learn about QML that we haven't been able to cover in this tutorial. Check out all the
+demos and examples and the \l {Declarative UI (QML)}{documentation} to find out all the things you can do with QML!
+
*/
diff --git a/doc/src/declarative/elements.qdoc b/doc/src/declarative/elements.qdoc
index fcfc7d6db6..5eaaf7ebd3 100644
--- a/doc/src/declarative/elements.qdoc
+++ b/doc/src/declarative/elements.qdoc
@@ -111,8 +111,8 @@ The following table lists the QML elements provided by the Qt Declarative module
\header
\o \bold {Basic Visual Items}
\o \bold {Basic Interaction Items}
-\o \bold {Widgets}
\o \bold {Utility}
+\o \bold {Transforms}
\row
\o
@@ -130,13 +130,8 @@ The following table lists the QML elements provided by the Qt Declarative module
\list
\o \l MouseArea
\o \l FocusScope
-\endlist
-
-\o
-\list
\o \l Flickable
\o \l Flipable
-\o \l WebView
\endlist
\o
@@ -148,10 +143,17 @@ The following table lists the QML elements provided by the Qt Declarative module
\o \l LayoutItem
\endlist
+\o
+\list
+\o \l Scale
+\o \l Rotation
+\o \l Translate
+\endlist
+
\header
\o \bold {Views}
\o \bold {Positioners}
-\o \bold {Transforms}
+\o \bold {Media}
\o \bold {Effects}
\row
@@ -172,6 +174,7 @@ The following table lists the QML elements provided by the Qt Declarative module
\o \l PathPercent
\endlist
\endlist
+\o \l WebView
\endlist
\o
@@ -184,16 +187,13 @@ The following table lists the QML elements provided by the Qt Declarative module
\o
\list
-\o \l Scale
-\o \l Rotation
+\o \l SoundEffect
+\o \l Audio
+\o \l Video
\endlist
\o
\list
-\o \l Blur
-\o \l Colorize
-\o \l DropShadow
-\o \l Opacity
\o \l Particles
\list
\o \l ParticleMotionLinear
diff --git a/doc/src/declarative/modules.qdoc b/doc/src/declarative/modules.qdoc
index 13658d8372..d476d6f9cd 100644
--- a/doc/src/declarative/modules.qdoc
+++ b/doc/src/declarative/modules.qdoc
@@ -83,7 +83,7 @@ For either type of module, a \c qmldir file in the module directory defines the
optional for location modules, but only for local filesystem content or a single remote content with a namespace.
The second exception is explained in more detail in the section below on Namespaces.
-\seciont2 The Import Path
+\section2 The Import Path
Installed modules are searched for on the import path.
The \c -L option to the \l {Qt Declarative UI Runtime}{qml} runtime adds paths to the import path.
@@ -169,8 +169,10 @@ import Ovi 1.0 as Nokia
While import statements are needed to make any types available in QML, the directory of the
current file is implicitly loaded. This is the exact same as if you had added 'import "."' to
-every QML file. The effect of this is that you can automatically use types defined in C++ plugins
-or QML files if they reside in the same directory.
+the start of every QML file. The effect of this is that you can automatically use types defined in C++ plugins
+or QML files if they reside in the same directory. This is the last location searched for types - so if you
+happen to have a "Text.qml" file, or "text.qml" on case-insensitive file systems, it will not override
+the one from Qt if you import Qt.
*/
diff --git a/doc/src/declarative/pics/qmldebugger-creator.png b/doc/src/declarative/pics/qmldebugger-creator.png
deleted file mode 100644
index da1e22d7c3..0000000000
--- a/doc/src/declarative/pics/qmldebugger-creator.png
+++ /dev/null
Binary files differ
diff --git a/doc/src/declarative/qdeclarativedebugging.qdoc b/doc/src/declarative/qdeclarativedebugging.qdoc
index e409c3ecad..4ff7fdebdb 100644
--- a/doc/src/declarative/qdeclarativedebugging.qdoc
+++ b/doc/src/declarative/qdeclarativedebugging.qdoc
@@ -63,58 +63,23 @@ When a transition doesn't look quite right, it can be helpful to view it in slow
motion to see what is happening more clearly. The \l {Qt Declarative UI Runtime}{qml} tool provides a
"Slow Down Animations" menu option to facilitate this.
+\section1 Debugging with Qt Creator
-\section1 The QML Inspector
+\l{http://qt.nokia.com/products/developer-tools}{Qt Creator} provides built-in
+support for QML debugging. Open a QML project in Creator and enter Debug mode,
+or click the "Start Debugging" option from the menu, and Creator will
+show QML debugging information and options for your application, including
+object inspection, property monitoring and application frame-rate analysis.
-The \c qmldebugger tool provides an experimental inspector to aid with debugging.
-It can be run as a Qt Creator plugin or as a standalone application.
-
-\section2 Qt Creator plugin
-
-The Qt Creator plugin currently builds against Qt Creator 1.3.
-
-To build the Qt Creator plugin:
-
-\list
-\o Set an environment variable \c CREATOR_SRC_DIR that points to the Qt Creator
- source directory
-\o Set an environment variable \c CREATOR_BUILD_DIR that points to the Qt Creator
- build directory
-\o Run \c qmake on \c $QTDIR/tools/qmldebugger/qmldebugger.pro
-\endlist
-
-This builds the plugin into your Qt Creator installation.
-
-The plugin adds a "QML Inspect" mode into Qt Creator that provides:
-
-\list
-\o An object tree showing all objects and their children
-\o The current property values for the object selected in the object tree
- (this table is dynamically updated for all properties that have property changed
- notifications)
-\o An expression evaluator for querying and setting values dynamically
-\o A table of watched properties (double-click on a property in the property
- table to add it to the watch table)
-\o A graph that shows the frame rate of your application
-\endlist
-
-
-To start the debugger, open a QML project and click the "QML Inspect" mode, then click the green
-"play" button in the toolbar of the bottom-right debugger window.
-
-\image qmldebugger-creator.png
-
-
-\section2 Standalone qmldebugger tool
-
-To run the standalone \c qmldebugger tool, set an environment variable \c QML_DEBUG_SERVER_PORT
-to an available port number and run the \l {Qt Declarative UI Runtime}{qml} tool. For example:
+Creator can be used to debug both local and remote QML applications. To
+enable remote debugging, start the \l {Qt Declarative UI Runtime}{qml} tool
+on the remote device with a debugging port defined, like this:
\code
QML_DEBUG_SERVER_PORT=3768 qml myqmlfile.qml
\endcode
-Then in another process, start the \c qmldebugger tool, enter the port number into the corresponding spinbox
-in the top right hand corner, and press the "Connect" button.
+In Creator, open the project settings pane and set the server and port
+details for the remote device, then start debugging.
*/
diff --git a/doc/src/declarative/tutorial.qdoc b/doc/src/declarative/tutorial.qdoc
index 66de741792..1a93d05b45 100644
--- a/doc/src/declarative/tutorial.qdoc
+++ b/doc/src/declarative/tutorial.qdoc
@@ -155,13 +155,13 @@ An \l Item is the most basic visual element in QML and is often used as a contai
\snippet examples/declarative/tutorials/helloworld/Cell.qml 4
-We declare a \c color property. This property is accessible from \e outside our component, this allows us
+We declare a \c cellColor property. This property is accessible from \e outside our component, this allows us
to instantiate the cells with different colors.
This property is just an alias to an existing property - the color of the rectangle that compose the cell (see \l{intro-properties}{Properties}).
\snippet examples/declarative/tutorials/helloworld/Cell.qml 5
-We want our component to also have a signal that we call \e clicked with a \e color parameter.
+We want our component to also have a signal that we call \e clicked with a \e cellColor parameter of type \e color.
We will use this signal to change the color of the text in the main QML file later.
\snippet examples/declarative/tutorials/helloworld/Cell.qml 2
@@ -189,7 +189,7 @@ We create the color picker by putting 6 cells with different colors in a grid.
\snippet examples/declarative/tutorials/helloworld/tutorial2.qml 1
-When the \e clicked signal of our cell is triggered, we want to set the color of the text to the color passed as a parameter.
+When the \e clicked signal of our cell is triggered, we want to set the color of the text to the \e cellColor passed as a parameter.
We can react to any signal of our component through a property of the name \e 'onSignalName' (see \l{Signal Handlers}).
*/
diff --git a/doc/src/legal/3rdparty.qdoc b/doc/src/legal/3rdparty.qdoc
index d608038bde..8d0cd2aae5 100644
--- a/doc/src/legal/3rdparty.qdoc
+++ b/doc/src/legal/3rdparty.qdoc
@@ -454,4 +454,43 @@
OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE.
See \c src/3rdparty/webkit/JavaScriptCore/wtf/dtoa.cpp for license details.
+
+ \section1 Pixman (\c pixman) version 0.17.11
+
+ \e{pixman is a library that provides low-level pixel manipulation
+ features such as image compositing and trapezoid rasterization.} -- quoted
+ from \c src/3rdparty/pixman/README
+
+ We are only using the pixman-arm-neon-asm.h and pixman-arm-neon-asm.S
+ source files which have the following copyright and license header:
+
+ \hr
+
+ Copyright © 2009 Nokia Corporation
+
+ Permission is hereby granted, free of charge, to any person obtaining a
+ copy of this software and associated documentation files (the "Software"),
+ to deal in the Software without restriction, including without limitation
+ the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ and/or sell copies of the Software, and to permit persons to whom the
+ Software is furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice (including the next
+ paragraph) shall be included in all copies or substantial portions of the
+ Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ DEALINGS IN THE SOFTWARE.
+
+ Author: Siarhei Siamashka (siarhei.siamashka@nokia.com)
+
+ \hr
+
+ See \c src/3rdparty/pixman/pixman-arm-neon-asm.h and
+ \c src/3rdparty/pixman/pixman-arm-neon-asm.S
*/
diff --git a/doc/src/modules.qdoc b/doc/src/modules.qdoc
index b13861f2ed..8731d57524 100644
--- a/doc/src/modules.qdoc
+++ b/doc/src/modules.qdoc
@@ -493,12 +493,13 @@
\snippet doc/src/snippets/code/doc_src_qtxmlpatterns.qdoc 1
- \section1 Further Links
+ \section1 Further Reading
General overviews of XQuery and XSchema can be found in the
\l{Using XML Technologies} document.
- An introduction to the XQuery language can be found in \l{A Short Path to XQuery}.
+ An introduction to the XQuery language can be found in
+ \l{A Short Path to XQuery}.
\section1 License Information
diff --git a/examples/declarative/declarative.pro b/examples/declarative/declarative.pro
index 5fc1cf0ff3..00d3c0540c 100644
--- a/examples/declarative/declarative.pro
+++ b/examples/declarative/declarative.pro
@@ -6,7 +6,7 @@ SUBDIRS = \
imageprovider \
objectlistmodel \
plugins \
- widgets
+ proxywidgets
# These examples contain no C++ and can simply be copied
sources.files = \
diff --git a/examples/declarative/imageprovider/imageprovider.pro b/examples/declarative/imageprovider/imageprovider.pro
index 86dbcca480..945a3014a5 100644
--- a/examples/declarative/imageprovider/imageprovider.pro
+++ b/examples/declarative/imageprovider/imageprovider.pro
@@ -18,4 +18,8 @@ ImageProviderCore_sources.files = \
ImageProviderCore/qmldir
ImageProviderCore_sources.path = $$[QT_INSTALL_EXAMPLES]/declarative/imageprovider/ImageProviderCore
+symbian:{
+ TARGET.EPOCALLOWDLLDATA=1
+}
+
INSTALLS = sources ImageProviderCore_sources target
diff --git a/examples/declarative/plugins/plugin.cpp b/examples/declarative/plugins/plugin.cpp
index 741f68ad33..fb51b0ca6b 100644
--- a/examples/declarative/plugins/plugin.cpp
+++ b/examples/declarative/plugins/plugin.cpp
@@ -46,7 +46,7 @@
#include <qbasictimer.h>
#include <qapplication.h>
-// Implements a "Time" class with hour and minute properties
+// Implements a "TimeModel" class with hour and minute properties
// that change on-the-minute yet efficiently sleep the rest
// of the time.
@@ -97,14 +97,14 @@ private:
QBasicTimer timer;
};
-class Time : public QObject
+class TimeModel : public QObject
{
Q_OBJECT
Q_PROPERTY(int hour READ hour NOTIFY timeChanged)
Q_PROPERTY(int minute READ minute NOTIFY timeChanged)
public:
- Time(QObject *parent=0) : QObject(parent)
+ TimeModel(QObject *parent=0) : QObject(parent)
{
if (++instances == 1) {
if (!timer)
@@ -114,7 +114,7 @@ public:
}
}
- ~Time()
+ ~TimeModel()
{
if (--instances == 0) {
timer->stop();
@@ -133,12 +133,8 @@ private:
static int instances;
};
-int Time::instances=0;
-MinuteTimer *Time::timer=0;
-
-
-QML_DECLARE_TYPE(Time);
-
+int TimeModel::instances=0;
+MinuteTimer *TimeModel::timer=0;
class QExampleQmlPlugin : public QDeclarativeExtensionPlugin
{
@@ -147,7 +143,7 @@ public:
void registerTypes(const char *uri)
{
Q_ASSERT(uri == QLatin1String("com.nokia.TimeExample"));
- qmlRegisterType<Time>(uri, 1, 0, "Time");
+ qmlRegisterType<TimeModel>(uri, 1, 0, "Time");
}
};
diff --git a/examples/declarative/plugins/plugins.pro b/examples/declarative/plugins/plugins.pro
index 877a5ceea6..c409d39c47 100644
--- a/examples/declarative/plugins/plugins.pro
+++ b/examples/declarative/plugins/plugins.pro
@@ -8,7 +8,7 @@ VERSION = 1.0.0
SOURCES += plugin.cpp
qdeclarativesources.files += \
- com/nokia/TimeExample/qdeclarativedir \
+ com/nokia/TimeExample/qmldir \
com/nokia/TimeExample/center.png \
com/nokia/TimeExample/clock.png \
com/nokia/TimeExample/Clock.qml \
@@ -22,6 +22,11 @@ sources.path += $$[QT_INSTALL_EXAMPLES]/declarative/plugins
target.path += $$[QT_INSTALL_EXAMPLES]/declarative/plugins/com/nokia/TimeExample
+symbian:{
+ TARGET.EPOCALLOWDLLDATA=1
+}
+
+
INSTALLS += qdeclarativesources sources target
symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
diff --git a/examples/declarative/proxywidgets/ProxyWidgets/qmldir b/examples/declarative/proxywidgets/ProxyWidgets/qmldir
new file mode 100644
index 0000000000..e55267c429
--- /dev/null
+++ b/examples/declarative/proxywidgets/ProxyWidgets/qmldir
@@ -0,0 +1 @@
+plugin proxywidgetsplugin
diff --git a/examples/declarative/widgets/README b/examples/declarative/proxywidgets/README
index f85a1e8e0c..f50fa22e4d 100644
--- a/examples/declarative/widgets/README
+++ b/examples/declarative/proxywidgets/README
@@ -1,4 +1,4 @@
To run:
make install
- qml mywidgets.qml
+ qml proxywidgets.qml
diff --git a/examples/declarative/widgets/mywidgets.cpp b/examples/declarative/proxywidgets/proxywidgets.cpp
index e17240d85e..47d0cb9e3c 100644
--- a/examples/declarative/widgets/mywidgets.cpp
+++ b/examples/declarative/proxywidgets/proxywidgets.cpp
@@ -82,7 +82,7 @@ private:
QPushButton *widget;
};
-class MyWidgetsPlugin : public QDeclarativeExtensionPlugin
+class ProxyWidgetsPlugin : public QDeclarativeExtensionPlugin
{
Q_OBJECT
public:
@@ -92,8 +92,8 @@ public:
}
};
-#include "mywidgets.moc"
+#include "proxywidgets.moc"
QML_DECLARE_TYPE(MyPushButton)
-Q_EXPORT_PLUGIN2(mywidgetsplugin, MyWidgetsPlugin);
+Q_EXPORT_PLUGIN2(proxywidgetsplugin, ProxyWidgetsPlugin);
diff --git a/examples/declarative/widgets/widgets.pro b/examples/declarative/proxywidgets/proxywidgets.pro
index 258edb150e..eb85191c17 100644
--- a/examples/declarative/widgets/widgets.pro
+++ b/examples/declarative/proxywidgets/proxywidgets.pro
@@ -1,13 +1,13 @@
TEMPLATE = lib
-DESTDIR = MyWidgets
-TARGET = mywidgetsplugin
+DESTDIR = ProxyWidgets
+TARGET = proxywidgetsplugin
CONFIG += qt plugin
QT += declarative
VERSION = 1.0.0
-SOURCES += mywidgets.cpp
+SOURCES += proxywidgets.cpp
-sources.files += mywidgets.pro mywidgets.cpp mywidgets.qml
+sources.files += proxywidgets.pro proxywidgets.cpp proxywidgets.qml
sources.path += $$[QT_INSTALL_EXAMPLES]/declarative/plugins
@@ -17,3 +17,6 @@ INSTALLS += sources target
symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+symbian:{
+ TARGET.EPOCALLOWDLLDATA = 1
+} \ No newline at end of file
diff --git a/examples/declarative/widgets/mywidgets.qml b/examples/declarative/proxywidgets/proxywidgets.qml
index b1efed46e4..023de710eb 100644
--- a/examples/declarative/widgets/mywidgets.qml
+++ b/examples/declarative/proxywidgets/proxywidgets.qml
@@ -1,5 +1,5 @@
import Qt 4.6
-import "MyWidgets" 1.0
+import "ProxyWidgets" 1.0
Rectangle {
id: window
diff --git a/examples/declarative/tutorials/helloworld/Cell.qml b/examples/declarative/tutorials/helloworld/Cell.qml
index de4f3bb5af..9249ffeb09 100644
--- a/examples/declarative/tutorials/helloworld/Cell.qml
+++ b/examples/declarative/tutorials/helloworld/Cell.qml
@@ -5,10 +5,10 @@ import Qt 4.6
Item {
id: container
//![4]
- property alias color: rectangle.color
+ property alias cellColor: rectangle.color
//![4]
//![5]
- signal clicked(color color)
+ signal clicked(color cellColor)
//![5]
width: 40; height: 25
@@ -25,7 +25,7 @@ Item {
//![3]
MouseArea {
anchors.fill: parent
- onClicked: container.clicked(container.color)
+ onClicked: container.clicked(container.cellColor)
}
//![3]
}
diff --git a/examples/declarative/tutorials/helloworld/tutorial2.qml b/examples/declarative/tutorials/helloworld/tutorial2.qml
index 99889d73f4..38447e212c 100644
--- a/examples/declarative/tutorials/helloworld/tutorial2.qml
+++ b/examples/declarative/tutorials/helloworld/tutorial2.qml
@@ -15,17 +15,17 @@ Rectangle {
Grid {
id: colorPicker
- anchors.bottom: page.bottom
+ x: 4; anchors.bottom: page.bottom; anchors.bottomMargin: 4
rows: 2; columns: 3; spacing: 3
//![1]
- Cell { color: "red"; onClicked: helloText.color = color }
+ Cell { cellColor: "red"; onClicked: helloText.color = cellColor }
//![1]
- Cell { color: "green"; onClicked: helloText.color = color }
- Cell { color: "blue"; onClicked: helloText.color = color }
- Cell { color: "yellow"; onClicked: helloText.color = color }
- Cell { color: "steelblue"; onClicked: helloText.color = color }
- Cell { color: "black"; onClicked: helloText.color = color }
+ Cell { cellColor: "green"; onClicked: helloText.color = cellColor }
+ Cell { cellColor: "blue"; onClicked: helloText.color = cellColor }
+ Cell { cellColor: "yellow"; onClicked: helloText.color = cellColor }
+ Cell { cellColor: "steelblue"; onClicked: helloText.color = cellColor }
+ Cell { cellColor: "black"; onClicked: helloText.color = cellColor }
}
}
//![0]
diff --git a/examples/declarative/tutorials/helloworld/tutorial3.qml b/examples/declarative/tutorials/helloworld/tutorial3.qml
index b8a4f7709e..d851c497f4 100644
--- a/examples/declarative/tutorials/helloworld/tutorial3.qml
+++ b/examples/declarative/tutorials/helloworld/tutorial3.qml
@@ -11,15 +11,14 @@ Rectangle {
text: "Hello world!"
font.pointSize: 24; font.bold: true
y: 30; anchors.horizontalCenter: page.horizontalCenter
- transformOrigin: Item.Center
//![1]
- MouseArea { id: mouseRegion; anchors.fill: parent }
+ MouseArea { id: mouseArea; anchors.fill: parent }
//![1]
//![2]
states: State {
- name: "down"; when: mouseRegion.pressed == true
+ name: "down"; when: mouseArea.pressed == true
PropertyChanges { target: helloText; y: 160; rotation: 180; color: "red" }
}
//![2]
@@ -37,15 +36,15 @@ Rectangle {
Grid {
id: colorPicker
- anchors.bottom: page.bottom
+ x: 4; anchors.bottom: page.bottom; anchors.bottomMargin: 4
rows: 2; columns: 3; spacing: 3
- Cell { color: "red"; onClicked: helloText.color = color }
- Cell { color: "green"; onClicked: helloText.color = color }
- Cell { color: "blue"; onClicked: helloText.color = color }
- Cell { color: "yellow"; onClicked: helloText.color = color }
- Cell { color: "steelblue"; onClicked: helloText.color = color }
- Cell { color: "black"; onClicked: helloText.color = color }
+ Cell { cellColor: "red"; onClicked: helloText.color = cellColor }
+ Cell { cellColor: "green"; onClicked: helloText.color = cellColor }
+ Cell { cellColor: "blue"; onClicked: helloText.color = cellColor }
+ Cell { cellColor: "yellow"; onClicked: helloText.color = cellColor }
+ Cell { cellColor: "steelblue"; onClicked: helloText.color = cellColor }
+ Cell { cellColor: "black"; onClicked: helloText.color = cellColor }
}
}
//![0]
diff --git a/examples/declarative/tutorials/samegame/samegame1/Button.qml b/examples/declarative/tutorials/samegame/samegame1/Button.qml
index 2e31ff887c..5e28da7786 100644
--- a/examples/declarative/tutorials/samegame/samegame1/Button.qml
+++ b/examples/declarative/tutorials/samegame/samegame1/Button.qml
@@ -14,11 +14,11 @@ Rectangle {
gradient: Gradient {
GradientStop {
id: topGrad; position: 0.0
- color: if (mr.pressed) { activePalette.dark } else { activePalette.light } }
+ color: if (mouseArea.pressed) { activePalette.dark } else { activePalette.light } }
GradientStop { position: 1.0; color: activePalette.button }
}
- MouseArea { id: mr; anchors.fill: parent; onClicked: container.clicked() }
+ MouseArea { id: mouseArea; anchors.fill: parent; onClicked: container.clicked() }
Text {
id: txtItem; text: container.text; anchors.centerIn: container; color: activePalette.buttonText
diff --git a/examples/declarative/tutorials/samegame/samegame1/samegame.qml b/examples/declarative/tutorials/samegame/samegame1/samegame.qml
index 5ed30c9008..006b92616a 100644
--- a/examples/declarative/tutorials/samegame/samegame1/samegame.qml
+++ b/examples/declarative/tutorials/samegame/samegame1/samegame.qml
@@ -24,7 +24,7 @@ Rectangle {
anchors.bottom: screen.bottom
Button {
- id: btnA; text: "New Game"; onClicked: console.log("Implement me!");
+ id: btnA; text: "New Game"; onClicked: console.log("Starting a new game...");
anchors.left: parent.left; anchors.leftMargin: 3
anchors.verticalCenter: parent.verticalCenter
}
diff --git a/examples/declarative/tutorials/samegame/samegame2/Button.qml b/examples/declarative/tutorials/samegame/samegame2/Button.qml
index 6629302051..a7853d48db 100644
--- a/examples/declarative/tutorials/samegame/samegame2/Button.qml
+++ b/examples/declarative/tutorials/samegame/samegame2/Button.qml
@@ -13,11 +13,11 @@ Rectangle {
gradient: Gradient {
GradientStop {
id: topGrad; position: 0.0
- color: if (mr.pressed) { activePalette.dark } else { activePalette.light } }
+ color: if (mouseArea.pressed) { activePalette.dark } else { activePalette.light } }
GradientStop { position: 1.0; color: activePalette.button }
}
- MouseArea { id: mr; anchors.fill: parent; onClicked: container.clicked() }
+ MouseArea { id: mouseArea; anchors.fill: parent; onClicked: container.clicked() }
Text {
id: txtItem; text: container.text; anchors.centerIn: container; color: activePalette.buttonText
diff --git a/examples/declarative/tutorials/samegame/samegame2/samegame.js b/examples/declarative/tutorials/samegame/samegame2/samegame.js
index 2c02c61cd4..0ec3a8be4a 100644
--- a/examples/declarative/tutorials/samegame/samegame2/samegame.js
+++ b/examples/declarative/tutorials/samegame/samegame2/samegame.js
@@ -15,6 +15,12 @@ function index(xIdx,yIdx) {
function initBoard()
{
+ //Delete old blocks
+ for(var i = 0; i<maxIndex; i++){
+ if(board[i] != null)
+ board[i].destroy();
+ }
+
//Calculate board size
maxX = Math.floor(background.width/tileSize);
maxY = Math.floor(background.height/tileSize);
diff --git a/examples/declarative/tutorials/samegame/samegame2/samegame.qml b/examples/declarative/tutorials/samegame/samegame2/samegame.qml
index 7e0bc0c3e4..89d80357bd 100644
--- a/examples/declarative/tutorials/samegame/samegame2/samegame.qml
+++ b/examples/declarative/tutorials/samegame/samegame2/samegame.qml
@@ -1,13 +1,13 @@
import Qt 4.6
+//![2]
+import "samegame.js" as SameGame
+//![2]
Rectangle {
id: screen
width: 490; height: 720
SystemPalette { id: activePalette }
-//![2]
- Script { source: "samegame.js" }
-//![2]
Item {
width: parent.width; anchors.top: parent.top; anchors.bottom: toolbar.top
@@ -27,7 +27,7 @@ Rectangle {
//![1]
Button {
- id: btnA; text: "New Game"; onClicked: initBoard();
+ id: btnA; text: "New Game"; onClicked: SameGame.initBoard();
anchors.left: parent.left; anchors.leftMargin: 3
anchors.verticalCenter: parent.verticalCenter
}
diff --git a/examples/declarative/tutorials/samegame/samegame3/Button.qml b/examples/declarative/tutorials/samegame/samegame3/Button.qml
index 6629302051..a7853d48db 100644
--- a/examples/declarative/tutorials/samegame/samegame3/Button.qml
+++ b/examples/declarative/tutorials/samegame/samegame3/Button.qml
@@ -13,11 +13,11 @@ Rectangle {
gradient: Gradient {
GradientStop {
id: topGrad; position: 0.0
- color: if (mr.pressed) { activePalette.dark } else { activePalette.light } }
+ color: if (mouseArea.pressed) { activePalette.dark } else { activePalette.light } }
GradientStop { position: 1.0; color: activePalette.button }
}
- MouseArea { id: mr; anchors.fill: parent; onClicked: container.clicked() }
+ MouseArea { id: mouseArea; anchors.fill: parent; onClicked: container.clicked() }
Text {
id: txtItem; text: container.text; anchors.centerIn: container; color: activePalette.buttonText
diff --git a/examples/declarative/tutorials/samegame/samegame3/Dialog.qml b/examples/declarative/tutorials/samegame/samegame3/Dialog.qml
index 36178ec05f..966f85a85d 100644
--- a/examples/declarative/tutorials/samegame/samegame3/Dialog.qml
+++ b/examples/declarative/tutorials/samegame/samegame3/Dialog.qml
@@ -18,6 +18,6 @@ Rectangle {
NumberAnimation { duration: 1000 }
}
Text { id: myText; anchors.centerIn: parent; text: "Hello World!" }
- MouseArea { id: mr; anchors.fill: parent; onClicked: forceClose(); }
+ MouseArea { id: mouseArea; anchors.fill: parent; onClicked: forceClose(); }
}
//![0]
diff --git a/examples/declarative/tutorials/samegame/samegame3/samegame.js b/examples/declarative/tutorials/samegame/samegame3/samegame.js
index 38efb3b54c..33449fa868 100644
--- a/examples/declarative/tutorials/samegame/samegame3/samegame.js
+++ b/examples/declarative/tutorials/samegame/samegame3/samegame.js
@@ -14,12 +14,6 @@ function index(xIdx,yIdx) {
function initBoard()
{
- for(var i = 0; i<maxIndex; i++){
- //Delete old blocks
- if(board[i] != null)
- board[i].destroy();
- }
-
//Calculate board size
maxX = Math.floor(gameCanvas.width/gameCanvas.tileSize);
maxY = Math.floor(gameCanvas.height/gameCanvas.tileSize);
diff --git a/examples/declarative/tutorials/samegame/samegame3/samegame.qml b/examples/declarative/tutorials/samegame/samegame3/samegame.qml
index 168bf9b300..db25e24000 100644
--- a/examples/declarative/tutorials/samegame/samegame3/samegame.qml
+++ b/examples/declarative/tutorials/samegame/samegame3/samegame.qml
@@ -1,12 +1,12 @@
//![0]
import Qt 4.6
+import "samegame.js" as SameGame
Rectangle {
id: screen
width: 490; height: 720
SystemPalette { id: activePalette }
- Script { source: "samegame.js" }
Item {
width: parent.width; anchors.top: parent.top; anchors.bottom: toolbar.top
@@ -28,8 +28,7 @@ Rectangle {
height: parent.height - (parent.height % tileSize);
MouseArea {
- id: gameMR
- anchors.fill: parent; onClicked: handleClick(mouse.x,mouse.y);
+ anchors.fill: parent; onClicked: SameGame.handleClick(mouse.x,mouse.y);
}
}
//![1]
@@ -46,7 +45,7 @@ Rectangle {
anchors.bottom: screen.bottom
Button {
- id: btnA; text: "New Game"; onClicked: initBoard();
+ id: btnA; text: "New Game"; onClicked: SameGame.initBoard();
anchors.left: parent.left; anchors.leftMargin: 3
anchors.verticalCenter: parent.verticalCenter
}
diff --git a/examples/declarative/tutorials/samegame/samegame4/content/BoomBlock.qml b/examples/declarative/tutorials/samegame/samegame4/content/BoomBlock.qml
index a6ef62c05f..e50aae0679 100644
--- a/examples/declarative/tutorials/samegame/samegame4/content/BoomBlock.qml
+++ b/examples/declarative/tutorials/samegame/samegame4/content/BoomBlock.qml
@@ -9,7 +9,7 @@ Item { id:block
property int targetX: 0
property int targetY: 0
- SpringFollow on x { enabled: spawned; source: targetX; spring: 2; damping: 0.2 }
+ SpringFollow on x { source: targetX; spring: 2; damping: 0.2; enabled: spawned }
SpringFollow on y { source: targetY; spring: 2; damping: 0.2 }
//![1]
diff --git a/examples/declarative/tutorials/samegame/samegame4/content/Button.qml b/examples/declarative/tutorials/samegame/samegame4/content/Button.qml
index 6629302051..a7853d48db 100644
--- a/examples/declarative/tutorials/samegame/samegame4/content/Button.qml
+++ b/examples/declarative/tutorials/samegame/samegame4/content/Button.qml
@@ -13,11 +13,11 @@ Rectangle {
gradient: Gradient {
GradientStop {
id: topGrad; position: 0.0
- color: if (mr.pressed) { activePalette.dark } else { activePalette.light } }
+ color: if (mouseArea.pressed) { activePalette.dark } else { activePalette.light } }
GradientStop { position: 1.0; color: activePalette.button }
}
- MouseArea { id: mr; anchors.fill: parent; onClicked: container.clicked() }
+ MouseArea { id: mouseArea; anchors.fill: parent; onClicked: container.clicked() }
Text {
id: txtItem; text: container.text; anchors.centerIn: container; color: activePalette.buttonText
diff --git a/examples/declarative/tutorials/samegame/samegame4/content/Dialog.qml b/examples/declarative/tutorials/samegame/samegame4/content/Dialog.qml
index 831c03bdf3..fc83e396f0 100644
--- a/examples/declarative/tutorials/samegame/samegame4/content/Dialog.qml
+++ b/examples/declarative/tutorials/samegame/samegame4/content/Dialog.qml
@@ -17,5 +17,5 @@ Rectangle {
NumberAnimation { duration: 1000 }
}
Text { id: myText; anchors.centerIn: parent; text: "Hello World!" }
- MouseArea { id: mr; anchors.fill: parent; onClicked: forceClose(); }
+ MouseArea { id: mouseArea; anchors.fill: parent; onClicked: forceClose(); }
}
diff --git a/examples/declarative/tutorials/samegame/samegame4/samegame.qml b/examples/declarative/tutorials/samegame/samegame4/samegame.qml
index c2e8018ca6..090496d097 100644
--- a/examples/declarative/tutorials/samegame/samegame4/samegame.qml
+++ b/examples/declarative/tutorials/samegame/samegame4/samegame.qml
@@ -1,5 +1,6 @@
import Qt 4.6
import "content"
+import "content/samegame.js" as SameGame
Rectangle {
id: screen
@@ -21,20 +22,19 @@ Rectangle {
property int score: 0
property int tileSize: 40
- Script { source: "content/samegame.js" }
-
z: 20; anchors.centerIn: parent
width: parent.width - (parent.width % getTileSize());
height: parent.height - (parent.height % getTileSize());
MouseArea {
- id: gameMR
- anchors.fill: parent; onClicked: handleClick(mouse.x,mouse.y);
+ anchors.fill: parent; onClicked: SameGame.handleClick(mouse.x,mouse.y);
}
}
}
Dialog { id: dialog; anchors.centerIn: parent; z: 21 }
+
+ //![0]
Dialog {
id: scoreName; anchors.centerIn: parent; z: 22;
Text {
@@ -54,6 +54,7 @@ Rectangle {
anchors.left: spacer.right
}
}
+ //![0]
Rectangle {
id: toolBar
@@ -62,7 +63,7 @@ Rectangle {
anchors.bottom: screen.bottom
Button {
- id: btnA; text: "New Game"; onClicked: {initBoard();}
+ id: btnA; text: "New Game"; onClicked: {SameGame.initBoard();}
anchors.left: parent.left; anchors.leftMargin: 3
anchors.verticalCenter: parent.verticalCenter
}
diff --git a/examples/declarative/widgets/MyWidgets/qmldir b/examples/declarative/widgets/MyWidgets/qmldir
deleted file mode 100644
index dc1d10e165..0000000000
--- a/examples/declarative/widgets/MyWidgets/qmldir
+++ /dev/null
@@ -1 +0,0 @@
-plugin mywidgetsplugin
diff --git a/examples/graphicsview/weatheranchorlayout/main.cpp b/examples/graphicsview/weatheranchorlayout/main.cpp
index aa06476f38..391fdd8fdf 100644
--- a/examples/graphicsview/weatheranchorlayout/main.cpp
+++ b/examples/graphicsview/weatheranchorlayout/main.cpp
@@ -97,6 +97,8 @@ protected:
case Qt::MaximumSize:
sh = QSizeF(QWIDGETSIZE_MAX, QWIDGETSIZE_MAX);
break;
+ default:
+ break;
}
return sh;
}
@@ -167,15 +169,6 @@ private:
};
-static QGraphicsProxyWidget *createItem(const QString &name = "Unnamed")
-{
- QGraphicsProxyWidget *w = new QGraphicsProxyWidget;
- w->setWidget(new QPushButton(name));
- w->setData(0, name);
- w->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred);
- return w;
-}
-
int main(int argc, char **argv)
{
Q_INIT_RESOURCE(weatheranchorlayout);
diff --git a/examples/script/qstetrix/tetrixboard.cpp b/examples/script/qstetrix/tetrixboard.cpp
index 7d44c4c13e..f35740d3b8 100644
--- a/examples/script/qstetrix/tetrixboard.cpp
+++ b/examples/script/qstetrix/tetrixboard.cpp
@@ -54,7 +54,12 @@ TetrixBoard::TetrixBoard(QWidget *parent)
void TetrixBoard::setNextPieceLabel(QWidget *label)
{
- nextPieceLabel = qobject_cast<QLabel*>(label);
+ nextPieceLbl = qobject_cast<QLabel*>(label);
+}
+
+QLabel *TetrixBoard::nextPieceLabel() const
+{
+ return nextPieceLbl;
}
QObject *TetrixBoard::getTimer()
@@ -82,16 +87,16 @@ void TetrixBoard::keyPressEvent(QKeyEvent *event)
void TetrixBoard::showNextPiece(int width, int height)
{
- if (!nextPieceLabel)
+ if (!nextPieceLabel())
return;
QPixmap pixmap(width * squareWidth(), height * squareHeight());
QPainter painter(&pixmap);
- painter.fillRect(pixmap.rect(), nextPieceLabel->palette().background());
+ painter.fillRect(pixmap.rect(), nextPieceLabel()->palette().background());
emit paintNextPieceRequested(&painter);
- nextPieceLabel->setPixmap(pixmap);
+ nextPieceLabel()->setPixmap(pixmap);
}
void TetrixBoard::drawPauseScreen(QPainter *painter)
diff --git a/examples/script/qstetrix/tetrixboard.h b/examples/script/qstetrix/tetrixboard.h
index 7a04317b10..781ec395a0 100644
--- a/examples/script/qstetrix/tetrixboard.h
+++ b/examples/script/qstetrix/tetrixboard.h
@@ -45,21 +45,19 @@
#include <QTimer>
#include <QFrame>
#include <QPointer>
-
-QT_BEGIN_NAMESPACE
-class QLabel;
-QT_END_NAMESPACE
+#include <QLabel>
class TetrixBoard : public QFrame
{
Q_OBJECT
Q_PROPERTY(QObject* timer READ getTimer)
- Q_PROPERTY(QWidget* nextPieceLabel WRITE setNextPieceLabel)
+ Q_PROPERTY(QWidget* nextPieceLabel READ nextPieceLabel WRITE setNextPieceLabel)
public:
TetrixBoard(QWidget *parent = 0);
void setNextPieceLabel(QWidget *label);
+ QLabel *nextPieceLabel() const;
void setBoardWidth(int width);
void setBoardHeight(int height);
QSize minimumSizeHint() const;
@@ -95,7 +93,7 @@ private:
int squareHeight() { return contentsRect().height() / BoardHeight; }
QTimer *timer;
- QPointer<QLabel> nextPieceLabel;
+ QPointer<QLabel> nextPieceLbl;
QImage image;
};
diff --git a/qmake/project.cpp b/qmake/project.cpp
index 9e6db108ea..01a3843c20 100644
--- a/qmake/project.cpp
+++ b/qmake/project.cpp
@@ -1507,6 +1507,7 @@ QMakeProject::read(uchar cmd)
void QMakeProject::validateModes()
{
+#if !defined(QT_BUILD_QMAKE_NO_GENERATORS)
if (Option::host_mode == Option::HOST_UNKNOWN_MODE
|| Option::target_mode == Option::TARG_UNKNOWN_MODE) {
Option::HOST_MODE host_mode;
@@ -1543,6 +1544,7 @@ void QMakeProject::validateModes()
}
}
}
+#endif // !defined(QT_BUILD_QMAKE_NO_GENERATORS)
}
bool
diff --git a/src/3rdparty/harfbuzz/src/harfbuzz-greek.c b/src/3rdparty/harfbuzz/src/harfbuzz-greek.c
index 59f3077688..2e9b858da7 100644
--- a/src/3rdparty/harfbuzz/src/harfbuzz-greek.c
+++ b/src/3rdparty/harfbuzz/src/harfbuzz-greek.c
@@ -77,10 +77,12 @@ static HB_UChar16 compose_0x300(HB_UChar16 base)
return 0x1fdd;
return 0;
}
- const hb_greek_decomposition *d = decompose_0x300;
- while (d->base && d->base != base)
- ++d;
- return d->composed;
+ {
+ const hb_greek_decomposition *d = decompose_0x300;
+ while (d->base && d->base != base)
+ ++d;
+ return d->composed;
+ }
}
static const hb_greek_decomposition decompose_0x301[] = {
@@ -115,10 +117,12 @@ static HB_UChar16 compose_0x301(HB_UChar16 base)
if (base == 0x1ffe)
return 0x1fde;
}
- const hb_greek_decomposition *d = decompose_0x301;
- while (d->base && d->base != base)
- ++d;
- return d->composed;
+ {
+ const hb_greek_decomposition *d = decompose_0x301;
+ while (d->base && d->base != base)
+ ++d;
+ return d->composed;
+ }
}
static const hb_greek_decomposition decompose_0x304[] = {
@@ -351,8 +355,7 @@ static HB_UChar16 compose_0x345(HB_UChar16 base)
*/
HB_Bool HB_GreekShape(HB_ShaperItem *shaper_item)
{
- assert(shaper_item->item.script == HB_Script_Greek);
-
+ const int availableGlyphs = shaper_item->num_glyphs;
const HB_UChar16 *uc = shaper_item->string + shaper_item->item.pos;
unsigned short *logClusters = shaper_item->log_clusters;
HB_GlyphAttributes *attributes = shaper_item->attributes;
@@ -363,6 +366,9 @@ HB_Bool HB_GreekShape(HB_ShaperItem *shaper_item)
hb_uint32 i;
HB_STACKARRAY(HB_UChar16, shapedChars, 2 * shaper_item->item.length);
+
+ assert(shaper_item->item.script == HB_Script_Greek);
+
*shapedChars = *uc;
logClusters[0] = 0;
@@ -430,7 +436,6 @@ HB_Bool HB_GreekShape(HB_ShaperItem *shaper_item)
#ifndef NO_OPENTYPE
if (HB_SelectScript(shaper_item, greek_features)) {
- const int availableGlyphs = shaper_item->num_glyphs;
HB_OpenTypeShape(shaper_item, /*properties*/0);
return HB_OpenTypePosition(shaper_item, availableGlyphs, /*doLogClusters*/TRUE);
}
diff --git a/src/3rdparty/harfbuzz/tests/shaping/main.cpp b/src/3rdparty/harfbuzz/tests/shaping/main.cpp
index b48b0a9e3a..320e8ee937 100644
--- a/src/3rdparty/harfbuzz/tests/shaping/main.cpp
+++ b/src/3rdparty/harfbuzz/tests/shaping/main.cpp
@@ -272,7 +272,6 @@ Shaper::Shaper(FT_Face face, HB_Script script, const QString &str)
}
-#if defined(Q_WS_X11)
static bool decomposedShaping(FT_Face face, HB_Script script, const QChar &ch)
{
QString uc = QString().append(ch);
@@ -318,7 +317,6 @@ static bool decomposedShaping(FT_Face face, HB_Script script, const QChar &ch)
qDebug(" decomposed glyph result = %s", str.toLatin1().constData());
return false;
}
-#endif
struct ShapeTable {
unsigned short unicode[16];
@@ -382,6 +380,44 @@ void tst_QScriptEngine::greek()
continue;
QVERIFY( decomposedShaping(face, HB_Script_Greek, QChar(uc)) );
}
+ FT_Done_Face(face);
+ } else {
+ QSKIP("couln't find DejaVu Sans", SkipAll);
+ }
+
+
+ face = loadFace("SBL_grk.ttf");
+ if (face) {
+ for (int uc = 0x1f00; uc <= 0x1fff; ++uc) {
+ QString str;
+ str.append(uc);
+ if (str.normalized(QString::NormalizationForm_D).normalized(QString::NormalizationForm_C) != str) {
+ //qDebug() << "skipping" << hex << uc;
+ continue;
+ }
+ if (uc == 0x1fc1 || uc == 0x1fed)
+ continue;
+ QVERIFY( decomposedShaping(face, HB_Script_Greek, QChar(uc)) );
+
+ }
+
+ const ShapeTable shape_table [] = {
+ { { 0x3b1, 0x300, 0x313, 0x0 },
+ { 0xb8, 0x3d3, 0x3c7, 0x0 } },
+ { { 0x3b1, 0x313, 0x300, 0x0 },
+ { 0xd4, 0x0 } },
+
+ { {0}, {0} }
+ };
+
+
+ const ShapeTable *s = shape_table;
+ while (s->unicode[0]) {
+ QVERIFY( shaping(face, s, HB_Script_Greek) );
+ ++s;
+ }
+
+ FT_Done_Face(face);
} else {
QSKIP("couln't find DejaVu Sans", SkipAll);
}
diff --git a/src/3rdparty/phonon/ds9/iodevicereader.cpp b/src/3rdparty/phonon/ds9/iodevicereader.cpp
index 2dff1feb92..9152712539 100644
--- a/src/3rdparty/phonon/ds9/iodevicereader.cpp
+++ b/src/3rdparty/phonon/ds9/iodevicereader.cpp
@@ -139,10 +139,6 @@ namespace Phonon
{
QMutexLocker locker(&m_mutexRead);
- if (m_mediaGraph->isStopping()) {
- return VFW_E_WRONG_STATE;
- }
-
if(streamSize() != 1 && pos + length > streamSize()) {
//it tries to read outside of the boundaries
return E_FAIL;
@@ -158,9 +154,6 @@ namespace Phonon
int oldSize = currentBufferSize();
while (currentBufferSize() < int(length)) {
needData();
- if (m_mediaGraph->isStopping()) {
- return VFW_E_WRONG_STATE;
- }
if (oldSize == currentBufferSize()) {
break; //we didn't get any data
diff --git a/src/3rdparty/pixman/README b/src/3rdparty/pixman/README
new file mode 100644
index 0000000000..843b069800
--- /dev/null
+++ b/src/3rdparty/pixman/README
@@ -0,0 +1,26 @@
+pixman is a library that provides low-level pixel manipulation
+features such as image compositing and trapezoid rasterization.
+
+Please submit bugs & patches to the libpixman bugzilla:
+
+ https://bugs.freedesktop.org/enter_bug.cgi?product=pixman
+
+All questions regarding this software should be directed to either the
+Xorg mailing list:
+
+ http://lists.freedesktop.org/mailman/listinfo/xorg
+
+or the cairo mailing list:
+
+ http://lists.freedesktop.org/mailman/listinfo/cairo
+
+The master development code repository can be found at:
+
+ git://anongit.freedesktop.org/git/pixman
+
+ http://gitweb.freedesktop.org/?p=pixman;a=summary
+
+For more information on the git code manager, see:
+
+ http://wiki.x.org/wiki/GitPage
+
diff --git a/src/3rdparty/pixman/pixman-arm-neon-asm.S b/src/3rdparty/pixman/pixman-arm-neon-asm.S
new file mode 100644
index 0000000000..eb8cc4c966
--- /dev/null
+++ b/src/3rdparty/pixman/pixman-arm-neon-asm.S
@@ -0,0 +1,1709 @@
+/*
+ * Copyright © 2009 Nokia Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ * Author: Siarhei Siamashka (siarhei.siamashka@nokia.com)
+ */
+
+/*
+ * This file contains implementations of NEON optimized pixel processing
+ * functions. There is no full and detailed tutorial, but some functions
+ * (those which are exposing some new or interesting features) are
+ * extensively commented and can be used as examples.
+ *
+ * You may want to have a look at the comments for following functions:
+ * - pixman_composite_over_8888_0565_asm_neon
+ * - pixman_composite_over_n_8_0565_asm_neon
+ */
+
+/* Prevent the stack from becoming executable for no reason... */
+#if defined(__linux__) && defined(__ELF__)
+.section .note.GNU-stack,"",%progbits
+#endif
+
+ .text
+ .fpu neon
+ .arch armv7a
+ .altmacro
+
+#include "pixman-arm-neon-asm.h"
+
+/* Global configuration options and preferences */
+
+/*
+ * The code can optionally make use of unaligned memory accesses to improve
+ * performance of handling leading/trailing pixels for each scanline.
+ * Configuration variable RESPECT_STRICT_ALIGNMENT can be set to 0 for
+ * example in linux if unaligned memory accesses are not configured to
+ * generate.exceptions.
+ */
+.set RESPECT_STRICT_ALIGNMENT, 1
+
+/*
+ * Set default prefetch type. There is a choice between the following options:
+ *
+ * PREFETCH_TYPE_NONE (may be useful for the ARM cores where PLD is set to work
+ * as NOP to workaround some HW bugs or for whatever other reason)
+ *
+ * PREFETCH_TYPE_SIMPLE (may be useful for simple single-issue ARM cores where
+ * advanced prefetch intruduces heavy overhead)
+ *
+ * PREFETCH_TYPE_ADVANCED (useful for superscalar cores such as ARM Cortex-A8
+ * which can run ARM and NEON instructions simultaneously so that extra ARM
+ * instructions do not add (many) extra cycles, but improve prefetch efficiency)
+ *
+ * Note: some types of function can't support advanced prefetch and fallback
+ * to simple one (those which handle 24bpp pixels)
+ */
+.set PREFETCH_TYPE_DEFAULT, PREFETCH_TYPE_ADVANCED
+
+/* Prefetch distance in pixels for simple prefetch */
+.set PREFETCH_DISTANCE_SIMPLE, 64
+
+/*
+ * Implementation of pixman_composite_over_8888_0565_asm_neon
+ *
+ * This function takes a8r8g8b8 source buffer, r5g6b5 destination buffer and
+ * performs OVER compositing operation. Function fast_composite_over_8888_0565
+ * from pixman-fast-path.c does the same in C and can be used as a reference.
+ *
+ * First we need to have some NEON assembly code which can do the actual
+ * operation on the pixels and provide it to the template macro.
+ *
+ * Template macro quite conveniently takes care of emitting all the necessary
+ * code for memory reading and writing (including quite tricky cases of
+ * handling unaligned leading/trailing pixels), so we only need to deal with
+ * the data in NEON registers.
+ *
+ * NEON registers allocation in general is recommented to be the following:
+ * d0, d1, d2, d3 - contain loaded source pixel data
+ * d4, d5, d6, d7 - contain loaded destination pixels (if they are needed)
+ * d24, d25, d26, d27 - contain loading mask pixel data (if mask is used)
+ * d28, d29, d30, d31 - place for storing the result (destination pixels)
+ *
+ * As can be seen above, four 64-bit NEON registers are used for keeping
+ * intermediate pixel data and up to 8 pixels can be processed in one step
+ * for 32bpp formats (16 pixels for 16bpp, 32 pixels for 8bpp).
+ *
+ * This particular function uses the following registers allocation:
+ * d0, d1, d2, d3 - contain loaded source pixel data
+ * d4, d5 - contain loaded destination pixels (they are needed)
+ * d28, d29 - place for storing the result (destination pixels)
+ */
+
+/*
+ * Step one. We need to have some code to do some arithmetics on pixel data.
+ * This is implemented as a pair of macros: '*_head' and '*_tail'. When used
+ * back-to-back, they take pixel data from {d0, d1, d2, d3} and {d4, d5},
+ * perform all the needed calculations and write the result to {d28, d29}.
+ * The rationale for having two macros and not just one will be explained
+ * later. In practice, any single monolitic function which does the work can
+ * be split into two parts in any arbitrary way without affecting correctness.
+ *
+ * There is one special trick here too. Common template macro can optionally
+ * make our life a bit easier by doing R, G, B, A color components
+ * deinterleaving for 32bpp pixel formats (and this feature is used in
+ * 'pixman_composite_over_8888_0565_asm_neon' function). So it means that
+ * instead of having 8 packed pixels in {d0, d1, d2, d3} registers, we
+ * actually use d0 register for blue channel (a vector of eight 8-bit
+ * values), d1 register for green, d2 for red and d3 for alpha. This
+ * simple conversion can be also done with a few NEON instructions:
+ *
+ * Packed to planar conversion:
+ * vuzp.8 d0, d1
+ * vuzp.8 d2, d3
+ * vuzp.8 d1, d3
+ * vuzp.8 d0, d2
+ *
+ * Planar to packed conversion:
+ * vzip.8 d0, d2
+ * vzip.8 d1, d3
+ * vzip.8 d2, d3
+ * vzip.8 d0, d1
+ *
+ * But pixel can be loaded directly in planar format using VLD4.8 NEON
+ * instruction. It is 1 cycle slower than VLD1.32, so this is not always
+ * desirable, that's why deinterleaving is optional.
+ *
+ * But anyway, here is the code:
+ */
+.macro pixman_composite_over_8888_0565_process_pixblock_head
+ /* convert 8 r5g6b5 pixel data from {d4, d5} to planar 8-bit format
+ and put data into d6 - red, d7 - green, d30 - blue */
+ vshrn.u16 d6, q2, #8
+ vshrn.u16 d7, q2, #3
+ vsli.u16 q2, q2, #5
+ vsri.u8 d6, d6, #5
+ vmvn.8 d3, d3 /* invert source alpha */
+ vsri.u8 d7, d7, #6
+ vshrn.u16 d30, q2, #2
+ /* now do alpha blending, storing results in 8-bit planar format
+ into d16 - red, d19 - green, d18 - blue */
+ vmull.u8 q10, d3, d6
+ vmull.u8 q11, d3, d7
+ vmull.u8 q12, d3, d30
+ vrshr.u16 q13, q10, #8
+ vrshr.u16 q3, q11, #8
+ vrshr.u16 q15, q12, #8
+ vraddhn.u16 d20, q10, q13
+ vraddhn.u16 d23, q11, q3
+ vraddhn.u16 d22, q12, q15
+.endm
+
+.macro pixman_composite_over_8888_0565_process_pixblock_tail
+ /* ... continue alpha blending */
+ vqadd.u8 d16, d2, d20
+ vqadd.u8 q9, q0, q11
+ /* convert the result to r5g6b5 and store it into {d28, d29} */
+ vshll.u8 q14, d16, #8
+ vshll.u8 q8, d19, #8
+ vshll.u8 q9, d18, #8
+ vsri.u16 q14, q8, #5
+ vsri.u16 q14, q9, #11
+.endm
+
+/*
+ * OK, now we got almost everything that we need. Using the above two
+ * macros, the work can be done right. But now we want to optimize
+ * it a bit. ARM Cortex-A8 is an in-order core, and benefits really
+ * a lot from good code scheduling and software pipelining.
+ *
+ * Let's construct some code, which will run in the core main loop.
+ * Some pseudo-code of the main loop will look like this:
+ * head
+ * while (...) {
+ * tail
+ * head
+ * }
+ * tail
+ *
+ * It may look a bit weird, but this setup allows to hide instruction
+ * latencies better and also utilize dual-issue capability more
+ * efficiently (make pairs of load-store and ALU instructions).
+ *
+ * So what we need now is a '*_tail_head' macro, which will be used
+ * in the core main loop. A trivial straightforward implementation
+ * of this macro would look like this:
+ *
+ * pixman_composite_over_8888_0565_process_pixblock_tail
+ * vst1.16 {d28, d29}, [DST_W, :128]!
+ * vld1.16 {d4, d5}, [DST_R, :128]!
+ * vld4.32 {d0, d1, d2, d3}, [SRC]!
+ * pixman_composite_over_8888_0565_process_pixblock_head
+ * cache_preload 8, 8
+ *
+ * Now it also got some VLD/VST instructions. We simply can't move from
+ * processing one block of pixels to the other one with just arithmetics.
+ * The previously processed data needs to be written to memory and new
+ * data needs to be fetched. Fortunately, this main loop does not deal
+ * with partial leading/trailing pixels and can load/store a full block
+ * of pixels in a bulk. Additionally, destination buffer is already
+ * 16 bytes aligned here (which is good for performance).
+ *
+ * New things here are DST_R, DST_W, SRC and MASK identifiers. These
+ * are the aliases for ARM registers which are used as pointers for
+ * accessing data. We maintain separate pointers for reading and writing
+ * destination buffer (DST_R and DST_W).
+ *
+ * Another new thing is 'cache_preload' macro. It is used for prefetching
+ * data into CPU L2 cache and improve performance when dealing with large
+ * images which are far larger than cache size. It uses one argument
+ * (actually two, but they need to be the same here) - number of pixels
+ * in a block. Looking into 'pixman-arm-neon-asm.h' can provide some
+ * details about this macro. Moreover, if good performance is needed
+ * the code from this macro needs to be copied into '*_tail_head' macro
+ * and mixed with the rest of code for optimal instructions scheduling.
+ * We are actually doing it below.
+ *
+ * Now after all the explanations, here is the optimized code.
+ * Different instruction streams (originaling from '*_head', '*_tail'
+ * and 'cache_preload' macro) use different indentation levels for
+ * better readability. Actually taking the code from one of these
+ * indentation levels and ignoring a few VLD/VST instructions would
+ * result in exactly the code from '*_head', '*_tail' or 'cache_preload'
+ * macro!
+ */
+
+#if 1
+
+.macro pixman_composite_over_8888_0565_process_pixblock_tail_head
+ vqadd.u8 d16, d2, d20
+ vld1.16 {d4, d5}, [DST_R, :128]!
+ vqadd.u8 q9, q0, q11
+ vshrn.u16 d6, q2, #8
+ vld4.8 {d0, d1, d2, d3}, [SRC]!
+ vshrn.u16 d7, q2, #3
+ vsli.u16 q2, q2, #5
+ vshll.u8 q14, d16, #8
+ PF add PF_X, PF_X, #8
+ vshll.u8 q8, d19, #8
+ PF tst PF_CTL, #0xF
+ vsri.u8 d6, d6, #5
+ PF addne PF_X, PF_X, #8
+ vmvn.8 d3, d3
+ PF subne PF_CTL, PF_CTL, #1
+ vsri.u8 d7, d7, #6
+ vshrn.u16 d30, q2, #2
+ vmull.u8 q10, d3, d6
+ PF pld, [PF_SRC, PF_X, lsl #src_bpp_shift]
+ vmull.u8 q11, d3, d7
+ vmull.u8 q12, d3, d30
+ PF pld, [PF_DST, PF_X, lsl #dst_bpp_shift]
+ vsri.u16 q14, q8, #5
+ PF cmp PF_X, ORIG_W
+ vshll.u8 q9, d18, #8
+ vrshr.u16 q13, q10, #8
+ PF subge PF_X, PF_X, ORIG_W
+ vrshr.u16 q3, q11, #8
+ vrshr.u16 q15, q12, #8
+ PF subges PF_CTL, PF_CTL, #0x10
+ vsri.u16 q14, q9, #11
+ PF ldrgeb DUMMY, [PF_SRC, SRC_STRIDE, lsl #src_bpp_shift]!
+ vraddhn.u16 d20, q10, q13
+ vraddhn.u16 d23, q11, q3
+ PF ldrgeb DUMMY, [PF_DST, DST_STRIDE, lsl #dst_bpp_shift]!
+ vraddhn.u16 d22, q12, q15
+ vst1.16 {d28, d29}, [DST_W, :128]!
+.endm
+
+#else
+
+/* If we did not care much about the performance, we would just use this... */
+.macro pixman_composite_over_8888_0565_process_pixblock_tail_head
+ pixman_composite_over_8888_0565_process_pixblock_tail
+ vst1.16 {d28, d29}, [DST_W, :128]!
+ vld1.16 {d4, d5}, [DST_R, :128]!
+ vld4.32 {d0, d1, d2, d3}, [SRC]!
+ pixman_composite_over_8888_0565_process_pixblock_head
+ cache_preload 8, 8
+.endm
+
+#endif
+
+/*
+ * And now the final part. We are using 'generate_composite_function' macro
+ * to put all the stuff together. We are specifying the name of the function
+ * which we want to get, number of bits per pixel for the source, mask and
+ * destination (0 if unused, like mask in this case). Next come some bit
+ * flags:
+ * FLAG_DST_READWRITE - tells that the destination buffer is both read
+ * and written, for write-only buffer we would use
+ * FLAG_DST_WRITEONLY flag instead
+ * FLAG_DEINTERLEAVE_32BPP - tells that we prefer to work with planar data
+ * and separate color channels for 32bpp format.
+ * The next things are:
+ * - the number of pixels processed per iteration (8 in this case, because
+ * that's the maximum what can fit into four 64-bit NEON registers).
+ * - prefetch distance, measured in pixel blocks. In this case it is 5 times
+ * by 8 pixels. That would be 40 pixels, or up to 160 bytes. Optimal
+ * prefetch distance can be selected by running some benchmarks.
+ *
+ * After that we specify some macros, these are 'default_init',
+ * 'default_cleanup' here which are empty (but it is possible to have custom
+ * init/cleanup macros to be able to save/restore some extra NEON registers
+ * like d8-d15 or do anything else) followed by
+ * 'pixman_composite_over_8888_0565_process_pixblock_head',
+ * 'pixman_composite_over_8888_0565_process_pixblock_tail' and
+ * 'pixman_composite_over_8888_0565_process_pixblock_tail_head'
+ * which we got implemented above.
+ *
+ * The last part is the NEON registers allocation scheme.
+ */
+generate_composite_function \
+ pixman_composite_over_8888_0565_asm_neon, 32, 0, 16, \
+ FLAG_DST_READWRITE | FLAG_DEINTERLEAVE_32BPP, \
+ 8, /* number of pixels, processed in a single block */ \
+ 5, /* prefetch distance */ \
+ default_init, \
+ default_cleanup, \
+ pixman_composite_over_8888_0565_process_pixblock_head, \
+ pixman_composite_over_8888_0565_process_pixblock_tail, \
+ pixman_composite_over_8888_0565_process_pixblock_tail_head, \
+ 28, /* dst_w_basereg */ \
+ 4, /* dst_r_basereg */ \
+ 0, /* src_basereg */ \
+ 24 /* mask_basereg */
+
+/******************************************************************************/
+
+.macro pixman_composite_over_n_0565_process_pixblock_head
+ /* convert 8 r5g6b5 pixel data from {d4, d5} to planar 8-bit format
+ and put data into d6 - red, d7 - green, d30 - blue */
+ vshrn.u16 d6, q2, #8
+ vshrn.u16 d7, q2, #3
+ vsli.u16 q2, q2, #5
+ vsri.u8 d6, d6, #5
+ vsri.u8 d7, d7, #6
+ vshrn.u16 d30, q2, #2
+ /* now do alpha blending, storing results in 8-bit planar format
+ into d16 - red, d19 - green, d18 - blue */
+ vmull.u8 q10, d3, d6
+ vmull.u8 q11, d3, d7
+ vmull.u8 q12, d3, d30
+ vrshr.u16 q13, q10, #8
+ vrshr.u16 q3, q11, #8
+ vrshr.u16 q15, q12, #8
+ vraddhn.u16 d20, q10, q13
+ vraddhn.u16 d23, q11, q3
+ vraddhn.u16 d22, q12, q15
+.endm
+
+.macro pixman_composite_over_n_0565_process_pixblock_tail
+ /* ... continue alpha blending */
+ vqadd.u8 d16, d2, d20
+ vqadd.u8 q9, q0, q11
+ /* convert the result to r5g6b5 and store it into {d28, d29} */
+ vshll.u8 q14, d16, #8
+ vshll.u8 q8, d19, #8
+ vshll.u8 q9, d18, #8
+ vsri.u16 q14, q8, #5
+ vsri.u16 q14, q9, #11
+.endm
+
+/* TODO: expand macros and do better instructions scheduling */
+.macro pixman_composite_over_n_0565_process_pixblock_tail_head
+ pixman_composite_over_n_0565_process_pixblock_tail
+ vld1.16 {d4, d5}, [DST_R, :128]!
+ vst1.16 {d28, d29}, [DST_W, :128]!
+ pixman_composite_over_n_0565_process_pixblock_head
+.endm
+
+.macro pixman_composite_over_n_0565_init
+ add DUMMY, sp, #ARGS_STACK_OFFSET
+ vld1.32 {d3[0]}, [DUMMY]
+ vdup.8 d0, d3[0]
+ vdup.8 d1, d3[1]
+ vdup.8 d2, d3[2]
+ vdup.8 d3, d3[3]
+ vmvn.8 d3, d3 /* invert source alpha */
+.endm
+
+generate_composite_function \
+ pixman_composite_over_n_0565_asm_neon, 0, 0, 16, \
+ FLAG_DST_READWRITE, \
+ 8, /* number of pixels, processed in a single block */ \
+ 5, /* prefetch distance */ \
+ pixman_composite_over_n_0565_init, \
+ default_cleanup, \
+ pixman_composite_over_n_0565_process_pixblock_head, \
+ pixman_composite_over_n_0565_process_pixblock_tail, \
+ pixman_composite_over_n_0565_process_pixblock_tail_head, \
+ 28, /* dst_w_basereg */ \
+ 4, /* dst_r_basereg */ \
+ 0, /* src_basereg */ \
+ 24 /* mask_basereg */
+
+/******************************************************************************/
+
+.macro pixman_composite_src_8888_0565_process_pixblock_head
+ vshll.u8 q8, d1, #8
+ vshll.u8 q14, d2, #8
+ vshll.u8 q9, d0, #8
+.endm
+
+.macro pixman_composite_src_8888_0565_process_pixblock_tail
+ vsri.u16 q14, q8, #5
+ vsri.u16 q14, q9, #11
+.endm
+
+.macro pixman_composite_src_8888_0565_process_pixblock_tail_head
+ vsri.u16 q14, q8, #5
+ PF add PF_X, PF_X, #8
+ PF tst PF_CTL, #0xF
+ vld4.8 {d0, d1, d2, d3}, [SRC]!
+ PF addne PF_X, PF_X, #8
+ PF subne PF_CTL, PF_CTL, #1
+ vsri.u16 q14, q9, #11
+ PF cmp PF_X, ORIG_W
+ PF pld, [PF_SRC, PF_X, lsl #src_bpp_shift]
+ vshll.u8 q8, d1, #8
+ vst1.16 {d28, d29}, [DST_W, :128]!
+ PF subge PF_X, PF_X, ORIG_W
+ PF subges PF_CTL, PF_CTL, #0x10
+ vshll.u8 q14, d2, #8
+ PF ldrgeb DUMMY, [PF_SRC, SRC_STRIDE, lsl #src_bpp_shift]!
+ vshll.u8 q9, d0, #8
+.endm
+
+generate_composite_function \
+ pixman_composite_src_8888_0565_asm_neon, 32, 0, 16, \
+ FLAG_DST_WRITEONLY | FLAG_DEINTERLEAVE_32BPP, \
+ 8, /* number of pixels, processed in a single block */ \
+ 10, /* prefetch distance */ \
+ default_init, \
+ default_cleanup, \
+ pixman_composite_src_8888_0565_process_pixblock_head, \
+ pixman_composite_src_8888_0565_process_pixblock_tail, \
+ pixman_composite_src_8888_0565_process_pixblock_tail_head
+
+/******************************************************************************/
+
+.macro pixman_composite_src_0565_8888_process_pixblock_head
+ vshrn.u16 d30, q0, #8
+ vshrn.u16 d29, q0, #3
+ vsli.u16 q0, q0, #5
+ vmov.u8 d31, #255
+ vsri.u8 d30, d30, #5
+ vsri.u8 d29, d29, #6
+ vshrn.u16 d28, q0, #2
+.endm
+
+.macro pixman_composite_src_0565_8888_process_pixblock_tail
+.endm
+
+/* TODO: expand macros and do better instructions scheduling */
+.macro pixman_composite_src_0565_8888_process_pixblock_tail_head
+ pixman_composite_src_0565_8888_process_pixblock_tail
+ vst4.8 {d28, d29, d30, d31}, [DST_W, :128]!
+ vld1.16 {d0, d1}, [SRC]!
+ pixman_composite_src_0565_8888_process_pixblock_head
+ cache_preload 8, 8
+.endm
+
+generate_composite_function \
+ pixman_composite_src_0565_8888_asm_neon, 16, 0, 32, \
+ FLAG_DST_WRITEONLY | FLAG_DEINTERLEAVE_32BPP, \
+ 8, /* number of pixels, processed in a single block */ \
+ 10, /* prefetch distance */ \
+ default_init, \
+ default_cleanup, \
+ pixman_composite_src_0565_8888_process_pixblock_head, \
+ pixman_composite_src_0565_8888_process_pixblock_tail, \
+ pixman_composite_src_0565_8888_process_pixblock_tail_head
+
+/******************************************************************************/
+
+.macro pixman_composite_add_8000_8000_process_pixblock_head
+ vqadd.u8 q14, q0, q2
+ vqadd.u8 q15, q1, q3
+.endm
+
+.macro pixman_composite_add_8000_8000_process_pixblock_tail
+.endm
+
+.macro pixman_composite_add_8000_8000_process_pixblock_tail_head
+ vld1.8 {d0, d1, d2, d3}, [SRC]!
+ PF add PF_X, PF_X, #32
+ PF tst PF_CTL, #0xF
+ vld1.8 {d4, d5, d6, d7}, [DST_R, :128]!
+ PF addne PF_X, PF_X, #32
+ PF subne PF_CTL, PF_CTL, #1
+ vst1.8 {d28, d29, d30, d31}, [DST_W, :128]!
+ PF cmp PF_X, ORIG_W
+ PF pld, [PF_SRC, PF_X, lsl #src_bpp_shift]
+ PF pld, [PF_DST, PF_X, lsl #dst_bpp_shift]
+ PF subge PF_X, PF_X, ORIG_W
+ PF subges PF_CTL, PF_CTL, #0x10
+ vqadd.u8 q14, q0, q2
+ PF ldrgeb DUMMY, [PF_SRC, SRC_STRIDE, lsl #src_bpp_shift]!
+ PF ldrgeb DUMMY, [PF_DST, DST_STRIDE, lsl #dst_bpp_shift]!
+ vqadd.u8 q15, q1, q3
+.endm
+
+generate_composite_function \
+ pixman_composite_add_8000_8000_asm_neon, 8, 0, 8, \
+ FLAG_DST_READWRITE, \
+ 32, /* number of pixels, processed in a single block */ \
+ 10, /* prefetch distance */ \
+ default_init, \
+ default_cleanup, \
+ pixman_composite_add_8000_8000_process_pixblock_head, \
+ pixman_composite_add_8000_8000_process_pixblock_tail, \
+ pixman_composite_add_8000_8000_process_pixblock_tail_head
+
+/******************************************************************************/
+
+.macro pixman_composite_add_8888_8888_process_pixblock_tail_head
+ vld1.8 {d0, d1, d2, d3}, [SRC]!
+ PF add PF_X, PF_X, #8
+ PF tst PF_CTL, #0xF
+ vld1.8 {d4, d5, d6, d7}, [DST_R, :128]!
+ PF addne PF_X, PF_X, #8
+ PF subne PF_CTL, PF_CTL, #1
+ vst1.8 {d28, d29, d30, d31}, [DST_W, :128]!
+ PF cmp PF_X, ORIG_W
+ PF pld, [PF_SRC, PF_X, lsl #src_bpp_shift]
+ PF pld, [PF_DST, PF_X, lsl #dst_bpp_shift]
+ PF subge PF_X, PF_X, ORIG_W
+ PF subges PF_CTL, PF_CTL, #0x10
+ vqadd.u8 q14, q0, q2
+ PF ldrgeb DUMMY, [PF_SRC, SRC_STRIDE, lsl #src_bpp_shift]!
+ PF ldrgeb DUMMY, [PF_DST, DST_STRIDE, lsl #dst_bpp_shift]!
+ vqadd.u8 q15, q1, q3
+.endm
+
+generate_composite_function \
+ pixman_composite_add_8888_8888_asm_neon, 32, 0, 32, \
+ FLAG_DST_READWRITE, \
+ 8, /* number of pixels, processed in a single block */ \
+ 10, /* prefetch distance */ \
+ default_init, \
+ default_cleanup, \
+ pixman_composite_add_8000_8000_process_pixblock_head, \
+ pixman_composite_add_8000_8000_process_pixblock_tail, \
+ pixman_composite_add_8888_8888_process_pixblock_tail_head
+
+generate_composite_function_single_scanline \
+ pixman_composite_scanline_add_asm_neon, 32, 0, 32, \
+ FLAG_DST_READWRITE, \
+ 8, /* number of pixels, processed in a single block */ \
+ default_init, \
+ default_cleanup, \
+ pixman_composite_add_8000_8000_process_pixblock_head, \
+ pixman_composite_add_8000_8000_process_pixblock_tail, \
+ pixman_composite_add_8888_8888_process_pixblock_tail_head
+
+/******************************************************************************/
+
+.macro pixman_composite_over_8888_8888_process_pixblock_head
+ vmvn.8 d24, d3 /* get inverted alpha */
+ /* do alpha blending */
+ vmull.u8 q8, d24, d4
+ vmull.u8 q9, d24, d5
+ vmull.u8 q10, d24, d6
+ vmull.u8 q11, d24, d7
+.endm
+
+.macro pixman_composite_over_8888_8888_process_pixblock_tail
+ vrshr.u16 q14, q8, #8
+ vrshr.u16 q15, q9, #8
+ vrshr.u16 q12, q10, #8
+ vrshr.u16 q13, q11, #8
+ vraddhn.u16 d28, q14, q8
+ vraddhn.u16 d29, q15, q9
+ vraddhn.u16 d30, q12, q10
+ vraddhn.u16 d31, q13, q11
+ vqadd.u8 q14, q0, q14
+ vqadd.u8 q15, q1, q15
+.endm
+
+.macro pixman_composite_over_8888_8888_process_pixblock_tail_head
+ vld4.8 {d4, d5, d6, d7}, [DST_R, :128]!
+ vrshr.u16 q14, q8, #8
+ PF add PF_X, PF_X, #8
+ PF tst PF_CTL, #0xF
+ vrshr.u16 q15, q9, #8
+ vrshr.u16 q12, q10, #8
+ vrshr.u16 q13, q11, #8
+ PF addne PF_X, PF_X, #8
+ PF subne PF_CTL, PF_CTL, #1
+ vraddhn.u16 d28, q14, q8
+ vraddhn.u16 d29, q15, q9
+ PF cmp PF_X, ORIG_W
+ vraddhn.u16 d30, q12, q10
+ vraddhn.u16 d31, q13, q11
+ vqadd.u8 q14, q0, q14
+ vqadd.u8 q15, q1, q15
+ vld4.8 {d0, d1, d2, d3}, [SRC]!
+ PF pld, [PF_SRC, PF_X, lsl #src_bpp_shift]
+ vmvn.8 d22, d3
+ PF pld, [PF_DST, PF_X, lsl #dst_bpp_shift]
+ vst4.8 {d28, d29, d30, d31}, [DST_W, :128]!
+ PF subge PF_X, PF_X, ORIG_W
+ vmull.u8 q8, d22, d4
+ PF subges PF_CTL, PF_CTL, #0x10
+ vmull.u8 q9, d22, d5
+ PF ldrgeb DUMMY, [PF_SRC, SRC_STRIDE, lsl #src_bpp_shift]!
+ vmull.u8 q10, d22, d6
+ PF ldrgeb DUMMY, [PF_DST, DST_STRIDE, lsl #dst_bpp_shift]!
+ vmull.u8 q11, d22, d7
+.endm
+
+generate_composite_function \
+ pixman_composite_over_8888_8888_asm_neon, 32, 0, 32, \
+ FLAG_DST_READWRITE | FLAG_DEINTERLEAVE_32BPP, \
+ 8, /* number of pixels, processed in a single block */ \
+ 5, /* prefetch distance */ \
+ default_init, \
+ default_cleanup, \
+ pixman_composite_over_8888_8888_process_pixblock_head, \
+ pixman_composite_over_8888_8888_process_pixblock_tail, \
+ pixman_composite_over_8888_8888_process_pixblock_tail_head
+
+generate_composite_function_single_scanline \
+ pixman_composite_scanline_over_asm_neon, 32, 0, 32, \
+ FLAG_DST_READWRITE | FLAG_DEINTERLEAVE_32BPP, \
+ 8, /* number of pixels, processed in a single block */ \
+ default_init, \
+ default_cleanup, \
+ pixman_composite_over_8888_8888_process_pixblock_head, \
+ pixman_composite_over_8888_8888_process_pixblock_tail, \
+ pixman_composite_over_8888_8888_process_pixblock_tail_head
+
+/******************************************************************************/
+
+/* TODO: expand macros and do better instructions scheduling */
+.macro pixman_composite_over_n_8888_process_pixblock_tail_head
+ pixman_composite_over_8888_8888_process_pixblock_tail
+ vld4.8 {d4, d5, d6, d7}, [DST_R, :128]!
+ vst4.8 {d28, d29, d30, d31}, [DST_W, :128]!
+ pixman_composite_over_8888_8888_process_pixblock_head
+.endm
+
+.macro pixman_composite_over_n_8888_init
+ add DUMMY, sp, #ARGS_STACK_OFFSET
+ vld1.32 {d3[0]}, [DUMMY]
+ vdup.8 d0, d3[0]
+ vdup.8 d1, d3[1]
+ vdup.8 d2, d3[2]
+ vdup.8 d3, d3[3]
+.endm
+
+generate_composite_function \
+ pixman_composite_over_n_8888_asm_neon, 0, 0, 32, \
+ FLAG_DST_READWRITE | FLAG_DEINTERLEAVE_32BPP, \
+ 8, /* number of pixels, processed in a single block */ \
+ 5, /* prefetch distance */ \
+ pixman_composite_over_n_8888_init, \
+ default_cleanup, \
+ pixman_composite_over_8888_8888_process_pixblock_head, \
+ pixman_composite_over_8888_8888_process_pixblock_tail, \
+ pixman_composite_over_n_8888_process_pixblock_tail_head
+
+/******************************************************************************/
+
+.macro pixman_composite_over_reverse_n_8888_process_pixblock_tail_head
+ vrshr.u16 q14, q8, #8
+ PF add PF_X, PF_X, #8
+ PF tst PF_CTL, #0xF
+ vrshr.u16 q15, q9, #8
+ vrshr.u16 q12, q10, #8
+ vrshr.u16 q13, q11, #8
+ PF addne PF_X, PF_X, #8
+ PF subne PF_CTL, PF_CTL, #1
+ vraddhn.u16 d28, q14, q8
+ vraddhn.u16 d29, q15, q9
+ PF cmp PF_X, ORIG_W
+ vraddhn.u16 d30, q12, q10
+ vraddhn.u16 d31, q13, q11
+ vqadd.u8 q14, q0, q14
+ vqadd.u8 q15, q1, q15
+ vld4.8 {d0, d1, d2, d3}, [DST_R, :128]!
+ vmvn.8 d22, d3
+ PF pld, [PF_DST, PF_X, lsl #dst_bpp_shift]
+ vst4.8 {d28, d29, d30, d31}, [DST_W, :128]!
+ PF subge PF_X, PF_X, ORIG_W
+ vmull.u8 q8, d22, d4
+ PF subges PF_CTL, PF_CTL, #0x10
+ vmull.u8 q9, d22, d5
+ vmull.u8 q10, d22, d6
+ PF ldrgeb DUMMY, [PF_DST, DST_STRIDE, lsl #dst_bpp_shift]!
+ vmull.u8 q11, d22, d7
+.endm
+
+.macro pixman_composite_over_reverse_n_8888_init
+ add DUMMY, sp, #ARGS_STACK_OFFSET
+ vld1.32 {d7[0]}, [DUMMY]
+ vdup.8 d4, d7[0]
+ vdup.8 d5, d7[1]
+ vdup.8 d6, d7[2]
+ vdup.8 d7, d7[3]
+.endm
+
+generate_composite_function \
+ pixman_composite_over_reverse_n_8888_asm_neon, 0, 0, 32, \
+ FLAG_DST_READWRITE | FLAG_DEINTERLEAVE_32BPP, \
+ 8, /* number of pixels, processed in a single block */ \
+ 5, /* prefetch distance */ \
+ pixman_composite_over_reverse_n_8888_init, \
+ default_cleanup, \
+ pixman_composite_over_8888_8888_process_pixblock_head, \
+ pixman_composite_over_8888_8888_process_pixblock_tail, \
+ pixman_composite_over_reverse_n_8888_process_pixblock_tail_head, \
+ 28, /* dst_w_basereg */ \
+ 0, /* dst_r_basereg */ \
+ 4, /* src_basereg */ \
+ 24 /* mask_basereg */
+
+/******************************************************************************/
+
+.macro pixman_composite_over_n_8_0565_process_pixblock_head
+ /* in */
+ vmull.u8 q0, d24, d8
+ vmull.u8 q1, d24, d9
+ vmull.u8 q6, d24, d10
+ vmull.u8 q7, d24, d11
+ vrshr.u16 q10, q0, #8
+ vrshr.u16 q11, q1, #8
+ vrshr.u16 q12, q6, #8
+ vrshr.u16 q13, q7, #8
+ vraddhn.u16 d0, q0, q10
+ vraddhn.u16 d1, q1, q11
+ vraddhn.u16 d2, q6, q12
+ vraddhn.u16 d3, q7, q13
+
+ vshrn.u16 d6, q2, #8
+ vshrn.u16 d7, q2, #3
+ vsli.u16 q2, q2, #5
+ vsri.u8 d6, d6, #5
+ vmvn.8 d3, d3
+ vsri.u8 d7, d7, #6
+ vshrn.u16 d30, q2, #2
+ /* now do alpha blending */
+ vmull.u8 q10, d3, d6
+ vmull.u8 q11, d3, d7
+ vmull.u8 q12, d3, d30
+ vrshr.u16 q13, q10, #8
+ vrshr.u16 q3, q11, #8
+ vrshr.u16 q15, q12, #8
+ vraddhn.u16 d20, q10, q13
+ vraddhn.u16 d23, q11, q3
+ vraddhn.u16 d22, q12, q15
+.endm
+
+.macro pixman_composite_over_n_8_0565_process_pixblock_tail
+ vqadd.u8 d16, d2, d20
+ vqadd.u8 q9, q0, q11
+ /* convert to r5g6b5 */
+ vshll.u8 q14, d16, #8
+ vshll.u8 q8, d19, #8
+ vshll.u8 q9, d18, #8
+ vsri.u16 q14, q8, #5
+ vsri.u16 q14, q9, #11
+.endm
+
+/* TODO: expand macros and do better instructions scheduling */
+.macro pixman_composite_over_n_8_0565_process_pixblock_tail_head
+ pixman_composite_over_n_8_0565_process_pixblock_tail
+ vst1.16 {d28, d29}, [DST_W, :128]!
+ vld1.16 {d4, d5}, [DST_R, :128]!
+ vld1.8 {d24}, [MASK]!
+ cache_preload 8, 8
+ pixman_composite_over_n_8_0565_process_pixblock_head
+.endm
+
+/*
+ * This function needs a special initialization of solid mask.
+ * Solid source pixel data is fetched from stack at ARGS_STACK_OFFSET
+ * offset, split into color components and replicated in d8-d11
+ * registers. Additionally, this function needs all the NEON registers,
+ * so it has to save d8-d15 registers which are callee saved according
+ * to ABI. These registers are restored from 'cleanup' macro. All the
+ * other NEON registers are caller saved, so can be clobbered freely
+ * without introducing any problems.
+ */
+.macro pixman_composite_over_n_8_0565_init
+ add DUMMY, sp, #ARGS_STACK_OFFSET
+ vpush {d8-d15}
+ vld1.32 {d11[0]}, [DUMMY]
+ vdup.8 d8, d11[0]
+ vdup.8 d9, d11[1]
+ vdup.8 d10, d11[2]
+ vdup.8 d11, d11[3]
+.endm
+
+.macro pixman_composite_over_n_8_0565_cleanup
+ vpop {d8-d15}
+.endm
+
+generate_composite_function \
+ pixman_composite_over_n_8_0565_asm_neon, 0, 8, 16, \
+ FLAG_DST_READWRITE, \
+ 8, /* number of pixels, processed in a single block */ \
+ 5, /* prefetch distance */ \
+ pixman_composite_over_n_8_0565_init, \
+ pixman_composite_over_n_8_0565_cleanup, \
+ pixman_composite_over_n_8_0565_process_pixblock_head, \
+ pixman_composite_over_n_8_0565_process_pixblock_tail, \
+ pixman_composite_over_n_8_0565_process_pixblock_tail_head
+
+/******************************************************************************/
+
+.macro pixman_composite_src_0565_0565_process_pixblock_head
+.endm
+
+.macro pixman_composite_src_0565_0565_process_pixblock_tail
+.endm
+
+.macro pixman_composite_src_0565_0565_process_pixblock_tail_head
+ vst1.16 {d0, d1, d2, d3}, [DST_W, :128]!
+ vld1.16 {d0, d1, d2, d3}, [SRC]!
+ cache_preload 16, 16
+.endm
+
+generate_composite_function \
+ pixman_composite_src_0565_0565_asm_neon, 16, 0, 16, \
+ FLAG_DST_WRITEONLY, \
+ 16, /* number of pixels, processed in a single block */ \
+ 10, /* prefetch distance */ \
+ default_init, \
+ default_cleanup, \
+ pixman_composite_src_0565_0565_process_pixblock_head, \
+ pixman_composite_src_0565_0565_process_pixblock_tail, \
+ pixman_composite_src_0565_0565_process_pixblock_tail_head, \
+ 0, /* dst_w_basereg */ \
+ 0, /* dst_r_basereg */ \
+ 0, /* src_basereg */ \
+ 0 /* mask_basereg */
+
+/******************************************************************************/
+
+.macro pixman_composite_src_n_8_process_pixblock_head
+.endm
+
+.macro pixman_composite_src_n_8_process_pixblock_tail
+.endm
+
+.macro pixman_composite_src_n_8_process_pixblock_tail_head
+ vst1.8 {d0, d1, d2, d3}, [DST_W, :128]!
+.endm
+
+.macro pixman_composite_src_n_8_init
+ add DUMMY, sp, #ARGS_STACK_OFFSET
+ vld1.32 {d0[0]}, [DUMMY]
+ vsli.u64 d0, d0, #8
+ vsli.u64 d0, d0, #16
+ vsli.u64 d0, d0, #32
+ vmov d1, d0
+ vmov q1, q0
+.endm
+
+.macro pixman_composite_src_n_8_cleanup
+.endm
+
+generate_composite_function \
+ pixman_composite_src_n_8_asm_neon, 0, 0, 8, \
+ FLAG_DST_WRITEONLY, \
+ 32, /* number of pixels, processed in a single block */ \
+ 0, /* prefetch distance */ \
+ pixman_composite_src_n_8_init, \
+ pixman_composite_src_n_8_cleanup, \
+ pixman_composite_src_n_8_process_pixblock_head, \
+ pixman_composite_src_n_8_process_pixblock_tail, \
+ pixman_composite_src_n_8_process_pixblock_tail_head, \
+ 0, /* dst_w_basereg */ \
+ 0, /* dst_r_basereg */ \
+ 0, /* src_basereg */ \
+ 0 /* mask_basereg */
+
+/******************************************************************************/
+
+.macro pixman_composite_src_n_0565_process_pixblock_head
+.endm
+
+.macro pixman_composite_src_n_0565_process_pixblock_tail
+.endm
+
+.macro pixman_composite_src_n_0565_process_pixblock_tail_head
+ vst1.16 {d0, d1, d2, d3}, [DST_W, :128]!
+.endm
+
+.macro pixman_composite_src_n_0565_init
+ add DUMMY, sp, #ARGS_STACK_OFFSET
+ vld1.32 {d0[0]}, [DUMMY]
+ vsli.u64 d0, d0, #16
+ vsli.u64 d0, d0, #32
+ vmov d1, d0
+ vmov q1, q0
+.endm
+
+.macro pixman_composite_src_n_0565_cleanup
+.endm
+
+generate_composite_function \
+ pixman_composite_src_n_0565_asm_neon, 0, 0, 16, \
+ FLAG_DST_WRITEONLY, \
+ 16, /* number of pixels, processed in a single block */ \
+ 0, /* prefetch distance */ \
+ pixman_composite_src_n_0565_init, \
+ pixman_composite_src_n_0565_cleanup, \
+ pixman_composite_src_n_0565_process_pixblock_head, \
+ pixman_composite_src_n_0565_process_pixblock_tail, \
+ pixman_composite_src_n_0565_process_pixblock_tail_head, \
+ 0, /* dst_w_basereg */ \
+ 0, /* dst_r_basereg */ \
+ 0, /* src_basereg */ \
+ 0 /* mask_basereg */
+
+/******************************************************************************/
+
+.macro pixman_composite_src_n_8888_process_pixblock_head
+.endm
+
+.macro pixman_composite_src_n_8888_process_pixblock_tail
+.endm
+
+.macro pixman_composite_src_n_8888_process_pixblock_tail_head
+ vst1.32 {d0, d1, d2, d3}, [DST_W, :128]!
+.endm
+
+.macro pixman_composite_src_n_8888_init
+ add DUMMY, sp, #ARGS_STACK_OFFSET
+ vld1.32 {d0[0]}, [DUMMY]
+ vsli.u64 d0, d0, #32
+ vmov d1, d0
+ vmov q1, q0
+.endm
+
+.macro pixman_composite_src_n_8888_cleanup
+.endm
+
+generate_composite_function \
+ pixman_composite_src_n_8888_asm_neon, 0, 0, 32, \
+ FLAG_DST_WRITEONLY, \
+ 8, /* number of pixels, processed in a single block */ \
+ 0, /* prefetch distance */ \
+ pixman_composite_src_n_8888_init, \
+ pixman_composite_src_n_8888_cleanup, \
+ pixman_composite_src_n_8888_process_pixblock_head, \
+ pixman_composite_src_n_8888_process_pixblock_tail, \
+ pixman_composite_src_n_8888_process_pixblock_tail_head, \
+ 0, /* dst_w_basereg */ \
+ 0, /* dst_r_basereg */ \
+ 0, /* src_basereg */ \
+ 0 /* mask_basereg */
+
+/******************************************************************************/
+
+.macro pixman_composite_src_8888_8888_process_pixblock_head
+.endm
+
+.macro pixman_composite_src_8888_8888_process_pixblock_tail
+.endm
+
+.macro pixman_composite_src_8888_8888_process_pixblock_tail_head
+ vst1.32 {d0, d1, d2, d3}, [DST_W, :128]!
+ vld1.32 {d0, d1, d2, d3}, [SRC]!
+ cache_preload 8, 8
+.endm
+
+generate_composite_function \
+ pixman_composite_src_8888_8888_asm_neon, 32, 0, 32, \
+ FLAG_DST_WRITEONLY, \
+ 8, /* number of pixels, processed in a single block */ \
+ 10, /* prefetch distance */ \
+ default_init, \
+ default_cleanup, \
+ pixman_composite_src_8888_8888_process_pixblock_head, \
+ pixman_composite_src_8888_8888_process_pixblock_tail, \
+ pixman_composite_src_8888_8888_process_pixblock_tail_head, \
+ 0, /* dst_w_basereg */ \
+ 0, /* dst_r_basereg */ \
+ 0, /* src_basereg */ \
+ 0 /* mask_basereg */
+
+/******************************************************************************/
+
+.macro pixman_composite_src_x888_8888_process_pixblock_head
+ vorr q0, q0, q2
+ vorr q1, q1, q2
+.endm
+
+.macro pixman_composite_src_x888_8888_process_pixblock_tail
+.endm
+
+.macro pixman_composite_src_x888_8888_process_pixblock_tail_head
+ vst1.32 {d0, d1, d2, d3}, [DST_W, :128]!
+ vld1.32 {d0, d1, d2, d3}, [SRC]!
+ vorr q0, q0, q2
+ vorr q1, q1, q2
+ cache_preload 8, 8
+.endm
+
+.macro pixman_composite_src_x888_8888_init
+ vmov.u8 q2, #0xFF
+ vshl.u32 q2, q2, #24
+.endm
+
+generate_composite_function \
+ pixman_composite_src_x888_8888_asm_neon, 32, 0, 32, \
+ FLAG_DST_WRITEONLY, \
+ 8, /* number of pixels, processed in a single block */ \
+ 10, /* prefetch distance */ \
+ pixman_composite_src_x888_8888_init, \
+ default_cleanup, \
+ pixman_composite_src_x888_8888_process_pixblock_head, \
+ pixman_composite_src_x888_8888_process_pixblock_tail, \
+ pixman_composite_src_x888_8888_process_pixblock_tail_head, \
+ 0, /* dst_w_basereg */ \
+ 0, /* dst_r_basereg */ \
+ 0, /* src_basereg */ \
+ 0 /* mask_basereg */
+
+/******************************************************************************/
+
+.macro pixman_composite_over_n_8_8888_process_pixblock_head
+ /* expecting deinterleaved source data in {d8, d9, d10, d11} */
+ /* d8 - blue, d9 - green, d10 - red, d11 - alpha */
+ /* and destination data in {d4, d5, d6, d7} */
+ /* mask is in d24 (d25, d26, d27 are unused) */
+
+ /* in */
+ vmull.u8 q0, d24, d8
+ vmull.u8 q1, d24, d9
+ vmull.u8 q6, d24, d10
+ vmull.u8 q7, d24, d11
+ vrshr.u16 q10, q0, #8
+ vrshr.u16 q11, q1, #8
+ vrshr.u16 q12, q6, #8
+ vrshr.u16 q13, q7, #8
+ vraddhn.u16 d0, q0, q10
+ vraddhn.u16 d1, q1, q11
+ vraddhn.u16 d2, q6, q12
+ vraddhn.u16 d3, q7, q13
+ vmvn.8 d24, d3 /* get inverted alpha */
+ /* source: d0 - blue, d1 - green, d2 - red, d3 - alpha */
+ /* destination: d4 - blue, d5 - green, d6 - red, d7 - alpha */
+ /* now do alpha blending */
+ vmull.u8 q8, d24, d4
+ vmull.u8 q9, d24, d5
+ vmull.u8 q10, d24, d6
+ vmull.u8 q11, d24, d7
+.endm
+
+.macro pixman_composite_over_n_8_8888_process_pixblock_tail
+ vrshr.u16 q14, q8, #8
+ vrshr.u16 q15, q9, #8
+ vrshr.u16 q12, q10, #8
+ vrshr.u16 q13, q11, #8
+ vraddhn.u16 d28, q14, q8
+ vraddhn.u16 d29, q15, q9
+ vraddhn.u16 d30, q12, q10
+ vraddhn.u16 d31, q13, q11
+ vqadd.u8 q14, q0, q14
+ vqadd.u8 q15, q1, q15
+.endm
+
+/* TODO: expand macros and do better instructions scheduling */
+.macro pixman_composite_over_n_8_8888_process_pixblock_tail_head
+ pixman_composite_over_n_8_8888_process_pixblock_tail
+ vst4.8 {d28, d29, d30, d31}, [DST_W, :128]!
+ vld4.8 {d4, d5, d6, d7}, [DST_R, :128]!
+ vld1.8 {d24}, [MASK]!
+ cache_preload 8, 8
+ pixman_composite_over_n_8_8888_process_pixblock_head
+.endm
+
+.macro pixman_composite_over_n_8_8888_init
+ add DUMMY, sp, #ARGS_STACK_OFFSET
+ vpush {d8-d15}
+ vld1.32 {d11[0]}, [DUMMY]
+ vdup.8 d8, d11[0]
+ vdup.8 d9, d11[1]
+ vdup.8 d10, d11[2]
+ vdup.8 d11, d11[3]
+.endm
+
+.macro pixman_composite_over_n_8_8888_cleanup
+ vpop {d8-d15}
+.endm
+
+generate_composite_function \
+ pixman_composite_over_n_8_8888_asm_neon, 0, 8, 32, \
+ FLAG_DST_READWRITE | FLAG_DEINTERLEAVE_32BPP, \
+ 8, /* number of pixels, processed in a single block */ \
+ 5, /* prefetch distance */ \
+ pixman_composite_over_n_8_8888_init, \
+ pixman_composite_over_n_8_8888_cleanup, \
+ pixman_composite_over_n_8_8888_process_pixblock_head, \
+ pixman_composite_over_n_8_8888_process_pixblock_tail, \
+ pixman_composite_over_n_8_8888_process_pixblock_tail_head
+
+/******************************************************************************/
+
+.macro pixman_composite_over_n_8888_8888_ca_process_pixblock_head
+ /*
+ * 'combine_mask_ca' replacement
+ *
+ * input: solid src (n) in {d8, d9, d10, d11}
+ * dest in {d4, d5, d6, d7 }
+ * mask in {d24, d25, d26, d27}
+ * output: updated src in {d0, d1, d2, d3 }
+ * updated mask in {d24, d25, d26, d3 }
+ */
+ vmull.u8 q0, d24, d8
+ vmull.u8 q1, d25, d9
+ vmull.u8 q6, d26, d10
+ vmull.u8 q7, d27, d11
+ vmull.u8 q9, d11, d25
+ vmull.u8 q12, d11, d24
+ vmull.u8 q13, d11, d26
+ vrshr.u16 q8, q0, #8
+ vrshr.u16 q10, q1, #8
+ vrshr.u16 q11, q6, #8
+ vraddhn.u16 d0, q0, q8
+ vraddhn.u16 d1, q1, q10
+ vraddhn.u16 d2, q6, q11
+ vrshr.u16 q11, q12, #8
+ vrshr.u16 q8, q9, #8
+ vrshr.u16 q6, q13, #8
+ vrshr.u16 q10, q7, #8
+ vraddhn.u16 d24, q12, q11
+ vraddhn.u16 d25, q9, q8
+ vraddhn.u16 d26, q13, q6
+ vraddhn.u16 d3, q7, q10
+ /*
+ * 'combine_over_ca' replacement
+ *
+ * output: updated dest in {d28, d29, d30, d31}
+ */
+ vmvn.8 d24, d24
+ vmvn.8 d25, d25
+ vmull.u8 q8, d24, d4
+ vmull.u8 q9, d25, d5
+ vmvn.8 d26, d26
+ vmvn.8 d27, d3
+ vmull.u8 q10, d26, d6
+ vmull.u8 q11, d27, d7
+.endm
+
+.macro pixman_composite_over_n_8888_8888_ca_process_pixblock_tail
+ /* ... continue 'combine_over_ca' replacement */
+ vrshr.u16 q14, q8, #8
+ vrshr.u16 q15, q9, #8
+ vrshr.u16 q6, q10, #8
+ vrshr.u16 q7, q11, #8
+ vraddhn.u16 d28, q14, q8
+ vraddhn.u16 d29, q15, q9
+ vraddhn.u16 d30, q6, q10
+ vraddhn.u16 d31, q7, q11
+ vqadd.u8 q14, q0, q14
+ vqadd.u8 q15, q1, q15
+.endm
+
+.macro pixman_composite_over_n_8888_8888_ca_process_pixblock_tail_head
+ vrshr.u16 q14, q8, #8
+ vrshr.u16 q15, q9, #8
+ vld4.8 {d4, d5, d6, d7}, [DST_R, :128]!
+ vrshr.u16 q6, q10, #8
+ vrshr.u16 q7, q11, #8
+ vraddhn.u16 d28, q14, q8
+ vraddhn.u16 d29, q15, q9
+ vraddhn.u16 d30, q6, q10
+ vraddhn.u16 d31, q7, q11
+ vld4.8 {d24, d25, d26, d27}, [MASK]!
+ vqadd.u8 q14, q0, q14
+ vqadd.u8 q15, q1, q15
+ cache_preload 8, 8
+ pixman_composite_over_n_8888_8888_ca_process_pixblock_head
+ vst4.8 {d28, d29, d30, d31}, [DST_W, :128]!
+.endm
+
+.macro pixman_composite_over_n_8888_8888_ca_init
+ add DUMMY, sp, #ARGS_STACK_OFFSET
+ vpush {d8-d15}
+ vld1.32 {d11[0]}, [DUMMY]
+ vdup.8 d8, d11[0]
+ vdup.8 d9, d11[1]
+ vdup.8 d10, d11[2]
+ vdup.8 d11, d11[3]
+.endm
+
+.macro pixman_composite_over_n_8888_8888_ca_cleanup
+ vpop {d8-d15}
+.endm
+
+generate_composite_function \
+ pixman_composite_over_n_8888_8888_ca_asm_neon, 0, 32, 32, \
+ FLAG_DST_READWRITE | FLAG_DEINTERLEAVE_32BPP, \
+ 8, /* number of pixels, processed in a single block */ \
+ 5, /* prefetch distance */ \
+ pixman_composite_over_n_8888_8888_ca_init, \
+ pixman_composite_over_n_8888_8888_ca_cleanup, \
+ pixman_composite_over_n_8888_8888_ca_process_pixblock_head, \
+ pixman_composite_over_n_8888_8888_ca_process_pixblock_tail, \
+ pixman_composite_over_n_8888_8888_ca_process_pixblock_tail_head
+
+/******************************************************************************/
+
+.macro pixman_composite_add_n_8_8_process_pixblock_head
+ /* expecting source data in {d8, d9, d10, d11} */
+ /* d8 - blue, d9 - green, d10 - red, d11 - alpha */
+ /* and destination data in {d4, d5, d6, d7} */
+ /* mask is in d24, d25, d26, d27 */
+ vmull.u8 q0, d24, d11
+ vmull.u8 q1, d25, d11
+ vmull.u8 q6, d26, d11
+ vmull.u8 q7, d27, d11
+ vrshr.u16 q10, q0, #8
+ vrshr.u16 q11, q1, #8
+ vrshr.u16 q12, q6, #8
+ vrshr.u16 q13, q7, #8
+ vraddhn.u16 d0, q0, q10
+ vraddhn.u16 d1, q1, q11
+ vraddhn.u16 d2, q6, q12
+ vraddhn.u16 d3, q7, q13
+ vqadd.u8 q14, q0, q2
+ vqadd.u8 q15, q1, q3
+.endm
+
+.macro pixman_composite_add_n_8_8_process_pixblock_tail
+.endm
+
+/* TODO: expand macros and do better instructions scheduling */
+.macro pixman_composite_add_n_8_8_process_pixblock_tail_head
+ pixman_composite_add_n_8_8_process_pixblock_tail
+ vst1.8 {d28, d29, d30, d31}, [DST_W, :128]!
+ vld1.8 {d4, d5, d6, d7}, [DST_R, :128]!
+ vld1.8 {d24, d25, d26, d27}, [MASK]!
+ cache_preload 32, 32
+ pixman_composite_add_n_8_8_process_pixblock_head
+.endm
+
+.macro pixman_composite_add_n_8_8_init
+ add DUMMY, sp, #ARGS_STACK_OFFSET
+ vpush {d8-d15}
+ vld1.32 {d11[0]}, [DUMMY]
+ vdup.8 d11, d11[3]
+.endm
+
+.macro pixman_composite_add_n_8_8_cleanup
+ vpop {d8-d15}
+.endm
+
+generate_composite_function \
+ pixman_composite_add_n_8_8_asm_neon, 0, 8, 8, \
+ FLAG_DST_READWRITE, \
+ 32, /* number of pixels, processed in a single block */ \
+ 5, /* prefetch distance */ \
+ pixman_composite_add_n_8_8_init, \
+ pixman_composite_add_n_8_8_cleanup, \
+ pixman_composite_add_n_8_8_process_pixblock_head, \
+ pixman_composite_add_n_8_8_process_pixblock_tail, \
+ pixman_composite_add_n_8_8_process_pixblock_tail_head
+
+/******************************************************************************/
+
+.macro pixman_composite_add_8_8_8_process_pixblock_head
+ /* expecting source data in {d0, d1, d2, d3} */
+ /* destination data in {d4, d5, d6, d7} */
+ /* mask in {d24, d25, d26, d27} */
+ vmull.u8 q8, d24, d0
+ vmull.u8 q9, d25, d1
+ vmull.u8 q10, d26, d2
+ vmull.u8 q11, d27, d3
+ vrshr.u16 q0, q8, #8
+ vrshr.u16 q1, q9, #8
+ vrshr.u16 q12, q10, #8
+ vrshr.u16 q13, q11, #8
+ vraddhn.u16 d0, q0, q8
+ vraddhn.u16 d1, q1, q9
+ vraddhn.u16 d2, q12, q10
+ vraddhn.u16 d3, q13, q11
+ vqadd.u8 q14, q0, q2
+ vqadd.u8 q15, q1, q3
+.endm
+
+.macro pixman_composite_add_8_8_8_process_pixblock_tail
+.endm
+
+/* TODO: expand macros and do better instructions scheduling */
+.macro pixman_composite_add_8_8_8_process_pixblock_tail_head
+ pixman_composite_add_8_8_8_process_pixblock_tail
+ vst1.8 {d28, d29, d30, d31}, [DST_W, :128]!
+ vld1.8 {d4, d5, d6, d7}, [DST_R, :128]!
+ vld1.8 {d24, d25, d26, d27}, [MASK]!
+ vld1.8 {d0, d1, d2, d3}, [SRC]!
+ cache_preload 32, 32
+ pixman_composite_add_8_8_8_process_pixblock_head
+.endm
+
+.macro pixman_composite_add_8_8_8_init
+.endm
+
+.macro pixman_composite_add_8_8_8_cleanup
+.endm
+
+generate_composite_function \
+ pixman_composite_add_8_8_8_asm_neon, 8, 8, 8, \
+ FLAG_DST_READWRITE, \
+ 32, /* number of pixels, processed in a single block */ \
+ 5, /* prefetch distance */ \
+ pixman_composite_add_8_8_8_init, \
+ pixman_composite_add_8_8_8_cleanup, \
+ pixman_composite_add_8_8_8_process_pixblock_head, \
+ pixman_composite_add_8_8_8_process_pixblock_tail, \
+ pixman_composite_add_8_8_8_process_pixblock_tail_head
+
+/******************************************************************************/
+
+.macro pixman_composite_add_8888_8888_8888_process_pixblock_head
+ /* expecting source data in {d0, d1, d2, d3} */
+ /* destination data in {d4, d5, d6, d7} */
+ /* mask in {d24, d25, d26, d27} */
+ vmull.u8 q8, d27, d0
+ vmull.u8 q9, d27, d1
+ vmull.u8 q10, d27, d2
+ vmull.u8 q11, d27, d3
+ vrshr.u16 q0, q8, #8
+ vrshr.u16 q1, q9, #8
+ vrshr.u16 q12, q10, #8
+ vrshr.u16 q13, q11, #8
+ vraddhn.u16 d0, q0, q8
+ vraddhn.u16 d1, q1, q9
+ vraddhn.u16 d2, q12, q10
+ vraddhn.u16 d3, q13, q11
+ vqadd.u8 q14, q0, q2
+ vqadd.u8 q15, q1, q3
+.endm
+
+.macro pixman_composite_add_8888_8888_8888_process_pixblock_tail
+.endm
+
+/* TODO: expand macros and do better instructions scheduling */
+.macro pixman_composite_add_8888_8888_8888_process_pixblock_tail_head
+ pixman_composite_add_8888_8888_8888_process_pixblock_tail
+ vst4.8 {d28, d29, d30, d31}, [DST_W, :128]!
+ vld4.8 {d4, d5, d6, d7}, [DST_R, :128]!
+ vld4.8 {d24, d25, d26, d27}, [MASK]!
+ vld4.8 {d0, d1, d2, d3}, [SRC]!
+ cache_preload 8, 8
+ pixman_composite_add_8888_8888_8888_process_pixblock_head
+.endm
+
+generate_composite_function \
+ pixman_composite_add_8888_8888_8888_asm_neon, 32, 32, 32, \
+ FLAG_DST_READWRITE | FLAG_DEINTERLEAVE_32BPP, \
+ 8, /* number of pixels, processed in a single block */ \
+ 10, /* prefetch distance */ \
+ default_init, \
+ default_cleanup, \
+ pixman_composite_add_8888_8888_8888_process_pixblock_head, \
+ pixman_composite_add_8888_8888_8888_process_pixblock_tail, \
+ pixman_composite_add_8888_8888_8888_process_pixblock_tail_head
+
+generate_composite_function_single_scanline \
+ pixman_composite_scanline_add_mask_asm_neon, 32, 32, 32, \
+ FLAG_DST_READWRITE | FLAG_DEINTERLEAVE_32BPP, \
+ 8, /* number of pixels, processed in a single block */ \
+ default_init, \
+ default_cleanup, \
+ pixman_composite_add_8888_8888_8888_process_pixblock_head, \
+ pixman_composite_add_8888_8888_8888_process_pixblock_tail, \
+ pixman_composite_add_8888_8888_8888_process_pixblock_tail_head
+
+/******************************************************************************/
+
+.macro pixman_composite_over_8888_n_8888_process_pixblock_head
+ /* expecting source data in {d0, d1, d2, d3} */
+ /* destination data in {d4, d5, d6, d7} */
+ /* solid mask is in d15 */
+
+ /* 'in' */
+ vmull.u8 q8, d15, d3
+ vmull.u8 q6, d15, d2
+ vmull.u8 q5, d15, d1
+ vmull.u8 q4, d15, d0
+ vrshr.u16 q13, q8, #8
+ vrshr.u16 q12, q6, #8
+ vrshr.u16 q11, q5, #8
+ vrshr.u16 q10, q4, #8
+ vraddhn.u16 d3, q8, q13
+ vraddhn.u16 d2, q6, q12
+ vraddhn.u16 d1, q5, q11
+ vraddhn.u16 d0, q4, q10
+ vmvn.8 d24, d3 /* get inverted alpha */
+ /* now do alpha blending */
+ vmull.u8 q8, d24, d4
+ vmull.u8 q9, d24, d5
+ vmull.u8 q10, d24, d6
+ vmull.u8 q11, d24, d7
+.endm
+
+.macro pixman_composite_over_8888_n_8888_process_pixblock_tail
+ vrshr.u16 q14, q8, #8
+ vrshr.u16 q15, q9, #8
+ vrshr.u16 q12, q10, #8
+ vrshr.u16 q13, q11, #8
+ vraddhn.u16 d28, q14, q8
+ vraddhn.u16 d29, q15, q9
+ vraddhn.u16 d30, q12, q10
+ vraddhn.u16 d31, q13, q11
+ vqadd.u8 q14, q0, q14
+ vqadd.u8 q15, q1, q15
+.endm
+
+/* TODO: expand macros and do better instructions scheduling */
+.macro pixman_composite_over_8888_n_8888_process_pixblock_tail_head
+ vld4.8 {d4, d5, d6, d7}, [DST_R, :128]!
+ pixman_composite_over_8888_n_8888_process_pixblock_tail
+ vld4.8 {d0, d1, d2, d3}, [SRC]!
+ cache_preload 8, 8
+ pixman_composite_over_8888_n_8888_process_pixblock_head
+ vst4.8 {d28, d29, d30, d31}, [DST_W, :128]!
+.endm
+
+.macro pixman_composite_over_8888_n_8888_init
+ add DUMMY, sp, #48
+ vpush {d8-d15}
+ vld1.32 {d15[0]}, [DUMMY]
+ vdup.8 d15, d15[3]
+.endm
+
+.macro pixman_composite_over_8888_n_8888_cleanup
+ vpop {d8-d15}
+.endm
+
+generate_composite_function \
+ pixman_composite_over_8888_n_8888_asm_neon, 32, 0, 32, \
+ FLAG_DST_READWRITE | FLAG_DEINTERLEAVE_32BPP, \
+ 8, /* number of pixels, processed in a single block */ \
+ 5, /* prefetch distance */ \
+ pixman_composite_over_8888_n_8888_init, \
+ pixman_composite_over_8888_n_8888_cleanup, \
+ pixman_composite_over_8888_n_8888_process_pixblock_head, \
+ pixman_composite_over_8888_n_8888_process_pixblock_tail, \
+ pixman_composite_over_8888_n_8888_process_pixblock_tail_head
+
+/******************************************************************************/
+
+/* TODO: expand macros and do better instructions scheduling */
+.macro pixman_composite_over_8888_8888_8888_process_pixblock_tail_head
+ vld4.8 {d4, d5, d6, d7}, [DST_R, :128]!
+ pixman_composite_over_8888_n_8888_process_pixblock_tail
+ vld4.8 {d0, d1, d2, d3}, [SRC]!
+ cache_preload 8, 8
+ vld4.8 {d12, d13, d14, d15}, [MASK]!
+ pixman_composite_over_8888_n_8888_process_pixblock_head
+ vst4.8 {d28, d29, d30, d31}, [DST_W, :128]!
+.endm
+
+.macro pixman_composite_over_8888_8888_8888_init
+ vpush {d8-d15}
+.endm
+
+.macro pixman_composite_over_8888_8888_8888_cleanup
+ vpop {d8-d15}
+.endm
+
+generate_composite_function \
+ pixman_composite_over_8888_8888_8888_asm_neon, 32, 32, 32, \
+ FLAG_DST_READWRITE | FLAG_DEINTERLEAVE_32BPP, \
+ 8, /* number of pixels, processed in a single block */ \
+ 5, /* prefetch distance */ \
+ pixman_composite_over_8888_8888_8888_init, \
+ pixman_composite_over_8888_8888_8888_cleanup, \
+ pixman_composite_over_8888_n_8888_process_pixblock_head, \
+ pixman_composite_over_8888_n_8888_process_pixblock_tail, \
+ pixman_composite_over_8888_8888_8888_process_pixblock_tail_head \
+ 28, /* dst_w_basereg */ \
+ 4, /* dst_r_basereg */ \
+ 0, /* src_basereg */ \
+ 12 /* mask_basereg */
+
+generate_composite_function_single_scanline \
+ pixman_composite_scanline_over_mask_asm_neon, 32, 32, 32, \
+ FLAG_DST_READWRITE | FLAG_DEINTERLEAVE_32BPP, \
+ 8, /* number of pixels, processed in a single block */ \
+ pixman_composite_over_8888_8888_8888_init, \
+ pixman_composite_over_8888_8888_8888_cleanup, \
+ pixman_composite_over_8888_n_8888_process_pixblock_head, \
+ pixman_composite_over_8888_n_8888_process_pixblock_tail, \
+ pixman_composite_over_8888_8888_8888_process_pixblock_tail_head \
+ 28, /* dst_w_basereg */ \
+ 4, /* dst_r_basereg */ \
+ 0, /* src_basereg */ \
+ 12 /* mask_basereg */
+
+/******************************************************************************/
+
+/* TODO: expand macros and do better instructions scheduling */
+.macro pixman_composite_over_8888_8_8888_process_pixblock_tail_head
+ vld4.8 {d4, d5, d6, d7}, [DST_R, :128]!
+ pixman_composite_over_8888_n_8888_process_pixblock_tail
+ vld4.8 {d0, d1, d2, d3}, [SRC]!
+ cache_preload 8, 8
+ vld1.8 {d15}, [MASK]!
+ pixman_composite_over_8888_n_8888_process_pixblock_head
+ vst4.8 {d28, d29, d30, d31}, [DST_W, :128]!
+.endm
+
+.macro pixman_composite_over_8888_8_8888_init
+ vpush {d8-d15}
+.endm
+
+.macro pixman_composite_over_8888_8_8888_cleanup
+ vpop {d8-d15}
+.endm
+
+generate_composite_function \
+ pixman_composite_over_8888_8_8888_asm_neon, 32, 8, 32, \
+ FLAG_DST_READWRITE | FLAG_DEINTERLEAVE_32BPP, \
+ 8, /* number of pixels, processed in a single block */ \
+ 5, /* prefetch distance */ \
+ pixman_composite_over_8888_8_8888_init, \
+ pixman_composite_over_8888_8_8888_cleanup, \
+ pixman_composite_over_8888_n_8888_process_pixblock_head, \
+ pixman_composite_over_8888_n_8888_process_pixblock_tail, \
+ pixman_composite_over_8888_8_8888_process_pixblock_tail_head \
+ 28, /* dst_w_basereg */ \
+ 4, /* dst_r_basereg */ \
+ 0, /* src_basereg */ \
+ 15 /* mask_basereg */
+
+/******************************************************************************/
+
+.macro pixman_composite_src_0888_0888_process_pixblock_head
+.endm
+
+.macro pixman_composite_src_0888_0888_process_pixblock_tail
+.endm
+
+.macro pixman_composite_src_0888_0888_process_pixblock_tail_head
+ vst3.8 {d0, d1, d2}, [DST_W]!
+ vld3.8 {d0, d1, d2}, [SRC]!
+ cache_preload 8, 8
+.endm
+
+generate_composite_function \
+ pixman_composite_src_0888_0888_asm_neon, 24, 0, 24, \
+ FLAG_DST_WRITEONLY, \
+ 8, /* number of pixels, processed in a single block */ \
+ 10, /* prefetch distance */ \
+ default_init, \
+ default_cleanup, \
+ pixman_composite_src_0888_0888_process_pixblock_head, \
+ pixman_composite_src_0888_0888_process_pixblock_tail, \
+ pixman_composite_src_0888_0888_process_pixblock_tail_head, \
+ 0, /* dst_w_basereg */ \
+ 0, /* dst_r_basereg */ \
+ 0, /* src_basereg */ \
+ 0 /* mask_basereg */
+
+/******************************************************************************/
+
+.macro pixman_composite_src_0888_8888_rev_process_pixblock_head
+ vswp d0, d2
+.endm
+
+.macro pixman_composite_src_0888_8888_rev_process_pixblock_tail
+.endm
+
+.macro pixman_composite_src_0888_8888_rev_process_pixblock_tail_head
+ vst4.8 {d0, d1, d2, d3}, [DST_W]!
+ vld3.8 {d0, d1, d2}, [SRC]!
+ vswp d0, d2
+ cache_preload 8, 8
+.endm
+
+.macro pixman_composite_src_0888_8888_rev_init
+ veor d3, d3, d3
+.endm
+
+generate_composite_function \
+ pixman_composite_src_0888_8888_rev_asm_neon, 24, 0, 32, \
+ FLAG_DST_WRITEONLY | FLAG_DEINTERLEAVE_32BPP, \
+ 8, /* number of pixels, processed in a single block */ \
+ 10, /* prefetch distance */ \
+ pixman_composite_src_0888_8888_rev_init, \
+ default_cleanup, \
+ pixman_composite_src_0888_8888_rev_process_pixblock_head, \
+ pixman_composite_src_0888_8888_rev_process_pixblock_tail, \
+ pixman_composite_src_0888_8888_rev_process_pixblock_tail_head, \
+ 0, /* dst_w_basereg */ \
+ 0, /* dst_r_basereg */ \
+ 0, /* src_basereg */ \
+ 0 /* mask_basereg */
+
+/******************************************************************************/
+
+.macro pixman_composite_src_0888_0565_rev_process_pixblock_head
+ vshll.u8 q8, d1, #8
+ vshll.u8 q9, d2, #8
+.endm
+
+.macro pixman_composite_src_0888_0565_rev_process_pixblock_tail
+ vshll.u8 q14, d0, #8
+ vsri.u16 q14, q8, #5
+ vsri.u16 q14, q9, #11
+.endm
+
+.macro pixman_composite_src_0888_0565_rev_process_pixblock_tail_head
+ vshll.u8 q14, d0, #8
+ vld3.8 {d0, d1, d2}, [SRC]!
+ vsri.u16 q14, q8, #5
+ vsri.u16 q14, q9, #11
+ vshll.u8 q8, d1, #8
+ vst1.16 {d28, d29}, [DST_W, :128]!
+ vshll.u8 q9, d2, #8
+.endm
+
+generate_composite_function \
+ pixman_composite_src_0888_0565_rev_asm_neon, 24, 0, 16, \
+ FLAG_DST_WRITEONLY, \
+ 8, /* number of pixels, processed in a single block */ \
+ 10, /* prefetch distance */ \
+ default_init, \
+ default_cleanup, \
+ pixman_composite_src_0888_0565_rev_process_pixblock_head, \
+ pixman_composite_src_0888_0565_rev_process_pixblock_tail, \
+ pixman_composite_src_0888_0565_rev_process_pixblock_tail_head, \
+ 28, /* dst_w_basereg */ \
+ 0, /* dst_r_basereg */ \
+ 0, /* src_basereg */ \
+ 0 /* mask_basereg */
+
+/******************************************************************************/
+
+.macro pixman_composite_src_pixbuf_8888_process_pixblock_head
+ vmull.u8 q8, d3, d0
+ vmull.u8 q9, d3, d1
+ vmull.u8 q10, d3, d2
+.endm
+
+.macro pixman_composite_src_pixbuf_8888_process_pixblock_tail
+ vrshr.u16 q11, q8, #8
+ vswp d3, d31
+ vrshr.u16 q12, q9, #8
+ vrshr.u16 q13, q10, #8
+ vraddhn.u16 d30, q11, q8
+ vraddhn.u16 d29, q12, q9
+ vraddhn.u16 d28, q13, q10
+.endm
+
+.macro pixman_composite_src_pixbuf_8888_process_pixblock_tail_head
+ vrshr.u16 q11, q8, #8
+ vswp d3, d31
+ vrshr.u16 q12, q9, #8
+ vrshr.u16 q13, q10, #8
+ vld4.8 {d0, d1, d2, d3}, [SRC]!
+ vraddhn.u16 d30, q11, q8
+ PF add PF_X, PF_X, #8
+ PF tst PF_CTL, #0xF
+ PF addne PF_X, PF_X, #8
+ PF subne PF_CTL, PF_CTL, #1
+ vraddhn.u16 d29, q12, q9
+ vraddhn.u16 d28, q13, q10
+ vmull.u8 q8, d3, d0
+ vmull.u8 q9, d3, d1
+ vmull.u8 q10, d3, d2
+ vst4.8 {d28, d29, d30, d31}, [DST_W, :128]!
+ PF cmp PF_X, ORIG_W
+ PF pld, [PF_SRC, PF_X, lsl #src_bpp_shift]
+ PF subge PF_X, PF_X, ORIG_W
+ PF subges PF_CTL, PF_CTL, #0x10
+ PF ldrgeb DUMMY, [PF_SRC, SRC_STRIDE, lsl #src_bpp_shift]!
+.endm
+
+generate_composite_function \
+ pixman_composite_src_pixbuf_8888_asm_neon, 32, 0, 32, \
+ FLAG_DST_WRITEONLY | FLAG_DEINTERLEAVE_32BPP, \
+ 8, /* number of pixels, processed in a single block */ \
+ 10, /* prefetch distance */ \
+ default_init, \
+ default_cleanup, \
+ pixman_composite_src_pixbuf_8888_process_pixblock_head, \
+ pixman_composite_src_pixbuf_8888_process_pixblock_tail, \
+ pixman_composite_src_pixbuf_8888_process_pixblock_tail_head, \
+ 28, /* dst_w_basereg */ \
+ 0, /* dst_r_basereg */ \
+ 0, /* src_basereg */ \
+ 0 /* mask_basereg */
diff --git a/src/3rdparty/pixman/pixman-arm-neon-asm.h b/src/3rdparty/pixman/pixman-arm-neon-asm.h
new file mode 100644
index 0000000000..56c3faebf9
--- /dev/null
+++ b/src/3rdparty/pixman/pixman-arm-neon-asm.h
@@ -0,0 +1,906 @@
+/*
+ * Copyright © 2009 Nokia Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ * Author: Siarhei Siamashka (siarhei.siamashka@nokia.com)
+ */
+
+/*
+ * This file contains a macro ('generate_composite_function') which can
+ * construct 2D image processing functions, based on a common template.
+ * Any combinations of source, destination and mask images with 8bpp,
+ * 16bpp, 24bpp, 32bpp color formats are supported.
+ *
+ * This macro takes care of:
+ * - handling of leading and trailing unaligned pixels
+ * - doing most of the work related to L2 cache preload
+ * - encourages the use of software pipelining for better instructions
+ * scheduling
+ *
+ * The user of this macro has to provide some configuration parameters
+ * (bit depths for the images, prefetch distance, etc.) and a set of
+ * macros, which should implement basic code chunks responsible for
+ * pixels processing. See 'pixman-arm-neon-asm.S' file for the usage
+ * examples.
+ *
+ * TODO:
+ * - try overlapped pixel method (from Ian Rickards) when processing
+ * exactly two blocks of pixels
+ * - maybe add an option to do reverse scanline processing
+ */
+
+/*
+ * Bit flags for 'generate_composite_function' macro which are used
+ * to tune generated functions behavior.
+ */
+.set FLAG_DST_WRITEONLY, 0
+.set FLAG_DST_READWRITE, 1
+.set FLAG_DEINTERLEAVE_32BPP, 2
+
+/*
+ * Offset in stack where mask and source pointer/stride can be accessed
+ * from 'init' macro. This is useful for doing special handling for solid mask.
+ */
+.set ARGS_STACK_OFFSET, 40
+
+/*
+ * Constants for selecting preferable prefetch type.
+ */
+.set PREFETCH_TYPE_NONE, 0 /* No prefetch at all */
+.set PREFETCH_TYPE_SIMPLE, 1 /* A simple, fixed-distance-ahead prefetch */
+.set PREFETCH_TYPE_ADVANCED, 2 /* Advanced fine-grained prefetch */
+
+/*
+ * Definitions of supplementary pixld/pixst macros (for partial load/store of
+ * pixel data).
+ */
+
+.macro pixldst1 op, elem_size, reg1, mem_operand, abits
+.if abits > 0
+ op&.&elem_size {d&reg1}, [&mem_operand&, :&abits&]!
+.else
+ op&.&elem_size {d&reg1}, [&mem_operand&]!
+.endif
+.endm
+
+.macro pixldst2 op, elem_size, reg1, reg2, mem_operand, abits
+.if abits > 0
+ op&.&elem_size {d&reg1, d&reg2}, [&mem_operand&, :&abits&]!
+.else
+ op&.&elem_size {d&reg1, d&reg2}, [&mem_operand&]!
+.endif
+.endm
+
+.macro pixldst4 op, elem_size, reg1, reg2, reg3, reg4, mem_operand, abits
+.if abits > 0
+ op&.&elem_size {d&reg1, d&reg2, d&reg3, d&reg4}, [&mem_operand&, :&abits&]!
+.else
+ op&.&elem_size {d&reg1, d&reg2, d&reg3, d&reg4}, [&mem_operand&]!
+.endif
+.endm
+
+.macro pixldst0 op, elem_size, reg1, idx, mem_operand, abits
+ op&.&elem_size {d&reg1[idx]}, [&mem_operand&]!
+.endm
+
+.macro pixldst3 op, elem_size, reg1, reg2, reg3, mem_operand
+ op&.&elem_size {d&reg1, d&reg2, d&reg3}, [&mem_operand&]!
+.endm
+
+.macro pixldst30 op, elem_size, reg1, reg2, reg3, idx, mem_operand
+ op&.&elem_size {d&reg1[idx], d&reg2[idx], d&reg3[idx]}, [&mem_operand&]!
+.endm
+
+.macro pixldst numbytes, op, elem_size, basereg, mem_operand, abits
+.if numbytes == 32
+ pixldst4 op, elem_size, %(basereg+4), %(basereg+5), \
+ %(basereg+6), %(basereg+7), mem_operand, abits
+.elseif numbytes == 16
+ pixldst2 op, elem_size, %(basereg+2), %(basereg+3), mem_operand, abits
+.elseif numbytes == 8
+ pixldst1 op, elem_size, %(basereg+1), mem_operand, abits
+.elseif numbytes == 4
+ .if !RESPECT_STRICT_ALIGNMENT || (elem_size == 32)
+ pixldst0 op, 32, %(basereg+0), 1, mem_operand, abits
+ .elseif elem_size == 16
+ pixldst0 op, 16, %(basereg+0), 2, mem_operand, abits
+ pixldst0 op, 16, %(basereg+0), 3, mem_operand, abits
+ .else
+ pixldst0 op, 8, %(basereg+0), 4, mem_operand, abits
+ pixldst0 op, 8, %(basereg+0), 5, mem_operand, abits
+ pixldst0 op, 8, %(basereg+0), 6, mem_operand, abits
+ pixldst0 op, 8, %(basereg+0), 7, mem_operand, abits
+ .endif
+.elseif numbytes == 2
+ .if !RESPECT_STRICT_ALIGNMENT || (elem_size == 16)
+ pixldst0 op, 16, %(basereg+0), 1, mem_operand, abits
+ .else
+ pixldst0 op, 8, %(basereg+0), 2, mem_operand, abits
+ pixldst0 op, 8, %(basereg+0), 3, mem_operand, abits
+ .endif
+.elseif numbytes == 1
+ pixldst0 op, 8, %(basereg+0), 1, mem_operand, abits
+.else
+ .error "unsupported size: numbytes"
+.endif
+.endm
+
+.macro pixld numpix, bpp, basereg, mem_operand, abits=0
+.if bpp > 0
+.if (bpp == 32) && (numpix == 8) && (DEINTERLEAVE_32BPP_ENABLED != 0)
+ pixldst4 vld4, 8, %(basereg+4), %(basereg+5), \
+ %(basereg+6), %(basereg+7), mem_operand, abits
+.elseif (bpp == 24) && (numpix == 8)
+ pixldst3 vld3, 8, %(basereg+3), %(basereg+4), %(basereg+5), mem_operand
+.elseif (bpp == 24) && (numpix == 4)
+ pixldst30 vld3, 8, %(basereg+0), %(basereg+1), %(basereg+2), 4, mem_operand
+ pixldst30 vld3, 8, %(basereg+0), %(basereg+1), %(basereg+2), 5, mem_operand
+ pixldst30 vld3, 8, %(basereg+0), %(basereg+1), %(basereg+2), 6, mem_operand
+ pixldst30 vld3, 8, %(basereg+0), %(basereg+1), %(basereg+2), 7, mem_operand
+.elseif (bpp == 24) && (numpix == 2)
+ pixldst30 vld3, 8, %(basereg+0), %(basereg+1), %(basereg+2), 2, mem_operand
+ pixldst30 vld3, 8, %(basereg+0), %(basereg+1), %(basereg+2), 3, mem_operand
+.elseif (bpp == 24) && (numpix == 1)
+ pixldst30 vld3, 8, %(basereg+0), %(basereg+1), %(basereg+2), 1, mem_operand
+.else
+ pixldst %(numpix * bpp / 8), vld1, %(bpp), basereg, mem_operand, abits
+.endif
+.endif
+.endm
+
+.macro pixst numpix, bpp, basereg, mem_operand, abits=0
+.if bpp > 0
+.if (bpp == 32) && (numpix == 8) && (DEINTERLEAVE_32BPP_ENABLED != 0)
+ pixldst4 vst4, 8, %(basereg+4), %(basereg+5), \
+ %(basereg+6), %(basereg+7), mem_operand, abits
+.elseif (bpp == 24) && (numpix == 8)
+ pixldst3 vst3, 8, %(basereg+3), %(basereg+4), %(basereg+5), mem_operand
+.elseif (bpp == 24) && (numpix == 4)
+ pixldst30 vst3, 8, %(basereg+0), %(basereg+1), %(basereg+2), 4, mem_operand
+ pixldst30 vst3, 8, %(basereg+0), %(basereg+1), %(basereg+2), 5, mem_operand
+ pixldst30 vst3, 8, %(basereg+0), %(basereg+1), %(basereg+2), 6, mem_operand
+ pixldst30 vst3, 8, %(basereg+0), %(basereg+1), %(basereg+2), 7, mem_operand
+.elseif (bpp == 24) && (numpix == 2)
+ pixldst30 vst3, 8, %(basereg+0), %(basereg+1), %(basereg+2), 2, mem_operand
+ pixldst30 vst3, 8, %(basereg+0), %(basereg+1), %(basereg+2), 3, mem_operand
+.elseif (bpp == 24) && (numpix == 1)
+ pixldst30 vst3, 8, %(basereg+0), %(basereg+1), %(basereg+2), 1, mem_operand
+.else
+ pixldst %(numpix * bpp / 8), vst1, %(bpp), basereg, mem_operand, abits
+.endif
+.endif
+.endm
+
+.macro pixld_a numpix, bpp, basereg, mem_operand
+.if (bpp * numpix) <= 128
+ pixld numpix, bpp, basereg, mem_operand, %(bpp * numpix)
+.else
+ pixld numpix, bpp, basereg, mem_operand, 128
+.endif
+.endm
+
+.macro pixst_a numpix, bpp, basereg, mem_operand
+.if (bpp * numpix) <= 128
+ pixst numpix, bpp, basereg, mem_operand, %(bpp * numpix)
+.else
+ pixst numpix, bpp, basereg, mem_operand, 128
+.endif
+.endm
+
+.macro vuzp8 reg1, reg2
+ vuzp.8 d&reg1, d&reg2
+.endm
+
+.macro vzip8 reg1, reg2
+ vzip.8 d&reg1, d&reg2
+.endm
+
+/* deinterleave B, G, R, A channels for eight 32bpp pixels in 4 registers */
+.macro pixdeinterleave bpp, basereg
+.if (bpp == 32) && (DEINTERLEAVE_32BPP_ENABLED != 0)
+ vuzp8 %(basereg+0), %(basereg+1)
+ vuzp8 %(basereg+2), %(basereg+3)
+ vuzp8 %(basereg+1), %(basereg+3)
+ vuzp8 %(basereg+0), %(basereg+2)
+.endif
+.endm
+
+/* interleave B, G, R, A channels for eight 32bpp pixels in 4 registers */
+.macro pixinterleave bpp, basereg
+.if (bpp == 32) && (DEINTERLEAVE_32BPP_ENABLED != 0)
+ vzip8 %(basereg+0), %(basereg+2)
+ vzip8 %(basereg+1), %(basereg+3)
+ vzip8 %(basereg+2), %(basereg+3)
+ vzip8 %(basereg+0), %(basereg+1)
+.endif
+.endm
+
+/*
+ * This is a macro for implementing cache preload. The main idea is that
+ * cache preload logic is mostly independent from the rest of pixels
+ * processing code. It starts at the top left pixel and moves forward
+ * across pixels and can jump across scanlines. Prefetch distance is
+ * handled in an 'incremental' way: it starts from 0 and advances to the
+ * optimal distance over time. After reaching optimal prefetch distance,
+ * it is kept constant. There are some checks which prevent prefetching
+ * unneeded pixel lines below the image (but it still can prefetch a bit
+ * more data on the right side of the image - not a big issue and may
+ * be actually helpful when rendering text glyphs). Additional trick is
+ * the use of LDR instruction for prefetch instead of PLD when moving to
+ * the next line, the point is that we have a high chance of getting TLB
+ * miss in this case, and PLD would be useless.
+ *
+ * This sounds like it may introduce a noticeable overhead (when working with
+ * fully cached data). But in reality, due to having a separate pipeline and
+ * instruction queue for NEON unit in ARM Cortex-A8, normal ARM code can
+ * execute simultaneously with NEON and be completely shadowed by it. Thus
+ * we get no performance overhead at all (*). This looks like a very nice
+ * feature of Cortex-A8, if used wisely. We don't have a hardware prefetcher,
+ * but still can implement some rather advanced prefetch logic in sofware
+ * for almost zero cost!
+ *
+ * (*) The overhead of the prefetcher is visible when running some trivial
+ * pixels processing like simple copy. Anyway, having prefetch is a must
+ * when working with the graphics data.
+ */
+.macro PF a, x:vararg
+.if (PREFETCH_TYPE_CURRENT == PREFETCH_TYPE_ADVANCED)
+ a x
+.endif
+.endm
+
+.macro cache_preload std_increment, boost_increment
+.if (src_bpp_shift >= 0) || (dst_r_bpp != 0) || (mask_bpp_shift >= 0)
+.if regs_shortage
+ PF ldr ORIG_W, [sp] /* If we are short on regs, ORIG_W is kept on stack */
+.endif
+.if std_increment != 0
+ PF add PF_X, PF_X, #std_increment
+.endif
+ PF tst PF_CTL, #0xF
+ PF addne PF_X, PF_X, #boost_increment
+ PF subne PF_CTL, PF_CTL, #1
+ PF cmp PF_X, ORIG_W
+.if src_bpp_shift >= 0
+ PF pld, [PF_SRC, PF_X, lsl #src_bpp_shift]
+.endif
+.if dst_r_bpp != 0
+ PF pld, [PF_DST, PF_X, lsl #dst_bpp_shift]
+.endif
+.if mask_bpp_shift >= 0
+ PF pld, [PF_MASK, PF_X, lsl #mask_bpp_shift]
+.endif
+ PF subge PF_X, PF_X, ORIG_W
+ PF subges PF_CTL, PF_CTL, #0x10
+.if src_bpp_shift >= 0
+ PF ldrgeb DUMMY, [PF_SRC, SRC_STRIDE, lsl #src_bpp_shift]!
+.endif
+.if dst_r_bpp != 0
+ PF ldrgeb DUMMY, [PF_DST, DST_STRIDE, lsl #dst_bpp_shift]!
+.endif
+.if mask_bpp_shift >= 0
+ PF ldrgeb DUMMY, [PF_MASK, MASK_STRIDE, lsl #mask_bpp_shift]!
+.endif
+.endif
+.endm
+
+.macro cache_preload_simple
+.if (PREFETCH_TYPE_CURRENT == PREFETCH_TYPE_SIMPLE)
+.if src_bpp > 0
+ pld [SRC, #(PREFETCH_DISTANCE_SIMPLE * src_bpp / 8)]
+.endif
+.if dst_r_bpp > 0
+ pld [DST_R, #(PREFETCH_DISTANCE_SIMPLE * dst_r_bpp / 8)]
+.endif
+.if mask_bpp > 0
+ pld [MASK, #(PREFETCH_DISTANCE_SIMPLE * mask_bpp / 8)]
+.endif
+.endif
+.endm
+
+/*
+ * Macro which is used to process leading pixels until destination
+ * pointer is properly aligned (at 16 bytes boundary). When destination
+ * buffer uses 16bpp format, this is unnecessary, or even pointless.
+ */
+.macro ensure_destination_ptr_alignment process_pixblock_head, \
+ process_pixblock_tail, \
+ process_pixblock_tail_head
+.if dst_w_bpp != 24
+ tst DST_R, #0xF
+ beq 2f
+
+.irp lowbit, 1, 2, 4, 8, 16
+local skip1
+.if (dst_w_bpp <= (lowbit * 8)) && ((lowbit * 8) < (pixblock_size * dst_w_bpp))
+.if lowbit < 16 /* we don't need more than 16-byte alignment */
+ tst DST_R, #lowbit
+ beq 1f
+.endif
+ pixld (lowbit * 8 / dst_w_bpp), src_bpp, src_basereg, SRC
+ pixld (lowbit * 8 / dst_w_bpp), mask_bpp, mask_basereg, MASK
+.if dst_r_bpp > 0
+ pixld_a (lowbit * 8 / dst_r_bpp), dst_r_bpp, dst_r_basereg, DST_R
+.else
+ add DST_R, DST_R, #lowbit
+.endif
+ PF add PF_X, PF_X, #(lowbit * 8 / dst_w_bpp)
+ sub W, W, #(lowbit * 8 / dst_w_bpp)
+1:
+.endif
+.endr
+ pixdeinterleave src_bpp, src_basereg
+ pixdeinterleave mask_bpp, mask_basereg
+ pixdeinterleave dst_r_bpp, dst_r_basereg
+
+ process_pixblock_head
+ cache_preload 0, pixblock_size
+ cache_preload_simple
+ process_pixblock_tail
+
+ pixinterleave dst_w_bpp, dst_w_basereg
+.irp lowbit, 1, 2, 4, 8, 16
+.if (dst_w_bpp <= (lowbit * 8)) && ((lowbit * 8) < (pixblock_size * dst_w_bpp))
+.if lowbit < 16 /* we don't need more than 16-byte alignment */
+ tst DST_W, #lowbit
+ beq 1f
+.endif
+ pixst_a (lowbit * 8 / dst_w_bpp), dst_w_bpp, dst_w_basereg, DST_W
+1:
+.endif
+.endr
+.endif
+2:
+.endm
+
+/*
+ * Special code for processing up to (pixblock_size - 1) remaining
+ * trailing pixels. As SIMD processing performs operation on
+ * pixblock_size pixels, anything smaller than this has to be loaded
+ * and stored in a special way. Loading and storing of pixel data is
+ * performed in such a way that we fill some 'slots' in the NEON
+ * registers (some slots naturally are unused), then perform compositing
+ * operation as usual. In the end, the data is taken from these 'slots'
+ * and saved to memory.
+ *
+ * cache_preload_flag - allows to suppress prefetch if
+ * set to 0
+ * dst_aligned_flag - selects whether destination buffer
+ * is aligned
+ */
+.macro process_trailing_pixels cache_preload_flag, \
+ dst_aligned_flag, \
+ process_pixblock_head, \
+ process_pixblock_tail, \
+ process_pixblock_tail_head
+ tst W, #(pixblock_size - 1)
+ beq 2f
+.irp chunk_size, 16, 8, 4, 2, 1
+.if pixblock_size > chunk_size
+ tst W, #chunk_size
+ beq 1f
+ pixld chunk_size, src_bpp, src_basereg, SRC
+ pixld chunk_size, mask_bpp, mask_basereg, MASK
+.if dst_aligned_flag != 0
+ pixld_a chunk_size, dst_r_bpp, dst_r_basereg, DST_R
+.else
+ pixld chunk_size, dst_r_bpp, dst_r_basereg, DST_R
+.endif
+.if cache_preload_flag != 0
+ PF add PF_X, PF_X, #chunk_size
+.endif
+1:
+.endif
+.endr
+ pixdeinterleave src_bpp, src_basereg
+ pixdeinterleave mask_bpp, mask_basereg
+ pixdeinterleave dst_r_bpp, dst_r_basereg
+
+ process_pixblock_head
+.if cache_preload_flag != 0
+ cache_preload 0, pixblock_size
+ cache_preload_simple
+.endif
+ process_pixblock_tail
+ pixinterleave dst_w_bpp, dst_w_basereg
+.irp chunk_size, 16, 8, 4, 2, 1
+.if pixblock_size > chunk_size
+ tst W, #chunk_size
+ beq 1f
+.if dst_aligned_flag != 0
+ pixst_a chunk_size, dst_w_bpp, dst_w_basereg, DST_W
+.else
+ pixst chunk_size, dst_w_bpp, dst_w_basereg, DST_W
+.endif
+1:
+.endif
+.endr
+2:
+.endm
+
+/*
+ * Macro, which performs all the needed operations to switch to the next
+ * scanline and start the next loop iteration unless all the scanlines
+ * are already processed.
+ */
+.macro advance_to_next_scanline start_of_loop_label
+.if regs_shortage
+ ldrd W, [sp] /* load W and H (width and height) from stack */
+.else
+ mov W, ORIG_W
+.endif
+ add DST_W, DST_W, DST_STRIDE, lsl #dst_bpp_shift
+.if src_bpp != 0
+ add SRC, SRC, SRC_STRIDE, lsl #src_bpp_shift
+.endif
+.if mask_bpp != 0
+ add MASK, MASK, MASK_STRIDE, lsl #mask_bpp_shift
+.endif
+.if (dst_w_bpp != 24)
+ sub DST_W, DST_W, W, lsl #dst_bpp_shift
+.endif
+.if (src_bpp != 24) && (src_bpp != 0)
+ sub SRC, SRC, W, lsl #src_bpp_shift
+.endif
+.if (mask_bpp != 24) && (mask_bpp != 0)
+ sub MASK, MASK, W, lsl #mask_bpp_shift
+.endif
+ subs H, H, #1
+ mov DST_R, DST_W
+.if regs_shortage
+ str H, [sp, #4] /* save updated height to stack */
+.endif
+ bge start_of_loop_label
+.endm
+
+/*
+ * Registers are allocated in the following way by default:
+ * d0, d1, d2, d3 - reserved for loading source pixel data
+ * d4, d5, d6, d7 - reserved for loading destination pixel data
+ * d24, d25, d26, d27 - reserved for loading mask pixel data
+ * d28, d29, d30, d31 - final destination pixel data for writeback to memory
+ */
+.macro generate_composite_function fname, \
+ src_bpp_, \
+ mask_bpp_, \
+ dst_w_bpp_, \
+ flags, \
+ pixblock_size_, \
+ prefetch_distance, \
+ init, \
+ cleanup, \
+ process_pixblock_head, \
+ process_pixblock_tail, \
+ process_pixblock_tail_head, \
+ dst_w_basereg_ = 28, \
+ dst_r_basereg_ = 4, \
+ src_basereg_ = 0, \
+ mask_basereg_ = 24
+
+ .func fname
+ .global fname
+ /* For ELF format also set function visibility to hidden */
+#ifdef __ELF__
+ .hidden fname
+ .type fname, %function
+#endif
+fname:
+ push {r4-r12, lr} /* save all registers */
+
+/*
+ * Select prefetch type for this function. If prefetch distance is
+ * set to 0 or one of the color formats is 24bpp, SIMPLE prefetch
+ * has to be used instead of ADVANCED.
+ */
+ .set PREFETCH_TYPE_CURRENT, PREFETCH_TYPE_DEFAULT
+.if prefetch_distance == 0
+ .set PREFETCH_TYPE_CURRENT, PREFETCH_TYPE_NONE
+.elseif (PREFETCH_TYPE_CURRENT > PREFETCH_TYPE_SIMPLE) && \
+ ((src_bpp_ == 24) || (mask_bpp_ == 24) || (dst_w_bpp_ == 24))
+ .set PREFETCH_TYPE_CURRENT, PREFETCH_TYPE_SIMPLE
+.endif
+
+/*
+ * Make some macro arguments globally visible and accessible
+ * from other macros
+ */
+ .set src_bpp, src_bpp_
+ .set mask_bpp, mask_bpp_
+ .set dst_w_bpp, dst_w_bpp_
+ .set pixblock_size, pixblock_size_
+ .set dst_w_basereg, dst_w_basereg_
+ .set dst_r_basereg, dst_r_basereg_
+ .set src_basereg, src_basereg_
+ .set mask_basereg, mask_basereg_
+
+/*
+ * Assign symbolic names to registers
+ */
+ W .req r0 /* width (is updated during processing) */
+ H .req r1 /* height (is updated during processing) */
+ DST_W .req r2 /* destination buffer pointer for writes */
+ DST_STRIDE .req r3 /* destination image stride */
+ SRC .req r4 /* source buffer pointer */
+ SRC_STRIDE .req r5 /* source image stride */
+ DST_R .req r6 /* destination buffer pointer for reads */
+
+ MASK .req r7 /* mask pointer */
+ MASK_STRIDE .req r8 /* mask stride */
+
+ PF_CTL .req r9 /* combined lines counter and prefetch */
+ /* distance increment counter */
+ PF_X .req r10 /* pixel index in a scanline for current */
+ /* pretetch position */
+ PF_SRC .req r11 /* pointer to source scanline start */
+ /* for prefetch purposes */
+ PF_DST .req r12 /* pointer to destination scanline start */
+ /* for prefetch purposes */
+ PF_MASK .req r14 /* pointer to mask scanline start */
+ /* for prefetch purposes */
+/*
+ * Check whether we have enough registers for all the local variables.
+ * If we don't have enough registers, original width and height are
+ * kept on top of stack (and 'regs_shortage' variable is set to indicate
+ * this for the rest of code). Even if there are enough registers, the
+ * allocation scheme may be a bit different depending on whether source
+ * or mask is not used.
+ */
+.if (PREFETCH_TYPE_CURRENT < PREFETCH_TYPE_ADVANCED)
+ ORIG_W .req r10 /* saved original width */
+ DUMMY .req r12 /* temporary register */
+ .set regs_shortage, 0
+.elseif mask_bpp == 0
+ ORIG_W .req r7 /* saved original width */
+ DUMMY .req r8 /* temporary register */
+ .set regs_shortage, 0
+.elseif src_bpp == 0
+ ORIG_W .req r4 /* saved original width */
+ DUMMY .req r5 /* temporary register */
+ .set regs_shortage, 0
+.else
+ ORIG_W .req r1 /* saved original width */
+ DUMMY .req r1 /* temporary register */
+ .set regs_shortage, 1
+.endif
+
+ .set mask_bpp_shift, -1
+.if src_bpp == 32
+ .set src_bpp_shift, 2
+.elseif src_bpp == 24
+ .set src_bpp_shift, 0
+.elseif src_bpp == 16
+ .set src_bpp_shift, 1
+.elseif src_bpp == 8
+ .set src_bpp_shift, 0
+.elseif src_bpp == 0
+ .set src_bpp_shift, -1
+.else
+ .error "requested src bpp (src_bpp) is not supported"
+.endif
+.if mask_bpp == 32
+ .set mask_bpp_shift, 2
+.elseif mask_bpp == 24
+ .set mask_bpp_shift, 0
+.elseif mask_bpp == 8
+ .set mask_bpp_shift, 0
+.elseif mask_bpp == 0
+ .set mask_bpp_shift, -1
+.else
+ .error "requested mask bpp (mask_bpp) is not supported"
+.endif
+.if dst_w_bpp == 32
+ .set dst_bpp_shift, 2
+.elseif dst_w_bpp == 24
+ .set dst_bpp_shift, 0
+.elseif dst_w_bpp == 16
+ .set dst_bpp_shift, 1
+.elseif dst_w_bpp == 8
+ .set dst_bpp_shift, 0
+.else
+ .error "requested dst bpp (dst_w_bpp) is not supported"
+.endif
+
+.if (((flags) & FLAG_DST_READWRITE) != 0)
+ .set dst_r_bpp, dst_w_bpp
+.else
+ .set dst_r_bpp, 0
+.endif
+.if (((flags) & FLAG_DEINTERLEAVE_32BPP) != 0)
+ .set DEINTERLEAVE_32BPP_ENABLED, 1
+.else
+ .set DEINTERLEAVE_32BPP_ENABLED, 0
+.endif
+
+.if prefetch_distance < 0 || prefetch_distance > 15
+ .error "invalid prefetch distance (prefetch_distance)"
+.endif
+
+.if src_bpp > 0
+ ldr SRC, [sp, #40]
+.endif
+.if mask_bpp > 0
+ ldr MASK, [sp, #48]
+.endif
+ PF mov PF_X, #0
+.if src_bpp > 0
+ ldr SRC_STRIDE, [sp, #44]
+.endif
+.if mask_bpp > 0
+ ldr MASK_STRIDE, [sp, #52]
+.endif
+ mov DST_R, DST_W
+
+.if src_bpp == 24
+ sub SRC_STRIDE, SRC_STRIDE, W
+ sub SRC_STRIDE, SRC_STRIDE, W, lsl #1
+.endif
+.if mask_bpp == 24
+ sub MASK_STRIDE, MASK_STRIDE, W
+ sub MASK_STRIDE, MASK_STRIDE, W, lsl #1
+.endif
+.if dst_w_bpp == 24
+ sub DST_STRIDE, DST_STRIDE, W
+ sub DST_STRIDE, DST_STRIDE, W, lsl #1
+.endif
+
+/*
+ * Setup advanced prefetcher initial state
+ */
+ PF mov PF_SRC, SRC
+ PF mov PF_DST, DST_R
+ PF mov PF_MASK, MASK
+ /* PF_CTL = prefetch_distance | ((h - 1) << 4) */
+ PF mov PF_CTL, H, lsl #4
+ PF add PF_CTL, #(prefetch_distance - 0x10)
+
+ init
+.if regs_shortage
+ push {r0, r1}
+.endif
+ subs H, H, #1
+.if regs_shortage
+ str H, [sp, #4] /* save updated height to stack */
+.else
+ mov ORIG_W, W
+.endif
+ blt 9f
+ cmp W, #(pixblock_size * 2)
+ blt 8f
+/*
+ * This is the start of the pipelined loop, which if optimized for
+ * long scanlines
+ */
+0:
+ ensure_destination_ptr_alignment process_pixblock_head, \
+ process_pixblock_tail, \
+ process_pixblock_tail_head
+
+ /* Implement "head (tail_head) ... (tail_head) tail" loop pattern */
+ pixld_a pixblock_size, dst_r_bpp, \
+ (dst_r_basereg - pixblock_size * dst_r_bpp / 64), DST_R
+ pixld pixblock_size, src_bpp, \
+ (src_basereg - pixblock_size * src_bpp / 64), SRC
+ pixld pixblock_size, mask_bpp, \
+ (mask_basereg - pixblock_size * mask_bpp / 64), MASK
+ PF add PF_X, PF_X, #pixblock_size
+ process_pixblock_head
+ cache_preload 0, pixblock_size
+ cache_preload_simple
+ subs W, W, #(pixblock_size * 2)
+ blt 2f
+1:
+ process_pixblock_tail_head
+ cache_preload_simple
+ subs W, W, #pixblock_size
+ bge 1b
+2:
+ process_pixblock_tail
+ pixst_a pixblock_size, dst_w_bpp, \
+ (dst_w_basereg - pixblock_size * dst_w_bpp / 64), DST_W
+
+ /* Process the remaining trailing pixels in the scanline */
+ process_trailing_pixels 1, 1, \
+ process_pixblock_head, \
+ process_pixblock_tail, \
+ process_pixblock_tail_head
+ advance_to_next_scanline 0b
+
+.if regs_shortage
+ pop {r0, r1}
+.endif
+ cleanup
+ pop {r4-r12, pc} /* exit */
+/*
+ * This is the start of the loop, designed to process images with small width
+ * (less than pixblock_size * 2 pixels). In this case neither pipelining
+ * nor prefetch are used.
+ */
+8:
+ /* Process exactly pixblock_size pixels if needed */
+ tst W, #pixblock_size
+ beq 1f
+ pixld pixblock_size, dst_r_bpp, \
+ (dst_r_basereg - pixblock_size * dst_r_bpp / 64), DST_R
+ pixld pixblock_size, src_bpp, \
+ (src_basereg - pixblock_size * src_bpp / 64), SRC
+ pixld pixblock_size, mask_bpp, \
+ (mask_basereg - pixblock_size * mask_bpp / 64), MASK
+ process_pixblock_head
+ process_pixblock_tail
+ pixst pixblock_size, dst_w_bpp, \
+ (dst_w_basereg - pixblock_size * dst_w_bpp / 64), DST_W
+1:
+ /* Process the remaining trailing pixels in the scanline */
+ process_trailing_pixels 0, 0, \
+ process_pixblock_head, \
+ process_pixblock_tail, \
+ process_pixblock_tail_head
+ advance_to_next_scanline 8b
+9:
+.if regs_shortage
+ pop {r0, r1}
+.endif
+ cleanup
+ pop {r4-r12, pc} /* exit */
+
+ .unreq SRC
+ .unreq MASK
+ .unreq DST_R
+ .unreq DST_W
+ .unreq ORIG_W
+ .unreq W
+ .unreq H
+ .unreq SRC_STRIDE
+ .unreq DST_STRIDE
+ .unreq MASK_STRIDE
+ .unreq PF_CTL
+ .unreq PF_X
+ .unreq PF_SRC
+ .unreq PF_DST
+ .unreq PF_MASK
+ .unreq DUMMY
+ .endfunc
+.endm
+
+/*
+ * A simplified variant of function generation template for a single
+ * scanline processing (for implementing pixman combine functions)
+ */
+.macro generate_composite_function_single_scanline fname, \
+ src_bpp_, \
+ mask_bpp_, \
+ dst_w_bpp_, \
+ flags, \
+ pixblock_size_, \
+ init, \
+ cleanup, \
+ process_pixblock_head, \
+ process_pixblock_tail, \
+ process_pixblock_tail_head, \
+ dst_w_basereg_ = 28, \
+ dst_r_basereg_ = 4, \
+ src_basereg_ = 0, \
+ mask_basereg_ = 24
+
+ .func fname
+ .global fname
+ /* For ELF format also set function visibility to hidden */
+#ifdef __ELF__
+ .hidden fname
+ .type fname, %function
+#endif
+fname:
+ .set PREFETCH_TYPE_CURRENT, PREFETCH_TYPE_NONE
+/*
+ * Make some macro arguments globally visible and accessible
+ * from other macros
+ */
+ .set src_bpp, src_bpp_
+ .set mask_bpp, mask_bpp_
+ .set dst_w_bpp, dst_w_bpp_
+ .set pixblock_size, pixblock_size_
+ .set dst_w_basereg, dst_w_basereg_
+ .set dst_r_basereg, dst_r_basereg_
+ .set src_basereg, src_basereg_
+ .set mask_basereg, mask_basereg_
+/*
+ * Assign symbolic names to registers
+ */
+ W .req r0 /* width (is updated during processing) */
+ DST_W .req r1 /* destination buffer pointer for writes */
+ SRC .req r2 /* source buffer pointer */
+ DST_R .req ip /* destination buffer pointer for reads */
+ MASK .req r3 /* mask pointer */
+
+.if (((flags) & FLAG_DST_READWRITE) != 0)
+ .set dst_r_bpp, dst_w_bpp
+.else
+ .set dst_r_bpp, 0
+.endif
+.if (((flags) & FLAG_DEINTERLEAVE_32BPP) != 0)
+ .set DEINTERLEAVE_32BPP_ENABLED, 1
+.else
+ .set DEINTERLEAVE_32BPP_ENABLED, 0
+.endif
+
+ init
+ mov DST_R, DST_W
+
+ cmp W, #pixblock_size
+ blt 8f
+
+ ensure_destination_ptr_alignment process_pixblock_head, \
+ process_pixblock_tail, \
+ process_pixblock_tail_head
+
+ subs W, W, #pixblock_size
+ blt 7f
+
+ /* Implement "head (tail_head) ... (tail_head) tail" loop pattern */
+ pixld_a pixblock_size, dst_r_bpp, \
+ (dst_r_basereg - pixblock_size * dst_r_bpp / 64), DST_R
+ pixld pixblock_size, src_bpp, \
+ (src_basereg - pixblock_size * src_bpp / 64), SRC
+ pixld pixblock_size, mask_bpp, \
+ (mask_basereg - pixblock_size * mask_bpp / 64), MASK
+ process_pixblock_head
+ subs W, W, #pixblock_size
+ blt 2f
+1:
+ process_pixblock_tail_head
+ subs W, W, #pixblock_size
+ bge 1b
+2:
+ process_pixblock_tail
+ pixst_a pixblock_size, dst_w_bpp, \
+ (dst_w_basereg - pixblock_size * dst_w_bpp / 64), DST_W
+7:
+ /* Process the remaining trailing pixels in the scanline (dst aligned) */
+ process_trailing_pixels 0, 1, \
+ process_pixblock_head, \
+ process_pixblock_tail, \
+ process_pixblock_tail_head
+
+ cleanup
+ bx lr /* exit */
+8:
+ /* Process the remaining trailing pixels in the scanline (dst unaligned) */
+ process_trailing_pixels 0, 0, \
+ process_pixblock_head, \
+ process_pixblock_tail, \
+ process_pixblock_tail_head
+
+ cleanup
+ bx lr /* exit */
+
+ .unreq SRC
+ .unreq MASK
+ .unreq DST_R
+ .unreq DST_W
+ .unreq W
+ .endfunc
+.endm
+
+.macro default_init
+.endm
+
+.macro default_cleanup
+.endm
diff --git a/src/corelib/kernel/qmetaobject_p.h b/src/corelib/kernel/qmetaobject_p.h
index a176149164..b538787113 100644
--- a/src/corelib/kernel/qmetaobject_p.h
+++ b/src/corelib/kernel/qmetaobject_p.h
@@ -196,7 +196,7 @@ static QByteArray normalizeTypeInternal(const char *t, const char *e, bool fixSc
if (*(e-1) == '&') { // treat const reference as value
t += 6;
--e;
- } else if (is_ident_char(*(e-1))) { // treat const value as value
+ } else if (is_ident_char(*(e-1)) || *(e-1) == '>') { // treat const value as value
t += 6;
}
}
@@ -287,13 +287,16 @@ static QByteArray normalizeTypeInternal(const char *t, const char *e, bool fixSc
}
// cv qualifers can appear after the type as well
- if (t != e && (e - t >= 5 && strncmp("const", t, 5) == 0)) {
+ if (!is_ident_char(c) && t != e && (e - t >= 5 && strncmp("const", t, 5) == 0)
+ && (e - t == 5 || !is_ident_char(t[5]))) {
t += 5;
while (t != e && is_space(*t))
++t;
if (adjustConst && t != e && *t == '&') {
// treat const ref as value
++t;
+ } else if (adjustConst && !star) {
+ // treat const as value
} else if (!star) {
// move const to the front (but not if const comes after a *)
result.prepend("const ");
diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp
index dbc6be2746..330de20214 100644
--- a/src/corelib/kernel/qobject.cpp
+++ b/src/corelib/kernel/qobject.cpp
@@ -1470,7 +1470,7 @@ void QObject::moveToThread(QThread *targetThread)
} else if (d->threadData != currentData) {
qWarning("QObject::moveToThread: Current thread (%p) is not the object's thread (%p).\n"
"Cannot move to target thread (%p)\n",
- d->threadData->thread, currentData->thread, targetData->thread);
+ currentData->thread, d->threadData->thread, targetData->thread);
#ifdef Q_WS_MAC
qWarning("On Mac OS X, you might be loading two sets of Qt binaries into the same process. "
diff --git a/src/corelib/tools/qdatetime.cpp b/src/corelib/tools/qdatetime.cpp
index dc1666a3da..459d76acdf 100644
--- a/src/corelib/tools/qdatetime.cpp
+++ b/src/corelib/tools/qdatetime.cpp
@@ -1336,7 +1336,10 @@ bool QDate::isValid(int year, int month, int day)
bool QDate::isLeapYear(int y)
{
if (y < 1582) {
- return qAbs(y) % 4 == 0;
+ if ( y < 1) { // No year 0 in Julian calendar, so -1, -5, -9 etc are leap years
+ ++y;
+ }
+ return y % 4 == 0;
} else {
return (y % 4 == 0 && y % 100 != 0) || y % 400 == 0;
}
diff --git a/src/corelib/tools/qvarlengtharray.h b/src/corelib/tools/qvarlengtharray.h
index aecb66e525..9773d4b2c3 100644
--- a/src/corelib/tools/qvarlengtharray.h
+++ b/src/corelib/tools/qvarlengtharray.h
@@ -107,6 +107,10 @@ public:
Q_ASSERT(idx >= 0 && idx < s);
return ptr[idx];
}
+ inline const T &at(int idx) const { return operator[](idx); }
+
+ T value(int i) const;
+ T value(int i, const T &defaultValue) const;
inline void append(const T &t) {
if (s == a) // i.e. s != 0
@@ -248,6 +252,21 @@ Q_OUTOFLINE_TEMPLATE void QVarLengthArray<T, Prealloc>::realloc(int asize, int a
}
}
+template <class T, int Prealloc>
+Q_OUTOFLINE_TEMPLATE T QVarLengthArray<T, Prealloc>::value(int i) const
+{
+ if (i < 0 || i >= size()) {
+ return T();
+ }
+ return at(i);
+}
+template <class T, int Prealloc>
+Q_OUTOFLINE_TEMPLATE T QVarLengthArray<T, Prealloc>::value(int i, const T &defaultValue) const
+{
+ return (i < 0 || i >= size()) ? defaultValue : at(i);
+}
+
+
QT_END_NAMESPACE
QT_END_HEADER
diff --git a/src/corelib/tools/qvarlengtharray.qdoc b/src/corelib/tools/qvarlengtharray.qdoc
index bb7a3defbf..38901e5ded 100644
--- a/src/corelib/tools/qvarlengtharray.qdoc
+++ b/src/corelib/tools/qvarlengtharray.qdoc
@@ -197,7 +197,7 @@
\a i must be a valid index position in the array (i.e., 0 <= \a i
< size()).
- \sa data()
+ \sa data(), at()
*/
/*! \fn const T &QVarLengthArray::operator[](int i) const
@@ -272,3 +272,33 @@
Constructs a copy of \a other.
*/
+/*! \fn const T &QVarLengthArray::at(int i) const
+
+ Returns a reference to the item at index position \a i.
+
+ \a i must be a valid index position in the array (i.e., 0 <= \a i
+ < size()).
+
+ \sa value(), operator[]()
+*/
+
+/*! \fn T QVarLengthArray::value(int i) const
+
+ Returns the value at index position \a i.
+
+ If the index \a i is out of bounds, the function returns
+ a \l{default-constructed value}. If you are certain that
+ \a i is within bounds, you can use at() instead, which is slightly
+ faster.
+
+ \sa at(), operator[]()
+*/
+
+/*! \fn T QVarLengthArray::value(int i, const T &defaultValue) const
+
+ \overload
+
+ If the index \a i is out of bounds, the function returns
+ \a defaultValue.
+*/
+
diff --git a/src/declarative/graphicsitems/qdeclarativeanchors.cpp b/src/declarative/graphicsitems/qdeclarativeanchors.cpp
index dc1f09db29..ffcedda7f6 100644
--- a/src/declarative/graphicsitems/qdeclarativeanchors.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeanchors.cpp
@@ -1059,7 +1059,7 @@ bool QDeclarativeAnchorsPrivate::checkVAnchorValid(QDeclarativeAnchorLine anchor
return true;
}
-#include <moc_qdeclarativeanchors_p.cpp>
-
QT_END_NAMESPACE
+#include <moc_qdeclarativeanchors_p.cpp>
+
diff --git a/src/declarative/graphicsitems/qdeclarativeflickable.cpp b/src/declarative/graphicsitems/qdeclarativeflickable.cpp
index fb224292de..8459245631 100644
--- a/src/declarative/graphicsitems/qdeclarativeflickable.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeflickable.cpp
@@ -403,8 +403,10 @@ void QDeclarativeFlickablePrivate::updateBeginningEnd()
These properties describe the position and size of the currently viewed area.
The size is defined as the percentage of the full view currently visible,
- scaled to 0.0 - 1.0. The page position is in the range 0.0 (beginning) to
- size ratio (end), i.e. yPosition is in the range 0.0 - heightRatio.
+ scaled to 0.0 - 1.0. The page position is usually in the range 0.0 (beginning) to
+ 1.0 minus size ratio (end), i.e. yPosition is in the range 0.0 to 1.0-heightRatio.
+ However, it is possible for the contents to be dragged outside of the normal
+ range, resulting in the page positions also being outside the normal range.
These properties are typically used to draw a scrollbar, for example:
\code
diff --git a/src/declarative/graphicsitems/qdeclarativeitem.cpp b/src/declarative/graphicsitems/qdeclarativeitem.cpp
index 05e13a732a..83c79a0bd3 100644
--- a/src/declarative/graphicsitems/qdeclarativeitem.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeitem.cpp
@@ -77,13 +77,20 @@ QT_BEGIN_NAMESPACE
\since 4.7
\brief The Transform elements provide a way of building advanced transformations on Items.
+ The Transform element is a base type which cannot be instantiated directly.
+ The following concrete Transform types are available:
+
+ \list
+ \o \l Rotation
+ \o \l Scale
+ \o \l Translate
+ \endlist
+
The Transform elements let you create and control advanced transformations that can be configured
independently using specialized properties.
You can assign any number of Transform elements to an Item. Each Transform is applied in order,
one at a time, to the Item it's assigned to.
-
- \sa Rotation, Scale, Translate
*/
/*!
@@ -91,7 +98,7 @@ QT_BEGIN_NAMESPACE
\since 4.7
\brief The Translate object provides a way to move an Item without changing its x or y properties.
- The Translate object independent control over position in addition to the Item's x and y properties.
+ The Translate object provides independent control over position in addition to the Item's x and y properties.
The following example moves the Y axis of the Rectangles while still allowing the Row element
to lay the items out as if they had not been transformed:
@@ -118,7 +125,7 @@ QT_BEGIN_NAMESPACE
*/
/*!
- \qmlproperty real Translate::yTranslate
+ \qmlproperty real Translate::y
The translation along the Y axis.
*/
diff --git a/src/declarative/graphicsitems/qdeclarativepositioners.cpp b/src/declarative/graphicsitems/qdeclarativepositioners.cpp
index b23b8c9ed8..781e58490e 100644
--- a/src/declarative/graphicsitems/qdeclarativepositioners.cpp
+++ b/src/declarative/graphicsitems/qdeclarativepositioners.cpp
@@ -237,21 +237,13 @@ void QDeclarativeBasePositioner::prePositioning()
positionedItems.append(*item);
}
}
- doPositioning();
+ QSizeF contentSize;
+ doPositioning(&contentSize);
if(d->addTransition || d->moveTransition)
finishApplyTransitions();
//Set implicit size to the size of its children
- qreal h = 0.0f;
- qreal w = 0.0f;
- for (int i = 0; i < positionedItems.count(); ++i) {
- const PositionedItem &posItem = positionedItems.at(i);
- if (posItem.isVisible) {
- h = qMax(h, posItem.item->y() + posItem.item->height());
- w = qMax(w, posItem.item->x() + posItem.item->width());
- }
- }
- setImplicitHeight(h);
- setImplicitWidth(w);
+ setImplicitHeight(contentSize.height());
+ setImplicitWidth(contentSize.width());
}
void QDeclarativeBasePositioner::positionX(int x, const PositionedItem &target)
@@ -423,7 +415,7 @@ static inline bool isInvisible(QDeclarativeItem *child)
return child->opacity() == 0.0 || !child->isVisible() || !child->width() || !child->height();
}
-void QDeclarativeColumn::doPositioning()
+void QDeclarativeColumn::doPositioning(QSizeF *contentSize)
{
int voffset = 0;
@@ -435,9 +427,13 @@ void QDeclarativeColumn::doPositioning()
if(child.item->y() != voffset)
positionY(voffset, child);
+ contentSize->setWidth(qMax(contentSize->width(), child.item->width()));
+
voffset += child.item->height();
voffset += spacing();
}
+
+ contentSize->setHeight(voffset - spacing());
}
/*!
@@ -534,7 +530,7 @@ QDeclarativeRow::QDeclarativeRow(QDeclarativeItem *parent)
{
}
-void QDeclarativeRow::doPositioning()
+void QDeclarativeRow::doPositioning(QSizeF *contentSize)
{
int hoffset = 0;
@@ -546,9 +542,13 @@ void QDeclarativeRow::doPositioning()
if(child.item->x() != hoffset)
positionX(hoffset, child);
+ contentSize->setHeight(qMax(contentSize->height(), child.item->height()));
+
hoffset += child.item->width();
hoffset += spacing();
}
+
+ contentSize->setWidth(hoffset - spacing());
}
@@ -698,7 +698,7 @@ void QDeclarativeGrid::setRows(const int rows)
emit rowsChanged();
}
-void QDeclarativeGrid::doPositioning()
+void QDeclarativeGrid::doPositioning(QSizeF *contentSize)
{
int c=_columns,r=_rows;//Actual number of rows/columns
int numVisible = positionedItems.count();
@@ -745,6 +745,10 @@ void QDeclarativeGrid::doPositioning()
positionX(xoffset, child);
positionY(yoffset, child);
}
+
+ contentSize->setWidth(qMax(contentSize->width(), xoffset + child.item->width()));
+ contentSize->setHeight(yoffset + maxRowHeight[curRow]);
+
xoffset+=maxColWidth[curCol]+spacing();
curCol++;
curCol%=c;
@@ -854,7 +858,7 @@ void QDeclarativeFlow::setFlow(Flow flow)
}
}
-void QDeclarativeFlow::doPositioning()
+void QDeclarativeFlow::doPositioning(QSizeF *contentSize)
{
Q_D(QDeclarativeFlow);
@@ -886,6 +890,9 @@ void QDeclarativeFlow::doPositioning()
positionY(voffset, child);
}
+ contentSize->setWidth(qMax(contentSize->width(), hoffset + child.item->width()));
+ contentSize->setHeight(qMax(contentSize->height(), voffset + child.item->height()));
+
if (d->flow == LeftToRight) {
hoffset += child.item->width();
hoffset += spacing();
diff --git a/src/declarative/graphicsitems/qdeclarativepositioners_p.h b/src/declarative/graphicsitems/qdeclarativepositioners_p.h
index f38847c0d8..c4414d11f5 100644
--- a/src/declarative/graphicsitems/qdeclarativepositioners_p.h
+++ b/src/declarative/graphicsitems/qdeclarativepositioners_p.h
@@ -90,10 +90,10 @@ Q_SIGNALS:
void addChanged();
protected Q_SLOTS:
- virtual void doPositioning()=0;
void prePositioning();
protected:
+ virtual void doPositioning(QSizeF *contentSize)=0;
struct PositionedItem {
PositionedItem(QDeclarativeItem *i) : item(i), isNew(false), isVisible(true) {}
bool operator==(const PositionedItem &other) const { return other.item == item; }
@@ -116,8 +116,8 @@ class Q_DECLARATIVE_EXPORT QDeclarativeColumn : public QDeclarativeBasePositione
Q_OBJECT
public:
QDeclarativeColumn(QDeclarativeItem *parent=0);
-protected Q_SLOTS:
- virtual void doPositioning();
+protected:
+ virtual void doPositioning(QSizeF *contentSize);
private:
Q_DISABLE_COPY(QDeclarativeColumn)
};
@@ -127,8 +127,8 @@ class Q_DECLARATIVE_EXPORT QDeclarativeRow: public QDeclarativeBasePositioner
Q_OBJECT
public:
QDeclarativeRow(QDeclarativeItem *parent=0);
-protected Q_SLOTS:
- virtual void doPositioning();
+protected:
+ virtual void doPositioning(QSizeF *contentSize);
private:
Q_DISABLE_COPY(QDeclarativeRow)
};
@@ -151,8 +151,8 @@ Q_SIGNALS:
void rowsChanged();
void columnsChanged();
-protected Q_SLOTS:
- virtual void doPositioning();
+protected:
+ virtual void doPositioning(QSizeF *contentSize);
private:
int _rows;
@@ -176,8 +176,8 @@ public:
Q_SIGNALS:
void flowChanged();
-protected Q_SLOTS:
- virtual void doPositioning();
+protected:
+ virtual void doPositioning(QSizeF *contentSize);
protected:
QDeclarativeFlow(QDeclarativeFlowPrivate &dd, QDeclarativeItem *parent);
diff --git a/src/declarative/graphicsitems/qdeclarativepositioners_p_p.h b/src/declarative/graphicsitems/qdeclarativepositioners_p_p.h
index 3a1edeec62..7880e3e6d7 100644
--- a/src/declarative/graphicsitems/qdeclarativepositioners_p_p.h
+++ b/src/declarative/graphicsitems/qdeclarativepositioners_p_p.h
@@ -73,8 +73,8 @@ class QDeclarativeBasePositionerPrivate : public QDeclarativeItemPrivate, public
public:
QDeclarativeBasePositionerPrivate()
- : spacing(0), type(QDeclarativeBasePositioner::None), moveTransition(0), addTransition(0),
- queuedPositioning(false)
+ : spacing(0), type(QDeclarativeBasePositioner::None)
+ , moveTransition(0), addTransition(0), queuedPositioning(false)
{
}
@@ -84,6 +84,7 @@ public:
}
int spacing;
+
QDeclarativeBasePositioner::PositionerType type;
QDeclarativeTransition *moveTransition;
QDeclarativeTransition *addTransition;
diff --git a/src/declarative/graphicsitems/qdeclarativerectangle.cpp b/src/declarative/graphicsitems/qdeclarativerectangle.cpp
index b82fb53da6..8fbaa22223 100644
--- a/src/declarative/graphicsitems/qdeclarativerectangle.cpp
+++ b/src/declarative/graphicsitems/qdeclarativerectangle.cpp
@@ -228,13 +228,12 @@ QDeclarativePen *QDeclarativeRectangle::border()
GradientStop { position: 1.0; color: "blue" }
}
}
- Rectangle { rotation: 90; x: 80; y: 200; width: 80; height: 80
+ Rectangle { rotation: 90; y: 200; width: 80; height: 80
gradient: Gradient {
GradientStop { position: 0.0; color: "lightsteelblue" }
GradientStop { position: 1.0; color: "blue" }
}
}
- // The x offset is needed because the rotation is from the top left corner
\endqml
\endtable
diff --git a/src/declarative/qml/parser/qdeclarativejs.g b/src/declarative/qml/parser/qdeclarativejs.g
index 6434d10012..536989f13a 100644
--- a/src/declarative/qml/parser/qdeclarativejs.g
+++ b/src/declarative/qml/parser/qdeclarativejs.g
@@ -971,6 +971,56 @@ case $rule_number: {
} break;
./
+UiObjectMember: T_PROPERTY T_IDENTIFIER T_LT UiPropertyType T_GT JsIdentifier T_COLON T_LBRACKET UiArrayMemberList T_RBRACKET ;
+/.
+case $rule_number: {
+ AST::UiPublicMember *node = makeAstNode<AST::UiPublicMember> (driver->nodePool(), sym(4).sval, sym(6).sval);
+ node->typeModifier = sym(2).sval;
+ node->propertyToken = loc(1);
+ node->typeModifierToken = loc(2);
+ node->typeToken = loc(4);
+ node->identifierToken = loc(6);
+ node->semicolonToken = loc(7); // insert a fake ';' before ':'
+
+ AST::UiQualifiedId *propertyName = makeAstNode<AST::UiQualifiedId>(driver->nodePool(), sym(6).sval);
+ propertyName->identifierToken = loc(6);
+ propertyName->next = 0;
+
+ AST::UiArrayBinding *binding = makeAstNode<AST::UiArrayBinding> (driver->nodePool(),
+ propertyName, sym(9).UiArrayMemberList->finish());
+ binding->colonToken = loc(7);
+ binding->lbracketToken = loc(8);
+ binding->rbracketToken = loc(10);
+
+ node->binding = binding;
+
+ sym(1).Node = node;
+} break;
+./
+
+UiObjectMember: T_PROPERTY UiPropertyType JsIdentifier T_COLON UiQualifiedId UiObjectInitializer ;
+/.
+case $rule_number: {
+ AST::UiPublicMember *node = makeAstNode<AST::UiPublicMember> (driver->nodePool(), sym(2).sval, sym(3).sval);
+ node->propertyToken = loc(1);
+ node->typeToken = loc(2);
+ node->identifierToken = loc(3);
+ node->semicolonToken = loc(4); // insert a fake ';' before ':'
+
+ AST::UiQualifiedId *propertyName = makeAstNode<AST::UiQualifiedId>(driver->nodePool(), sym(3).sval);
+ propertyName->identifierToken = loc(3);
+ propertyName->next = 0;
+
+ AST::UiObjectBinding *binding = makeAstNode<AST::UiObjectBinding> (driver->nodePool(),
+ propertyName, sym(5).UiQualifiedId, sym(6).UiObjectInitializer);
+ binding->colonToken = loc(4);
+
+ node->binding = binding;
+
+ sym(1).Node = node;
+} break;
+./
+
UiObjectMember: FunctionDeclaration ;
/.
case $rule_number: {
diff --git a/src/declarative/qml/parser/qdeclarativejsast.cpp b/src/declarative/qml/parser/qdeclarativejsast.cpp
index 3b569a7123..e3d3a66535 100644
--- a/src/declarative/qml/parser/qdeclarativejsast.cpp
+++ b/src/declarative/qml/parser/qdeclarativejsast.cpp
@@ -837,6 +837,7 @@ void UiPublicMember::accept0(Visitor *visitor)
{
if (visitor->visit(this)) {
accept(expression, visitor);
+ accept(binding, visitor);
}
visitor->endVisit(this);
diff --git a/src/declarative/qml/parser/qdeclarativejsast_p.h b/src/declarative/qml/parser/qdeclarativejsast_p.h
index c1945cefbb..b839413777 100644
--- a/src/declarative/qml/parser/qdeclarativejsast_p.h
+++ b/src/declarative/qml/parser/qdeclarativejsast_p.h
@@ -2485,13 +2485,13 @@ public:
UiPublicMember(NameId *memberType,
NameId *name)
- : type(Property), typeModifier(0), memberType(memberType), name(name), expression(0), isDefaultMember(false), isReadonlyMember(false), parameters(0)
+ : type(Property), typeModifier(0), memberType(memberType), name(name), expression(0), binding(0), isDefaultMember(false), isReadonlyMember(false), parameters(0)
{ kind = K; }
UiPublicMember(NameId *memberType,
NameId *name,
ExpressionNode *expression)
- : type(Property), typeModifier(0), memberType(memberType), name(name), expression(expression), isDefaultMember(false), isReadonlyMember(false), parameters(0)
+ : type(Property), typeModifier(0), memberType(memberType), name(name), expression(expression), binding(0), isDefaultMember(false), isReadonlyMember(false), parameters(0)
{ kind = K; }
virtual SourceLocation firstSourceLocation() const
@@ -2506,6 +2506,9 @@ public:
virtual SourceLocation lastSourceLocation() const
{
+ if (binding)
+ return binding->lastSourceLocation();
+
return semicolonToken;
}
@@ -2516,7 +2519,8 @@ public:
NameId *typeModifier;
NameId *memberType;
NameId *name;
- ExpressionNode *expression;
+ ExpressionNode *expression; // initialized with a JS expression
+ UiObjectMember *binding; // initialized with a QML object or array.
bool isDefaultMember;
bool isReadonlyMember;
UiParameterList *parameters;
diff --git a/src/declarative/qml/parser/qdeclarativejsgrammar.cpp b/src/declarative/qml/parser/qdeclarativejsgrammar.cpp
index 89493ff7a1..39a2d3f061 100644
--- a/src/declarative/qml/parser/qdeclarativejsgrammar.cpp
+++ b/src/declarative/qml/parser/qdeclarativejsgrammar.cpp
@@ -64,35 +64,35 @@ const short QDeclarativeJSGrammar::lhs [] = {
106, 106, 106, 106, 106, 106, 106, 106, 126, 126,
126, 127, 127, 128, 128, 106, 106, 106, 106, 106,
106, 106, 106, 106, 106, 106, 106, 106, 106, 106,
- 106, 106, 106, 116, 116, 116, 116, 116, 131, 131,
+ 106, 106, 106, 106, 106, 116, 116, 116, 116, 116,
131, 131, 131, 131, 131, 131, 131, 131, 131, 131,
- 131, 131, 131, 131, 131, 131, 121, 133, 133, 133,
- 133, 132, 132, 135, 135, 137, 137, 137, 137, 137,
- 137, 138, 138, 138, 138, 138, 138, 138, 138, 138,
+ 131, 131, 131, 131, 131, 131, 131, 131, 121, 133,
+ 133, 133, 133, 132, 132, 135, 135, 137, 137, 137,
+ 137, 137, 137, 138, 138, 138, 138, 138, 138, 138,
138, 138, 138, 138, 138, 138, 138, 138, 138, 138,
138, 138, 138, 138, 138, 138, 138, 138, 138, 138,
- 138, 138, 139, 139, 114, 114, 114, 114, 114, 142,
- 142, 143, 143, 143, 143, 141, 141, 144, 144, 145,
- 145, 146, 146, 146, 147, 147, 147, 147, 147, 147,
- 147, 147, 147, 147, 148, 148, 148, 148, 149, 149,
- 149, 150, 150, 150, 150, 151, 151, 151, 151, 151,
- 151, 151, 152, 152, 152, 152, 152, 152, 153, 153,
- 153, 153, 153, 154, 154, 154, 154, 154, 155, 155,
- 156, 156, 157, 157, 158, 158, 159, 159, 160, 160,
- 161, 161, 162, 162, 163, 163, 164, 164, 165, 165,
- 166, 166, 136, 136, 167, 167, 168, 168, 168, 168,
- 168, 168, 168, 168, 168, 168, 168, 168, 104, 104,
- 169, 169, 170, 170, 171, 171, 103, 103, 103, 103,
+ 138, 138, 138, 138, 139, 139, 114, 114, 114, 114,
+ 114, 142, 142, 143, 143, 143, 143, 141, 141, 144,
+ 144, 145, 145, 146, 146, 146, 147, 147, 147, 147,
+ 147, 147, 147, 147, 147, 147, 148, 148, 148, 148,
+ 149, 149, 149, 150, 150, 150, 150, 151, 151, 151,
+ 151, 151, 151, 151, 152, 152, 152, 152, 152, 152,
+ 153, 153, 153, 153, 153, 154, 154, 154, 154, 154,
+ 155, 155, 156, 156, 157, 157, 158, 158, 159, 159,
+ 160, 160, 161, 161, 162, 162, 163, 163, 164, 164,
+ 165, 165, 166, 166, 136, 136, 167, 167, 168, 168,
+ 168, 168, 168, 168, 168, 168, 168, 168, 168, 168,
+ 104, 104, 169, 169, 170, 170, 171, 171, 103, 103,
103, 103, 103, 103, 103, 103, 103, 103, 103, 103,
- 103, 122, 183, 183, 182, 182, 130, 130, 184, 184,
- 185, 185, 187, 187, 186, 188, 191, 189, 189, 192,
- 190, 190, 123, 124, 124, 125, 125, 172, 172, 172,
- 172, 172, 172, 172, 173, 173, 173, 173, 174, 174,
- 174, 174, 175, 175, 176, 178, 193, 193, 196, 196,
- 194, 194, 197, 195, 177, 177, 177, 179, 179, 180,
- 180, 180, 198, 199, 181, 181, 129, 140, 203, 203,
- 200, 200, 201, 201, 204, 107, 205, 205, 105, 105,
- 202, 202, 134, 134, 206};
+ 103, 103, 103, 122, 183, 183, 182, 182, 130, 130,
+ 184, 184, 185, 185, 187, 187, 186, 188, 191, 189,
+ 189, 192, 190, 190, 123, 124, 124, 125, 125, 172,
+ 172, 172, 172, 172, 172, 172, 173, 173, 173, 173,
+ 174, 174, 174, 174, 175, 175, 176, 178, 193, 193,
+ 196, 196, 194, 194, 197, 195, 177, 177, 177, 179,
+ 179, 180, 180, 180, 198, 199, 181, 181, 129, 140,
+ 203, 203, 200, 200, 201, 201, 204, 107, 205, 205,
+ 105, 105, 202, 202, 134, 134, 206};
const short QDeclarativeJSGrammar::rhs [] = {
2, 2, 2, 2, 2, 2, 2, 1, 1, 1,
@@ -101,106 +101,107 @@ const short QDeclarativeJSGrammar::rhs [] = {
1, 5, 4, 4, 3, 3, 3, 3, 1, 1,
1, 0, 1, 2, 4, 6, 6, 3, 3, 7,
7, 4, 4, 5, 5, 6, 6, 7, 7, 7,
- 7, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
- 3, 4, 5, 3, 4, 3, 1, 1, 2, 3,
- 4, 1, 2, 3, 5, 1, 1, 1, 1, 1,
+ 7, 10, 6, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 2, 3, 3, 4, 5, 3, 4, 3, 1, 1,
+ 2, 3, 4, 1, 2, 3, 5, 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, 3, 5, 1,
- 2, 4, 4, 4, 3, 0, 1, 1, 3, 1,
- 1, 1, 2, 2, 1, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 1, 3, 3, 3, 1, 3,
- 3, 1, 3, 3, 3, 1, 3, 3, 3, 3,
- 3, 3, 1, 3, 3, 3, 3, 3, 1, 3,
- 3, 3, 3, 1, 3, 3, 3, 3, 1, 3,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 4, 3,
+ 5, 1, 2, 4, 4, 4, 3, 0, 1, 1,
+ 3, 1, 1, 1, 2, 2, 1, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 1, 3, 3, 3,
+ 1, 3, 3, 1, 3, 3, 3, 1, 3, 3,
+ 3, 3, 3, 3, 1, 3, 3, 3, 3, 3,
+ 1, 3, 3, 3, 3, 1, 3, 3, 3, 3,
+ 1, 3, 1, 3, 1, 3, 1, 3, 1, 3,
1, 3, 1, 3, 1, 3, 1, 3, 1, 3,
- 1, 3, 1, 3, 1, 3, 1, 3, 1, 5,
- 1, 5, 1, 3, 1, 3, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 3,
- 0, 1, 1, 3, 0, 1, 1, 1, 1, 1,
+ 1, 5, 1, 5, 1, 3, 1, 3, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 3, 0, 1, 1, 3, 0, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 3, 1, 2, 0, 1, 3, 3, 1, 1,
- 1, 3, 1, 3, 2, 2, 2, 0, 1, 2,
- 0, 1, 1, 2, 2, 7, 5, 7, 7, 5,
- 9, 10, 7, 8, 2, 2, 3, 3, 2, 2,
- 3, 3, 3, 3, 5, 5, 3, 5, 1, 2,
- 0, 1, 4, 3, 3, 3, 3, 3, 3, 3,
- 3, 4, 5, 2, 2, 2, 8, 8, 1, 3,
- 0, 1, 0, 1, 1, 1, 1, 2, 1, 1,
- 0, 1, 0, 1, 2};
+ 1, 1, 1, 3, 1, 2, 0, 1, 3, 3,
+ 1, 1, 1, 3, 1, 3, 2, 2, 2, 0,
+ 1, 2, 0, 1, 1, 2, 2, 7, 5, 7,
+ 7, 5, 9, 10, 7, 8, 2, 2, 3, 3,
+ 2, 2, 3, 3, 3, 3, 5, 5, 3, 5,
+ 1, 2, 0, 1, 4, 3, 3, 3, 3, 3,
+ 3, 3, 3, 4, 5, 2, 2, 2, 8, 8,
+ 1, 3, 0, 1, 0, 1, 1, 1, 1, 2,
+ 1, 1, 0, 1, 0, 1, 2};
const short QDeclarativeJSGrammar::action_default [] = {
- 0, 0, 0, 0, 0, 0, 22, 0, 172, 239,
- 203, 211, 207, 151, 223, 199, 3, 136, 70, 152,
- 215, 219, 140, 169, 150, 155, 135, 189, 176, 0,
- 77, 78, 73, 341, 64, 343, 0, 0, 0, 0,
- 75, 0, 0, 71, 74, 68, 0, 0, 65, 67,
- 66, 76, 69, 0, 72, 0, 0, 165, 0, 0,
- 152, 171, 154, 153, 0, 0, 0, 167, 168, 166,
- 170, 0, 200, 0, 0, 0, 0, 190, 0, 0,
- 0, 0, 0, 0, 180, 0, 0, 0, 174, 175,
- 173, 178, 182, 181, 179, 177, 192, 191, 193, 0,
- 208, 0, 204, 0, 0, 146, 133, 145, 134, 102,
- 103, 104, 129, 105, 130, 106, 107, 108, 109, 110,
- 111, 112, 113, 114, 115, 116, 117, 118, 131, 119,
- 120, 121, 122, 123, 124, 125, 126, 127, 128, 132,
- 0, 0, 144, 240, 147, 0, 148, 0, 149, 143,
- 0, 236, 229, 227, 234, 235, 233, 232, 238, 231,
- 230, 228, 237, 224, 0, 212, 0, 0, 216, 0,
- 0, 220, 0, 0, 146, 138, 0, 137, 0, 142,
- 156, 0, 342, 331, 332, 0, 329, 0, 330, 0,
- 333, 247, 254, 253, 261, 249, 0, 250, 334, 0,
- 340, 251, 252, 257, 255, 337, 335, 339, 258, 0,
- 269, 0, 0, 0, 0, 341, 64, 0, 343, 65,
- 241, 283, 66, 0, 0, 0, 270, 0, 0, 259,
- 260, 0, 248, 256, 284, 285, 328, 338, 0, 299,
- 300, 301, 302, 0, 295, 296, 297, 298, 325, 326,
- 0, 0, 0, 0, 0, 288, 289, 245, 243, 205,
- 213, 209, 225, 201, 246, 0, 152, 217, 221, 194,
- 183, 0, 0, 202, 0, 0, 0, 0, 195, 0,
- 0, 0, 0, 0, 187, 185, 188, 186, 184, 197,
- 196, 198, 0, 210, 0, 206, 0, 244, 152, 0,
- 226, 241, 242, 0, 241, 0, 0, 291, 0, 0,
- 0, 293, 0, 214, 0, 0, 218, 0, 0, 222,
- 281, 0, 273, 282, 276, 0, 280, 0, 241, 274,
- 0, 241, 0, 0, 292, 0, 0, 0, 294, 342,
- 331, 0, 0, 333, 0, 327, 0, 317, 0, 0,
- 0, 287, 0, 286, 0, 344, 0, 101, 263, 266,
- 0, 102, 269, 105, 130, 107, 108, 73, 112, 113,
- 64, 114, 117, 71, 74, 65, 241, 66, 76, 120,
- 69, 122, 72, 124, 125, 270, 127, 128, 132, 0,
- 94, 0, 0, 96, 100, 98, 85, 97, 99, 0,
- 95, 84, 264, 262, 140, 141, 146, 0, 139, 0,
- 316, 0, 303, 304, 0, 315, 0, 0, 0, 306,
- 311, 309, 312, 0, 0, 310, 311, 0, 307, 0,
- 308, 265, 314, 0, 265, 313, 0, 318, 319, 0,
- 265, 320, 321, 0, 0, 322, 0, 0, 0, 323,
- 324, 158, 157, 0, 0, 0, 290, 0, 0, 0,
- 305, 278, 271, 0, 279, 275, 0, 277, 267, 0,
- 268, 272, 88, 0, 0, 92, 79, 0, 81, 90,
- 0, 82, 91, 93, 83, 89, 80, 0, 86, 162,
- 160, 164, 161, 159, 163, 6, 336, 4, 2, 62,
- 87, 0, 0, 65, 67, 66, 31, 5, 0, 63,
+ 0, 0, 0, 0, 0, 0, 22, 0, 174, 241,
+ 205, 213, 209, 153, 225, 201, 3, 138, 72, 154,
+ 217, 221, 142, 171, 152, 157, 137, 191, 178, 0,
+ 79, 80, 75, 343, 66, 345, 0, 0, 0, 0,
+ 77, 0, 0, 73, 76, 70, 0, 0, 67, 69,
+ 68, 78, 71, 0, 74, 0, 0, 167, 0, 0,
+ 154, 173, 156, 155, 0, 0, 0, 169, 170, 168,
+ 172, 0, 202, 0, 0, 0, 0, 192, 0, 0,
+ 0, 0, 0, 0, 182, 0, 0, 0, 176, 177,
+ 175, 180, 184, 183, 181, 179, 194, 193, 195, 0,
+ 210, 0, 206, 0, 0, 148, 135, 147, 136, 104,
+ 105, 106, 131, 107, 132, 108, 109, 110, 111, 112,
+ 113, 114, 115, 116, 117, 118, 119, 120, 133, 121,
+ 122, 123, 124, 125, 126, 127, 128, 129, 130, 134,
+ 0, 0, 146, 242, 149, 0, 150, 0, 151, 145,
+ 0, 238, 231, 229, 236, 237, 235, 234, 240, 233,
+ 232, 230, 239, 226, 0, 214, 0, 0, 218, 0,
+ 0, 222, 0, 0, 148, 140, 0, 139, 0, 144,
+ 158, 0, 344, 333, 334, 0, 331, 0, 332, 0,
+ 335, 249, 256, 255, 263, 251, 0, 252, 336, 0,
+ 342, 253, 254, 259, 257, 339, 337, 341, 260, 0,
+ 271, 0, 0, 0, 0, 343, 66, 0, 345, 67,
+ 243, 285, 68, 0, 0, 0, 272, 0, 0, 261,
+ 262, 0, 250, 258, 286, 287, 330, 340, 0, 301,
+ 302, 303, 304, 0, 297, 298, 299, 300, 327, 328,
+ 0, 0, 0, 0, 0, 290, 291, 247, 245, 207,
+ 215, 211, 227, 203, 248, 0, 154, 219, 223, 196,
+ 185, 0, 0, 204, 0, 0, 0, 0, 197, 0,
+ 0, 0, 0, 0, 189, 187, 190, 188, 186, 199,
+ 198, 200, 0, 212, 0, 208, 0, 246, 154, 0,
+ 228, 243, 244, 0, 243, 0, 0, 293, 0, 0,
+ 0, 295, 0, 216, 0, 0, 220, 0, 0, 224,
+ 283, 0, 275, 284, 278, 0, 282, 0, 243, 276,
+ 0, 243, 0, 0, 294, 0, 0, 0, 296, 344,
+ 333, 0, 0, 335, 0, 329, 0, 319, 0, 0,
+ 0, 289, 0, 288, 0, 346, 0, 103, 265, 268,
+ 0, 104, 271, 107, 132, 109, 110, 75, 114, 115,
+ 66, 116, 119, 73, 76, 67, 243, 68, 78, 122,
+ 71, 124, 74, 126, 127, 272, 129, 130, 134, 0,
+ 96, 0, 0, 98, 102, 100, 87, 99, 101, 0,
+ 97, 86, 266, 264, 142, 143, 148, 0, 141, 0,
+ 318, 0, 305, 306, 0, 317, 0, 0, 0, 308,
+ 313, 311, 314, 0, 0, 312, 313, 0, 309, 0,
+ 310, 267, 316, 0, 267, 315, 0, 320, 321, 0,
+ 267, 322, 323, 0, 0, 324, 0, 0, 0, 325,
+ 326, 160, 159, 0, 0, 0, 292, 0, 0, 0,
+ 307, 280, 273, 0, 281, 277, 0, 279, 269, 0,
+ 270, 274, 90, 0, 0, 94, 81, 0, 83, 92,
+ 0, 84, 93, 95, 85, 91, 82, 0, 88, 164,
+ 162, 166, 163, 161, 165, 6, 338, 4, 2, 64,
+ 89, 0, 0, 67, 69, 68, 31, 5, 0, 65,
0, 41, 40, 39, 0, 0, 54, 0, 55, 0,
60, 61, 0, 41, 0, 0, 0, 0, 0, 50,
- 51, 0, 52, 0, 53, 0, 56, 57, 0, 0,
- 0, 0, 0, 58, 59, 0, 48, 42, 49, 43,
- 0, 0, 0, 0, 45, 0, 46, 47, 44, 0,
- 0, 0, 30, 35, 36, 37, 38, 140, 265, 0,
- 0, 102, 269, 105, 130, 107, 108, 73, 112, 113,
- 64, 114, 117, 71, 74, 65, 241, 66, 76, 120,
- 69, 122, 72, 124, 125, 270, 127, 128, 132, 140,
- 0, 26, 0, 0, 32, 27, 33, 28, 24, 0,
- 29, 25, 0, 34, 8, 0, 10, 0, 9, 0,
- 1, 21, 12, 0, 13, 0, 14, 0, 19, 20,
- 0, 15, 16, 0, 17, 18, 11, 23, 7, 345};
+ 0, 51, 0, 0, 26, 0, 0, 62, 27, 0,
+ 30, 28, 24, 0, 29, 25, 0, 52, 0, 53,
+ 0, 142, 0, 56, 57, 63, 0, 0, 0, 0,
+ 0, 58, 59, 0, 48, 42, 49, 43, 0, 0,
+ 0, 0, 45, 0, 46, 47, 44, 0, 0, 35,
+ 36, 37, 38, 142, 267, 0, 0, 104, 271, 107,
+ 132, 109, 110, 75, 114, 115, 66, 116, 119, 73,
+ 76, 67, 243, 68, 78, 122, 71, 124, 74, 126,
+ 127, 272, 129, 130, 134, 0, 32, 33, 0, 34,
+ 8, 0, 10, 0, 9, 0, 1, 21, 12, 0,
+ 13, 0, 14, 0, 19, 20, 0, 15, 16, 0,
+ 17, 18, 11, 23, 7, 347};
const short QDeclarativeJSGrammar::goto_default [] = {
- 7, 620, 207, 196, 205, 507, 495, 619, 638, 614,
- 618, 616, 621, 22, 617, 18, 506, 609, 600, 562,
- 508, 191, 195, 197, 201, 524, 550, 549, 200, 232,
+ 7, 626, 207, 196, 205, 507, 495, 625, 644, 620,
+ 624, 622, 627, 22, 623, 18, 506, 543, 533, 540,
+ 535, 191, 195, 197, 201, 524, 568, 567, 200, 232,
26, 474, 473, 356, 355, 9, 354, 357, 107, 17,
145, 24, 13, 144, 19, 25, 57, 23, 8, 28,
27, 269, 15, 263, 10, 259, 12, 261, 11, 260,
@@ -211,775 +212,771 @@ const short QDeclarativeJSGrammar::goto_default [] = {
199, 181, 184, 198, 206, 0};
const short QDeclarativeJSGrammar::action_index [] = {
- 314, 1273, 2404, 2404, 2307, 1001, 58, 98, 78, -101,
- 95, 56, 4, 236, -101, 296, 86, -101, -101, 545,
- 97, 115, 162, 197, -101, -101, -101, 447, 192, 1273,
- -101, -101, -101, 369, -101, 2113, 1919, 1273, 1273, 1273,
- -101, 732, 1273, -101, -101, -101, 1273, 1273, -101, -101,
- -101, -101, -101, 1273, -101, 1273, 1273, -101, 1273, 1273,
- 81, 195, -101, -101, 1273, 1273, 1273, -101, -101, -101,
- 185, 1273, 283, 1273, 1273, 1273, 1273, 447, 1273, 1273,
- 1273, 1273, 1273, 1273, 297, 1273, 1273, 1273, 107, 85,
- 116, 297, 297, 297, 297, 191, 447, 447, 447, 1273,
- 74, 1273, 102, 2016, 1273, 1273, -101, -101, -101, -101,
+ 421, 1288, 2322, 2322, 2419, 1016, -52, 37, 140, -101,
+ 35, -13, -40, 190, -101, 272, 34, -101, -101, 658,
+ 42, 103, 194, 201, -101, -101, -101, 439, 256, 1288,
+ -101, -101, -101, 282, -101, 2128, 1751, 1288, 1288, 1288,
+ -101, 917, 1288, -101, -101, -101, 1288, 1288, -101, -101,
+ -101, -101, -101, 1288, -101, 1288, 1288, -101, 1288, 1288,
+ 109, 245, -101, -101, 1288, 1288, 1288, -101, -101, -101,
+ 185, 1288, 295, 1288, 1288, 1288, 1288, 461, 1288, 1288,
+ 1288, 1288, 1288, 1288, 256, 1288, 1288, 1288, 155, 119,
+ 114, 176, 256, 332, 202, 332, 560, 560, 471, 1288,
+ -23, 1288, 53, 2031, 1288, 1288, -101, -101, -101, -101,
-101, -101, -101, -101, -101, -101, -101, -101, -101, -101,
-101, -101, -101, -101, -101, -101, -101, -101, -101, -101,
-101, -101, -101, -101, -101, -101, -101, -101, -101, -101,
- 112, 1273, -101, -101, 92, 61, -101, 1273, -101, -101,
- 1273, -101, -101, -101, -101, -101, -101, -101, -101, -101,
- -101, -101, -101, -101, 1273, 36, 1273, 1273, 65, 62,
- 1273, -101, 2016, 1273, 1273, -101, 127, -101, 42, -101,
- -101, 57, -101, 294, 60, 35, -101, 259, -101, 32,
- 2404, -101, -101, -101, -101, -101, 200, -101, -101, 33,
- -101, -101, -101, -101, -101, -101, 2404, -101, -101, 436,
- -101, 433, 100, 2307, 34, 369, 67, 45, 2598, 71,
- 1273, -101, 72, 51, 1273, 59, -101, 54, 55, -101,
- -101, 324, -101, -101, -101, -101, -101, -101, 88, -101,
- -101, -101, -101, 76, -101, -101, -101, -101, -101, -101,
- 5, 49, 1273, 104, 84, -101, -101, 1457, -101, 70,
- 41, 1, -101, 287, 68, 46, 643, 73, 77, 364,
- 297, 369, 1273, 238, 1273, 1273, 1273, 1273, 341, 1273,
- 1273, 1273, 1273, 1273, 297, 175, 167, 161, 176, 348,
- 315, 331, 1273, -13, 1273, 63, 1273, -101, 545, 1273,
- -101, 1273, 64, 40, 1273, 2, 2307, -101, 1273, 152,
- 2307, -101, 1273, 69, 1273, 1273, 75, 79, 1273, -101,
- 44, 149, 66, -101, -101, 1273, -101, 369, 1273, -101,
- 52, 1273, -54, 2307, -101, 1273, 151, 2307, -101, -29,
- 369, -41, -11, 2404, -46, -101, 2307, -101, 1273, 131,
- 2307, -5, 2307, -101, 8, 13, -55, -101, -101, 2307,
- -51, 360, -2, 352, 119, 1273, 2307, 39, -19, 366,
- 3, -24, 910, 6, 7, -101, 1367, -101, 11, -16,
- -4, 1273, -6, -31, 1273, 9, 1273, -12, 17, 1273,
- -101, 2210, 37, -101, -101, -101, -101, -101, -101, 1273,
- -101, -101, -101, -101, 258, -101, 1273, -15, -101, 2307,
- -101, 117, -101, -101, 2307, -101, 1273, 106, 16, -101,
- 38, -101, 135, 96, 1273, -101, 135, 43, -101, 18,
- -101, 2307, -101, 101, 2307, -101, 179, -101, -101, 99,
- 2307, 31, -101, -7, -8, -101, 369, -34, -1, -101,
- -101, -101, -101, 1273, 124, 2307, -101, 1273, 122, 2307,
- -101, 25, -101, 207, -101, -101, 1273, -101, -101, 290,
- -101, -101, -101, 114, 1733, -101, -101, 1826, -101, -101,
- 1550, -101, -101, -101, -101, -101, -101, 103, -101, -101,
- -101, -101, -101, -101, -101, -101, 2404, -101, -101, -101,
- 221, -43, 704, 164, -26, 12, -101, -101, 188, -101,
- 196, -101, -101, -101, 369, 183, -101, 1273, -101, 165,
- -101, -101, 170, 0, 369, 160, 10, 369, 113, -101,
- -101, 215, -101, 1273, -101, 225, -101, -101, 203, 369,
- 28, 1273, 229, -101, -101, 202, -101, 218, -101, 30,
- -21, 369, 199, 278, -101, 110, -101, -101, -101, 1640,
- 1092, 583, -101, -101, -101, -101, -101, 284, 2501, 1919,
- 14, 388, 29, 424, 93, 1273, 2307, 39, -9, 338,
- 21, -3, 821, 24, 23, -101, 1367, -101, 48, 20,
- 47, 1273, 50, 26, 1273, 53, 1273, 27, 22, 264,
- 120, -101, 15, 813, -101, -101, -101, -101, -101, 1183,
- -101, -101, 19, -101, -101, 498, -101, 249, -82, 902,
- -101, -101, 118, 369, -101, 204, -101, 80, -101, -101,
- 369, -101, -101, 82, -101, -101, -101, -101, -101, -101,
+ 100, 1288, -101, -101, 70, 59, -101, 1288, -101, -101,
+ 1288, -101, -101, -101, -101, -101, -101, -101, -101, -101,
+ -101, -101, -101, -101, 1288, 41, 1288, 1288, 98, 91,
+ 1288, -101, 2031, 1288, 1288, -101, 121, -101, 73, -101,
+ -101, 39, -101, 385, 180, 78, -101, 391, -101, 64,
+ 2322, -101, -101, -101, -101, -101, 208, -101, -101, 82,
+ -101, -101, -101, -101, -101, -101, 2322, -101, -101, 538,
+ -101, 495, 128, 2419, 54, 358, 62, 44, 2613, 67,
+ 1288, -101, 76, 63, 1288, 58, -101, 60, 46, -101,
+ -101, 309, -101, -101, -101, -101, -101, -101, 86, -101,
+ -101, -101, -101, 107, -101, -101, -101, -101, -101, -101,
+ 28, 52, 1288, 101, 102, -101, -101, 1472, -101, 83,
+ 75, 79, -101, 287, 84, 80, 585, 69, 89, 321,
+ 177, 482, 1288, 297, 1288, 1288, 1288, 1288, 331, 1288,
+ 1288, 1288, 1288, 1288, 332, 222, 332, 332, 332, 410,
+ 410, 410, 1288, 57, 1288, 72, 1288, -101, 658, 1288,
+ -101, 1288, 71, 45, 1288, 61, 2419, -101, 1288, 132,
+ 2419, -101, 1288, 47, 1288, 1288, 66, 65, 1288, -101,
+ 68, 112, 81, -101, -101, 1288, -101, 369, 1288, -101,
+ 85, 1288, 74, 2419, -101, 1288, 122, 2419, -101, 77,
+ 294, 16, -29, 2322, -53, -101, 2419, -101, 1288, 127,
+ 2419, -15, 2419, -101, 10, 11, -34, -101, -101, 2419,
+ -48, 504, 4, 476, 113, 1288, 2419, 2, -28, 420,
+ 6, -21, 719, 7, 87, -101, 1382, -101, -4, -16,
+ 5, 1288, 3, -27, 1288, 9, 1288, -18, -31, 1288,
+ -101, 2225, -7, -101, -101, -101, -101, -101, -101, 1288,
+ -101, -101, -101, -101, 246, -101, 1288, -38, -101, 2419,
+ -101, 88, -101, -101, 2419, -101, 1288, 106, 26, -101,
+ 55, -101, 50, 105, 1288, -101, 48, 38, -101, -8,
+ -101, 2419, -101, 94, 2419, -101, 238, -101, -101, 104,
+ 2419, 31, -101, 21, 19, -101, 305, 1, 30, -101,
+ -101, -101, -101, 1288, 136, 2419, -101, 1288, 134, 2419,
+ -101, 49, -101, 173, -101, -101, 1288, -101, -101, 363,
+ -101, -101, -101, 137, 1565, -101, -101, 1658, -101, -101,
+ 1844, -101, -101, -101, -101, -101, -101, 95, -101, -101,
+ -101, -101, -101, -101, -101, -101, 2322, -101, -101, -101,
+ 92, 15, 925, 169, 27, -6, -101, -101, 212, -101,
+ 191, -101, -101, -101, 323, 211, -101, 1288, -101, 214,
+ -101, -101, 216, 40, 317, 210, 43, 259, 236, -101,
+ 36, -101, 747, 96, -101, 29, 747, -101, -101, 1198,
+ -101, -101, -101, 1107, -101, -101, 231, -101, 1288, -101,
+ 217, 286, 32, -101, -101, -101, 188, 340, 51, 1288,
+ 175, -101, -101, 171, -101, 179, -101, 56, -11, 351,
+ 181, 336, -101, 110, -101, -101, -101, 1934, 647, -101,
+ -101, -101, -101, 253, 2516, 1751, -5, 460, 22, 468,
+ 138, 1288, 2419, 24, -2, 412, 23, -3, 836, 20,
+ 87, -101, 1382, -101, 17, -10, 18, 1288, 25, 8,
+ 1288, 33, 1288, 12, 14, 120, -101, -101, 13, -101,
+ -101, 747, -101, 248, -47, 828, -101, -101, 152, 482,
+ -101, 150, -101, 123, -101, -101, 398, -101, -101, 117,
+ -101, -101, -101, -101, -101, -101,
- -106, 17, -83, 19, 24, 228, -106, -106, -106, -106,
- -106, -106, -106, -106, -106, -106, -106, -106, -106, -49,
- -106, -106, -106, -106, -106, -106, -106, -106, -106, 101,
- -106, -106, -106, 2, -106, -106, -2, 29, 107, 166,
- -106, 204, 183, -106, -106, -106, 174, 169, -106, -106,
- -106, -106, -106, 145, -106, 141, 137, -106, 152, 161,
- -106, -106, -106, -106, 163, 158, 157, -106, -106, -106,
- -106, 132, -106, 142, 138, 187, 178, -106, 167, 181,
- 81, 82, 85, 83, -106, 93, 114, 96, -106, -106,
- -106, -106, -106, -106, -106, -106, -106, -106, -106, 170,
- -106, 74, -106, 109, 80, 51, -106, -106, -106, -106,
+ -106, 6, -92, 10, 5, 278, -106, -106, -106, -106,
+ -106, -106, -106, -106, -106, -106, -106, -106, -106, -42,
+ -106, -106, -106, -106, -106, -106, -106, -106, -106, 109,
+ -106, -106, -106, -10, -106, -106, -35, 24, 73, 90,
+ -106, 219, 181, -106, -106, -106, 171, 120, -106, -106,
+ -106, -106, -106, 174, -106, 170, 167, -106, 175, 163,
+ -106, -106, -106, -106, 184, 177, 180, -106, -106, -106,
+ -106, 125, -106, 132, 134, 162, 130, -106, 121, 124,
+ 123, 141, 142, 152, -106, 154, 161, 160, -106, -106,
+ -106, -106, -106, -106, -106, -106, -106, -106, -106, 139,
+ -106, 143, -106, 156, 91, 55, -106, -106, -106, -106,
-106, -106, -106, -106, -106, -106, -106, -106, -106, -106,
-106, -106, -106, -106, -106, -106, -106, -106, -106, -106,
-106, -106, -106, -106, -106, -106, -106, -106, -106, -106,
- -106, 25, -106, -106, -106, -106, -106, 41, -106, -106,
- 50, -106, -106, -106, -106, -106, -106, -106, -106, -106,
- -106, -106, -106, -106, 98, -106, 104, 43, -106, -106,
- 42, -106, 221, 64, 117, -106, -106, -106, -106, -106,
- -106, -106, -106, 54, -106, -106, -106, 55, -106, -106,
+ -106, 32, -106, -106, -106, -106, -106, 33, -106, -106,
+ 26, -106, -106, -106, -106, -106, -106, -106, -106, -106,
+ -106, -106, -106, -106, 96, -106, 119, 52, -106, -106,
+ 66, -106, 220, 69, 71, -106, -106, -106, -106, -106,
+ -106, -106, -106, 25, -106, -106, -106, 64, -106, -106,
-106, -106, -106, -106, -106, -106, -106, -106, -106, -106,
- -106, -106, -106, -106, -106, -106, 47, -106, -106, 38,
- -106, 33, -106, 92, -106, 73, -106, -106, 88, -106,
- 86, -106, -106, -106, 94, 23, -106, -106, -106, -106,
- -106, -11, -106, -106, -106, -106, -106, -106, -106, -106,
+ -106, -106, -106, -106, -106, -106, 70, -106, -106, 61,
+ -106, 41, -106, 39, -106, 37, -106, -106, 42, -106,
+ 79, -106, -106, -106, 81, 72, -106, -106, -106, -106,
+ -106, -5, -106, -106, -106, -106, -106, -106, -106, -106,
-106, -106, -106, -106, -106, -106, -106, -106, -106, -106,
- -106, -106, 22, -106, -106, -106, -106, 105, -106, -106,
+ -106, -106, 21, -106, -106, -106, -106, 112, -106, -106,
-106, -106, -106, -106, -106, -106, -106, -106, -106, -106,
- -106, 7, 235, -106, 249, 219, 216, 222, -106, 124,
- 125, 123, 122, 116, -106, -106, -106, -106, -106, -106,
- -106, -106, 191, -106, 232, -106, 225, -106, -106, 231,
- -106, 156, -106, -106, 130, -106, 91, -106, 5, -106,
- 8, -106, 233, -106, 200, 189, -106, -106, 198, -106,
- -106, -106, -106, -106, -106, 245, -106, 108, 95, -106,
- -106, 298, -106, 195, -106, 89, -106, 71, -106, -106,
- 120, -106, -106, -5, -106, -106, 52, -106, 53, -106,
- 56, -106, 60, -106, -106, -106, -106, -106, -106, 39,
- -106, 37, -106, 49, -106, 133, 69, -106, -106, 59,
- -106, -106, 102, -106, -106, -106, 79, -106, -106, -106,
- -106, 62, -106, 45, 67, -106, 75, -106, -106, 44,
- -106, 1, -106, -106, -106, -106, -106, -106, -106, 46,
- -106, -106, -106, -106, -106, -106, 115, -106, -106, 66,
- -106, -106, -106, -106, 70, -106, 77, -106, -106, -106,
- -106, -106, -9, -106, 72, -106, -38, -106, -106, -106,
- -106, 97, -106, -106, 99, -106, -106, -106, -106, -106,
- 40, -51, -106, -106, 36, -106, 34, -106, 63, -106,
- -106, -106, -106, 35, -106, 48, -106, 58, -106, 57,
- -106, -106, -106, -106, -106, -106, 28, -106, -106, 90,
- -106, -106, -106, -106, 65, -106, -106, 159, -106, -106,
- 61, -106, -106, -106, -106, -106, -106, -106, -106, -106,
- -106, -106, -106, -106, -106, -106, 87, -106, -106, -106,
- -106, -106, -13, -106, -106, -106, -106, -106, -106, -106,
- -18, -106, -106, -106, -10, -106, -106, 0, -106, -106,
- -106, -106, -106, -106, -4, -12, -106, -6, -106, -106,
- -106, -106, -106, 3, -106, -106, -106, -106, -23, -14,
- -106, 11, -106, -106, -106, -106, -106, 15, -106, -106,
- -106, 16, 18, 14, -106, -106, -106, -106, -106, 292,
- 399, 180, -106, -106, -106, -106, -106, -106, 26, 286,
- 20, 21, -106, 30, -106, 177, 10, -106, -106, 31,
- -106, -106, 193, -106, -106, -106, 32, -106, -106, -106,
- -106, 27, -106, 13, 76, -106, 68, -106, -106, -106,
- -106, -106, -106, 230, -106, -106, -106, -106, -106, 290,
- -106, -106, -3, -106, -106, 6, -106, -106, 4, 270,
- -106, -106, -106, 9, -106, -106, -106, -106, -106, -106,
- 12, -106, -106, -106, -106, -106, -106, -106, -106, -106};
+ -106, 17, 237, -106, 192, 236, 224, 225, -106, 97,
+ 98, 101, 99, 113, -106, -106, -106, -106, -106, -106,
+ -106, -106, 204, -106, 223, -106, 235, -106, -106, 239,
+ -106, 197, -106, -106, 228, -106, 27, -106, 13, -106,
+ 2, -106, 233, -106, 190, 198, -106, -106, 196, -106,
+ -106, -106, -106, -106, -106, 200, -106, 107, 135, -106,
+ -106, 186, -106, 84, -106, 80, -106, 76, -106, -106,
+ 89, -106, -106, -49, -106, -106, 47, -106, 40, -106,
+ 44, -106, 68, -106, -106, -106, -106, -106, -106, 53,
+ -106, 35, -106, 49, -106, 87, 63, -106, -106, 30,
+ -106, -106, 103, -106, -106, -106, 51, -106, -106, -106,
+ -106, 86, -106, 67, 114, -106, 74, -106, -106, 65,
+ -106, 56, -106, -106, -106, -106, -106, -106, -106, 62,
+ -106, -106, -106, -106, -106, -106, 95, -106, -106, 78,
+ -106, -106, -106, -106, 75, -106, 88, -106, -106, -106,
+ -106, -106, -54, -106, 45, -106, -40, -106, -106, -106,
+ -106, 94, -106, -106, 100, -106, -106, -106, -106, -106,
+ 150, -41, -106, -106, 54, -106, 43, -106, 48, -106,
+ -106, -106, -106, 59, -106, 57, -106, 60, -106, 58,
+ -106, -106, -106, -106, -106, -106, 38, -106, -106, 144,
+ -106, -106, -106, -106, 31, -106, -106, 202, -106, -106,
+ 50, -106, -106, -106, -106, -106, -106, -106, -106, -106,
+ -106, -106, -106, -106, -106, -106, 77, -106, -106, -106,
+ -106, -106, 82, -106, -106, -106, -106, -106, -106, -106,
+ -17, -106, -106, -106, -4, -106, -106, 12, -106, -106,
+ -106, -106, -106, -106, -14, 46, -106, -13, -106, -106,
+ -106, -106, 108, -106, -106, -106, 243, -106, -106, 295,
+ -106, -106, -106, 290, -106, -106, -106, -106, 346, -106,
+ -106, -106, 16, -106, -106, -106, 22, 23, -106, 34,
+ -106, -106, -106, -106, -106, 11, -106, -106, -106, 7,
+ 1, 8, -106, -106, -106, -106, -106, 307, 179, -106,
+ -106, -106, -106, -106, 18, 281, 9, 15, -106, 4,
+ -106, 83, 29, -106, -106, -2, -106, -106, 85, -106,
+ -106, -106, 3, -106, -106, -106, -106, 14, -106, 0,
+ 105, -106, 93, -106, -106, -106, -106, -106, -1, -106,
+ -106, 20, -106, -106, 28, 92, -106, -106, -106, 19,
+ -106, -106, -106, -106, -106, -106, -12, -106, -106, -106,
+ -106, -106, -106, -106, -106, -106};
const short QDeclarativeJSGrammar::action_info [] = {
- 401, -123, 440, -121, 403, -129, 333, 340, 615, 345,
- -96, 352, 348, -118, -100, 389, -126, 257, -99, 342,
- 416, 391, 343, 510, 453, 440, 448, 257, -96, 446,
- -100, -118, 440, 348, 527, 541, -129, 525, 552, 555,
- 538, 545, 466, 424, 399, 408, -110, 560, 560, 420,
- 431, 444, 560, 457, -121, -99, 416, -123, 457, 440,
- -126, 325, 306, 453, 272, 190, 294, 164, 187, 170,
- 257, 272, 141, 430, 346, 312, 296, 312, 409, 414,
- 294, 348, 251, 101, 99, 252, 318, 416, 236, 292,
- 453, 457, 440, 183, 141, 189, 71, 335, 639, 164,
- 147, 304, 179, 71, 99, 443, 427, 301, 434, 141,
- 0, 141, 141, 331, 141, 0, 0, 292, 58, 444,
- 141, 149, 477, 62, 0, 58, 0, 314, 603, 59,
- 141, 315, 141, 172, 63, 141, 59, 247, 246, 141,
- 424, 629, 628, 635, 634, 256, 255, 58, 615, 242,
- 241, 428, 173, 101, 249, 248, 58, 327, 59, 141,
- 141, 249, 248, 488, 254, 166, 418, 59, 142, 167,
- 478, 557, 556, 141, 530, 529, 604, 172, 413, 412,
- 249, 248, 459, 177, 455, 172, 85, 141, 86, 511,
- 517, 350, 85, 523, 86, 559, 173, 64, 174, 87,
- 85, 85, 86, 86, 173, 87, 406, 64, 141, 64,
- 328, 337, 310, 87, 87, 469, 85, 85, 86, 86,
- 0, 560, 533, 0, 0, 511, 521, 520, 511, 87,
- 87, 0, 511, 141, 0, 513, 172, 141, 547, 513,
- 438, 437, 65, 0, 518, 516, 512, 511, 66, 0,
- 512, 103, 65, 0, 65, 173, 274, 275, 66, 0,
- 66, 235, 234, 548, 546, 632, 631, 0, 470, 468,
- 104, 513, 105, 172, 513, 0, 534, 532, 513, 172,
- 561, 0, 512, 276, 277, 512, 537, 536, 34, 512,
- 544, 543, 173, 513, 406, 630, 625, -87, 173, 172,
- 174, 73, 74, 0, 512, 274, 275, 34, 0, 0,
- 626, 624, 0, 0, 73, 74, 0, -87, 173, 34,
- 174, 0, 85, 34, 86, 48, 50, 49, 75, 76,
- 0, 0, 276, 277, 0, 87, 0, 0, 279, 280,
- 623, 75, 76, 0, 48, 50, 49, 281, 0, 0,
- 282, 45, 283, 34, 279, 280, 48, 50, 49, 0,
- 48, 50, 49, 281, 279, 280, 282, 34, 283, 0,
- 45, 279, 280, 281, -341, 0, 282, 0, 283, 0,
- 281, 34, 45, 282, 0, 283, 45, 279, 280, 34,
- 48, 50, 49, 0, 0, 34, 281, 0, 34, 282,
- 0, 283, -341, 0, 48, 50, 49, 6, 5, 4,
- 1, 3, 2, 245, 244, 0, 45, 34, 48, 50,
- 49, 240, 239, 0, 0, 0, 48, 50, 49, 0,
- 45, 0, 48, 50, 49, 48, 50, 49, 0, 0,
- 0, 0, 0, 0, 45, 0, 0, 0, 0, 240,
- 239, 0, 45, 34, 48, 50, 49, 0, 45, 0,
- 0, 45, 34, 0, 0, 34, 0, 0, 0, 0,
- 78, 79, 0, 0, 0, 0, 0, 0, 80, 81,
- 45, 0, 82, 0, 83, 245, 244, 0, 0, 0,
- 48, 50, 49, 0, 245, 244, 0, 240, 239, 48,
- 50, 49, 48, 50, 49, 0, 0, 0, 0, 0,
- 30, 31, 0, 0, 0, 0, 45, 0, 0, 0,
- 33, 0, 0, 0, 0, 45, 0, 34, 45, 0,
+ 399, 352, 345, -101, 343, 457, 440, 403, 257, -112,
+ -125, -131, -123, -98, -120, 348, -128, 389, 453, 391,
+ 416, 401, 408, 563, -101, -123, 416, -120, 539, -131,
+ -98, -112, -125, 348, 257, 99, 71, 645, 621, 101,
+ -128, 440, 141, 621, 164, 431, 539, 430, 453, 573,
+ 457, 444, 440, 424, 71, 424, 101, 446, 559, 420,
+ 424, 448, 539, 440, 570, 539, 466, 527, 312, 346,
+ 532, 312, 318, 272, 409, 183, 342, 525, 147, 141,
+ 348, 510, 457, 414, 272, 325, 0, 0, 252, 99,
+ 257, 440, 296, 556, -102, 292, 453, 190, 170, 416,
+ 164, 434, 141, 141, 536, 251, 304, 172, 141, 141,
+ 443, 0, 335, 340, 141, 427, 0, 0, 0, 149,
+ 327, 306, 0, 292, 444, 0, 173, 0, 536, 141,
+ 141, 0, 0, 179, 333, 141, 294, 236, 189, 314,
+ 141, 301, 141, 315, 141, 477, 331, 242, 241, 413,
+ 412, 62, 537, 166, 58, 488, 142, 167, 294, 58,
+ 428, 254, 63, 256, 255, 59, 418, 172, 247, 246,
+ 59, 575, 574, 328, 249, 248, 616, 177, 641, 640,
+ 58, 469, 337, 141, 635, 634, 173, 350, 187, 249,
+ 248, 59, 310, 478, 459, 58, 455, 64, 523, 249,
+ 248, 85, 85, 86, 86, 103, 59, 565, 511, 172,
+ 511, 638, 637, 64, 87, 87, 141, 511, 517, 577,
+ 511, 0, 141, 0, 104, 141, 105, 85, 173, 86,
+ 174, 172, 566, 564, 470, 468, 562, 561, 548, 511,
+ 87, 636, 65, 530, 513, 539, 141, 85, 66, 86,
+ 173, 0, 406, 0, 513, 512, 513, 64, 65, 0,
+ 87, 172, 0, 513, 66, 512, 513, 512, 172, 235,
+ 234, 0, 518, 516, 512, 521, 520, 512, 554, 553,
+ 173, 85, 406, 86, 0, 513, -89, 173, 34, 174,
+ 73, 74, 549, 547, 87, 631, 512, 531, 529, 438,
+ 437, 172, 65, 0, 578, 274, 275, 0, 66, 632,
+ 630, 34, 0, 73, 74, 274, 275, 75, 76, -89,
+ 173, 0, 174, 34, 0, 48, 50, 49, 0, 0,
+ 0, 0, 276, 277, 34, 0, 0, 0, 34, 629,
+ 75, 76, 276, 277, 279, 280, 34, 0, 48, 50,
+ 49, 45, 34, 281, 279, 280, 282, 85, 283, 86,
+ 48, 50, 49, 281, 0, 34, 282, 0, 283, 34,
+ 87, 48, 50, 49, 45, 48, 50, 49, 0, 0,
+ 34, 0, 0, 48, 50, 49, 45, 34, 0, 48,
+ 50, 49, 34, 0, 0, 0, 0, 45, 34, 0,
+ 0, 45, 48, 50, 49, 0, 48, 50, 49, 45,
+ 0, 0, 0, 0, 34, 45, 0, 48, 50, 49,
+ 34, 0, 0, 0, 48, 50, 49, 34, 45, 48,
+ 50, 49, 45, 279, 280, 48, 50, 49, 0, 0,
+ 0, 34, 281, 45, 0, 282, 0, 283, -343, 34,
+ 45, 48, 50, 49, 0, 45, -343, 48, 50, 49,
+ 0, 45, 78, 79, 48, 50, 49, 0, 0, 0,
+ 80, 81, 0, 0, 82, 0, 83, 45, 48, 50,
+ 49, 0, 0, 45, 78, 79, 48, 50, 49, 34,
+ 45, 0, 80, 81, 78, 79, 82, 34, 83, 0,
+ 0, 0, 80, 81, 45, 34, 82, 0, 83, 0,
+ 0, 34, 45, 0, 6, 5, 4, 1, 3, 2,
+ 0, 240, 239, 0, 34, 0, 48, 50, 49, 245,
+ 244, 0, 0, 34, 48, 50, 49, 245, 244, 0,
+ 0, 0, 48, 50, 49, 0, 0, 0, 48, 50,
+ 49, 0, 45, 0, 0, 0, 245, 244, 0, 0,
+ 45, 48, 50, 49, 0, 240, 239, 34, 45, 0,
+ 48, 50, 49, 0, 45, 0, 0, 0, 0, 0,
+ 0, 0, 0, 78, 79, 0, 0, 45, 151, 0,
+ 0, 80, 81, 0, 0, 82, 45, 83, 152, 240,
+ 239, 0, 153, 0, 48, 50, 49, 0, 0, 0,
+ 0, 154, 0, 155, 0, 0, 308, 0, 0, 0,
+ 0, 0, 0, 0, 156, 0, 157, 62, 0, 0,
+ 45, 0, 0, 0, 158, 0, 0, 159, 63, 0,
+ 0, 0, 0, 160, 0, 0, 0, 0, 0, 161,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 30,
+ 31, 151, 0, 0, 0, 162, 0, 0, 0, 33,
+ 0, 152, 0, 0, 0, 153, 34, 0, 0, 0,
+ 35, 36, 0, 37, 154, 0, 155, 0, 0, 0,
+ 502, 0, 0, 0, 44, 0, 0, 156, 0, 157,
+ 62, 0, 0, 0, 0, 0, 0, 158, 0, 0,
+ 159, 63, 51, 48, 50, 49, 160, 52, 0, 0,
+ 0, 0, 161, 0, 0, 0, 0, 0, 43, 54,
+ 32, 30, 31, 0, 40, 0, 0, 0, 162, 45,
+ 0, 33, 0, 0, 0, 0, 0, 0, 34, 0,
+ 0, 0, 35, 36, 0, 37, 0, 0, 0, 30,
+ 31, 0, 41, 0, 0, 0, 44, 0, 0, 33,
+ 0, 0, 0, 0, 0, 0, 34, 0, 0, 0,
+ 35, 36, 0, 37, 51, 48, 50, 49, 0, 52,
+ 502, 0, 0, 0, 44, 0, 0, 0, 0, 0,
+ 43, 54, 32, 0, 0, 0, 40, 0, 0, 0,
+ 0, 45, 51, 48, 50, 49, 0, 52, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 43, 54,
+ 32, 0, 0, 0, 40, 0, 0, 0, 0, 45,
+ 30, 31, 0, 0, 0, 0, 0, 0, 30, 31,
+ 33, 0, 0, 0, 0, 0, 0, 34, 33, 0,
+ 0, 35, 36, 0, 37, 34, 0, 0, 0, 35,
+ 36, 502, 37, 0, 0, 44, 0, 0, 0, 41,
+ 0, 0, 0, 44, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 51, 48, 50, 49, 0, 52, 0,
+ 0, 51, 48, 50, 49, 0, 52, 0, 0, 43,
+ 54, 32, 0, 0, 0, 40, 0, 43, 54, 32,
+ 45, 0, 0, 40, 0, 0, 0, 0, 45, 30,
+ 31, 0, 0, 0, 0, 0, 0, 30, 31, 33,
+ 0, 0, 0, 0, 0, 0, 34, 33, 0, 0,
+ 35, 36, 0, 37, 34, 0, 0, 0, 35, 36,
+ 41, 37, 0, 0, 44, 0, 0, 0, 502, 0,
+ 0, 0, 44, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 51, 48, 50, 49, 0, 52, 0, 0,
+ 51, 48, 50, 49, 0, 52, 0, 0, 43, 54,
+ 32, 0, 0, 0, 40, 0, 43, 54, 32, 45,
+ 0, 0, 40, 0, 0, 0, 0, 45, 0, 0,
+ 0, 0, 0, 0, 0, 0, 501, 0, 30, 31,
+ 0, 0, 0, 0, 0, 0, 0, 0, 215, 0,
+ 0, 0, 0, 0, 0, 34, 0, 0, 0, 35,
+ 36, 0, 37, 0, 0, 0, 0, 0, 0, 502,
+ 0, 0, 0, 44, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 51, 503, 505, 504, 0, 52, 0, 0, 0,
+ 0, 226, 0, 0, 0, 0, 0, 43, 54, 32,
+ 210, 0, 0, 40, 0, 0, 0, 0, 45, 0,
+ 0, 0, 0, 0, 0, 0, 0, 501, 0, 30,
+ 31, 0, 0, 0, 0, 0, 0, 0, 0, 215,
+ 0, 0, 0, 0, 0, 0, 34, 0, 0, 0,
+ 35, 36, 0, 37, 0, 0, 0, 0, 0, 0,
+ 502, 0, 0, 0, 44, 0, 0, 0, 0, 0,
+ 0, 0, 544, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 51, 503, 505, 504, 0, 52, 0, 0,
+ 0, 0, 226, 0, 0, 0, 0, 0, 43, 54,
+ 32, 210, 0, 0, 40, 0, 0, 0, 0, 45,
+ 0, 0, 0, 0, 0, 0, 0, 0, 501, 0,
+ 30, 31, 0, 0, 0, 0, 0, 0, 0, 0,
+ 215, 0, 0, 0, 0, 0, 0, 34, 0, 0,
0, 35, 36, 0, 37, 0, 0, 0, 0, 0,
- 0, 502, 0, 0, 0, 44, 0, 0, 151, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 152, 0,
- 0, 0, 153, 51, 48, 50, 49, 0, 52, 0,
- 0, 154, 0, 155, 0, 0, 0, 0, 0, 43,
- 54, 32, 0, 0, 156, 40, 157, 62, 0, 0,
- 45, 0, 0, 0, 158, 30, 31, 159, 63, 0,
- 0, 0, 0, 160, 0, 33, 0, 0, 0, 161,
- 0, 0, 34, 0, 0, 0, 35, 36, 0, 37,
- 0, 0, 0, 0, 0, 162, 502, 0, 0, 0,
- 44, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 151, 0, 51, 48,
- 50, 49, 0, 52, 0, 0, 152, 0, 0, 0,
- 153, 0, 0, 0, 43, 54, 32, 0, 0, 154,
- 40, 155, 0, 0, 308, 45, 0, 0, 0, 0,
- 0, 0, 156, 0, 157, 62, 0, 0, 0, 0,
- 0, 0, 158, 0, 0, 159, 63, 0, 0, 0,
- 0, 160, 0, 0, 0, 0, 0, 161, 0, 0,
- 0, 0, 0, 0, 0, 0, 30, 31, 0, 0,
- 0, 0, 0, 162, 0, 0, 33, 0, 0, 0,
- 0, 0, 0, 34, 0, 0, 0, 35, 36, 0,
- 37, 0, 0, 0, 30, 31, 0, 502, 0, 0,
- 0, 44, 0, 0, 33, 0, 0, 0, 0, 0,
- 0, 34, 0, 0, 0, 35, 36, 0, 37, 51,
- 48, 50, 49, 0, 52, 41, 0, 0, 0, 44,
- 0, 0, 0, 0, 0, 43, 54, 32, 0, 0,
- 0, 40, 0, 0, 0, 0, 45, 51, 48, 50,
- 49, 0, 52, 0, 0, 0, 0, 0, 0, 0,
+ 0, 502, 0, 0, 0, 44, 0, 0, 0, 0,
+ 0, 0, 0, 541, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 51, 503, 505, 504, 0, 52, 0,
+ 0, 0, 0, 226, 0, 0, 0, 0, 0, 43,
+ 54, 32, 210, 0, 0, 40, 0, 0, 0, 0,
+ 45, 0, 0, 0, 0, 0, 0, 0, 0, 29,
+ 30, 31, 0, 0, 0, 0, 0, 0, 0, 0,
+ 33, 0, 0, 0, 0, 0, 0, 34, 0, 0,
+ 0, 35, 36, 0, 37, 0, 0, 0, 38, 0,
+ 39, 41, 42, 0, 0, 44, 0, 0, 0, 46,
+ 0, 47, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 51, 48, 50, 49, 0, 52, 0,
+ 53, 0, 55, 0, 56, 0, 0, 0, 0, 43,
+ 54, 32, 0, 0, 0, 40, 0, 0, 0, 0,
+ 45, 0, 0, 0, 0, 0, 0, 0, 0, -121,
+ 0, 0, 0, 29, 30, 31, 0, 0, 0, 0,
+ 0, 0, 0, 0, 33, 0, 0, 0, 0, 0,
+ 0, 34, 0, 0, 0, 35, 36, 0, 37, 0,
+ 0, 0, 38, 0, 39, 41, 42, 0, 0, 44,
+ 0, 0, 0, 46, 0, 47, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 51, 48, 50,
+ 49, 0, 52, 0, 53, 0, 55, 0, 56, 0,
0, 0, 0, 43, 54, 32, 0, 0, 0, 40,
- 0, 0, 0, 0, 45, 30, 31, 0, 0, 0,
- 0, 0, 0, 30, 31, 33, 0, 0, 0, 0,
- 0, 0, 34, 33, 0, 0, 35, 36, 0, 37,
- 34, 0, 0, 0, 35, 36, 502, 37, 0, 0,
- 44, 0, 0, 0, 41, 0, 0, 0, 44, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 51, 48,
- 50, 49, 0, 52, 0, 0, 51, 48, 50, 49,
- 0, 52, 0, 0, 43, 54, 32, 0, 0, 0,
- 40, 0, 43, 54, 32, 45, 0, 0, 40, 0,
- 0, 0, 0, 45, 30, 31, 0, 0, 0, 0,
- 0, 0, 30, 31, 33, 0, 0, 0, 0, 0,
- 0, 34, 33, 0, 0, 35, 36, 0, 37, 34,
- 0, 0, 0, 35, 36, 502, 37, 0, 0, 44,
- 0, 0, 0, 41, 0, 0, 0, 44, 0, 0,
+ 0, 0, 0, 0, 45, 0, 0, 0, 0, 0,
+ 0, 0, 0, 29, 30, 31, 0, 0, 0, 0,
+ 0, 0, 0, 0, 33, 0, 0, 0, 0, 0,
+ 0, 34, 0, 0, 0, 35, 36, 0, 37, 0,
+ 0, 0, 38, 0, 39, 41, 42, 0, 0, 44,
+ 0, 0, 0, 46, 0, 47, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 51, 48, 50,
- 49, 0, 52, 0, 0, 51, 48, 50, 49, 0,
- 52, 0, 0, 43, 54, 32, 0, 0, 0, 40,
- 0, 43, 54, 32, 45, 0, 0, 40, 0, 0,
- 0, 0, 45, 0, 0, 0, 0, 0, 0, 0,
- 0, 501, 0, 30, 31, 0, 0, 0, 0, 0,
- 0, 0, 0, 215, 0, 0, 0, 0, 0, 0,
+ 49, 0, 52, 0, 53, 0, 55, 271, 56, 0,
+ 0, 0, 0, 43, 54, 32, 0, 0, 0, 40,
+ 0, 0, 0, 0, 45, 0, 0, 0, 0, 0,
+ 0, 0, 0, 483, 0, 0, 29, 30, 31, 0,
+ 0, 0, 0, 0, 0, 0, 0, 33, 0, 0,
+ 0, 0, 0, 0, 34, 0, 0, 0, 35, 36,
+ 0, 37, 0, 0, 0, 38, 0, 39, 41, 42,
+ 0, 0, 44, 0, 0, 0, 46, 0, 47, 0,
+ 0, 486, 0, 0, 0, 0, 0, 0, 0, 0,
+ 51, 48, 50, 49, 0, 52, 0, 53, 0, 55,
+ 0, 56, 0, 0, 0, 0, 43, 54, 32, 0,
+ 0, 0, 40, 0, 0, 0, 0, 45, 0, 0,
+ 0, 0, 0, 0, 0, 0, 475, 0, 0, 29,
+ 30, 31, 0, 0, 0, 0, 0, 0, 0, 0,
+ 33, 0, 0, 0, 0, 0, 0, 34, 0, 0,
+ 0, 35, 36, 0, 37, 0, 0, 0, 38, 0,
+ 39, 41, 42, 0, 0, 44, 0, 0, 0, 46,
+ 0, 47, 0, 0, 481, 0, 0, 0, 0, 0,
+ 0, 0, 0, 51, 48, 50, 49, 0, 52, 0,
+ 53, 0, 55, 0, 56, 0, 0, 0, 0, 43,
+ 54, 32, 0, 0, 0, 40, 0, 0, 0, 0,
+ 45, 0, 0, 0, 0, 0, 0, 0, 0, 475,
+ 0, 0, 29, 30, 31, 0, 0, 0, 0, 0,
+ 0, 0, 0, 33, 0, 0, 0, 0, 0, 0,
34, 0, 0, 0, 35, 36, 0, 37, 0, 0,
- 0, 0, 0, 0, 502, 0, 0, 0, 44, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 51, 503, 505, 504,
- 0, 52, 0, 0, 0, 0, 226, 0, 0, 0,
- 0, 0, 43, 54, 32, 210, 0, 0, 40, 0,
+ 0, 38, 0, 39, 41, 42, 0, 0, 44, 0,
+ 0, 0, 46, 0, 47, 0, 0, 476, 0, 0,
+ 0, 0, 0, 0, 0, 0, 51, 48, 50, 49,
+ 0, 52, 0, 53, 0, 55, 0, 56, 0, 0,
+ 0, 0, 43, 54, 32, 0, 0, 0, 40, 0,
0, 0, 0, 45, 0, 0, 0, 0, 0, 0,
- 0, 0, 501, 0, 30, 31, 0, 0, 0, 0,
- 0, 0, 0, 0, 215, 0, 0, 0, 0, 0,
- 0, 34, 0, 0, 0, 35, 36, 0, 37, 0,
- 0, 0, 0, 0, 0, 502, 0, 0, 0, 44,
- 0, 0, 0, 0, 0, 0, 0, 607, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 51, 503, 505,
- 504, 0, 52, 0, 0, 0, 0, 226, 0, 0,
- 0, 0, 0, 43, 54, 32, 210, 0, 0, 40,
- 0, 0, 0, 0, 45, 0, 0, 0, 0, 0,
- 0, 0, 0, 501, 0, 30, 31, 0, 0, 0,
- 0, 0, 0, 0, 0, 215, 0, 0, 0, 0,
- 0, 0, 34, 0, 0, 0, 35, 36, 0, 37,
- 0, 0, 0, 0, 0, 0, 502, 0, 0, 0,
- 44, 0, 0, 0, 0, 0, 0, 0, 610, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 51, 503,
- 505, 504, 0, 52, 0, 0, 0, 0, 226, 0,
- 0, 0, 0, 0, 43, 54, 32, 210, 0, 0,
- 40, 0, 0, 0, 0, 45, 0, 0, 0, 0,
- 0, 0, 0, 0, 29, 30, 31, 0, 0, 0,
- 0, 0, 0, 0, 0, 33, 0, 0, 0, 0,
- 0, 0, 34, 0, 0, 0, 35, 36, 0, 37,
- 0, 0, 0, 38, 0, 39, 41, 42, 0, 0,
- 44, 0, 0, 0, 46, 0, 47, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 51, 48,
- 50, 49, 0, 52, 0, 53, 0, 55, 0, 56,
- 0, 0, 0, 0, 43, 54, 32, 0, 0, 0,
- 40, 0, 0, 0, 0, 45, 0, 0, 0, 0,
- 0, 0, 0, 0, -119, 0, 0, 0, 29, 30,
- 31, 0, 0, 0, 0, 0, 0, 0, 0, 33,
- 0, 0, 0, 0, 0, 0, 34, 0, 0, 0,
- 35, 36, 0, 37, 0, 0, 0, 38, 0, 39,
- 41, 42, 0, 0, 44, 0, 0, 0, 46, 0,
- 47, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 51, 48, 50, 49, 0, 52, 0, 53,
- 0, 55, 0, 56, 0, 0, 0, 0, 43, 54,
- 32, 0, 0, 0, 40, 0, 0, 0, 0, 45,
- 0, 0, 0, 0, 0, 0, 0, 0, 29, 30,
- 31, 0, 0, 0, 0, 0, 0, 0, 0, 33,
- 0, 0, 0, 0, 0, 0, 34, 0, 0, 0,
- 35, 36, 0, 37, 0, 0, 0, 38, 0, 39,
- 41, 42, 0, 0, 44, 0, 0, 0, 46, 0,
- 47, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 51, 48, 50, 49, 0, 52, 0, 53,
- 0, 55, 271, 56, 0, 0, 0, 0, 43, 54,
- 32, 0, 0, 0, 40, 0, 0, 0, 0, 45,
- 0, 0, 0, 0, 0, 0, 0, 0, 483, 0,
- 0, 29, 30, 31, 0, 0, 0, 0, 0, 0,
- 0, 0, 33, 0, 0, 0, 0, 0, 0, 34,
- 0, 0, 0, 35, 36, 0, 37, 0, 0, 0,
- 38, 0, 39, 41, 42, 0, 0, 44, 0, 0,
- 0, 46, 0, 47, 0, 0, 484, 0, 0, 0,
- 0, 0, 0, 0, 0, 51, 48, 50, 49, 0,
- 52, 0, 53, 0, 55, 0, 56, 0, 0, 0,
- 0, 43, 54, 32, 0, 0, 0, 40, 0, 0,
- 0, 0, 45, 0, 0, 0, 0, 0, 0, 0,
- 0, 29, 30, 31, 0, 0, 0, 0, 0, 0,
- 0, 0, 33, 0, 0, 0, 0, 0, 0, 34,
- 217, 0, 0, 568, 569, 0, 37, 0, 0, 0,
- 38, 0, 39, 41, 42, 0, 0, 44, 0, 0,
- 0, 46, 0, 47, 0, 0, 0, 0, 0, 0,
- 0, 221, 0, 0, 0, 51, 48, 50, 49, 0,
- 52, 0, 53, 0, 55, 0, 56, 0, 0, 0,
- 0, 43, 54, 32, 0, 0, 0, 40, 0, 0,
- 0, 0, 45, 0, 0, 0, 0, 0, 0, 0,
- 0, 483, 0, 0, 29, 30, 31, 0, 0, 0,
- 0, 0, 0, 0, 0, 33, 0, 0, 0, 0,
- 0, 0, 34, 0, 0, 0, 35, 36, 0, 37,
- 0, 0, 0, 38, 0, 39, 41, 42, 0, 0,
- 44, 0, 0, 0, 46, 0, 47, 0, 0, 486,
- 0, 0, 0, 0, 0, 0, 0, 0, 51, 48,
- 50, 49, 0, 52, 0, 53, 0, 55, 0, 56,
- 0, 0, 0, 0, 43, 54, 32, 0, 0, 0,
- 40, 0, 0, 0, 0, 45, 0, 0, 0, 0,
- 0, 0, 0, 0, 475, 0, 0, 29, 30, 31,
- 0, 0, 0, 0, 0, 0, 0, 0, 33, 0,
- 0, 0, 0, 0, 0, 34, 0, 0, 0, 35,
- 36, 0, 37, 0, 0, 0, 38, 0, 39, 41,
- 42, 0, 0, 44, 0, 0, 0, 46, 0, 47,
- 0, 0, 481, 0, 0, 0, 0, 0, 0, 0,
- 0, 51, 48, 50, 49, 0, 52, 0, 53, 0,
- 55, 0, 56, 0, 0, 0, 0, 43, 54, 32,
- 0, 0, 0, 40, 0, 0, 0, 0, 45, 0,
- 0, 0, 0, 0, 0, 0, 0, 475, 0, 0,
- 29, 30, 31, 0, 0, 0, 0, 0, 0, 0,
- 0, 33, 0, 0, 0, 0, 0, 0, 34, 0,
- 0, 0, 35, 36, 0, 37, 0, 0, 0, 38,
- 0, 39, 41, 42, 0, 0, 44, 0, 0, 0,
- 46, 0, 47, 0, 0, 476, 0, 0, 0, 0,
- 0, 0, 0, 0, 51, 48, 50, 49, 0, 52,
- 0, 53, 0, 55, 0, 56, 0, 0, 0, 0,
- 43, 54, 32, 0, 0, 0, 40, 0, 0, 0,
- 0, 45, 0, 0, 0, 0, 0, 0, 0, 0,
- 109, 110, 111, 0, 0, 113, 115, 116, 0, 0,
- 117, 0, 118, 0, 0, 0, 120, 121, 122, 0,
- 0, 0, 0, 0, 0, 34, 123, 124, 125, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 126,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 129, 0, 0, 0, 0,
- 0, 0, 48, 50, 49, 130, 131, 132, 0, 134,
- 135, 136, 137, 138, 139, 0, 0, 127, 133, 119,
- 112, 114, 128, 0, 0, 0, 0, 0, 45, 0,
- 0, 0, 0, 0, 0, 0, 0, 109, 110, 111,
- 0, 0, 113, 115, 116, 0, 0, 117, 0, 118,
- 0, 0, 0, 120, 121, 122, 0, 0, 0, 0,
- 0, 0, 393, 123, 124, 125, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 126, 0, 0, 0,
- 394, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 129, 0, 0, 0, 0, 0, 398, 395,
- 397, 0, 130, 131, 132, 0, 134, 135, 136, 137,
- 138, 139, 0, 0, 127, 133, 119, 112, 114, 128,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 109, 110, 111, 0, 0, 113,
- 115, 116, 0, 0, 117, 0, 118, 0, 0, 0,
- 120, 121, 122, 0, 0, 0, 0, 0, 0, 393,
- 123, 124, 125, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 126, 0, 0, 0, 394, 0, 0,
- 0, 0, 0, 0, 0, 396, 0, 0, 0, 129,
- 0, 0, 0, 0, 0, 398, 395, 397, 0, 130,
- 131, 132, 0, 134, 135, 136, 137, 138, 139, 0,
- 0, 127, 133, 119, 112, 114, 128, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 209, 0, 0, 0, 0, 211, 0, 29, 30,
- 31, 213, 0, 0, 0, 0, 0, 0, 214, 33,
- 0, 0, 0, 0, 0, 0, 216, 217, 0, 0,
- 218, 36, 0, 37, 0, 0, 0, 38, 0, 39,
- 41, 42, 0, 0, 44, 0, 0, 0, 46, 0,
- 47, 0, 0, 0, 0, 0, 220, 0, 221, 0,
- 0, 0, 51, 219, 222, 49, 223, 52, 224, 53,
- 225, 55, 226, 56, 227, 228, 0, 0, 43, 54,
- 32, 210, 212, 0, 40, 0, 0, 0, 0, 45,
- 0, 0, 0, 0, 0, 0, 0, 0, 209, 0,
- 0, 0, 0, 211, 0, 29, 30, 31, 213, 0,
- 0, 0, 0, 0, 0, 214, 215, 0, 0, 0,
- 0, 0, 0, 216, 217, 0, 0, 218, 36, 0,
+ 0, 0, 483, 0, 0, 29, 30, 31, 0, 0,
+ 0, 0, 0, 0, 0, 0, 33, 0, 0, 0,
+ 0, 0, 0, 34, 0, 0, 0, 35, 36, 0,
+ 37, 0, 0, 0, 38, 0, 39, 41, 42, 0,
+ 0, 44, 0, 0, 0, 46, 0, 47, 0, 0,
+ 484, 0, 0, 0, 0, 0, 0, 0, 0, 51,
+ 48, 50, 49, 0, 52, 0, 53, 0, 55, 0,
+ 56, 0, 0, 0, 0, 43, 54, 32, 0, 0,
+ 0, 40, 0, 0, 0, 0, 45, 0, 0, 0,
+ 0, 0, 0, 0, 0, 29, 30, 31, 0, 0,
+ 0, 0, 0, 0, 0, 0, 33, 0, 0, 0,
+ 0, 0, 0, 34, 217, 0, 0, 584, 585, 0,
37, 0, 0, 0, 38, 0, 39, 41, 42, 0,
0, 44, 0, 0, 0, 46, 0, 47, 0, 0,
- 0, 0, 0, 220, 0, 221, 0, 0, 0, 51,
- 219, 222, 49, 223, 52, 224, 53, 225, 55, 226,
- 56, 227, 228, 0, 0, 43, 54, 32, 210, 212,
+ 0, 0, 0, 0, 0, 221, 0, 0, 0, 51,
+ 48, 50, 49, 0, 52, 0, 53, 0, 55, 0,
+ 56, 0, 0, 0, 0, 43, 54, 32, 0, 0,
0, 40, 0, 0, 0, 0, 45, 0, 0, 0,
- 0, 0, 0, 0, 0, 571, 110, 111, 0, 0,
- 573, 115, 575, 30, 31, 576, 0, 118, 0, 0,
- 0, 120, 578, 579, 0, 0, 0, 0, 0, 0,
- 580, 581, 124, 125, 218, 36, 0, 37, 0, 0,
- 0, 38, 0, 39, 582, 42, 0, 0, 584, 0,
- 0, 0, 46, 0, 47, 0, 0, 0, 0, 0,
- 586, 0, 221, 0, 0, 0, 588, 585, 587, 49,
- 589, 590, 591, 53, 593, 594, 595, 596, 597, 598,
- 0, 0, 583, 592, 577, 572, 574, 128, 40, 0,
+ 0, 0, 0, 0, 0, 109, 110, 111, 0, 0,
+ 113, 115, 116, 0, 0, 117, 0, 118, 0, 0,
+ 0, 120, 121, 122, 0, 0, 0, 0, 0, 0,
+ 34, 123, 124, 125, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 126, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 129, 0, 0, 0, 0, 0, 0, 48, 50, 49,
+ 130, 131, 132, 0, 134, 135, 136, 137, 138, 139,
+ 0, 0, 127, 133, 119, 112, 114, 128, 0, 0,
0, 0, 0, 45, 0, 0, 0, 0, 0, 0,
- 0, 0, 361, 110, 111, 0, 0, 363, 115, 365,
- 30, 31, 366, 0, 118, 0, 0, 0, 120, 368,
- 369, 0, 0, 0, 0, 0, 0, 370, 371, 124,
- 125, 218, 36, 0, 37, 0, 0, 0, 38, 0,
- 39, 372, 42, 0, 0, 374, 0, 0, 0, 46,
- 0, 47, 0, -265, 0, 0, 0, 376, 0, 221,
- 0, 0, 0, 378, 375, 377, 49, 379, 380, 381,
- 53, 383, 384, 385, 386, 387, 388, 0, 0, 373,
- 382, 367, 362, 364, 128, 40, 0, 0, 0, 0,
- 45, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 109, 110, 111, 0, 0, 113, 115, 116,
+ 0, 0, 117, 0, 118, 0, 0, 0, 120, 121,
+ 122, 0, 0, 0, 0, 0, 0, 393, 123, 124,
+ 125, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 126, 0, 0, 0, 394, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 129, 0, 0,
+ 0, 0, 0, 398, 395, 397, 0, 130, 131, 132,
+ 0, 134, 135, 136, 137, 138, 139, 0, 0, 127,
+ 133, 119, 112, 114, 128, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 109,
+ 110, 111, 0, 0, 113, 115, 116, 0, 0, 117,
+ 0, 118, 0, 0, 0, 120, 121, 122, 0, 0,
+ 0, 0, 0, 0, 393, 123, 124, 125, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 126, 0,
+ 0, 0, 394, 0, 0, 0, 0, 0, 0, 0,
+ 396, 0, 0, 0, 129, 0, 0, 0, 0, 0,
+ 398, 395, 397, 0, 130, 131, 132, 0, 134, 135,
+ 136, 137, 138, 139, 0, 0, 127, 133, 119, 112,
+ 114, 128, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 209, 0, 0, 0,
+ 0, 211, 0, 29, 30, 31, 213, 0, 0, 0,
+ 0, 0, 0, 214, 215, 0, 0, 0, 0, 0,
+ 0, 216, 217, 0, 0, 218, 36, 0, 37, 0,
+ 0, 0, 38, 0, 39, 41, 42, 0, 0, 44,
+ 0, 0, 0, 46, 0, 47, 0, 0, 0, 0,
+ 0, 220, 0, 221, 0, 0, 0, 51, 219, 222,
+ 49, 223, 52, 224, 53, 225, 55, 226, 56, 227,
+ 228, 0, 0, 43, 54, 32, 210, 212, 0, 40,
+ 0, 0, 0, 0, 45, 0, 0, 0, 0, 0,
+ 0, 0, 0, 209, 0, 0, 0, 0, 211, 0,
+ 29, 30, 31, 213, 0, 0, 0, 0, 0, 0,
+ 214, 33, 0, 0, 0, 0, 0, 0, 216, 217,
+ 0, 0, 218, 36, 0, 37, 0, 0, 0, 38,
+ 0, 39, 41, 42, 0, 0, 44, 0, 0, 0,
+ 46, 0, 47, 0, 0, 0, 0, 0, 220, 0,
+ 221, 0, 0, 0, 51, 219, 222, 49, 223, 52,
+ 224, 53, 225, 55, 226, 56, 227, 228, 0, 0,
+ 43, 54, 32, 210, 212, 0, 40, 0, 0, 0,
+ 0, 45, 0, 0, 0, 0, 0, 0, 0, 0,
+ 587, 110, 111, 0, 0, 589, 115, 591, 30, 31,
+ 592, 0, 118, 0, 0, 0, 120, 594, 595, 0,
+ 0, 0, 0, 0, 0, 596, 597, 124, 125, 218,
+ 36, 0, 37, 0, 0, 0, 38, 0, 39, 598,
+ 42, 0, 0, 600, 0, 0, 0, 46, 0, 47,
+ 0, 0, 0, 0, 0, 602, 0, 221, 0, 0,
+ 0, 604, 601, 603, 49, 605, 606, 607, 53, 609,
+ 610, 611, 612, 613, 614, 0, 0, 599, 608, 593,
+ 588, 590, 128, 40, 0, 0, 0, 0, 45, 0,
+ 0, 0, 0, 0, 0, 0, 0, 361, 110, 111,
+ 0, 0, 363, 115, 365, 30, 31, 366, 0, 118,
+ 0, 0, 0, 120, 368, 369, 0, 0, 0, 0,
+ 0, 0, 370, 371, 124, 125, 218, 36, 0, 37,
+ 0, 0, 0, 38, 0, 39, 372, 42, 0, 0,
+ 374, 0, 0, 0, 46, 0, 47, 0, -267, 0,
+ 0, 0, 376, 0, 221, 0, 0, 0, 378, 375,
+ 377, 49, 379, 380, 381, 53, 383, 384, 385, 386,
+ 387, 388, 0, 0, 373, 382, 367, 362, 364, 128,
+ 40, 0, 0, 0, 0, 45, 0, 0, 0, 0,
+ 0, 0, 0, 0,
- 522, 540, 539, 519, 461, 515, 535, 514, 309, 528,
- 311, 531, 250, 526, 542, 636, 613, 182, 150, 622,
- 16, 496, 320, 497, 627, 253, 498, 633, 358, 554,
- 436, 558, 487, 472, 439, 302, 238, 392, 454, 606,
- 551, 402, 358, 553, 439, 243, 182, 445, 243, 447,
- 456, 237, 238, 238, 347, 429, 349, 450, 351, 460,
- 143, 458, 353, 467, 243, 436, 439, 176, 410, 186,
- 188, 250, 415, 338, 182, 433, 148, 171, 169, 390,
- 417, 400, 302, 140, 449, 163, 146, 425, 339, 302,
- 358, 237, 336, 307, 250, 344, 482, 436, 302, 358,
- 485, 358, 0, 0, 0, 461, 0, 0, 0, 0,
- 0, 60, 60, 451, 452, 404, 0, 0, 60, 60,
- 60, 452, 451, 320, 106, 60, 60, 60, 102, 60,
- 92, 93, 95, 302, 94, 186, 0, 60, 0, 0,
- 60, 88, 60, 405, 90, 60, 108, 180, 60, 266,
- 146, 60, 146, 489, 270, 407, 165, 178, 60, 302,
- 60, 0, 89, 330, 168, 288, 60, 60, 60, 60,
- 0, 287, 286, 284, 285, 471, 60, 60, 432, 180,
- 435, 60, 60, 452, 72, 60, 60, 451, 96, 60,
- 480, 494, 77, 500, 479, 329, 60, 334, 305, 61,
- 612, 60, 60, 69, 68, 60, 404, 60, 70, 67,
- 60, 60, 490, 60, 60, 493, 84, 404, 60, 341,
- 492, 60, 60, 180, 303, 60, 100, 60, 98, 491,
- 91, 60, 0, 298, 405, 60, 106, 97, 270, 0,
- 270, 500, 298, 500, 60, 405, 605, 270, 293, 270,
- 602, 0, 0, 0, 0, 317, 499, 509, 108, 175,
- 60, 316, 0, 60, 319, 270, 60, 290, 270, 298,
- 289, 270, 0, 291, 270, 298, 60, 60, 0, 60,
- 270, 270, 270, 500, 270, 0, 637, 295, 273, 298,
- 602, 297, 313, 60, 270, 611, 0, 300, 270, 599,
- 278, 302, 601, 500, 0, 567, 602, 0, 0, 0,
- 0, 326, 570, 563, 564, 565, 566, 0, 499, 509,
- 0, 472, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 332, 0, 0, 0,
+ 472, 546, 528, 639, 311, 182, 302, 498, 514, 16,
+ 461, 515, 496, 182, 497, 519, 309, 436, 619, 243,
+ 358, 439, 576, 572, 253, 150, 571, 487, 617, 307,
+ 238, 250, 320, 628, 633, 555, 569, 560, 558, 642,
+ 186, 250, 425, 349, 358, 182, 351, 557, 433, 347,
+ 238, 344, 339, 429, 302, 402, 243, 445, 447, 456,
+ 460, 163, 454, 458, 243, 250, 485, 143, 148, 449,
+ 353, 526, 176, 467, 237, 450, 238, 415, 338, 188,
+ 410, 237, 302, 336, 436, 482, 334, 169, 439, 436,
+ 146, 417, 392, 439, 140, 522, 358, 400, 404, 0,
+ 390, 171, 358, 0, 186, 500, 146, 0, 643, 0,
+ 0, 178, 0, 0, 0, 0, 404, 60, 60, 489,
+ 452, 500, 320, 0, 534, 0, 405, 60, 0, 180,
+ 146, 60, 0, 180, 60, 407, 490, 60, 302, 452,
+ 60, 60, 60, 60, 405, 60, 284, 285, 287, 60,
+ 286, 451, 358, 60, 165, 180, 266, 60, 60, 461,
+ 451, 270, 288, 60, 60, 60, 493, 60, 60, 60,
+ 84, 106, 92, 91, 60, 432, 60, 72, 60, 168,
+ 98, 435, 77, 60, 96, 60, 60, 60, 341, 302,
+ 93, 94, 500, 108, 329, 100, 60, 102, 60, 618,
+ 302, 95, 88, 330, 60, 60, 60, 60, 90, 89,
+ 70, 60, 97, 452, 60, 60, 451, 492, 60, 60,
+ 494, 60, 61, 68, 60, 60, 69, 491, 60, 471,
+ 67, 302, 404, 480, 60, 106, 60, 479, 0, 270,
+ 298, 270, 298, 278, 298, 270, 0, 270, 60, 270,
+ 0, 316, 0, 270, 332, 0, 500, 108, 175, 538,
+ 405, 293, 319, 0, 317, 303, 326, 60, 60, 60,
+ 0, 0, 270, 270, 270, 290, 291, 60, 295, 298,
+ 60, 60, 270, 298, 270, 270, 270, 289, 270, 0,
+ 273, 500, 313, 0, 551, 545, 305, 534, 508, 615,
+ 542, 297, 0, 500, 0, 300, 499, 509, 500, 0,
+ 508, 0, 0, 0, 0, 508, 472, 0, 499, 509,
+ 583, 0, 0, 499, 509, 0, 0, 586, 579, 580,
+ 581, 582, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 550,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 551,
+ 0, 0, 0, 0, 0, 0, 552, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 608, 0, 0, 0, 0, 0,
- 0, 0, 500, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 499, 509, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0};
+ 0, 0};
const short QDeclarativeJSGrammar::action_check [] = {
- 55, 7, 33, 7, 55, 7, 60, 36, 90, 55,
- 7, 16, 36, 7, 7, 7, 7, 36, 7, 60,
- 36, 8, 33, 66, 36, 33, 60, 36, 7, 36,
- 7, 7, 33, 36, 24, 7, 7, 37, 8, 60,
- 66, 29, 17, 5, 7, 60, 7, 33, 33, 33,
- 7, 20, 33, 36, 7, 7, 36, 7, 36, 33,
- 7, 17, 60, 36, 1, 33, 79, 2, 8, 7,
- 36, 1, 8, 55, 7, 2, 8, 2, 7, 7,
- 79, 36, 77, 79, 48, 36, 7, 36, 55, 48,
- 36, 36, 33, 36, 8, 60, 1, 31, 0, 2,
- 8, 61, 60, 1, 48, 6, 10, 61, 7, 8,
- -1, 8, 8, 61, 8, -1, -1, 48, 40, 20,
- 8, 60, 8, 42, -1, 40, -1, 50, 8, 51,
- 8, 54, 8, 15, 53, 8, 51, 61, 62, 8,
- 5, 61, 62, 61, 62, 61, 62, 40, 90, 61,
- 62, 55, 34, 79, 61, 62, 40, 8, 51, 8,
- 8, 61, 62, 60, 60, 50, 60, 51, 56, 54,
- 56, 61, 62, 8, 61, 62, 56, 15, 61, 62,
- 61, 62, 60, 56, 60, 15, 25, 8, 27, 29,
- 7, 60, 25, 29, 27, 7, 34, 12, 36, 38,
- 25, 25, 27, 27, 34, 38, 36, 12, 8, 12,
- 61, 60, 60, 38, 38, 8, 25, 25, 27, 27,
- -1, 33, 7, -1, -1, 29, 61, 62, 29, 38,
- 38, -1, 29, 8, -1, 75, 15, 8, 36, 75,
- 61, 62, 57, -1, 61, 62, 86, 29, 63, -1,
- 86, 15, 57, -1, 57, 34, 18, 19, 63, -1,
- 63, 61, 62, 61, 62, 61, 62, -1, 61, 62,
- 34, 75, 36, 15, 75, -1, 61, 62, 75, 15,
- 92, -1, 86, 45, 46, 86, 61, 62, 29, 86,
- 61, 62, 34, 75, 36, 91, 47, 33, 34, 15,
- 36, 18, 19, -1, 86, 18, 19, 29, -1, -1,
- 61, 62, -1, -1, 18, 19, -1, 33, 34, 29,
- 36, -1, 25, 29, 27, 66, 67, 68, 45, 46,
- -1, -1, 45, 46, -1, 38, -1, -1, 23, 24,
- 91, 45, 46, -1, 66, 67, 68, 32, -1, -1,
- 35, 92, 37, 29, 23, 24, 66, 67, 68, -1,
- 66, 67, 68, 32, 23, 24, 35, 29, 37, -1,
- 92, 23, 24, 32, 36, -1, 35, -1, 37, -1,
- 32, 29, 92, 35, -1, 37, 92, 23, 24, 29,
- 66, 67, 68, -1, -1, 29, 32, -1, 29, 35,
- -1, 37, 36, -1, 66, 67, 68, 93, 94, 95,
- 96, 97, 98, 61, 62, -1, 92, 29, 66, 67,
- 68, 61, 62, -1, -1, -1, 66, 67, 68, -1,
- 92, -1, 66, 67, 68, 66, 67, 68, -1, -1,
- -1, -1, -1, -1, 92, -1, -1, -1, -1, 61,
- 62, -1, 92, 29, 66, 67, 68, -1, 92, -1,
- -1, 92, 29, -1, -1, 29, -1, -1, -1, -1,
- 23, 24, -1, -1, -1, -1, -1, -1, 31, 32,
- 92, -1, 35, -1, 37, 61, 62, -1, -1, -1,
- 66, 67, 68, -1, 61, 62, -1, 61, 62, 66,
- 67, 68, 66, 67, 68, -1, -1, -1, -1, -1,
- 12, 13, -1, -1, -1, -1, 92, -1, -1, -1,
- 22, -1, -1, -1, -1, 92, -1, 29, 92, -1,
+ 7, 16, 55, 7, 33, 36, 33, 55, 36, 7,
+ 7, 7, 7, 7, 7, 36, 7, 7, 36, 8,
+ 36, 55, 60, 29, 7, 7, 36, 7, 33, 7,
+ 7, 7, 7, 36, 36, 48, 1, 0, 90, 79,
+ 7, 33, 8, 90, 2, 7, 33, 55, 36, 60,
+ 36, 20, 33, 5, 1, 5, 79, 36, 7, 33,
+ 5, 60, 33, 33, 8, 33, 17, 24, 2, 7,
+ 34, 2, 7, 1, 7, 36, 60, 37, 8, 8,
+ 36, 66, 36, 7, 1, 17, -1, -1, 36, 48,
+ 36, 33, 8, 66, 7, 48, 36, 33, 7, 36,
+ 2, 7, 8, 8, 8, 77, 61, 15, 8, 8,
+ 6, -1, 31, 36, 8, 10, -1, -1, -1, 60,
+ 8, 60, -1, 48, 20, -1, 34, -1, 8, 8,
+ 8, -1, -1, 60, 60, 8, 79, 55, 60, 50,
+ 8, 61, 8, 54, 8, 8, 61, 61, 62, 61,
+ 62, 42, 56, 50, 40, 60, 56, 54, 79, 40,
+ 55, 60, 53, 61, 62, 51, 60, 15, 61, 62,
+ 51, 61, 62, 61, 61, 62, 56, 56, 61, 62,
+ 40, 8, 60, 8, 61, 62, 34, 60, 8, 61,
+ 62, 51, 60, 56, 60, 40, 60, 12, 29, 61,
+ 62, 25, 25, 27, 27, 15, 51, 36, 29, 15,
+ 29, 61, 62, 12, 38, 38, 8, 29, 7, 7,
+ 29, -1, 8, -1, 34, 8, 36, 25, 34, 27,
+ 36, 15, 61, 62, 61, 62, 61, 62, 7, 29,
+ 38, 91, 57, 7, 75, 33, 8, 25, 63, 27,
+ 34, -1, 36, -1, 75, 86, 75, 12, 57, -1,
+ 38, 15, -1, 75, 63, 86, 75, 86, 15, 61,
+ 62, -1, 61, 62, 86, 61, 62, 86, 61, 62,
+ 34, 25, 36, 27, -1, 75, 33, 34, 29, 36,
+ 18, 19, 61, 62, 38, 47, 86, 61, 62, 61,
+ 62, 15, 57, -1, 92, 18, 19, -1, 63, 61,
+ 62, 29, -1, 18, 19, 18, 19, 45, 46, 33,
+ 34, -1, 36, 29, -1, 66, 67, 68, -1, -1,
+ -1, -1, 45, 46, 29, -1, -1, -1, 29, 91,
+ 45, 46, 45, 46, 23, 24, 29, -1, 66, 67,
+ 68, 92, 29, 32, 23, 24, 35, 25, 37, 27,
+ 66, 67, 68, 32, -1, 29, 35, -1, 37, 29,
+ 38, 66, 67, 68, 92, 66, 67, 68, -1, -1,
+ 29, -1, -1, 66, 67, 68, 92, 29, -1, 66,
+ 67, 68, 29, -1, -1, -1, -1, 92, 29, -1,
+ -1, 92, 66, 67, 68, -1, 66, 67, 68, 92,
+ -1, -1, -1, -1, 29, 92, -1, 66, 67, 68,
+ 29, -1, -1, -1, 66, 67, 68, 29, 92, 66,
+ 67, 68, 92, 23, 24, 66, 67, 68, -1, -1,
+ -1, 29, 32, 92, -1, 35, -1, 37, 36, 29,
+ 92, 66, 67, 68, -1, 92, 36, 66, 67, 68,
+ -1, 92, 23, 24, 66, 67, 68, -1, -1, -1,
+ 31, 32, -1, -1, 35, -1, 37, 92, 66, 67,
+ 68, -1, -1, 92, 23, 24, 66, 67, 68, 29,
+ 92, -1, 31, 32, 23, 24, 35, 29, 37, -1,
+ -1, -1, 31, 32, 92, 29, 35, -1, 37, -1,
+ -1, 29, 92, -1, 93, 94, 95, 96, 97, 98,
+ -1, 61, 62, -1, 29, -1, 66, 67, 68, 61,
+ 62, -1, -1, 29, 66, 67, 68, 61, 62, -1,
+ -1, -1, 66, 67, 68, -1, -1, -1, 66, 67,
+ 68, -1, 92, -1, -1, -1, 61, 62, -1, -1,
+ 92, 66, 67, 68, -1, 61, 62, 29, 92, -1,
+ 66, 67, 68, -1, 92, -1, -1, -1, -1, -1,
+ -1, -1, -1, 23, 24, -1, -1, 92, 3, -1,
+ -1, 31, 32, -1, -1, 35, 92, 37, 13, 61,
+ 62, -1, 17, -1, 66, 67, 68, -1, -1, -1,
+ -1, 26, -1, 28, -1, -1, 31, -1, -1, -1,
+ -1, -1, -1, -1, 39, -1, 41, 42, -1, -1,
+ 92, -1, -1, -1, 49, -1, -1, 52, 53, -1,
+ -1, -1, -1, 58, -1, -1, -1, -1, -1, 64,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, 12,
+ 13, 3, -1, -1, -1, 80, -1, -1, -1, 22,
+ -1, 13, -1, -1, -1, 17, 29, -1, -1, -1,
+ 33, 34, -1, 36, 26, -1, 28, -1, -1, -1,
+ 43, -1, -1, -1, 47, -1, -1, 39, -1, 41,
+ 42, -1, -1, -1, -1, -1, -1, 49, -1, -1,
+ 52, 53, 65, 66, 67, 68, 58, 70, -1, -1,
+ -1, -1, 64, -1, -1, -1, -1, -1, 81, 82,
+ 83, 12, 13, -1, 87, -1, -1, -1, 80, 92,
+ -1, 22, -1, -1, -1, -1, -1, -1, 29, -1,
+ -1, -1, 33, 34, -1, 36, -1, -1, -1, 12,
+ 13, -1, 43, -1, -1, -1, 47, -1, -1, 22,
+ -1, -1, -1, -1, -1, -1, 29, -1, -1, -1,
+ 33, 34, -1, 36, 65, 66, 67, 68, -1, 70,
+ 43, -1, -1, -1, 47, -1, -1, -1, -1, -1,
+ 81, 82, 83, -1, -1, -1, 87, -1, -1, -1,
+ -1, 92, 65, 66, 67, 68, -1, 70, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, 81, 82,
+ 83, -1, -1, -1, 87, -1, -1, -1, -1, 92,
+ 12, 13, -1, -1, -1, -1, -1, -1, 12, 13,
+ 22, -1, -1, -1, -1, -1, -1, 29, 22, -1,
+ -1, 33, 34, -1, 36, 29, -1, -1, -1, 33,
+ 34, 43, 36, -1, -1, 47, -1, -1, -1, 43,
+ -1, -1, -1, 47, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, 65, 66, 67, 68, -1, 70, -1,
+ -1, 65, 66, 67, 68, -1, 70, -1, -1, 81,
+ 82, 83, -1, -1, -1, 87, -1, 81, 82, 83,
+ 92, -1, -1, 87, -1, -1, -1, -1, 92, 12,
+ 13, -1, -1, -1, -1, -1, -1, 12, 13, 22,
+ -1, -1, -1, -1, -1, -1, 29, 22, -1, -1,
+ 33, 34, -1, 36, 29, -1, -1, -1, 33, 34,
+ 43, 36, -1, -1, 47, -1, -1, -1, 43, -1,
+ -1, -1, 47, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, 65, 66, 67, 68, -1, 70, -1, -1,
+ 65, 66, 67, 68, -1, 70, -1, -1, 81, 82,
+ 83, -1, -1, -1, 87, -1, 81, 82, 83, 92,
+ -1, -1, 87, -1, -1, -1, -1, 92, -1, -1,
+ -1, -1, -1, -1, -1, -1, 10, -1, 12, 13,
+ -1, -1, -1, -1, -1, -1, -1, -1, 22, -1,
+ -1, -1, -1, -1, -1, 29, -1, -1, -1, 33,
+ 34, -1, 36, -1, -1, -1, -1, -1, -1, 43,
+ -1, -1, -1, 47, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, 65, 66, 67, 68, -1, 70, -1, -1, -1,
+ -1, 75, -1, -1, -1, -1, -1, 81, 82, 83,
+ 84, -1, -1, 87, -1, -1, -1, -1, 92, -1,
+ -1, -1, -1, -1, -1, -1, -1, 10, -1, 12,
+ 13, -1, -1, -1, -1, -1, -1, -1, -1, 22,
+ -1, -1, -1, -1, -1, -1, 29, -1, -1, -1,
+ 33, 34, -1, 36, -1, -1, -1, -1, -1, -1,
+ 43, -1, -1, -1, 47, -1, -1, -1, -1, -1,
+ -1, -1, 55, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, 65, 66, 67, 68, -1, 70, -1, -1,
+ -1, -1, 75, -1, -1, -1, -1, -1, 81, 82,
+ 83, 84, -1, -1, 87, -1, -1, -1, -1, 92,
+ -1, -1, -1, -1, -1, -1, -1, -1, 10, -1,
+ 12, 13, -1, -1, -1, -1, -1, -1, -1, -1,
+ 22, -1, -1, -1, -1, -1, -1, 29, -1, -1,
-1, 33, 34, -1, 36, -1, -1, -1, -1, -1,
- -1, 43, -1, -1, -1, 47, -1, -1, 3, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, 13, -1,
- -1, -1, 17, 65, 66, 67, 68, -1, 70, -1,
- -1, 26, -1, 28, -1, -1, -1, -1, -1, 81,
- 82, 83, -1, -1, 39, 87, 41, 42, -1, -1,
- 92, -1, -1, -1, 49, 12, 13, 52, 53, -1,
- -1, -1, -1, 58, -1, 22, -1, -1, -1, 64,
- -1, -1, 29, -1, -1, -1, 33, 34, -1, 36,
- -1, -1, -1, -1, -1, 80, 43, -1, -1, -1,
- 47, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, 3, -1, 65, 66,
- 67, 68, -1, 70, -1, -1, 13, -1, -1, -1,
- 17, -1, -1, -1, 81, 82, 83, -1, -1, 26,
- 87, 28, -1, -1, 31, 92, -1, -1, -1, -1,
- -1, -1, 39, -1, 41, 42, -1, -1, -1, -1,
- -1, -1, 49, -1, -1, 52, 53, -1, -1, -1,
- -1, 58, -1, -1, -1, -1, -1, 64, -1, -1,
- -1, -1, -1, -1, -1, -1, 12, 13, -1, -1,
- -1, -1, -1, 80, -1, -1, 22, -1, -1, -1,
- -1, -1, -1, 29, -1, -1, -1, 33, 34, -1,
- 36, -1, -1, -1, 12, 13, -1, 43, -1, -1,
- -1, 47, -1, -1, 22, -1, -1, -1, -1, -1,
- -1, 29, -1, -1, -1, 33, 34, -1, 36, 65,
- 66, 67, 68, -1, 70, 43, -1, -1, -1, 47,
- -1, -1, -1, -1, -1, 81, 82, 83, -1, -1,
- -1, 87, -1, -1, -1, -1, 92, 65, 66, 67,
- 68, -1, 70, -1, -1, -1, -1, -1, -1, -1,
+ -1, 43, -1, -1, -1, 47, -1, -1, -1, -1,
+ -1, -1, -1, 55, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, 65, 66, 67, 68, -1, 70, -1,
+ -1, -1, -1, 75, -1, -1, -1, -1, -1, 81,
+ 82, 83, 84, -1, -1, 87, -1, -1, -1, -1,
+ 92, -1, -1, -1, -1, -1, -1, -1, -1, 11,
+ 12, 13, -1, -1, -1, -1, -1, -1, -1, -1,
+ 22, -1, -1, -1, -1, -1, -1, 29, -1, -1,
+ -1, 33, 34, -1, 36, -1, -1, -1, 40, -1,
+ 42, 43, 44, -1, -1, 47, -1, -1, -1, 51,
+ -1, 53, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, 65, 66, 67, 68, -1, 70, -1,
+ 72, -1, 74, -1, 76, -1, -1, -1, -1, 81,
+ 82, 83, -1, -1, -1, 87, -1, -1, -1, -1,
+ 92, -1, -1, -1, -1, -1, -1, -1, -1, 7,
+ -1, -1, -1, 11, 12, 13, -1, -1, -1, -1,
+ -1, -1, -1, -1, 22, -1, -1, -1, -1, -1,
+ -1, 29, -1, -1, -1, 33, 34, -1, 36, -1,
+ -1, -1, 40, -1, 42, 43, 44, -1, -1, 47,
+ -1, -1, -1, 51, -1, 53, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, 65, 66, 67,
+ 68, -1, 70, -1, 72, -1, 74, -1, 76, -1,
-1, -1, -1, 81, 82, 83, -1, -1, -1, 87,
- -1, -1, -1, -1, 92, 12, 13, -1, -1, -1,
- -1, -1, -1, 12, 13, 22, -1, -1, -1, -1,
- -1, -1, 29, 22, -1, -1, 33, 34, -1, 36,
- 29, -1, -1, -1, 33, 34, 43, 36, -1, -1,
- 47, -1, -1, -1, 43, -1, -1, -1, 47, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, 65, 66,
- 67, 68, -1, 70, -1, -1, 65, 66, 67, 68,
- -1, 70, -1, -1, 81, 82, 83, -1, -1, -1,
- 87, -1, 81, 82, 83, 92, -1, -1, 87, -1,
- -1, -1, -1, 92, 12, 13, -1, -1, -1, -1,
- -1, -1, 12, 13, 22, -1, -1, -1, -1, -1,
- -1, 29, 22, -1, -1, 33, 34, -1, 36, 29,
- -1, -1, -1, 33, 34, 43, 36, -1, -1, 47,
- -1, -1, -1, 43, -1, -1, -1, 47, -1, -1,
+ -1, -1, -1, -1, 92, -1, -1, -1, -1, -1,
+ -1, -1, -1, 11, 12, 13, -1, -1, -1, -1,
+ -1, -1, -1, -1, 22, -1, -1, -1, -1, -1,
+ -1, 29, -1, -1, -1, 33, 34, -1, 36, -1,
+ -1, -1, 40, -1, 42, 43, 44, -1, -1, 47,
+ -1, -1, -1, 51, -1, 53, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, 65, 66, 67,
- 68, -1, 70, -1, -1, 65, 66, 67, 68, -1,
- 70, -1, -1, 81, 82, 83, -1, -1, -1, 87,
- -1, 81, 82, 83, 92, -1, -1, 87, -1, -1,
- -1, -1, 92, -1, -1, -1, -1, -1, -1, -1,
- -1, 10, -1, 12, 13, -1, -1, -1, -1, -1,
+ 68, -1, 70, -1, 72, -1, 74, 75, 76, -1,
+ -1, -1, -1, 81, 82, 83, -1, -1, -1, 87,
+ -1, -1, -1, -1, 92, -1, -1, -1, -1, -1,
+ -1, -1, -1, 8, -1, -1, 11, 12, 13, -1,
+ -1, -1, -1, -1, -1, -1, -1, 22, -1, -1,
+ -1, -1, -1, -1, 29, -1, -1, -1, 33, 34,
+ -1, 36, -1, -1, -1, 40, -1, 42, 43, 44,
+ -1, -1, 47, -1, -1, -1, 51, -1, 53, -1,
+ -1, 56, -1, -1, -1, -1, -1, -1, -1, -1,
+ 65, 66, 67, 68, -1, 70, -1, 72, -1, 74,
+ -1, 76, -1, -1, -1, -1, 81, 82, 83, -1,
+ -1, -1, 87, -1, -1, -1, -1, 92, -1, -1,
+ -1, -1, -1, -1, -1, -1, 8, -1, -1, 11,
+ 12, 13, -1, -1, -1, -1, -1, -1, -1, -1,
+ 22, -1, -1, -1, -1, -1, -1, 29, -1, -1,
+ -1, 33, 34, -1, 36, -1, -1, -1, 40, -1,
+ 42, 43, 44, -1, -1, 47, -1, -1, -1, 51,
+ -1, 53, -1, -1, 56, -1, -1, -1, -1, -1,
+ -1, -1, -1, 65, 66, 67, 68, -1, 70, -1,
+ 72, -1, 74, -1, 76, -1, -1, -1, -1, 81,
+ 82, 83, -1, -1, -1, 87, -1, -1, -1, -1,
+ 92, -1, -1, -1, -1, -1, -1, -1, -1, 8,
+ -1, -1, 11, 12, 13, -1, -1, -1, -1, -1,
-1, -1, -1, 22, -1, -1, -1, -1, -1, -1,
29, -1, -1, -1, 33, 34, -1, 36, -1, -1,
- -1, -1, -1, -1, 43, -1, -1, -1, 47, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, 40, -1, 42, 43, 44, -1, -1, 47, -1,
+ -1, -1, 51, -1, 53, -1, -1, 56, -1, -1,
-1, -1, -1, -1, -1, -1, 65, 66, 67, 68,
- -1, 70, -1, -1, -1, -1, 75, -1, -1, -1,
- -1, -1, 81, 82, 83, 84, -1, -1, 87, -1,
+ -1, 70, -1, 72, -1, 74, -1, 76, -1, -1,
+ -1, -1, 81, 82, 83, -1, -1, -1, 87, -1,
-1, -1, -1, 92, -1, -1, -1, -1, -1, -1,
- -1, -1, 10, -1, 12, 13, -1, -1, -1, -1,
- -1, -1, -1, -1, 22, -1, -1, -1, -1, -1,
- -1, 29, -1, -1, -1, 33, 34, -1, 36, -1,
- -1, -1, -1, -1, -1, 43, -1, -1, -1, 47,
- -1, -1, -1, -1, -1, -1, -1, 55, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, 65, 66, 67,
- 68, -1, 70, -1, -1, -1, -1, 75, -1, -1,
- -1, -1, -1, 81, 82, 83, 84, -1, -1, 87,
- -1, -1, -1, -1, 92, -1, -1, -1, -1, -1,
- -1, -1, -1, 10, -1, 12, 13, -1, -1, -1,
- -1, -1, -1, -1, -1, 22, -1, -1, -1, -1,
- -1, -1, 29, -1, -1, -1, 33, 34, -1, 36,
- -1, -1, -1, -1, -1, -1, 43, -1, -1, -1,
- 47, -1, -1, -1, -1, -1, -1, -1, 55, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, 65, 66,
- 67, 68, -1, 70, -1, -1, -1, -1, 75, -1,
- -1, -1, -1, -1, 81, 82, 83, 84, -1, -1,
- 87, -1, -1, -1, -1, 92, -1, -1, -1, -1,
- -1, -1, -1, -1, 11, 12, 13, -1, -1, -1,
- -1, -1, -1, -1, -1, 22, -1, -1, -1, -1,
- -1, -1, 29, -1, -1, -1, 33, 34, -1, 36,
- -1, -1, -1, 40, -1, 42, 43, 44, -1, -1,
- 47, -1, -1, -1, 51, -1, 53, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, 65, 66,
- 67, 68, -1, 70, -1, 72, -1, 74, -1, 76,
- -1, -1, -1, -1, 81, 82, 83, -1, -1, -1,
- 87, -1, -1, -1, -1, 92, -1, -1, -1, -1,
- -1, -1, -1, -1, 7, -1, -1, -1, 11, 12,
- 13, -1, -1, -1, -1, -1, -1, -1, -1, 22,
- -1, -1, -1, -1, -1, -1, 29, -1, -1, -1,
- 33, 34, -1, 36, -1, -1, -1, 40, -1, 42,
- 43, 44, -1, -1, 47, -1, -1, -1, 51, -1,
- 53, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, 65, 66, 67, 68, -1, 70, -1, 72,
- -1, 74, -1, 76, -1, -1, -1, -1, 81, 82,
- 83, -1, -1, -1, 87, -1, -1, -1, -1, 92,
- -1, -1, -1, -1, -1, -1, -1, -1, 11, 12,
- 13, -1, -1, -1, -1, -1, -1, -1, -1, 22,
- -1, -1, -1, -1, -1, -1, 29, -1, -1, -1,
- 33, 34, -1, 36, -1, -1, -1, 40, -1, 42,
- 43, 44, -1, -1, 47, -1, -1, -1, 51, -1,
- 53, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, 65, 66, 67, 68, -1, 70, -1, 72,
- -1, 74, 75, 76, -1, -1, -1, -1, 81, 82,
- 83, -1, -1, -1, 87, -1, -1, -1, -1, 92,
- -1, -1, -1, -1, -1, -1, -1, -1, 8, -1,
- -1, 11, 12, 13, -1, -1, -1, -1, -1, -1,
- -1, -1, 22, -1, -1, -1, -1, -1, -1, 29,
- -1, -1, -1, 33, 34, -1, 36, -1, -1, -1,
- 40, -1, 42, 43, 44, -1, -1, 47, -1, -1,
- -1, 51, -1, 53, -1, -1, 56, -1, -1, -1,
- -1, -1, -1, -1, -1, 65, 66, 67, 68, -1,
- 70, -1, 72, -1, 74, -1, 76, -1, -1, -1,
- -1, 81, 82, 83, -1, -1, -1, 87, -1, -1,
- -1, -1, 92, -1, -1, -1, -1, -1, -1, -1,
- -1, 11, 12, 13, -1, -1, -1, -1, -1, -1,
- -1, -1, 22, -1, -1, -1, -1, -1, -1, 29,
- 30, -1, -1, 33, 34, -1, 36, -1, -1, -1,
- 40, -1, 42, 43, 44, -1, -1, 47, -1, -1,
- -1, 51, -1, 53, -1, -1, -1, -1, -1, -1,
- -1, 61, -1, -1, -1, 65, 66, 67, 68, -1,
- 70, -1, 72, -1, 74, -1, 76, -1, -1, -1,
- -1, 81, 82, 83, -1, -1, -1, 87, -1, -1,
- -1, -1, 92, -1, -1, -1, -1, -1, -1, -1,
- -1, 8, -1, -1, 11, 12, 13, -1, -1, -1,
- -1, -1, -1, -1, -1, 22, -1, -1, -1, -1,
- -1, -1, 29, -1, -1, -1, 33, 34, -1, 36,
- -1, -1, -1, 40, -1, 42, 43, 44, -1, -1,
- 47, -1, -1, -1, 51, -1, 53, -1, -1, 56,
- -1, -1, -1, -1, -1, -1, -1, -1, 65, 66,
- 67, 68, -1, 70, -1, 72, -1, 74, -1, 76,
- -1, -1, -1, -1, 81, 82, 83, -1, -1, -1,
- 87, -1, -1, -1, -1, 92, -1, -1, -1, -1,
- -1, -1, -1, -1, 8, -1, -1, 11, 12, 13,
- -1, -1, -1, -1, -1, -1, -1, -1, 22, -1,
- -1, -1, -1, -1, -1, 29, -1, -1, -1, 33,
- 34, -1, 36, -1, -1, -1, 40, -1, 42, 43,
- 44, -1, -1, 47, -1, -1, -1, 51, -1, 53,
- -1, -1, 56, -1, -1, -1, -1, -1, -1, -1,
- -1, 65, 66, 67, 68, -1, 70, -1, 72, -1,
- 74, -1, 76, -1, -1, -1, -1, 81, 82, 83,
- -1, -1, -1, 87, -1, -1, -1, -1, 92, -1,
- -1, -1, -1, -1, -1, -1, -1, 8, -1, -1,
- 11, 12, 13, -1, -1, -1, -1, -1, -1, -1,
- -1, 22, -1, -1, -1, -1, -1, -1, 29, -1,
- -1, -1, 33, 34, -1, 36, -1, -1, -1, 40,
- -1, 42, 43, 44, -1, -1, 47, -1, -1, -1,
- 51, -1, 53, -1, -1, 56, -1, -1, -1, -1,
- -1, -1, -1, -1, 65, 66, 67, 68, -1, 70,
- -1, 72, -1, 74, -1, 76, -1, -1, -1, -1,
- 81, 82, 83, -1, -1, -1, 87, -1, -1, -1,
- -1, 92, -1, -1, -1, -1, -1, -1, -1, -1,
- 4, 5, 6, -1, -1, 9, 10, 11, -1, -1,
- 14, -1, 16, -1, -1, -1, 20, 21, 22, -1,
- -1, -1, -1, -1, -1, 29, 30, 31, 32, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, 43,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, 59, -1, -1, -1, -1,
- -1, -1, 66, 67, 68, 69, 70, 71, -1, 73,
- 74, 75, 76, 77, 78, -1, -1, 81, 82, 83,
- 84, 85, 86, -1, -1, -1, -1, -1, 92, -1,
- -1, -1, -1, -1, -1, -1, -1, 4, 5, 6,
- -1, -1, 9, 10, 11, -1, -1, 14, -1, 16,
- -1, -1, -1, 20, 21, 22, -1, -1, -1, -1,
- -1, -1, 29, 30, 31, 32, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, 43, -1, -1, -1,
- 47, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, 59, -1, -1, -1, -1, -1, 65, 66,
- 67, -1, 69, 70, 71, -1, 73, 74, 75, 76,
- 77, 78, -1, -1, 81, 82, 83, 84, 85, 86,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, 4, 5, 6, -1, -1, 9,
- 10, 11, -1, -1, 14, -1, 16, -1, -1, -1,
- 20, 21, 22, -1, -1, -1, -1, -1, -1, 29,
- 30, 31, 32, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, 43, -1, -1, -1, 47, -1, -1,
- -1, -1, -1, -1, -1, 55, -1, -1, -1, 59,
- -1, -1, -1, -1, -1, 65, 66, 67, -1, 69,
- 70, 71, -1, 73, 74, 75, 76, 77, 78, -1,
- -1, 81, 82, 83, 84, 85, 86, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, 4, -1, -1, -1, -1, 9, -1, 11, 12,
- 13, 14, -1, -1, -1, -1, -1, -1, 21, 22,
- -1, -1, -1, -1, -1, -1, 29, 30, -1, -1,
- 33, 34, -1, 36, -1, -1, -1, 40, -1, 42,
- 43, 44, -1, -1, 47, -1, -1, -1, 51, -1,
- 53, -1, -1, -1, -1, -1, 59, -1, 61, -1,
- -1, -1, 65, 66, 67, 68, 69, 70, 71, 72,
- 73, 74, 75, 76, 77, 78, -1, -1, 81, 82,
- 83, 84, 85, -1, 87, -1, -1, -1, -1, 92,
- -1, -1, -1, -1, -1, -1, -1, -1, 4, -1,
- -1, -1, -1, 9, -1, 11, 12, 13, 14, -1,
- -1, -1, -1, -1, -1, 21, 22, -1, -1, -1,
+ -1, -1, 8, -1, -1, 11, 12, 13, -1, -1,
+ -1, -1, -1, -1, -1, -1, 22, -1, -1, -1,
+ -1, -1, -1, 29, -1, -1, -1, 33, 34, -1,
+ 36, -1, -1, -1, 40, -1, 42, 43, 44, -1,
+ -1, 47, -1, -1, -1, 51, -1, 53, -1, -1,
+ 56, -1, -1, -1, -1, -1, -1, -1, -1, 65,
+ 66, 67, 68, -1, 70, -1, 72, -1, 74, -1,
+ 76, -1, -1, -1, -1, 81, 82, 83, -1, -1,
+ -1, 87, -1, -1, -1, -1, 92, -1, -1, -1,
+ -1, -1, -1, -1, -1, 11, 12, 13, -1, -1,
+ -1, -1, -1, -1, -1, -1, 22, -1, -1, -1,
-1, -1, -1, 29, 30, -1, -1, 33, 34, -1,
36, -1, -1, -1, 40, -1, 42, 43, 44, -1,
-1, 47, -1, -1, -1, 51, -1, 53, -1, -1,
- -1, -1, -1, 59, -1, 61, -1, -1, -1, 65,
- 66, 67, 68, 69, 70, 71, 72, 73, 74, 75,
- 76, 77, 78, -1, -1, 81, 82, 83, 84, 85,
+ -1, -1, -1, -1, -1, 61, -1, -1, -1, 65,
+ 66, 67, 68, -1, 70, -1, 72, -1, 74, -1,
+ 76, -1, -1, -1, -1, 81, 82, 83, -1, -1,
-1, 87, -1, -1, -1, -1, 92, -1, -1, -1,
-1, -1, -1, -1, -1, 4, 5, 6, -1, -1,
- 9, 10, 11, 12, 13, 14, -1, 16, -1, -1,
+ 9, 10, 11, -1, -1, 14, -1, 16, -1, -1,
-1, 20, 21, 22, -1, -1, -1, -1, -1, -1,
- 29, 30, 31, 32, 33, 34, -1, 36, -1, -1,
- -1, 40, -1, 42, 43, 44, -1, -1, 47, -1,
- -1, -1, 51, -1, 53, -1, -1, -1, -1, -1,
- 59, -1, 61, -1, -1, -1, 65, 66, 67, 68,
- 69, 70, 71, 72, 73, 74, 75, 76, 77, 78,
- -1, -1, 81, 82, 83, 84, 85, 86, 87, -1,
+ 29, 30, 31, 32, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, 43, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ 59, -1, -1, -1, -1, -1, -1, 66, 67, 68,
+ 69, 70, 71, -1, 73, 74, 75, 76, 77, 78,
+ -1, -1, 81, 82, 83, 84, 85, 86, -1, -1,
-1, -1, -1, 92, -1, -1, -1, -1, -1, -1,
-1, -1, 4, 5, 6, -1, -1, 9, 10, 11,
- 12, 13, 14, -1, 16, -1, -1, -1, 20, 21,
+ -1, -1, 14, -1, 16, -1, -1, -1, 20, 21,
22, -1, -1, -1, -1, -1, -1, 29, 30, 31,
- 32, 33, 34, -1, 36, -1, -1, -1, 40, -1,
- 42, 43, 44, -1, -1, 47, -1, -1, -1, 51,
- -1, 53, -1, 55, -1, -1, -1, 59, -1, 61,
- -1, -1, -1, 65, 66, 67, 68, 69, 70, 71,
- 72, 73, 74, 75, 76, 77, 78, -1, -1, 81,
- 82, 83, 84, 85, 86, 87, -1, -1, -1, -1,
- 92, -1, -1, -1, -1, -1, -1, -1, -1,
+ 32, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, 43, -1, -1, -1, 47, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, 59, -1, -1,
+ -1, -1, -1, 65, 66, 67, -1, 69, 70, 71,
+ -1, 73, 74, 75, 76, 77, 78, -1, -1, 81,
+ 82, 83, 84, 85, 86, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, 4,
+ 5, 6, -1, -1, 9, 10, 11, -1, -1, 14,
+ -1, 16, -1, -1, -1, 20, 21, 22, -1, -1,
+ -1, -1, -1, -1, 29, 30, 31, 32, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, 43, -1,
+ -1, -1, 47, -1, -1, -1, -1, -1, -1, -1,
+ 55, -1, -1, -1, 59, -1, -1, -1, -1, -1,
+ 65, 66, 67, -1, 69, 70, 71, -1, 73, 74,
+ 75, 76, 77, 78, -1, -1, 81, 82, 83, 84,
+ 85, 86, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, 4, -1, -1, -1,
+ -1, 9, -1, 11, 12, 13, 14, -1, -1, -1,
+ -1, -1, -1, 21, 22, -1, -1, -1, -1, -1,
+ -1, 29, 30, -1, -1, 33, 34, -1, 36, -1,
+ -1, -1, 40, -1, 42, 43, 44, -1, -1, 47,
+ -1, -1, -1, 51, -1, 53, -1, -1, -1, -1,
+ -1, 59, -1, 61, -1, -1, -1, 65, 66, 67,
+ 68, 69, 70, 71, 72, 73, 74, 75, 76, 77,
+ 78, -1, -1, 81, 82, 83, 84, 85, -1, 87,
+ -1, -1, -1, -1, 92, -1, -1, -1, -1, -1,
+ -1, -1, -1, 4, -1, -1, -1, -1, 9, -1,
+ 11, 12, 13, 14, -1, -1, -1, -1, -1, -1,
+ 21, 22, -1, -1, -1, -1, -1, -1, 29, 30,
+ -1, -1, 33, 34, -1, 36, -1, -1, -1, 40,
+ -1, 42, 43, 44, -1, -1, 47, -1, -1, -1,
+ 51, -1, 53, -1, -1, -1, -1, -1, 59, -1,
+ 61, -1, -1, -1, 65, 66, 67, 68, 69, 70,
+ 71, 72, 73, 74, 75, 76, 77, 78, -1, -1,
+ 81, 82, 83, 84, 85, -1, 87, -1, -1, -1,
+ -1, 92, -1, -1, -1, -1, -1, -1, -1, -1,
+ 4, 5, 6, -1, -1, 9, 10, 11, 12, 13,
+ 14, -1, 16, -1, -1, -1, 20, 21, 22, -1,
+ -1, -1, -1, -1, -1, 29, 30, 31, 32, 33,
+ 34, -1, 36, -1, -1, -1, 40, -1, 42, 43,
+ 44, -1, -1, 47, -1, -1, -1, 51, -1, 53,
+ -1, -1, -1, -1, -1, 59, -1, 61, -1, -1,
+ -1, 65, 66, 67, 68, 69, 70, 71, 72, 73,
+ 74, 75, 76, 77, 78, -1, -1, 81, 82, 83,
+ 84, 85, 86, 87, -1, -1, -1, -1, 92, -1,
+ -1, -1, -1, -1, -1, -1, -1, 4, 5, 6,
+ -1, -1, 9, 10, 11, 12, 13, 14, -1, 16,
+ -1, -1, -1, 20, 21, 22, -1, -1, -1, -1,
+ -1, -1, 29, 30, 31, 32, 33, 34, -1, 36,
+ -1, -1, -1, 40, -1, 42, 43, 44, -1, -1,
+ 47, -1, -1, -1, 51, -1, 53, -1, 55, -1,
+ -1, -1, 59, -1, 61, -1, -1, -1, 65, 66,
+ 67, 68, 69, 70, 71, 72, 73, 74, 75, 76,
+ 77, 78, -1, -1, 81, 82, 83, 84, 85, 86,
+ 87, -1, -1, -1, -1, 92, -1, -1, -1, -1,
+ -1, -1, -1, -1,
- 13, 15, 25, 3, 15, 15, 3, 25, 3, 15,
- 2, 15, 2, 25, 3, 11, 19, 15, 67, 13,
- 3, 104, 15, 4, 15, 3, 2, 15, 2, 15,
- 3, 15, 3, 35, 21, 3, 15, 36, 3, 19,
- 25, 2, 2, 25, 21, 15, 15, 98, 15, 15,
- 2, 4, 15, 15, 2, 93, 3, 21, 2, 2,
- 35, 3, 2, 35, 15, 3, 21, 3, 2, 15,
- 15, 2, 2, 2, 15, 3, 35, 35, 35, 35,
- 3, 35, 3, 3, 21, 35, 35, 96, 15, 3,
- 2, 4, 3, 2, 2, 100, 35, 3, 3, 2,
- 35, 2, -1, -1, -1, 15, -1, -1, -1, -1,
- -1, 44, 44, 46, 46, 13, -1, -1, 44, 44,
- 44, 46, 46, 15, 15, 44, 44, 44, 54, 44,
- 49, 49, 49, 3, 49, 15, -1, 44, -1, -1,
- 44, 48, 44, 41, 48, 44, 37, 46, 44, 44,
- 35, 44, 35, 46, 49, 40, 58, 40, 44, 3,
- 44, -1, 48, 68, 60, 49, 44, 44, 44, 44,
- -1, 49, 49, 49, 49, 85, 44, 44, 81, 46,
- 81, 44, 44, 46, 52, 44, 44, 46, 50, 44,
- 31, 46, 50, 13, 35, 87, 44, 2, 68, 47,
- 20, 44, 44, 46, 46, 44, 13, 44, 47, 46,
- 44, 44, 46, 44, 44, 46, 49, 13, 44, 99,
- 46, 44, 44, 46, 68, 44, 56, 44, 50, 46,
- 49, 44, -1, 44, 41, 44, 15, 50, 49, -1,
- 49, 13, 44, 13, 44, 41, 16, 49, 57, 49,
- 20, -1, -1, -1, -1, 66, 28, 29, 37, 38,
- 44, 61, -1, 44, 66, 49, 44, 51, 49, 44,
- 51, 49, -1, 51, 49, 44, 44, 44, -1, 44,
- 49, 49, 49, 13, 49, -1, 16, 55, 53, 44,
- 20, 66, 59, 44, 49, 5, -1, 66, 49, 13,
- 51, 3, 16, 13, -1, 13, 20, -1, -1, -1,
- -1, 66, 20, 21, 22, 23, 24, -1, 28, 29,
- -1, 35, -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, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, 68, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ 35, 15, 15, 15, 2, 15, 3, 2, 25, 3,
+ 15, 15, 104, 15, 4, 3, 3, 3, 19, 15,
+ 2, 21, 15, 15, 3, 67, 25, 3, 19, 2,
+ 15, 2, 15, 13, 15, 19, 25, 3, 15, 11,
+ 15, 2, 96, 3, 2, 15, 2, 25, 3, 2,
+ 15, 100, 15, 93, 3, 2, 15, 98, 15, 2,
+ 2, 35, 3, 3, 15, 2, 35, 35, 35, 21,
+ 2, 25, 3, 35, 4, 21, 15, 2, 2, 15,
+ 2, 4, 3, 3, 3, 35, 2, 35, 21, 3,
+ 35, 3, 36, 21, 3, 13, 2, 35, 13, -1,
+ 35, 35, 2, -1, 15, 13, 35, -1, 16, -1,
+ -1, 40, -1, -1, -1, -1, 13, 44, 44, 46,
+ 46, 13, 15, -1, 16, -1, 41, 44, -1, 46,
+ 35, 44, -1, 46, 44, 40, 46, 44, 3, 46,
+ 44, 44, 44, 44, 41, 44, 49, 49, 49, 44,
+ 49, 46, 2, 44, 58, 46, 44, 44, 44, 15,
+ 46, 49, 49, 44, 44, 44, 46, 44, 44, 44,
+ 49, 15, 49, 49, 44, 81, 44, 52, 44, 60,
+ 50, 81, 50, 44, 50, 44, 44, 44, 99, 3,
+ 49, 49, 13, 37, 87, 56, 44, 54, 44, 20,
+ 3, 49, 48, 68, 44, 44, 44, 44, 48, 48,
+ 47, 44, 50, 46, 44, 44, 46, 46, 44, 44,
+ 46, 44, 47, 46, 44, 44, 46, 46, 44, 85,
+ 46, 3, 13, 31, 44, 15, 44, 35, -1, 49,
+ 44, 49, 44, 51, 44, 49, -1, 49, 44, 49,
+ -1, 61, -1, 49, 68, -1, 13, 37, 38, 16,
+ 41, 57, 66, -1, 66, 68, 66, 44, 44, 44,
+ -1, -1, 49, 49, 49, 51, 51, 44, 55, 44,
+ 44, 44, 49, 44, 49, 49, 49, 51, 49, -1,
+ 53, 13, 59, -1, 13, 5, 68, 16, 20, 18,
+ 5, 66, -1, 13, -1, 66, 28, 29, 13, -1,
+ 20, -1, -1, -1, -1, 20, 35, -1, 28, 29,
+ 13, -1, -1, 28, 29, -1, -1, 20, 21, 22,
+ 23, 24, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, 3,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, 13,
+ -1, -1, -1, -1, -1, -1, 20, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, 5, -1, -1, -1, -1, -1,
- -1, -1, 13, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, 28, 29, -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, -1, -1,
@@ -987,6 +984,6 @@ const short QDeclarativeJSGrammar::action_check [] = {
-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, -1,
- -1, -1, -1, -1, -1};
+ -1, -1};
QT_END_NAMESPACE
diff --git a/src/declarative/qml/parser/qdeclarativejsgrammar_p.h b/src/declarative/qml/parser/qdeclarativejsgrammar_p.h
index 32bb12b3f2..064c67a813 100644
--- a/src/declarative/qml/parser/qdeclarativejsgrammar_p.h
+++ b/src/declarative/qml/parser/qdeclarativejsgrammar_p.h
@@ -164,15 +164,15 @@ public:
T_XOR = 79,
T_XOR_EQ = 80,
- ACCEPT_STATE = 639,
- RULE_COUNT = 345,
- STATE_COUNT = 640,
+ ACCEPT_STATE = 645,
+ RULE_COUNT = 347,
+ STATE_COUNT = 646,
TERMINAL_COUNT = 101,
NON_TERMINAL_COUNT = 106,
- GOTO_INDEX_OFFSET = 640,
- GOTO_INFO_OFFSET = 2699,
- GOTO_CHECK_OFFSET = 2699
+ GOTO_INDEX_OFFSET = 646,
+ GOTO_INFO_OFFSET = 2714,
+ GOTO_CHECK_OFFSET = 2714
};
static const char *const spell [];
diff --git a/src/declarative/qml/parser/qdeclarativejsparser.cpp b/src/declarative/qml/parser/qdeclarativejsparser.cpp
index 3cf73b1ef3..170c7fa132 100644
--- a/src/declarative/qml/parser/qdeclarativejsparser.cpp
+++ b/src/declarative/qml/parser/qdeclarativejsparser.cpp
@@ -487,80 +487,124 @@ case 60: {
} break;
case 61: {
- sym(1).Node = makeAstNode<AST::UiSourceElement>(driver->nodePool(), sym(1).Node);
+ AST::UiPublicMember *node = makeAstNode<AST::UiPublicMember> (driver->nodePool(), sym(4).sval, sym(6).sval);
+ node->typeModifier = sym(2).sval;
+ node->propertyToken = loc(1);
+ node->typeModifierToken = loc(2);
+ node->typeToken = loc(4);
+ node->identifierToken = loc(6);
+ node->semicolonToken = loc(7); // insert a fake ';' before ':'
+
+ AST::UiQualifiedId *propertyName = makeAstNode<AST::UiQualifiedId>(driver->nodePool(), sym(6).sval);
+ propertyName->identifierToken = loc(6);
+ propertyName->next = 0;
+
+ AST::UiArrayBinding *binding = makeAstNode<AST::UiArrayBinding> (driver->nodePool(),
+ propertyName, sym(9).UiArrayMemberList->finish());
+ binding->colonToken = loc(7);
+ binding->lbracketToken = loc(8);
+ binding->rbracketToken = loc(10);
+
+ node->binding = binding;
+
+ sym(1).Node = node;
} break;
case 62: {
+ AST::UiPublicMember *node = makeAstNode<AST::UiPublicMember> (driver->nodePool(), sym(2).sval, sym(3).sval);
+ node->propertyToken = loc(1);
+ node->typeToken = loc(2);
+ node->identifierToken = loc(3);
+ node->semicolonToken = loc(4); // insert a fake ';' before ':'
+
+ AST::UiQualifiedId *propertyName = makeAstNode<AST::UiQualifiedId>(driver->nodePool(), sym(3).sval);
+ propertyName->identifierToken = loc(3);
+ propertyName->next = 0;
+
+ AST::UiObjectBinding *binding = makeAstNode<AST::UiObjectBinding> (driver->nodePool(),
+ propertyName, sym(5).UiQualifiedId, sym(6).UiObjectInitializer);
+ binding->colonToken = loc(4);
+
+ node->binding = binding;
+
+ sym(1).Node = node;
+} break;
+
+case 63: {
sym(1).Node = makeAstNode<AST::UiSourceElement>(driver->nodePool(), sym(1).Node);
} break;
case 64: {
+ sym(1).Node = makeAstNode<AST::UiSourceElement>(driver->nodePool(), sym(1).Node);
+} break;
+
+case 66: {
QString s = QLatin1String(QDeclarativeJSGrammar::spell[T_PROPERTY]);
sym(1).sval = driver->intern(s.constData(), s.length());
break;
}
-case 65: {
+case 67: {
QString s = QLatin1String(QDeclarativeJSGrammar::spell[T_SIGNAL]);
sym(1).sval = driver->intern(s.constData(), s.length());
break;
}
-case 66: {
+case 68: {
QString s = QLatin1String(QDeclarativeJSGrammar::spell[T_READONLY]);
sym(1).sval = driver->intern(s.constData(), s.length());
break;
}
-case 67: {
+case 69: {
QString s = QLatin1String(QDeclarativeJSGrammar::spell[T_ON]);
sym(1).sval = driver->intern(s.constData(), s.length());
break;
}
-case 68: {
+case 70: {
AST::ThisExpression *node = makeAstNode<AST::ThisExpression> (driver->nodePool());
node->thisToken = loc(1);
sym(1).Node = node;
} break;
-case 69: {
+case 71: {
AST::IdentifierExpression *node = makeAstNode<AST::IdentifierExpression> (driver->nodePool(), sym(1).sval);
node->identifierToken = loc(1);
sym(1).Node = node;
} break;
-case 70: {
+case 72: {
AST::NullExpression *node = makeAstNode<AST::NullExpression> (driver->nodePool());
node->nullToken = loc(1);
sym(1).Node = node;
} break;
-case 71: {
+case 73: {
AST::TrueLiteral *node = makeAstNode<AST::TrueLiteral> (driver->nodePool());
node->trueToken = loc(1);
sym(1).Node = node;
} break;
-case 72: {
+case 74: {
AST::FalseLiteral *node = makeAstNode<AST::FalseLiteral> (driver->nodePool());
node->falseToken = loc(1);
sym(1).Node = node;
} break;
-case 73: {
+case 75: {
AST::NumericLiteral *node = makeAstNode<AST::NumericLiteral> (driver->nodePool(), sym(1).dval);
node->literalToken = loc(1);
sym(1).Node = node;
} break;
-case 74:
-case 75: {
+case 76:
+case 77: {
AST::StringLiteral *node = makeAstNode<AST::StringLiteral> (driver->nodePool(), sym(1).sval);
node->literalToken = loc(1);
sym(1).Node = node;
} break;
-case 76: {
+case 78: {
bool rx = lexer->scanRegExp(Lexer::NoPrefix);
if (!rx) {
diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, location(lexer), lexer->errorMessage()));
@@ -574,7 +618,7 @@ case 76: {
sym(1).Node = node;
} break;
-case 77: {
+case 79: {
bool rx = lexer->scanRegExp(Lexer::EqualPrefix);
if (!rx) {
diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, location(lexer), lexer->errorMessage()));
@@ -588,28 +632,28 @@ case 77: {
sym(1).Node = node;
} break;
-case 78: {
+case 80: {
AST::ArrayLiteral *node = makeAstNode<AST::ArrayLiteral> (driver->nodePool(), (AST::Elision *) 0);
node->lbracketToken = loc(1);
node->rbracketToken = loc(2);
sym(1).Node = node;
} break;
-case 79: {
+case 81: {
AST::ArrayLiteral *node = makeAstNode<AST::ArrayLiteral> (driver->nodePool(), sym(2).Elision->finish());
node->lbracketToken = loc(1);
node->rbracketToken = loc(3);
sym(1).Node = node;
} break;
-case 80: {
+case 82: {
AST::ArrayLiteral *node = makeAstNode<AST::ArrayLiteral> (driver->nodePool(), sym(2).ElementList->finish ());
node->lbracketToken = loc(1);
node->rbracketToken = loc(3);
sym(1).Node = node;
} break;
-case 81: {
+case 83: {
AST::ArrayLiteral *node = makeAstNode<AST::ArrayLiteral> (driver->nodePool(), sym(2).ElementList->finish (),
(AST::Elision *) 0);
node->lbracketToken = loc(1);
@@ -618,7 +662,7 @@ case 81: {
sym(1).Node = node;
} break;
-case 82: {
+case 84: {
AST::ArrayLiteral *node = makeAstNode<AST::ArrayLiteral> (driver->nodePool(), sym(2).ElementList->finish (),
sym(4).Elision->finish());
node->lbracketToken = loc(1);
@@ -627,7 +671,7 @@ case 82: {
sym(1).Node = node;
} break;
-case 83: {
+case 85: {
AST::ObjectLiteral *node = 0;
if (sym(2).Node)
node = makeAstNode<AST::ObjectLiteral> (driver->nodePool(),
@@ -639,7 +683,7 @@ case 83: {
sym(1).Node = node;
} break;
-case 84: {
+case 86: {
AST::ObjectLiteral *node = makeAstNode<AST::ObjectLiteral> (driver->nodePool(),
sym(2).PropertyNameAndValueList->finish ());
node->lbraceToken = loc(1);
@@ -647,14 +691,14 @@ case 84: {
sym(1).Node = node;
} break;
-case 85: {
+case 87: {
AST::NestedExpression *node = makeAstNode<AST::NestedExpression>(driver->nodePool(), sym(2).Expression);
node->lparenToken = loc(1);
node->rparenToken = loc(3);
sym(1).Node = node;
} break;
-case 86: {
+case 88: {
if (AST::ArrayMemberExpression *mem = AST::cast<AST::ArrayMemberExpression *>(sym(1).Expression)) {
diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Warning, mem->lbracketToken,
QLatin1String("Ignored annotation")));
@@ -674,48 +718,48 @@ case 86: {
}
} break;
-case 87: {
+case 89: {
sym(1).Node = makeAstNode<AST::ElementList> (driver->nodePool(), (AST::Elision *) 0, sym(1).Expression);
} break;
-case 88: {
+case 90: {
sym(1).Node = makeAstNode<AST::ElementList> (driver->nodePool(), sym(1).Elision->finish(), sym(2).Expression);
} break;
-case 89: {
+case 91: {
AST::ElementList *node = makeAstNode<AST::ElementList> (driver->nodePool(), sym(1).ElementList,
(AST::Elision *) 0, sym(3).Expression);
node->commaToken = loc(2);
sym(1).Node = node;
} break;
-case 90: {
+case 92: {
AST::ElementList *node = makeAstNode<AST::ElementList> (driver->nodePool(), sym(1).ElementList, sym(3).Elision->finish(),
sym(4).Expression);
node->commaToken = loc(2);
sym(1).Node = node;
} break;
-case 91: {
+case 93: {
AST::Elision *node = makeAstNode<AST::Elision> (driver->nodePool());
node->commaToken = loc(1);
sym(1).Node = node;
} break;
-case 92: {
+case 94: {
AST::Elision *node = makeAstNode<AST::Elision> (driver->nodePool(), sym(1).Elision);
node->commaToken = loc(2);
sym(1).Node = node;
} break;
-case 93: {
+case 95: {
AST::PropertyNameAndValueList *node = makeAstNode<AST::PropertyNameAndValueList> (driver->nodePool(),
sym(1).PropertyName, sym(3).Expression);
node->colonToken = loc(2);
sym(1).Node = node;
} break;
-case 94: {
+case 96: {
AST::PropertyNameAndValueList *node = makeAstNode<AST::PropertyNameAndValueList> (driver->nodePool(),
sym(1).PropertyNameAndValueList, sym(3).PropertyName, sym(5).Expression);
node->commaToken = loc(2);
@@ -723,40 +767,36 @@ case 94: {
sym(1).Node = node;
} break;
-case 95: {
+case 97: {
AST::IdentifierPropertyName *node = makeAstNode<AST::IdentifierPropertyName> (driver->nodePool(), sym(1).sval);
node->propertyNameToken = loc(1);
sym(1).Node = node;
} break;
-case 96:
-case 97: {
+case 98:
+case 99: {
AST::IdentifierPropertyName *node = makeAstNode<AST::IdentifierPropertyName> (driver->nodePool(), driver->intern(lexer->characterBuffer(), lexer->characterCount()));
node->propertyNameToken = loc(1);
sym(1).Node = node;
} break;
-case 98: {
+case 100: {
AST::StringLiteralPropertyName *node = makeAstNode<AST::StringLiteralPropertyName> (driver->nodePool(), sym(1).sval);
node->propertyNameToken = loc(1);
sym(1).Node = node;
} break;
-case 99: {
+case 101: {
AST::NumericLiteralPropertyName *node = makeAstNode<AST::NumericLiteralPropertyName> (driver->nodePool(), sym(1).dval);
node->propertyNameToken = loc(1);
sym(1).Node = node;
} break;
-case 100: {
+case 102: {
AST::IdentifierPropertyName *node = makeAstNode<AST::IdentifierPropertyName> (driver->nodePool(), sym(1).sval);
node->propertyNameToken = loc(1);
sym(1).Node = node;
} break;
-case 101:
-
-case 102:
-
case 103:
case 104:
@@ -814,25 +854,29 @@ case 129:
case 130:
case 131:
+
+case 132:
+
+case 133:
{
sym(1).sval = driver->intern(lexer->characterBuffer(), lexer->characterCount());
} break;
-case 136: {
+case 138: {
AST::ArrayMemberExpression *node = makeAstNode<AST::ArrayMemberExpression> (driver->nodePool(), sym(1).Expression, sym(3).Expression);
node->lbracketToken = loc(2);
node->rbracketToken = loc(4);
sym(1).Node = node;
} break;
-case 137: {
+case 139: {
AST::FieldMemberExpression *node = makeAstNode<AST::FieldMemberExpression> (driver->nodePool(), sym(1).Expression, sym(3).sval);
node->dotToken = loc(2);
node->identifierToken = loc(3);
sym(1).Node = node;
} break;
-case 138: {
+case 140: {
AST::NewMemberExpression *node = makeAstNode<AST::NewMemberExpression> (driver->nodePool(), sym(2).Expression, sym(4).ArgumentList);
node->newToken = loc(1);
node->lparenToken = loc(3);
@@ -840,316 +884,309 @@ case 138: {
sym(1).Node = node;
} break;
-case 140: {
+case 142: {
AST::NewExpression *node = makeAstNode<AST::NewExpression> (driver->nodePool(), sym(2).Expression);
node->newToken = loc(1);
sym(1).Node = node;
} break;
-case 141: {
+case 143: {
AST::CallExpression *node = makeAstNode<AST::CallExpression> (driver->nodePool(), sym(1).Expression, sym(3).ArgumentList);
node->lparenToken = loc(2);
node->rparenToken = loc(4);
sym(1).Node = node;
} break;
-case 142: {
+case 144: {
AST::CallExpression *node = makeAstNode<AST::CallExpression> (driver->nodePool(), sym(1).Expression, sym(3).ArgumentList);
node->lparenToken = loc(2);
node->rparenToken = loc(4);
sym(1).Node = node;
} break;
-case 143: {
+case 145: {
AST::ArrayMemberExpression *node = makeAstNode<AST::ArrayMemberExpression> (driver->nodePool(), sym(1).Expression, sym(3).Expression);
node->lbracketToken = loc(2);
node->rbracketToken = loc(4);
sym(1).Node = node;
} break;
-case 144: {
+case 146: {
AST::FieldMemberExpression *node = makeAstNode<AST::FieldMemberExpression> (driver->nodePool(), sym(1).Expression, sym(3).sval);
node->dotToken = loc(2);
node->identifierToken = loc(3);
sym(1).Node = node;
} break;
-case 145: {
+case 147: {
sym(1).Node = 0;
} break;
-case 146: {
+case 148: {
sym(1).Node = sym(1).ArgumentList->finish();
} break;
-case 147: {
+case 149: {
sym(1).Node = makeAstNode<AST::ArgumentList> (driver->nodePool(), sym(1).Expression);
} break;
-case 148: {
+case 150: {
AST::ArgumentList *node = makeAstNode<AST::ArgumentList> (driver->nodePool(), sym(1).ArgumentList, sym(3).Expression);
node->commaToken = loc(2);
sym(1).Node = node;
} break;
-case 152: {
+case 154: {
AST::PostIncrementExpression *node = makeAstNode<AST::PostIncrementExpression> (driver->nodePool(), sym(1).Expression);
node->incrementToken = loc(2);
sym(1).Node = node;
} break;
-case 153: {
+case 155: {
AST::PostDecrementExpression *node = makeAstNode<AST::PostDecrementExpression> (driver->nodePool(), sym(1).Expression);
node->decrementToken = loc(2);
sym(1).Node = node;
} break;
-case 155: {
+case 157: {
AST::DeleteExpression *node = makeAstNode<AST::DeleteExpression> (driver->nodePool(), sym(2).Expression);
node->deleteToken = loc(1);
sym(1).Node = node;
} break;
-case 156: {
+case 158: {
AST::VoidExpression *node = makeAstNode<AST::VoidExpression> (driver->nodePool(), sym(2).Expression);
node->voidToken = loc(1);
sym(1).Node = node;
} break;
-case 157: {
+case 159: {
AST::TypeOfExpression *node = makeAstNode<AST::TypeOfExpression> (driver->nodePool(), sym(2).Expression);
node->typeofToken = loc(1);
sym(1).Node = node;
} break;
-case 158: {
+case 160: {
AST::PreIncrementExpression *node = makeAstNode<AST::PreIncrementExpression> (driver->nodePool(), sym(2).Expression);
node->incrementToken = loc(1);
sym(1).Node = node;
} break;
-case 159: {
+case 161: {
AST::PreDecrementExpression *node = makeAstNode<AST::PreDecrementExpression> (driver->nodePool(), sym(2).Expression);
node->decrementToken = loc(1);
sym(1).Node = node;
} break;
-case 160: {
+case 162: {
AST::UnaryPlusExpression *node = makeAstNode<AST::UnaryPlusExpression> (driver->nodePool(), sym(2).Expression);
node->plusToken = loc(1);
sym(1).Node = node;
} break;
-case 161: {
+case 163: {
AST::UnaryMinusExpression *node = makeAstNode<AST::UnaryMinusExpression> (driver->nodePool(), sym(2).Expression);
node->minusToken = loc(1);
sym(1).Node = node;
} break;
-case 162: {
+case 164: {
AST::TildeExpression *node = makeAstNode<AST::TildeExpression> (driver->nodePool(), sym(2).Expression);
node->tildeToken = loc(1);
sym(1).Node = node;
} break;
-case 163: {
+case 165: {
AST::NotExpression *node = makeAstNode<AST::NotExpression> (driver->nodePool(), sym(2).Expression);
node->notToken = loc(1);
sym(1).Node = node;
} break;
-case 165: {
+case 167: {
AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
QSOperator::Mul, sym(3).Expression);
node->operatorToken = loc(2);
sym(1).Node = node;
} break;
-case 166: {
+case 168: {
AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
QSOperator::Div, sym(3).Expression);
node->operatorToken = loc(2);
sym(1).Node = node;
} break;
-case 167: {
+case 169: {
AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
QSOperator::Mod, sym(3).Expression);
node->operatorToken = loc(2);
sym(1).Node = node;
} break;
-case 169: {
+case 171: {
AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
QSOperator::Add, sym(3).Expression);
node->operatorToken = loc(2);
sym(1).Node = node;
} break;
-case 170: {
+case 172: {
AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
QSOperator::Sub, sym(3).Expression);
node->operatorToken = loc(2);
sym(1).Node = node;
} break;
-case 172: {
+case 174: {
AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
QSOperator::LShift, sym(3).Expression);
node->operatorToken = loc(2);
sym(1).Node = node;
} break;
-case 173: {
+case 175: {
AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
QSOperator::RShift, sym(3).Expression);
node->operatorToken = loc(2);
sym(1).Node = node;
} break;
-case 174: {
+case 176: {
AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
QSOperator::URShift, sym(3).Expression);
node->operatorToken = loc(2);
sym(1).Node = node;
} break;
-case 176: {
+case 178: {
AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
QSOperator::Lt, sym(3).Expression);
node->operatorToken = loc(2);
sym(1).Node = node;
} break;
-case 177: {
+case 179: {
AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
QSOperator::Gt, sym(3).Expression);
node->operatorToken = loc(2);
sym(1).Node = node;
} break;
-case 178: {
+case 180: {
AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
QSOperator::Le, sym(3).Expression);
node->operatorToken = loc(2);
sym(1).Node = node;
} break;
-case 179: {
+case 181: {
AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
QSOperator::Ge, sym(3).Expression);
node->operatorToken = loc(2);
sym(1).Node = node;
} break;
-case 180: {
+case 182: {
AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
QSOperator::InstanceOf, sym(3).Expression);
node->operatorToken = loc(2);
sym(1).Node = node;
} break;
-case 181: {
+case 183: {
AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
QSOperator::In, sym(3).Expression);
node->operatorToken = loc(2);
sym(1).Node = node;
} break;
-case 183: {
+case 185: {
AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
QSOperator::Lt, sym(3).Expression);
node->operatorToken = loc(2);
sym(1).Node = node;
} break;
-case 184: {
+case 186: {
AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
QSOperator::Gt, sym(3).Expression);
node->operatorToken = loc(2);
sym(1).Node = node;
} break;
-case 185: {
+case 187: {
AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
QSOperator::Le, sym(3).Expression);
node->operatorToken = loc(2);
sym(1).Node = node;
} break;
-case 186: {
+case 188: {
AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
QSOperator::Ge, sym(3).Expression);
node->operatorToken = loc(2);
sym(1).Node = node;
} break;
-case 187: {
+case 189: {
AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
QSOperator::InstanceOf, sym(3).Expression);
node->operatorToken = loc(2);
sym(1).Node = node;
} break;
-case 189: {
+case 191: {
AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
QSOperator::Equal, sym(3).Expression);
node->operatorToken = loc(2);
sym(1).Node = node;
} break;
-case 190: {
+case 192: {
AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
QSOperator::NotEqual, sym(3).Expression);
node->operatorToken = loc(2);
sym(1).Node = node;
} break;
-case 191: {
+case 193: {
AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
QSOperator::StrictEqual, sym(3).Expression);
node->operatorToken = loc(2);
sym(1).Node = node;
} break;
-case 192: {
+case 194: {
AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
QSOperator::StrictNotEqual, sym(3).Expression);
node->operatorToken = loc(2);
sym(1).Node = node;
} break;
-case 194: {
+case 196: {
AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
QSOperator::Equal, sym(3).Expression);
node->operatorToken = loc(2);
sym(1).Node = node;
} break;
-case 195: {
+case 197: {
AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
QSOperator::NotEqual, sym(3).Expression);
node->operatorToken = loc(2);
sym(1).Node = node;
} break;
-case 196: {
+case 198: {
AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
QSOperator::StrictEqual, sym(3).Expression);
node->operatorToken = loc(2);
sym(1).Node = node;
} break;
-case 197: {
- AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
- QSOperator::StrictNotEqual, sym(3).Expression);
- node->operatorToken = loc(2);
- sym(1).Node = node;
-} break;
-
case 199: {
AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
- QSOperator::BitAnd, sym(3).Expression);
+ QSOperator::StrictNotEqual, sym(3).Expression);
node->operatorToken = loc(2);
sym(1).Node = node;
} break;
@@ -1163,7 +1200,7 @@ case 201: {
case 203: {
AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
- QSOperator::BitXor, sym(3).Expression);
+ QSOperator::BitAnd, sym(3).Expression);
node->operatorToken = loc(2);
sym(1).Node = node;
} break;
@@ -1177,7 +1214,7 @@ case 205: {
case 207: {
AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
- QSOperator::BitOr, sym(3).Expression);
+ QSOperator::BitXor, sym(3).Expression);
node->operatorToken = loc(2);
sym(1).Node = node;
} break;
@@ -1191,7 +1228,7 @@ case 209: {
case 211: {
AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
- QSOperator::And, sym(3).Expression);
+ QSOperator::BitOr, sym(3).Expression);
node->operatorToken = loc(2);
sym(1).Node = node;
} break;
@@ -1205,7 +1242,7 @@ case 213: {
case 215: {
AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
- QSOperator::Or, sym(3).Expression);
+ QSOperator::And, sym(3).Expression);
node->operatorToken = loc(2);
sym(1).Node = node;
} break;
@@ -1218,6 +1255,13 @@ case 217: {
} break;
case 219: {
+ AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
+ QSOperator::Or, sym(3).Expression);
+ node->operatorToken = loc(2);
+ sym(1).Node = node;
+} break;
+
+case 221: {
AST::ConditionalExpression *node = makeAstNode<AST::ConditionalExpression> (driver->nodePool(), sym(1).Expression,
sym(3).Expression, sym(5).Expression);
node->questionToken = loc(2);
@@ -1225,7 +1269,7 @@ case 219: {
sym(1).Node = node;
} break;
-case 221: {
+case 223: {
AST::ConditionalExpression *node = makeAstNode<AST::ConditionalExpression> (driver->nodePool(), sym(1).Expression,
sym(3).Expression, sym(5).Expression);
node->questionToken = loc(2);
@@ -1233,112 +1277,112 @@ case 221: {
sym(1).Node = node;
} break;
-case 223: {
+case 225: {
AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
sym(2).ival, sym(3).Expression);
node->operatorToken = loc(2);
sym(1).Node = node;
} break;
-case 225: {
+case 227: {
AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression,
sym(2).ival, sym(3).Expression);
node->operatorToken = loc(2);
sym(1).Node = node;
} break;
-case 226: {
+case 228: {
sym(1).ival = QSOperator::Assign;
} break;
-case 227: {
+case 229: {
sym(1).ival = QSOperator::InplaceMul;
} break;
-case 228: {
+case 230: {
sym(1).ival = QSOperator::InplaceDiv;
} break;
-case 229: {
+case 231: {
sym(1).ival = QSOperator::InplaceMod;
} break;
-case 230: {
+case 232: {
sym(1).ival = QSOperator::InplaceAdd;
} break;
-case 231: {
+case 233: {
sym(1).ival = QSOperator::InplaceSub;
} break;
-case 232: {
+case 234: {
sym(1).ival = QSOperator::InplaceLeftShift;
} break;
-case 233: {
+case 235: {
sym(1).ival = QSOperator::InplaceRightShift;
} break;
-case 234: {
+case 236: {
sym(1).ival = QSOperator::InplaceURightShift;
} break;
-case 235: {
+case 237: {
sym(1).ival = QSOperator::InplaceAnd;
} break;
-case 236: {
+case 238: {
sym(1).ival = QSOperator::InplaceXor;
} break;
-case 237: {
+case 239: {
sym(1).ival = QSOperator::InplaceOr;
} break;
-case 239: {
+case 241: {
AST::Expression *node = makeAstNode<AST::Expression> (driver->nodePool(), sym(1).Expression, sym(3).Expression);
node->commaToken = loc(2);
sym(1).Node = node;
} break;
-case 240: {
+case 242: {
sym(1).Node = 0;
} break;
-case 243: {
+case 245: {
AST::Expression *node = makeAstNode<AST::Expression> (driver->nodePool(), sym(1).Expression, sym(3).Expression);
node->commaToken = loc(2);
sym(1).Node = node;
} break;
-case 244: {
+case 246: {
sym(1).Node = 0;
} break;
-case 261: {
+case 263: {
AST::Block *node = makeAstNode<AST::Block> (driver->nodePool(), sym(2).StatementList);
node->lbraceToken = loc(1);
node->rbraceToken = loc(3);
sym(1).Node = node;
} break;
-case 262: {
+case 264: {
sym(1).Node = makeAstNode<AST::StatementList> (driver->nodePool(), sym(1).Statement);
} break;
-case 263: {
+case 265: {
sym(1).Node = makeAstNode<AST::StatementList> (driver->nodePool(), sym(1).StatementList, sym(2).Statement);
} break;
-case 264: {
+case 266: {
sym(1).Node = 0;
} break;
-case 265: {
+case 267: {
sym(1).Node = sym(1).StatementList->finish ();
} break;
-case 267: {
+case 269: {
AST::VariableStatement *node = makeAstNode<AST::VariableStatement> (driver->nodePool(),
sym(2).VariableDeclarationList->finish (/*readOnly=*/sym(1).ival == T_CONST));
node->declarationKindToken = loc(1);
@@ -1346,76 +1390,76 @@ case 267: {
sym(1).Node = node;
} break;
-case 268: {
+case 270: {
sym(1).ival = T_CONST;
} break;
-case 269: {
+case 271: {
sym(1).ival = T_VAR;
} break;
-case 270: {
+case 272: {
sym(1).Node = makeAstNode<AST::VariableDeclarationList> (driver->nodePool(), sym(1).VariableDeclaration);
} break;
-case 271: {
+case 273: {
AST::VariableDeclarationList *node = makeAstNode<AST::VariableDeclarationList> (driver->nodePool(),
sym(1).VariableDeclarationList, sym(3).VariableDeclaration);
node->commaToken = loc(2);
sym(1).Node = node;
} break;
-case 272: {
+case 274: {
sym(1).Node = makeAstNode<AST::VariableDeclarationList> (driver->nodePool(), sym(1).VariableDeclaration);
} break;
-case 273: {
+case 275: {
sym(1).Node = makeAstNode<AST::VariableDeclarationList> (driver->nodePool(), sym(1).VariableDeclarationList, sym(3).VariableDeclaration);
} break;
-case 274: {
+case 276: {
AST::VariableDeclaration *node = makeAstNode<AST::VariableDeclaration> (driver->nodePool(), sym(1).sval, sym(2).Expression);
node->identifierToken = loc(1);
sym(1).Node = node;
} break;
-case 275: {
+case 277: {
AST::VariableDeclaration *node = makeAstNode<AST::VariableDeclaration> (driver->nodePool(), sym(1).sval, sym(2).Expression);
node->identifierToken = loc(1);
sym(1).Node = node;
} break;
-case 276: {
+case 278: {
// ### TODO: AST for initializer
sym(1) = sym(2);
} break;
-case 277: {
+case 279: {
sym(1).Node = 0;
} break;
-case 279: {
+case 281: {
// ### TODO: AST for initializer
sym(1) = sym(2);
} break;
-case 280: {
+case 282: {
sym(1).Node = 0;
} break;
-case 282: {
+case 284: {
AST::EmptyStatement *node = makeAstNode<AST::EmptyStatement> (driver->nodePool());
node->semicolonToken = loc(1);
sym(1).Node = node;
} break;
-case 284: {
+case 286: {
AST::ExpressionStatement *node = makeAstNode<AST::ExpressionStatement> (driver->nodePool(), sym(1).Expression);
node->semicolonToken = loc(2);
sym(1).Node = node;
} break;
-case 285: {
+case 287: {
AST::IfStatement *node = makeAstNode<AST::IfStatement> (driver->nodePool(), sym(3).Expression, sym(5).Statement, sym(7).Statement);
node->ifToken = loc(1);
node->lparenToken = loc(2);
@@ -1424,7 +1468,7 @@ case 285: {
sym(1).Node = node;
} break;
-case 286: {
+case 288: {
AST::IfStatement *node = makeAstNode<AST::IfStatement> (driver->nodePool(), sym(3).Expression, sym(5).Statement);
node->ifToken = loc(1);
node->lparenToken = loc(2);
@@ -1432,7 +1476,7 @@ case 286: {
sym(1).Node = node;
} break;
-case 288: {
+case 290: {
AST::DoWhileStatement *node = makeAstNode<AST::DoWhileStatement> (driver->nodePool(), sym(2).Statement, sym(5).Expression);
node->doToken = loc(1);
node->whileToken = loc(3);
@@ -1442,7 +1486,7 @@ case 288: {
sym(1).Node = node;
} break;
-case 289: {
+case 291: {
AST::WhileStatement *node = makeAstNode<AST::WhileStatement> (driver->nodePool(), sym(3).Expression, sym(5).Statement);
node->whileToken = loc(1);
node->lparenToken = loc(2);
@@ -1450,7 +1494,7 @@ case 289: {
sym(1).Node = node;
} break;
-case 290: {
+case 292: {
AST::ForStatement *node = makeAstNode<AST::ForStatement> (driver->nodePool(), sym(3).Expression,
sym(5).Expression, sym(7).Expression, sym(9).Statement);
node->forToken = loc(1);
@@ -1461,7 +1505,7 @@ case 290: {
sym(1).Node = node;
} break;
-case 291: {
+case 293: {
AST::LocalForStatement *node = makeAstNode<AST::LocalForStatement> (driver->nodePool(),
sym(4).VariableDeclarationList->finish (/*readOnly=*/false), sym(6).Expression,
sym(8).Expression, sym(10).Statement);
@@ -1474,7 +1518,7 @@ case 291: {
sym(1).Node = node;
} break;
-case 292: {
+case 294: {
AST:: ForEachStatement *node = makeAstNode<AST::ForEachStatement> (driver->nodePool(), sym(3).Expression,
sym(5).Expression, sym(7).Statement);
node->forToken = loc(1);
@@ -1484,7 +1528,7 @@ case 292: {
sym(1).Node = node;
} break;
-case 293: {
+case 295: {
AST::LocalForEachStatement *node = makeAstNode<AST::LocalForEachStatement> (driver->nodePool(),
sym(4).VariableDeclaration, sym(6).Expression, sym(8).Statement);
node->forToken = loc(1);
@@ -1495,14 +1539,14 @@ case 293: {
sym(1).Node = node;
} break;
-case 295: {
+case 297: {
AST::ContinueStatement *node = makeAstNode<AST::ContinueStatement> (driver->nodePool());
node->continueToken = loc(1);
node->semicolonToken = loc(2);
sym(1).Node = node;
} break;
-case 297: {
+case 299: {
AST::ContinueStatement *node = makeAstNode<AST::ContinueStatement> (driver->nodePool(), sym(2).sval);
node->continueToken = loc(1);
node->identifierToken = loc(2);
@@ -1510,14 +1554,14 @@ case 297: {
sym(1).Node = node;
} break;
-case 299: {
+case 301: {
AST::BreakStatement *node = makeAstNode<AST::BreakStatement> (driver->nodePool());
node->breakToken = loc(1);
node->semicolonToken = loc(2);
sym(1).Node = node;
} break;
-case 301: {
+case 303: {
AST::BreakStatement *node = makeAstNode<AST::BreakStatement> (driver->nodePool(), sym(2).sval);
node->breakToken = loc(1);
node->identifierToken = loc(2);
@@ -1525,14 +1569,14 @@ case 301: {
sym(1).Node = node;
} break;
-case 303: {
+case 305: {
AST::ReturnStatement *node = makeAstNode<AST::ReturnStatement> (driver->nodePool(), sym(2).Expression);
node->returnToken = loc(1);
node->semicolonToken = loc(3);
sym(1).Node = node;
} break;
-case 304: {
+case 306: {
AST::WithStatement *node = makeAstNode<AST::WithStatement> (driver->nodePool(), sym(3).Expression, sym(5).Statement);
node->withToken = loc(1);
node->lparenToken = loc(2);
@@ -1540,7 +1584,7 @@ case 304: {
sym(1).Node = node;
} break;
-case 305: {
+case 307: {
AST::SwitchStatement *node = makeAstNode<AST::SwitchStatement> (driver->nodePool(), sym(3).Expression, sym(5).CaseBlock);
node->switchToken = loc(1);
node->lparenToken = loc(2);
@@ -1548,90 +1592,90 @@ case 305: {
sym(1).Node = node;
} break;
-case 306: {
+case 308: {
AST::CaseBlock *node = makeAstNode<AST::CaseBlock> (driver->nodePool(), sym(2).CaseClauses);
node->lbraceToken = loc(1);
node->rbraceToken = loc(3);
sym(1).Node = node;
} break;
-case 307: {
+case 309: {
AST::CaseBlock *node = makeAstNode<AST::CaseBlock> (driver->nodePool(), sym(2).CaseClauses, sym(3).DefaultClause, sym(4).CaseClauses);
node->lbraceToken = loc(1);
node->rbraceToken = loc(5);
sym(1).Node = node;
} break;
-case 308: {
+case 310: {
sym(1).Node = makeAstNode<AST::CaseClauses> (driver->nodePool(), sym(1).CaseClause);
} break;
-case 309: {
+case 311: {
sym(1).Node = makeAstNode<AST::CaseClauses> (driver->nodePool(), sym(1).CaseClauses, sym(2).CaseClause);
} break;
-case 310: {
+case 312: {
sym(1).Node = 0;
} break;
-case 311: {
+case 313: {
sym(1).Node = sym(1).CaseClauses->finish ();
} break;
-case 312: {
+case 314: {
AST::CaseClause *node = makeAstNode<AST::CaseClause> (driver->nodePool(), sym(2).Expression, sym(4).StatementList);
node->caseToken = loc(1);
node->colonToken = loc(3);
sym(1).Node = node;
} break;
-case 313: {
+case 315: {
AST::DefaultClause *node = makeAstNode<AST::DefaultClause> (driver->nodePool(), sym(3).StatementList);
node->defaultToken = loc(1);
node->colonToken = loc(2);
sym(1).Node = node;
} break;
-case 314:
-case 315: {
+case 316:
+case 317: {
AST::LabelledStatement *node = makeAstNode<AST::LabelledStatement> (driver->nodePool(), driver->intern(lexer->characterBuffer(), lexer->characterCount()), sym(3).Statement);
node->identifierToken = loc(1);
node->colonToken = loc(2);
sym(1).Node = node;
} break;
-case 316: {
+case 318: {
AST::LabelledStatement *node = makeAstNode<AST::LabelledStatement> (driver->nodePool(), sym(1).sval, sym(3).Statement);
node->identifierToken = loc(1);
node->colonToken = loc(2);
sym(1).Node = node;
} break;
-case 318: {
+case 320: {
AST::ThrowStatement *node = makeAstNode<AST::ThrowStatement> (driver->nodePool(), sym(2).Expression);
node->throwToken = loc(1);
node->semicolonToken = loc(3);
sym(1).Node = node;
} break;
-case 319: {
+case 321: {
AST::TryStatement *node = makeAstNode<AST::TryStatement> (driver->nodePool(), sym(2).Statement, sym(3).Catch);
node->tryToken = loc(1);
sym(1).Node = node;
} break;
-case 320: {
+case 322: {
AST::TryStatement *node = makeAstNode<AST::TryStatement> (driver->nodePool(), sym(2).Statement, sym(3).Finally);
node->tryToken = loc(1);
sym(1).Node = node;
} break;
-case 321: {
+case 323: {
AST::TryStatement *node = makeAstNode<AST::TryStatement> (driver->nodePool(), sym(2).Statement, sym(3).Catch, sym(4).Finally);
node->tryToken = loc(1);
sym(1).Node = node;
} break;
-case 322: {
+case 324: {
AST::Catch *node = makeAstNode<AST::Catch> (driver->nodePool(), sym(3).sval, sym(5).Block);
node->catchToken = loc(1);
node->lparenToken = loc(2);
@@ -1640,20 +1684,20 @@ case 322: {
sym(1).Node = node;
} break;
-case 323: {
+case 325: {
AST::Finally *node = makeAstNode<AST::Finally> (driver->nodePool(), sym(2).Block);
node->finallyToken = loc(1);
sym(1).Node = node;
} break;
-case 325: {
+case 327: {
AST::DebuggerStatement *node = makeAstNode<AST::DebuggerStatement> (driver->nodePool());
node->debuggerToken = loc(1);
node->semicolonToken = loc(2);
sym(1).Node = node;
} break;
-case 326: {
+case 328: {
AST::FunctionDeclaration *node = makeAstNode<AST::FunctionDeclaration> (driver->nodePool(), sym(2).sval, sym(4).FormalParameterList, sym(7).FunctionBody);
node->functionToken = loc(1);
node->identifierToken = loc(2);
@@ -1664,7 +1708,7 @@ case 326: {
sym(1).Node = node;
} break;
-case 327: {
+case 329: {
AST::FunctionExpression *node = makeAstNode<AST::FunctionExpression> (driver->nodePool(), sym(2).sval, sym(4).FormalParameterList, sym(7).FunctionBody);
node->functionToken = loc(1);
if (sym(2).sval)
@@ -1676,60 +1720,60 @@ case 327: {
sym(1).Node = node;
} break;
-case 328: {
+case 330: {
AST::FormalParameterList *node = makeAstNode<AST::FormalParameterList> (driver->nodePool(), sym(1).sval);
node->identifierToken = loc(1);
sym(1).Node = node;
} break;
-case 329: {
+case 331: {
AST::FormalParameterList *node = makeAstNode<AST::FormalParameterList> (driver->nodePool(), sym(1).FormalParameterList, sym(3).sval);
node->commaToken = loc(2);
node->identifierToken = loc(3);
sym(1).Node = node;
} break;
-case 330: {
+case 332: {
sym(1).Node = 0;
} break;
-case 331: {
+case 333: {
sym(1).Node = sym(1).FormalParameterList->finish ();
} break;
-case 332: {
+case 334: {
sym(1).Node = 0;
} break;
-case 334: {
+case 336: {
sym(1).Node = makeAstNode<AST::FunctionBody> (driver->nodePool(), sym(1).SourceElements->finish ());
} break;
-case 335: {
+case 337: {
sym(1).Node = makeAstNode<AST::Program> (driver->nodePool(), sym(1).SourceElements->finish ());
} break;
-case 336: {
+case 338: {
sym(1).Node = makeAstNode<AST::SourceElements> (driver->nodePool(), sym(1).SourceElement);
} break;
-case 337: {
+case 339: {
sym(1).Node = makeAstNode<AST::SourceElements> (driver->nodePool(), sym(1).SourceElements, sym(2).SourceElement);
} break;
-case 338: {
+case 340: {
sym(1).Node = makeAstNode<AST::StatementSourceElement> (driver->nodePool(), sym(1).Statement);
} break;
-case 339: {
+case 341: {
sym(1).Node = makeAstNode<AST::FunctionSourceElement> (driver->nodePool(), sym(1).FunctionDeclaration);
} break;
-case 340: {
+case 342: {
sym(1).sval = 0;
} break;
-case 342: {
+case 344: {
sym(1).Node = 0;
} break;
diff --git a/src/declarative/qml/parser/qdeclarativejsparser_p.h b/src/declarative/qml/parser/qdeclarativejsparser_p.h
index 3864398992..8838fbe07b 100644
--- a/src/declarative/qml/parser/qdeclarativejsparser_p.h
+++ b/src/declarative/qml/parser/qdeclarativejsparser_p.h
@@ -235,9 +235,9 @@ protected:
-#define J_SCRIPT_REGEXPLITERAL_RULE1 76
+#define J_SCRIPT_REGEXPLITERAL_RULE1 78
-#define J_SCRIPT_REGEXPLITERAL_RULE2 77
+#define J_SCRIPT_REGEXPLITERAL_RULE2 79
QT_QML_END_NAMESPACE
diff --git a/src/declarative/qml/qdeclarativecompositetypemanager.cpp b/src/declarative/qml/qdeclarativecompositetypemanager.cpp
index c59e5e2aea..eb8c9ebad1 100644
--- a/src/declarative/qml/qdeclarativecompositetypemanager.cpp
+++ b/src/declarative/qml/qdeclarativecompositetypemanager.cpp
@@ -537,6 +537,31 @@ int QDeclarativeCompositeTypeManager::resolveTypes(QDeclarativeCompositeTypeData
int waiting = 0;
+ /*
+ For local urls, add an implicit import "." as first (most overridden) lookup. This will also trigger
+ the loading of the qmldir and the import of any native types from available plugins.
+ */
+ {
+
+ QDeclarativeDirComponents qmldircomponentsnetwork;
+ if (QDeclarativeCompositeTypeResource *resource
+ = resources.value(unit->imports.baseUrl().resolved(QUrl(QLatin1String("./qmldir"))))) {
+ QDeclarativeDirParser parser;
+ parser.setSource(QString::fromUtf8(resource->data));
+ parser.parse();
+ qmldircomponentsnetwork = parser.components();
+ }
+
+ QDeclarativeEnginePrivate::get(engine)->
+ addToImport(&unit->imports,
+ qmldircomponentsnetwork,
+ QLatin1String("."),
+ QString(),
+ -1, -1,
+ QDeclarativeScriptParser::Import::File,
+ 0); // error ignored (just means no fallback)
+ }
+
foreach (QDeclarativeScriptParser::Import imp, unit->data.imports()) {
QDeclarativeDirComponents qmldircomponentsnetwork;
@@ -587,31 +612,6 @@ int QDeclarativeCompositeTypeManager::resolveTypes(QDeclarativeCompositeTypeData
}
}
- /*
- For local urls, add an implicit import "." as first lookup. This will also trigger
- the loading of the qmldir and the import of any native types from available plugins.
- */
- {
-
- QDeclarativeDirComponents qmldircomponentsnetwork;
- if (QDeclarativeCompositeTypeResource *resource
- = resources.value(unit->imports.baseUrl().resolved(QUrl(QLatin1String("./qmldir"))))) {
- QDeclarativeDirParser parser;
- parser.setSource(QString::fromUtf8(resource->data));
- parser.parse();
- qmldircomponentsnetwork = parser.components();
- }
-
- QDeclarativeEnginePrivate::get(engine)->
- addToImport(&unit->imports,
- qmldircomponentsnetwork,
- QLatin1String("."),
- QString(),
- -1, -1,
- QDeclarativeScriptParser::Import::File,
- 0); // error ignored (just means no fallback)
- }
-
QList<QDeclarativeScriptParser::TypeReference*> types = unit->data.referencedTypes();
diff --git a/src/declarative/qml/qdeclarativeengine.cpp b/src/declarative/qml/qdeclarativeengine.cpp
index 3e570e5459..9442705fde 100644
--- a/src/declarative/qml/qdeclarativeengine.cpp
+++ b/src/declarative/qml/qdeclarativeengine.cpp
@@ -1980,8 +1980,11 @@ QString QDeclarativeEnginePrivate::resolvePlugin(const QDir &dir, const QString
QStringList()
# ifdef QT_DEBUG
<< QLatin1String("_debug.dylib") // try a qmake-style debug build first
-# endif
<< QLatin1String(".dylib")
+# else
+ << QLatin1String(".dylib")
+ << QLatin1String("_debug.dylib") // try a qmake-style debug build after
+# endif
<< QLatin1String(".so")
<< QLatin1String(".bundle"),
QLatin1String("lib"));
diff --git a/src/declarative/qml/qdeclarativescriptparser.cpp b/src/declarative/qml/qdeclarativescriptparser.cpp
index 9fff294a93..2b9cd4bad4 100644
--- a/src/declarative/qml/qdeclarativescriptparser.cpp
+++ b/src/declarative/qml/qdeclarativescriptparser.cpp
@@ -397,7 +397,7 @@ Object *ProcessAST::defineObjectBinding(AST::UiQualifiedId *qualifiedId, bool on
if (string.isStringList()) {
QStringList urls = string.asStringList();
// We need to add this as a resource
- for (int ii = 0; ii < urls.count(); ++ii)
+ for (int ii = 0; ii < urls.count(); ++ii)
_parser->_refUrls << QUrl(urls.at(ii));
}
}
@@ -503,7 +503,7 @@ bool ProcessAST::visit(AST::UiImport *node)
error.setColumn(node->importIdToken.startColumn);
_parser->_errors << error;
return false;
- }
+ }
import.location = location(startLoc, endLoc);
@@ -637,7 +637,7 @@ bool ProcessAST::visit(AST::UiPublicMember *node)
property.isDefaultProperty = node->isDefaultMember;
property.type = type;
if (type >= Object::DynamicProperty::Custom) {
- QDeclarativeScriptParser::TypeReference *typeRef =
+ QDeclarativeScriptParser::TypeReference *typeRef =
_parser->findOrCreateType(memberType);
typeRef->refObjects.append(_stateStack.top().object);
}
@@ -660,9 +660,12 @@ bool ProcessAST::visit(AST::UiPublicMember *node)
}
_stateStack.top().object->dynamicProperties << property;
+
+ // process QML-like initializers (e.g. property Object o: Object {})
+ accept(node->binding);
}
- return true;
+ return false;
}
@@ -996,7 +999,7 @@ QDeclarativeParser::Object::ScriptBlock::Pragmas QDeclarativeScriptParser::extra
for (int ii = 0; ii < length; ++ii) {
const QChar &c = data[ii];
- if (c.isSpace())
+ if (c.isSpace())
continue;
if (c == forwardSlash) {
diff --git a/src/declarative/util/qdeclarativelistmodel.cpp b/src/declarative/util/qdeclarativelistmodel.cpp
index 1a28176042..13662c5276 100644
--- a/src/declarative/util/qdeclarativelistmodel.cpp
+++ b/src/declarative/util/qdeclarativelistmodel.cpp
@@ -532,7 +532,7 @@ QScriptValue QDeclarativeListModel::get(int index) const
\qmlmethod ListModel::set(int index, jsobject dict)
Changes the item at \a index in the list model with the
- values in \a dict. Properties not appearing in \a valuemap
+ values in \a dict. Properties not appearing in \a dict
are left unchanged.
\code
@@ -1273,6 +1273,8 @@ void ModelNode::setObjectValue(const QScriptValue& valuemap) {
value->setListValue(v);
} else {
value->values << v.toVariant();
+ if (objectCache)
+ objectCache->setValue(it.name().toUtf8(), value->values.last());
}
if (properties.contains(it.name()))
delete properties[it.name()];
diff --git a/src/gui/dialogs/qdialog.cpp b/src/gui/dialogs/qdialog.cpp
index 3f8cc7211a..c9129c141c 100644
--- a/src/gui/dialogs/qdialog.cpp
+++ b/src/gui/dialogs/qdialog.cpp
@@ -258,7 +258,7 @@ QT_BEGIN_NAMESPACE
QDialog::QDialog(QWidget *parent, Qt::WindowFlags f)
: QWidget(*new QDialogPrivate, parent,
- f | QFlag((f & Qt::WindowType_Mask) == 0 ? Qt::Dialog : 0))
+ f | ((f & Qt::WindowType_Mask) == 0 ? Qt::Dialog : Qt::WindowType(0)))
{
#ifdef Q_WS_WINCE
if (!qt_wince_is_smartphone())
@@ -295,7 +295,7 @@ QDialog::QDialog(QWidget *parent, const char *name, bool modal, Qt::WindowFlags
\internal
*/
QDialog::QDialog(QDialogPrivate &dd, QWidget *parent, Qt::WindowFlags f)
- : QWidget(dd, parent, f | QFlag((f & Qt::WindowType_Mask) == 0 ? Qt::Dialog : 0))
+ : QWidget(dd, parent, f | ((f & Qt::WindowType_Mask) == 0 ? Qt::Dialog : Qt::WindowType(0)))
{
#ifdef Q_WS_WINCE
if (!qt_wince_is_smartphone())
diff --git a/src/gui/dialogs/qfiledialog.cpp b/src/gui/dialogs/qfiledialog.cpp
index ef2b223d5c..3b5fb9f39f 100644
--- a/src/gui/dialogs/qfiledialog.cpp
+++ b/src/gui/dialogs/qfiledialog.cpp
@@ -723,9 +723,15 @@ void QFileDialog::setVisible(bool visible)
// Set WA_DontShowOnScreen so that QDialog::setVisible(visible) below
// updates the state correctly, but skips showing the non-native version:
setAttribute(Qt::WA_DontShowOnScreen);
+ //So the completer don't try to complete and therefore to show a popup
+ d->completer->setModel(0);
} else {
d->nativeDialogInUse = false;
setAttribute(Qt::WA_DontShowOnScreen, false);
+ if (d->proxyModel != 0)
+ d->completer->setModel(d->proxyModel);
+ else
+ d->completer->setModel(d->model);
}
}
diff --git a/src/gui/egl/qegl.cpp b/src/gui/egl/qegl.cpp
index b8705239b8..498245cb10 100644
--- a/src/gui/egl/qegl.cpp
+++ b/src/gui/egl/qegl.cpp
@@ -528,6 +528,11 @@ QEglProperties QEglContext::configProperties() const
return QEglProperties(config());
}
+#if (defined(EGL_KHR_image) || defined(EGL_KHR_image_base)) && !defined(EGL_EGLEXT_PROTOTYPES)
+_eglCreateImageKHR eglCreateImageKHR = 0;
+_eglDestroyImageKHR eglDestroyImageKHR = 0;
+#endif
+
EGLDisplay QEgl::display()
{
static EGLDisplay dpy = EGL_NO_DISPLAY;
@@ -549,6 +554,14 @@ EGLDisplay QEgl::display()
qWarning() << "QEgl::display(): Cannot initialize EGL display:" << QEgl::errorString();
return EGL_NO_DISPLAY;
}
+
+ // Resolve the egl extension function pointers:
+#if !defined(EGL_KHR_image) && !defined(EGL_KHR_image_base)
+ if (QEgl::hasExtension("EGL_KHR_image") || QEgl::hasExtension("EGL_KHR_image_base")) {
+ eglCreateImageKHR = (_eglCreateImageKHR) eglGetProcAddress("eglCreateImageKHR");
+ eglDestroyImageKHR = (_eglDestroyImageKHR) eglGetProcAddress("eglDestroyImageKHR");
+ }
+#endif
}
return dpy;
diff --git a/src/gui/egl/qegl_p.h b/src/gui/egl/qegl_p.h
index 7dad9fe345..540cd3d425 100644
--- a/src/gui/egl/qegl_p.h
+++ b/src/gui/egl/qegl_p.h
@@ -100,13 +100,63 @@ typedef NativeDisplayType EGLNativeDisplayType;
QT_END_INCLUDE_NAMESPACE
#include <QtGui/qpaintdevice.h>
-
#include <QFlags>
QT_BEGIN_NAMESPACE
#define QEGL_NO_CONFIG ((EGLConfig)-1)
+#ifndef EGLAPIENTRY
+#define EGLAPIENTRY
+#endif
+
+// Try to get some info to debug the symbian build failues:
+#ifdef Q_OS_SYMBIAN
+
+#ifdef EGL_KHR_image
+#warning "EGL_KHR_image is defined"
+#else
+#warning "EGL_KHR_image is NOT defined"
+#endif
+
+#ifdef EGL_KHR_image_base
+#warning "EGL_KHR_image_base is defined"
+#else
+#warning "EGL_KHR_image_base is NOT defined"
+#endif
+
+#ifdef EGL_EGLEXT_PROTOTYPES
+#warning "EGL_EGLEXT_PROTOTYPES is defined"
+#else
+#warning "EGL_EGLEXT_PROTOTYPES NOT not defined"
+#endif
+
+#endif
+
+
+// Declare/define the bits of EGL_KHR_image_base we need:
+#if !defined(EGL_KHR_image) && !defined(EGL_KHR_image_base)
+typedef void *EGLImageKHR;
+#define EGL_NO_IMAGE_KHR ((EGLImageKHR)0)
+#define EGL_IMAGE_PRESERVED_KHR 0x30D2
+#endif
+
+// It is possible that something has included eglext.h (like Symbian 10.1's broken egl.h), in
+// which case, EGL_KHR_image/EGL_KHR_image_base will be defined. They may have also defined
+// the actual function prototypes, but generally EGL_EGLEXT_PROTOTYPES will be defined in that
+// case and we shouldn't re-define them here.
+#if (defined(EGL_KHR_image) || defined(EGL_KHR_image_base)) && !defined(EGL_EGLEXT_PROTOTYPES)
+typedef EGLImageKHR (EGLAPIENTRY *_eglCreateImageKHR)(EGLDisplay, EGLContext, EGLenum, EGLClientBuffer, EGLint*);
+typedef EGLBoolean (EGLAPIENTRY *_eglDestroyImageKHR)(EGLDisplay, EGLImageKHR);
+
+// Defined in qegl.cpp:
+extern Q_GUI_EXPORT _eglCreateImageKHR eglCreateImageKHR;
+extern Q_GUI_EXPORT _eglDestroyImageKHR eglDestroyImageKHR;
+#endif // (defined(EGL_KHR_image) || defined(EGL_KHR_image_base)) && !defined(EGL_EGLEXT_PROTOTYPES)
+
+#if !defined(EGL_KHR_image) && !defined(EGL_KHR_image_pixmap)
+#define EGL_NATIVE_PIXMAP_KHR 0x30B0
+#endif
class QEglProperties;
@@ -132,7 +182,6 @@ namespace QEgl {
};
Q_DECLARE_FLAGS(ConfigOptions, ConfigOption);
-
// Most of the time we use the same config for things like widgets & pixmaps, so rather than
// go through the eglChooseConfig loop every time, we use defaultConfig, which will return
// the config for a particular device/api/option combo. This function assumes that once a
diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp
index 20c9faa69a..f106b3d58d 100644
--- a/src/gui/graphicsview/qgraphicsitem.cpp
+++ b/src/gui/graphicsview/qgraphicsitem.cpp
@@ -381,7 +381,9 @@
\value ItemSendsGeometryChanges The item enables itemChange()
notifications for ItemPositionChange, ItemPositionHasChanged,
- ItemMatrixChange, ItemTransformChange, and ItemTransformHasChanged. For
+ ItemMatrixChange, ItemTransformChange, ItemTransformHasChanged,
+ ItemRotationChange, ItemRotationHasChanged, ItemScaleChange, ItemScaleHasChanged,
+ ItemTransformOriginPointChange, and ItemTransformOriginPointHasChanged. For
performance reasons, these notifications are disabled by default. You must
enable this flag to receive notifications for position and transform
changes. This flag was introduced in Qt 4.6.
@@ -475,6 +477,52 @@
(same as transform()), and QGraphicsItem ignores the return value for this
notification (i.e., a read-only notification).
+ \value ItemRotationChange The item's rotation property changes. This
+ notification is sent if the ItemSendsGeometryChanges flag is enabled, and
+ when the item's rotation property changes (i.e., as a result of calling
+ setRotation()). The value argument is the new rotation (i.e., a double);
+ to get the old rotation, call rotation(). Do not call setRotation() in
+ itemChange() as this notification is delivered; instead, you can return
+ the new rotation from itemChange().
+
+ \value ItemRotationHasChanged The item's rotation property has changed.
+ This notification is sent if the ItemSendsGeometryChanges flag is enabled,
+ and after the item's rotation property has changed. The value argument is
+ the new rotation (i.e., a double), and QGraphicsItem ignores the return
+ value for this notification (i.e., a read-only notification). Do not call
+ setRotation() in itemChange() as this notification is delivered.
+
+ \value ItemScaleChange The item's scale property changes. This notification
+ is sent if the ItemSendsGeometryChanges flag is enabled, and when the item's
+ scale property changes (i.e., as a result of calling setScale()). The value
+ argument is the new scale (i.e., a double); to get the old scale, call
+ scale(). Do not call setScale() in itemChange() as this notification is
+ delivered; instead, you can return the new scale from itemChange().
+
+ \value ItemScaleHasChanged The item's scale property has changed. This
+ notification is sent if the ItemSendsGeometryChanges flag is enabled, and
+ after the item's scale property has changed. The value argument is the new
+ scale (i.e., a double), and QGraphicsItem ignores the return value for this
+ notification (i.e., a read-only notification). Do not call setScale() in
+ itemChange() as this notification is delivered.
+
+ \value ItemTransformOriginPointChange The item's transform origin point
+ property changes. This notification is sent if the ItemSendsGeometryChanges
+ flag is enabled, and when the item's transform origin point property changes
+ (i.e., as a result of calling setTransformOriginPoint()). The value argument
+ is the new origin point (i.e., a QPointF); to get the old origin point, call
+ transformOriginPoint(). Do not call setTransformOriginPoint() in itemChange()
+ as this notification is delivered; instead, you can return the new transform
+ origin point from itemChange().
+
+ \value ItemTransformOriginPointHasChanged The item's transform origin point
+ property has changed. This notification is sent if the ItemSendsGeometryChanges
+ flag is enabled, and after the item's transform origin point property has
+ changed. The value argument is the new origin point (i.e., a QPointF), and
+ QGraphicsItem ignores the return value for this notification (i.e., a read-only
+ notification). Do not call setTransformOriginPoint() in itemChange() as this
+ notification is delivered.
+
\value ItemSelectedChange The item's selected state changes. If the item is
presently selected, it will become unselected, and vice verca. The value
argument is the new selected state (i.e., true or false). Do not call
@@ -683,6 +731,9 @@
#include <QtGui/qevent.h>
#include <QtGui/qinputcontext.h>
#include <QtGui/qgraphicseffect.h>
+#ifndef QT_NO_ACCESSIBILITY
+# include "qaccessible.h"
+#endif
#include <private/qgraphicsitem_p.h>
#include <private/qgraphicswidget_p.h>
@@ -690,6 +741,7 @@
#include <private/qtextdocumentlayout_p.h>
#include <private/qtextengine_p.h>
#include <private/qwidget_p.h>
+#include <private/qapplication_p.h>
#ifdef Q_WS_X11
#include <private/qt_x11_p.h>
@@ -3583,7 +3635,7 @@ void QGraphicsItem::setPos(const QPointF &pos)
return;
// Update and repositition.
- if (!(d_ptr->flags & ItemSendsGeometryChanges) && !(d_ptr->flags & ItemSendsScenePositionChanges)) {
+ if (!(d_ptr->flags & (ItemSendsGeometryChanges | ItemSendsScenePositionChanges))) {
d_ptr->setPosHelper(pos);
return;
}
@@ -3728,12 +3780,28 @@ qreal QGraphicsItem::rotation() const
void QGraphicsItem::setRotation(qreal angle)
{
prepareGeometryChange();
+ qreal newRotation = angle;
+
+ if (d_ptr->flags & ItemSendsGeometryChanges) {
+ // Notify the item that the rotation is changing.
+ const QVariant newRotationVariant(itemChange(ItemRotationChange, angle));
+ newRotation = newRotationVariant.toReal();
+ }
+
if (!d_ptr->transformData)
d_ptr->transformData = new QGraphicsItemPrivate::TransformData;
- d_ptr->transformData->rotation = angle;
+
+ if (d_ptr->transformData->rotation == newRotation)
+ return;
+
+ d_ptr->transformData->rotation = newRotation;
d_ptr->transformData->onlyTransform = false;
d_ptr->dirtySceneTransform = 1;
+ // Send post-notification.
+ if (d_ptr->flags & ItemSendsGeometryChanges)
+ itemChange(ItemRotationHasChanged, newRotation);
+
if (d_ptr->isObject)
emit static_cast<QGraphicsObject *>(this)->rotationChanged();
}
@@ -3776,12 +3844,28 @@ qreal QGraphicsItem::scale() const
void QGraphicsItem::setScale(qreal factor)
{
prepareGeometryChange();
+ qreal newScale = factor;
+
+ if (d_ptr->flags & ItemSendsGeometryChanges) {
+ // Notify the item that the scale is changing.
+ const QVariant newScaleVariant(itemChange(ItemScaleChange, factor));
+ newScale = newScaleVariant.toReal();
+ }
+
if (!d_ptr->transformData)
d_ptr->transformData = new QGraphicsItemPrivate::TransformData;
- d_ptr->transformData->scale = factor;
+
+ if (d_ptr->transformData->scale == newScale)
+ return;
+
+ d_ptr->transformData->scale = newScale;
d_ptr->transformData->onlyTransform = false;
d_ptr->dirtySceneTransform = 1;
+ // Send post-notification.
+ if (d_ptr->flags & ItemSendsGeometryChanges)
+ itemChange(ItemScaleHasChanged, newScale);
+
if (d_ptr->isObject)
emit static_cast<QGraphicsObject *>(this)->scaleChanged();
}
@@ -3899,12 +3983,31 @@ QPointF QGraphicsItem::transformOriginPoint() const
void QGraphicsItem::setTransformOriginPoint(const QPointF &origin)
{
prepareGeometryChange();
+ QPointF newOrigin = origin;
+
+ if (d_ptr->flags & ItemSendsGeometryChanges) {
+ // Notify the item that the origin point is changing.
+ const QVariant newOriginVariant(itemChange(ItemTransformOriginPointChange,
+ qVariantFromValue<QPointF>(origin)));
+ newOrigin = newOriginVariant.toPointF();
+ }
+
if (!d_ptr->transformData)
d_ptr->transformData = new QGraphicsItemPrivate::TransformData;
- d_ptr->transformData->xOrigin = origin.x();
- d_ptr->transformData->yOrigin = origin.y();
+
+ if (d_ptr->transformData->xOrigin == newOrigin.x()
+ && d_ptr->transformData->yOrigin == newOrigin.y()) {
+ return;
+ }
+
+ d_ptr->transformData->xOrigin = newOrigin.x();
+ d_ptr->transformData->yOrigin = newOrigin.y();
d_ptr->transformData->onlyTransform = false;
d_ptr->dirtySceneTransform = 1;
+
+ // Send post-notification.
+ if (d_ptr->flags & ItemSendsGeometryChanges)
+ itemChange(ItemTransformOriginPointHasChanged, qVariantFromValue<QPointF>(newOrigin));
}
/*!
@@ -7206,6 +7309,31 @@ void QGraphicsItem::setInputMethodHints(Qt::InputMethodHints hints)
}
/*!
+ Updates the item's micro focus.
+
+ \since 4.7
+
+ \sa QInputContext
+*/
+void QGraphicsItem::updateMicroFocus()
+{
+#if !defined(QT_NO_IM) && (defined(Q_WS_X11) || defined(Q_WS_QWS) || defined(Q_OS_SYMBIAN))
+ if (QWidget *fw = qApp->focusWidget()) {
+ if (qt_widget_private(fw)->ic || qApp->d_func()->inputContext) {
+ if (QInputContext *ic = fw->inputContext()) {
+ if (ic)
+ ic->update();
+ }
+ }
+#ifndef QT_NO_ACCESSIBILITY
+ // ##### is this correct
+ QAccessible::updateAccessibility(fw, 0, QAccessible::StateChanged);
+#endif
+ }
+#endif
+}
+
+/*!
This virtual function is called by QGraphicsItem to notify custom items
that some part of the item's state changes. By reimplementing this
function, your can react to a change, and in some cases, (depending on \a
@@ -7481,6 +7609,11 @@ void QGraphicsObject::ungrabGesture(Qt::GestureType gesture)
}
}
+void QGraphicsObject::updateMicroFocus()
+{
+ QGraphicsItem::updateMicroFocus();
+}
+
void QGraphicsItemPrivate::append(QDeclarativeListProperty<QGraphicsObject> *list, QGraphicsObject *item)
{
QGraphicsItemPrivate::get(item)->setParentItemHelper(static_cast<QGraphicsObject *>(list->object), /*newParentVariant=*/0, /*thisPointerVariant=*/0);
@@ -11197,6 +11330,24 @@ QDebug operator<<(QDebug debug, QGraphicsItem::GraphicsItemChange change)
case QGraphicsItem::ItemScenePositionHasChanged:
str = "ItemScenePositionHasChanged";
break;
+ case QGraphicsItem::ItemRotationChange:
+ str = "ItemRotationChange";
+ break;
+ case QGraphicsItem::ItemRotationHasChanged:
+ str = "ItemRotationHasChanged";
+ break;
+ case QGraphicsItem::ItemScaleChange:
+ str = "ItemScaleChange";
+ break;
+ case QGraphicsItem::ItemScaleHasChanged:
+ str = "ItemScaleHasChanged";
+ break;
+ case QGraphicsItem::ItemTransformOriginPointChange:
+ str = "ItemTransformOriginPointChange";
+ break;
+ case QGraphicsItem::ItemTransformOriginPointHasChanged:
+ str = "ItemTransformOriginPointHasChanged";
+ break;
}
debug << str;
return debug;
diff --git a/src/gui/graphicsview/qgraphicsitem.h b/src/gui/graphicsview/qgraphicsitem.h
index 22be64c0cc..9cc75af82c 100644
--- a/src/gui/graphicsview/qgraphicsitem.h
+++ b/src/gui/graphicsview/qgraphicsitem.h
@@ -139,7 +139,13 @@ public:
ItemZValueHasChanged,
ItemOpacityChange,
ItemOpacityHasChanged,
- ItemScenePositionHasChanged
+ ItemScenePositionHasChanged,
+ ItemRotationChange,
+ ItemRotationHasChanged,
+ ItemScaleChange,
+ ItemScaleHasChanged,
+ ItemTransformOriginPointChange,
+ ItemTransformOriginPointHasChanged
};
enum CacheMode {
@@ -418,6 +424,7 @@ public:
void removeSceneEventFilter(QGraphicsItem *filterItem);
protected:
+ void updateMicroFocus();
virtual bool sceneEventFilter(QGraphicsItem *watched, QEvent *event);
virtual bool sceneEvent(QEvent *event);
virtual void contextMenuEvent(QGraphicsSceneContextMenuEvent *event);
@@ -565,6 +572,9 @@ public:
void grabGesture(Qt::GestureType type, Qt::GestureFlags flags = Qt::GestureFlags());
void ungrabGesture(Qt::GestureType type);
+protected Q_SLOTS:
+ void updateMicroFocus();
+
Q_SIGNALS:
void parentChanged();
void opacityChanged();
diff --git a/src/gui/gui.pro b/src/gui/gui.pro
index cbdbb5c449..b22f732d7d 100644
--- a/src/gui/gui.pro
+++ b/src/gui/gui.pro
@@ -41,6 +41,7 @@ include(math3d/math3d.pri)
include(effects/effects.pri)
contains(QT_CONFIG, egl): include(egl/egl.pri)
+win32:!wince*: DEFINES += QT_NO_EGL
embedded: QT += network
diff --git a/src/gui/image/qimage.cpp b/src/gui/image/qimage.cpp
index 94307de8d7..233c58dfed 100644
--- a/src/gui/image/qimage.cpp
+++ b/src/gui/image/qimage.cpp
@@ -2988,19 +2988,19 @@ static void convert_Indexed8_to_X32(QImageData *dest, const QImageData *src, Qt:
colorTable.resize(256);
for (int i=0; i<256; ++i)
colorTable[i] = qRgb(i, i, i);
-
}
int w = src->width;
const uchar *src_data = src->data;
uchar *dest_data = dest->data;
+ int tableSize = colorTable.size() - 1;
for (int y = 0; y < src->height; y++) {
uint *p = (uint *)dest_data;
const uchar *b = src_data;
uint *end = p + w;
while (p < end)
- *p++ = colorTable.at(*b++);
+ *p++ = colorTable.at(qMin<int>(tableSize, *b++));
src_data += src->bytes_per_line;
dest_data += dest->bytes_per_line;
diff --git a/src/gui/image/qpicture.cpp b/src/gui/image/qpicture.cpp
index 3220a67332..45b3ed0e24 100644
--- a/src/gui/image/qpicture.cpp
+++ b/src/gui/image/qpicture.cpp
@@ -651,7 +651,12 @@ bool QPicture::exec(QPainter *painter, QDataStream &s, int nrecords)
s >> dbl;
QFont fnt(font, painter->device());
- qreal scale = painter->device()->logicalDpiY() / (dbl*qt_defaultDpiY());
+ // Fonts that specify a pixel size should not be scaled - QPicture already
+ // have a matrix set to compensate for the DPI differences between the
+ // default Qt DPI and the actual target device DPI, and we have to take that
+ // into consideration in the case where the font has a pixel size set.
+
+ qreal scale = fnt.pointSize() == -1 ? 1 : painter->device()->logicalDpiY() / (dbl*qt_defaultDpiY());
painter->save();
painter->scale(1/scale, 1/scale);
@@ -660,7 +665,7 @@ bool QPicture::exec(QPainter *painter, QDataStream &s, int nrecords)
int flags = Qt::TextSingleLine | Qt::TextDontClip | Qt::TextForceLeftToRight;
- QSizeF size(scale, scale);
+ QSizeF size(1, 1);
if (justificationWidth > 0) {
size.setWidth(justificationWidth*scale);
flags |= Qt::TextJustificationForced;
diff --git a/src/gui/image/qpixmap_raster.cpp b/src/gui/image/qpixmap_raster.cpp
index 0b1c18d438..b183d0d185 100644
--- a/src/gui/image/qpixmap_raster.cpp
+++ b/src/gui/image/qpixmap_raster.cpp
@@ -182,6 +182,7 @@ void QRasterPixmapData::fromImage(const QImage &sourceImage,
QImage::Format opaqueFormat = QNativeImage::systemFormat();
QImage::Format alphaFormat = QImage::Format_ARGB32_Premultiplied;
+#ifndef QT_HAVE_NEON
switch (opaqueFormat) {
case QImage::Format_RGB16:
alphaFormat = QImage::Format_ARGB8565_Premultiplied;
@@ -189,6 +190,7 @@ void QRasterPixmapData::fromImage(const QImage &sourceImage,
default: // We don't care about the others...
break;
}
+#endif
if (!sourceImage.hasAlphaChannel()
|| ((flags & Qt::NoOpaqueDetection) == 0
@@ -238,6 +240,7 @@ void QRasterPixmapData::fill(const QColor &color)
if (alpha != 255) {
if (!image.hasAlphaChannel()) {
QImage::Format toFormat;
+#ifndef QT_HAVE_NEON
if (image.format() == QImage::Format_RGB16)
toFormat = QImage::Format_ARGB8565_Premultiplied;
else if (image.format() == QImage::Format_RGB666)
@@ -247,6 +250,7 @@ void QRasterPixmapData::fill(const QColor &color)
else if (image.format() == QImage::Format_RGB444)
toFormat = QImage::Format_ARGB4444_Premultiplied;
else
+#endif
toFormat = QImage::Format_ARGB32_Premultiplied;
image = QImage(image.width(), image.height(), toFormat);
}
diff --git a/src/gui/itemviews/qitemdelegate.cpp b/src/gui/itemviews/qitemdelegate.cpp
index cba213b3e5..d5f6fd2423 100644
--- a/src/gui/itemviews/qitemdelegate.cpp
+++ b/src/gui/itemviews/qitemdelegate.cpp
@@ -69,6 +69,7 @@
#include <qdebug.h>
#include <qlocale.h>
#include <qdialog.h>
+#include <qmath.h>
#include <limits.h>
@@ -1148,7 +1149,8 @@ QRect QItemDelegate::textRectangle(QPainter * /*painter*/, const QRect &rect,
d->textLayout.setTextOption(d->textOption);
d->textLayout.setFont(font);
d->textLayout.setText(QItemDelegatePrivate::replaceNewLine(text));
- const QSize size = d->doTextLayout(rect.width()).toSize();
+ QSizeF fpSize = d->doTextLayout(rect.width());
+ const QSize size = QSize(qCeil(fpSize.width()), qCeil(fpSize.height()));
// ###: textRectangle should take style option as argument
const int textMargin = QApplication::style()->pixelMetric(QStyle::PM_FocusFrameHMargin) + 1;
return QRect(0, 0, size.width() + 2 * textMargin, size.height());
diff --git a/src/gui/kernel/qapplication.h b/src/gui/kernel/qapplication.h
index ee743501f3..c21b982a45 100644
--- a/src/gui/kernel/qapplication.h
+++ b/src/gui/kernel/qapplication.h
@@ -376,6 +376,7 @@ private:
Q_DECLARE_PRIVATE(QApplication)
friend class QGraphicsWidget;
+ friend class QGraphicsItem;
friend class QGraphicsScene;
friend class QGraphicsScenePrivate;
friend class QWidget;
diff --git a/src/gui/painting/painting.pri b/src/gui/painting/painting.pri
index a6cc9c7ec9..ed8ee762d2 100644
--- a/src/gui/painting/painting.pri
+++ b/src/gui/painting/painting.pri
@@ -91,6 +91,8 @@ SOURCES += \
HEADERS += \
painting/qpaintengine_raster_p.h \
+ painting/qdrawhelper_p.h \
+ painting/qblendfunctions_p.h \
painting/qrasterdefs_p.h \
painting/qgrayraster_p.h
@@ -379,11 +381,23 @@ symbian {
QMAKE_CXXFLAGS.ARMCC *= -O3
}
-neon {
+neon:*-g++* {
DEFINES += QT_HAVE_NEON
HEADERS += painting/qdrawhelper_neon_p.h
SOURCES += painting/qdrawhelper_neon.cpp
QMAKE_CXXFLAGS *= -mfpu=neon
+
+ DRAWHELPER_NEON_ASM_FILES = ../3rdparty/pixman/pixman-arm-neon-asm.S painting/qdrawhelper_neon_asm.S
+
+ neon_compiler.commands = $$QMAKE_CXX -c
+ neon_compiler.commands += $(CXXFLAGS) $(INCPATH) ${QMAKE_FILE_IN} -o ${QMAKE_FILE_OUT}
+ neon_compiler.dependency_type = TYPE_C
+ neon_compiler.output = ${QMAKE_VAR_OBJECTS_DIR}${QMAKE_FILE_BASE}$${first(QMAKE_EXT_OBJ)}
+ neon_compiler.input = DRAWHELPER_NEON_ASM_FILES
+ neon_compiler.variable_out = OBJECTS
+ neon_compiler.name = compiling[neon] ${QMAKE_FILE_IN}
+ silent:neon_compiler.commands = @echo compiling[neon] ${QMAKE_FILE_IN} && $$neon_compiler.commands
+ QMAKE_EXTRA_COMPILERS += neon_compiler
}
contains(QT_CONFIG, zlib) {
diff --git a/src/gui/painting/qblendfunctions.cpp b/src/gui/painting/qblendfunctions.cpp
index dc33896434..24908cec0d 100644
--- a/src/gui/painting/qblendfunctions.cpp
+++ b/src/gui/painting/qblendfunctions.cpp
@@ -40,7 +40,7 @@
****************************************************************************/
#include <qmath.h>
-#include "qdrawhelper_p.h"
+#include "qblendfunctions_p.h"
QT_BEGIN_NAMESPACE
@@ -88,6 +88,8 @@ static inline quint16 convert_argb32_to_rgb16(quint32 spix)
struct Blend_RGB16_on_RGB16_NoAlpha {
inline void write(quint16 *dst, quint16 src) { *dst = src; }
+
+ inline void flush(void *) {}
};
struct Blend_RGB16_on_RGB16_ConstAlpha {
@@ -100,6 +102,8 @@ struct Blend_RGB16_on_RGB16_ConstAlpha {
*dst = BYTE_MUL_RGB16(src, m_alpha) + BYTE_MUL_RGB16(*dst, m_ialpha);
}
+ inline void flush(void *) {}
+
quint32 m_alpha;
quint32 m_ialpha;
};
@@ -114,6 +118,8 @@ struct Blend_ARGB24_on_RGB16_SourceAlpha {
*dst = s;
}
}
+
+ inline void flush(void *) {}
};
struct Blend_ARGB24_on_RGB16_SourceAndConstAlpha {
@@ -132,6 +138,8 @@ struct Blend_ARGB24_on_RGB16_SourceAndConstAlpha {
}
}
+ inline void flush(void *) {}
+
quint32 m_alpha;
};
@@ -145,6 +153,8 @@ struct Blend_ARGB32_on_RGB16_SourceAlpha {
*dst = s;
}
}
+
+ inline void flush(void *) {}
};
struct Blend_ARGB32_on_RGB16_SourceAndConstAlpha {
@@ -163,99 +173,11 @@ struct Blend_ARGB32_on_RGB16_SourceAndConstAlpha {
}
}
+ inline void flush(void *) {}
+
quint32 m_alpha;
};
-template <typename SRC, typename T>
-void qt_scale_image_16bit(uchar *destPixels, int dbpl,
- const uchar *srcPixels, int sbpl,
- const QRectF &targetRect,
- const QRectF &srcRect,
- const QRect &clip,
- T blender)
-{
- qreal sx = targetRect.width() / (qreal) srcRect.width();
- qreal sy = targetRect.height() / (qreal) srcRect.height();
-
- int ix = 0x00010000 / sx;
- int iy = 0x00010000 / sy;
-
-// qDebug() << "scale:" << endl
-// << " - target" << targetRect << endl
-// << " - source" << srcRect << endl
-// << " - clip" << clip << endl
-// << " - sx=" << sx << " sy=" << sy << " ix=" << ix << " iy=" << iy;
-
- int cx1 = clip.x();
- int cx2 = clip.x() + clip.width();
- int cy1 = clip.top();
- int cy2 = clip.y() + clip.height();
-
- int tx1 = qRound(targetRect.left());
- int tx2 = qRound(targetRect.right());
- int ty1 = qRound(targetRect.top());
- int ty2 = qRound(targetRect.bottom());
-
- if (tx2 < tx1)
- qSwap(tx2, tx1);
-
- if (ty2 < ty1)
- qSwap(ty2, ty1);
-
- if (tx1 < cx1)
- tx1 = cx1;
-
- if (tx2 >= cx2)
- tx2 = cx2;
-
- if (tx1 >= tx2)
- return;
-
- if (ty1 < cy1)
- ty1 = cy1;
-
- if (ty2 >= cy2)
- ty2 = cy2;
-
- if (ty1 >= ty2)
- return;
-
- int h = ty2 - ty1;
- int w = tx2 - tx1;
-
-
- quint32 basex;
- quint32 srcy;
-
- if (sx < 0) {
- int dstx = qFloor((tx1 + qreal(0.5) - targetRect.right()) * ix) + 1;
- basex = quint32(srcRect.right() * 65536) + dstx;
- } else {
- int dstx = qCeil((tx1 + qreal(0.5) - targetRect.left()) * ix) - 1;
- basex = quint32(srcRect.left() * 65536) + dstx;
- }
- if (sy < 0) {
- int dsty = qFloor((ty1 + qreal(0.5) - targetRect.bottom()) * iy) + 1;
- srcy = quint32(srcRect.bottom() * 65536) + dsty;
- } else {
- int dsty = qCeil((ty1 + qreal(0.5) - targetRect.top()) * iy) - 1;
- srcy = quint32(srcRect.top() * 65536) + dsty;
- }
-
- quint16 *dst = ((quint16 *) (destPixels + ty1 * dbpl)) + tx1;
-
- while (h--) {
- const SRC *src = (const SRC *) (srcPixels + (srcy >> 16) * sbpl);
- int srcx = basex;
- for (int x=0; x<w; ++x) {
- blender.write(&dst[x], src[srcx >> 16]);
- srcx += ix;
- }
- dst = (quint16 *)(((uchar *) dst) + dbpl);
- srcy += iy;
- }
-}
-
void qt_scale_image_rgb16_on_rgb16(uchar *destPixels, int dbpl,
const uchar *srcPixels, int sbpl,
const QRectF &targetRect,
@@ -447,10 +369,10 @@ static void qt_blend_argb24_on_rgb16(uchar *destPixels, int dbpl,
-static void qt_blend_argb32_on_rgb16_const_alpha(uchar *destPixels, int dbpl,
- const uchar *srcPixels, int sbpl,
- int w, int h,
- int const_alpha)
+void qt_blend_argb32_on_rgb16_const_alpha(uchar *destPixels, int dbpl,
+ const uchar *srcPixels, int sbpl,
+ int w, int h,
+ int const_alpha)
{
quint16 *dst = (quint16 *) destPixels;
const quint32 *src = (const quint32 *) srcPixels;
@@ -643,6 +565,8 @@ void qt_blend_rgb32_on_rgb32(uchar *destPixels, int dbpl,
struct Blend_RGB32_on_RGB32_NoAlpha {
inline void write(quint32 *dst, quint32 src) { *dst = src; }
+
+ inline void flush(void *) {}
};
struct Blend_RGB32_on_RGB32_ConstAlpha {
@@ -655,6 +579,8 @@ struct Blend_RGB32_on_RGB32_ConstAlpha {
*dst = BYTE_MUL(src, m_alpha) + BYTE_MUL(*dst, m_ialpha);
}
+ inline void flush(void *) {}
+
quint32 m_alpha;
quint32 m_ialpha;
};
@@ -663,6 +589,8 @@ struct Blend_ARGB32_on_ARGB32_SourceAlpha {
inline void write(quint32 *dst, quint32 src) {
*dst = src + BYTE_MUL(*dst, qAlpha(~src));
}
+
+ inline void flush(void *) {}
};
struct Blend_ARGB32_on_ARGB32_SourceAndConstAlpha {
@@ -676,98 +604,12 @@ struct Blend_ARGB32_on_ARGB32_SourceAndConstAlpha {
*dst = src + BYTE_MUL(*dst, qAlpha(~src));
}
+ inline void flush(void *) {}
+
quint32 m_alpha;
quint32 m_ialpha;
};
-template <typename T> void qt_scale_image_32bit(uchar *destPixels, int dbpl,
- const uchar *srcPixels, int sbpl,
- const QRectF &targetRect,
- const QRectF &srcRect,
- const QRect &clip,
- T blender)
-{
- qreal sx = targetRect.width() / (qreal) srcRect.width();
- qreal sy = targetRect.height() / (qreal) srcRect.height();
-
- int ix = 0x00010000 / sx;
- int iy = 0x00010000 / sy;
-
-// qDebug() << "scale:" << endl
-// << " - target" << targetRect << endl
-// << " - source" << srcRect << endl
-// << " - clip" << clip << endl
-// << " - sx=" << sx << " sy=" << sy << " ix=" << ix << " iy=" << iy;
-
- int cx1 = clip.x();
- int cx2 = clip.x() + clip.width();
- int cy1 = clip.top();
- int cy2 = clip.y() + clip.height();
-
- int tx1 = qRound(targetRect.left());
- int tx2 = qRound(targetRect.right());
- int ty1 = qRound(targetRect.top());
- int ty2 = qRound(targetRect.bottom());
-
- if (tx2 < tx1)
- qSwap(tx2, tx1);
-
- if (ty2 < ty1)
- qSwap(ty2, ty1);
-
- if (tx1 < cx1)
- tx1 = cx1;
-
- if (tx2 >= cx2)
- tx2 = cx2;
-
- if (tx1 >= tx2)
- return;
-
- if (ty1 < cy1)
- ty1 = cy1;
-
- if (ty2 >= cy2)
- ty2 = cy2;
-
- if (ty1 >= ty2)
- return;
-
- int h = ty2 - ty1;
- int w = tx2 - tx1;
-
- quint32 basex;
- quint32 srcy;
-
- if (sx < 0) {
- int dstx = qFloor((tx1 + qreal(0.5) - targetRect.right()) * ix) + 1;
- basex = quint32(srcRect.right() * 65536) + dstx;
- } else {
- int dstx = qCeil((tx1 + qreal(0.5) - targetRect.left()) * ix) - 1;
- basex = quint32(srcRect.left() * 65536) + dstx;
- }
- if (sy < 0) {
- int dsty = qFloor((ty1 + qreal(0.5) - targetRect.bottom()) * iy) + 1;
- srcy = quint32(srcRect.bottom() * 65536) + dsty;
- } else {
- int dsty = qCeil((ty1 + qreal(0.5) - targetRect.top()) * iy) - 1;
- srcy = quint32(srcRect.top() * 65536) + dsty;
- }
-
- quint32 *dst = ((quint32 *) (destPixels + ty1 * dbpl)) + tx1;
-
- while (h--) {
- const uint *src = (const quint32 *) (srcPixels + (srcy >> 16) * sbpl);
- int srcx = basex;
- for (int x=0; x<w; ++x) {
- blender.write(&dst[x], src[srcx >> 16]);
- srcx += ix;
- }
- dst = (quint32 *)(((uchar *) dst) + dbpl);
- srcy += iy;
- }
-}
-
void qt_scale_image_rgb32_on_rgb32(uchar *destPixels, int dbpl,
const uchar *srcPixels, int sbpl,
const QRectF &targetRect,
@@ -818,244 +660,6 @@ void qt_scale_image_argb32_on_argb32(uchar *destPixels, int dbpl,
}
}
-struct QTransformImageVertex
-{
- qreal x, y, u, v; // destination coordinates (x, y) and source coordinates (u, v)
-};
-
-template <class SrcT, class DestT, class Blender>
-void qt_transform_image_rasterize(DestT *destPixels, int dbpl,
- const SrcT *srcPixels, int sbpl,
- const QTransformImageVertex &topLeft, const QTransformImageVertex &bottomLeft,
- const QTransformImageVertex &topRight, const QTransformImageVertex &bottomRight,
- const QRect &sourceRect,
- const QRect &clip,
- qreal topY, qreal bottomY,
- int dudx, int dvdx, int dudy, int dvdy, int u0, int v0,
- Blender blender)
-{
- int fromY = qMax(qRound(topY), clip.top());
- int toY = qMin(qRound(bottomY), clip.top() + clip.height());
- if (fromY >= toY)
- return;
-
- qreal leftSlope = (bottomLeft.x - topLeft.x) / (bottomLeft.y - topLeft.y);
- qreal rightSlope = (bottomRight.x - topRight.x) / (bottomRight.y - topRight.y);
- int dx_l = int(leftSlope * 0x10000);
- int dx_r = int(rightSlope * 0x10000);
- int x_l = int((topLeft.x + (0.5 + fromY - topLeft.y) * leftSlope + 0.5) * 0x10000);
- int x_r = int((topRight.x + (0.5 + fromY - topRight.y) * rightSlope + 0.5) * 0x10000);
-
- int fromX, toX, x1, x2, u, v, i, ii;
- DestT *line;
- for (int y = fromY; y < toY; ++y) {
- line = reinterpret_cast<DestT *>(reinterpret_cast<uchar *>(destPixels) + y * dbpl);
-
- fromX = qMax(x_l >> 16, clip.left());
- toX = qMin(x_r >> 16, clip.left() + clip.width());
- if (fromX < toX) {
- // Because of rounding, we can get source coordinates outside the source image.
- // Clamp these coordinates to the source rect to avoid segmentation fault and
- // garbage on the screen.
-
- // Find the first pixel on the current scan line where the source coordinates are within the source rect.
- x1 = fromX;
- u = x1 * dudx + y * dudy + u0;
- v = x1 * dvdx + y * dvdy + v0;
- for (; x1 < toX; ++x1) {
- int uu = u >> 16;
- int vv = v >> 16;
- if (uu >= sourceRect.left() && uu < sourceRect.left() + sourceRect.width()
- && vv >= sourceRect.top() && vv < sourceRect.top() + sourceRect.height()) {
- break;
- }
- u += dudx;
- v += dvdx;
- }
-
- // Find the last pixel on the current scan line where the source coordinates are within the source rect.
- x2 = toX;
- u = (x2 - 1) * dudx + y * dudy + u0;
- v = (x2 - 1) * dvdx + y * dvdy + v0;
- for (; x2 > x1; --x2) {
- int uu = u >> 16;
- int vv = v >> 16;
- if (uu >= sourceRect.left() && uu < sourceRect.left() + sourceRect.width()
- && vv >= sourceRect.top() && vv < sourceRect.top() + sourceRect.height()) {
- break;
- }
- u -= dudx;
- v -= dvdx;
- }
-
- // Set up values at the beginning of the scan line.
- u = fromX * dudx + y * dudy + u0;
- v = fromX * dvdx + y * dvdy + v0;
- line += fromX;
-
- // Beginning of the scan line, with per-pixel checks.
- i = x1 - fromX;
- while (i) {
- int uu = qBound(sourceRect.left(), u >> 16, sourceRect.left() + sourceRect.width() - 1);
- int vv = qBound(sourceRect.top(), v >> 16, sourceRect.top() + sourceRect.height() - 1);
- blender.write(line, reinterpret_cast<const SrcT *>(reinterpret_cast<const uchar *>(srcPixels) + vv * sbpl)[uu]);
- u += dudx;
- v += dvdx;
- ++line;
- --i;
- }
-
- // Middle of the scan line, without checks.
- // Manual loop unrolling.
- i = x2 - x1;
- ii = i >> 3;
- while (ii) {
- blender.write(&line[0], reinterpret_cast<const SrcT *>(reinterpret_cast<const uchar *>(srcPixels) + (v >> 16) * sbpl)[u >> 16]); u += dudx; v += dvdx;
- blender.write(&line[1], reinterpret_cast<const SrcT *>(reinterpret_cast<const uchar *>(srcPixels) + (v >> 16) * sbpl)[u >> 16]); u += dudx; v += dvdx;
- blender.write(&line[2], reinterpret_cast<const SrcT *>(reinterpret_cast<const uchar *>(srcPixels) + (v >> 16) * sbpl)[u >> 16]); u += dudx; v += dvdx;
- blender.write(&line[3], reinterpret_cast<const SrcT *>(reinterpret_cast<const uchar *>(srcPixels) + (v >> 16) * sbpl)[u >> 16]); u += dudx; v += dvdx;
- blender.write(&line[4], reinterpret_cast<const SrcT *>(reinterpret_cast<const uchar *>(srcPixels) + (v >> 16) * sbpl)[u >> 16]); u += dudx; v += dvdx;
- blender.write(&line[5], reinterpret_cast<const SrcT *>(reinterpret_cast<const uchar *>(srcPixels) + (v >> 16) * sbpl)[u >> 16]); u += dudx; v += dvdx;
- blender.write(&line[6], reinterpret_cast<const SrcT *>(reinterpret_cast<const uchar *>(srcPixels) + (v >> 16) * sbpl)[u >> 16]); u += dudx; v += dvdx;
- blender.write(&line[7], reinterpret_cast<const SrcT *>(reinterpret_cast<const uchar *>(srcPixels) + (v >> 16) * sbpl)[u >> 16]); u += dudx; v += dvdx;
- line += 8;
- --ii;
- }
- switch (i & 7) {
- case 7: blender.write(line, reinterpret_cast<const SrcT *>(reinterpret_cast<const uchar *>(srcPixels) + (v >> 16) * sbpl)[u >> 16]); u += dudx; v += dvdx; ++line;
- case 6: blender.write(line, reinterpret_cast<const SrcT *>(reinterpret_cast<const uchar *>(srcPixels) + (v >> 16) * sbpl)[u >> 16]); u += dudx; v += dvdx; ++line;
- case 5: blender.write(line, reinterpret_cast<const SrcT *>(reinterpret_cast<const uchar *>(srcPixels) + (v >> 16) * sbpl)[u >> 16]); u += dudx; v += dvdx; ++line;
- case 4: blender.write(line, reinterpret_cast<const SrcT *>(reinterpret_cast<const uchar *>(srcPixels) + (v >> 16) * sbpl)[u >> 16]); u += dudx; v += dvdx; ++line;
- case 3: blender.write(line, reinterpret_cast<const SrcT *>(reinterpret_cast<const uchar *>(srcPixels) + (v >> 16) * sbpl)[u >> 16]); u += dudx; v += dvdx; ++line;
- case 2: blender.write(line, reinterpret_cast<const SrcT *>(reinterpret_cast<const uchar *>(srcPixels) + (v >> 16) * sbpl)[u >> 16]); u += dudx; v += dvdx; ++line;
- case 1: blender.write(line, reinterpret_cast<const SrcT *>(reinterpret_cast<const uchar *>(srcPixels) + (v >> 16) * sbpl)[u >> 16]); u += dudx; v += dvdx; ++line;
- }
-
- // End of the scan line, with per-pixel checks.
- i = toX - x2;
- while (i) {
- int uu = qBound(sourceRect.left(), u >> 16, sourceRect.left() + sourceRect.width() - 1);
- int vv = qBound(sourceRect.top(), v >> 16, sourceRect.top() + sourceRect.height() - 1);
- blender.write(line, reinterpret_cast<const SrcT *>(reinterpret_cast<const uchar *>(srcPixels) + vv * sbpl)[uu]);
- u += dudx;
- v += dvdx;
- ++line;
- --i;
- }
- }
- x_l += dx_l;
- x_r += dx_r;
- }
-}
-
-template <class SrcT, class DestT, class Blender>
-void qt_transform_image(DestT *destPixels, int dbpl,
- const SrcT *srcPixels, int sbpl,
- const QRectF &targetRect,
- const QRectF &sourceRect,
- const QRect &clip,
- const QTransform &targetRectTransform,
- Blender blender)
-{
- enum Corner
- {
- TopLeft,
- TopRight,
- BottomRight,
- BottomLeft
- };
-
- // map source rectangle to destination.
- QTransformImageVertex v[4];
- v[TopLeft].u = v[BottomLeft].u = sourceRect.left();
- v[TopLeft].v = v[TopRight].v = sourceRect.top();
- v[TopRight].u = v[BottomRight].u = sourceRect.right();
- v[BottomLeft].v = v[BottomRight].v = sourceRect.bottom();
- targetRectTransform.map(targetRect.left(), targetRect.top(), &v[TopLeft].x, &v[TopLeft].y);
- targetRectTransform.map(targetRect.right(), targetRect.top(), &v[TopRight].x, &v[TopRight].y);
- targetRectTransform.map(targetRect.left(), targetRect.bottom(), &v[BottomLeft].x, &v[BottomLeft].y);
- targetRectTransform.map(targetRect.right(), targetRect.bottom(), &v[BottomRight].x, &v[BottomRight].y);
-
- // find topmost vertex.
- int topmost = 0;
- for (int i = 1; i < 4; ++i) {
- if (v[i].y < v[topmost].y)
- topmost = i;
- }
- // rearrange array such that topmost vertex is at index 0.
- switch (topmost) {
- case 1:
- {
- QTransformImageVertex t = v[0];
- for (int i = 0; i < 3; ++i)
- v[i] = v[i+1];
- v[3] = t;
- }
- break;
- case 2:
- qSwap(v[0], v[2]);
- qSwap(v[1], v[3]);
- break;
- case 3:
- {
- QTransformImageVertex t = v[3];
- for (int i = 3; i > 0; --i)
- v[i] = v[i-1];
- v[0] = t;
- }
- break;
- }
-
- // if necessary, swap vertex 1 and 3 such that 1 is to the left of 3.
- qreal dx1 = v[1].x - v[0].x;
- qreal dy1 = v[1].y - v[0].y;
- qreal dx2 = v[3].x - v[0].x;
- qreal dy2 = v[3].y - v[0].y;
- if (dx1 * dy2 - dx2 * dy1 > 0)
- qSwap(v[1], v[3]);
-
- QTransformImageVertex u = {v[1].x - v[0].x, v[1].y - v[0].y, v[1].u - v[0].u, v[1].v - v[0].v};
- QTransformImageVertex w = {v[2].x - v[0].x, v[2].y - v[0].y, v[2].u - v[0].u, v[2].v - v[0].v};
-
- qreal det = u.x * w.y - u.y * w.x;
- if (det == 0)
- return;
-
- qreal invDet = 1.0 / det;
- qreal m11, m12, m21, m22, mdx, mdy;
-
- m11 = (u.u * w.y - u.y * w.u) * invDet;
- m12 = (u.x * w.u - u.u * w.x) * invDet;
- m21 = (u.v * w.y - u.y * w.v) * invDet;
- m22 = (u.x * w.v - u.v * w.x) * invDet;
- mdx = v[0].u - m11 * v[0].x - m12 * v[0].y;
- mdy = v[0].v - m21 * v[0].x - m22 * v[0].y;
-
- int dudx = int(m11 * 0x10000);
- int dvdx = int(m21 * 0x10000);
- int dudy = int(m12 * 0x10000);
- int dvdy = int(m22 * 0x10000);
- int u0 = qCeil((0.5 * m11 + 0.5 * m12 + mdx) * 0x10000) - 1;
- int v0 = qCeil((0.5 * m21 + 0.5 * m22 + mdy) * 0x10000) - 1;
-
- int x1 = qFloor(sourceRect.left());
- int y1 = qFloor(sourceRect.top());
- int x2 = qCeil(sourceRect.right());
- int y2 = qCeil(sourceRect.bottom());
- QRect sourceRectI(x1, y1, x2 - x1, y2 - y1);
-
- // rasterize trapezoids.
- if (v[1].y < v[3].y) {
- qt_transform_image_rasterize(destPixels, dbpl, srcPixels, sbpl, v[0], v[1], v[0], v[3], sourceRectI, clip, v[0].y, v[1].y, dudx, dvdx, dudy, dvdy, u0, v0, blender);
- qt_transform_image_rasterize(destPixels, dbpl, srcPixels, sbpl, v[1], v[2], v[0], v[3], sourceRectI, clip, v[1].y, v[3].y, dudx, dvdx, dudy, dvdy, u0, v0, blender);
- qt_transform_image_rasterize(destPixels, dbpl, srcPixels, sbpl, v[1], v[2], v[3], v[2], sourceRectI, clip, v[3].y, v[2].y, dudx, dvdx, dudy, dvdy, u0, v0, blender);
- } else {
- qt_transform_image_rasterize(destPixels, dbpl, srcPixels, sbpl, v[0], v[1], v[0], v[3], sourceRectI, clip, v[0].y, v[3].y, dudx, dvdx, dudy, dvdy, u0, v0, blender);
- qt_transform_image_rasterize(destPixels, dbpl, srcPixels, sbpl, v[0], v[1], v[3], v[2], sourceRectI, clip, v[3].y, v[1].y, dudx, dvdx, dudy, dvdy, u0, v0, blender);
- qt_transform_image_rasterize(destPixels, dbpl, srcPixels, sbpl, v[1], v[2], v[3], v[2], sourceRectI, clip, v[1].y, v[2].y, dudx, dvdx, dudy, dvdy, u0, v0, blender);
- }
-}
-
void qt_transform_image_rgb16_on_rgb16(uchar *destPixels, int dbpl,
const uchar *srcPixels, int sbpl,
const QRectF &targetRect,
diff --git a/src/gui/painting/qblendfunctions_p.h b/src/gui/painting/qblendfunctions_p.h
new file mode 100644
index 0000000000..ad754b0e8c
--- /dev/null
+++ b/src/gui/painting/qblendfunctions_p.h
@@ -0,0 +1,497 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtGui 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 Technology Preview License Agreement accompanying
+** this package.
+**
+** 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.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QBLENDFUNCTIONS_P_H
+#define QBLENDFUNCTIONS_P_H
+
+#include <qmath.h>
+#include "qdrawhelper_p.h"
+
+QT_BEGIN_NAMESPACE
+
+//
+// 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.
+//
+
+template <typename SRC, typename T>
+void qt_scale_image_16bit(uchar *destPixels, int dbpl,
+ const uchar *srcPixels, int sbpl,
+ const QRectF &targetRect,
+ const QRectF &srcRect,
+ const QRect &clip,
+ T blender)
+{
+ qreal sx = targetRect.width() / (qreal) srcRect.width();
+ qreal sy = targetRect.height() / (qreal) srcRect.height();
+
+ int ix = 0x00010000 / sx;
+ int iy = 0x00010000 / sy;
+
+// qDebug() << "scale:" << endl
+// << " - target" << targetRect << endl
+// << " - source" << srcRect << endl
+// << " - clip" << clip << endl
+// << " - sx=" << sx << " sy=" << sy << " ix=" << ix << " iy=" << iy;
+
+ int cx1 = clip.x();
+ int cx2 = clip.x() + clip.width();
+ int cy1 = clip.top();
+ int cy2 = clip.y() + clip.height();
+
+ int tx1 = qRound(targetRect.left());
+ int tx2 = qRound(targetRect.right());
+ int ty1 = qRound(targetRect.top());
+ int ty2 = qRound(targetRect.bottom());
+
+ if (tx2 < tx1)
+ qSwap(tx2, tx1);
+
+ if (ty2 < ty1)
+ qSwap(ty2, ty1);
+
+ if (tx1 < cx1)
+ tx1 = cx1;
+
+ if (tx2 >= cx2)
+ tx2 = cx2;
+
+ if (tx1 >= tx2)
+ return;
+
+ if (ty1 < cy1)
+ ty1 = cy1;
+
+ if (ty2 >= cy2)
+ ty2 = cy2;
+
+ if (ty1 >= ty2)
+ return;
+
+ int h = ty2 - ty1;
+ int w = tx2 - tx1;
+
+
+ quint32 basex;
+ quint32 srcy;
+
+ if (sx < 0) {
+ int dstx = qFloor((tx1 + qreal(0.5) - targetRect.right()) * ix) + 1;
+ basex = quint32(srcRect.right() * 65536) + dstx;
+ } else {
+ int dstx = qCeil((tx1 + qreal(0.5) - targetRect.left()) * ix) - 1;
+ basex = quint32(srcRect.left() * 65536) + dstx;
+ }
+ if (sy < 0) {
+ int dsty = qFloor((ty1 + qreal(0.5) - targetRect.bottom()) * iy) + 1;
+ srcy = quint32(srcRect.bottom() * 65536) + dsty;
+ } else {
+ int dsty = qCeil((ty1 + qreal(0.5) - targetRect.top()) * iy) - 1;
+ srcy = quint32(srcRect.top() * 65536) + dsty;
+ }
+
+ quint16 *dst = ((quint16 *) (destPixels + ty1 * dbpl)) + tx1;
+
+ while (h--) {
+ const SRC *src = (const SRC *) (srcPixels + (srcy >> 16) * sbpl);
+ int srcx = basex;
+ int x = 0;
+ for (; x<w-7; x+=8) {
+ blender.write(&dst[x], src[srcx >> 16]); srcx += ix;
+ blender.write(&dst[x+1], src[srcx >> 16]); srcx += ix;
+ blender.write(&dst[x+2], src[srcx >> 16]); srcx += ix;
+ blender.write(&dst[x+3], src[srcx >> 16]); srcx += ix;
+ blender.write(&dst[x+4], src[srcx >> 16]); srcx += ix;
+ blender.write(&dst[x+5], src[srcx >> 16]); srcx += ix;
+ blender.write(&dst[x+6], src[srcx >> 16]); srcx += ix;
+ blender.write(&dst[x+7], src[srcx >> 16]); srcx += ix;
+ }
+ for (; x<w; ++x) {
+ blender.write(&dst[x], src[srcx >> 16]);
+ srcx += ix;
+ }
+ blender.flush(&dst[x]);
+ dst = (quint16 *)(((uchar *) dst) + dbpl);
+ srcy += iy;
+ }
+}
+
+template <typename T> void qt_scale_image_32bit(uchar *destPixels, int dbpl,
+ const uchar *srcPixels, int sbpl,
+ const QRectF &targetRect,
+ const QRectF &srcRect,
+ const QRect &clip,
+ T blender)
+{
+ qreal sx = targetRect.width() / (qreal) srcRect.width();
+ qreal sy = targetRect.height() / (qreal) srcRect.height();
+
+ int ix = 0x00010000 / sx;
+ int iy = 0x00010000 / sy;
+
+// qDebug() << "scale:" << endl
+// << " - target" << targetRect << endl
+// << " - source" << srcRect << endl
+// << " - clip" << clip << endl
+// << " - sx=" << sx << " sy=" << sy << " ix=" << ix << " iy=" << iy;
+
+ int cx1 = clip.x();
+ int cx2 = clip.x() + clip.width();
+ int cy1 = clip.top();
+ int cy2 = clip.y() + clip.height();
+
+ int tx1 = qRound(targetRect.left());
+ int tx2 = qRound(targetRect.right());
+ int ty1 = qRound(targetRect.top());
+ int ty2 = qRound(targetRect.bottom());
+
+ if (tx2 < tx1)
+ qSwap(tx2, tx1);
+
+ if (ty2 < ty1)
+ qSwap(ty2, ty1);
+
+ if (tx1 < cx1)
+ tx1 = cx1;
+
+ if (tx2 >= cx2)
+ tx2 = cx2;
+
+ if (tx1 >= tx2)
+ return;
+
+ if (ty1 < cy1)
+ ty1 = cy1;
+
+ if (ty2 >= cy2)
+ ty2 = cy2;
+
+ if (ty1 >= ty2)
+ return;
+
+ int h = ty2 - ty1;
+ int w = tx2 - tx1;
+
+ quint32 basex;
+ quint32 srcy;
+
+ if (sx < 0) {
+ int dstx = qFloor((tx1 + qreal(0.5) - targetRect.right()) * ix) + 1;
+ basex = quint32(srcRect.right() * 65536) + dstx;
+ } else {
+ int dstx = qCeil((tx1 + qreal(0.5) - targetRect.left()) * ix) - 1;
+ basex = quint32(srcRect.left() * 65536) + dstx;
+ }
+ if (sy < 0) {
+ int dsty = qFloor((ty1 + qreal(0.5) - targetRect.bottom()) * iy) + 1;
+ srcy = quint32(srcRect.bottom() * 65536) + dsty;
+ } else {
+ int dsty = qCeil((ty1 + qreal(0.5) - targetRect.top()) * iy) - 1;
+ srcy = quint32(srcRect.top() * 65536) + dsty;
+ }
+
+ quint32 *dst = ((quint32 *) (destPixels + ty1 * dbpl)) + tx1;
+
+ while (h--) {
+ const uint *src = (const quint32 *) (srcPixels + (srcy >> 16) * sbpl);
+ int srcx = basex;
+ int x = 0;
+ for (; x<w; ++x) {
+ blender.write(&dst[x], src[srcx >> 16]);
+ srcx += ix;
+ }
+ blender.flush(&dst[x]);
+ dst = (quint32 *)(((uchar *) dst) + dbpl);
+ srcy += iy;
+ }
+}
+
+struct QTransformImageVertex
+{
+ qreal x, y, u, v; // destination coordinates (x, y) and source coordinates (u, v)
+};
+
+template <class SrcT, class DestT, class Blender>
+void qt_transform_image_rasterize(DestT *destPixels, int dbpl,
+ const SrcT *srcPixels, int sbpl,
+ const QTransformImageVertex &topLeft, const QTransformImageVertex &bottomLeft,
+ const QTransformImageVertex &topRight, const QTransformImageVertex &bottomRight,
+ const QRect &sourceRect,
+ const QRect &clip,
+ qreal topY, qreal bottomY,
+ int dudx, int dvdx, int dudy, int dvdy, int u0, int v0,
+ Blender blender)
+{
+ int fromY = qMax(qRound(topY), clip.top());
+ int toY = qMin(qRound(bottomY), clip.top() + clip.height());
+ if (fromY >= toY)
+ return;
+
+ qreal leftSlope = (bottomLeft.x - topLeft.x) / (bottomLeft.y - topLeft.y);
+ qreal rightSlope = (bottomRight.x - topRight.x) / (bottomRight.y - topRight.y);
+ int dx_l = int(leftSlope * 0x10000);
+ int dx_r = int(rightSlope * 0x10000);
+ int x_l = int((topLeft.x + (0.5 + fromY - topLeft.y) * leftSlope + 0.5) * 0x10000);
+ int x_r = int((topRight.x + (0.5 + fromY - topRight.y) * rightSlope + 0.5) * 0x10000);
+
+ int fromX, toX, x1, x2, u, v, i, ii;
+ DestT *line;
+ for (int y = fromY; y < toY; ++y) {
+ line = reinterpret_cast<DestT *>(reinterpret_cast<uchar *>(destPixels) + y * dbpl);
+
+ fromX = qMax(x_l >> 16, clip.left());
+ toX = qMin(x_r >> 16, clip.left() + clip.width());
+ if (fromX < toX) {
+ // Because of rounding, we can get source coordinates outside the source image.
+ // Clamp these coordinates to the source rect to avoid segmentation fault and
+ // garbage on the screen.
+
+ // Find the first pixel on the current scan line where the source coordinates are within the source rect.
+ x1 = fromX;
+ u = x1 * dudx + y * dudy + u0;
+ v = x1 * dvdx + y * dvdy + v0;
+ for (; x1 < toX; ++x1) {
+ int uu = u >> 16;
+ int vv = v >> 16;
+ if (uu >= sourceRect.left() && uu < sourceRect.left() + sourceRect.width()
+ && vv >= sourceRect.top() && vv < sourceRect.top() + sourceRect.height()) {
+ break;
+ }
+ u += dudx;
+ v += dvdx;
+ }
+
+ // Find the last pixel on the current scan line where the source coordinates are within the source rect.
+ x2 = toX;
+ u = (x2 - 1) * dudx + y * dudy + u0;
+ v = (x2 - 1) * dvdx + y * dvdy + v0;
+ for (; x2 > x1; --x2) {
+ int uu = u >> 16;
+ int vv = v >> 16;
+ if (uu >= sourceRect.left() && uu < sourceRect.left() + sourceRect.width()
+ && vv >= sourceRect.top() && vv < sourceRect.top() + sourceRect.height()) {
+ break;
+ }
+ u -= dudx;
+ v -= dvdx;
+ }
+
+ // Set up values at the beginning of the scan line.
+ u = fromX * dudx + y * dudy + u0;
+ v = fromX * dvdx + y * dvdy + v0;
+ line += fromX;
+
+ // Beginning of the scan line, with per-pixel checks.
+ i = x1 - fromX;
+ while (i) {
+ int uu = qBound(sourceRect.left(), u >> 16, sourceRect.left() + sourceRect.width() - 1);
+ int vv = qBound(sourceRect.top(), v >> 16, sourceRect.top() + sourceRect.height() - 1);
+ blender.write(line, reinterpret_cast<const SrcT *>(reinterpret_cast<const uchar *>(srcPixels) + vv * sbpl)[uu]);
+ u += dudx;
+ v += dvdx;
+ ++line;
+ --i;
+ }
+
+ // Middle of the scan line, without checks.
+ // Manual loop unrolling.
+ i = x2 - x1;
+ ii = i >> 3;
+ while (ii) {
+ blender.write(&line[0], reinterpret_cast<const SrcT *>(reinterpret_cast<const uchar *>(srcPixels) + (v >> 16) * sbpl)[u >> 16]); u += dudx; v += dvdx;
+ blender.write(&line[1], reinterpret_cast<const SrcT *>(reinterpret_cast<const uchar *>(srcPixels) + (v >> 16) * sbpl)[u >> 16]); u += dudx; v += dvdx;
+ blender.write(&line[2], reinterpret_cast<const SrcT *>(reinterpret_cast<const uchar *>(srcPixels) + (v >> 16) * sbpl)[u >> 16]); u += dudx; v += dvdx;
+ blender.write(&line[3], reinterpret_cast<const SrcT *>(reinterpret_cast<const uchar *>(srcPixels) + (v >> 16) * sbpl)[u >> 16]); u += dudx; v += dvdx;
+ blender.write(&line[4], reinterpret_cast<const SrcT *>(reinterpret_cast<const uchar *>(srcPixels) + (v >> 16) * sbpl)[u >> 16]); u += dudx; v += dvdx;
+ blender.write(&line[5], reinterpret_cast<const SrcT *>(reinterpret_cast<const uchar *>(srcPixels) + (v >> 16) * sbpl)[u >> 16]); u += dudx; v += dvdx;
+ blender.write(&line[6], reinterpret_cast<const SrcT *>(reinterpret_cast<const uchar *>(srcPixels) + (v >> 16) * sbpl)[u >> 16]); u += dudx; v += dvdx;
+ blender.write(&line[7], reinterpret_cast<const SrcT *>(reinterpret_cast<const uchar *>(srcPixels) + (v >> 16) * sbpl)[u >> 16]); u += dudx; v += dvdx;
+
+ line += 8;
+
+ --ii;
+ }
+ switch (i & 7) {
+ case 7: blender.write(line, reinterpret_cast<const SrcT *>(reinterpret_cast<const uchar *>(srcPixels) + (v >> 16) * sbpl)[u >> 16]); u += dudx; v += dvdx; ++line;
+ case 6: blender.write(line, reinterpret_cast<const SrcT *>(reinterpret_cast<const uchar *>(srcPixels) + (v >> 16) * sbpl)[u >> 16]); u += dudx; v += dvdx; ++line;
+ case 5: blender.write(line, reinterpret_cast<const SrcT *>(reinterpret_cast<const uchar *>(srcPixels) + (v >> 16) * sbpl)[u >> 16]); u += dudx; v += dvdx; ++line;
+ case 4: blender.write(line, reinterpret_cast<const SrcT *>(reinterpret_cast<const uchar *>(srcPixels) + (v >> 16) * sbpl)[u >> 16]); u += dudx; v += dvdx; ++line;
+ case 3: blender.write(line, reinterpret_cast<const SrcT *>(reinterpret_cast<const uchar *>(srcPixels) + (v >> 16) * sbpl)[u >> 16]); u += dudx; v += dvdx; ++line;
+ case 2: blender.write(line, reinterpret_cast<const SrcT *>(reinterpret_cast<const uchar *>(srcPixels) + (v >> 16) * sbpl)[u >> 16]); u += dudx; v += dvdx; ++line;
+ case 1: blender.write(line, reinterpret_cast<const SrcT *>(reinterpret_cast<const uchar *>(srcPixels) + (v >> 16) * sbpl)[u >> 16]); u += dudx; v += dvdx; ++line;
+ }
+
+ // End of the scan line, with per-pixel checks.
+ i = toX - x2;
+ while (i) {
+ int uu = qBound(sourceRect.left(), u >> 16, sourceRect.left() + sourceRect.width() - 1);
+ int vv = qBound(sourceRect.top(), v >> 16, sourceRect.top() + sourceRect.height() - 1);
+ blender.write(line, reinterpret_cast<const SrcT *>(reinterpret_cast<const uchar *>(srcPixels) + vv * sbpl)[uu]);
+ u += dudx;
+ v += dvdx;
+ ++line;
+ --i;
+ }
+
+ blender.flush(line);
+ }
+ x_l += dx_l;
+ x_r += dx_r;
+ }
+}
+
+template <class SrcT, class DestT, class Blender>
+void qt_transform_image(DestT *destPixels, int dbpl,
+ const SrcT *srcPixels, int sbpl,
+ const QRectF &targetRect,
+ const QRectF &sourceRect,
+ const QRect &clip,
+ const QTransform &targetRectTransform,
+ Blender blender)
+{
+ enum Corner
+ {
+ TopLeft,
+ TopRight,
+ BottomRight,
+ BottomLeft
+ };
+
+ // map source rectangle to destination.
+ QTransformImageVertex v[4];
+ v[TopLeft].u = v[BottomLeft].u = sourceRect.left();
+ v[TopLeft].v = v[TopRight].v = sourceRect.top();
+ v[TopRight].u = v[BottomRight].u = sourceRect.right();
+ v[BottomLeft].v = v[BottomRight].v = sourceRect.bottom();
+ targetRectTransform.map(targetRect.left(), targetRect.top(), &v[TopLeft].x, &v[TopLeft].y);
+ targetRectTransform.map(targetRect.right(), targetRect.top(), &v[TopRight].x, &v[TopRight].y);
+ targetRectTransform.map(targetRect.left(), targetRect.bottom(), &v[BottomLeft].x, &v[BottomLeft].y);
+ targetRectTransform.map(targetRect.right(), targetRect.bottom(), &v[BottomRight].x, &v[BottomRight].y);
+
+ // find topmost vertex.
+ int topmost = 0;
+ for (int i = 1; i < 4; ++i) {
+ if (v[i].y < v[topmost].y)
+ topmost = i;
+ }
+ // rearrange array such that topmost vertex is at index 0.
+ switch (topmost) {
+ case 1:
+ {
+ QTransformImageVertex t = v[0];
+ for (int i = 0; i < 3; ++i)
+ v[i] = v[i+1];
+ v[3] = t;
+ }
+ break;
+ case 2:
+ qSwap(v[0], v[2]);
+ qSwap(v[1], v[3]);
+ break;
+ case 3:
+ {
+ QTransformImageVertex t = v[3];
+ for (int i = 3; i > 0; --i)
+ v[i] = v[i-1];
+ v[0] = t;
+ }
+ break;
+ }
+
+ // if necessary, swap vertex 1 and 3 such that 1 is to the left of 3.
+ qreal dx1 = v[1].x - v[0].x;
+ qreal dy1 = v[1].y - v[0].y;
+ qreal dx2 = v[3].x - v[0].x;
+ qreal dy2 = v[3].y - v[0].y;
+ if (dx1 * dy2 - dx2 * dy1 > 0)
+ qSwap(v[1], v[3]);
+
+ QTransformImageVertex u = {v[1].x - v[0].x, v[1].y - v[0].y, v[1].u - v[0].u, v[1].v - v[0].v};
+ QTransformImageVertex w = {v[2].x - v[0].x, v[2].y - v[0].y, v[2].u - v[0].u, v[2].v - v[0].v};
+
+ qreal det = u.x * w.y - u.y * w.x;
+ if (det == 0)
+ return;
+
+ qreal invDet = 1.0 / det;
+ qreal m11, m12, m21, m22, mdx, mdy;
+
+ m11 = (u.u * w.y - u.y * w.u) * invDet;
+ m12 = (u.x * w.u - u.u * w.x) * invDet;
+ m21 = (u.v * w.y - u.y * w.v) * invDet;
+ m22 = (u.x * w.v - u.v * w.x) * invDet;
+ mdx = v[0].u - m11 * v[0].x - m12 * v[0].y;
+ mdy = v[0].v - m21 * v[0].x - m22 * v[0].y;
+
+ int dudx = int(m11 * 0x10000);
+ int dvdx = int(m21 * 0x10000);
+ int dudy = int(m12 * 0x10000);
+ int dvdy = int(m22 * 0x10000);
+ int u0 = qCeil((0.5 * m11 + 0.5 * m12 + mdx) * 0x10000) - 1;
+ int v0 = qCeil((0.5 * m21 + 0.5 * m22 + mdy) * 0x10000) - 1;
+
+ int x1 = qFloor(sourceRect.left());
+ int y1 = qFloor(sourceRect.top());
+ int x2 = qCeil(sourceRect.right());
+ int y2 = qCeil(sourceRect.bottom());
+ QRect sourceRectI(x1, y1, x2 - x1, y2 - y1);
+
+ // rasterize trapezoids.
+ if (v[1].y < v[3].y) {
+ qt_transform_image_rasterize(destPixels, dbpl, srcPixels, sbpl, v[0], v[1], v[0], v[3], sourceRectI, clip, v[0].y, v[1].y, dudx, dvdx, dudy, dvdy, u0, v0, blender);
+ qt_transform_image_rasterize(destPixels, dbpl, srcPixels, sbpl, v[1], v[2], v[0], v[3], sourceRectI, clip, v[1].y, v[3].y, dudx, dvdx, dudy, dvdy, u0, v0, blender);
+ qt_transform_image_rasterize(destPixels, dbpl, srcPixels, sbpl, v[1], v[2], v[3], v[2], sourceRectI, clip, v[3].y, v[2].y, dudx, dvdx, dudy, dvdy, u0, v0, blender);
+ } else {
+ qt_transform_image_rasterize(destPixels, dbpl, srcPixels, sbpl, v[0], v[1], v[0], v[3], sourceRectI, clip, v[0].y, v[3].y, dudx, dvdx, dudy, dvdy, u0, v0, blender);
+ qt_transform_image_rasterize(destPixels, dbpl, srcPixels, sbpl, v[0], v[1], v[3], v[2], sourceRectI, clip, v[3].y, v[1].y, dudx, dvdx, dudy, dvdy, u0, v0, blender);
+ qt_transform_image_rasterize(destPixels, dbpl, srcPixels, sbpl, v[1], v[2], v[3], v[2], sourceRectI, clip, v[1].y, v[2].y, dudx, dvdx, dudy, dvdy, u0, v0, blender);
+ }
+}
+
+QT_END_NAMESPACE
+
+#endif // QBLENDFUNCTIONS_P_H
diff --git a/src/gui/painting/qdrawhelper.cpp b/src/gui/painting/qdrawhelper.cpp
index 1f75ec7131..917b910a91 100644
--- a/src/gui/painting/qdrawhelper.cpp
+++ b/src/gui/painting/qdrawhelper.cpp
@@ -175,7 +175,7 @@ Q_STATIC_TEMPLATE_FUNCTION uint * QT_FASTCALL destFetch(uint *buffer, QRasterBuf
# define SPANFUNC_POINTER_DESTFETCH(Arg) destFetch<Arg>
-static const DestFetchProc destFetchProc[QImage::NImageFormats] =
+static DestFetchProc destFetchProc[QImage::NImageFormats] =
{
0, // Format_Invalid
destFetchMono, // Format_Mono,
@@ -323,7 +323,7 @@ Q_STATIC_TEMPLATE_FUNCTION void QT_FASTCALL destStore(QRasterBuffer *rasterBuffe
# define SPANFUNC_POINTER_DESTSTORE(DEST) destStore<DEST>
-static const DestStoreProc destStoreProc[QImage::NImageFormats] =
+static DestStoreProc destStoreProc[QImage::NImageFormats] =
{
0, // Format_Invalid
destStoreMono, // Format_Mono,
@@ -2827,7 +2827,7 @@ static void QT_FASTCALL rasterop_SourceAndNotDestination(uint *dest,
}
}
-static const CompositionFunctionSolid functionForModeSolid_C[] = {
+static CompositionFunctionSolid functionForModeSolid_C[] = {
comp_func_solid_SourceOver,
comp_func_solid_DestinationOver,
comp_func_solid_Clear,
@@ -2865,7 +2865,7 @@ static const CompositionFunctionSolid functionForModeSolid_C[] = {
static const CompositionFunctionSolid *functionForModeSolid = functionForModeSolid_C;
-static const CompositionFunction functionForMode_C[] = {
+static CompositionFunction functionForMode_C[] = {
comp_func_SourceOver,
comp_func_DestinationOver,
comp_func_Clear,
@@ -7961,6 +7961,20 @@ void qInitDrawhelperAsm()
qBlendFunctions[QImage::Format_ARGB32_Premultiplied][QImage::Format_RGB32] = qt_blend_rgb32_on_rgb32_neon;
qBlendFunctions[QImage::Format_RGB32][QImage::Format_ARGB32_Premultiplied] = qt_blend_argb32_on_argb32_neon;
qBlendFunctions[QImage::Format_ARGB32_Premultiplied][QImage::Format_ARGB32_Premultiplied] = qt_blend_argb32_on_argb32_neon;
+ qBlendFunctions[QImage::Format_RGB16][QImage::Format_ARGB32_Premultiplied] = qt_blend_argb32_on_rgb16_neon;
+ qBlendFunctions[QImage::Format_ARGB32_Premultiplied][QImage::Format_RGB16] = qt_blend_rgb16_on_argb32_neon;
+
+ qScaleFunctions[QImage::Format_RGB16][QImage::Format_ARGB32_Premultiplied] = qt_scale_image_argb32_on_rgb16_neon;
+ qScaleFunctions[QImage::Format_RGB16][QImage::Format_RGB16] = qt_scale_image_rgb16_on_rgb16_neon;
+
+ qTransformFunctions[QImage::Format_RGB16][QImage::Format_ARGB32_Premultiplied] = qt_transform_image_argb32_on_rgb16_neon;
+ qTransformFunctions[QImage::Format_RGB16][QImage::Format_RGB16] = qt_transform_image_rgb16_on_rgb16_neon;
+
+ qDrawHelper[QImage::Format_RGB16].alphamapBlit = qt_alphamapblit_quint16_neon;
+
+ functionForMode_C[QPainter::CompositionMode_SourceOver] = qt_blend_argb32_on_argb32_scanline_neon;
+ destFetchProc[QImage::Format_RGB16] = qt_destFetchRGB16_neon;
+ destStoreProc[QImage::Format_RGB16] = qt_destStoreRGB16_neon;
}
#endif
diff --git a/src/gui/painting/qdrawhelper_neon.cpp b/src/gui/painting/qdrawhelper_neon.cpp
index 77c52022f8..ee5f24a1db 100644
--- a/src/gui/painting/qdrawhelper_neon.cpp
+++ b/src/gui/painting/qdrawhelper_neon.cpp
@@ -40,10 +40,13 @@
****************************************************************************/
#include <private/qdrawhelper_p.h>
+#include <private/qblendfunctions_p.h>
+#include <private/qmath_p.h>
#ifdef QT_HAVE_NEON
#include <private/qdrawhelper_neon_p.h>
+#include <private/qpaintengine_raster_p.h>
#include <arm_neon.h>
QT_BEGIN_NAMESPACE
@@ -87,60 +90,142 @@ static inline uint16x8_t qvsource_over_u16(uint16x8_t src16, uint16x8_t dst16, u
return vaddq_u16(src16, qvbyte_mul_u16(dst16, alpha16, half));
}
-void qt_blend_argb32_on_argb32_neon(uchar *destPixels, int dbpl,
- const uchar *srcPixels, int sbpl,
- int w, int h,
- int const_alpha)
+extern "C" void
+pixman_composite_over_8888_0565_asm_neon (int32_t w,
+ int32_t h,
+ uint16_t *dst,
+ int32_t dst_stride,
+ uint32_t *src,
+ int32_t src_stride);
+
+extern "C" void
+pixman_composite_over_8888_8888_asm_neon (int32_t w,
+ int32_t h,
+ uint32_t *dst,
+ int32_t dst_stride,
+ uint32_t *src,
+ int32_t src_stride);
+
+extern "C" void
+pixman_composite_src_0565_8888_asm_neon (int32_t w,
+ int32_t h,
+ uint32_t *dst,
+ int32_t dst_stride,
+ uint16_t *src,
+ int32_t src_stride);
+
+extern "C" void
+pixman_composite_over_n_8_0565_asm_neon (int32_t w,
+ int32_t h,
+ uint16_t *dst,
+ int32_t dst_stride,
+ uint32_t src,
+ int32_t unused,
+ uint8_t *mask,
+ int32_t mask_stride);
+
+extern "C" void
+pixman_composite_scanline_over_asm_neon (int32_t w,
+ const uint32_t *dst,
+ const uint32_t *src);
+
+// qblendfunctions.cpp
+void qt_blend_argb32_on_rgb16_const_alpha(uchar *destPixels, int dbpl,
+ const uchar *srcPixels, int sbpl,
+ int w, int h,
+ int const_alpha);
+
+void qt_blend_rgb16_on_argb32_neon(uchar *destPixels, int dbpl,
+ const uchar *srcPixels, int sbpl,
+ int w, int h,
+ int const_alpha)
{
- const uint *src = (const uint *) srcPixels;
- uint *dst = (uint *) destPixels;
- uint16x8_t half = vdupq_n_u16(0x80);
- uint16x8_t full = vdupq_n_u16(0xff);
- if (const_alpha == 256) {
- for (int y = 0; y < h; ++y) {
- int x = 0;
- for (; x < w-3; x += 4) {
- uint32x4_t src32 = vld1q_u32((uint32_t *)&src[x]);
- if ((src[x] & src[x+1] & src[x+2] & src[x+3]) >= 0xff000000) {
- // all opaque
- vst1q_u32((uint32_t *)&dst[x], src32);
- } else if (src[x] | src[x+1] | src[x+2] | src[x+3]) {
- uint32x4_t dst32 = vld1q_u32((uint32_t *)&dst[x]);
+ dbpl /= 4;
+ sbpl /= 2;
- const uint8x16_t src8 = vreinterpretq_u8_u32(src32);
- const uint8x16_t dst8 = vreinterpretq_u8_u32(dst32);
+ quint32 *dst = (quint32 *) destPixels;
+ quint16 *src = (quint16 *) srcPixels;
- const uint8x8_t src8_low = vget_low_u8(src8);
- const uint8x8_t dst8_low = vget_low_u8(dst8);
+ if (const_alpha != 256) {
+ quint8 a = (255 * const_alpha) >> 8;
+ quint8 ia = 255 - a;
+
+ while (h--) {
+ for (int x=0; x<w; ++x)
+ dst[x] = INTERPOLATE_PIXEL_255(qt_colorConvert(src[x], dst[x]), a, dst[x], ia);
+ dst += dbpl;
+ src += sbpl;
+ }
+ return;
+ }
- const uint8x8_t src8_high = vget_high_u8(src8);
- const uint8x8_t dst8_high = vget_high_u8(dst8);
+ pixman_composite_src_0565_8888_asm_neon(w, h, dst, dbpl, src, sbpl);
+}
- const uint16x8_t src16_low = vmovl_u8(src8_low);
- const uint16x8_t dst16_low = vmovl_u8(dst8_low);
+extern "C" void blend_8_pixels_argb32_on_rgb16_neon(quint16 *dst, const quint32 *src, int const_alpha);
- const uint16x8_t src16_high = vmovl_u8(src8_high);
- const uint16x8_t dst16_high = vmovl_u8(dst8_high);
+void qt_blend_argb32_on_rgb16_neon(uchar *destPixels, int dbpl,
+ const uchar *srcPixels, int sbpl,
+ int w, int h,
+ int const_alpha)
+{
+ quint16 *dst = (quint16 *) destPixels;
+ quint32 *src = (quint32 *) srcPixels;
- const uint16x8_t result16_low = qvsource_over_u16(src16_low, dst16_low, half, full);
- const uint16x8_t result16_high = qvsource_over_u16(src16_high, dst16_high, half, full);
+ if (const_alpha != 256) {
+ for (int y=0; y<h; ++y) {
+ int i = 0;
+ for (; i < w-7; i += 8)
+ blend_8_pixels_argb32_on_rgb16_neon(&dst[i], &src[i], const_alpha);
- const uint32x2_t result32_low = vreinterpret_u32_u8(vmovn_u16(result16_low));
- const uint32x2_t result32_high = vreinterpret_u32_u8(vmovn_u16(result16_high));
+ if (i < w) {
+ int tail = w - i;
- vst1q_u32((uint32_t *)&dst[x], vcombine_u32(result32_low, result32_high));
+ quint16 dstBuffer[8];
+ quint32 srcBuffer[8];
+
+ for (int j = 0; j < tail; ++j) {
+ dstBuffer[j] = dst[i + j];
+ srcBuffer[j] = src[i + j];
+ }
+
+ blend_8_pixels_argb32_on_rgb16_neon(dstBuffer, srcBuffer, const_alpha);
+
+ for (int j = 0; j < tail; ++j) {
+ dst[i + j] = dstBuffer[j];
+ src[i + j] = srcBuffer[j];
}
}
- for (; x<w; ++x) {
- uint s = src[x];
- if (s >= 0xff000000)
- dst[x] = s;
- else if (s != 0)
- dst[x] = s + BYTE_MUL(dst[x], qAlpha(~s));
- }
- dst = (quint32 *)(((uchar *) dst) + dbpl);
- src = (const quint32 *)(((const uchar *) src) + sbpl);
+
+ dst = (quint16 *)(((uchar *) dst) + dbpl);
+ src = (quint32 *)(((uchar *) src) + sbpl);
}
+ return;
+ }
+
+ pixman_composite_over_8888_0565_asm_neon(w, h, dst, dbpl / 2, src, sbpl / 4);
+}
+
+void qt_blend_argb32_on_argb32_scanline_neon(uint *dest, const uint *src, int length, uint const_alpha)
+{
+ if (const_alpha == 255) {
+ pixman_composite_scanline_over_asm_neon(length, dest, src);
+ } else {
+ qt_blend_argb32_on_argb32_neon((uchar *)dest, 4 * length, (uchar *)src, 4 * length, length, 1, (const_alpha * 256) / 255);
+ }
+}
+
+void qt_blend_argb32_on_argb32_neon(uchar *destPixels, int dbpl,
+ const uchar *srcPixels, int sbpl,
+ int w, int h,
+ int const_alpha)
+{
+ const uint *src = (const uint *) srcPixels;
+ uint *dst = (uint *) destPixels;
+ uint16x8_t half = vdupq_n_u16(0x80);
+ uint16x8_t full = vdupq_n_u16(0xff);
+ if (const_alpha == 256) {
+ pixman_composite_over_8888_8888_asm_neon(w, h, (uint32_t *)destPixels, dbpl / 4, (uint32_t *)srcPixels, sbpl / 4);
} else if (const_alpha != 0) {
const_alpha = (const_alpha * 255) >> 8;
uint16x8_t const_alpha16 = vdupq_n_u16(const_alpha);
@@ -254,6 +339,246 @@ void qt_blend_rgb32_on_rgb32_neon(uchar *destPixels, int dbpl,
}
}
+void qt_alphamapblit_quint16_neon(QRasterBuffer *rasterBuffer,
+ int x, int y, quint32 color,
+ const uchar *bitmap,
+ int mapWidth, int mapHeight, int mapStride,
+ const QClipData *)
+{
+ quint16 *dest = reinterpret_cast<quint16*>(rasterBuffer->scanLine(y)) + x;
+ const int destStride = rasterBuffer->bytesPerLine() / sizeof(quint16);
+
+ uchar *mask = const_cast<uchar *>(bitmap);
+
+ pixman_composite_over_n_8_0565_asm_neon(mapWidth, mapHeight, dest, destStride, color, 0, mask, mapStride);
+}
+
+extern "C" void blend_8_pixels_rgb16_on_rgb16_neon(quint16 *dst, const quint16 *src, int const_alpha);
+
+template <typename SRC, typename BlendFunc>
+struct Blend_on_RGB16_SourceAndConstAlpha_Neon {
+ Blend_on_RGB16_SourceAndConstAlpha_Neon(BlendFunc blender, int const_alpha)
+ : m_index(0)
+ , m_blender(blender)
+ , m_const_alpha(const_alpha)
+ {
+ }
+
+ inline void write(quint16 *dst, quint32 src)
+ {
+ srcBuffer[m_index++] = src;
+
+ if (m_index == 8) {
+ m_blender(dst - 7, srcBuffer, m_const_alpha);
+ m_index = 0;
+ }
+ }
+
+ inline void flush(quint16 *dst)
+ {
+ if (m_index > 0) {
+ quint16 dstBuffer[8];
+ for (int i = 0; i < m_index; ++i)
+ dstBuffer[i] = dst[i - m_index];
+
+ m_blender(dstBuffer, srcBuffer, m_const_alpha);
+
+ for (int i = 0; i < m_index; ++i)
+ dst[i - m_index] = dstBuffer[i];
+
+ m_index = 0;
+ }
+ }
+
+ SRC srcBuffer[8];
+
+ int m_index;
+ BlendFunc m_blender;
+ int m_const_alpha;
+};
+
+template <typename SRC, typename BlendFunc>
+Blend_on_RGB16_SourceAndConstAlpha_Neon<SRC, BlendFunc>
+Blend_on_RGB16_SourceAndConstAlpha_Neon_create(BlendFunc blender, int const_alpha)
+{
+ return Blend_on_RGB16_SourceAndConstAlpha_Neon<SRC, BlendFunc>(blender, const_alpha);
+}
+
+void qt_scale_image_argb32_on_rgb16_neon(uchar *destPixels, int dbpl,
+ const uchar *srcPixels, int sbpl,
+ const QRectF &targetRect,
+ const QRectF &sourceRect,
+ const QRect &clip,
+ int const_alpha)
+{
+ if (const_alpha == 0)
+ return;
+
+ qt_scale_image_16bit<quint32>(destPixels, dbpl, srcPixels, sbpl, targetRect, sourceRect, clip,
+ Blend_on_RGB16_SourceAndConstAlpha_Neon_create<quint32>(blend_8_pixels_argb32_on_rgb16_neon, const_alpha));
+}
+
+void qt_scale_image_rgb16_on_rgb16(uchar *destPixels, int dbpl,
+ const uchar *srcPixels, int sbpl,
+ const QRectF &targetRect,
+ const QRectF &sourceRect,
+ const QRect &clip,
+ int const_alpha);
+
+void qt_scale_image_rgb16_on_rgb16_neon(uchar *destPixels, int dbpl,
+ const uchar *srcPixels, int sbpl,
+ const QRectF &targetRect,
+ const QRectF &sourceRect,
+ const QRect &clip,
+ int const_alpha)
+{
+ if (const_alpha == 0)
+ return;
+
+ if (const_alpha == 256) {
+ qt_scale_image_rgb16_on_rgb16(destPixels, dbpl, srcPixels, sbpl, targetRect, sourceRect, clip, const_alpha);
+ return;
+ }
+
+ qt_scale_image_16bit<quint16>(destPixels, dbpl, srcPixels, sbpl, targetRect, sourceRect, clip,
+ Blend_on_RGB16_SourceAndConstAlpha_Neon_create<quint16>(blend_8_pixels_rgb16_on_rgb16_neon, const_alpha));
+}
+
+extern void qt_transform_image_rgb16_on_rgb16(uchar *destPixels, int dbpl,
+ const uchar *srcPixels, int sbpl,
+ const QRectF &targetRect,
+ const QRectF &sourceRect,
+ const QRect &clip,
+ const QTransform &targetRectTransform,
+ int const_alpha);
+
+void qt_transform_image_rgb16_on_rgb16_neon(uchar *destPixels, int dbpl,
+ const uchar *srcPixels, int sbpl,
+ const QRectF &targetRect,
+ const QRectF &sourceRect,
+ const QRect &clip,
+ const QTransform &targetRectTransform,
+ int const_alpha)
+{
+ if (const_alpha == 0)
+ return;
+
+ if (const_alpha == 256) {
+ qt_transform_image_rgb16_on_rgb16(destPixels, dbpl, srcPixels, sbpl, targetRect, sourceRect, clip, targetRectTransform, const_alpha);
+ return;
+ }
+
+ qt_transform_image(reinterpret_cast<quint16 *>(destPixels), dbpl,
+ reinterpret_cast<const quint16 *>(srcPixels), sbpl, targetRect, sourceRect, clip, targetRectTransform,
+ Blend_on_RGB16_SourceAndConstAlpha_Neon_create<quint16>(blend_8_pixels_rgb16_on_rgb16_neon, const_alpha));
+}
+
+void qt_transform_image_argb32_on_rgb16_neon(uchar *destPixels, int dbpl,
+ const uchar *srcPixels, int sbpl,
+ const QRectF &targetRect,
+ const QRectF &sourceRect,
+ const QRect &clip,
+ const QTransform &targetRectTransform,
+ int const_alpha)
+{
+ if (const_alpha == 0)
+ return;
+
+ qt_transform_image(reinterpret_cast<quint16 *>(destPixels), dbpl,
+ reinterpret_cast<const quint32 *>(srcPixels), sbpl, targetRect, sourceRect, clip, targetRectTransform,
+ Blend_on_RGB16_SourceAndConstAlpha_Neon_create<quint32>(blend_8_pixels_argb32_on_rgb16_neon, const_alpha));
+}
+
+static inline void convert_8_pixels_rgb16_to_argb32(quint32 *dst, const quint16 *src)
+{
+ asm volatile (
+ "vld1.16 { d0, d1 }, [%[SRC]]\n\t"
+
+ /* convert 8 r5g6b5 pixel data from {d0, d1} to planar 8-bit format
+ and put data into d4 - red, d3 - green, d2 - blue */
+ "vshrn.u16 d4, q0, #8\n\t"
+ "vshrn.u16 d3, q0, #3\n\t"
+ "vsli.u16 q0, q0, #5\n\t"
+ "vsri.u8 d4, d4, #5\n\t"
+ "vsri.u8 d3, d3, #6\n\t"
+ "vshrn.u16 d2, q0, #2\n\t"
+
+ /* fill d5 - alpha with 0xff */
+ "mov r2, #255\n\t"
+ "vdup.8 d5, r2\n\t"
+
+ "vst4.8 { d2, d3, d4, d5 }, [%[DST]]"
+ : : [DST]"r" (dst), [SRC]"r" (src)
+ : "memory", "r2", "d0", "d1", "d2", "d3", "d4", "d5"
+ );
+}
+
+uint * QT_FASTCALL qt_destFetchRGB16_neon(uint *buffer, QRasterBuffer *rasterBuffer, int x, int y, int length)
+{
+ const ushort *data = (const ushort *)rasterBuffer->scanLine(y) + x;
+
+ int i = 0;
+ for (; i < length - 7; i += 8)
+ convert_8_pixels_rgb16_to_argb32(&buffer[i], &data[i]);
+
+ if (i < length) {
+ quint16 srcBuffer[8];
+ quint32 dstBuffer[8];
+
+ int tail = length - i;
+ for (int j = 0; j < tail; ++j)
+ srcBuffer[j] = data[i + j];
+
+ convert_8_pixels_rgb16_to_argb32(dstBuffer, srcBuffer);
+
+ for (int j = 0; j < tail; ++j)
+ buffer[i + j] = dstBuffer[j];
+ }
+
+ return buffer;
+}
+
+static inline void convert_8_pixels_argb32_to_rgb16(quint16 *dst, const quint32 *src)
+{
+ asm volatile (
+ "vld4.8 { d0, d1, d2, d3 }, [%[SRC]]\n\t"
+
+ /* convert to r5g6b5 and store it into {d28, d29} */
+ "vshll.u8 q14, d2, #8\n\t"
+ "vshll.u8 q8, d1, #8\n\t"
+ "vshll.u8 q9, d0, #8\n\t"
+ "vsri.u16 q14, q8, #5\n\t"
+ "vsri.u16 q14, q9, #11\n\t"
+
+ "vst1.16 { d28, d29 }, [%[DST]]"
+ : : [DST]"r" (dst), [SRC]"r" (src)
+ : "memory", "d0", "d1", "d2", "d3", "d16", "d17", "d18", "d19", "d28", "d29"
+ );
+}
+
+void QT_FASTCALL qt_destStoreRGB16_neon(QRasterBuffer *rasterBuffer, int x, int y, const uint *buffer, int length)
+{
+ quint16 *data = (quint16*)rasterBuffer->scanLine(y) + x;
+
+ int i = 0;
+ for (; i < length - 7; i += 8)
+ convert_8_pixels_argb32_to_rgb16(&data[i], &buffer[i]);
+
+ if (i < length) {
+ quint32 srcBuffer[8];
+ quint16 dstBuffer[8];
+
+ int tail = length - i;
+ for (int j = 0; j < tail; ++j)
+ srcBuffer[j] = buffer[i + j];
+
+ convert_8_pixels_argb32_to_rgb16(dstBuffer, srcBuffer);
+
+ for (int j = 0; j < tail; ++j)
+ data[i + j] = dstBuffer[j];
+ }
+}
+
QT_END_NAMESPACE
#endif // QT_HAVE_NEON
diff --git a/src/gui/painting/qdrawhelper_neon_asm.S b/src/gui/painting/qdrawhelper_neon_asm.S
new file mode 100644
index 0000000000..9992817fec
--- /dev/null
+++ b/src/gui/painting/qdrawhelper_neon_asm.S
@@ -0,0 +1,192 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtGui 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 Technology Preview License Agreement accompanying
+** this package.
+**
+** 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.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/* Prevent the stack from becoming executable for no reason... */
+#if defined(__linux__) && defined(__ELF__)
+.section .note.GNU-stack,"",%progbits
+#endif
+
+.text
+.fpu neon
+.arch armv7a
+.altmacro
+
+/* void blend_8_pixels_argb32_on_rgb16_neon(quint16 *dst, const quint32 *src, int const_alpha) */
+
+ .func blend_8_pixels_argb32_on_rgb16_neon
+ .global blend_8_pixels_argb32_on_rgb16_neon
+ /* For ELF format also set function visibility to hidden */
+#ifdef __ELF__
+ .hidden blend_8_pixels_argb32_on_rgb16_neon
+ .type blend_8_pixels_argb32_on_rgb16_neon, %function
+#endif
+blend_8_pixels_argb32_on_rgb16_neon:
+ vld4.8 { d0, d1, d2, d3 }, [r1]
+ vld1.16 { d4, d5 }, [r0]
+
+ cmp r2, #256
+ beq .blend_32_inner
+
+ vdup.8 d6, r2
+
+ /* multiply by const_alpha */
+ vmull.u8 q8, d6, d0
+ vmull.u8 q9, d6, d1
+ vmull.u8 q10, d6, d2
+ vmull.u8 q11, d6, d3
+
+ vshrn.u16 d0, q8, #8
+ vshrn.u16 d1, q9, #8
+ vshrn.u16 d2, q10, #8
+ vshrn.u16 d3, q11, #8
+
+.blend_32_inner:
+ /* convert 8 r5g6b5 pixel data from {d4, d5} to planar 8-bit format
+ and put data into d6 - red, d7 - green, d30 - blue */
+ vshrn.u16 d6, q2, #8
+ vshrn.u16 d7, q2, #3
+ vsli.u16 q2, q2, #5
+ vsri.u8 d6, d6, #5
+ vmvn.8 d3, d3
+ vsri.u8 d7, d7, #6
+ vshrn.u16 d30, q2, #2
+
+ pld [r0, #128]
+
+ /* now do alpha blending, storing results in 8-bit planar format
+ into d16 - red, d19 - green, d18 - blue */
+ vmull.u8 q10, d3, d6
+ vmull.u8 q11, d3, d7
+ vmull.u8 q12, d3, d30
+ vrshr.u16 q13, q10, #8
+ vrshr.u16 q3, q11, #8
+ vrshr.u16 q15, q12, #8
+ vraddhn.u16 d20, q10, q13
+ vraddhn.u16 d23, q11, q3
+ vraddhn.u16 d22, q12, q15
+ vqadd.u8 d16, d2, d20
+ vqadd.u8 q9, q0, q11
+ /* convert the result to r5g6b5 and store it into {d28, d29} */
+ vshll.u8 q14, d16, #8
+ vshll.u8 q8, d19, #8
+ vshll.u8 q9, d18, #8
+ vsri.u16 q14, q8, #5
+ vsri.u16 q14, q9, #11
+
+ vst1.16 { d28, d29 }, [r0]
+
+ bx lr
+
+ .endfunc
+
+/* void blend_8_pixels_rgb16_on_rgb16_neon(quint16 *dst, const quint16 *src, int const_alpha) */
+
+ .func blend_8_pixels_rgb16_on_rgb16_neon
+ .global blend_8_pixels_rgb16_on_rgb16_neon
+ /* For ELF format also set function visibility to hidden */
+#ifdef __ELF__
+ .hidden blend_8_pixels_rgb16_on_rgb16_neon
+ .type blend_8_pixels_rgb16_on_rgb16_neon, %function
+#endif
+blend_8_pixels_rgb16_on_rgb16_neon:
+ vld1.16 { d0, d1 }, [r0]
+ vld1.16 { d2, d3 }, [r1]
+
+ rsb r3, r2, #256
+ vdup.8 d4, r2
+ vdup.8 d5, r3
+
+ /* convert 8 r5g6b5 pixel data from {d0, d1} to planar 8-bit format
+ and put data into d6 - red, d7 - green, d30 - blue */
+ vshrn.u16 d6, q0, #8
+ vshrn.u16 d7, q0, #3
+ vsli.u16 q0, q0, #5
+ vsri.u8 d6, d6, #5
+ vsri.u8 d7, d7, #6
+ vshrn.u16 d30, q0, #2
+
+ /* same from {d2, d3} into {d26, d27, d28} */
+ vshrn.u16 d26, q1, #8
+ vshrn.u16 d27, q1, #3
+ vsli.u16 q1, q1, #5
+ vsri.u8 d26, d26, #5
+ vsri.u8 d27, d27, #6
+ vshrn.u16 d28, q1, #2
+
+ /* multiply dst by inv const_alpha */
+ vmull.u8 q10, d5, d6
+ vmull.u8 q11, d5, d7
+ vmull.u8 q12, d5, d30
+
+ vshrn.u16 d6, q10, #8
+ vshrn.u16 d7, q11, #8
+ vshrn.u16 d30, q12, #8
+
+ /* multiply src by const_alpha */
+ vmull.u8 q10, d4, d26
+ vmull.u8 q11, d4, d27
+ vmull.u8 q12, d4, d28
+
+ vshrn.u16 d26, q10, #8
+ vshrn.u16 d27, q11, #8
+ vshrn.u16 d28, q12, #8
+
+ /* preload dst + 128 */
+ pld [r0, #128]
+
+ /* add components, storing results in 8-bit planar format
+ into d16 - red, d19 - green, d18 - blue */
+ vadd.u8 d16, d26, d6
+ vadd.u8 d19, d27, d7
+ vadd.u8 d18, d28, d30
+
+ /* convert the result to r5g6b5 and store it into {d28, d29} */
+ vshll.u8 q14, d16, #8
+ vshll.u8 q8, d19, #8
+ vshll.u8 q9, d18, #8
+ vsri.u16 q14, q8, #5
+ vsri.u16 q14, q9, #11
+
+ vst1.16 { d28, d29 }, [r0]
+
+ bx lr
+
+ .endfunc
diff --git a/src/gui/painting/qdrawhelper_neon_p.h b/src/gui/painting/qdrawhelper_neon_p.h
index 1994441b65..d6a4509075 100644
--- a/src/gui/painting/qdrawhelper_neon_p.h
+++ b/src/gui/painting/qdrawhelper_neon_p.h
@@ -69,6 +69,64 @@ void qt_blend_rgb32_on_rgb32_neon(uchar *destPixels, int dbpl,
int w, int h,
int const_alpha);
+void qt_blend_argb32_on_rgb16_neon(uchar *destPixels, int dbpl,
+ const uchar *srcPixels, int sbpl,
+ int w, int h,
+ int const_alpha);
+
+void qt_blend_argb32_on_argb32_scanline_neon(uint *dest,
+ const uint *src,
+ int length,
+ uint const_alpha);
+
+void qt_blend_rgb16_on_argb32_neon(uchar *destPixels, int dbpl,
+ const uchar *srcPixels, int sbpl,
+ int w, int h,
+ int const_alpha);
+
+void qt_alphamapblit_quint16_neon(QRasterBuffer *rasterBuffer,
+ int x, int y, quint32 color,
+ const uchar *bitmap,
+ int mapWidth, int mapHeight, int mapStride,
+ const QClipData *clip);
+
+void qt_scale_image_argb32_on_rgb16_neon(uchar *destPixels, int dbpl,
+ const uchar *srcPixels, int sbpl,
+ const QRectF &targetRect,
+ const QRectF &sourceRect,
+ const QRect &clip,
+ int const_alpha);
+
+void qt_scale_image_rgb16_on_rgb16_neon(uchar *destPixels, int dbpl,
+ const uchar *srcPixels, int sbpl,
+ const QRectF &targetRect,
+ const QRectF &sourceRect,
+ const QRect &clip,
+ int const_alpha);
+
+void qt_transform_image_argb32_on_rgb16_neon(uchar *destPixels, int dbpl,
+ const uchar *srcPixels, int sbpl,
+ const QRectF &targetRect,
+ const QRectF &sourceRect,
+ const QRect &clip,
+ const QTransform &targetRectTransform,
+ int const_alpha);
+
+void qt_transform_image_rgb16_on_rgb16_neon(uchar *destPixels, int dbpl,
+ const uchar *srcPixels, int sbpl,
+ const QRectF &targetRect,
+ const QRectF &sourceRect,
+ const QRect &clip,
+ const QTransform &targetRectTransform,
+ int const_alpha);
+
+uint * QT_FASTCALL qt_destFetchRGB16_neon(uint *buffer,
+ QRasterBuffer *rasterBuffer,
+ int x, int y, int length);
+
+void QT_FASTCALL qt_destStoreRGB16_neon(QRasterBuffer *rasterBuffer,
+ int x, int y, const uint *buffer, int length);
+
#endif // QT_HAVE_NEON
QT_END_NAMESPACE
diff --git a/src/gui/painting/qpaintbuffer.cpp b/src/gui/painting/qpaintbuffer.cpp
index 39b76c8e0f..e1156dcb89 100644
--- a/src/gui/painting/qpaintbuffer.cpp
+++ b/src/gui/painting/qpaintbuffer.cpp
@@ -269,24 +269,300 @@ void QPaintBuffer::draw(QPainter *painter, int frame) const
printf("\n");
#endif
- if (painter && !painter->isActive())
- return;
+ processCommands(painter, frameStartIndex(frame), frameEndIndex(frame));
+
+#ifdef QPAINTBUFFER_DEBUG_DRAW
+ qDebug() << "QPaintBuffer::draw() -------------------------------- DONE!";
+#endif
+}
+
+int QPaintBuffer::frameStartIndex(int frame) const
+{
+ return (frame == 0) ? 0 : d_ptr->frames.at(frame - 1);
+}
+
+int QPaintBuffer::frameEndIndex(int frame) const
+{
+ return (frame == d_ptr->frames.size()) ? d_ptr->commands.size() : d_ptr->frames.at(frame);
+}
+
+int QPaintBuffer::processCommands(QPainter *painter, int begin, int end) const
+{
+ if (!painter || !painter->isActive())
+ return 0;
QPaintEngineEx *xengine = painter->paintEngine()->isExtended()
? (QPaintEngineEx *) painter->paintEngine() : 0;
if (xengine) {
QPaintEngineExReplayer player;
- player.draw(*this, painter, frame);
+ player.processCommands(*this, painter, begin, end);
} else {
QPainterReplayer player;
- player.draw(*this, painter, frame);
+ player.processCommands(*this, painter, begin, end);
}
-#ifdef QPAINTBUFFER_DEBUG_DRAW
- qDebug() << "QPaintBuffer::draw() -------------------------------- DONE!";
-#endif
+ int depth = 0;
+ for (int i = begin; i < end; ++i) {
+ const QPaintBufferCommand &cmd = d_ptr->commands.at(i);
+ if (cmd.id == QPaintBufferPrivate::Cmd_Save)
+ ++depth;
+ else if (cmd.id == QPaintBufferPrivate::Cmd_Restore)
+ --depth;
+ }
+ return depth;
}
+QString QPaintBuffer::commandDescription(int command) const
+{
+ QString desc;
+ QDebug debug(&desc);
+
+ const QPaintBufferCommand &cmd = d_ptr->commands.at(command);
+
+ switch (cmd.id) {
+ case QPaintBufferPrivate::Cmd_Save: {
+ debug << "Cmd_Save";
+ break; }
+
+ case QPaintBufferPrivate::Cmd_Restore: {
+ debug << "Cmd_Restore";
+ break; }
+
+ case QPaintBufferPrivate::Cmd_SetBrush: {
+ QBrush brush = qVariantValue<QBrush>(d_ptr->variants.at(cmd.offset));
+ debug << "Cmd_SetBrush: " << brush;
+ break; }
+
+ case QPaintBufferPrivate::Cmd_SetBrushOrigin: {
+ debug << "Cmd_SetBrushOrigin: " << d_ptr->variants.at(cmd.offset).toPointF();
+ break; }
+
+ case QPaintBufferPrivate::Cmd_SetCompositionMode: {
+ QPainter::CompositionMode mode = (QPainter::CompositionMode) cmd.extra;
+ debug << "ExCmd_SetCompositionMode, mode: " << mode;
+ break; }
+
+ case QPaintBufferPrivate::Cmd_SetOpacity: {
+ debug << "ExCmd_SetOpacity: " << d_ptr->variants.at(cmd.offset).toDouble();
+ break; }
+
+ case QPaintBufferPrivate::Cmd_DrawVectorPath: {
+ debug << "ExCmd_DrawVectorPath: size: " << cmd.size
+// << ", hints:" << d->ints[cmd.offset2+cmd.size]
+ << "pts/elms:" << cmd.offset << cmd.offset2;
+ break; }
+
+ case QPaintBufferPrivate::Cmd_StrokeVectorPath: {
+ QPen pen = qVariantValue<QPen>(d_ptr->variants.at(cmd.extra));
+ debug << "ExCmd_StrokeVectorPath: size: " << cmd.size
+// << ", hints:" << d->ints[cmd.offset2+cmd.size]
+ << "pts/elms:" << cmd.offset << cmd.offset2 << pen;
+ break; }
+
+ case QPaintBufferPrivate::Cmd_FillVectorPath: {
+ QBrush brush = qVariantValue<QBrush>(d_ptr->variants.at(cmd.extra));
+ debug << "ExCmd_FillVectorPath: size: " << cmd.size
+// << ", hints:" << d->ints[cmd.offset2+cmd.size]
+ << "pts/elms:" << cmd.offset << cmd.offset2 << brush;
+ break; }
+
+ case QPaintBufferPrivate::Cmd_FillRectBrush: {
+ QBrush brush = qVariantValue<QBrush>(d_ptr->variants.at(cmd.extra));
+ QRectF *rect = (QRectF *)(d_ptr->floats.constData() + cmd.offset);
+ debug << "ExCmd_FillRectBrush, offset: " << cmd.offset << " rect: " << *rect << " brush: " << brush;
+ break; }
+
+ case QPaintBufferPrivate::Cmd_FillRectColor: {
+ QColor color = qVariantValue<QColor>(d_ptr->variants.at(cmd.extra));
+ QRectF *rect = (QRectF *)(d_ptr->floats.constData() + cmd.offset);
+ debug << "ExCmd_FillRectBrush, offset: " << cmd.offset << " rect: " << *rect << " color: " << color;
+ break; }
+
+ case QPaintBufferPrivate::Cmd_DrawPolygonF: {
+ debug << "ExCmd_DrawPolygonF, offset: " << cmd.offset << " size: " << cmd.size
+ << " mode: " << cmd.extra
+ << d_ptr->floats.at(cmd.offset)
+ << d_ptr->floats.at(cmd.offset+1);
+ break; }
+
+ case QPaintBufferPrivate::Cmd_DrawPolygonI: {
+ debug << "ExCmd_DrawPolygonI, offset: " << cmd.offset << " size: " << cmd.size
+ << " mode: " << cmd.extra
+ << d_ptr->ints.at(cmd.offset)
+ << d_ptr->ints.at(cmd.offset+1);
+ break; }
+
+ case QPaintBufferPrivate::Cmd_DrawEllipseF: {
+ debug << "ExCmd_DrawEllipseF, offset: " << cmd.offset;
+ break; }
+
+ case QPaintBufferPrivate::Cmd_DrawLineF: {
+ debug << "ExCmd_DrawLineF, offset: " << cmd.offset << " size: " << cmd.size;
+ break; }
+
+ case QPaintBufferPrivate::Cmd_DrawLineI: {
+ debug << "ExCmd_DrawLineI, offset: " << cmd.offset << " size: " << cmd.size;
+ break; }
+
+ case QPaintBufferPrivate::Cmd_DrawPointsF: {
+ debug << "ExCmd_DrawPointsF, offset: " << cmd.offset << " size: " << cmd.size;
+ break; }
+
+ case QPaintBufferPrivate::Cmd_DrawPointsI: {
+ debug << "ExCmd_DrawPointsI, offset: " << cmd.offset << " size: " << cmd.size;
+ break; }
+
+ case QPaintBufferPrivate::Cmd_DrawPolylineF: {
+ debug << "ExCmd_DrawPolylineF, offset: " << cmd.offset << " size: " << cmd.size;
+ break; }
+
+ case QPaintBufferPrivate::Cmd_DrawPolylineI: {
+ debug << "ExCmd_DrawPolylineI, offset: " << cmd.offset << " size: " << cmd.size;
+ break; }
+
+ case QPaintBufferPrivate::Cmd_DrawRectF: {
+ debug << "ExCmd_DrawRectF, offset: " << cmd.offset << " size: " << cmd.size;
+ break; }
+
+ case QPaintBufferPrivate::Cmd_DrawRectI: {
+ debug << "ExCmd_DrawRectI, offset: " << cmd.offset << " size: " << cmd.size;
+ break; }
+
+ case QPaintBufferPrivate::Cmd_SetClipEnabled: {
+ bool clipEnabled = d_ptr->variants.at(cmd.offset).toBool();
+ debug << "ExCmd_SetClipEnabled:" << clipEnabled;
+ break; }
+
+ case QPaintBufferPrivate::Cmd_ClipVectorPath: {
+ QVectorPathCmd path(d_ptr, cmd);
+ debug << "ExCmd_ClipVectorPath:" << path().elementCount();
+ break; }
+
+ case QPaintBufferPrivate::Cmd_ClipRect: {
+ QRect rect(QPoint(d_ptr->ints.at(cmd.offset), d_ptr->ints.at(cmd.offset + 1)),
+ QPoint(d_ptr->ints.at(cmd.offset + 2), d_ptr->ints.at(cmd.offset + 3)));
+ debug << "ExCmd_ClipRect:" << rect << cmd.extra;
+ break; }
+
+ case QPaintBufferPrivate::Cmd_ClipRegion: {
+ QRegion region(d_ptr->variants.at(cmd.offset).value<QRegion>());
+ debug << "ExCmd_ClipRegion:" << region.boundingRect() << cmd.extra;
+ break; }
+
+ case QPaintBufferPrivate::Cmd_SetPen: {
+ QPen pen = qVariantValue<QPen>(d_ptr->variants.at(cmd.offset));
+ debug << "Cmd_SetPen: " << pen;
+ break; }
+
+ case QPaintBufferPrivate::Cmd_SetTransform: {
+ QTransform xform = qVariantValue<QTransform>(d_ptr->variants.at(cmd.offset));
+ debug << "Cmd_SetTransform, offset: " << cmd.offset << xform;
+ break; }
+
+ case QPaintBufferPrivate::Cmd_SetRenderHints: {
+ debug << "Cmd_SetRenderHints, hints: " << cmd.extra;
+ break; }
+
+ case QPaintBufferPrivate::Cmd_SetBackgroundMode: {
+ debug << "Cmd_SetBackgroundMode: " << cmd.extra;
+ break; }
+
+ case QPaintBufferPrivate::Cmd_DrawConvexPolygonF: {
+ debug << "Cmd_DrawConvexPolygonF, offset: " << cmd.offset << " size: " << cmd.size;
+ break; }
+
+ case QPaintBufferPrivate::Cmd_DrawConvexPolygonI: {
+ debug << "Cmd_DrawConvexPolygonI, offset: " << cmd.offset << " size: " << cmd.size;
+ break; }
+
+ case QPaintBufferPrivate::Cmd_DrawEllipseI: {
+ debug << "Cmd_DrawEllipseI, offset: " << cmd.offset;
+ break; }
+
+ case QPaintBufferPrivate::Cmd_DrawPixmapRect: {
+ QPixmap pm(d_ptr->variants.at(cmd.offset).value<QPixmap>());
+ QRectF r(d_ptr->floats.at(cmd.extra), d_ptr->floats.at(cmd.extra+1),
+ d_ptr->floats.at(cmd.extra+2), d_ptr->floats.at(cmd.extra+3));
+
+ QRectF sr(d_ptr->floats.at(cmd.extra+4), d_ptr->floats.at(cmd.extra+5),
+ d_ptr->floats.at(cmd.extra+6), d_ptr->floats.at(cmd.extra+7));
+ debug << "Cmd_DrawPixmapRect:" << r << sr << pm.size();
+ break; }
+
+ case QPaintBufferPrivate::Cmd_DrawPixmapPos: {
+ QPixmap pm(d_ptr->variants.at(cmd.offset).value<QPixmap>());
+ QPointF pos(d_ptr->floats.at(cmd.extra), d_ptr->floats.at(cmd.extra+1));
+ debug << "Cmd_DrawPixmapPos:" << pos << pm.size();
+ break; }
+
+ case QPaintBufferPrivate::Cmd_DrawTiledPixmap: {
+ QPixmap pm(d_ptr->variants.at(cmd.offset).value<QPixmap>());
+ QRectF r(d_ptr->floats.at(cmd.extra), d_ptr->floats.at(cmd.extra+1),
+ d_ptr->floats.at(cmd.extra+2), d_ptr->floats.at(cmd.extra+3));
+
+ QPointF offset(d_ptr->floats.at(cmd.extra+4), d_ptr->floats.at(cmd.extra+5));
+ debug << "Cmd_DrawTiledPixmap:" << r << offset << pm.size();
+ break; }
+
+ case QPaintBufferPrivate::Cmd_DrawImageRect: {
+ QImage image(d_ptr->variants.at(cmd.offset).value<QImage>());
+ QRectF r(d_ptr->floats.at(cmd.extra), d_ptr->floats.at(cmd.extra+1),
+ d_ptr->floats.at(cmd.extra+2), d_ptr->floats.at(cmd.extra+3));
+ QRectF sr(d_ptr->floats.at(cmd.extra+4), d_ptr->floats.at(cmd.extra+5),
+ d_ptr->floats.at(cmd.extra+6), d_ptr->floats.at(cmd.extra+7));
+ debug << "Cmd_DrawImageRect:" << r << sr << image.size();
+ break; }
+
+ case QPaintBufferPrivate::Cmd_DrawImagePos: {
+ QImage image(d_ptr->variants.at(cmd.offset).value<QImage>());
+ QPointF pos(d_ptr->floats.at(cmd.extra), d_ptr->floats.at(cmd.extra+1));
+ debug << "Cmd_DrawImagePos:" << pos << image.size();
+ break; }
+
+ case QPaintBufferPrivate::Cmd_DrawText: {
+ QPointF pos(d_ptr->floats.at(cmd.extra), d_ptr->floats.at(cmd.extra+1));
+ QList<QVariant> variants(d_ptr->variants.at(cmd.offset).value<QList<QVariant> >());
+
+ QFont font(variants.at(0).value<QFont>());
+ QString text(variants.at(1).value<QString>());
+
+ debug << "Cmd_DrawText:" << pos << text << font.family();
+ break; }
+
+ case QPaintBufferPrivate::Cmd_DrawTextItem: {
+ QPointF pos(d_ptr->floats.at(cmd.extra), d_ptr->floats.at(cmd.extra+1));
+ QTextItemIntCopy *tiCopy = reinterpret_cast<QTextItemIntCopy *>(qVariantValue<void *>(d_ptr->variants.at(cmd.offset)));
+ QTextItemInt &ti = (*tiCopy)();
+ QString text(ti.text());
+
+ QFont font(ti.font());
+ font.setUnderline(false);
+ font.setStrikeOut(false);
+ font.setOverline(false);
+
+ const QTextItemInt &si = static_cast<const QTextItemInt &>(ti);
+ qreal justificationWidth = 0;
+ if (si.justified)
+ justificationWidth = si.width.toReal();
+
+ debug << "Cmd_DrawTextItem:" << pos << " " << text;
+ break; }
+ case QPaintBufferPrivate::Cmd_SystemStateChanged: {
+ QRegion systemClip(d_ptr->variants.at(cmd.offset).value<QRegion>());
+
+ debug << "Cmd_SystemStateChanged:" << systemClip;
+ break; }
+ case QPaintBufferPrivate::Cmd_Translate: {
+ QPointF delta(d_ptr->floats.at(cmd.extra), d_ptr->floats.at(cmd.extra+1));
+ debug << "Cmd_Translate:" << delta;
+ break; }
+ case QPaintBufferPrivate::Cmd_DrawStaticText: {
+ debug << "Cmd_DrawStaticText";
+ break; }
+ }
+
+ return desc;
+}
QRectF QPaintBuffer::boundingRect() const
{
@@ -992,13 +1268,14 @@ void QPaintBufferEngine::drawTiledPixmap(const QRectF &r, const QPixmap &pm, con
void QPaintBufferEngine::drawStaticTextItem(QStaticTextItem *staticTextItem)
{
- QString text = QString(staticTextItem->chars, staticTextItem->numChars);
+ QVariantList variants;
- QStaticText staticText(text);
- staticText.prepare(state()->matrix, staticTextItem->font);
+ variants << QVariant(staticTextItem->font);
+ for (int i=0; i<staticTextItem->numGlyphs; ++i) {
+ variants.append(staticTextItem->glyphs[i]);
+ variants.append(staticTextItem->glyphPositions[i].toPointF());
+ }
- QVariantList variants;
- variants << QVariant(staticTextItem->font) << QVariant::fromValue(staticText);
buffer->addCommand(QPaintBufferPrivate::Cmd_DrawStaticText, QVariant(variants));
}
@@ -1110,15 +1387,12 @@ void QPainterReplayer::setupTransform(QPainter *_painter)
painter->setTransform(m_world_matrix);
}
-void QPainterReplayer::draw(const QPaintBuffer &buffer, QPainter *_painter, int frame)
+void QPainterReplayer::processCommands(const QPaintBuffer &buffer, QPainter *p, int begin, int end)
{
d = buffer.d_ptr;
- setupTransform(_painter);
-
- int frameStart = (frame == 0) ? 0 : d->frames.at(frame-1);
- int frameEnd = (frame == d->frames.size()) ? d->commands.size() : d->frames.at(frame);
+ painter = p;
- for (int cmdIndex=frameStart; cmdIndex<frameEnd; ++cmdIndex) {
+ for (int cmdIndex = begin; cmdIndex < end; ++cmdIndex) {
const QPaintBufferCommand &cmd = d->commands.at(cmdIndex);
process(cmd);
}
@@ -1484,11 +1758,19 @@ void QPainterReplayer::process(const QPaintBufferCommand &cmd)
QVariantList variants(d->variants.at(cmd.offset).value<QVariantList>());
- QFont font(variants.at(0).value<QFont>());
- QStaticText text(variants.at(0).value<QStaticText>());
-
+ QFont font = variants.at(0).value<QFont>();
+
+ QVector<quint32> glyphs;
+ QVector<QPointF> positions;
+
+ for (int i=0; i<(variants.size() - 1) / 2; ++i) {
+ glyphs.append(variants.at(i*2 + 1).toUInt());
+ positions.append(variants.at(i*2 + 2).toPointF());
+ }
+
painter->setFont(font);
- painter->drawStaticText(QPointF(0, 0), text);
+
+ qt_draw_glyphs(painter, glyphs.constData(), positions.constData(), glyphs.size());
break;
}
diff --git a/src/gui/painting/qpaintbuffer_p.h b/src/gui/painting/qpaintbuffer_p.h
index 0fde290632..457694754a 100644
--- a/src/gui/painting/qpaintbuffer_p.h
+++ b/src/gui/painting/qpaintbuffer_p.h
@@ -78,6 +78,12 @@ public:
int numFrames() const;
void draw(QPainter *painter, int frame = 0) const;
+
+ int frameStartIndex(int frame) const;
+ int frameEndIndex(int frame) const;
+ int processCommands(QPainter *painter, int begin, int end) const;
+ QString commandDescription(int command) const;
+
void setBoundingRect(const QRectF &rect);
QRectF boundingRect() const;
@@ -317,7 +323,7 @@ public:
void setupTransform(QPainter *painter);
virtual void process(const QPaintBufferCommand &cmd);
- void draw(const QPaintBuffer &buffer, QPainter *painter, int frame);
+ void processCommands(const QPaintBuffer &buffer, QPainter *painter, int begin, int end);
protected:
QPaintBufferPrivate *d;
diff --git a/src/gui/painting/qpainter.cpp b/src/gui/painting/qpainter.cpp
index 1c528fe7ea..898a996e15 100644
--- a/src/gui/painting/qpainter.cpp
+++ b/src/gui/painting/qpainter.cpp
@@ -5720,6 +5720,16 @@ void QPainterPrivate::drawGlyphs(const quint32 *glyphArray, const QPointF *posit
QFontEngine *fontEngine = state->font.d->engineForScript(QUnicodeTables::Common);
+ while (fontEngine->type() == QFontEngine::Multi) {
+ // Pick engine based on first glyph in array if we are using a multi engine.
+ // (all glyphs must be for same font)
+ int engineIdx = 0;
+ if (glyphCount > 0)
+ engineIdx = glyphArray[0] >> 24;
+
+ fontEngine = static_cast<QFontEngineMulti *>(fontEngine)->engine(engineIdx);
+ }
+
QVarLengthArray<QFixedPoint, 128> positions;
for (int i=0; i<glyphCount; ++i) {
QFixedPoint fp = QFixedPoint::fromPointF(positionArray[i]);
@@ -5762,19 +5772,24 @@ void QPainterPrivate::drawGlyphs(const quint32 *glyphArray, const QPointF *posit
/*!
- \fn void QPainter::drawStaticText(const QPoint &position, const QStaticText &staticText)
+ \fn void QPainter::drawStaticText(const QPoint &topLeftPosition, const QStaticText &staticText)
\since 4.7
\overload
- Draws the \a staticText at the \a position.
+ Draws the \a staticText at the \a topLeftPosition.
+
+ \note The y-position is used as the top of the font.
+
*/
/*!
- \fn void QPainter::drawStaticText(int x, int y, const QStaticText &staticText)
+ \fn void QPainter::drawStaticText(int left, int top, const QStaticText &staticText)
\since 4.7
\overload
- Draws the \a staticText at coordinates \a x and \a y.
+ Draws the \a staticText at coordinates \a left and \a top.
+
+ \note The y-position is used as the top of the font.
*/
/*!
@@ -5802,7 +5817,7 @@ void QPainter::drawText(const QPointF &p, const QString &str)
/*!
\since 4.7
- Draws the given \a staticText at the given \a position.
+ Draws the given \a staticText at the given \a topLeftPosition.
The text will be drawn using the font and the transformation set on the painter. If the
font and/or transformation set on the painter are different from the ones used to initialize
@@ -5810,15 +5825,17 @@ void QPainter::drawText(const QPointF &p, const QString &str)
QStaticText::prepare() to initialize \a staticText with the font and transformation with which
it will later be drawn.
- If \a position is not the same as when \a staticText was initialized, or when it was last drawn,
- then there will be a slight overhead when translating the text to its new position.
+ If \a topLeftPosition is not the same as when \a staticText was initialized, or when it was
+ last drawn, then there will be a slight overhead when translating the text to its new position.
- \note If the painter's transformation is not affine, then \a staticText will be drawn using regular
- calls to drawText(), losing any potential performance improvement.
+ \note If the painter's transformation is not affine, then \a staticText will be drawn using
+ regular calls to drawText(), losing any potential for performance improvement.
+
+ \note The y-position is used as the top of the font.
\sa QStaticText
*/
-void QPainter::drawStaticText(const QPointF &position, const QStaticText &staticText)
+void QPainter::drawStaticText(const QPointF &topLeftPosition, const QStaticText &staticText)
{
Q_D(QPainter);
if (!d->engine || staticText.text().isEmpty() || pen().style() == Qt::NoPen)
@@ -5827,16 +5844,21 @@ void QPainter::drawStaticText(const QPointF &position, const QStaticText &static
QStaticTextPrivate *staticText_d =
const_cast<QStaticTextPrivate *>(QStaticTextPrivate::get(&staticText));
+ if (font() != staticText_d->font) {
+ staticText_d->font = font();
+ staticText_d->needsRelayout = true;
+ }
+
// If we don't have an extended paint engine, or if the painter is projected,
// we go through standard code path
if (d->extended == 0 || !d->state->matrix.isAffine()) {
- staticText_d->paintText(position, this);
+ staticText_d->paintText(topLeftPosition, this);
return;
}
// Don't recalculate entire layout because of translation, rather add the dx and dy
// into the position to move each text item the correct distance.
- QPointF transformedPosition = position * d->state->matrix;
+ QPointF transformedPosition = topLeftPosition * d->state->matrix;
QTransform matrix = d->state->matrix;
// The translation has been applied to transformedPosition. Remove translation
@@ -5857,25 +5879,12 @@ void QPainter::drawStaticText(const QPointF &position, const QStaticText &static
// If the transform is not identical to the text transform,
// we have to relayout the text (for other transformations than plain translation)
- bool staticTextNeedsReinit = false;
+ bool staticTextNeedsReinit = staticText_d->needsRelayout;
if (staticText_d->matrix != d->state->matrix) {
staticText_d->matrix = d->state->matrix;
staticTextNeedsReinit = true;
}
- bool restoreWhenFinished = false;
- if (staticText_d->needsClipRect) {
- save();
- setClipRect(QRectF(position, staticText_d->maximumSize));
-
- restoreWhenFinished = true;
- }
-
- if (font() != staticText_d->font) {
- staticText_d->font = font();
- staticTextNeedsReinit = true;
- }
-
// Recreate the layout of the static text because the matrix or font has changed
if (staticTextNeedsReinit)
staticText_d->init();
@@ -5901,7 +5910,7 @@ void QPainter::drawStaticText(const QPointF &position, const QStaticText &static
QColor currentColor = oldPen.color();
for (int i=0; i<staticText_d->itemCount; ++i) {
QStaticTextItem *item = staticText_d->items + i;
- if (currentColor != item->color) {
+ if (item->color.isValid() && currentColor != item->color) {
setPen(item->color);
currentColor = item->color;
}
@@ -5910,9 +5919,6 @@ void QPainter::drawStaticText(const QPointF &position, const QStaticText &static
if (currentColor != oldPen.color())
setPen(oldPen);
- if (restoreWhenFinished)
- restore();
-
if (matrix.isTranslating())
d->state->matrix = matrix;
}
diff --git a/src/gui/painting/qpainter.h b/src/gui/painting/qpainter.h
index 443925b771..edfb67ecb1 100644
--- a/src/gui/painting/qpainter.h
+++ b/src/gui/painting/qpainter.h
@@ -396,9 +396,9 @@ public:
void setLayoutDirection(Qt::LayoutDirection direction);
Qt::LayoutDirection layoutDirection() const;
- void drawStaticText(const QPointF &p, const QStaticText &staticText);
- inline void drawStaticText(const QPoint &p, const QStaticText &staticText);
- inline void drawStaticText(int x, int y, const QStaticText &staticText);
+ void drawStaticText(const QPointF &topLeftPosition, const QStaticText &staticText);
+ inline void drawStaticText(const QPoint &topLeftPosition, const QStaticText &staticText);
+ inline void drawStaticText(int left, int top, const QStaticText &staticText);
void drawText(const QPointF &p, const QString &s);
inline void drawText(const QPoint &p, const QString &s);
diff --git a/src/gui/painting/qtransform.cpp b/src/gui/painting/qtransform.cpp
index 4f42a5852e..988d6784f7 100644
--- a/src/gui/painting/qtransform.cpp
+++ b/src/gui/painting/qtransform.cpp
@@ -1037,8 +1037,18 @@ QDataStream & operator>>(QDataStream &s, QTransform &t)
#ifndef QT_NO_DEBUG_STREAM
QDebug operator<<(QDebug dbg, const QTransform &m)
{
- dbg.nospace() << "QTransform("
- << "11=" << m.m11()
+ static const char *typeStr[] =
+ {
+ "TxNone",
+ "TxTranslate",
+ "TxScale",
+ "TxRotate",
+ "TxShear",
+ "TxProject"
+ };
+
+ dbg.nospace() << "QTransform(type=" << typeStr[m.type()] << ','
+ << " 11=" << m.m11()
<< " 12=" << m.m12()
<< " 13=" << m.m13()
<< " 21=" << m.m21()
@@ -1048,6 +1058,7 @@ QDebug operator<<(QDebug dbg, const QTransform &m)
<< " 32=" << m.m32()
<< " 33=" << m.m33()
<< ')';
+
return dbg.space();
}
#endif
diff --git a/src/gui/text/qfont.cpp b/src/gui/text/qfont.cpp
index 9b85c0410b..99b9f40cc2 100644
--- a/src/gui/text/qfont.cpp
+++ b/src/gui/text/qfont.cpp
@@ -1297,6 +1297,8 @@ QFont::StyleHint QFont::styleHint() const
\value PreferQuality prefer the best quality font. The font matcher
will use the nearest standard point size that the font
supports.
+ \value ForceIntegerMetrics forces the use of integer values in font engines that support fractional
+ font metrics.
*/
/*!
diff --git a/src/gui/text/qfont.h b/src/gui/text/qfont.h
index 5adf237af7..6f624246b9 100644
--- a/src/gui/text/qfont.h
+++ b/src/gui/text/qfont.h
@@ -76,17 +76,18 @@ public:
};
enum StyleStrategy {
- PreferDefault = 0x0001,
- PreferBitmap = 0x0002,
- PreferDevice = 0x0004,
- PreferOutline = 0x0008,
- ForceOutline = 0x0010,
- PreferMatch = 0x0020,
- PreferQuality = 0x0040,
- PreferAntialias = 0x0080,
- NoAntialias = 0x0100,
- OpenGLCompatible = 0x0200,
- NoFontMerging = 0x8000
+ PreferDefault = 0x0001,
+ PreferBitmap = 0x0002,
+ PreferDevice = 0x0004,
+ PreferOutline = 0x0008,
+ ForceOutline = 0x0010,
+ PreferMatch = 0x0020,
+ PreferQuality = 0x0040,
+ PreferAntialias = 0x0080,
+ NoAntialias = 0x0100,
+ OpenGLCompatible = 0x0200,
+ ForceIntegerMetrics = 0x0400,
+ NoFontMerging = 0x8000
};
enum Weight {
diff --git a/src/gui/text/qfontengine_mac.mm b/src/gui/text/qfontengine_mac.mm
index 8588214b5c..0bfdbc04f3 100644
--- a/src/gui/text/qfontengine_mac.mm
+++ b/src/gui/text/qfontengine_mac.mm
@@ -53,6 +53,7 @@
#include <qvarlengtharray.h>
#include <qdebug.h>
#include <qendian.h>
+#include <qmath.h>
#include <ApplicationServices/ApplicationServices.h>
#include <AppKit/AppKit.h>
@@ -303,12 +304,20 @@ bool QCoreTextFontEngineMulti::stringToCMap(const QChar *str, int len, QGlyphLay
outGlyphs[idx] = tmpGlyphs[i] | fontIndex;
outAdvances_x[idx] = QFixed::fromReal(tmpPoints[i + 1].x - tmpPoints[i].x);
outAdvances_y[idx] = QFixed::fromReal(tmpPoints[i + 1].y - tmpPoints[i].y);
+
+ if (fontDef.styleStrategy & QFont::ForceIntegerMetrics) {
+ outAdvances_x[idx] = outAdvances_x[idx].round();
+ outAdvances_y[idx] = outAdvances_y[idx].round();
+ }
}
CGSize lastGlyphAdvance;
CTFontGetAdvancesForGlyphs(runFont, kCTFontHorizontalOrientation, tmpGlyphs + glyphCount - 1, &lastGlyphAdvance, 1);
outGlyphs[rtl ? 0 : (glyphCount - 1)] = tmpGlyphs[glyphCount - 1] | fontIndex;
- outAdvances_x[rtl ? 0 : (glyphCount - 1)] = QFixed::fromReal(lastGlyphAdvance.width);
+ outAdvances_x[rtl ? 0 : (glyphCount - 1)] =
+ (fontDef.styleStrategy & QFont::ForceIntegerMetrics)
+ ? QFixed::fromReal(lastGlyphAdvance.width).round()
+ : QFixed::fromReal(lastGlyphAdvance.width);
}
outGlyphs += glyphCount;
outAttributes += glyphCount;
@@ -378,8 +387,11 @@ bool QCoreTextFontEngine::stringToCMap(const QChar *, int, QGlyphLayout *, int *
glyph_metrics_t QCoreTextFontEngine::boundingBox(const QGlyphLayout &glyphs)
{
QFixed w;
- for (int i = 0; i < glyphs.numGlyphs; ++i)
- w += glyphs.effectiveAdvance(i);
+ for (int i = 0; i < glyphs.numGlyphs; ++i) {
+ w += (fontDef.styleStrategy & QFont::ForceIntegerMetrics)
+ ? glyphs.effectiveAdvance(i).round()
+ : glyphs.effectiveAdvance(i);
+ }
return glyph_metrics_t(0, -(ascent()), w, ascent()+descent(), w, 0);
}
glyph_metrics_t QCoreTextFontEngine::boundingBox(glyph_t glyph)
@@ -393,33 +405,51 @@ glyph_metrics_t QCoreTextFontEngine::boundingBox(glyph_t glyph)
ret.y = -QFixed::fromReal(rect.origin.y) - ret.height;
CGSize advances[1];
CTFontGetAdvancesForGlyphs(ctfont, kCTFontHorizontalOrientation, &g, advances, 1);
- ret.xoff = QFixed::fromReal(advances[0].width).ceil();
- ret.yoff = QFixed::fromReal(advances[0].height).ceil();
+ ret.xoff = QFixed::fromReal(advances[0].width);
+ ret.yoff = QFixed::fromReal(advances[0].height);
+
+ if (fontDef.styleStrategy & QFont::ForceIntegerMetrics) {
+ ret.xoff = ret.xoff.round();
+ ret.yoff = ret.yoff.round();
+ }
+
return ret;
}
QFixed QCoreTextFontEngine::ascent() const
{
- return QFixed::fromReal(CTFontGetAscent(ctfont)).ceil();
+ return (fontDef.styleStrategy & QFont::ForceIntegerMetrics)
+ ? QFixed::fromReal(CTFontGetAscent(ctfont)).round()
+ : QFixed::fromReal(CTFontGetAscent(ctfont));
}
QFixed QCoreTextFontEngine::descent() const
{
+ QFixed d = QFixed::fromReal(CTFontGetDescent(ctfont));
+ if (fontDef.styleStrategy & QFont::ForceIntegerMetrics)
+ d = d.round();
+
// subtract a pixel to even out the historical +1 in QFontMetrics::height().
// Fix in Qt 5.
- return QFixed::fromReal(CTFontGetDescent(ctfont)).ceil() - 1;
+ return d - 1;
}
QFixed QCoreTextFontEngine::leading() const
{
- return QFixed::fromReal(CTFontGetLeading(ctfont)).ceil();
+ return (fontDef.styleStrategy & QFont::ForceIntegerMetrics)
+ ? QFixed::fromReal(CTFontGetLeading(ctfont)).round()
+ : QFixed::fromReal(CTFontGetLeading(ctfont));
}
QFixed QCoreTextFontEngine::xHeight() const
{
- return QFixed::fromReal(CTFontGetXHeight(ctfont)).ceil();
+ return (fontDef.styleStrategy & QFont::ForceIntegerMetrics)
+ ? QFixed::fromReal(CTFontGetXHeight(ctfont)).round()
+ : QFixed::fromReal(CTFontGetXHeight(ctfont));
}
QFixed QCoreTextFontEngine::averageCharWidth() const
{
// ### Need to implement properly and get the information from the OS/2 Table.
- return QFontEngine::averageCharWidth();
+ return (fontDef.styleStrategy & QFont::ForceIntegerMetrics)
+ ? QFontEngine::averageCharWidth().round()
+ : QFontEngine::averageCharWidth();
}
qreal QCoreTextFontEngine::maxCharWidth() const
@@ -787,6 +817,7 @@ struct QGlyphLayoutInfo
int *mappedFonts;
QTextEngine::ShaperFlags flags;
QFontEngineMacMulti::ShaperItem *shaperItem;
+ unsigned int styleStrategy;
};
static OSStatus atsuPostLayoutCallback(ATSULayoutOperationSelector selector, ATSULineRef lineRef, URefCon refCon,
@@ -856,6 +887,11 @@ static OSStatus atsuPostLayoutCallback(ATSULayoutOperationSelector selector, ATS
QFixed yAdvance = FixedToQFixed(baselineDeltas[glyphIdx]);
QFixed xAdvance = FixedToQFixed(layoutData[glyphIdx + 1].realPos - layoutData[glyphIdx].realPos);
+ if (nfo->styleStrategy & QFont::ForceIntegerMetrics) {
+ yAdvance = yAdvance.round();
+ xAdvance = xAdvance.round();
+ }
+
if (glyphId != 0xffff || i == 0) {
if (i < nfo->glyphs->numGlyphs)
{
@@ -1032,6 +1068,7 @@ bool QFontEngineMacMulti::stringToCMapInternal(const QChar *str, int len, QGlyph
nfo.callbackCalled = false;
nfo.flags = flags;
nfo.shaperItem = shaperItem;
+ nfo.styleStrategy = fontDef.styleStrategy;
int prevNumGlyphs = *nglyphs;
@@ -1061,8 +1098,6 @@ bool QFontEngineMacMulti::stringToCMapInternal(const QChar *str, int len, QGlyph
| kATSLineDisableAllJustification
;
- layopts |= kATSLineUseDeviceMetrics;
-
if (fontDef.styleStrategy & QFont::NoAntialias)
layopts |= kATSLineNoAntiAliasing;
@@ -1366,14 +1401,22 @@ void QFontEngineMac::recalcAdvances(QGlyphLayout *glyphs, QTextEngine::ShaperFla
for (int i = 0; i < glyphs->numGlyphs; ++i) {
glyphs->advances_x[i] = QFixed::fromReal(metrics[i].deviceAdvance.x);
glyphs->advances_y[i] = QFixed::fromReal(metrics[i].deviceAdvance.y);
+
+ if (fontDef.styleStrategy & QFont::ForceIntegerMetrics) {
+ glyphs->advances_x[i] = glyphs->advances_x[i].round();
+ glyphs->advances_y[i] = glyphs->advances_y[i].round();
+ }
}
}
glyph_metrics_t QFontEngineMac::boundingBox(const QGlyphLayout &glyphs)
{
QFixed w;
- for (int i = 0; i < glyphs.numGlyphs; ++i)
- w += glyphs.effectiveAdvance(i);
+ for (int i = 0; i < glyphs.numGlyphs; ++i) {
+ w += (fontDef.styleStrategy & QFont::ForceIntegerMetrics)
+ ? glyphs.effectiveAdvance(i).round()
+ : glyphs.effectiveAdvance(i);
+ }
return glyph_metrics_t(0, -(ascent()), w, ascent()+descent(), w, 0);
}
@@ -1398,39 +1441,58 @@ glyph_metrics_t QFontEngineMac::boundingBox(glyph_t glyph)
gm.xoff = QFixed::fromReal(metrics.deviceAdvance.x);
gm.yoff = QFixed::fromReal(metrics.deviceAdvance.y);
+ if (fontDef.styleStrategy & QFont::ForceIntegerMetrics) {
+ gm.x = gm.x.floor();
+ gm.y = gm.y.floor();
+ gm.xoff = gm.xoff.round();
+ gm.yoff = gm.yoff.round();
+ }
+
return gm;
}
QFixed QFontEngineMac::ascent() const
{
- return m_ascent;
+ return (fontDef.styleStrategy & QFont::ForceIntegerMetrics)
+ ? m_ascent.round()
+ : m_ascent;
}
QFixed QFontEngineMac::descent() const
{
// subtract a pixel to even out the historical +1 in QFontMetrics::height().
// Fix in Qt 5.
- return m_descent - 1;
+ return (fontDef.styleStrategy & QFont::ForceIntegerMetrics)
+ ? m_descent.round() - 1
+ : m_descent;
}
QFixed QFontEngineMac::leading() const
{
- return m_leading;
+ return (fontDef.styleStrategy & QFont::ForceIntegerMetrics)
+ ? m_leading.round()
+ : m_leading;
}
qreal QFontEngineMac::maxCharWidth() const
{
- return m_maxCharWidth;
+ return (fontDef.styleStrategy & QFont::ForceIntegerMetrics)
+ ? qRound(m_maxCharWidth)
+ : m_maxCharWidth;
}
QFixed QFontEngineMac::xHeight() const
{
- return m_xHeight;
+ return (fontDef.styleStrategy & QFont::ForceIntegerMetrics)
+ ? m_xHeight.round()
+ : m_xHeight;
}
QFixed QFontEngineMac::averageCharWidth() const
{
- return m_averageCharWidth;
+ return (fontDef.styleStrategy & QFont::ForceIntegerMetrics)
+ ? m_averageCharWidth.round()
+ : m_averageCharWidth;
}
static void addGlyphsToPathHelper(ATSUStyle style, glyph_t *glyphs, QFixedPoint *positions, int numGlyphs, QPainterPath *path)
diff --git a/src/gui/text/qfontmetrics.cpp b/src/gui/text/qfontmetrics.cpp
index 9349f46ca6..3a52e8e47e 100644
--- a/src/gui/text/qfontmetrics.cpp
+++ b/src/gui/text/qfontmetrics.cpp
@@ -328,7 +328,7 @@ int QFontMetrics::height() const
{
QFontEngine *engine = d->engineForScript(QUnicodeTables::Common);
Q_ASSERT(engine != 0);
- return qRound(engine->ascent() + engine->descent()) + 1;
+ return qRound(engine->ascent()) + qRound(engine->descent()) + 1;
}
/*!
@@ -356,7 +356,7 @@ int QFontMetrics::lineSpacing() const
{
QFontEngine *engine = d->engineForScript(QUnicodeTables::Common);
Q_ASSERT(engine != 0);
- return qRound(engine->leading() + engine->ascent() + engine->descent()) + 1;
+ return qRound(engine->leading()) + qRound(engine->ascent()) + qRound(engine->descent()) + 1;
}
/*!
diff --git a/src/gui/text/qstatictext.cpp b/src/gui/text/qstatictext.cpp
index 798ae37b9d..6c504a7ffb 100644
--- a/src/gui/text/qstatictext.cpp
+++ b/src/gui/text/qstatictext.cpp
@@ -99,20 +99,27 @@ QT_BEGIN_NAMESPACE
point with no boundaries, and also when QPainter::drawText() is called with a bounding
rectangle.
- If a bounding rectangle is not required, create a QStaticText object without setting a maximum
- size. The text will then occupy a single line.
+ If a bounding rectangle is not required, create a QStaticText object without setting a preferred
+ text width. The text will then occupy a single line.
- If you set a maximum size on the QStaticText object, this will bound the text. The text will
- be formatted so that no line exceeds the given width. When the object is painted, it will
- be clipped at the given size. The position of the text is decided by the argument
- passed to QPainter::drawStaticText() and can change from call to call with a minimal impact
- on performance.
+ If you set a text width on the QStaticText object, this will bound the text. The text will
+ be formatted so that no line exceeds the given width. The text width set for QStaticText will
+ not automatically be used for clipping. To achieve clipping in addition to line breaks, use
+ QPainter::setClipRect(). The position of the text is decided by the argument passed to
+ QPainter::drawStaticText() and can change from call to call with a minimal impact on
+ performance.
QStaticText will attempt to guess the format of the input text using Qt::mightBeRichText().
To force QStaticText to display its contents as either plain text or rich text, use the
function QStaticText::setTextFormat() and pass in, respectively, Qt::PlainText and
Qt::RichText.
+ If it's the first time the static text is drawn, or if the static text, or the painter's font
+ or matrix have been altered since the last time it was drawn, the text's layout has to be
+ recalculated. This will impose an overhead on the QPainter::drawStaticText() call where the
+ relayout occurs. To avoid this overhead in the paint event, you can call prepare() ahead of
+ time to ensure that the layout is calculated.
+
\sa QPainter::drawText(), QPainter::drawStaticText(), QTextLayout, QTextDocument
*/
@@ -143,12 +150,11 @@ QStaticText::QStaticText()
If an invalid size is passed for \a size the text will be unbounded.
*/
-QStaticText::QStaticText(const QString &text, const QSizeF &size)
+QStaticText::QStaticText(const QString &text)
: data(new QStaticTextPrivate)
{
data->text = text;
- data->maximumSize = size;
- data->init();
+ data->invalidate();
}
/*!
@@ -177,17 +183,17 @@ void QStaticText::detach()
}
/*!
- Prepares the QStaticText object for being painted with the given \a matrix and the given
- \a font to avoid overhead when the actual drawStaticText() call is made.
+ Prepares the QStaticText object for being painted with the given \a matrix and the given \a font
+ to avoid overhead when the actual drawStaticText() call is made.
- When drawStaticText() is called, the layout of the QStaticText will be recalculated if the
- painter's font or matrix is different from the one used for the currently cached layout. By
- default, QStaticText will use a default constructed QFont and an identity matrix to create
- its layout.
+ When drawStaticText() is called, the layout of the QStaticText will be recalculated if any part
+ of the QStaticText object has changed since the last time it was drawn. It will also be
+ recalculated if the painter's font or matrix are not the same as when the QStaticText was last
+ drawn.
- To avoid the overhead of creating the layout the first time you draw the QStaticText with
- a painter whose matrix or font are different from the defaults, you can use the prepare()
- function and pass in the matrix and font you expect to use when drawing the text.
+ To avoid the overhead of creating the layout the first time you draw the QStaticText after
+ making changes, you can use the prepare() function and pass in the \a matrix and \a font you
+ expect to use when drawing the text.
\sa QPainter::setFont(), QPainter::setMatrix()
*/
@@ -209,7 +215,7 @@ QStaticText &QStaticText::operator=(const QStaticText &other)
}
/*!
- Compares \a other to this QStaticText. Returns true if the texts, fonts and maximum sizes
+ Compares \a other to this QStaticText. Returns true if the texts, fonts and text widths
are equal.
*/
bool QStaticText::operator==(const QStaticText &other) const
@@ -217,7 +223,7 @@ bool QStaticText::operator==(const QStaticText &other) const
return (data == other.data
|| (data->text == other.data->text
&& data->font == other.data->font
- && data->maximumSize == other.data->maximumSize));
+ && data->textWidth == other.data->textWidth));
}
/*!
@@ -232,7 +238,7 @@ bool QStaticText::operator!=(const QStaticText &other) const
/*!
Sets the text of the QStaticText to \a text.
- \note This function will cause the layout of the text to be recalculated.
+ \note This function will cause the layout of the text to require recalculation.
\sa text()
*/
@@ -240,7 +246,7 @@ void QStaticText::setText(const QString &text)
{
detach();
data->text = text;
- data->init();
+ data->invalidate();
}
/*!
@@ -250,7 +256,7 @@ void QStaticText::setText(const QString &text)
displayed as is, whereas it will be interpreted as HTML if the format is Qt::RichText. HTML tags
that alter the font of the text, its color, or its layout are supported by QStaticText.
- \note This function will cause the layout of the text to be recalculated.
+ \note This function will cause the layout of the text to require recalculation.
\sa textFormat(), setText(), text()
*/
@@ -258,7 +264,7 @@ void QStaticText::setTextFormat(Qt::TextFormat textFormat)
{
detach();
data->textFormat = textFormat;
- data->init();
+ data->invalidate();
}
/*!
@@ -289,7 +295,7 @@ QString QStaticText::text() const
The default is QStaticText::ModerateCaching.
- \note This function will cause the layout of the text to be recalculated.
+ \note This function will cause the layout of the text to require recalculation.
\sa performanceHint()
*/
@@ -301,7 +307,7 @@ void QStaticText::setPerformanceHint(PerformanceHint performanceHint)
}
detach();
data->useBackendOptimizations = (performanceHint == AggressiveCaching);
- data->init();
+ data->invalidate();
}
/*!
@@ -315,48 +321,56 @@ QStaticText::PerformanceHint QStaticText::performanceHint() const
}
/*!
- Sets the maximum size of the QStaticText to \a size.
+ Sets the preferred width for this QStaticText. If the text is wider than the specified width,
+ it will be broken into multiple lines and grow vertically. If the text cannot be split into
+ multiple lines, it will be larger than the specified \a textWidth.
- \note This function will cause the layout of the text to be recalculated.
+ Setting the preferred text width to a negative number will cause the text to be unbounded.
- \sa maximumSize(), size()
+ Use size() to get the actual size of the text.
+
+ \note This function will cause the layout of the text to require recalculation.
+
+ \sa textWidth(), size()
*/
-void QStaticText::setMaximumSize(const QSizeF &size)
+void QStaticText::setTextWidth(qreal textWidth)
{
detach();
- data->maximumSize = size;
- data->init();
+ data->textWidth = textWidth;
+ data->invalidate();
}
/*!
- Returns the maximum size of the QStaticText.
+ Returns the preferred width for this QStaticText.
- \sa setMaximumSize()
+ \sa setTextWidth()
*/
-QSizeF QStaticText::maximumSize() const
+qreal QStaticText::textWidth() const
{
- return data->maximumSize;
+ return data->textWidth;
}
/*!
Returns the size of the bounding rect for this QStaticText.
- \sa maximumSize()
+ \sa textWidth()
*/
QSizeF QStaticText::size() const
{
+ if (data->needsRelayout)
+ data->init();
return data->actualSize;
}
QStaticTextPrivate::QStaticTextPrivate()
- : items(0), itemCount(0), glyphPool(0), positionPool(0), needsClipRect(false),
- useBackendOptimizations(false), textFormat(Qt::AutoText)
+ : items(0), itemCount(0), glyphPool(0), positionPool(0), textWidth(-1.0),
+ needsRelayout(true), useBackendOptimizations(false), textFormat(Qt::AutoText)
{
}
QStaticTextPrivate::QStaticTextPrivate(const QStaticTextPrivate &other)
- : text(other.text), font(other.font), maximumSize(other.maximumSize), matrix(other.matrix),
- items(0), itemCount(0), glyphPool(0), positionPool(0), needsClipRect(false),
+ : text(other.text), font(other.font), textWidth(other.textWidth), matrix(other.matrix),
+ items(0), itemCount(0), glyphPool(0), positionPool(0), needsRelayout(true),
useBackendOptimizations(other.useBackendOptimizations), textFormat(other.textFormat)
{
}
@@ -388,10 +402,17 @@ namespace {
m_expectedItemCount(expectedItemCount),
m_expectedGlyphCount(expectedGlyphCount),
m_glyphPool(glyphPool),
- m_positionPool(positionPool)
+ m_positionPool(positionPool),
+ m_dirtyPen(false)
{
}
+ virtual void updateState(const QPaintEngineState &newState)
+ {
+ if (newState.state() & QPaintEngine::DirtyPen)
+ m_dirtyPen = true;
+ }
+
virtual void drawTextItem(const QPointF &position, const QTextItem &textItem)
{
const QTextItemInt &ti = static_cast<const QTextItemInt &>(textItem);
@@ -412,7 +433,8 @@ namespace {
currentItem->numGlyphs = ti.glyphs.numGlyphs;
currentItem->glyphs = m_glyphPool;
currentItem->glyphPositions = m_positionPool;
- currentItem->color = state->pen().color();
+ if (m_dirtyPen)
+ currentItem->color = state->pen().color();
QTransform matrix = state->transform();
matrix.translate(position.x(), position.y());
@@ -435,7 +457,6 @@ namespace {
virtual bool begin(QPaintDevice *) { return true; }
virtual bool end() { return true; }
- virtual void updateState(const QPaintEngineState &) {}
virtual void drawPixmap(const QRectF &, const QPixmap &, const QRectF &) {}
virtual Type type() const
{
@@ -461,6 +482,8 @@ namespace {
glyph_t *m_glyphPool;
QFixedPoint *m_positionPool;
+
+ bool m_dirtyPen;
};
class DrawTextItemDevice: public QPaintDevice
@@ -530,44 +553,59 @@ namespace {
};
}
-void QStaticTextPrivate::paintText(const QPointF &pos, QPainter *p)
+void QStaticTextPrivate::paintText(const QPointF &topLeftPosition, QPainter *p)
{
bool preferRichText = textFormat == Qt::RichText
|| (textFormat == Qt::AutoText && Qt::mightBeRichText(text));
if (!preferRichText) {
- if (maximumSize.isValid()) {
- QRectF boundingRect;
- p->drawText(QRectF(pos, maximumSize), Qt::TextWordWrap, text, &boundingRect);
-
- actualSize = boundingRect.size();
- needsClipRect = boundingRect.width() > maximumSize.width()
- || boundingRect.height() > maximumSize.height();
- } else {
- p->drawText(pos, text);
- needsClipRect = false;
-
- QFontMetrics fm(font);
- actualSize = fm.boundingRect(text).size();
+ QTextLayout textLayout;
+ textLayout.setText(text);
+ textLayout.setFont(font);
+
+ qreal leading = QFontMetricsF(font).leading();
+ qreal height = -leading;
+
+ textLayout.beginLayout();
+ while (1) {
+ QTextLine line = textLayout.createLine();
+ if (!line.isValid())
+ break;
+
+ if (textWidth >= 0.0)
+ line.setLineWidth(textWidth);
+ height += leading;
+ line.setPosition(QPointF(0.0, height));
+ height += line.height();
}
+ textLayout.endLayout();
+
+ actualSize = textLayout.boundingRect().size();
+ textLayout.draw(p, topLeftPosition);
} else {
QTextDocument document;
+ QColor color = p->pen().color();
+ document.setDefaultStyleSheet(QString::fromLatin1("body { color: #%1%2%3 }")
+ .arg(QString::number(color.red(), 16), 2, QLatin1Char('0'))
+ .arg(QString::number(color.green(), 16), 2, QLatin1Char('0'))
+ .arg(QString::number(color.blue(), 16), 2, QLatin1Char('0')));
document.setDefaultFont(font);
+ document.setDocumentMargin(0.0);
+ if (textWidth >= 0.0)
+ document.setTextWidth(textWidth);
#ifndef QT_NO_TEXTHTMLPARSER
document.setHtml(text);
#else
document.setPlainText(text);
#endif
- QRectF rect = maximumSize.isValid() ? QRectF(pos, maximumSize) : QRectF();
+
document.adjustSize();
p->save();
- p->translate(pos);
- document.drawContents(p, rect);
+ p->translate(topLeftPosition);
+ document.drawContents(p);
p->restore();
+
actualSize = document.size();
- needsClipRect = maximumSize.isValid()
- && (actualSize.width() > maximumSize.width()
- || actualSize.height() > maximumSize.height());
}
}
@@ -614,6 +652,7 @@ void QStaticTextPrivate::init()
paintText(QPointF(0, 0), &painter);
}
+ needsRelayout = false;
}
QT_END_NAMESPACE
diff --git a/src/gui/text/qstatictext.h b/src/gui/text/qstatictext.h
index 00d42e0515..f3bef93f05 100644
--- a/src/gui/text/qstatictext.h
+++ b/src/gui/text/qstatictext.h
@@ -66,7 +66,7 @@ public:
};
QStaticText();
- QStaticText(const QString &text, const QSizeF &maximumSize = QSizeF());
+ QStaticText(const QString &text);
QStaticText(const QStaticText &other);
~QStaticText();
@@ -76,12 +76,12 @@ public:
void setTextFormat(Qt::TextFormat textFormat);
Qt::TextFormat textFormat() const;
- void setMaximumSize(const QSizeF &maximumSize);
- QSizeF maximumSize() const;
+ void setTextWidth(qreal textWidth);
+ qreal textWidth() const;
QSizeF size() const;
- void prepare(const QTransform &matrix, const QFont &font);
+ void prepare(const QTransform &matrix = QTransform(), const QFont &font = QFont());
void setPerformanceHint(PerformanceHint performanceHint);
PerformanceHint performanceHint() const;
diff --git a/src/gui/text/qstatictext_p.h b/src/gui/text/qstatictext_p.h
index e75824468b..f017ed1dcd 100644
--- a/src/gui/text/qstatictext_p.h
+++ b/src/gui/text/qstatictext_p.h
@@ -118,11 +118,16 @@ public:
void init();
void paintText(const QPointF &pos, QPainter *p);
+ void invalidate()
+ {
+ needsRelayout = true;
+ }
+
QAtomicInt ref; // 4 bytes per text
QString text; // 4 bytes per text
QFont font; // 8 bytes per text
- QSizeF maximumSize; // 16 bytes per text
+ qreal textWidth; // 8 bytes per text
QSizeF actualSize; // 16 bytes per text
QPointF position; // 16 bytes per text
@@ -132,11 +137,11 @@ public:
glyph_t *glyphPool; // 4 bytes per text
QFixedPoint *positionPool; // 4 bytes per text
- unsigned char needsClipRect : 1; // 1 byte per text
- unsigned char useBackendOptimizations : 1;
+ unsigned char needsRelayout : 1;
+ unsigned char useBackendOptimizations : 1; // 1 byte per text
unsigned char textFormat : 2;
// ================
- // 171 bytes per text
+ // 163 bytes per text
static QStaticTextPrivate *get(const QStaticText *q);
};
diff --git a/src/gui/widgets/qlabel.cpp b/src/gui/widgets/qlabel.cpp
index b81f04fec6..bdbd0b04ef 100644
--- a/src/gui/widgets/qlabel.cpp
+++ b/src/gui/widgets/qlabel.cpp
@@ -53,6 +53,7 @@
#include <qurl.h>
#include "qlabel_p.h"
#include "private/qstylesheetstyle_p.h"
+#include <qmath.h>
QT_BEGIN_NAMESPACE
@@ -661,7 +662,9 @@ QSize QLabelPrivate::sizeForWidth(int w) const
} else {
control->setTextWidth(-1);
}
- br = QRect(QPoint(0, 0), control->size().toSize());
+
+ QSizeF controlSize = control->size();
+ br = QRect(QPoint(0, 0), QSize(qCeil(controlSize.width()), qCeil(controlSize.height())));
// restore state
control->setTextWidth(oldTextWidth);
diff --git a/src/gui/widgets/qlinecontrol_p.h b/src/gui/widgets/qlinecontrol_p.h
index dd82581e3e..5da1831c71 100644
--- a/src/gui/widgets/qlinecontrol_p.h
+++ b/src/gui/widgets/qlinecontrol_p.h
@@ -94,136 +94,207 @@ public:
delete [] m_maskData;
}
- int nextMaskBlank(int pos);
- int prevMaskBlank(int pos);
+ int nextMaskBlank(int pos)
+ {
+ int c = findInMask(pos, true, false);
+ m_separator |= (c != pos);
+ return (c != -1 ? c : m_maxLength);
+ }
+
+ int prevMaskBlank(int pos)
+ {
+ int c = findInMask(pos, false, false);
+ m_separator |= (c != pos);
+ return (c != -1 ? c : 0);
+ }
+
+ bool isUndoAvailable() const { return !m_readOnly && m_undoState; }
+ bool isRedoAvailable() const { return !m_readOnly && m_undoState < (int)m_history.size(); }
+ void clearUndo() { m_history.clear(); m_modifiedState = m_undoState = 0; }
- bool isUndoAvailable() const;
- bool isRedoAvailable() const;
- void clearUndo();
- bool isModified() const;
- void setModified(bool modified);
+ bool isModified() const { return m_modifiedState != m_undoState; }
+ void setModified(bool modified) { m_modifiedState = modified ? -1 : m_undoState; }
- bool allSelected() const;
- bool hasSelectedText() const;
+ bool allSelected() const { return !m_text.isEmpty() && m_selstart == 0 && m_selend == (int)m_text.length(); }
+ bool hasSelectedText() const { return !m_text.isEmpty() && m_selend > m_selstart; }
- int width() const;
- int height() const;
- int ascent() const;
- qreal naturalTextWidth() const;
+ int width() const { return qRound(m_textLayout.lineAt(0).width()) + 1; }
+ int height() const { return qRound(m_textLayout.lineAt(0).height()) + 1; }
+ int ascent() const { return m_ascent; }
+ qreal naturalTextWidth() const { return m_textLayout.lineAt(0).naturalTextWidth(); }
void setSelection(int start, int length);
- QString selectedText() const;
- QString textBeforeSelection() const;
- QString textAfterSelection() const;
+ inline QString selectedText() const { return hasSelectedText() ? m_text.mid(m_selstart, m_selend - m_selstart) : QString(); }
+ QString textBeforeSelection() const { return hasSelectedText() ? m_text.left(m_selstart) : QString(); }
+ QString textAfterSelection() const { return hasSelectedText() ? m_text.mid(m_selend) : QString(); }
- int selectionStart() const;
- int selectionEnd() const;
- bool inSelection(int x) const;
+ int selectionStart() const { return hasSelectedText() ? m_selstart : -1; }
+ int selectionEnd() const { return hasSelectedText() ? m_selend : -1; }
+ bool inSelection(int x) const
+ {
+ if (m_selstart >= m_selend)
+ return false;
+ int pos = xToPos(x, QTextLine::CursorOnCharacter);
+ return pos >= m_selstart && pos < m_selend;
+ }
- void removeSelection();
+ void removeSelection()
+ {
+ int priorState = m_undoState;
+ removeSelectedText();
+ finishChange(priorState);
+ }
- int start() const;
- int end() const;
+ int start() const { return 0; }
+ int end() const { return m_text.length(); }
#ifndef QT_NO_CLIPBOARD
void copy(QClipboard::Mode mode = QClipboard::Clipboard) const;
void paste(QClipboard::Mode mode = QClipboard::Clipboard);
#endif
- int cursor() const;
- int preeditCursor() const;
+ int cursor() const{ return m_cursor; }
+ int preeditCursor() const { return m_preeditCursor; }
+
+ int cursorWidth() const { return m_cursorWidth; }
+ void setCursorWidth(int value) { m_cursorWidth = value; }
- int cursorWidth() const;
- void setCursorWidth(int value);
void moveCursor(int pos, bool mark = false);
- void cursorForward(bool mark, int steps);
- void cursorWordForward(bool mark);
- void cursorWordBackward(bool mark);
- void home(bool mark);
- void end(bool mark);
+ void cursorForward(bool mark, int steps)
+ {
+ int c = m_cursor;
+ if (steps > 0) {
+ while (steps--)
+ c = m_textLayout.nextCursorPosition(c);
+ } else if (steps < 0) {
+ while (steps++)
+ c = m_textLayout.previousCursorPosition(c);
+ }
+ moveCursor(c, mark);
+ }
+
+ void cursorWordForward(bool mark) { moveCursor(m_textLayout.nextCursorPosition(m_cursor, QTextLayout::SkipWords), mark); }
+ void cursorWordBackward(bool mark) { moveCursor(m_textLayout.previousCursorPosition(m_cursor, QTextLayout::SkipWords), mark); }
+
+ void home(bool mark) { moveCursor(0, mark); }
+ void end(bool mark) { moveCursor(text().length(), mark); }
int xToPos(int x, QTextLine::CursorPosition = QTextLine::CursorBetweenCharacters) const;
QRect cursorRect() const;
- qreal cursorToX(int cursor) const;
- qreal cursorToX() const;
-
- bool isReadOnly() const;
- void setReadOnly(bool enable);
+ qreal cursorToX(int cursor) const { return m_textLayout.lineAt(0).cursorToX(cursor); }
+ qreal cursorToX() const
+ {
+ int cursor = m_cursor;
+ if (m_preeditCursor != -1)
+ cursor += m_preeditCursor;
+ return cursorToX(cursor);
+ }
- QString text() const;
- void setText(const QString &txt);
+ bool isReadOnly() const { return m_readOnly; }
+ void setReadOnly(bool enable) { m_readOnly = enable; }
- QString displayText() const;
+ QString text() const
+ {
+ QString res = m_maskData ? stripString(m_text) : m_text;
+ return (res.isNull() ? QString::fromLatin1("") : res);
+ }
+ void setText(const QString &txt) { internalSetText(txt, -1, false); }
+ QString displayText() const { return m_textLayout.text(); }
void backspace();
void del();
- void deselect();
- void selectAll();
+ void deselect() { internalDeselect(); finishChange(); }
+ void selectAll() { m_selstart = m_selend = m_cursor = 0; moveCursor(m_text.length(), true); }
+
void insert(const QString &);
void clear();
- void undo();
- void redo();
+ void undo() { internalUndo(); finishChange(-1, true); }
+ void redo() { internalRedo(); finishChange(); }
void selectWordAtPos(int);
- uint echoMode() const;
- void setEchoMode(uint mode);
+ uint echoMode() const { return m_echoMode; }
+ void setEchoMode(uint mode)
+ {
+ m_echoMode = mode;
+ m_passwordEchoEditing = false;
+ updateDisplayText();
+ }
- void setMaxLength(int maxLength);
- int maxLength() const;
+ int maxLength() const { return m_maxLength; }
+ void setMaxLength(int maxLength)
+ {
+ if (m_maskData)
+ return;
+ m_maxLength = maxLength;
+ setText(m_text);
+ }
#ifndef QT_NO_VALIDATOR
- const QValidator *validator() const;
- void setValidator(const QValidator *);
+ const QValidator *validator() const { return m_validator; }
+ void setValidator(const QValidator *v) { m_validator = const_cast<QValidator*>(v); }
#endif
#ifndef QT_NO_COMPLETER
- QCompleter *completer() const;
- void setCompleter(const QCompleter*);
+ QCompleter *completer() const { return m_completer; }
+ /* Note that you must set the widget for the completer seperately */
+ void setCompleter(const QCompleter *c) { m_completer = const_cast<QCompleter*>(c); }
void complete(int key);
#endif
- void setCursorPosition(int pos);
- int cursorPosition() const;
+ int cursorPosition() const { return m_cursor; }
+ void setCursorPosition(int pos) { if (pos <= m_text.length()) moveCursor(qMax(0, pos)); }
- bool hasAcceptableInput() const;
+ bool hasAcceptableInput() const { return hasAcceptableInput(m_text); }
bool fixup();
- QString inputMask() const;
- void setInputMask(const QString &mask);
+ QString inputMask() const { return m_maskData ? m_inputMask + QLatin1Char(';') + m_blank : QString(); }
+ void setInputMask(const QString &mask)
+ {
+ parseInputMask(mask);
+ if (m_maskData)
+ moveCursor(nextMaskBlank(0));
+ }
// input methods
#ifndef QT_NO_IM
- bool composeMode() const;
- void setPreeditArea(int cursor, const QString &text);
+ bool composeMode() const { return !m_textLayout.preeditAreaText().isEmpty(); }
+ void setPreeditArea(int cursor, const QString &text) { m_textLayout.setPreeditArea(cursor, text); }
#endif
- QString preeditAreaText() const;
+ QString preeditAreaText() const { return m_textLayout.preeditAreaText(); }
void updatePasswordEchoEditing(bool editing);
- bool passwordEchoEditing() const;
+ bool passwordEchoEditing() const { return m_passwordEchoEditing; }
- QChar passwordCharacter() const;
- void setPasswordCharacter(const QChar &character);
+ QChar passwordCharacter() const { return m_passwordCharacter; }
+ void setPasswordCharacter(const QChar &character) { m_passwordCharacter = character; updateDisplayText(); }
- Qt::LayoutDirection layoutDirection() const;
- void setLayoutDirection(Qt::LayoutDirection direction);
- void setFont(const QFont &font);
+ Qt::LayoutDirection layoutDirection() const { return m_layoutDirection; }
+ void setLayoutDirection(Qt::LayoutDirection direction)
+ {
+ if (direction != m_layoutDirection) {
+ m_layoutDirection = direction;
+ updateDisplayText();
+ }
+ }
+
+ void setFont(const QFont &font) { m_textLayout.setFont(font); updateDisplayText(); }
void processInputMethodEvent(QInputMethodEvent *event);
void processMouseEvent(QMouseEvent* ev);
void processKeyEvent(QKeyEvent* ev);
- int cursorBlinkPeriod() const;
+ int cursorBlinkPeriod() const { return m_blinkPeriod; }
void setCursorBlinkPeriod(int msec);
- QString cancelText() const;
- void setCancelText(const QString &text);
+ QString cancelText() const { return m_cancelText; }
+ void setCancelText(const QString &text) { m_cancelText = text; }
- const QPalette &palette() const;
- void setPalette(const QPalette &);
+ const QPalette &palette() const { return m_palette; }
+ void setPalette(const QPalette &p) { m_palette = p; }
enum DrawFlags {
DrawText = 0x01,
@@ -363,406 +434,6 @@ private Q_SLOTS:
};
-inline int QLineControl::nextMaskBlank(int pos)
-{
- int c = findInMask(pos, true, false);
- m_separator |= (c != pos);
- return (c != -1 ? c : m_maxLength);
-}
-
-inline int QLineControl::prevMaskBlank(int pos)
-{
- int c = findInMask(pos, false, false);
- m_separator |= (c != pos);
- return (c != -1 ? c : 0);
-}
-
-inline bool QLineControl::isUndoAvailable() const
-{
- return !m_readOnly && m_undoState;
-}
-
-inline bool QLineControl::isRedoAvailable() const
-{
- return !m_readOnly && m_undoState < (int)m_history.size();
-}
-
-inline void QLineControl::clearUndo()
-{
- m_history.clear();
- m_modifiedState = m_undoState = 0;
-}
-
-inline bool QLineControl::isModified() const
-{
- return m_modifiedState != m_undoState;
-}
-
-inline void QLineControl::setModified(bool modified)
-{
- m_modifiedState = modified ? -1 : m_undoState;
-}
-
-inline bool QLineControl::allSelected() const
-{
- return !m_text.isEmpty() && m_selstart == 0 && m_selend == (int)m_text.length();
-}
-
-inline bool QLineControl::hasSelectedText() const
-{
- return !m_text.isEmpty() && m_selend > m_selstart;
-}
-
-inline int QLineControl::width() const
-{
- return qRound(m_textLayout.lineAt(0).width()) + 1;
-}
-
-inline qreal QLineControl::naturalTextWidth() const
-{
- return m_textLayout.lineAt(0).naturalTextWidth();
-}
-
-inline int QLineControl::height() const
-{
- return qRound(m_textLayout.lineAt(0).height()) + 1;
-}
-
-inline int QLineControl::ascent() const
-{
- return m_ascent;
-}
-
-inline QString QLineControl::selectedText() const
-{
- if (hasSelectedText())
- return m_text.mid(m_selstart, m_selend - m_selstart);
- return QString();
-}
-
-inline QString QLineControl::textBeforeSelection() const
-{
- if (hasSelectedText())
- return m_text.left(m_selstart);
- return QString();
-}
-
-inline QString QLineControl::textAfterSelection() const
-{
- if (hasSelectedText())
- return m_text.mid(m_selend);
- return QString();
-}
-
-inline int QLineControl::selectionStart() const
-{
- return hasSelectedText() ? m_selstart : -1;
-}
-
-inline int QLineControl::selectionEnd() const
-{
- return hasSelectedText() ? m_selend : -1;
-}
-
-inline int QLineControl::start() const
-{
- return 0;
-}
-
-inline int QLineControl::end() const
-{
- return m_text.length();
-}
-
-inline void QLineControl::removeSelection()
-{
- int priorState = m_undoState;
- removeSelectedText();
- finishChange(priorState);
-}
-
-inline bool QLineControl::inSelection(int x) const
-{
- if (m_selstart >= m_selend)
- return false;
- int pos = xToPos(x, QTextLine::CursorOnCharacter);
- return pos >= m_selstart && pos < m_selend;
-}
-
-inline int QLineControl::cursor() const
-{
- return m_cursor;
-}
-
-inline int QLineControl::preeditCursor() const
-{
- return m_preeditCursor;
-}
-
-inline int QLineControl::cursorWidth() const
-{
- return m_cursorWidth;
-}
-
-inline void QLineControl::setCursorWidth(int value)
-{
- m_cursorWidth = value;
-}
-
-inline void QLineControl::cursorForward(bool mark, int steps)
-{
- int c = m_cursor;
- if (steps > 0) {
- while (steps--)
- c = m_textLayout.nextCursorPosition(c);
- } else if (steps < 0) {
- while (steps++)
- c = m_textLayout.previousCursorPosition(c);
- }
- moveCursor(c, mark);
-}
-
-inline void QLineControl::cursorWordForward(bool mark)
-{
- moveCursor(m_textLayout.nextCursorPosition(m_cursor, QTextLayout::SkipWords), mark);
-}
-
-inline void QLineControl::home(bool mark)
-{
- moveCursor(0, mark);
-}
-
-inline void QLineControl::end(bool mark)
-{
- moveCursor(text().length(), mark);
-}
-
-inline void QLineControl::cursorWordBackward(bool mark)
-{
- moveCursor(m_textLayout.previousCursorPosition(m_cursor, QTextLayout::SkipWords), mark);
-}
-
-inline qreal QLineControl::cursorToX(int cursor) const
-{
- return m_textLayout.lineAt(0).cursorToX(cursor);
-}
-
-inline qreal QLineControl::cursorToX() const
-{
- int cursor = m_cursor;
- if (m_preeditCursor != -1)
- cursor += m_preeditCursor;
- return cursorToX(cursor);
-}
-
-inline bool QLineControl::isReadOnly() const
-{
- return m_readOnly;
-}
-
-inline void QLineControl::setReadOnly(bool enable)
-{
- m_readOnly = enable;
-}
-
-inline QString QLineControl::text() const
-{
- QString res = m_maskData ? stripString(m_text) : m_text;
- return (res.isNull() ? QString::fromLatin1("") : res);
-}
-
-inline void QLineControl::setText(const QString &txt)
-{
- internalSetText(txt, -1, false);
-}
-
-inline QString QLineControl::displayText() const
-{
- return m_textLayout.text();
-}
-
-inline void QLineControl::deselect()
-{
- internalDeselect();
- finishChange();
-}
-
-inline void QLineControl::selectAll()
-{
- m_selstart = m_selend = m_cursor = 0;
- moveCursor(m_text.length(), true);
-}
-
-inline void QLineControl::undo()
-{
- internalUndo();
- finishChange(-1, true);
-}
-
-inline void QLineControl::redo()
-{
- internalRedo();
- finishChange();
-}
-
-inline uint QLineControl::echoMode() const
-{
- return m_echoMode;
-}
-
-inline void QLineControl::setEchoMode(uint mode)
-{
- m_echoMode = mode;
- m_passwordEchoEditing = false;
- updateDisplayText();
-}
-
-inline void QLineControl::setMaxLength(int maxLength)
-{
- if (m_maskData)
- return;
- m_maxLength = maxLength;
- setText(m_text);
-}
-
-inline int QLineControl::maxLength() const
-{
- return m_maxLength;
-}
-
-#ifndef QT_NO_VALIDATOR
-inline const QValidator *QLineControl::validator() const
-{
- return m_validator;
-}
-
-inline void QLineControl::setValidator(const QValidator *v)
-{
- m_validator = const_cast<QValidator*>(v);
-}
-#endif
-
-#ifndef QT_NO_COMPLETER
-inline QCompleter *QLineControl::completer() const
-{
- return m_completer;
-}
-
-/* Note that you must set the widget for the completer seperately */
-inline void QLineControl::setCompleter(const QCompleter* c)
-{
- m_completer = const_cast<QCompleter*>(c);
-}
-#endif
-
-inline void QLineControl::setCursorPosition(int pos)
-{
- if (pos < 0)
- pos = 0;
- if (pos <= m_text.length())
- moveCursor(pos);
-}
-
-inline int QLineControl::cursorPosition() const
-{
- return m_cursor;
-}
-
-inline bool QLineControl::hasAcceptableInput() const
-{
- return hasAcceptableInput(m_text);
-}
-
-inline QString QLineControl::inputMask() const
-{
- return m_maskData ? m_inputMask + QLatin1Char(';') + m_blank : QString();
-}
-
-inline void QLineControl::setInputMask(const QString &mask)
-{
- parseInputMask(mask);
- if (m_maskData)
- moveCursor(nextMaskBlank(0));
-}
-
-// input methods
-#ifndef QT_NO_IM
-inline bool QLineControl::composeMode() const
-{
- return !m_textLayout.preeditAreaText().isEmpty();
-}
-
-inline void QLineControl::setPreeditArea(int cursor, const QString &text)
-{
- m_textLayout.setPreeditArea(cursor, text);
-}
-#endif
-
-inline QString QLineControl::preeditAreaText() const
-{
- return m_textLayout.preeditAreaText();
-}
-
-inline bool QLineControl::passwordEchoEditing() const
-{
- return m_passwordEchoEditing;
-}
-
-inline QChar QLineControl::passwordCharacter() const
-{
- return m_passwordCharacter;
-}
-
-inline void QLineControl::setPasswordCharacter(const QChar &character)
-{
- m_passwordCharacter = character;
- updateDisplayText();
-}
-
-inline Qt::LayoutDirection QLineControl::layoutDirection() const
-{
- return m_layoutDirection;
-}
-
-inline void QLineControl::setLayoutDirection(Qt::LayoutDirection direction)
-{
- if (direction != m_layoutDirection) {
- m_layoutDirection = direction;
- updateDisplayText();
- }
-}
-
-inline void QLineControl::setFont(const QFont &font)
-{
- m_textLayout.setFont(font);
- updateDisplayText();
-}
-
-inline int QLineControl::cursorBlinkPeriod() const
-{
- return m_blinkPeriod;
-}
-
-inline QString QLineControl::cancelText() const
-{
- return m_cancelText;
-}
-
-inline void QLineControl::setCancelText(const QString &text)
-{
- m_cancelText = text;
-}
-
-inline const QPalette & QLineControl::palette() const
-{
- return m_palette;
-}
-
-inline void QLineControl::setPalette(const QPalette &p)
-{
- m_palette = p;
-}
-
QT_END_NAMESPACE
QT_END_HEADER
diff --git a/src/imports/multimedia/qdeclarativeaudio.cpp b/src/imports/multimedia/qdeclarativeaudio.cpp
index 077ed9adc9..8d2dc618b8 100644
--- a/src/imports/multimedia/qdeclarativeaudio.cpp
+++ b/src/imports/multimedia/qdeclarativeaudio.cpp
@@ -51,7 +51,12 @@ QT_BEGIN_NAMESPACE
\since 4.7
\brief The Audio element allows you to add audio playback to a scene.
+ This element is part of the \bold{Qt.multimedia 4.7} module.
+
\qml
+ import Qt 4.6
+ import Qt.multimedia 4.7
+
Audio { source: "audio/song.mp3" }
\endqml
diff --git a/src/imports/multimedia/qdeclarativevideo.cpp b/src/imports/multimedia/qdeclarativevideo.cpp
index c878fe1b11..bf112be885 100644
--- a/src/imports/multimedia/qdeclarativevideo.cpp
+++ b/src/imports/multimedia/qdeclarativevideo.cpp
@@ -73,7 +73,12 @@ void QDeclarativeVideo::_q_error(int errorCode, const QString &errorString)
\brief The Video element allows you to add videos to a scene.
\inherits Item
+ This element is part of the \bold{Qt.multimedia 4.7} module.
+
\qml
+ import Qt 4.6
+ import Qt.multimedia 4.7
+
Video { source: "video/movie.mpg" }
\endqml
diff --git a/src/imports/particles/qdeclarativeparticles.cpp b/src/imports/particles/qdeclarativeparticles.cpp
index e69c2353f9..e98a801c32 100644
--- a/src/imports/particles/qdeclarativeparticles.cpp
+++ b/src/imports/particles/qdeclarativeparticles.cpp
@@ -623,7 +623,7 @@ void QDeclarativeParticlesPrivate::updateOpacity(QDeclarativeParticle &p, int ag
\brief The Particles object generates and moves particles.
\inherits Item
- Particles are available in the Qt.labs.particles 1.0 module.
+ Particles are available in the \bold{Qt.labs.particles 1.0} module.
This element provides preliminary support for particles in QML,
and may be heavily changed or removed in later versions.
diff --git a/src/imports/webkit/qdeclarativewebview.cpp b/src/imports/webkit/qdeclarativewebview.cpp
index 1ff1078194..5db812cf95 100644
--- a/src/imports/webkit/qdeclarativewebview.cpp
+++ b/src/imports/webkit/qdeclarativewebview.cpp
@@ -123,7 +123,7 @@ public:
This type is made available by importing the \c org.webkit module:
- \b{import org.webkit 1.0}
+ \bold{import org.webkit 1.0}
If the width and height of the item is not set, they will
dynamically adjust to a size appropriate for the content.
diff --git a/src/multimedia/audio/qaudiooutput_win32_p.cpp b/src/multimedia/audio/qaudiooutput_win32_p.cpp
index ab8da53eb7..4bcbd09424 100644
--- a/src/multimedia/audio/qaudiooutput_win32_p.cpp
+++ b/src/multimedia/audio/qaudiooutput_win32_p.cpp
@@ -88,7 +88,7 @@ QAudioOutputPrivate::~QAudioOutputPrivate()
DeleteCriticalSection(&waveOutCriticalSection);
}
-void QT_WIN_CALLBACK QAudioOutputPrivate::waveOutProc( HWAVEOUT hWaveOut, UINT uMsg,
+void CALLBACK QAudioOutputPrivate::waveOutProc( HWAVEOUT hWaveOut, UINT uMsg,
DWORD dwInstance, DWORD dwParam1, DWORD dwParam2 )
{
Q_UNUSED(dwParam1)
diff --git a/src/multimedia/effects/qsoundeffect.cpp b/src/multimedia/effects/qsoundeffect.cpp
index ed9ab3fef1..8a38103fef 100644
--- a/src/multimedia/effects/qsoundeffect.cpp
+++ b/src/multimedia/effects/qsoundeffect.cpp
@@ -56,18 +56,25 @@ QT_BEGIN_NAMESPACE
\since 4.7
\brief The SoundEffect element provides a way to play sound effects in qml.
+ This element is part of the \bold{Qt.multimedia 4.7} module.
+
The following example plays a wav file on mouse click.
\qml
- SoundEffect {
- id: playSound
- source: "test.wav"
- }
- MouseArea {
- id: playArea
- anchors.fill: parent
- onPressed: {
- playSound.play()
+ import Qt 4.6
+ import Qt.multimedia 4.7
+
+ Item {
+ SoundEffect {
+ id: playSound
+ source: "test.wav"
+ }
+ MouseArea {
+ id: playArea
+ anchors.fill: parent
+ onPressed: {
+ playSound.play()
+ }
}
}
\endqml
diff --git a/src/network/ssl/qsslsocket_openssl.cpp b/src/network/ssl/qsslsocket_openssl.cpp
index 40107109fb..050fb1b403 100644
--- a/src/network/ssl/qsslsocket_openssl.cpp
+++ b/src/network/ssl/qsslsocket_openssl.cpp
@@ -146,7 +146,7 @@ static void locking_function(int mode, int lockNumber, const char *, int)
}
static unsigned long id_function()
{
- return (unsigned long)QThread::currentThreadId();
+ return (quintptr)QThread::currentThreadId();
}
} // extern "C"
diff --git a/src/opengl/opengl.pro b/src/opengl/opengl.pro
index ff42a49e3c..94733437e4 100644
--- a/src/opengl/opengl.pro
+++ b/src/opengl/opengl.pro
@@ -116,6 +116,7 @@ mac {
LIBS_PRIVATE += -framework AppKit -framework Carbon
}
win32:!wince*: {
+ DEFINES += QT_NO_EGL
SOURCES += qgl_win.cpp \
qglpixelbuffer_win.cpp
}
diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp
index 7aba25af2f..e56b149eab 100644
--- a/src/opengl/qgl.cpp
+++ b/src/opengl/qgl.cpp
@@ -2444,7 +2444,7 @@ QGLTexture *QGLContextPrivate::bindTexture(const QPixmap &pixmap, GLenum target,
if (pd->classId() == QPixmapData::X11Class && pd->pixelType() == QPixmapData::PixmapType
&& xinfo && xinfo->screen() == pixmap.x11Info().screen())
{
- texture = bindTextureFromNativePixmap(pd, key, options);
+ texture = bindTextureFromNativePixmap(const_cast<QPixmap*>(&pixmap), key, options);
if (texture) {
texture->options |= QGLContext::MemoryManagedBindOption;
texture->boundPixmap = pd;
diff --git a/src/opengl/qgl_egl_p.h b/src/opengl/qgl_egl_p.h
index 43793cd16c..85d7f32fa6 100644
--- a/src/opengl/qgl_egl_p.h
+++ b/src/opengl/qgl_egl_p.h
@@ -53,6 +53,7 @@
// We mean it.
//
+#include <QtGui/private/qegl_p.h>
#include <QtGui/private/qeglcontext_p.h>
#include <QtGui/private/qeglproperties_p.h>
diff --git a/src/opengl/qgl_p.h b/src/opengl/qgl_p.h
index dc1e26e23c..1f28b08210 100644
--- a/src/opengl/qgl_p.h
+++ b/src/opengl/qgl_p.h
@@ -361,7 +361,7 @@ public:
quint32 gpm;
int screen;
QHash<QPixmapData*, QPixmap> boundPixmaps;
- QGLTexture *bindTextureFromNativePixmap(QPixmapData*, const qint64 key,
+ QGLTexture *bindTextureFromNativePixmap(QPixmap*, const qint64 key,
QGLContext::BindOptions options);
static void destroyGlSurfaceForPixmap(QPixmapData*);
static void unbindPixmapFromTexture(QPixmapData*);
diff --git a/src/opengl/qgl_x11.cpp b/src/opengl/qgl_x11.cpp
index 4fa1467faf..e1a202f4d4 100644
--- a/src/opengl/qgl_x11.cpp
+++ b/src/opengl/qgl_x11.cpp
@@ -1671,7 +1671,7 @@ static bool qt_resolveTextureFromPixmap(QPaintDevice *paintDevice)
#endif //defined(GLX_VERSION_1_3) && !defined(Q_OS_HPUX)
-QGLTexture *QGLContextPrivate::bindTextureFromNativePixmap(QPixmapData *pmd, const qint64 key,
+QGLTexture *QGLContextPrivate::bindTextureFromNativePixmap(QPixmap *pixmap, const qint64 key,
QGLContext::BindOptions options)
{
#if !defined(GLX_VERSION_1_3) || defined(Q_OS_HPUX)
@@ -1679,12 +1679,12 @@ QGLTexture *QGLContextPrivate::bindTextureFromNativePixmap(QPixmapData *pmd, con
#else
Q_Q(QGLContext);
- Q_ASSERT(pmd->classId() == QPixmapData::X11Class);
+ QX11PixmapData *pixmapData = static_cast<QX11PixmapData*>(pixmap->data_ptr().data());
+ Q_ASSERT(pixmapData->classId() == QPixmapData::X11Class);
if (!qt_resolveTextureFromPixmap(paintDevice))
return 0;
- QX11PixmapData *pixmapData = static_cast<QX11PixmapData*>(pmd);
const QX11Info &x11Info = pixmapData->xinfo;
// Store the configs (Can be static because configs aren't dependent on current context)
diff --git a/src/opengl/qgl_x11egl.cpp b/src/opengl/qgl_x11egl.cpp
index 0954e69471..af0100b588 100644
--- a/src/opengl/qgl_x11egl.cpp
+++ b/src/opengl/qgl_x11egl.cpp
@@ -354,7 +354,7 @@ void QGLWidgetPrivate::recreateEglSurface(bool force)
}
-QGLTexture *QGLContextPrivate::bindTextureFromNativePixmap(QPixmapData* pd, const qint64 key,
+QGLTexture *QGLContextPrivate::bindTextureFromNativePixmap(QPixmap *pixmap, const qint64 key,
QGLContext::BindOptions options)
{
Q_Q(QGLContext);
@@ -363,10 +363,33 @@ QGLTexture *QGLContextPrivate::bindTextureFromNativePixmap(QPixmapData* pd, cons
if (!(options & QGLContext::CanFlipNativePixmapBindOption))
return 0;
- Q_ASSERT(pd->classId() == QPixmapData::X11Class);
static bool checkedForTFP = false;
static bool haveTFP = false;
+ static bool checkedForEglImageTFP = false;
+ static bool haveEglImageTFP = false;
+
+
+ if (!checkedForEglImageTFP) {
+ checkedForEglImageTFP = true;
+
+ // We need to be able to create an EGLImage from a native pixmap, which was split
+ // into a seperate EGL extension, EGL_KHR_image_pixmap. It is possible to have
+ // eglCreateImageKHR & eglDestroyImageKHR without support for pixmaps, so we must
+ // check we have the EGLImage from pixmap functionality.
+ if (QEgl::hasExtension("EGL_KHR_image") || QEgl::hasExtension("EGL_KHR_image_pixmap")) {
+ Q_ASSERT(eglCreateImageKHR);
+ Q_ASSERT(eglDestroyImageKHR);
+
+ // Being able to create an EGLImage from a native pixmap is also pretty useless
+ // without the ability to bind that EGLImage as a texture, which is provided by
+ // the GL_OES_EGL_image extension, which we try to resolve here:
+ haveEglImageTFP = qt_resolve_eglimage_gl_extensions(q);
+
+ if (haveEglImageTFP)
+ qDebug("Found EGL_KHR_image_pixmap & GL_OES_EGL_image extensions (preferred method)!");
+ }
+ }
if (!checkedForTFP) {
// Check for texture_from_pixmap egl extension
@@ -379,61 +402,111 @@ QGLTexture *QGLContextPrivate::bindTextureFromNativePixmap(QPixmapData* pd, cons
}
}
- if (!haveTFP)
+ if (!haveTFP && !haveEglImageTFP)
return 0;
- QX11PixmapData *pixmapData = static_cast<QX11PixmapData*>(pd);
+ QX11PixmapData *pixmapData = static_cast<QX11PixmapData*>(pixmap->data_ptr().data());
+ Q_ASSERT(pixmapData->classId() == QPixmapData::X11Class);
bool hasAlpha = pixmapData->hasAlphaChannel();
+ bool pixmapHasValidSurface = false;
+ bool textureIsBound = false;
+ GLuint textureId;
+ glGenTextures(1, &textureId);
+ glBindTexture(GL_TEXTURE_2D, textureId);
- // Check to see if the surface is still valid
- if (pixmapData->gl_surface &&
- hasAlpha != (pixmapData->flags & QX11PixmapData::GlSurfaceCreatedWithAlpha))
+ if (haveTFP && pixmapData->gl_surface &&
+ hasAlpha == (pixmapData->flags & QX11PixmapData::GlSurfaceCreatedWithAlpha))
{
- // Surface is invalid!
- destroyGlSurfaceForPixmap(pixmapData);
+ pixmapHasValidSurface = true;
+ }
+
+ // If we already have a valid EGL surface for the pixmap, we should use it
+ if (pixmapHasValidSurface) {
+ EGLBoolean success;
+ success = eglBindTexImage(QEgl::display(), (EGLSurface)pixmapData->gl_surface, EGL_BACK_BUFFER);
+ if (success == EGL_FALSE) {
+ qWarning() << "eglBindTexImage() failed:" << QEgl::errorString();
+ eglDestroySurface(QEgl::display(), (EGLSurface)pixmapData->gl_surface);
+ pixmapData->gl_surface = (void*)EGL_NO_SURFACE;
+ } else
+ textureIsBound = true;
}
- if (pixmapData->gl_surface == 0) {
- EGLConfig config = QEgl::defaultConfig(QInternal::Pixmap,
- QEgl::OpenGL,
- hasAlpha ? QEgl::Translucent : QEgl::NoOptions);
+ // If the pixmap doesn't already have a valid surface, try binding it via EGLImage
+ // first, as going through EGLImage should be faster and better supported:
+ if (!textureIsBound && haveEglImageTFP) {
+ Q_ASSERT(eglCreateImageKHR);
- QPixmap tmpPixmap(pixmapData); //###
- pixmapData->gl_surface = (void*)QEgl::createSurface(&tmpPixmap, config);
- if (pixmapData->gl_surface == (void*)EGL_NO_SURFACE) {
- haveTFP = false;
- return 0;
- }
+ EGLImageKHR eglImage;
+
+ EGLint attribs[] = {
+ EGL_IMAGE_PRESERVED_KHR, EGL_TRUE,
+ EGL_NONE
+ };
+ eglImage = eglCreateImageKHR(QEgl::display(), EGL_NO_CONTEXT, EGL_NATIVE_PIXMAP_KHR,
+ (EGLClientBuffer)QEgl::nativePixmap(pixmap), attribs);
+
+ QGLContext* ctx = q;
+ glEGLImageTargetTexture2DOES(GL_TEXTURE_2D, eglImage);
+
+ GLint err = glGetError();
+ if (err == GL_NO_ERROR)
+ textureIsBound = true;
+
+ // Once the egl image is bound, the texture becomes a new sibling image and we can safely
+ // destroy the EGLImage we created for the pixmap:
+ if (eglImage != EGL_NO_IMAGE_KHR)
+ eglDestroyImageKHR(QEgl::display(), eglImage);
}
- Q_ASSERT(pixmapData->gl_surface);
+ if (!textureIsBound && haveTFP) {
+ // Check to see if the surface is still valid
+ if (pixmapData->gl_surface &&
+ hasAlpha != (pixmapData->flags & QX11PixmapData::GlSurfaceCreatedWithAlpha))
+ {
+ // Surface is invalid!
+ destroyGlSurfaceForPixmap(pixmapData);
+ }
- GLuint textureId;
- glGenTextures(1, &textureId);
- glBindTexture(GL_TEXTURE_2D, textureId);
+ if (pixmapData->gl_surface == 0) {
+ EGLConfig config = QEgl::defaultConfig(QInternal::Pixmap,
+ QEgl::OpenGL,
+ hasAlpha ? QEgl::Translucent : QEgl::NoOptions);
- // bind the egl pixmap surface to a texture
- EGLBoolean success;
- success = eglBindTexImage(eglContext->display(), (EGLSurface)pixmapData->gl_surface, EGL_BACK_BUFFER);
- if (success == EGL_FALSE) {
- qWarning() << "eglBindTexImage() failed:" << QEgl::errorString();
- eglDestroySurface(eglContext->display(), (EGLSurface)pixmapData->gl_surface);
- pixmapData->gl_surface = (void*)EGL_NO_SURFACE;
- haveTFP = false;
- return 0;
+ pixmapData->gl_surface = (void*)QEgl::createSurface(pixmap, config);
+ if (pixmapData->gl_surface == (void*)EGL_NO_SURFACE)
+ return false;
+ }
+
+ EGLBoolean success;
+ success = eglBindTexImage(QEgl::display(), (EGLSurface)pixmapData->gl_surface, EGL_BACK_BUFFER);
+ if (success == EGL_FALSE) {
+ qWarning() << "eglBindTexImage() failed:" << QEgl::errorString();
+ eglDestroySurface(QEgl::display(), (EGLSurface)pixmapData->gl_surface);
+ pixmapData->gl_surface = (void*)EGL_NO_SURFACE;
+ haveTFP = false; // If TFP isn't working, disable it's use
+ } else
+ textureIsBound = true;
}
- QGLTexture *texture = new QGLTexture(q, textureId, GL_TEXTURE_2D, options);
- pixmapData->flags |= QX11PixmapData::InvertedWhenBoundToTexture;
+ QGLTexture *texture = 0;
- // We assume the cost of bound pixmaps is zero
- QGLTextureCache::instance()->insert(q, key, texture, 0);
+ if (textureIsBound) {
+ texture = new QGLTexture(q, textureId, GL_TEXTURE_2D, options);
+ pixmapData->flags |= QX11PixmapData::InvertedWhenBoundToTexture;
+
+ // We assume the cost of bound pixmaps is zero
+ QGLTextureCache::instance()->insert(q, key, texture, 0);
+
+ glBindTexture(GL_TEXTURE_2D, textureId);
+ } else
+ glDeleteTextures(1, &textureId);
- glBindTexture(GL_TEXTURE_2D, textureId);
return texture;
}
+
void QGLContextPrivate::destroyGlSurfaceForPixmap(QPixmapData* pmd)
{
Q_ASSERT(pmd->classId() == QPixmapData::X11Class);
diff --git a/src/opengl/qglextensions.cpp b/src/opengl/qglextensions.cpp
index 02d55014f4..ef3c4cd26a 100644
--- a/src/opengl/qglextensions.cpp
+++ b/src/opengl/qglextensions.cpp
@@ -222,6 +222,17 @@ bool qt_resolve_buffer_extensions(QGLContext *ctx)
#endif
}
+#ifndef QT_NO_EGL
+bool qt_resolve_eglimage_gl_extensions(QGLContext *ctx)
+{
+ if (glEGLImageTargetTexture2DOES || glEGLImageTargetRenderbufferStorageOES)
+ return true;
+ glEGLImageTargetTexture2DOES = (_glEGLImageTargetTexture2DOES) ctx->getProcAddress(QLatin1String("glEGLImageTargetTexture2DOES"));
+ glEGLImageTargetRenderbufferStorageOES = (_glEGLImageTargetRenderbufferStorageOES) ctx->getProcAddress(QLatin1String("glEGLImageTargetRenderbufferStorageOES"));
+ return glEGLImageTargetTexture2DOES && glEGLImageTargetRenderbufferStorageOES;
+}
+#endif
+
bool qt_resolve_glsl_extensions(QGLContext *ctx)
{
// Geometry shaders are optional...
diff --git a/src/opengl/qglextensions_p.h b/src/opengl/qglextensions_p.h
index f6926f320f..7597b33a17 100644
--- a/src/opengl/qglextensions_p.h
+++ b/src/opengl/qglextensions_p.h
@@ -68,6 +68,11 @@
# define APIENTRYP *
#endif
+#ifndef QT_NO_EGL
+// Needed for EGLImageKHR definition:
+#include <QtGui/private/qegl_p.h>
+#endif
+
#include <QtCore/qglobal.h>
#ifndef GL_ARB_vertex_buffer_object
@@ -210,6 +215,14 @@ typedef void (APIENTRY *_glFramebufferTextureFaceEXT)(GLenum target, GLenum atta
typedef void (APIENTRY *_glCompressedTexImage2DARB) (GLenum, GLint, GLenum, GLsizei,
GLsizei, GLint, GLsizei, const GLvoid *);
+#ifndef QT_NO_EGL
+// OES_EGL_image
+// Note: We define these to take EGLImage whereas spec says they take a new GLeglImageOES
+// type, which the EGL image should be cast to.
+typedef void (APIENTRY *_glEGLImageTargetTexture2DOES) (GLenum, EGLImageKHR);
+typedef void (APIENTRY *_glEGLImageTargetRenderbufferStorageOES) (GLenum, EGLImageKHR);
+#endif
+
QT_BEGIN_NAMESPACE
struct QGLExtensionFuncs
@@ -327,6 +340,12 @@ struct QGLExtensionFuncs
// Texture compression
qt_glCompressedTexImage2DARB = 0;
#endif
+
+#ifndef QT_NO_EGL
+ // OES_EGL_image
+ qt_glEGLImageTargetTexture2DOES = 0;
+ qt_glEGLImageTargetRenderbufferStorageOES = 0;
+#endif
}
@@ -447,6 +466,13 @@ struct QGLExtensionFuncs
// Texture compression
_glCompressedTexImage2DARB qt_glCompressedTexImage2DARB;
#endif
+
+#ifndef QT_NO_EGL
+ // OES_EGL_image
+ _glEGLImageTargetTexture2DOES qt_glEGLImageTargetTexture2DOES;
+ _glEGLImageTargetRenderbufferStorageOES qt_glEGLImageTargetRenderbufferStorageOES;
+#endif
+
};
@@ -839,6 +865,12 @@ struct QGLExtensionFuncs
#define glCompressedTexImage2D QGLContextPrivate::extensionFuncs(ctx).qt_glCompressedTexImage2DARB
#endif
+#ifndef QT_NO_EGL
+// OES_EGL_image
+#define glEGLImageTargetTexture2DOES QGLContextPrivate::extensionFuncs(ctx).qt_glEGLImageTargetTexture2DOES
+#define glEGLImageTargetRenderbufferStorageOES QGLContextPrivate::extensionFuncs(ctx).qt_glEGLImageTargetRenderbufferStorageOES
+#endif
+
extern bool qt_resolve_framebufferobject_extensions(QGLContext *ctx);
bool qt_resolve_buffer_extensions(QGLContext *ctx);
@@ -849,6 +881,10 @@ bool qt_resolve_frag_program_extensions(QGLContext *ctx);
bool qt_resolve_glsl_extensions(QGLContext *ctx);
+#ifndef QT_NO_EGL
+bool qt_resolve_eglimage_gl_extensions(QGLContext *ctx);
+#endif
+
QT_END_NAMESPACE
#endif // QGL_EXTENSIONS_P_H
diff --git a/src/openvg/qpixmapdata_vg.cpp b/src/openvg/qpixmapdata_vg.cpp
index ab8f26df60..5c4f41b6b3 100644
--- a/src/openvg/qpixmapdata_vg.cpp
+++ b/src/openvg/qpixmapdata_vg.cpp
@@ -42,6 +42,7 @@
#include "qpixmapdata_vg_p.h"
#include "qpaintengine_vg_p.h"
#include <QtGui/private/qdrawhelper_p.h>
+#include <QtGui/private/qegl_p.h>
#include "qvg_p.h"
#include "qvgimagepool_p.h"
@@ -51,8 +52,6 @@
#endif
#ifdef QT_SYMBIAN_SUPPORTS_SGIMAGE
#include <sgresource/sgimage.h>
-typedef EGLImageKHR (*pfnEglCreateImageKHR)(EGLDisplay, EGLContext, EGLenum, EGLClientBuffer, EGLint*);
-typedef EGLBoolean (*pfnEglDestroyImageKHR)(EGLDisplay, EGLImageKHR);
typedef VGImage (*pfnVgCreateEGLImageTargetKHR)(VGeglImageKHR);
#endif // QT_SYMBIAN_SUPPORTS_SGIMAGE
@@ -488,11 +487,9 @@ void QVGPixmapData::fromNativeType(void* pixmap, NativeType type)
return;
}
- pfnEglCreateImageKHR eglCreateImageKHR = (pfnEglCreateImageKHR) eglGetProcAddress("eglCreateImageKHR");
- pfnEglDestroyImageKHR eglDestroyImageKHR = (pfnEglDestroyImageKHR) eglGetProcAddress("eglDestroyImageKHR");
pfnVgCreateEGLImageTargetKHR vgCreateEGLImageTargetKHR = (pfnVgCreateEGLImageTargetKHR) eglGetProcAddress("vgCreateEGLImageTargetKHR");
- if (eglGetError() != EGL_SUCCESS || !eglCreateImageKHR || !eglDestroyImageKHR || !vgCreateEGLImageTargetKHR) {
+ if (eglGetError() != EGL_SUCCESS || !(QEgl::hasExtension("EGL_KHR_image") || QEgl::hasExtension("EGL_KHR_image_pixmap")) || !vgCreateEGLImageTargetKHR) {
cleanup();
driver.Close();
return;
@@ -606,11 +603,9 @@ void* QVGPixmapData::toNativeType(NativeType type)
return 0;
}
- pfnEglCreateImageKHR eglCreateImageKHR = (pfnEglCreateImageKHR) eglGetProcAddress("eglCreateImageKHR");
- pfnEglDestroyImageKHR eglDestroyImageKHR = (pfnEglDestroyImageKHR) eglGetProcAddress("eglDestroyImageKHR");
pfnVgCreateEGLImageTargetKHR vgCreateEGLImageTargetKHR = (pfnVgCreateEGLImageTargetKHR) eglGetProcAddress("vgCreateEGLImageTargetKHR");
- if (eglGetError() != EGL_SUCCESS || !eglCreateImageKHR || !eglDestroyImageKHR || !vgCreateEGLImageTargetKHR) {
+ if (eglGetError() != EGL_SUCCESS || !(QEgl::hasExtension("EGL_KHR_image") || QEgl::hasExtension("EGL_KHR_image_pixmap")) || !vgCreateEGLImageTargetKHR) {
driver.Close();
return 0;
}
diff --git a/src/plugins/imageformats/svg/main.cpp b/src/plugins/imageformats/svg/main.cpp
index dbbd3b75fd..329e9d4baa 100644
--- a/src/plugins/imageformats/svg/main.cpp
+++ b/src/plugins/imageformats/svg/main.cpp
@@ -62,26 +62,18 @@ public:
QStringList QSvgPlugin::keys() const
{
- return QStringList() << QLatin1String("svg");
+ return QStringList() << QLatin1String("svg") << QLatin1String("svgz");
}
QImageIOPlugin::Capabilities QSvgPlugin::capabilities(QIODevice *device, const QByteArray &format) const
{
- //### canRead disabled for now because it's hard to detect
- // whether the file is actually svg without parsing it
- //if (device->isReadable() && QSvgIOHandler::canRead(device))
-
- if (format == "svg")
+ if (format == "svg" || format == "svgz")
return Capabilities(CanRead);
- else
- return 0;
-
-
- if (!device->isOpen())
+ if (!format.isEmpty())
return 0;
Capabilities cap;
- if (device->isReadable())
+ if (device->isReadable() && QSvgIOHandler::canRead(device))
cap |= CanRead;
return cap;
}
diff --git a/src/plugins/imageformats/svg/qsvgiohandler.cpp b/src/plugins/imageformats/svg/qsvgiohandler.cpp
index f3670c6ebc..81555692b8 100644
--- a/src/plugins/imageformats/svg/qsvgiohandler.cpp
+++ b/src/plugins/imageformats/svg/qsvgiohandler.cpp
@@ -48,6 +48,7 @@
#include "qpixmap.h"
#include "qpainter.h"
#include "qvariant.h"
+#include "qbuffer.h"
#include "qdebug.h"
QT_BEGIN_NAMESPACE
@@ -55,67 +56,54 @@ QT_BEGIN_NAMESPACE
class QSvgIOHandlerPrivate
{
public:
- QSvgIOHandlerPrivate()
- : r(new QSvgRenderer()), loaded(false)
+ QSvgIOHandlerPrivate(QSvgIOHandler *qq)
+ : q(qq), loaded(false), readDone(false), backColor(Qt::transparent)
{}
- ~QSvgIOHandlerPrivate()
- {
- delete r;
- }
bool load(QIODevice *device);
- static bool findSvgTag(QIODevice *device);
- QSvgRenderer *r;
- QSize defaultSize;
- QSize currentSize;
- bool loaded;
+ QSvgIOHandler *q;
+ QSvgRenderer r;
+ QXmlStreamReader xmlReader;
+ QSize defaultSize;
+ QRect clipRect;
+ QSize scaledSize;
+ QRect scaledClipRect;
+ bool loaded;
+ bool readDone;
+ QColor backColor;
};
+
bool QSvgIOHandlerPrivate::load(QIODevice *device)
{
if (loaded)
return true;
+ if (q->format().isEmpty())
+ q->canRead();
+
+ bool res = false;
+ QBuffer *buf = qobject_cast<QBuffer *>(device);
+ if (buf) {
+ res = r.load(buf->data());
+ } else if (q->format() == "svgz") {
+ res = r.load(device->readAll()); // ### can't stream svgz
+ } else {
+ xmlReader.setDevice(device);
+ res = r.load(&xmlReader); //### doesn't leave pos() correctly
+ }
- if (r->load(device->readAll())) {
- defaultSize = QSize(r->viewBox().width(), r->viewBox().height());
- if (currentSize.isEmpty())
- currentSize = defaultSize;
+ if (res) {
+ defaultSize = QSize(r.viewBox().width(), r.viewBox().height());
+ loaded = true;
}
- loaded = r->isValid();
return loaded;
}
-bool QSvgIOHandlerPrivate::findSvgTag(QIODevice *device)
-{
- qint64 pos = device->pos();
- device->seek(0);
- char buffer[256];
- const char svg_tag[] = "<svg";
-
- while (1) {
- int size = device->read(buffer, 256);
- for (int i=0; i<size - 5; ++i) {
- if (!memcmp(buffer + i, svg_tag, 4)) {
- if (buffer[i+4] == ' ' || buffer[i+4] == '\t'
- || buffer[i+4] == '\n' || buffer[i+4] == '\r')
- {
- device->seek(pos);
- return true;
- }
- }
- }
- if (device->atEnd())
- break;
- device->seek(device->pos()-4);
- }
- device->seek(pos);
- return false;
-}
QSvgIOHandler::QSvgIOHandler()
- : d(new QSvgIOHandlerPrivate())
+ : d(new QSvgIOHandlerPrivate(this))
{
}
@@ -129,7 +117,20 @@ QSvgIOHandler::~QSvgIOHandler()
bool QSvgIOHandler::canRead() const
{
- return QSvgIOHandlerPrivate::findSvgTag(device());
+ if (!device())
+ return false;
+ if (d->loaded && !d->readDone)
+ return true; // Will happen if we have been asked for the size
+
+ QByteArray buf = device()->peek(8);
+ if (buf.startsWith("\x1f\x8b")) {
+ setFormat("svgz");
+ return true;
+ } else if (buf.contains("<?xml") || buf.contains("<svg")) {
+ setFormat("svg");
+ return true;
+ }
+ return false;
}
@@ -141,14 +142,41 @@ QByteArray QSvgIOHandler::name() const
bool QSvgIOHandler::read(QImage *image)
{
- if (d->load(device())) {
- *image = QImage(d->currentSize, QImage::Format_ARGB32_Premultiplied);
- if (!d->currentSize.isEmpty()) {
- image->fill(0x00000000);
+ if (!d->readDone && d->load(device())) {
+ bool xform = (d->clipRect.isValid() || d->scaledSize.isValid() || d->scaledClipRect.isValid());
+ QSize finalSize = d->defaultSize;
+ QRectF bounds;
+ if (xform && !d->defaultSize.isEmpty()) {
+ bounds = QRectF(QPointF(0,0), QSizeF(d->defaultSize));
+ QPoint tr1, tr2;
+ QSizeF sc(1, 1);
+ if (d->clipRect.isValid()) {
+ tr1 = -d->clipRect.topLeft();
+ finalSize = d->clipRect.size();
+ }
+ if (d->scaledSize.isValid()) {
+ sc = QSizeF(qreal(d->scaledSize.width()) / finalSize.width(),
+ qreal(d->scaledSize.height()) / finalSize.height());
+ finalSize = d->scaledSize;
+ }
+ if (d->scaledClipRect.isValid()) {
+ tr2 = -d->scaledClipRect.topLeft();
+ finalSize = d->scaledClipRect.size();
+ }
+ QTransform t;
+ t.translate(tr2.x(), tr2.y());
+ t.scale(sc.width(), sc.height());
+ t.translate(tr1.x(), tr1.y());
+ bounds = t.mapRect(bounds);
+ }
+ *image = QImage(finalSize, QImage::Format_ARGB32_Premultiplied);
+ if (!finalSize.isEmpty()) {
+ image->fill(d->backColor.rgba());
QPainter p(image);
- d->r->render(&p);
+ d->r.render(&p, bounds);
p.end();
}
+ d->readDone = true;
return true;
}
@@ -166,8 +194,17 @@ QVariant QSvgIOHandler::option(ImageOption option) const
d->load(device());
return d->defaultSize;
break;
+ case ClipRect:
+ return d->clipRect;
+ break;
case ScaledSize:
- return d->currentSize;
+ return d->scaledSize;
+ break;
+ case ScaledClipRect:
+ return d->scaledClipRect;
+ break;
+ case BackgroundColor:
+ return d->backColor;
break;
default:
break;
@@ -179,12 +216,17 @@ QVariant QSvgIOHandler::option(ImageOption option) const
void QSvgIOHandler::setOption(ImageOption option, const QVariant & value)
{
switch(option) {
- case Size:
- d->defaultSize = value.toSize();
- d->currentSize = value.toSize();
+ case ClipRect:
+ d->clipRect = value.toRect();
break;
case ScaledSize:
- d->currentSize = value.toSize();
+ d->scaledSize = value.toSize();
+ break;
+ case ScaledClipRect:
+ d->scaledClipRect = value.toRect();
+ break;
+ case BackgroundColor:
+ d->backColor = value.value<QColor>();
break;
default:
break;
@@ -198,7 +240,10 @@ bool QSvgIOHandler::supportsOption(ImageOption option) const
{
case ImageFormat:
case Size:
+ case ClipRect:
case ScaledSize:
+ case ScaledClipRect:
+ case BackgroundColor:
return true;
default:
break;
@@ -206,9 +251,11 @@ bool QSvgIOHandler::supportsOption(ImageOption option) const
return false;
}
+
bool QSvgIOHandler::canRead(QIODevice *device)
{
- return QSvgIOHandlerPrivate::findSvgTag(device);
+ QByteArray buf = device->peek(8);
+ return buf.startsWith("\x1f\x8b") || buf.contains("<?xml") || buf.contains("<svg");
}
QT_END_NAMESPACE
diff --git a/src/plugins/imageformats/tiff/qtiffhandler.cpp b/src/plugins/imageformats/tiff/qtiffhandler.cpp
index 31e0c92970..619aa4ee26 100644
--- a/src/plugins/imageformats/tiff/qtiffhandler.cpp
+++ b/src/plugins/imageformats/tiff/qtiffhandler.cpp
@@ -385,8 +385,8 @@ static bool checkGrayscale(const QVector<QRgb> &colorTable)
const bool increasing = (colorTable.at(0) == 0xff000000);
for (int i = 0; i < 256; ++i) {
- if (increasing && colorTable.at(i) != qRgb(i, i, i)
- || !increasing && colorTable.at(i) != qRgb(255 - i, 255 - i, 255 - i))
+ if ((increasing && colorTable.at(i) != qRgb(i, i, i))
+ || (!increasing && colorTable.at(i) != qRgb(255 - i, 255 - i, 255 - i)))
return false;
}
return true;
diff --git a/src/script/api/qscriptengine.cpp b/src/script/api/qscriptengine.cpp
index 3e5249a1df..13b8e7c24f 100644
--- a/src/script/api/qscriptengine.cpp
+++ b/src/script/api/qscriptengine.cpp
@@ -875,7 +875,7 @@ QScriptEnginePrivate::QScriptEnginePrivate()
return;
}
JSC::initializeThreading();
-
+ JSC::IdentifierTable *oldTable = JSC::currentIdentifierTable();
globalData = JSC::JSGlobalData::create().releaseRef();
globalData->clientData = new QScript::GlobalClientData(this);
JSC::JSGlobalObject *globalObject = new (globalData)QScript::GlobalObject();
@@ -911,6 +911,7 @@ QScriptEnginePrivate::QScriptEnginePrivate()
activeAgent = 0;
agentLineNumber = -1;
processEventsInterval = -1;
+ JSC::setCurrentIdentifierTable(oldTable);
}
QScriptEnginePrivate::~QScriptEnginePrivate()
@@ -3311,8 +3312,12 @@ bool QScriptEngine::convertV2(const QScriptValue &value, int type, void *ptr)
if (vp) {
switch (vp->type) {
case QScriptValuePrivate::JavaScriptCore: {
- JSC::ExecState *exec = vp->engine ? vp->engine->currentFrame : 0;
- return QScriptEnginePrivate::convertValue(exec, vp->jscValue, type, ptr);
+ if (vp->engine) {
+ QScript::APIShim shim(vp->engine);
+ return QScriptEnginePrivate::convertValue(vp->engine->currentFrame, vp->jscValue, type, ptr);
+ } else {
+ return QScriptEnginePrivate::convertValue(0, vp->jscValue, type, ptr);
+ }
}
case QScriptValuePrivate::Number:
return QScriptEnginePrivate::convertNumber(vp->numberValue, type, ptr);
diff --git a/src/script/api/qscriptprogram.cpp b/src/script/api/qscriptprogram.cpp
index d4a32f4e07..8d4de1150a 100644
--- a/src/script/api/qscriptprogram.cpp
+++ b/src/script/api/qscriptprogram.cpp
@@ -120,7 +120,7 @@ QScriptProgram::QScriptProgram(const QScriptProgram &other)
*/
QScriptProgram::~QScriptProgram()
{
- Q_D(QScriptProgram);
+ // Q_D(QScriptProgram);
// if (d->engine && (d->ref == 1))
// d->engine->unregisterScriptProgram(d);
}
diff --git a/src/script/api/qscriptstring.cpp b/src/script/api/qscriptstring.cpp
index d0b0ffd829..8c7c30c7af 100644
--- a/src/script/api/qscriptstring.cpp
+++ b/src/script/api/qscriptstring.cpp
@@ -94,7 +94,7 @@ QScriptString::~QScriptString()
case QScriptStringPrivate::HeapAllocated:
if (d->engine && (d->ref == 1)) {
// Make sure the identifier is removed from the correct engine.
- QScript::APIShim(d->engine);
+ QScript::APIShim shim(d->engine);
d->identifier = JSC::Identifier();
d->engine->unregisterScriptString(d);
}
diff --git a/src/script/api/qscriptvalue.cpp b/src/script/api/qscriptvalue.cpp
index 4cd84a4a4a..7469f9a85d 100644
--- a/src/script/api/qscriptvalue.cpp
+++ b/src/script/api/qscriptvalue.cpp
@@ -561,6 +561,7 @@ QScriptValue QScriptValue::scope() const
Q_D(const QScriptValue);
if (!d || !d->isObject())
return QScriptValue();
+ QScript::APIShim shim(d->engine);
// ### make hidden property
JSC::JSValue result = d->property("__qt_scope__", QScriptValue::ResolveLocal);
return d->engine->scriptValueFromJSCValue(result);
@@ -650,11 +651,12 @@ static Type type(const QScriptValue &v)
return Object;
}
-QScriptValue ToPrimitive(const QScriptValue &object, JSC::PreferredPrimitiveType hint = JSC::NoPreference)
+static QScriptValue ToPrimitive(const QScriptValue &object, JSC::PreferredPrimitiveType hint = JSC::NoPreference)
{
Q_ASSERT(object.isObject());
QScriptValuePrivate *pp = QScriptValuePrivate::get(object);
Q_ASSERT(pp->engine != 0);
+ QScript::APIShim shim(pp->engine);
JSC::ExecState *exec = pp->engine->currentFrame;
JSC::JSValue savedException;
QScriptEnginePrivate::saveException(exec, &savedException);
@@ -848,6 +850,7 @@ bool QScriptValue::equals(const QScriptValue &other) const
if (!eng_p)
eng_p = other.d_ptr->engine;
if (eng_p) {
+ QScript::APIShim shim(eng_p);
JSC::ExecState *exec = eng_p->currentFrame;
JSC::JSValue savedException;
QScriptEnginePrivate::saveException(exec, &savedException);
@@ -940,9 +943,12 @@ QString QScriptValue::toString() const
return QString();
switch (d->type) {
case QScriptValuePrivate::JavaScriptCore: {
- JSC::ExecState *exec = d->engine ? d->engine->currentFrame : 0;
- return QScriptEnginePrivate::toString(exec, d->jscValue);
- }
+ if (d->engine) {
+ QScript::APIShim shim(d->engine);
+ return QScriptEnginePrivate::toString(d->engine->currentFrame, d->jscValue);
+ } else {
+ return QScriptEnginePrivate::toString(0, d->jscValue);
+ } }
case QScriptValuePrivate::Number:
return QScript::ToString(d->numberValue);
case QScriptValuePrivate::String:
@@ -970,8 +976,12 @@ qsreal QScriptValue::toNumber() const
return 0;
switch (d->type) {
case QScriptValuePrivate::JavaScriptCore: {
- JSC::ExecState *exec = d->engine ? d->engine->currentFrame : 0;
- return QScriptEnginePrivate::toNumber(exec, d->jscValue);
+ if (d->engine) {
+ QScript::APIShim shim(d->engine);
+ return QScriptEnginePrivate::toNumber(d->engine->currentFrame, d->jscValue);
+ } else {
+ return QScriptEnginePrivate::toNumber(0, d->jscValue);
+ }
}
case QScriptValuePrivate::Number:
return d->numberValue;
@@ -993,8 +1003,12 @@ bool QScriptValue::toBoolean() const
return false;
switch (d->type) {
case QScriptValuePrivate::JavaScriptCore: {
- JSC::ExecState *exec = d->engine ? d->engine->currentFrame : 0;
- return QScriptEnginePrivate::toBool(exec, d->jscValue);
+ if (d->engine) {
+ QScript::APIShim shim(d->engine);
+ return QScriptEnginePrivate::toBool(d->engine->currentFrame, d->jscValue);
+ } else {
+ return QScriptEnginePrivate::toBool(0, d->jscValue);
+ }
}
case QScriptValuePrivate::Number:
return QScript::ToBool(d->numberValue);
@@ -1025,8 +1039,12 @@ bool QScriptValue::toBool() const
return false;
switch (d->type) {
case QScriptValuePrivate::JavaScriptCore: {
- JSC::ExecState *exec = d->engine ? d->engine->currentFrame : 0;
- return QScriptEnginePrivate::toBool(exec, d->jscValue);
+ if (d->engine) {
+ QScript::APIShim shim(d->engine);
+ return QScriptEnginePrivate::toBool(d->engine->currentFrame, d->jscValue);
+ } else {
+ return QScriptEnginePrivate::toBool(0, d->jscValue);
+ }
}
case QScriptValuePrivate::Number:
return QScript::ToBool(d->numberValue);
@@ -1055,8 +1073,12 @@ qint32 QScriptValue::toInt32() const
return 0;
switch (d->type) {
case QScriptValuePrivate::JavaScriptCore: {
- JSC::ExecState *exec = d->engine ? d->engine->currentFrame : 0;
- return QScriptEnginePrivate::toInt32(exec, d->jscValue);
+ if (d->engine) {
+ QScript::APIShim shim(d->engine);
+ return QScriptEnginePrivate::toInt32(d->engine->currentFrame, d->jscValue);
+ } else {
+ return QScriptEnginePrivate::toInt32(0, d->jscValue);
+ }
}
case QScriptValuePrivate::Number:
return QScript::ToInt32(d->numberValue);
@@ -1085,8 +1107,12 @@ quint32 QScriptValue::toUInt32() const
return 0;
switch (d->type) {
case QScriptValuePrivate::JavaScriptCore: {
- JSC::ExecState *exec = d->engine ? d->engine->currentFrame : 0;
- return QScriptEnginePrivate::toUInt32(exec, d->jscValue);
+ if (d->engine) {
+ QScript::APIShim shim(d->engine);
+ return QScriptEnginePrivate::toUInt32(d->engine->currentFrame, d->jscValue);
+ } else {
+ return QScriptEnginePrivate::toUInt32(0, d->jscValue);
+ }
}
case QScriptValuePrivate::Number:
return QScript::ToUInt32(d->numberValue);
@@ -1115,8 +1141,12 @@ quint16 QScriptValue::toUInt16() const
return 0;
switch (d->type) {
case QScriptValuePrivate::JavaScriptCore: {
- JSC::ExecState *exec = d->engine ? d->engine->currentFrame : 0;
- return QScriptEnginePrivate::toUInt16(exec, d->jscValue);
+ if (d->engine) {
+ QScript::APIShim shim(d->engine);
+ return QScriptEnginePrivate::toUInt16(d->engine->currentFrame, d->jscValue);
+ } else {
+ return QScriptEnginePrivate::toUInt16(0, d->jscValue);
+ }
}
case QScriptValuePrivate::Number:
return QScript::ToUInt16(d->numberValue);
@@ -1145,8 +1175,12 @@ qsreal QScriptValue::toInteger() const
return 0;
switch (d->type) {
case QScriptValuePrivate::JavaScriptCore: {
- JSC::ExecState *exec = d->engine ? d->engine->currentFrame : 0;
- return QScriptEnginePrivate::toInteger(exec, d->jscValue);
+ if (d->engine) {
+ QScript::APIShim shim(d->engine);
+ return QScriptEnginePrivate::toInteger(d->engine->currentFrame, d->jscValue);
+ } else {
+ return QScriptEnginePrivate::toInteger(0, d->jscValue);
+ }
}
case QScriptValuePrivate::Number:
return QScript::ToInteger(d->numberValue);
@@ -1185,8 +1219,12 @@ QVariant QScriptValue::toVariant() const
return QVariant();
switch (d->type) {
case QScriptValuePrivate::JavaScriptCore: {
- JSC::ExecState *exec = d->engine ? d->engine->currentFrame : 0;
- return QScriptEnginePrivate::toVariant(exec, d->jscValue);
+ if (d->engine) {
+ QScript::APIShim shim(d->engine);
+ return QScriptEnginePrivate::toVariant(d->engine->currentFrame, d->jscValue);
+ } else {
+ return QScriptEnginePrivate::toVariant(0, d->jscValue);
+ }
}
case QScriptValuePrivate::Number:
return QVariant(d->numberValue);
@@ -1409,6 +1447,7 @@ QScriptValue QScriptValue::property(const QScriptString &name,
Q_D(const QScriptValue);
if (!d || !d->isObject() || !QScriptStringPrivate::isValid(name))
return QScriptValue();
+ QScript::APIShim shim(d->engine);
return d->engine->scriptValueFromJSCValue(d->property(name.d_ptr->identifier, mode));
}
@@ -1439,6 +1478,7 @@ void QScriptValue::setProperty(const QScriptString &name,
qPrintable(name.toString()));
return;
}
+ QScript::APIShim shim(d->engine);
JSC::JSValue jsValue = d->engine->scriptValueToJSCValue(value);
d->setProperty(name.d_ptr->identifier, jsValue, flags);
}
diff --git a/src/script/api/qscriptvalueiterator.cpp b/src/script/api/qscriptvalueiterator.cpp
index c58c046269..ecda5fc058 100644
--- a/src/script/api/qscriptvalueiterator.cpp
+++ b/src/script/api/qscriptvalueiterator.cpp
@@ -85,6 +85,17 @@ public:
: initialized(false)
{}
+ ~QScriptValueIteratorPrivate()
+ {
+ if (!initialized)
+ return;
+ QScriptEnginePrivate *eng_p = engine();
+ if (!eng_p)
+ return;
+ QScript::APIShim shim(eng_p);
+ propertyNames.clear(); //destroying the identifiers need to be done under the APIShim guard
+ }
+
QScriptValuePrivate *object() const
{
return QScriptValuePrivate::get(objectValue);
@@ -139,12 +150,6 @@ QScriptValueIterator::QScriptValueIterator(const QScriptValue &object)
*/
QScriptValueIterator::~QScriptValueIterator()
{
- Q_D(QScriptValueIterator);
- if (d && d->engine()) {
- // Make sure identifiers are removed from the correct engine.
- QScript::APIShim shim(d->engine());
- d->propertyNames.clear();
- }
}
/*!
@@ -287,6 +292,7 @@ QScriptValue QScriptValueIterator::value() const
Q_D(const QScriptValueIterator);
if (!d || !d->initialized || !d->engine())
return QScriptValue();
+ QScript::APIShim shim(d->engine());
JSC::JSValue jsValue = d->object()->property(*d->current);
return d->engine()->scriptValueFromJSCValue(jsValue);
}
@@ -302,6 +308,7 @@ void QScriptValueIterator::setValue(const QScriptValue &value)
Q_D(QScriptValueIterator);
if (!d || !d->initialized || !d->engine())
return;
+ QScript::APIShim shim(d->engine());
JSC::JSValue jsValue = d->engine()->scriptValueToJSCValue(value);
d->object()->setProperty(*d->current, jsValue);
}
@@ -317,6 +324,7 @@ QScriptValue::PropertyFlags QScriptValueIterator::flags() const
Q_D(const QScriptValueIterator);
if (!d || !d->initialized || !d->engine())
return 0;
+ QScript::APIShim shim(d->engine());
return d->object()->propertyFlags(*d->current);
}
@@ -331,6 +339,7 @@ void QScriptValueIterator::remove()
Q_D(QScriptValueIterator);
if (!d || !d->initialized || !d->engine())
return;
+ QScript::APIShim shim(d->engine());
d->object()->setProperty(*d->current, JSC::JSValue());
d->propertyNames.erase(d->current);
}
diff --git a/tests/auto/declarative/qdeclarativeanchors/tst_qdeclarativeanchors.cpp b/tests/auto/declarative/qdeclarativeanchors/tst_qdeclarativeanchors.cpp
index 6b7d57f135..16ae7fc448 100644
--- a/tests/auto/declarative/qdeclarativeanchors/tst_qdeclarativeanchors.cpp
+++ b/tests/auto/declarative/qdeclarativeanchors/tst_qdeclarativeanchors.cpp
@@ -390,7 +390,7 @@ void tst_qdeclarativeanchors::fill()
QCOMPARE(rect->y(), 0.0 + 30.0);
QCOMPARE(rect->width(), 200.0 - 10.0 - 20.0);
QCOMPARE(rect->height(), 200.0 - 30.0 - 40.0);
- //Alter Offsets (QTBUG-6631)
+ //Alter Offsets (tests QTBUG-6631)
rect->anchors()->setLeftMargin(20.0);
rect->anchors()->setRightMargin(0.0);
rect->anchors()->setBottomMargin(0.0);
@@ -411,7 +411,7 @@ void tst_qdeclarativeanchors::centerIn()
QDeclarativeRectangle* rect = findItem<QDeclarativeRectangle>(view->rootObject(), QLatin1String("centered"));
QCOMPARE(rect->x(), 75.0 + 10);
QCOMPARE(rect->y(), 75.0 + 30);
- //Alter Offsets (QTBUG-6631)
+ //Alter Offsets (tests QTBUG-6631)
rect->anchors()->setHorizontalCenterOffset(-20.0);
rect->anchors()->setVerticalCenterOffset(-10.0);
QCOMPARE(rect->x(), 75.0 - 20.0);
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/LocalLast.qml b/tests/auto/declarative/qdeclarativelanguage/data/LocalLast.qml
new file mode 100644
index 0000000000..a0706addf8
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/LocalLast.qml
@@ -0,0 +1,2 @@
+import Qt 4.6
+Text {}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/lib/com/nokia/installedtest/LocalLast.qml b/tests/auto/declarative/qdeclarativelanguage/data/lib/com/nokia/installedtest/LocalLast.qml
new file mode 100644
index 0000000000..d8a22a82d2
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/lib/com/nokia/installedtest/LocalLast.qml
@@ -0,0 +1,2 @@
+import Qt 4.6
+Rectangle {}
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/lib/com/nokia/installedtest/qmldir b/tests/auto/declarative/qdeclarativelanguage/data/lib/com/nokia/installedtest/qmldir
index eeb9a05a95..0adb0f6b73 100644
--- a/tests/auto/declarative/qdeclarativelanguage/data/lib/com/nokia/installedtest/qmldir
+++ b/tests/auto/declarative/qdeclarativelanguage/data/lib/com/nokia/installedtest/qmldir
@@ -1,4 +1,5 @@
Rectangle 1.5 InstalledTest2.qml
+LocalLast 1.0 LocalLast.qml
InstalledTest 1.4 InstalledTest2.qml
InstalledTest 1.0 InstalledTest.qml
InstalledTestTP 0.0 InstalledTest.qml
diff --git a/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp b/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp
index e2cf5ca2bb..722e16140e 100644
--- a/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp
+++ b/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp
@@ -1065,7 +1065,6 @@ void tst_qdeclarativelanguage::defaultPropertyListOrder()
void tst_qdeclarativelanguage::declaredPropertyValues()
{
QDeclarativeComponent component(&engine, TEST_FILE("declaredPropertyValues.qml"));
- QEXPECT_FAIL("", "QTBUG-7860", Abort);
VERIFY_ERRORS(0);
}
@@ -1358,6 +1357,13 @@ void tst_qdeclarativelanguage::importsOrder_data()
"import com.nokia.installedtest 1.5\n"
"Rectangle.Image {}"
<< "QDeclarativeImage";
+ QTest::newRow("local last 1") <<
+ "LocalLast {}"
+ << "QDeclarativeText";
+ QTest::newRow("local last 2") <<
+ "import com.nokia.installedtest 1.0\n"
+ "LocalLast {}"
+ << "QDeclarativeRectangle"; // i.e. from com.nokia.installedtest, not data/LocalLast.qml
}
void tst_qdeclarativelanguage::importsOrder()
diff --git a/tests/auto/declarative/qdeclarativelistmodel/tst_qdeclarativelistmodel.cpp b/tests/auto/declarative/qdeclarativelistmodel/tst_qdeclarativelistmodel.cpp
index 12000d0a21..d02f54f202 100644
--- a/tests/auto/declarative/qdeclarativelistmodel/tst_qdeclarativelistmodel.cpp
+++ b/tests/auto/declarative/qdeclarativelistmodel/tst_qdeclarativelistmodel.cpp
@@ -41,6 +41,7 @@
#include <qtest.h>
#include <QtDeclarative/private/qdeclarativeitem_p.h>
#include <QtDeclarative/private/qdeclarativetext_p.h>
+#include <QtDeclarative/private/qdeclarativeengine_p.h>
#include <QtDeclarative/private/qdeclarativelistmodel_p.h>
#include <QtDeclarative/private/qdeclarativeexpression_p.h>
#include <QDeclarativeComponent>
@@ -77,6 +78,7 @@ private slots:
void convertNestedToFlat_ok_data();
void error_data();
void error();
+ void set();
};
QScriptValue tst_QDeclarativeListModel::nestedListValue(QScriptEngine *eng) const
@@ -550,6 +552,30 @@ void tst_QDeclarativeListModel::error()
}
}
+void tst_QDeclarativeListModel::set()
+{
+ QDeclarativeEngine engine;
+ QDeclarativeListModel model;
+ QDeclarativeEngine::setContextForObject(&model,engine.rootContext());
+ engine.rootContext()->setContextObject(&model);
+ QScriptEngine *seng = QDeclarativeEnginePrivate::getScriptEngine(&engine);
+
+ QScriptValue sv = seng->newObject();
+ sv.setProperty("test", QScriptValue(false));
+ model.append(sv);
+
+ sv.setProperty("test", QScriptValue(true));
+ model.set(0, sv);
+ QCOMPARE(model.get(0).property("test").toBool(), true); // triggers creation of model cache
+ QCOMPARE(model.data(0, model.roles()[0]), qVariantFromValue(true));
+
+ sv.setProperty("test", QScriptValue(false));
+ model.set(0, sv);
+ QCOMPARE(model.get(0).property("test").toBool(), false); // tests model cache is updated
+ QCOMPARE(model.data(0, model.roles()[0]), qVariantFromValue(false));
+}
+
+
QTEST_MAIN(tst_QDeclarativeListModel)
#include "tst_qdeclarativelistmodel.moc"
diff --git a/tests/auto/declarative/qdeclarativepositioners/data/flowtest.qml b/tests/auto/declarative/qdeclarativepositioners/data/flowtest.qml
index bd13bacafe..6c1c823535 100644
--- a/tests/auto/declarative/qdeclarativepositioners/data/flowtest.qml
+++ b/tests/auto/declarative/qdeclarativepositioners/data/flowtest.qml
@@ -4,7 +4,8 @@ Item {
width: 90
height: 480
Flow {
- anchors.fill: parent
+ objectName: "flow"
+ width: parent.width
Rectangle {
objectName: "one"
color: "red"
diff --git a/tests/auto/declarative/qdeclarativepositioners/data/grid-animated.qml b/tests/auto/declarative/qdeclarativepositioners/data/grid-animated.qml
index f6376a153e..9741ba926c 100644
--- a/tests/auto/declarative/qdeclarativepositioners/data/grid-animated.qml
+++ b/tests/auto/declarative/qdeclarativepositioners/data/grid-animated.qml
@@ -4,6 +4,7 @@ Item {
width: 640
height: 480
Grid {
+ objectName: "grid"
columns: 3
add: Transition {
NumberAnimation {
diff --git a/tests/auto/declarative/qdeclarativepositioners/data/grid-spacing.qml b/tests/auto/declarative/qdeclarativepositioners/data/grid-spacing.qml
index 5b4a30dfd9..e335932d00 100644
--- a/tests/auto/declarative/qdeclarativepositioners/data/grid-spacing.qml
+++ b/tests/auto/declarative/qdeclarativepositioners/data/grid-spacing.qml
@@ -4,6 +4,7 @@ Item {
width: 640
height: 480
Grid {
+ objectName: "grid"
columns: 3
spacing: 4
Rectangle {
diff --git a/tests/auto/declarative/qdeclarativepositioners/data/gridtest.qml b/tests/auto/declarative/qdeclarativepositioners/data/gridtest.qml
index 830df6acd0..1d6f44e0a4 100644
--- a/tests/auto/declarative/qdeclarativepositioners/data/gridtest.qml
+++ b/tests/auto/declarative/qdeclarativepositioners/data/gridtest.qml
@@ -4,6 +4,7 @@ Item {
width: 640
height: 480
Grid {
+ objectName: "grid"
columns: 3
Rectangle {
objectName: "one"
diff --git a/tests/auto/declarative/qdeclarativepositioners/data/horizontal-animated.qml b/tests/auto/declarative/qdeclarativepositioners/data/horizontal-animated.qml
index c113a367bc..a1c05a88d3 100644
--- a/tests/auto/declarative/qdeclarativepositioners/data/horizontal-animated.qml
+++ b/tests/auto/declarative/qdeclarativepositioners/data/horizontal-animated.qml
@@ -4,6 +4,7 @@ Item {
width: 640
height: 480
Row {
+ objectName: "row"
add: Transition {
NumberAnimation {
properties: "x";
diff --git a/tests/auto/declarative/qdeclarativepositioners/data/horizontal-spacing.qml b/tests/auto/declarative/qdeclarativepositioners/data/horizontal-spacing.qml
index 32bf775588..fb9fdd1a3b 100644
--- a/tests/auto/declarative/qdeclarativepositioners/data/horizontal-spacing.qml
+++ b/tests/auto/declarative/qdeclarativepositioners/data/horizontal-spacing.qml
@@ -4,6 +4,7 @@ Item {
width: 640
height: 480
Row {
+ objectName: "row"
spacing: 10
Rectangle {
objectName: "one"
diff --git a/tests/auto/declarative/qdeclarativepositioners/data/horizontal.qml b/tests/auto/declarative/qdeclarativepositioners/data/horizontal.qml
index 06ae151494..3a7a3b1fc1 100644
--- a/tests/auto/declarative/qdeclarativepositioners/data/horizontal.qml
+++ b/tests/auto/declarative/qdeclarativepositioners/data/horizontal.qml
@@ -4,6 +4,7 @@ Item {
width: 640
height: 480
Row {
+ objectName: "row"
Rectangle {
objectName: "one"
color: "red"
diff --git a/tests/auto/declarative/qdeclarativepositioners/data/vertical-animated.qml b/tests/auto/declarative/qdeclarativepositioners/data/vertical-animated.qml
index 10f6cbb3d1..31faa54dbf 100644
--- a/tests/auto/declarative/qdeclarativepositioners/data/vertical-animated.qml
+++ b/tests/auto/declarative/qdeclarativepositioners/data/vertical-animated.qml
@@ -4,6 +4,7 @@ Item {
width: 640
height: 480
Column {
+ objectName: "column"
add: Transition {
NumberAnimation {
properties: "y";
diff --git a/tests/auto/declarative/qdeclarativepositioners/data/vertical-spacing.qml b/tests/auto/declarative/qdeclarativepositioners/data/vertical-spacing.qml
index 69a8256c39..1c5696b5ce 100644
--- a/tests/auto/declarative/qdeclarativepositioners/data/vertical-spacing.qml
+++ b/tests/auto/declarative/qdeclarativepositioners/data/vertical-spacing.qml
@@ -4,6 +4,7 @@ Item {
width: 640
height: 480
Column {
+ objectName: "column"
spacing: 10
Rectangle {
objectName: "one"
diff --git a/tests/auto/declarative/qdeclarativepositioners/data/vertical.qml b/tests/auto/declarative/qdeclarativepositioners/data/vertical.qml
index 856c180a45..cd777e26cd 100644
--- a/tests/auto/declarative/qdeclarativepositioners/data/vertical.qml
+++ b/tests/auto/declarative/qdeclarativepositioners/data/vertical.qml
@@ -4,6 +4,7 @@ Item {
width: 640
height: 480
Column {
+ objectName: "column"
Rectangle {
objectName: "one"
color: "red"
diff --git a/tests/auto/declarative/qdeclarativepositioners/tst_qdeclarativepositioners.cpp b/tests/auto/declarative/qdeclarativepositioners/tst_qdeclarativepositioners.cpp
index 9026566517..08eac0a9f1 100644
--- a/tests/auto/declarative/qdeclarativepositioners/tst_qdeclarativepositioners.cpp
+++ b/tests/auto/declarative/qdeclarativepositioners/tst_qdeclarativepositioners.cpp
@@ -94,6 +94,10 @@ void tst_QDeclarativePositioners::test_horizontal()
QCOMPARE(two->y(), 0.0);
QCOMPARE(three->x(), 70.0);
QCOMPARE(three->y(), 0.0);
+
+ QDeclarativeItem *row = canvas->rootObject()->findChild<QDeclarativeItem*>("row");
+ QCOMPARE(row->width(), 110.0);
+ QCOMPARE(row->height(), 50.0);
}
void tst_QDeclarativePositioners::test_horizontal_spacing()
@@ -115,6 +119,10 @@ void tst_QDeclarativePositioners::test_horizontal_spacing()
QCOMPARE(two->y(), 0.0);
QCOMPARE(three->x(), 90.0);
QCOMPARE(three->y(), 0.0);
+
+ QDeclarativeItem *row = canvas->rootObject()->findChild<QDeclarativeItem*>("row");
+ QCOMPARE(row->width(), 130.0);
+ QCOMPARE(row->height(), 50.0);
}
void tst_QDeclarativePositioners::test_horizontal_animated()
@@ -135,6 +143,11 @@ void tst_QDeclarativePositioners::test_horizontal_animated()
QCOMPARE(two->x(), -100.0);
QCOMPARE(three->x(), -100.0);
+ QDeclarativeItem *row = canvas->rootObject()->findChild<QDeclarativeItem*>("row");
+ QVERIFY(row);
+ QCOMPARE(row->width(), 100.0);
+ QCOMPARE(row->height(), 50.0);
+
//QTRY_COMPARE used instead of waiting for the expected time of animation completion
//Note that this means the duration of the animation is NOT tested
@@ -149,6 +162,11 @@ void tst_QDeclarativePositioners::test_horizontal_animated()
//Add 'two'
two->setOpacity(1.0);
QCOMPARE(two->opacity(), 1.0);
+
+ // New size should be immediate
+ QCOMPARE(row->width(), 150.0);
+ QCOMPARE(row->height(), 50.0);
+
QTest::qWait(0);//Let the animation start
QCOMPARE(two->x(), -100.0);
QCOMPARE(three->x(), 50.0);
@@ -176,6 +194,11 @@ void tst_QDeclarativePositioners::test_vertical()
QCOMPARE(two->y(), 50.0);
QCOMPARE(three->x(), 0.0);
QCOMPARE(three->y(), 60.0);
+
+ QDeclarativeItem *column = canvas->rootObject()->findChild<QDeclarativeItem*>("column");
+ QVERIFY(column);
+ QCOMPARE(column->height(), 80.0);
+ QCOMPARE(column->width(), 50.0);
}
void tst_QDeclarativePositioners::test_vertical_spacing()
@@ -197,6 +220,10 @@ void tst_QDeclarativePositioners::test_vertical_spacing()
QCOMPARE(two->y(), 60.0);
QCOMPARE(three->x(), 0.0);
QCOMPARE(three->y(), 80.0);
+
+ QDeclarativeItem *column = canvas->rootObject()->findChild<QDeclarativeItem*>("column");
+ QCOMPARE(column->height(), 100.0);
+ QCOMPARE(column->width(), 50.0);
}
void tst_QDeclarativePositioners::test_vertical_animated()
@@ -216,6 +243,11 @@ void tst_QDeclarativePositioners::test_vertical_animated()
QVERIFY(three != 0);
QCOMPARE(three->y(), -100.0);
+ QDeclarativeItem *column = canvas->rootObject()->findChild<QDeclarativeItem*>("column");
+ QVERIFY(column);
+ QCOMPARE(column->height(), 100.0);
+ QCOMPARE(column->width(), 50.0);
+
//QTRY_COMPARE used instead of waiting for the expected time of animation completion
//Note that this means the duration of the animation is NOT tested
@@ -230,6 +262,8 @@ void tst_QDeclarativePositioners::test_vertical_animated()
//Add 'two'
two->setOpacity(1.0);
QTRY_COMPARE(two->opacity(), 1.0);
+ QCOMPARE(column->height(), 150.0);
+ QCOMPARE(column->width(), 50.0);
QTest::qWait(0);//Let the animation start
QCOMPARE(two->y(), -100.0);
QCOMPARE(three->y(), 50.0);
@@ -264,6 +298,10 @@ void tst_QDeclarativePositioners::test_grid()
QCOMPARE(four->y(), 50.0);
QCOMPARE(five->x(), 50.0);
QCOMPARE(five->y(), 50.0);
+
+ QDeclarativeItem *grid = canvas->rootObject()->findChild<QDeclarativeItem*>("grid");
+ QCOMPARE(grid->width(), 120.0);
+ QCOMPARE(grid->height(), 100.0);
}
void tst_QDeclarativePositioners::test_grid_spacing()
@@ -291,6 +329,10 @@ void tst_QDeclarativePositioners::test_grid_spacing()
QCOMPARE(four->y(), 54.0);
QCOMPARE(five->x(), 54.0);
QCOMPARE(five->y(), 54.0);
+
+ QDeclarativeItem *grid = canvas->rootObject()->findChild<QDeclarativeItem*>("grid");
+ QCOMPARE(grid->width(), 128.0);
+ QCOMPARE(grid->height(), 104.0);
}
void tst_QDeclarativePositioners::test_grid_animated()
@@ -323,6 +365,11 @@ void tst_QDeclarativePositioners::test_grid_animated()
QCOMPARE(five->x(), -100.0);
QCOMPARE(five->y(), -100.0);
+ QDeclarativeItem *grid = canvas->rootObject()->findChild<QDeclarativeItem*>("grid");
+ QVERIFY(grid);
+ QCOMPARE(grid->width(), 150.0);
+ QCOMPARE(grid->height(), 100.0);
+
//QTRY_COMPARE used instead of waiting for the expected time of animation completion
//Note that this means the duration of the animation is NOT tested
@@ -341,6 +388,8 @@ void tst_QDeclarativePositioners::test_grid_animated()
//Add 'two'
two->setOpacity(1.0);
QCOMPARE(two->opacity(), 1.0);
+ QCOMPARE(grid->width(), 150.0);
+ QCOMPARE(grid->height(), 100.0);
QTest::qWait(0);//Let the animation start
QCOMPARE(two->x(), -100.0);
QCOMPARE(two->y(), -100.0);
@@ -468,6 +517,11 @@ void tst_QDeclarativePositioners::test_flow()
QCOMPARE(four->y(), 70.0);
QCOMPARE(five->x(), 50.0);
QCOMPARE(five->y(), 70.0);
+
+ QDeclarativeItem *flow = canvas->rootObject()->findChild<QDeclarativeItem*>("flow");
+ QVERIFY(flow);
+ QCOMPARE(flow->width(), 90.0);
+ QCOMPARE(flow->height(), 120.0);
}
void tst_QDeclarativePositioners::test_flow_resize()
diff --git a/tests/auto/declarative/qdeclarativerepeater/data/itemlist.qml b/tests/auto/declarative/qdeclarativerepeater/data/itemlist.qml
index fc6b34c8ad..d74b2dcb62 100644
--- a/tests/auto/declarative/qdeclarativerepeater/data/itemlist.qml
+++ b/tests/auto/declarative/qdeclarativerepeater/data/itemlist.qml
@@ -21,17 +21,17 @@ Rectangle {
objectName: "itemModel"
Rectangle {
objectName: "item1"
- height: view.height; width: view.width; color: "#FFFEF0"
+ height: 50; width: 100; color: "#FFFEF0"
Text { objectName: "text1"; text: "index: " + parent.VisualItemModel.index; font.bold: true; anchors.centerIn: parent }
}
Rectangle {
objectName: "item2"
- height: view.height; width: view.width; color: "#F0FFF7"
+ height: 50; width: 100; color: "#F0FFF7"
Text { objectName: "text2"; text: "index: " + parent.VisualItemModel.index; font.bold: true; anchors.centerIn: parent }
}
Rectangle {
objectName: "item3"
- height: view.height; width: view.width; color: "#F4F0FF"
+ height: 50; width: 100; color: "#F4F0FF"
Text { objectName: "text3"; text: "index: " + parent.VisualItemModel.index; font.bold: true; anchors.centerIn: parent }
}
}
@@ -41,8 +41,6 @@ Rectangle {
Repeater {
id: view
objectName: "repeater"
- anchors.fill: parent
- anchors.bottomMargin: 30
model: testObject.useModel ? itemModel : 0
}
}
diff --git a/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp b/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp
index 84e7182a56..b6f55ddd8a 100644
--- a/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp
+++ b/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp
@@ -523,7 +523,7 @@ void tst_qdeclarativetextinput::navigation()
QVERIFY(input->hasFocus() == false);
simulateKey(canvas, Qt::Key_Right);
QVERIFY(input->hasFocus() == true);
- //QT-2944: If text is selected, then we should deselect first.
+ //QT-2944: If text is selected, ensure we deselect upon cursor motion
input->setCursorPosition(input->text().length());
input->setSelectionStart(0);
input->setSelectionEnd(input->text().length());
diff --git a/tests/auto/declarative/qdeclarativevaluetypes/tst_qdeclarativevaluetypes.cpp b/tests/auto/declarative/qdeclarativevaluetypes/tst_qdeclarativevaluetypes.cpp
index a5cb16f335..4e254ebd98 100644
--- a/tests/auto/declarative/qdeclarativevaluetypes/tst_qdeclarativevaluetypes.cpp
+++ b/tests/auto/declarative/qdeclarativevaluetypes/tst_qdeclarativevaluetypes.cpp
@@ -432,7 +432,6 @@ void tst_qdeclarativevaluetypes::autoBindingRemoval()
object->setProperty("value", QVariant(92));
- //QEXPECT_FAIL("", "QT-2920", Continue);
QCOMPARE(object->rect().x(), 42);
delete object;
diff --git a/tests/auto/moc/tst_moc.cpp b/tests/auto/moc/tst_moc.cpp
index 30c27214e4..a56d842f85 100644
--- a/tests/auto/moc/tst_moc.cpp
+++ b/tests/auto/moc/tst_moc.cpp
@@ -1302,6 +1302,26 @@ void tst_Moc::QTBUG5590_dummyProperty()
QCOMPARE(o.value2(), 82);
}
+class QTBUG7421_ReturnConstTemplate: public QObject
+{ Q_OBJECT
+public slots:
+ const QList<int> returnConstTemplate1() { return QList<int>(); }
+ QList<int> const returnConstTemplate2() { return QList<int>(); }
+ const int returnConstInt() { return 0; }
+ const QString returnConstString(const QString s) { return s; }
+ QString const returnConstString2( QString const s) { return s; }
+};
+
+class QTBUG9354_constInName: public QObject
+{ Q_OBJECT
+public slots:
+ void slotChooseScientificConst0(struct science_constant const &) {};
+ void foo(struct science_const const &) {};
+ void foo(struct constconst const &) {};
+ void foo(struct constconst *) {};
+ void foo(struct const_ *) {};
+};
+
QTEST_APPLESS_MAIN(tst_Moc)
#include "tst_moc.moc"
diff --git a/tests/auto/qdate/tst_qdate.cpp b/tests/auto/qdate/tst_qdate.cpp
index 722329178a..60772ebd57 100644
--- a/tests/auto/qdate/tst_qdate.cpp
+++ b/tests/auto/qdate/tst_qdate.cpp
@@ -99,6 +99,7 @@ private slots:
void standaloneShortMonthName() const;
void longMonthName() const;
void standaloneLongMonthName() const;
+ void roundtrip() const;
};
Q_DECLARE_METATYPE(QDate)
@@ -668,17 +669,18 @@ void tst_QDate::toString_format()
void tst_QDate::isLeapYear()
{
- QVERIFY(QDate::isLeapYear(-4444));
- QVERIFY(!QDate::isLeapYear(-4443));
- QVERIFY(QDate::isLeapYear(-8));
- QVERIFY(!QDate::isLeapYear(-7));
- QVERIFY(QDate::isLeapYear(-4));
+ QVERIFY(QDate::isLeapYear(-4445));
+ QVERIFY(!QDate::isLeapYear(-4444));
+ QVERIFY(!QDate::isLeapYear(-6));
+ QVERIFY(QDate::isLeapYear(-5));
+ QVERIFY(!QDate::isLeapYear(-4));
QVERIFY(!QDate::isLeapYear(-3));
QVERIFY(!QDate::isLeapYear(-2));
- QVERIFY(!QDate::isLeapYear(-1));
- QVERIFY(!QDate::isLeapYear(1));
- QVERIFY(!QDate::isLeapYear(1));
+ QVERIFY(QDate::isLeapYear(-1));
+ QVERIFY(!QDate::isLeapYear(0)); // Doesn't exist
QVERIFY(!QDate::isLeapYear(1));
+ QVERIFY(!QDate::isLeapYear(2));
+ QVERIFY(!QDate::isLeapYear(3));
QVERIFY(QDate::isLeapYear(4));
QVERIFY(!QDate::isLeapYear(7));
QVERIFY(QDate::isLeapYear(8));
@@ -910,5 +912,37 @@ void tst_QDate::standaloneLongMonthName() const
}
}
+void tst_QDate::roundtrip() const
+{
+ // Test round trip, this exercises setDate(), isValid(), isLeapYear(),
+ // year(), month(), day(), julianDayFromDate(), and getDateFromJulianDay()
+ // to ensure they are internally consistent (but doesn't guarantee correct)
+
+ // Test Julian round trip in both BC and AD
+ QDate testDate;
+ QDate loopDate = QDate::fromJulianDay(1684899); // 1 Jan 100 BC
+ while ( loopDate.toJulianDay() <= 1757948 ) { // 31 Dec 100 AD
+ testDate.setDate( loopDate.year(), loopDate.month(), loopDate.day() );
+ QCOMPARE( loopDate.toJulianDay(), testDate.toJulianDay() );
+ loopDate = loopDate.addDays(1);
+ }
+
+ // Test Julian and Gregorian round trip during changeover period
+ loopDate = QDate::fromJulianDay(2298153); // 1 Jan 1580 AD
+ while ( loopDate.toJulianDay() <= 2300334 ) { // 31 Dec 1585 AD
+ testDate.setDate( loopDate.year(), loopDate.month(), loopDate.day() );
+ QCOMPARE( loopDate.toJulianDay(), testDate.toJulianDay() );
+ loopDate = loopDate.addDays(1);
+ }
+
+ // Test Gregorian round trip during current useful period
+ loopDate = QDate::fromJulianDay(2378497); // 1 Jan 1900 AD
+ while ( loopDate.toJulianDay() <= 2488433 ) { // 31 Dec 2100 AD
+ testDate.setDate( loopDate.year(), loopDate.month(), loopDate.day() );
+ QCOMPARE( loopDate.toJulianDay(), testDate.toJulianDay() );
+ loopDate = loopDate.addDays(1);
+ }
+}
+
QTEST_APPLESS_MAIN(tst_QDate)
#include "tst_qdate.moc"
diff --git a/tests/auto/qfontmetrics/tst_qfontmetrics.cpp b/tests/auto/qfontmetrics/tst_qfontmetrics.cpp
index 46f2b155b8..5d73764dbb 100644
--- a/tests/auto/qfontmetrics/tst_qfontmetrics.cpp
+++ b/tests/auto/qfontmetrics/tst_qfontmetrics.cpp
@@ -259,7 +259,7 @@ void tst_QFontMetrics::bearingIncludedInBoundingRect()
font.setItalic(false);
QRect brectNormal = QFontMetrics(font).boundingRect("ITALIC");
- QVERIFY(brectItalic.width() > brectNormal.width());
+ QVERIFY(brectItalic.width() >= brectNormal.width());
}
QTEST_MAIN(tst_QFontMetrics)
diff --git a/tests/auto/qgl/qgl.pro b/tests/auto/qgl/qgl.pro
index 5f058f9f61..20f8018f4c 100644
--- a/tests/auto/qgl/qgl.pro
+++ b/tests/auto/qgl/qgl.pro
@@ -7,6 +7,7 @@ requires(contains(QT_CONFIG,opengl))
QT += opengl
contains(QT_CONFIG,egl):DEFINES += QGL_EGL
+win32:!wince*: DEFINES += QT_NO_EGL
SOURCES += tst_qgl.cpp
RESOURCES = qgl.qrc
diff --git a/tests/auto/qglbuffer/qglbuffer.pro b/tests/auto/qglbuffer/qglbuffer.pro
index 07d05bb9db..5627d2d6cb 100644
--- a/tests/auto/qglbuffer/qglbuffer.pro
+++ b/tests/auto/qglbuffer/qglbuffer.pro
@@ -6,4 +6,6 @@ load(qttest_p4)
requires(contains(QT_CONFIG,opengl))
QT += opengl
+win32:!wince*: DEFINES += QT_NO_EGL
+
SOURCES += tst_qglbuffer.cpp
diff --git a/tests/auto/qglthreads/qglthreads.pro b/tests/auto/qglthreads/qglthreads.pro
index 73b75d4a3a..883eef2fe0 100644
--- a/tests/auto/qglthreads/qglthreads.pro
+++ b/tests/auto/qglthreads/qglthreads.pro
@@ -2,6 +2,8 @@ load(qttest_p4)
requires(contains(QT_CONFIG,opengl))
QT += opengl
+win32:!wince*: DEFINES += QT_NO_EGL
+
HEADERS += tst_qglthreads.h
SOURCES += tst_qglthreads.cpp
diff --git a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp
index 01ef9a2e9b..89d59589c8 100644
--- a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp
+++ b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp
@@ -61,6 +61,7 @@
#include <QScrollBar>
#include <QVBoxLayout>
#include <QGraphicsEffect>
+#include <QInputContext>
#include "../../shared/util.h"
@@ -424,6 +425,7 @@ private slots:
void modality_keyEvents();
void itemIsInFront();
void scenePosChange();
+ void updateMicroFocus();
// task specific tests below me
void task141694_textItemEnsureVisible();
@@ -4318,6 +4320,21 @@ protected:
break;
case QGraphicsItem::ItemScenePositionHasChanged:
break;
+ case QGraphicsItem::ItemRotationChange:
+ oldValues << rotation();
+ break;
+ case QGraphicsItem::ItemRotationHasChanged:
+ break;
+ case QGraphicsItem::ItemScaleChange:
+ oldValues << scale();
+ break;
+ case QGraphicsItem::ItemScaleHasChanged:
+ break;
+ case QGraphicsItem::ItemTransformOriginPointChange:
+ oldValues << transformOriginPoint();
+ break;
+ case QGraphicsItem::ItemTransformOriginPointHasChanged:
+ break;
}
return itemChangeReturnValue.isValid() ? itemChangeReturnValue : value;
}
@@ -4414,6 +4431,48 @@ void tst_QGraphicsItem::itemChange()
QCOMPARE(tester.zValue(), qreal(2.0));
}
{
+ // ItemRotationChange / ItemRotationHasChanged
+ tester.itemChangeReturnValue = qreal(15.0);
+ tester.setRotation(10.0);
+ ++changeCount; // notification sent too
+ ++changeCount;
+ QCOMPARE(tester.changes.size(), changeCount);
+ QCOMPARE(tester.changes.at(tester.changes.size() - 2), QGraphicsItem::ItemRotationChange);
+ QCOMPARE(tester.changes.at(tester.changes.size() - 1), QGraphicsItem::ItemRotationHasChanged);
+ QCOMPARE(tester.values.at(tester.changes.size() - 2), QVariant(qreal(10.0)));
+ QCOMPARE(tester.values.at(tester.changes.size() - 1), QVariant(qreal(15.0)));
+ QCOMPARE(tester.oldValues.last(), QVariant(qreal(0.0)));
+ QCOMPARE(tester.rotation(), qreal(15.0));
+ }
+ {
+ // ItemScaleChange / ItemScaleHasChanged
+ tester.itemChangeReturnValue = qreal(2.0);
+ tester.setScale(1.5);
+ ++changeCount; // notification sent too
+ ++changeCount;
+ QCOMPARE(tester.changes.size(), changeCount);
+ QCOMPARE(tester.changes.at(tester.changes.size() - 2), QGraphicsItem::ItemScaleChange);
+ QCOMPARE(tester.changes.at(tester.changes.size() - 1), QGraphicsItem::ItemScaleHasChanged);
+ QCOMPARE(tester.values.at(tester.changes.size() - 2), QVariant(qreal(1.5)));
+ QCOMPARE(tester.values.at(tester.changes.size() - 1), QVariant(qreal(2.0)));
+ QCOMPARE(tester.oldValues.last(), QVariant(qreal(1.0)));
+ QCOMPARE(tester.scale(), qreal(2.0));
+ }
+ {
+ // ItemTransformOriginPointChange / ItemTransformOriginPointHasChanged
+ tester.itemChangeReturnValue = QPointF(2.0, 2.0);
+ tester.setTransformOriginPoint(1.0, 1.0);
+ ++changeCount; // notification sent too
+ ++changeCount;
+ QCOMPARE(tester.changes.size(), changeCount);
+ QCOMPARE(tester.changes.at(tester.changes.size() - 2), QGraphicsItem::ItemTransformOriginPointChange);
+ QCOMPARE(tester.changes.at(tester.changes.size() - 1), QGraphicsItem::ItemTransformOriginPointHasChanged);
+ QCOMPARE(tester.values.at(tester.changes.size() - 2), QVariant(QPointF(1.0, 1.0)));
+ QCOMPARE(tester.values.at(tester.changes.size() - 1), QVariant(QPointF(2.0, 2.0)));
+ QCOMPARE(tester.oldValues.last(), QVariant(QPointF(0.0, 0.0)));
+ QCOMPARE(tester.transformOriginPoint(), QPointF(2.0, 2.0));
+ }
+ {
// ItemFlagsChange
tester.itemChangeReturnValue = QGraphicsItem::ItemIsSelectable;
tester.setFlag(QGraphicsItem::ItemIsSelectable, false);
@@ -7463,10 +7522,19 @@ void tst_QGraphicsItem::itemSendsGeometryChanges()
QTransform x = QTransform().rotate(45);
QPointF pos(10, 10);
qreal o(0.5);
+ qreal r(10.0);
+ qreal s(1.5);
+ QPointF origin(1.0, 1.0);
item.setTransform(x);
item.setPos(pos);
+ item.setRotation(r);
+ item.setScale(s);
+ item.setTransformOriginPoint(origin);
QCOMPARE(item.transform(), x);
QCOMPARE(item.pos(), pos);
+ QCOMPARE(item.rotation(), r);
+ QCOMPARE(item.scale(), s);
+ QCOMPARE(item.transformOriginPoint(), origin);
QCOMPARE(item.changes.size(), 0);
item.setOpacity(o);
@@ -7480,6 +7548,13 @@ void tst_QGraphicsItem::itemSendsGeometryChanges()
QCOMPARE(item.transform(), QTransform());
QCOMPARE(item.pos(), QPointF());
QCOMPARE(item.opacity(), o);
+ item.setRotation(0.0);
+ item.setScale(1.0);
+ item.setTransformOriginPoint(0.0, 0.0);
+ QCOMPARE(item.changes.size(), 14); // rotation + scale + origin
+ QCOMPARE(item.rotation(), qreal(0.0));
+ QCOMPARE(item.scale(), qreal(1.0));
+ QCOMPARE(item.transformOriginPoint(), QPointF(0.0, 0.0));
QCOMPARE(item.changes, QList<QGraphicsItem::GraphicsItemChange>()
<< QGraphicsItem::ItemOpacityChange
@@ -7489,7 +7564,13 @@ void tst_QGraphicsItem::itemSendsGeometryChanges()
<< QGraphicsItem::ItemTransformChange
<< QGraphicsItem::ItemTransformHasChanged
<< QGraphicsItem::ItemPositionChange
- << QGraphicsItem::ItemPositionHasChanged);
+ << QGraphicsItem::ItemPositionHasChanged
+ << QGraphicsItem::ItemRotationChange
+ << QGraphicsItem::ItemRotationHasChanged
+ << QGraphicsItem::ItemScaleChange
+ << QGraphicsItem::ItemScaleHasChanged
+ << QGraphicsItem::ItemTransformOriginPointChange
+ << QGraphicsItem::ItemTransformOriginPointHasChanged);
}
// Make sure we update moved items correctly.
@@ -9909,6 +9990,79 @@ void tst_QGraphicsItem::scenePosChange()
QCOMPARE(child2->changes.count(QGraphicsItem::ItemScenePositionHasChanged), 0);
}
+class MyInputContext : public QInputContext
+{
+public:
+ MyInputContext() : nbUpdates(0) {}
+ ~MyInputContext() {}
+
+ QString identifierName() { return QString(); }
+ QString language() { return QString(); }
+
+ void reset() {}
+
+ bool isComposing() const { return false; }
+
+ void update() { nbUpdates++; }
+
+ bool nbUpdates;
+};
+
+class MyInputWidget : public QGraphicsWidget
+{
+public:
+ MyInputWidget()
+ {
+ setFlag(QGraphicsItem::ItemIsFocusable, true);
+ setFlag(QGraphicsItem::ItemAcceptsInputMethod, true);
+ }
+ void mousePressEvent(QGraphicsSceneMouseEvent *event)
+ {
+ event->accept();
+ }
+
+ void doUpdateMicroFocus()
+ {
+ updateMicroFocus();
+ }
+};
+
+void tst_QGraphicsItem::updateMicroFocus()
+{
+#if defined Q_OS_WIN || defined Q_OS_MAC
+ QSKIP("QTBUG-9578", SkipAll);
+ return;
+#endif
+ QGraphicsScene scene;
+ QWidget parent;
+ QGridLayout layout;
+ parent.setLayout(&layout);
+ QGraphicsView view(&scene);
+ QGraphicsView view2(&scene);
+ layout.addWidget(&view, 0, 0);
+ layout.addWidget(&view2, 0, 1);
+ MyInputContext ic2;
+ view2.setInputContext(&ic2);
+ MyInputContext ic;
+ view.setInputContext(&ic);
+ MyInputWidget input;
+ input.setPos(0, 0);
+ input.resize(150, 150);
+ scene.addItem(&input);
+ input.setFocus();
+ parent.show();
+ view.setFocus();
+ qApp->setAutoSipEnabled(true);
+ QApplication::setActiveWindow(&parent);
+ QTest::qWaitForWindowShown(&parent);
+ QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget *>(&parent));
+ input.doUpdateMicroFocus();
+ QApplication::processEvents();
+ QTRY_COMPARE(ic.nbUpdates, 1);
+ //No update since view2 does not have the focus.
+ QTRY_COMPARE(ic2.nbUpdates, 0);
+}
+
void tst_QGraphicsItem::QTBUG_5418_textItemSetDefaultColor()
{
struct Item : public QGraphicsTextItem
diff --git a/tests/auto/qimagereader/images/corrupt.svg b/tests/auto/qimagereader/images/corrupt.svg
new file mode 100644
index 0000000000..8747df008f
--- /dev/null
+++ b/tests/auto/qimagereader/images/corrupt.svg
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ version="1.0"
+ width="40px"
+ height="5px"
+ id="svg2"
+ sodipodi:version="0.32"
+ inkscape:version="0.46"
+ sodipodi:docname="test.svg"
+ inkscape:output_extension="org.inkscape.output.svg.inkscape">
+ <metadata
+ id="metadata7">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <sodipodi:namedview
+ inkscape:window-height="1005"
+ \ No newline at end of file
diff --git a/tests/auto/qimagereader/images/corrupt.svgz b/tests/auto/qimagereader/images/corrupt.svgz
new file mode 100644
index 0000000000..67fdceee0b
--- /dev/null
+++ b/tests/auto/qimagereader/images/corrupt.svgz
Binary files differ
diff --git a/tests/auto/qimagereader/images/rect.svg b/tests/auto/qimagereader/images/rect.svg
new file mode 100644
index 0000000000..c56549a69a
--- /dev/null
+++ b/tests/auto/qimagereader/images/rect.svg
@@ -0,0 +1,462 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ version="1.0"
+ width="128"
+ height="128"
+ viewBox="0 0 105.427 137.439"
+ id="Livello_1"
+ xml:space="preserve"
+ style="overflow:visible"><defs
+ id="defs2727"><linearGradient
+ x1="26.294399"
+ y1="11.6704"
+ x2="71.901901"
+ y2="133.0273"
+ id="linearGradient3352"
+ xlink:href="#XMLID_34_"
+ gradientUnits="userSpaceOnUse" /><linearGradient
+ x1="36.838902"
+ y1="7.7075"
+ x2="82.446297"
+ y2="129.0645"
+ id="linearGradient3354"
+ xlink:href="#XMLID_34_"
+ gradientUnits="userSpaceOnUse" /><linearGradient
+ x1="33.882301"
+ y1="23.583"
+ x2="39.972198"
+ y2="23.583"
+ id="XMLID_34_"
+ gradientUnits="userSpaceOnUse">
+ <stop
+ id="stop2672"
+ style="stop-color:#ff5d5d;stop-opacity:1"
+ offset="0" />
+ <stop
+ id="stop2674"
+ style="stop-color:#e20800;stop-opacity:1"
+ offset="1" />
+ </linearGradient><linearGradient
+ x1="33.882301"
+ y1="23.583"
+ x2="39.972198"
+ y2="23.583"
+ id="linearGradient3368"
+ xlink:href="#XMLID_34_"
+ gradientUnits="userSpaceOnUse" /><linearGradient
+ x1="54.356899"
+ y1="1.124"
+ x2="99.964401"
+ y2="122.481"
+ id="linearGradient3370"
+ xlink:href="#XMLID_34_"
+ gradientUnits="userSpaceOnUse" /><linearGradient
+ x1="15.8457"
+ y1="15.5972"
+ x2="61.453098"
+ y2="136.9541"
+ id="linearGradient3376"
+ xlink:href="#XMLID_34_"
+ gradientUnits="userSpaceOnUse" /><linearGradient
+ x1="43.438"
+ y1="5.2275"
+ x2="89.045403"
+ y2="126.5845"
+ id="linearGradient3382"
+ xlink:href="#XMLID_34_"
+ gradientUnits="userSpaceOnUse" /><linearGradient
+ x1="8.1176996"
+ y1="14.9019"
+ x2="70.759598"
+ y2="117.2331"
+ id="linearGradient3792"
+ xlink:href="#XMLID_30_"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(0.9991,-4.18e-2,4.18e-2,0.9991,-2.4309,1.195)" /><linearGradient
+ x1="10.5708"
+ y1="10.1548"
+ x2="73.2117"
+ y2="112.4844"
+ id="linearGradient3794"
+ xlink:href="#XMLID_30_"
+ gradientUnits="userSpaceOnUse" /><linearGradient
+ x1="6.2178001"
+ y1="72.223602"
+ x2="79.360802"
+ y2="72.223602"
+ id="XMLID_26_"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="translate(0,2.1512354)">
+ <stop
+ id="stop2578"
+ style="stop-color:#ffffff;stop-opacity:1"
+ offset="0" />
+ <stop
+ id="stop2580"
+ style="stop-color:#eeeeec;stop-opacity:1"
+ offset="1" />
+ </linearGradient><filter
+ id="filter5869"><feGaussianBlur
+ id="feGaussianBlur5871"
+ stdDeviation="1.2254964"
+ inkscape:collect="always" /></filter><filter
+ id="filter5873"><feGaussianBlur
+ id="feGaussianBlur5875"
+ stdDeviation="1.3615922"
+ inkscape:collect="always" /></filter><filter
+ id="filter2854"><feGaussianBlur
+ id="feGaussianBlur2856"
+ stdDeviation="0.8944793"
+ inkscape:collect="always" /></filter></defs>
+<filter
+ id="AI_Sfocatura_1">
+ <feGaussianBlur
+ id="feGaussianBlur2545"
+ stdDeviation="1" />
+</filter>
+<g
+ transform="translate(-3.2052027,3.2058836)"
+ id="g2547">
+ <g
+ transform="matrix(0.9982563,0,0,0.9982563,-1.5492234e-2,0.2232388)"
+ id="g2549">
+ <g
+ id="g2551">
+ <linearGradient
+ x1="6.2178001"
+ y1="68.029297"
+ x2="79.360802"
+ y2="68.029297"
+ id="XMLID_24_"
+ gradientUnits="userSpaceOnUse">
+ <stop
+ id="stop2554"
+ style="stop-color:#ffffff;stop-opacity:1"
+ offset="0" />
+ <stop
+ id="stop2556"
+ style="stop-color:#eeeeec;stop-opacity:1"
+ offset="1" />
+ </linearGradient>
+ <path
+ d="M 9.542,121.224 C 7.713,121.224 6.217,119.728 6.217,117.9 L 6.217,18.16 C 6.217,16.331 7.713,14.835 9.542,14.835 L 76.036,14.835 C 77.864,14.835 79.36,16.331 79.36,18.16 L 79.36,117.9 C 79.36,119.728 77.864,121.224 76.036,121.224 L 9.542,121.224 z"
+ id="path2558"
+ style="fill:url(#XMLID_24_)" />
+ </g>
+ <g
+ id="g2560">
+ <linearGradient
+ x1="10.5718"
+ y1="15.3989"
+ x2="73.212097"
+ y2="117.7277"
+ id="XMLID_25_"
+ gradientUnits="userSpaceOnUse">
+ <stop
+ id="stop2563"
+ style="stop-color:#77b753;stop-opacity:1"
+ offset="0" />
+ <stop
+ id="stop2565"
+ style="stop-color:#00892c;stop-opacity:1"
+ offset="1" />
+ </linearGradient>
+ <path
+ d="M 11.204,18.159 C 10.29,18.159 9.542,18.907 9.542,19.821 L 9.542,116.237 C 9.542,117.151 10.29,117.899 11.204,117.899 L 74.375,117.899 C 75.289,117.899 76.037,117.151 76.037,116.237 L 76.037,19.821 C 76.037,18.907 75.289,18.159 74.375,18.159 L 11.204,18.159 z"
+ id="path2567"
+ style="fill:url(#XMLID_25_)" />
+ </g>
+ </g>
+ <g
+ transform="matrix(0.9982563,0,0,0.9982563,1.05825,0.2232388)"
+ id="g2569">
+ <path
+ d="M 11.639,126.468 C 9.811,126.468 8.314,124.972 8.314,123.143 L 8.314,23.403 C 8.314,21.574 9.811,20.078 11.639,20.078 L 78.134,20.078 C 79.962,20.078 81.458,21.574 81.458,23.403 L 81.458,123.143 C 81.458,124.972 79.962,126.468 78.134,126.468 L 23.696022,126.468 L 11.639,126.468 z"
+ transform="matrix(1.041449,0,0,1,-4.451967,3.1512354)"
+ id="path2575"
+ style="opacity:0.6;filter:url(#filter2854)" /><path
+ d="M 9.542,127.56924 C 7.714,127.56924 6.218,126.07324 6.218,124.24624 L 6.218,24.505236 C 6.218,22.677236 7.714,21.181236 9.542,21.181236 L 76.037,21.181236 C 77.865,21.181236 79.361,22.677236 79.361,24.505236 L 79.361,124.24624 C 79.361,126.07324 77.865,127.56924 76.037,127.56924 L 9.542,127.56924 z"
+ id="path2582"
+ style="fill:url(#XMLID_26_)" />
+ <g
+ transform="translate(0,2.1512354)"
+ id="g2584">
+ <g
+ transform="matrix(1.0276326,0,0,1,-2.2508995,0)"
+ id="g2586"
+ style="opacity:0.5;filter:url(#AI_Sfocatura_1)">
+ <path
+ d="M 11.639,123.321 C 9.811,123.321 8.314,121.824 8.314,119.997 L 81.458,119.997 C 81.458,121.824 79.962,123.321 78.134,123.321 L 11.639,123.321 z"
+ id="path2588" />
+ </g>
+ <linearGradient
+ x1="6.2178001"
+ y1="69.078102"
+ x2="79.360802"
+ y2="69.078102"
+ id="XMLID_27_"
+ gradientUnits="userSpaceOnUse">
+ <stop
+ id="stop2591"
+ style="stop-color:#ffffff;stop-opacity:1"
+ offset="0" />
+ <stop
+ id="stop2593"
+ style="stop-color:#eeeeec;stop-opacity:1"
+ offset="1" />
+ </linearGradient>
+ <path
+ d="M 9.542,122.272 C 7.714,122.272 6.218,120.776 6.218,118.947 L 6.218,19.207 C 6.218,17.378 7.714,15.882 9.542,15.882 L 76.037,15.882 C 77.865,15.882 79.361,17.378 79.361,19.207 L 79.361,118.947 C 79.361,120.776 77.865,122.272 76.037,122.272 L 9.542,122.272 z"
+ id="path2595"
+ style="fill:url(#XMLID_27_)" />
+ </g>
+ <g
+ transform="translate(0,3.2268531)"
+ id="g2597">
+ <g
+ transform="matrix(1.0368435,0,0,1,-3.0011994,-1.0756177)"
+ id="g2599"
+ style="opacity:0.5;filter:url(#AI_Sfocatura_1)">
+ <path
+ d="M 11.639,120.175 C 9.811,120.175 8.314,118.679 8.314,116.85 L 81.458,116.85 C 81.458,118.679 79.962,120.175 78.134,120.175 L 11.639,120.175 z"
+ id="path2601" />
+ </g>
+ <linearGradient
+ x1="6.2178001"
+ y1="65.931602"
+ x2="79.360802"
+ y2="65.931602"
+ id="XMLID_28_"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="translate(0,-1.0756177)">
+ <stop
+ id="stop2604"
+ style="stop-color:#ffffff;stop-opacity:1"
+ offset="0" />
+ <stop
+ id="stop2606"
+ style="stop-color:#eeeeec;stop-opacity:1"
+ offset="1" />
+ </linearGradient>
+ <path
+ d="M 9.542,118.05038 C 7.714,118.05038 6.218,116.55438 6.218,114.72638 L 6.218,14.986382 C 6.218,13.157382 7.714,11.661382 9.542,11.661382 L 76.037,11.661382 C 77.865,11.661382 79.361,13.157382 79.361,14.986382 L 79.361,114.72638 C 79.361,116.55438 77.865,118.05038 76.037,118.05038 L 9.542,118.05038 z"
+ id="path2608"
+ style="fill:url(#XMLID_28_)" />
+ </g>
+ <g
+ transform="translate(0,1.8317954)"
+ id="g2610">
+ <g
+ transform="matrix(1.0184218,0,0,1.0158314,-1.4821779,-1.8527316)"
+ id="g2612"
+ style="opacity:0.5;filter:url(#AI_Sfocatura_1)">
+ <path
+ d="M 10.639,117.029 C 8.811,117.029 7.314,115.532 7.314,113.704 L 7.314,13.964 C 7.314,12.135 8.811,10.639 10.639,10.639 L 77.134,10.639 C 78.962,10.639 80.458,12.135 80.458,13.964 L 80.458,113.704 C 80.458,115.532 78.962,117.029 77.134,117.029 L 10.639,117.029 z"
+ id="path2614" />
+ </g>
+ <linearGradient
+ x1="6.2178001"
+ y1="62.785599"
+ x2="79.360802"
+ y2="62.785599"
+ id="XMLID_29_"
+ gradientUnits="userSpaceOnUse">
+ <stop
+ id="stop2617"
+ style="stop-color:#ffffff;stop-opacity:1"
+ offset="0" />
+ <stop
+ id="stop2619"
+ style="stop-color:#eeeeec;stop-opacity:1"
+ offset="1" />
+ </linearGradient>
+ <path
+ d="M 9.542,115.98 C 7.714,115.98 6.218,114.483 6.218,112.656 L 6.218,12.916 C 6.218,11.087 7.714,9.591 9.542,9.591 L 76.037,9.591 C 77.865,9.591 79.361,11.087 79.361,12.916 L 79.361,112.657 C 79.361,114.484 77.865,115.981 76.037,115.981 L 9.542,115.981 L 9.542,115.98 z"
+ id="path2621"
+ style="fill:url(#XMLID_29_)" />
+ <linearGradient
+ x1="10.5708"
+ y1="10.1548"
+ x2="73.2117"
+ y2="112.4844"
+ id="XMLID_30_"
+ gradientUnits="userSpaceOnUse">
+ <stop
+ id="stop2624"
+ style="stop-color:#73bdf2;stop-opacity:1"
+ offset="0" />
+ <stop
+ id="stop2626"
+ style="stop-color:#3592ee;stop-opacity:1"
+ offset="1" />
+ </linearGradient>
+ <path
+ d="M 11.204,12.916 C 10.289,12.916 9.541,13.664 9.541,14.578 L 9.541,110.994 C 9.541,111.909 10.289,112.657 11.204,112.657 L 74.373,112.657 C 75.288,112.657 76.036,111.909 76.036,110.994 L 76.036,14.578 C 76.036,13.664 75.288,12.916 74.373,12.916 L 11.204,12.916 L 11.204,12.916 z"
+ id="path2628"
+ style="fill:url(#linearGradient3794)" />
+ </g>
+ </g>
+ <g
+ transform="matrix(0.9961334,-6.5068755e-2,6.5068755e-2,0.9961334,-5.7493275,-6.3015051)"
+ id="g2630">
+ <g
+ transform="matrix(1.0311837,0,0,1.0154411,-2.8218065,-1.9088007)"
+ id="g2632"
+ style="opacity:0.6;filter:url(#filter5869)">
+ <path
+ d="M 10.744,123.615 C 8.917,123.691 7.36,122.259 7.283,120.432 L 3.118,20.779 C 3.042,18.952 4.474,17.395 6.301,17.319 L 72.737,14.542 C 74.563,14.465 76.121,15.898 76.198,17.725 L 80.363,117.377 C 80.439,119.204 79.007,120.761 77.181,120.839 L 10.744,123.615 z"
+ id="path2634" />
+ </g>
+ <g
+ id="g2636">
+
+ <linearGradient
+ x1="3.7607"
+ y1="67.532204"
+ x2="76.909698"
+ y2="67.532204"
+ id="XMLID_31_"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(0.9991,-4.18e-2,4.18e-2,0.9991,-2.4309,1.195)">
+ <stop
+ id="stop2639"
+ style="stop-color:#ffffff;stop-opacity:1"
+ offset="0" />
+ <stop
+ id="stop2641"
+ style="stop-color:#eeeeec;stop-opacity:1"
+ offset="1" />
+ </linearGradient>
+ <path
+ d="M 9.695,121.518 C 7.868,121.595 6.311,120.163 6.234,118.335 L 2.069,18.682 C 1.993,16.855 3.425,15.298 5.252,15.222 L 71.688,12.444 C 73.514,12.368 75.072,13.8 75.149,15.627 L 79.314,115.28 C 79.391,117.106 77.959,118.663 76.131,118.741 L 9.695,121.518 z"
+ id="path2643"
+ style="fill:url(#XMLID_31_)" />
+ </g>
+ <path
+ d="M 7.051,18.474 C 6.138,18.513 5.422,19.291 5.46,20.204 L 9.486,116.535 C 9.525,117.448 10.303,118.164 11.217,118.126 L 74.331,115.489 C 75.244,115.451 75.96,114.672 75.922,113.759 L 71.897,17.427 C 71.859,16.513 71.08,15.797 70.167,15.836 L 7.051,18.474 z"
+ id="path2652"
+ style="fill:url(#linearGradient3792);fill-opacity:1" />
+ <path
+ d="M 9.5625,22.375 C 10.84375,52.927083 12.125,83.479167 13.40625,114.03125 C 32.885417,113.21875 52.364583,112.40625 71.84375,111.59375 C 70.5625,81.041667 69.28125,50.489583 68,19.9375 C 48.520833,20.75 29.041667,21.5625 9.5625,22.375 z"
+ id="path4189"
+ style="opacity:0.6;fill:none;fill-opacity:1;stroke:#ffffff;stroke-width:1;stroke-miterlimit:4;stroke-dasharray:1.00000001, 1.00000001;stroke-dashoffset:0;stroke-opacity:1" /></g>
+ <g
+ transform="matrix(0.9982563,0,0,0.9982563,10.72193,-5.1454722)"
+ id="g2654">
+ <g
+ transform="translate(-4.2156998e-8,1.0756177)"
+ id="g2656"
+ style="opacity:0.6;filter:url(#filter5873)">
+ <path
+ d="M 10.854785,112.52047 C 9.0174891,112.09656 7.8676311,110.2731 8.2990859,108.46891 L 31.839177,9.9940152 C 32.271664,8.1888112 34.127539,7.0580233 35.964835,7.481942 L 102.78149,22.901224 C 104.61776,23.325142 105.76865,25.149615 105.33616,26.954819 L 81.79607,125.42768 C 81.364615,127.23289 79.507708,128.36368 77.671444,127.93976 L 10.854785,112.52047 z"
+ id="path2658" />
+ </g>
+ <g
+ id="g2660">
+
+ <linearGradient
+ x1="16.688499"
+ y1="-8.9546003"
+ x2="94.108398"
+ y2="105.6356"
+ id="XMLID_33_"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(0.9735,0.2287,-0.2287,0.9735,14.4454,7.996)">
+ <stop
+ id="stop2663"
+ style="stop-color:#ffffff;stop-opacity:1"
+ offset="0" />
+ <stop
+ id="stop2665"
+ style="stop-color:#eeeeec;stop-opacity:1"
+ offset="1" />
+ </linearGradient>
+ <path
+ d="M 12.707,111.688 C 10.927,111.271 9.813,109.472 10.231,107.692 L 33.037,10.593 C 33.455,8.813 35.254,7.698 37.034,8.116 L 101.767,23.32 C 103.546,23.738 104.661,25.537 104.243,27.317 L 81.436,124.415 C 81.019,126.195 79.219,127.31 77.44,126.892 L 12.707,111.688 z"
+ id="path2667"
+ style="fill:url(#XMLID_33_)" />
+ </g>
+ <path
+ d="M 33.925,25.17 L 35.435,25.3 C 35.369,25.76 35.413,26.134 35.567,26.422 C 35.721,26.71 35.941,26.887 36.226,26.954 C 36.538,27.027 36.832,26.947 37.114,26.715 C 37.396,26.483 37.594,26.116 37.712,25.615 C 37.821,25.149 37.805,24.759 37.661,24.445 C 37.517,24.132 37.298,23.939 37.004,23.87 C 36.811,23.825 36.571,23.817 36.281,23.846 L 36.797,22.386 C 37.187,22.487 37.522,22.455 37.801,22.292 C 38.076,22.127 38.26,21.847 38.353,21.451 C 38.431,21.12 38.41,20.843 38.291,20.618 C 38.172,20.392 37.984,20.25 37.729,20.19 C 37.473,20.13 37.226,20.187 36.987,20.358 C 36.749,20.531 36.562,20.825 36.427,21.24 L 35.104,20.624 C 35.455,19.78 35.886,19.208 36.401,18.909 C 36.915,18.61 37.492,18.536 38.131,18.686 C 38.85,18.855 39.36,19.244 39.663,19.853 C 39.967,20.462 40.045,21.076 39.9,21.695 C 39.802,22.113 39.618,22.468 39.35,22.758 C 39.081,23.049 38.726,23.276 38.287,23.439 C 38.699,23.661 38.996,24.004 39.18,24.471 C 39.362,24.937 39.383,25.471 39.242,26.073 C 39.036,26.949 38.604,27.613 37.948,28.064 C 37.29,28.515 36.601,28.655 35.88,28.486 C 35.189,28.323 34.661,27.944 34.297,27.347 C 33.931,26.751 33.808,26.025 33.925,25.17 z"
+ id="path2676"
+ style="fill:url(#linearGradient3368);fill-opacity:1" />
+ <linearGradient
+ x1="26.294399"
+ y1="11.6704"
+ x2="71.901901"
+ y2="133.0273"
+ id="XMLID_35_"
+ gradientUnits="userSpaceOnUse">
+ <stop
+ id="stop2679"
+ style="stop-color:#ff8080;stop-opacity:1"
+ offset="0" />
+ <stop
+ id="stop2681"
+ style="stop-color:#e20800;stop-opacity:1"
+ offset="1" />
+ </linearGradient>
+ <path
+ d="M 32.977,38.964 C 33.619,37.58 34.903,36.55 35.811,35.945 C 36.752,35.319 37.49,34.55 37.729,33.53 C 38.094,31.979 36.471,30.257 34.621,31.997 C 33.74,29.616 31.507,30.433 31.143,31.984 C 30.903,33.003 31.223,34.019 31.786,35 C 32.329,35.946 33.021,37.439 32.977,38.964 z"
+ id="path2683"
+ style="fill:url(#linearGradient3352);fill-opacity:1" />
+ <path
+ d="M 80.223,109.559 L 78.711,109.43 C 78.779,108.969 78.734,108.595 78.58,108.308 C 78.426,108.02 78.205,107.842 77.922,107.776 C 77.61,107.703 77.315,107.782 77.033,108.014 C 76.751,108.246 76.553,108.614 76.433,109.114 C 76.324,109.581 76.341,109.97 76.484,110.284 C 76.629,110.598 76.849,110.79 77.142,110.859 C 77.335,110.904 77.576,110.913 77.865,110.883 L 77.349,112.343 C 76.958,112.242 76.624,112.274 76.345,112.439 C 76.07,112.603 75.886,112.883 75.792,113.279 C 75.714,113.609 75.735,113.887 75.854,114.112 C 75.973,114.339 76.161,114.481 76.416,114.541 C 76.672,114.602 76.918,114.545 77.156,114.372 C 77.394,114.2 77.582,113.906 77.717,113.49 L 79.039,114.106 C 78.689,114.95 78.258,115.521 77.742,115.82 C 77.228,116.119 76.652,116.193 76.013,116.043 C 75.294,115.874 74.783,115.486 74.48,114.876 C 74.175,114.268 74.097,113.653 74.244,113.034 C 74.342,112.616 74.525,112.262 74.795,111.971 C 75.063,111.681 75.418,111.453 75.857,111.289 C 75.445,111.069 75.146,110.725 74.964,110.259 C 74.78,109.793 74.761,109.259 74.902,108.657 C 75.109,107.78 75.541,107.117 76.197,106.666 C 76.855,106.216 77.543,106.075 78.265,106.244 C 78.956,106.406 79.484,106.786 79.849,107.382 C 80.217,107.978 80.34,108.704 80.223,109.559 z"
+ id="path2694"
+ style="fill:#e20800;fill-opacity:1" /><path
+ d="M 81.063,95.83 C 80.422,97.214 79.138,98.244 78.23,98.85 C 77.29,99.477 76.55,100.246 76.311,101.264 C 75.947,102.815 77.57,104.536 79.419,102.797 C 80.301,105.178 82.533,104.361 82.898,102.811 C 83.138,101.791 82.819,100.776 82.255,99.795 C 81.711,98.849 81.021,97.355 81.063,95.83 z"
+ id="path2701"
+ style="fill:url(#linearGradient3382);fill-opacity:1" />
+ <linearGradient
+ x1="54.356899"
+ y1="1.124"
+ x2="99.964401"
+ y2="122.481"
+ id="XMLID_39_"
+ gradientUnits="userSpaceOnUse">
+ <stop
+ id="stop2704"
+ style="stop-color:#ff8080;stop-opacity:1"
+ offset="0" />
+ <stop
+ id="stop2706"
+ style="stop-color:#e20800;stop-opacity:1"
+ offset="1" />
+ </linearGradient>
+ <path
+ d="M 63.174,42.222 C 64.361,39.656 66.742,37.748 68.427,36.625 C 70.171,35.463 71.54,34.04 71.985,32.15 C 72.66,29.274 69.651,26.081 66.22,29.307 C 64.585,24.892 60.448,26.406 59.772,29.281 C 59.329,31.172 59.921,33.055 60.965,34.873 C 61.97,36.628 63.253,39.396 63.174,42.222 z"
+ id="path2708"
+ style="fill:url(#linearGradient3370);fill-opacity:1" />
+ <linearGradient
+ x1="36.838902"
+ y1="7.7075"
+ x2="82.446297"
+ y2="129.0645"
+ id="XMLID_40_"
+ xlink:href="#XMLID_39_"
+ gradientUnits="userSpaceOnUse">
+ <stop
+ id="stop2711"
+ style="stop-color:#ff8080;stop-opacity:1"
+ offset="0" />
+ <stop
+ id="stop2713"
+ style="stop-color:#e20800;stop-opacity:1"
+ offset="1" />
+ </linearGradient>
+ <path
+ d="M 55.486,74.959 C 56.672,72.393 59.054,70.485 60.737,69.362 C 62.481,68.2 63.851,66.777 64.296,64.886 C 64.97,62.01 61.962,58.818 58.532,62.043 C 56.897,57.628 52.759,59.142 52.082,62.018 C 51.638,63.908 52.23,65.792 53.275,67.609 C 54.281,69.364 55.565,72.132 55.486,74.959 z"
+ id="path2715"
+ style="fill:url(#linearGradient3354);fill-opacity:1" />
+ <path
+ d="M 51.37,92.488 C 50.182,95.054 47.801,96.961 46.117,98.084 C 44.373,99.246 43.004,100.67 42.559,102.561 C 41.884,105.436 44.893,108.627 48.323,105.404 C 49.958,109.82 54.096,108.304 54.772,105.428 C 55.217,103.538 54.623,101.655 53.579,99.836 C 52.573,98.082 51.291,95.314 51.37,92.488 z"
+ id="path2724"
+ style="fill:url(#linearGradient3376);fill-opacity:1" />
+ </g>
+</g>
+</svg> \ No newline at end of file
diff --git a/tests/auto/qimagereader/images/rect.svgz b/tests/auto/qimagereader/images/rect.svgz
new file mode 100644
index 0000000000..c2e193b989
--- /dev/null
+++ b/tests/auto/qimagereader/images/rect.svgz
Binary files differ
diff --git a/tests/auto/qimagereader/qimagereader.pro b/tests/auto/qimagereader/qimagereader.pro
index 5b061b0e31..402e94b14b 100644
--- a/tests/auto/qimagereader/qimagereader.pro
+++ b/tests/auto/qimagereader/qimagereader.pro
@@ -9,6 +9,7 @@ RESOURCES += qimagereader.qrc
!contains(QT_CONFIG, no-jpeg):DEFINES += QTEST_HAVE_JPEG
!contains(QT_CONFIG, no-mng):DEFINES += QTEST_HAVE_MNG
!contains(QT_CONFIG, no-tiff):DEFINES += QTEST_HAVE_TIFF
+!contains(QT_CONFIG, no-svg):DEFINES += QTEST_HAVE_SVG
win32-msvc:QMAKE_CXXFLAGS -= -Zm200
win32-msvc:QMAKE_CXXFLAGS += -Zm800
diff --git a/tests/auto/qimagereader/qimagereader.qrc b/tests/auto/qimagereader/qimagereader.qrc
index bc48244935..278427be18 100644
--- a/tests/auto/qimagereader/qimagereader.qrc
+++ b/tests/auto/qimagereader/qimagereader.qrc
@@ -61,5 +61,9 @@
<file>images/four-frames.gif</file>
<file>images/qt-gif-anim.gif</file>
<file>images/qt-gif-noanim.gif</file>
+ <file>images/rect.svg</file>
+ <file>images/rect.svgz</file>
+ <file>images/corrupt.svg</file>
+ <file>images/corrupt.svgz</file>
</qresource>
</RCC>
diff --git a/tests/auto/qimagereader/tst_qimagereader.cpp b/tests/auto/qimagereader/tst_qimagereader.cpp
index 99244c2688..1b4c502896 100644
--- a/tests/auto/qimagereader/tst_qimagereader.cpp
+++ b/tests/auto/qimagereader/tst_qimagereader.cpp
@@ -245,6 +245,10 @@ void tst_QImageReader::readImage_data()
QTest::newRow("MNG: ball") << QString("ball.mng") << true << QByteArray("mng");
QTest::newRow("MNG: fire") << QString("fire.mng") << true << QByteArray("mng");
#endif
+#if defined QTEST_HAVE_SVG
+ QTest::newRow("SVG: rect") << QString("rect.svg") << true << QByteArray("svg");
+ QTest::newRow("SVGZ: rect") << QString("rect.svgz") << true << QByteArray("svgz");
+#endif
}
void tst_QImageReader::readImage()
@@ -294,7 +298,6 @@ void tst_QImageReader::readImage()
QVERIFY(!image2Reader.format().isEmpty());
}
QCOMPARE(image, image2);
-
do {
QVERIFY2(!image.isNull(), io.errorString().toLatin1().constData());
} while (!(image = io.read()).isNull());
@@ -342,6 +345,10 @@ void tst_QImageReader::setScaledSize_data()
QTest::newRow("MNG: ball") << "ball" << QSize(200, 200) << QByteArray("mng");
QTest::newRow("MNG: fire") << "fire" << QSize(200, 200) << QByteArray("mng");
#endif // QTEST_HAVE_MNG
+#if defined QTEST_HAVE_SVG
+ QTest::newRow("SVG: rect") << "rect" << QSize(200, 200) << QByteArray("svg");
+ QTest::newRow("SVGZ: rect") << "rect" << QSize(200, 200) << QByteArray("svgz");
+#endif
}
void tst_QImageReader::setScaledSize()
@@ -409,6 +416,10 @@ void tst_QImageReader::setClipRect_data()
QTest::newRow("MNG: ball") << "ball" << QRect(0, 0, 50, 50) << QByteArray("mng");
QTest::newRow("MNG: fire") << "fire" << QRect(0, 0, 50, 50) << QByteArray("mng");
#endif // QTEST_HAVE_MNG
+#if defined QTEST_HAVE_SVG
+ QTest::newRow("SVG: rect") << "rect" << QRect(0, 0, 50, 50) << QByteArray("svg");
+ QTest::newRow("SVGZ: rect") << "rect" << QRect(0, 0, 50, 50) << QByteArray("svgz");
+#endif
}
void tst_QImageReader::setClipRect()
@@ -456,6 +467,10 @@ void tst_QImageReader::setScaledClipRect_data()
QTest::newRow("MNG: ball") << "ball" << QRect(0, 0, 50, 50) << QByteArray("mng");
QTest::newRow("MNG: fire") << "fire" << QRect(0, 0, 50, 50) << QByteArray("mng");
#endif // QTEST_HAVE_MNG
+#if defined QTEST_HAVE_SVG
+ QTest::newRow("SVG: rect") << "rect" << QRect(0, 0, 50, 50) << QByteArray("svg");
+ QTest::newRow("SVGZ: rect") << "rect" << QRect(0, 0, 50, 50) << QByteArray("svgz");
+#endif
}
void tst_QImageReader::setScaledClipRect()
@@ -509,6 +524,8 @@ void tst_QImageReader::imageFormat_data()
QTest::newRow("png-2") << QString("YCbCr_cmyk.png") << QByteArray("png") << QImage::Format_RGB32;
QTest::newRow("mng-1") << QString("ball.mng") << QByteArray("mng") << QImage::Format_Invalid;
QTest::newRow("mng-2") << QString("fire.mng") << QByteArray("mng") << QImage::Format_Invalid;
+ QTest::newRow("svg") << QString("rect.svg") << QByteArray("svg") << QImage::Format_ARGB32_Premultiplied;
+ QTest::newRow("svgz") << QString("rect.svgz") << QByteArray("svgz") << QImage::Format_ARGB32_Premultiplied;
}
void tst_QImageReader::imageFormat()
@@ -530,6 +547,10 @@ void tst_QImageReader::imageFormat()
#ifndef QTEST_HAVE_MNG
return;
#endif // !QTEST_HAVE_MNG
+ if (QByteArray("svg") == format || QByteArray("svgz") == format)
+#ifndef QTEST_HAVE_SVG
+ return;
+#endif // !QTEST_HAVE_SVG
QSKIP(("Qt does not support the " + format + " format.").constData(), SkipSingle);
} else {
QCOMPARE(QImageReader::imageFormat(prefix + fileName), format);
@@ -604,6 +625,10 @@ void tst_QImageReader::setBackgroundColor_data()
QTest::newRow("MNG: ball") << QString("ball.mng") << QColor(Qt::yellow);
QTest::newRow("MNG: fire") << QString("fire.mng") << QColor(Qt::gray);
#endif
+#if defined QTEST_HAVE_SVG
+ QTest::newRow("SVG: rect") << QString("rect.svg") << QColor(Qt::darkGreen);
+ QTest::newRow("SVGZ: rect") << QString("rect.svgz") << QColor(Qt::darkGreen);
+#endif
}
void tst_QImageReader::setBackgroundColor()
@@ -641,6 +666,10 @@ void tst_QImageReader::supportsAnimation_data()
QTest::newRow("MNG: ball") << QString("ball.mng") << true;
QTest::newRow("MNG: fire") << QString("fire.mng") << true;
#endif
+#if defined QTEST_HAVE_SVG
+ QTest::newRow("SVG: rect") << QString("rect.svg") << false;
+ QTest::newRow("SVGZ: rect") << QString("rect.svgz") << false;
+#endif
}
void tst_QImageReader::supportsAnimation()
@@ -979,6 +1008,10 @@ void tst_QImageReader::readFromDevice_data()
QTest::newRow("mng-1") << QString("ball.mng") << QByteArray("mng");
QTest::newRow("mng-2") << QString("fire.mng") << QByteArray("mng");
#endif // QTEST_HAVE_MNG
+#if defined QTEST_HAVE_SVG
+ QTest::newRow("svg") << QString("rect.svg") << QByteArray("svg");
+ QTest::newRow("svgz") << QString("rect.svgz") << QByteArray("svgz");
+#endif
}
void tst_QImageReader::readFromDevice()
@@ -1059,6 +1092,10 @@ void tst_QImageReader::readFromFileAfterJunk_data()
QTest::newRow("png") << QString("kollada.png") << QByteArray("png");
// QTest::newRow("mng-1") << QString("images/ball.mng") << QByteArray("mng");
// QTest::newRow("mng-2") << QString("images/fire.mng") << QByteArray("mng");
+#if defined QTEST_HAVE_SVG
+ QTest::newRow("svg") << QString("rect.svg") << QByteArray("svg");
+ QTest::newRow("svgz") << QString("rect.svgz") << QByteArray("svgz");
+#endif
}
void tst_QImageReader::readFromFileAfterJunk()
@@ -1081,7 +1118,7 @@ void tst_QImageReader::readFromFileAfterJunk()
QVERIFY(!imageData.isNull());
int iterations = 10;
- if (format == "ppm" || format == "pbm" || format == "pgm")
+ if (format == "ppm" || format == "pbm" || format == "pgm" || format == "svg" || format == "svgz")
iterations = 1;
if (format == "mng" || !QImageWriter::supportedImageFormats().contains(format)) {
@@ -1233,6 +1270,20 @@ void tst_QImageReader::readFromResources_data()
<< QByteArray("mng") << QSize(32, 32)
<< QString("");
#endif
+#ifdef QTEST_HAVE_SVG
+ QTest::newRow("rect.svg") << QString("rect.svg")
+ << QByteArray("svg") << QSize(105, 137)
+ << QString("");
+ QTest::newRow("rect.svgz") << QString("rect.svgz")
+ << QByteArray("svgz") << QSize(105, 137)
+ << QString("");
+ QTest::newRow("corrupt.svg") << QString("corrupt.svg")
+ << QByteArray("svg") << QSize(0, 0)
+ << QString("");
+ QTest::newRow("corrupt.svgz") << QString("corrupt.svgz")
+ << QByteArray("svgz") << QSize(0, 0)
+ << QString("");
+#endif
QTest::newRow("image.pbm") << QString("image.pbm")
<< QByteArray("pbm") << QSize(16, 6)
<< QString("");
@@ -1405,6 +1456,10 @@ void tst_QImageReader::readCorruptImage_data()
#if defined QTEST_HAVE_TIFF
QTest::newRow("corrupt tiff") << QString("corrupt-data.tif") << true << QString("");
#endif
+#if defined QTEST_HAVE_SVG
+ QTest::newRow("corrupt svg") << QString("corrupt.svg") << true << QString("");
+ QTest::newRow("corrupt svgz") << QString("corrupt.svgz") << true << QString("");
+#endif
}
void tst_QImageReader::readCorruptImage()
@@ -1753,6 +1808,11 @@ void tst_QImageReader::testIgnoresFormatAndExtension_data()
#if defined QTEST_HAVE_TIFF
QTest::newRow("image_100dpi.tif") << "image_100dpi" << "tif" << "tiff";
#endif
+
+#if defined QTEST_HAVE_SVG
+ QTest::newRow("rect.svg") << "rect" << "svg" << "svg";
+ QTest::newRow("rect.svgz") << "rect" << "svgz" << "svgz";
+#endif
}
diff --git a/tests/auto/qmetaobject/tst_qmetaobject.cpp b/tests/auto/qmetaobject/tst_qmetaobject.cpp
index bb4a0d2dd3..c0b1303f00 100644
--- a/tests/auto/qmetaobject/tst_qmetaobject.cpp
+++ b/tests/auto/qmetaobject/tst_qmetaobject.cpp
@@ -706,6 +706,12 @@ void tst_QMetaObject::normalizedSignature_data()
QTest::newRow("const6") << "void foo(QList<const int>)" << "void foo(QList<const int>)";
QTest::newRow("const7") << "void foo(QList<const int*>)" << "void foo(QList<const int*>)";
QTest::newRow("const8") << "void foo(QList<int const*>)" << "void foo(QList<const int*>)";
+ QTest::newRow("const9") << "void foo(const Foo<Bar>)" << "void foo(Foo<Bar>)";
+ QTest::newRow("const10") << "void foo(Foo<Bar>const)" << "void foo(Foo<Bar>)";
+ QTest::newRow("const11") << "void foo(Foo<Bar> *const)" << "void foo(Foo<Bar>*const)";
+ QTest::newRow("const12") << "void foo(Foo<Bar>const*const *const)" << "void foo(Foo<Bar>*const*const)";
+ QTest::newRow("const13") << "void foo(const Foo<Bar>&)" << "void foo(Foo<Bar>)";
+ QTest::newRow("const14") << "void foo(Foo<Bar>const&)" << "void foo(Foo<Bar>)";
}
void tst_QMetaObject::normalizedSignature()
@@ -734,6 +740,14 @@ void tst_QMetaObject::normalizedType_data()
QTest::newRow("template7") << "QList<QList<int> >" << "QList<QList<int> >";
QTest::newRow("value1") << "const QString &" << "QString";
QTest::newRow("value2") << "QString const &" << "QString";
+ QTest::newRow("constInName1") << "constconst" << "constconst";
+ QTest::newRow("constInName2") << "constconst*" << "constconst*";
+ QTest::newRow("constInName3") << "const constconst&" << "constconst";
+ QTest::newRow("constInName4") << "constconst const*const" << "constconst*const";
+ QTest::newRow("class") << "const class foo&" << "foo";
+ QTest::newRow("struct") << "const struct foo*" << "const foo*";
+ QTest::newRow("struct2") << "struct foo const*" << "const foo*";
+ QTest::newRow("enum") << "enum foo" << "foo";
}
void tst_QMetaObject::normalizedType()
diff --git a/tests/auto/qobject/tst_qobject.cpp b/tests/auto/qobject/tst_qobject.cpp
index 8da3484cf5..08b7c19437 100644
--- a/tests/auto/qobject/tst_qobject.cpp
+++ b/tests/auto/qobject/tst_qobject.cpp
@@ -2088,6 +2088,9 @@ signals:
void typePointerConstRefSignal(Class * const &);
+ void constTemplateSignal1( Template<int > );
+ void constTemplateSignal2( Template< const int >);
+
public slots:
void uintPointerSlot(uint *) { }
void ulongPointerSlot(ulong *) { }
@@ -2124,6 +2127,10 @@ public slots:
void typeConstRefSlot(Template<Class const &> const &) {}
void typePointerConstRefSlot(Class * const &) {}
+
+ void constTemplateSlot1(Template<int > const) {}
+ void constTemplateSlot2(const Template<int > ) {}
+ void constTemplateSlot3(const Template< const int >) {}
};
#include "oldnormalizeobject.h"
@@ -2526,6 +2533,19 @@ void tst_QObject::normalize()
QVERIFY(object.connect(&object,
SIGNAL(typePointerConstRefSignal(Class*)),
SLOT(typePointerConstRefSlot(Class*))));
+
+ QVERIFY( connect(&object, SIGNAL(constTemplateSignal1(Template <int>)),
+ &object , SLOT(constTemplateSlot1 (Template<int > ) ) ));
+ QVERIFY( connect(&object, SIGNAL(constTemplateSignal1(Template <int>)),
+ &object , SLOT(constTemplateSlot2 (Template<int > ) ) ));
+ QVERIFY( connect(&object, SIGNAL(constTemplateSignal2(Template <const int>)),
+ &object , SLOT(constTemplateSlot3(Template<int const > ) ) ));
+
+ //type does not match
+ QTest::ignoreMessage(QtWarningMsg, "QObject::connect: Incompatible sender/receiver arguments\n"
+ " NormalizeObject::constTemplateSignal1(Template<int>) --> NormalizeObject::constTemplateSlot3(Template<const int>)");
+ QVERIFY(!connect(&object, SIGNAL(constTemplateSignal1(Template <int>)),
+ &object , SLOT(constTemplateSlot3(Template<int const> ) ) ));
}
class SiblingDeleter : public QObject
diff --git a/tests/auto/qscriptengine/tst_qscriptengine.cpp b/tests/auto/qscriptengine/tst_qscriptengine.cpp
index 0615b6332a..3c6c7b21ff 100644
--- a/tests/auto/qscriptengine/tst_qscriptengine.cpp
+++ b/tests/auto/qscriptengine/tst_qscriptengine.cpp
@@ -161,6 +161,7 @@ private slots:
void qRegExpInport_data();
void qRegExpInport();
+ void reentrency();
};
tst_QScriptEngine::tst_QScriptEngine()
@@ -4577,5 +4578,25 @@ void tst_QScriptEngine::qRegExpInport()
}
}
+static QScriptValue createAnotherEngine(QScriptContext *, QScriptEngine *)
+{
+ QScriptEngine eng;
+ eng.evaluate("function foo(x, y) { return x + y; }" );
+ eng.evaluate("hello = 5; world = 6" );
+ return eng.evaluate("foo(hello,world)").toInt32();
+}
+
+
+void tst_QScriptEngine::reentrency()
+{
+ QScriptEngine eng;
+ eng.globalObject().setProperty("foo", eng.newFunction(createAnotherEngine));
+ eng.evaluate("function bar() { return foo(); } hello = 9; function getHello() { return hello; }");
+ QCOMPARE(eng.evaluate("foo() + getHello() + foo()").toInt32(), 5+6 + 9 + 5+6);
+ QCOMPARE(eng.evaluate("foo").call().toInt32(), 5+6);
+ QCOMPARE(eng.evaluate("hello").toInt32(), 9);
+ QCOMPARE(eng.evaluate("foo() + hello").toInt32(), 5+6+9);
+}
+
QTEST_MAIN(tst_QScriptEngine)
#include "tst_qscriptengine.moc"
diff --git a/tests/auto/qstatictext/tst_qstatictext.cpp b/tests/auto/qstatictext/tst_qstatictext.cpp
index 16832ade53..c7801acd1c 100644
--- a/tests/auto/qstatictext/tst_qstatictext.cpp
+++ b/tests/auto/qstatictext/tst_qstatictext.cpp
@@ -69,7 +69,7 @@ private slots:
void drawToRect_data();
void drawToRect();
void setFont();
- void setMaximumSize();
+ void setTextWidth();
void prepareToCorrectData();
void prepareToWrongData();
@@ -79,6 +79,12 @@ private slots:
void projectedPainter();
void rotatedScaledAndTranslatedPainter();
void transformationChanged();
+
+ void plainTextVsRichText();
+
+ void setPenPlainText();
+ void setPenRichText();
+ void richTextOverridesPen();
};
void tst_QStaticText::init()
@@ -121,7 +127,7 @@ void tst_QStaticText::drawToPoint()
QStaticText text("Lorem ipsum dolor sit amet, consectetur adipiscing elit.");
text.setTextFormat(Qt::PlainText);
text.setPerformanceHint(performanceHint);
- p.drawStaticText(QPointF(11, 12), text);
+ p.drawStaticText(QPointF(11, 12 - QFontMetricsF(p.font()).ascent()), text);
}
QCOMPARE(imageDrawStaticText, imageDrawText);
@@ -150,12 +156,19 @@ void tst_QStaticText::drawToRect()
imageDrawStaticText.fill(Qt::white);
{
QPainter p(&imageDrawStaticText);
- QStaticText text("Lorem ipsum dolor sit amet, consectetur adipiscing elit.", QSizeF(10, 500));
+ QStaticText text("Lorem ipsum dolor sit amet, consectetur adipiscing elit.");
+ text.setTextWidth(10),
+ p.setClipRect(QRectF(11, 12, 10, 500));
text.setPerformanceHint(performanceHint);
text.setTextFormat(Qt::PlainText);
p.drawStaticText(QPointF(11, 12), text);
}
+#if defined(DEBUG_SAVE_IMAGE)
+ imageDrawText.save("drawToRect_imageDrawText.png");
+ imageDrawStaticText.save("drawToRect_imageDrawStaticText.png");
+#endif
+
QCOMPARE(imageDrawStaticText, imageDrawText);
}
@@ -181,7 +194,7 @@ void tst_QStaticText::prepareToCorrectData()
QStaticText text("Lorem ipsum dolor sit amet, consectetur adipiscing elit.");
text.prepare(transform, p.font());
text.setTextFormat(Qt::PlainText);
- p.drawStaticText(QPointF(11, 12), text);
+ p.drawStaticText(QPointF(11, 12 - QFontMetricsF(p.font()).ascent()), text);
}
if (!supportsTransformations())
@@ -209,7 +222,7 @@ void tst_QStaticText::prepareToWrongData()
QStaticText text("Lorem ipsum dolor sit amet, consectetur adipiscing elit.");
text.prepare(transform, p.font());
text.setTextFormat(Qt::PlainText);
- p.drawStaticText(QPointF(11, 12), text);
+ p.drawStaticText(QPointF(11, 12 - QFontMetricsF(p.font()).ascent()), text);
}
QCOMPARE(imageDrawStaticText, imageDrawText);
@@ -226,10 +239,10 @@ void tst_QStaticText::setFont()
imageDrawText.fill(Qt::white);
{
QPainter p(&imageDrawText);
- p.drawText(0, 0, "Lorem ipsum dolor sit amet, consectetur adipiscing elit.");
+ p.drawText(QRectF(0, 0, 1000, 1000), 0, "Lorem ipsum dolor sit amet, consectetur adipiscing elit.");
p.setFont(font);
- p.drawText(11, 120, "Lorem ipsum dolor sit amet, consectetur adipiscing elit.");
+ p.drawText(QRectF(11, 120, 1000, 1000), 0, "Lorem ipsum dolor sit amet, consectetur adipiscing elit.");
}
QPixmap imageDrawStaticText(1000, 1000);
@@ -247,10 +260,15 @@ void tst_QStaticText::setFont()
p.drawStaticText(11, 120, text);
}
+#if defined(DEBUG_SAVE_IMAGE)
+ imageDrawText.save("setFont_imageDrawText.png");
+ imageDrawStaticText.save("setFont_imageDrawStaticText.png");
+#endif
+
QCOMPARE(imageDrawStaticText, imageDrawText);
}
-void tst_QStaticText::setMaximumSize()
+void tst_QStaticText::setTextWidth()
{
QPixmap imageDrawText(1000, 1000);
imageDrawText.fill(Qt::white);
@@ -264,7 +282,8 @@ void tst_QStaticText::setMaximumSize()
{
QPainter p(&imageDrawStaticText);
QStaticText text("Lorem ipsum dolor sit amet, consectetur adipiscing elit.");
- text.setMaximumSize(QSizeF(10, 500));
+ text.setTextWidth(10);
+ p.setClipRect(QRectF(11, 12, 10, 500));
p.drawStaticText(QPointF(11, 12), text);
}
@@ -291,7 +310,7 @@ void tst_QStaticText::translatedPainter()
QStaticText text("Lorem ipsum dolor sit amet, consectetur adipiscing elit.");
text.setTextFormat(Qt::PlainText);
- p.drawStaticText(QPointF(11, 12), text);
+ p.drawStaticText(QPointF(11, 12 - QFontMetricsF(p.font()).ascent()), text);
}
QCOMPARE(imageDrawStaticText, imageDrawText);
@@ -323,7 +342,7 @@ void tst_QStaticText::rotatedPainter()
{
QPainter p(&imageDrawText);
p.rotate(30.0);
- p.drawText(0, 0, "Lorem ipsum dolor sit amet, consectetur adipiscing elit.");
+ p.drawText(QRectF(0, 0, 1000, 100), 0, "Lorem ipsum dolor sit amet, consectetur adipiscing elit.");
}
QPixmap imageDrawStaticText(1000, 1000);
@@ -367,7 +386,7 @@ void tst_QStaticText::scaledPainter()
QStaticText text("Lorem ipsum dolor sit amet, consectetur adipiscing elit.");
text.setTextFormat(Qt::PlainText);
- p.drawStaticText(QPointF(11, 12), text);
+ p.drawStaticText(QPointF(11, 12 - QFontMetricsF(p.font()).ascent()), text);
}
if (!supportsTransformations())
@@ -398,7 +417,7 @@ void tst_QStaticText::projectedPainter()
QStaticText text("Lorem ipsum dolor sit amet, consectetur adipiscing elit.");
text.setTextFormat(Qt::PlainText);
- p.drawStaticText(QPointF(11, 12), text);
+ p.drawStaticText(QPointF(11, 12 - QFontMetricsF(p.font()).ascent()), text);
}
QCOMPARE(imageDrawStaticText, imageDrawText);
@@ -428,7 +447,7 @@ void tst_QStaticText::rotatedScaledAndTranslatedPainter()
QStaticText text("Lorem ipsum dolor sit amet, consectetur adipiscing elit.");
text.setTextFormat(Qt::PlainText);
- p.drawStaticText(QPointF(11, 12), text);
+ p.drawStaticText(QPointF(11, 12 - QFontMetricsF(p.font()).ascent()), text);
}
#if defined(DEBUG_SAVE_IMAGE)
@@ -450,10 +469,10 @@ void tst_QStaticText::transformationChanged()
p.rotate(33.0);
p.scale(0.5, 0.7);
- p.drawText(0, 0, "Lorem ipsum dolor sit amet, consectetur adipiscing elit.");
+ p.drawText(QRectF(0, 0, 1000, 1000), 0, "Lorem ipsum dolor sit amet, consectetur adipiscing elit.");
p.scale(7.0, 5.0);
- p.drawText(0, 0, "Lorem ipsum dolor sit amet, consectetur adipiscing elit.");
+ p.drawText(QRectF(0, 0, 1000, 1000), 0, "Lorem ipsum dolor sit amet, consectetur adipiscing elit.");
}
QPixmap imageDrawStaticText(1000, 1000);
@@ -482,5 +501,125 @@ void tst_QStaticText::transformationChanged()
QCOMPARE(imageDrawStaticText, imageDrawText);
}
+void tst_QStaticText::plainTextVsRichText()
+{
+ QPixmap imagePlainText(1000, 1000);
+ imagePlainText.fill(Qt::white);
+ {
+ QPainter p(&imagePlainText);
+
+ QStaticText staticText;
+ staticText.setText("FOObar");
+ staticText.setTextFormat(Qt::PlainText);
+
+ p.drawStaticText(10, 10, staticText);
+ }
+
+ QPixmap imageRichText(1000, 1000);
+ imageRichText.fill(Qt::white);
+ {
+ QPainter p(&imageRichText);
+
+ QStaticText staticText;
+ staticText.setText("<html><body>FOObar</body></html>");
+ staticText.setTextFormat(Qt::RichText);
+
+ p.drawStaticText(10, 10, staticText);
+ }
+
+#if defined(DEBUG_SAVE_IMAGE)
+ imagePlainText.save("plainTextVsRichText_imagePlainText.png");
+ imageRichText.save("plainTextVsRichText_imageRichText.png");
+#endif
+
+ QCOMPARE(imagePlainText, imageRichText);
+}
+
+void tst_QStaticText::setPenPlainText()
+{
+ QFont font = QApplication::font();
+ font.setStyleStrategy(QFont::NoAntialias);
+
+ QFontMetricsF fm(font);
+ QPixmap image(qCeil(fm.width("XXXXX")), qCeil(fm.height()));
+ image.fill(Qt::white);
+ {
+ QPainter p(&image);
+ p.setFont(font);
+ p.setPen(Qt::green);
+
+ QStaticText staticText("XXXXX");
+ staticText.setTextFormat(Qt::PlainText);
+ p.drawStaticText(0, fm.ascent(), staticText);
+ }
+
+ QImage img = image.toImage();
+ for (int x=0; x<img.width(); ++x) {
+ for (int y=0; y<img.height(); ++y) {
+ QRgb pixel = img.pixel(x, y);
+ QVERIFY(pixel == QColor(Qt::white).rgba()
+ || pixel == QColor(Qt::green).rgba());
+ }
+ }
+}
+
+void tst_QStaticText::setPenRichText()
+{
+ QFont font = QApplication::font();
+ font.setStyleStrategy(QFont::NoAntialias);
+
+ QFontMetricsF fm(font);
+ QPixmap image(qCeil(fm.width("XXXXX")), qCeil(fm.height()));
+ image.fill(Qt::white);
+ {
+ QPainter p(&image);
+ p.setFont(font);
+ p.setPen(Qt::green);
+
+ QStaticText staticText;
+ staticText.setText("<html><body>XXXXX</body></html>");
+ staticText.setTextFormat(Qt::RichText);
+ p.drawStaticText(0, 0, staticText);
+ }
+
+ QImage img = image.toImage();
+ for (int x=0; x<img.width(); ++x) {
+ for (int y=0; y<img.height(); ++y) {
+ QRgb pixel = img.pixel(x, y);
+ QVERIFY(pixel == QColor(Qt::white).rgba()
+ || pixel == QColor(Qt::green).rgba());
+ }
+ }
+}
+
+void tst_QStaticText::richTextOverridesPen()
+{
+ QFont font = QApplication::font();
+ font.setStyleStrategy(QFont::NoAntialias);
+
+ QFontMetricsF fm(font);
+ QPixmap image(qCeil(fm.width("XXXXX")), qCeil(fm.height()));
+ image.fill(Qt::white);
+ {
+ QPainter p(&image);
+ p.setFont(font);
+ p.setPen(Qt::green);
+
+ QStaticText staticText;
+ staticText.setText("<html><body><font color=\"#ff0000\">XXXXX</font></body></html>");
+ staticText.setTextFormat(Qt::RichText);
+ p.drawStaticText(0, 0, staticText);
+ }
+
+ QImage img = image.toImage();
+ for (int x=0; x<img.width(); ++x) {
+ for (int y=0; y<img.height(); ++y) {
+ QRgb pixel = img.pixel(x, y);
+ QVERIFY(pixel == QColor(Qt::white).rgba()
+ || pixel == QColor(Qt::red).rgba());
+ }
+ }
+}
+
QTEST_MAIN(tst_QStaticText)
#include "tst_qstatictext.moc"
diff --git a/tests/auto/qtextcodec/tst_qtextcodec.cpp b/tests/auto/qtextcodec/tst_qtextcodec.cpp
index 1c64ade6e1..4e7123f33a 100644
--- a/tests/auto/qtextcodec/tst_qtextcodec.cpp
+++ b/tests/auto/qtextcodec/tst_qtextcodec.cpp
@@ -2178,6 +2178,45 @@ void tst_QTextCodec::moreToFromUnicode_data() {
koi8_u_ba.append(x);
}
QTest::newRow("KOI8-U") << QByteArray("KOI8-U") << koi8_u_ba;
+
+
+ QByteArray big5_ba;
+ for (unsigned char u=0xa1; u<=0xf9; u++) {
+ if (u==0xc8) {
+ continue;
+ }
+ for (unsigned char v=0x40; v<=0x7e; v++) {
+ big5_ba.append(u);
+ big5_ba.append(v);
+ }
+ unsigned char v_up;
+ switch (u) {
+ case 0xa3: v_up=0xbf; break;
+ case 0xc7: v_up=0xfc; break;
+ case 0xf9: v_up=0xd5; break;
+ default: v_up=0xfe;
+ }
+
+ for (unsigned char v=0xa1; v<=v_up; v++) {
+ if (u==0xa2 && (v==0xcc || v==0xce)) {
+ continue;
+ }
+ big5_ba.append(u);
+ big5_ba.append(v);
+ }
+ }
+
+ QTest::newRow("BIG5") << QByteArray("BIG5") << big5_ba;
+
+ QByteArray gb2312_ba;
+ for (unsigned char u=0xa1; u<=0xf7; u++) {
+ for (unsigned char v=0xa1; v<=0xfe; v++) {
+ gb2312_ba.append(u);
+ gb2312_ba.append(v);
+ }
+ }
+
+ QTest::newRow("GB2312") << QByteArray("GB2312") << gb2312_ba;
}
void tst_QTextCodec::moreToFromUnicode()
diff --git a/tests/auto/qtextscriptengine/tst_qtextscriptengine.cpp b/tests/auto/qtextscriptengine/tst_qtextscriptengine.cpp
index 841f5b90c7..018c036722 100644
--- a/tests/auto/qtextscriptengine/tst_qtextscriptengine.cpp
+++ b/tests/auto/qtextscriptengine/tst_qtextscriptengine.cpp
@@ -1068,6 +1068,42 @@ void tst_QTextScriptEngine::greek()
QSKIP("couln't find DejaVu Sans", SkipAll);
}
}
+
+ {
+ if (QFontDatabase().families(QFontDatabase::Any).contains("SBL Greek")) {
+ QFont f("SBL Greek");
+ for (int uc = 0x1f00; uc <= 0x1fff; ++uc) {
+ QString str;
+ str.append(uc);
+ if (str.normalized(QString::NormalizationForm_D).normalized(QString::NormalizationForm_C) != str) {
+ //qDebug() << "skipping" << hex << uc;
+ continue;
+ }
+ if (uc == 0x1fc1 || uc == 0x1fed)
+ continue;
+ QVERIFY( decomposedShaping(f, QChar(uc) ) );
+
+ }
+
+ const ShapeTable shape_table [] = {
+ { { 0x3b1, 0x300, 0x313, 0x0 },
+ { 0xb8, 0x3d3, 0x3c7, 0x0 } },
+ { { 0x3b1, 0x313, 0x300, 0x0 },
+ { 0xd4, 0x0 } },
+
+ { {0}, {0} }
+ };
+
+
+ const ShapeTable *s = shape_table;
+ while (s->unicode[0]) {
+ QVERIFY( shaping(f, s) );
+ ++s;
+ }
+ } else {
+ QSKIP("couln't find SBL_grk", SkipAll);
+ }
+ }
#else
QSKIP("X11 specific test", SkipAll);
#endif
diff --git a/tests/auto/qtreeview/tst_qtreeview.cpp b/tests/auto/qtreeview/tst_qtreeview.cpp
index bdc0a0c476..2de189d8fc 100644
--- a/tests/auto/qtreeview/tst_qtreeview.cpp
+++ b/tests/auto/qtreeview/tst_qtreeview.cpp
@@ -237,6 +237,7 @@ private slots:
void task245654_changeModelAndExpandAll();
void doubleClickedWithSpans();
void taskQTBUG_6450_selectAllWith1stColumnHidden();
+ void taskQTBUG_9216_setSizeAndUniformRowHeightsWrongRepaint();
};
class QtTestModel: public QAbstractItemModel
@@ -3714,5 +3715,43 @@ void tst_QTreeView::taskQTBUG_6450_selectAllWith1stColumnHidden()
QVERIFY(tree.selectionModel()->isRowSelected(i, QModelIndex()));
}
+class TreeViewQTBUG_9216 : public QTreeView
+{
+ Q_OBJECT
+public:
+ void paintEvent(QPaintEvent *event)
+ {
+ if (doCompare)
+ QCOMPARE(event->rect(), viewport()->rect());
+ QTreeView::paintEvent(event);
+ painted++;
+ }
+ int painted;
+ bool doCompare;
+};
+
+void tst_QTreeView::taskQTBUG_9216_setSizeAndUniformRowHeightsWrongRepaint()
+{
+ QStandardItemModel model(10, 10, this);
+ for (int row = 0; row < 10; row++)
+ for (int col = 0; col < 10; col++)
+ model.setItem(row, col, new QStandardItem(QString("row %0, col %1").arg(row).arg(col)));
+ TreeViewQTBUG_9216 view;
+ view.setUniformRowHeights(true);
+ view.setModel(&model);
+ view.painted = 0;
+ view.doCompare = false;
+ view.show();
+ QTest::qWaitForWindowShown(&view);
+ QTRY_VERIFY(view.painted > 0);
+
+ QTest::qWait(100); // This one is needed to make the test fail before the patch.
+ view.painted = 0;
+ view.doCompare = true;
+ model.setData(model.index(0, 0), QVariant(QSize(50, 50)), Qt::SizeHintRole);
+ QTest::qWait(100);
+ QTRY_VERIFY(view.painted > 0);
+}
+
QTEST_MAIN(tst_QTreeView)
#include "tst_qtreeview.moc"
diff --git a/tests/auto/qvarlengtharray/tst_qvarlengtharray.cpp b/tests/auto/qvarlengtharray/tst_qvarlengtharray.cpp
index 1c43069eca..5708726bd0 100644
--- a/tests/auto/qvarlengtharray/tst_qvarlengtharray.cpp
+++ b/tests/auto/qvarlengtharray/tst_qvarlengtharray.cpp
@@ -133,6 +133,12 @@ void tst_QVarLengthArray::oldTests()
QVERIFY(sa.data() == &sa[0]);
QVERIFY(sa[0] == 0xfee);
QVERIFY(sa[10] == 0xff);
+ QVERIFY(sa.at(0) == 0xfee);
+ QVERIFY(sa.at(10) == 0xff);
+ QVERIFY(sa.value(0) == 0xfee);
+ QVERIFY(sa.value(10) == 0xff);
+ QVERIFY(sa.value(1000) == 0);
+ QVERIFY(sa.value(1000, 12) == 12);
QVERIFY(sa.size() == 512);
sa.reserve(1024);
QVERIFY(sa.capacity() == 1024);
@@ -168,6 +174,13 @@ void tst_QVarLengthArray::oldTests()
QCOMPARE(sa.size(), 12);
QCOMPARE(sa[10], QString("hello"));
QCOMPARE(sa[11], QString("world"));
+ QCOMPARE(sa.at(10), QString("hello"));
+ QCOMPARE(sa.at(11), QString("world"));
+ QCOMPARE(sa.value(10), QString("hello"));
+ QCOMPARE(sa.value(11), QString("world"));
+ QCOMPARE(sa.value(10000), QString());
+ QCOMPARE(sa.value(1212112, QString("none")), QString("none"));
+ QCOMPARE(sa.value(-12, QString("neg")), QString("neg"));
sa.append(arr, 1);
QCOMPARE(sa.size(), 13);
diff --git a/tests/benchmarks/declarative/typeimports/data/QmlTestType1.qml b/tests/benchmarks/declarative/typeimports/data/QmlTestType1.qml
new file mode 100644
index 0000000000..f359b85084
--- /dev/null
+++ b/tests/benchmarks/declarative/typeimports/data/QmlTestType1.qml
@@ -0,0 +1,2 @@
+import Qt.test 2.0
+TestType1 { }
diff --git a/tests/benchmarks/declarative/typeimports/data/QmlTestType2.qml b/tests/benchmarks/declarative/typeimports/data/QmlTestType2.qml
new file mode 100644
index 0000000000..b6fabe6d24
--- /dev/null
+++ b/tests/benchmarks/declarative/typeimports/data/QmlTestType2.qml
@@ -0,0 +1,2 @@
+import Qt.test 2.0
+TestType2 { }
diff --git a/tests/benchmarks/declarative/typeimports/data/QmlTestType3.qml b/tests/benchmarks/declarative/typeimports/data/QmlTestType3.qml
new file mode 100644
index 0000000000..6a30887ab7
--- /dev/null
+++ b/tests/benchmarks/declarative/typeimports/data/QmlTestType3.qml
@@ -0,0 +1,2 @@
+import Qt.test 2.0
+TestType3 { }
diff --git a/tests/benchmarks/declarative/typeimports/data/QmlTestType4.qml b/tests/benchmarks/declarative/typeimports/data/QmlTestType4.qml
new file mode 100644
index 0000000000..5cc8a6bc62
--- /dev/null
+++ b/tests/benchmarks/declarative/typeimports/data/QmlTestType4.qml
@@ -0,0 +1,2 @@
+import Qt.test 2.0
+TestType4 { }
diff --git a/tests/benchmarks/declarative/typeimports/data/cpp.qml b/tests/benchmarks/declarative/typeimports/data/cpp.qml
new file mode 100644
index 0000000000..11ee4e693f
--- /dev/null
+++ b/tests/benchmarks/declarative/typeimports/data/cpp.qml
@@ -0,0 +1,15 @@
+import Qt.test 2.0
+
+TestType1 {
+ TestType1 { } TestType2 { } TestType3 { } TestType4 { }
+ TestType1 { } TestType2 { } TestType3 { } TestType4 { }
+ TestType1 { } TestType2 { } TestType3 { } TestType4 { }
+ TestType1 { } TestType2 { } TestType3 { } TestType4 { }
+ TestType1 { } TestType2 { } TestType3 { } TestType4 { }
+
+ TestType1 { } TestType2 { } TestType3 { } TestType4 { }
+ TestType1 { } TestType2 { } TestType3 { } TestType4 { }
+ TestType1 { } TestType2 { } TestType3 { } TestType4 { }
+ TestType1 { } TestType2 { } TestType3 { } TestType4 { }
+ TestType1 { } TestType2 { } TestType3 { } TestType4 { }
+}
diff --git a/tests/benchmarks/declarative/typeimports/data/qml.qml b/tests/benchmarks/declarative/typeimports/data/qml.qml
new file mode 100644
index 0000000000..d776bcf65f
--- /dev/null
+++ b/tests/benchmarks/declarative/typeimports/data/qml.qml
@@ -0,0 +1,13 @@
+QmlTestType1 {
+ QmlTestType1 { } QmlTestType2 { } QmlTestType3 { } QmlTestType4 { }
+ QmlTestType1 { } QmlTestType2 { } QmlTestType3 { } QmlTestType4 { }
+ QmlTestType1 { } QmlTestType2 { } QmlTestType3 { } QmlTestType4 { }
+ QmlTestType1 { } QmlTestType2 { } QmlTestType3 { } QmlTestType4 { }
+ QmlTestType1 { } QmlTestType2 { } QmlTestType3 { } QmlTestType4 { }
+
+ QmlTestType1 { } QmlTestType2 { } QmlTestType3 { } QmlTestType4 { }
+ QmlTestType1 { } QmlTestType2 { } QmlTestType3 { } QmlTestType4 { }
+ QmlTestType1 { } QmlTestType2 { } QmlTestType3 { } QmlTestType4 { }
+ QmlTestType1 { } QmlTestType2 { } QmlTestType3 { } QmlTestType4 { }
+ QmlTestType1 { } QmlTestType2 { } QmlTestType3 { } QmlTestType4 { }
+}
diff --git a/tests/benchmarks/declarative/typeimports/tst_typeimports.cpp b/tests/benchmarks/declarative/typeimports/tst_typeimports.cpp
new file mode 100644
index 0000000000..b92ab4673d
--- /dev/null
+++ b/tests/benchmarks/declarative/typeimports/tst_typeimports.cpp
@@ -0,0 +1,138 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite 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 Technology Preview License Agreement accompanying
+** this package.
+**
+** 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.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <qtest.h>
+#include <QDeclarativeEngine>
+#include <QDeclarativeComponent>
+#include <QDebug>
+
+#ifdef Q_OS_SYMBIAN
+// In Symbian OS test data is located in applications private dir
+// Application private dir is default serach path for files, so SRCDIR can be set to empty
+#define SRCDIR ""
+#endif
+
+class tst_typeimports : public QObject
+{
+ Q_OBJECT
+public:
+ tst_typeimports();
+
+private slots:
+ void cpp();
+ void qml();
+
+private:
+ QDeclarativeEngine engine;
+};
+
+class TestType1 : public QObject
+{
+ Q_OBJECT
+ Q_PROPERTY(QDeclarativeListProperty<QObject> resources READ resources);
+ Q_CLASSINFO("DefaultProperty", "resources");
+public:
+ TestType1(QObject *parent = 0) : QObject(parent) {}
+
+ QDeclarativeListProperty<QObject> resources() {
+ return QDeclarativeListProperty<QObject>(this, 0, resources_append);
+ }
+
+ static void resources_append(QDeclarativeListProperty<QObject> *p, QObject *o) {
+ o->setParent(p->object);
+ }
+};
+
+class TestType2 : public TestType1
+{
+ Q_OBJECT
+public:
+ TestType2(QObject *parent = 0) : TestType1(parent) {}
+};
+
+
+class TestType3 : public TestType1
+{
+ Q_OBJECT
+public:
+ TestType3(QObject *parent = 0) : TestType1(parent) {}
+};
+
+class TestType4 : public TestType1
+{
+ Q_OBJECT
+public:
+ TestType4(QObject *parent = 0) : TestType1(parent) {}
+};
+
+
+tst_typeimports::tst_typeimports()
+{
+ qmlRegisterType<TestType1>("Qt.test", 1, 0, "TestType1");
+ qmlRegisterType<TestType2>("Qt.test", 1, 0, "TestType2");
+ qmlRegisterType<TestType3>("Qt.test", 2, 0, "TestType3");
+ qmlRegisterType<TestType4>("Qt.test", 2, 0, "TestType4");
+}
+
+inline QUrl TEST_FILE(const QString &filename)
+{
+ return QUrl::fromLocalFile(QLatin1String(SRCDIR) + QLatin1String("/data/") + filename);
+}
+
+void tst_typeimports::cpp()
+{
+ QBENCHMARK {
+ QDeclarativeComponent component(&engine, TEST_FILE("cpp.qml"));
+ QVERIFY(component.isReady());
+ }
+}
+
+void tst_typeimports::qml()
+{
+ QBENCHMARK {
+ QDeclarativeComponent component(&engine, TEST_FILE("qml.qml"));
+ QVERIFY(component.isReady());
+ }
+}
+
+QTEST_MAIN(tst_typeimports)
+
+#include "tst_typeimports.moc"
diff --git a/tests/benchmarks/declarative/typeimports/typeimports.pro b/tests/benchmarks/declarative/typeimports/typeimports.pro
new file mode 100644
index 0000000000..8a74e0dab4
--- /dev/null
+++ b/tests/benchmarks/declarative/typeimports/typeimports.pro
@@ -0,0 +1,15 @@
+load(qttest_p4)
+TEMPLATE = app
+TARGET = tst_typeimports
+QT += declarative
+macx:CONFIG -= app_bundle
+
+SOURCES += tst_typeimports.cpp
+
+symbian* {
+ data.sources = data/*
+ data.path = data
+ DEPLOYMENT += addFiles
+} else {
+ DEFINES += SRCDIR=\\\"$$PWD\\\"
+} \ No newline at end of file
diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp
index 0b14cba13a..dfd1196113 100644
--- a/tools/configure/configureapp.cpp
+++ b/tools/configure/configureapp.cpp
@@ -3041,6 +3041,10 @@ void Configure::generateConfigfiles()
if(dictionary["S60"] == "no") qconfigList += "QT_NO_S60";
if(dictionary["NATIVE_GESTURES"] == "no") qconfigList += "QT_NO_NATIVE_GESTURES";
+ if(dictionary["OPENGL_ES_CM"] == "no" &&
+ dictionary["OPENGL_ES_2"] == "no" &&
+ dictionary["OPENVG"] == "no") qconfigList += "QT_NO_EGL";
+
if(dictionary["OPENGL_ES_CM"] == "yes" ||
dictionary["OPENGL_ES_2"] == "yes") qconfigList += "QT_OPENGL_ES";
diff --git a/tools/qdoc3/doc/examples/main.cpp b/tools/qdoc3/doc/examples/main.cpp
index e2cf6c5e99..e439d3e453 100644
--- a/tools/qdoc3/doc/examples/main.cpp
+++ b/tools/qdoc3/doc/examples/main.cpp
@@ -46,7 +46,7 @@ int main(int argc, char *argv[])
{
QApplication app(argc, argv);
- QPushButton *hello("Hello world!");
+ QPushButton hello("Hello world!");
hello.resize(100, 30);
hello.show();
diff --git a/tools/qdoc3/doc/qdoc-manual.qdoc b/tools/qdoc3/doc/qdoc-manual.qdoc
index e2f670c0a0..482af467b5 100644
--- a/tools/qdoc3/doc/qdoc-manual.qdoc
+++ b/tools/qdoc3/doc/qdoc-manual.qdoc
@@ -78,10 +78,10 @@
\endlist
\o \l{QDoc Configuration}
\list
- \o \l{General Variables}
+ \o \l{General Configuration Variables}
\o \l{Creating Help Project Files}
- \o \l{C++ Specific Variables}
- \o \l{HTML Specific Variables}
+ \o \l{C++ Specific Configuration Variables}
+ \o \l{HTML Specific Configuration Variables}
\o \l{Supporting Derived Projects}
\o \l{QDoc Compatibility}
\o \l{qt.qdocconf}
@@ -1425,6 +1425,7 @@
\quotefromfile examples/main.cpp
+ \skipto QApplication
\printline QApplication
This line includes the QApplication class
@@ -1652,6 +1653,7 @@
can press and release.
\quotefromfile examples/main.cpp
+ \skipto QApplication
\skipline QApplication
\printline QPushButton
@@ -6974,7 +6976,7 @@
\page 21-0-qdoc-configuration.html
\previouspage Title Commands
\contentspage QDoc Manual - Table of Contents
- \nextpage General Variables
+ \nextpage General Configuration Variables
\title QDoc Configuration
@@ -7094,9 +7096,9 @@
\section2 Categories
\list
- \o \l {General Variables}
- \o \l {C++ Specific Variables}
- \o \l {HTML Specific Variables}
+ \o \l {General Configuration Variables}
+ \o \l {C++ Specific Configuration Variables}
+ \o \l {HTML Specific Configuration Variables}
\endlist
\section1 Configuration File Examples
@@ -7133,7 +7135,7 @@
\contentspage QDoc Manual - Table of Contents
\nextpage Creating Help Project Files
- \title General Variables
+ \title General Configuration Variables
With the general QDoc configuration variables, you can define
where QDoc will find the various source files it needs to generate
@@ -7215,7 +7217,7 @@
QDoc originally used a hard-coded value of four spaces for
code indentation to ensure that code snippets could be easily
distinguished from surrounding text. Since we can use
- \l{HTML Specific Variables#HTML.stylesheets}{stylesheets} to
+ \l{HTML Specific Configuration Variables#HTML.stylesheets}{stylesheets} to
adjust the appearance of certain types of HTML elements, this
level of indentation is not always required.
@@ -7572,7 +7574,7 @@
\code
header.fileextensions += *.H
\endcode
-
+
\warning The above assignment may not work as described.
See also \l headerdirs.
@@ -7730,6 +7732,27 @@
bold font, and that \\raisedaster renders a '*'.
\row
+ \o \bold naturallanguage \target naturallanguage
+ \o \bold {The \c naturallanguage variable specifies the natural
+ language used for the documentation generated by qdoc.}
+
+ For example:
+
+ \code
+ naturallanguage = zh-Hans
+ \endcode
+
+ By default, the natural language is \c en for compatibility
+ with legacy documentation.
+
+ qdoc will add the natural language information to the HTML
+ it generates, using the \c lang and \c xml:lang attributes.
+
+ See also \l sourceencoding, \l outputencoding,
+ \l{http://www.w3.org/TR/xhtml1/#C_7}{C.7. The lang and xml:lang Attributes} and
+ \l{http://www.w3.org/TR/i18n-html-tech-lang/#ri20040429.113217290}{Best Practice 13: Using Hans and Hant codes}.
+
+ \row
\o \bold outputdir \target outputdir
\o \bold {The \c outputdir variable specifies the directory
where QDoc will put the generated documentation.}
@@ -7754,6 +7777,31 @@
directory, all files from the previous run will be lost.
\row
+ \o \bold outputencoding \target outputencoding
+ \o \bold {The \c outputencoding variable specifies the encoding
+ used for the documentation generated by qdoc.}
+
+ For example:
+
+ \code
+ outputencoding = UTF-8
+ \endcode
+
+ By default, the output encoding is \c ISO-8859-1 (Latin1) for
+ compatibility with legacy documentation. When generating
+ documentation for some languages, particularly non-European
+ languages, this is not sufficient and an encoding such as UTF-8
+ is required.
+
+ qdoc will encode HTML using this encoding and generate the
+ correct declarations to indicate to browsers which encoding
+ is being used. The \l naturallanguage configuration variable
+ should also be specified to provide browsers with a complete
+ set of character encoding and language information.
+
+ See also \l outputencoding and \l naturallanguage.
+
+ \row
\o \bold outputformats \target outputformats
\o \bold {The \c outputformats variable specifies the format of
the generated documentation.}
@@ -7831,6 +7879,30 @@
See also \l sources and \l sources.fileextensions.
\row
+ \o \bold sourceencoding \target sourceencoding
+ \o \bold {The \c sourceencoding variable specifies the encoding
+ used for the source code and documentation.}
+
+ For example:
+
+ \code
+ sourceencoding = UTF-8
+ \endcode
+
+ By default, the source encoding is \c ISO-8859-1 (Latin1) for
+ compatibility with legacy documentation. For some languages,
+ particularly non-European languages, this is not sufficient
+ and an encoding such as UTF-8 is required.
+
+ Although qdoc will use the encoding to read source and
+ documentation files, limitations of C++ compilers may prevent
+ you from using non-ASCII characters in source code comments.
+ In cases like these, it is possible to write API documentation
+ completely in documentation files.
+
+ See also \l naturallanguage and \l outputencoding.
+
+ \row
\o \bold sources \target sources
\o \bold {The \c sources variable allows you to specify
individual source files in addition to those located in the
@@ -7973,9 +8045,9 @@
/*!
\page 22-creating-help-project-files.html
- \previouspage General Variables
+ \previouspage General Configuration Variables
\contentspage QDoc Manual - Table of Contents
- \nextpage C++ Specific Variables
+ \nextpage C++ Specific Configuration Variables
\title Creating Help Project Files
@@ -8023,9 +8095,9 @@
\page 23-qdoc-configuration-cppvariables.html
\previouspage Creating Help Project Files
\contentspage QDoc Manual - Table of Contents
- \nextpage HTML Specific Variables
+ \nextpage HTML Specific Configuration Variables
- \title C++ Specific Variables
+ \title C++ Specific Configuration Variables
The C++ specific configuration variables are provided to avoid
erroneous documentation due to non-standard C++ constructs.
@@ -8159,11 +8231,11 @@
/*!
\page 24-qdoc-configuration-htmlvariables.html
- \previouspage C++ Specific Variables
+ \previouspage C++ Specific Configuration Variables
\contentspage QDoc Manual - Table of Contents
\nextpage Supporting Derived Projects
- \title HTML Specific Variables
+ \title HTML Specific Configuration Variables
The HTML specific configuration variables define the generated
documentation's style, or define the contents of the
@@ -8289,7 +8361,7 @@
/*!
\page 25-qdoc-configuration-derivedprojects.html
- \previouspage HTML Specific Variables
+ \previouspage HTML Specific Configuration Variables
\contentspage QDoc Manual - Table of Contents
\nextpage QDoc Compatibility
diff --git a/tools/qdoc3/generator.cpp b/tools/qdoc3/generator.cpp
index 62f191b355..3f955bfdc3 100644
--- a/tools/qdoc3/generator.cpp
+++ b/tools/qdoc3/generator.cpp
@@ -322,11 +322,11 @@ void Generator::generateBody(const Node *node, CodeMarker *marker)
bool quiet = false;
if (node->type() == Node::Function) {
-#if 0
+#if 0
const FunctionNode *func = (const FunctionNode *) node;
if (func->isOverload() && func->metaness() != FunctionNode::Ctor)
generateOverload(node, marker);
-#endif
+#endif
}
else if (node->type() == Node::Fake) {
const FakeNode *fake = static_cast<const FakeNode *>(node);
@@ -347,7 +347,7 @@ void Generator::generateBody(const Node *node, CodeMarker *marker)
if (func->reimplementedFrom() != 0)
generateReimplementedFrom(func, marker);
}
-
+
if (!generateText(node->doc().body(), node, marker))
if (node->isReimp())
return;
@@ -452,7 +452,7 @@ void Generator::generateBody(const Node *node, CodeMarker *marker)
// Now we put this at the top, before the other text.
if (func->reimplementedFrom() != 0)
generateReimplementedFrom(func, marker);
-#endif
+#endif
}
}
@@ -544,7 +544,7 @@ void Generator::generateInheritedBy(const ClassNode *classe,
example is being formatted. It outputs the list of source
files comprising the example, and the list of images used
by the example. The images are copied into a subtree of
- \c{...doc/html/images/used-in-examples/...}
+ \c{...doc/html/images/used-in-examples/...}
*/
void Generator::generateFileList(const FakeNode* fake,
CodeMarker* marker,
@@ -946,7 +946,7 @@ void Generator::generateThreadSafeness(const Node *node, CodeMarker *marker)
}
++c;
}
- if (!exceptions)
+ if (!exceptions)
text << ".";
else if (threadSafeness == Node::Reentrant) {
if (nonreentrant.isEmpty()) {
@@ -1033,7 +1033,7 @@ void Generator::generateOverload(const Node *node, CodeMarker *marker)
text << Atom::ParaLeft
<< "This function overloads ";
QString t = node->name() + "()";
- text << Atom::AutoLink << t
+ text << Atom::AutoLink << t
<< Atom::ParaRight;
generateText(text, node, marker);
}
diff --git a/tools/qdoc3/node.cpp b/tools/qdoc3/node.cpp
index ef75f6eac1..a2bd948e5b 100644
--- a/tools/qdoc3/node.cpp
+++ b/tools/qdoc3/node.cpp
@@ -415,7 +415,7 @@ void InnerNode::normalizeOverloads()
/*!
*/
-void InnerNode::removeFromRelated()
+void InnerNode::removeFromRelated()
{
while (!related.isEmpty()) {
Node *p = static_cast<Node *>(related.takeFirst());
@@ -456,7 +456,7 @@ const Node *InnerNode::findNode(const QString& name, Type type) const
}
/*!
- Find the function node in this node that has the given \a name.
+ Find the function node in this node that has the given \a name.
*/
const FunctionNode *InnerNode::findFunctionNode(const QString& name) const
{
@@ -973,7 +973,7 @@ Parameter::Parameter(const Parameter& p)
/*!
Assigning Parameter \a p to this Parameter copies the
- strings across.
+ strings across.
*/
Parameter& Parameter::operator=(const Parameter& p)
{
@@ -1319,7 +1319,7 @@ void QmlClassNode::clear()
*/
QString QmlClassNode::fileBase() const
{
-#if 0
+#if 0
if (Node::fileBase() == "item")
qDebug() << "FILEBASE: qmlitem" << name();
return "qml_" + Node::fileBase();
@@ -1368,7 +1368,7 @@ QmlBasicTypeNode::QmlBasicTypeNode(InnerNode *parent,
/*!
Constructor for the Qml property group node. \a parent is
- always a QmlClassNode.
+ always a QmlClassNode.
*/
QmlPropGroupNode::QmlPropGroupNode(QmlClassNode* parent,
const QString& name,
diff --git a/tools/qtestlib/wince/cetest/cetcpsyncconnection.cpp b/tools/qtestlib/wince/cetest/cetcpsyncconnection.cpp
index 99219f3ff8..549419400e 100644
--- a/tools/qtestlib/wince/cetest/cetcpsyncconnection.cpp
+++ b/tools/qtestlib/wince/cetest/cetcpsyncconnection.cpp
@@ -198,3 +198,24 @@ bool CeTcpSyncConnection::fileCreationTime(const QString &fileName, FILETIME* de
file.remove();
return result;
}
+
+bool CeTcpSyncConnection::resetDevice()
+{
+ qWarning("CeTcpSyncConnection::resetDevice not implemented");
+ return false;
+}
+
+bool CeTcpSyncConnection::toggleDevicePower(int *returnValue)
+{
+ Q_UNUSED(returnValue);
+ qWarning("CeTcpSyncConnection::toggleDevicePower not implemented");
+ return false;
+}
+
+bool CeTcpSyncConnection::setDeviceAwake(bool activate, int *returnValue)
+{
+ Q_UNUSED(activate);
+ Q_UNUSED(returnValue);
+ qWarning("CeTcpSyncConnection::setDeviceAwake not implemented");
+ return false;
+}
diff --git a/tools/qtestlib/wince/cetest/cetcpsyncconnection.h b/tools/qtestlib/wince/cetest/cetcpsyncconnection.h
index 77539cc896..e603efc9ac 100644
--- a/tools/qtestlib/wince/cetest/cetcpsyncconnection.h
+++ b/tools/qtestlib/wince/cetest/cetcpsyncconnection.h
@@ -75,6 +75,9 @@ public:
bool createDirectory(const QString&, bool deleteBefore=false);
bool execute(QString program, QString arguments = QString(), int timeout = -1, int *returnValue = NULL);
+ bool resetDevice();
+ bool toggleDevicePower(int *returnValue = NULL);
+ bool setDeviceAwake(bool activate, int *returnValue = NULL);
private:
bool connected;
};
diff --git a/tools/qtestlib/wince/cetest/cetest.pro b/tools/qtestlib/wince/cetest/cetest.pro
index 2773fe4484..43ed18e505 100644
--- a/tools/qtestlib/wince/cetest/cetest.pro
+++ b/tools/qtestlib/wince/cetest/cetest.pro
@@ -13,7 +13,8 @@ DEFINES += QT_BUILD_QMAKE QT_BOOTSTRAPPED QT_NO_CODECS QT_LITE_UNICODE QT
QT_NO_STL QT_NO_COMPRESS QT_NO_DATASTREAM \
QT_NO_TEXTCODEC QT_NO_UNICODETABLES QT_NO_THREAD \
QT_NO_SYSTEMLOCALE QT_NO_GEOM_VARIANT \
- QT_NODLL QT_NO_QOBJECT
+ QT_NODLL QT_NO_QOBJECT \
+ QT_BUILD_QMAKE_NO_GENERATORS
INCLUDEPATH = \
$$QT_SOURCE_TREE/tools/qtestlib/ce/cetest \
@@ -36,8 +37,6 @@ HEADERS += \
SOURCES += \
remoteconnection.cpp \
deployment.cpp \
- symbian/epocroot.cpp \
- windows/registry.cpp \
main.cpp
LIBS += ole32.lib advapi32.lib
diff --git a/tools/qttracereplay/main.cpp b/tools/qttracereplay/main.cpp
index be7906b97d..101d5127e2 100644
--- a/tools/qttracereplay/main.cpp
+++ b/tools/qttracereplay/main.cpp
@@ -49,7 +49,7 @@ class ReplayWidget : public QWidget
{
Q_OBJECT
public:
- ReplayWidget(const QString &filename, int from, int to, bool single);
+ ReplayWidget(const QString &filename, int from, int to, bool single, int frame);
void paintEvent(QPaintEvent *event);
void resizeEvent(QResizeEvent *event);
@@ -66,27 +66,96 @@ public:
QTime timer;
QList<uint> visibleUpdates;
- QList<uint> iterationTimes;
+
+ QVector<uint> iterationTimes;
QString filename;
int from;
int to;
bool single;
+
+ int frame;
+ int currentCommand;
};
void ReplayWidget::updateRect()
{
- if (!visibleUpdates.isEmpty())
+ if (frame >= 0 && !updates.isEmpty())
+ update(updates.at(frame));
+ else if (!visibleUpdates.isEmpty())
update(updates.at(visibleUpdates.at(currentFrame)));
}
+const int singleFrameRepeatsPerCommand = 100;
+const int singleFrameIterations = 4;
+
void ReplayWidget::paintEvent(QPaintEvent *)
{
QPainter p(this);
+ QTimer::singleShot(0, this, SLOT(updateRect()));
+
// p.setClipRegion(frames.at(currentFrame).updateRegion);
+ if (frame >= 0) {
+ int start = buffer.frameStartIndex(frame);
+ int end = buffer.frameEndIndex(frame);
+
+ iterationTimes.resize(end - start);
+
+ int saveRestoreStackDepth = buffer.processCommands(&p, start, start + currentCommand);
+
+ for (int i = 0; i < saveRestoreStackDepth; ++i)
+ p.restore();
+
+ const int repeats = currentIteration >= 3 ? singleFrameRepeatsPerCommand : 1;
+
+ ++currentFrame;
+ if (currentFrame == repeats) {
+ currentFrame = 0;
+ if (currentIteration >= 3) {
+ iterationTimes[currentCommand - 1] = qMin(iterationTimes[currentCommand - 1], uint(timer.elapsed()));
+ timer.restart();
+ }
+
+ if (currentIteration >= singleFrameIterations + 3) {
+ printf(" # | ms | description\n");
+ printf("------+---------+------------------------------------------------------------\n");
+
+ qSort(iterationTimes);
+
+ int sum = 0;
+ for (int i = 0; i < iterationTimes.size(); ++i) {
+ int delta = iterationTimes.at(i);
+ if (i > 0)
+ delta -= iterationTimes.at(i-1);
+ sum += delta;
+ qreal deltaF = delta / qreal(repeats);
+ printf("%.5d | %.5f | %s\n", i, deltaF, qPrintable(buffer.commandDescription(start + i)));
+ }
+ printf("Total | %.5f | Total frame time\n", sum / qreal(repeats));
+ deleteLater();
+ return;
+ }
+
+ if (start + currentCommand >= end) {
+ currentCommand = 1;
+ ++currentIteration;
+ if (currentIteration == 3) {
+ timer.start();
+ iterationTimes.fill(uint(-1));
+ }
+ if (currentIteration >= 3 && currentIteration < singleFrameIterations + 3)
+ printf("Profiling iteration %d of %d\n", currentIteration - 2, singleFrameIterations);
+ } else {
+ ++currentCommand;
+ }
+ }
+
+ return;
+ }
+
buffer.draw(&p, visibleUpdates.at(currentFrame));
++currentFrame;
@@ -138,11 +207,9 @@ void ReplayWidget::paintEvent(QPaintEvent *)
}
}
}
-
- QTimer::singleShot(0, this, SLOT(updateRect()));
}
-void ReplayWidget::resizeEvent(QResizeEvent *event)
+void ReplayWidget::resizeEvent(QResizeEvent *)
{
visibleUpdates.clear();
@@ -162,13 +229,15 @@ void ReplayWidget::resizeEvent(QResizeEvent *event)
}
-ReplayWidget::ReplayWidget(const QString &filename_, int from_, int to_, bool single_)
+ReplayWidget::ReplayWidget(const QString &filename_, int from_, int to_, bool single_, int frame_)
: currentFrame(0)
, currentIteration(0)
, filename(filename_)
, from(from_)
, to(to_)
, single(single_)
+ , frame(frame_)
+ , currentCommand(1)
{
setWindowTitle(filename);
QFile file(filename);
@@ -216,7 +285,8 @@ int main(int argc, char **argv)
printf("Usage:\n > %s [OPTIONS] [traceFile]\n", argv[0]);
printf("OPTIONS\n"
" --range=from-to to specify a frame range.\n"
- " --singlerun to do only one run (without statistics)\n");
+ " --singlerun to do only one run (without statistics)\n"
+ " --instrumentframe=frame to instrument a single frame\n");
return 1;
}
@@ -228,6 +298,8 @@ int main(int argc, char **argv)
bool single = false;
+ int frame = -1;
+
int from = 0;
int to = -1;
for (int i = 1; i < app.arguments().size() - 1; ++i) {
@@ -253,13 +325,22 @@ int main(int argc, char **argv)
}
} else if (arg == QLatin1String("--singlerun")) {
single = true;
+ } else if (arg.startsWith(QLatin1String("--instrumentframe="))) {
+ QString rest = arg.mid(18);
+ bool ok = false;
+ int frameCandidate = rest.toInt(&ok);
+ if (ok) {
+ frame = frameCandidate;
+ } else {
+ printf("ERROR: malformed syntax in argument %s\n", qPrintable(arg));
+ }
} else {
printf("Unrecognized argument: %s\n", qPrintable(arg));
return 1;
}
}
- ReplayWidget *widget = new ReplayWidget(app.arguments().last(), from, to, single);
+ ReplayWidget *widget = new ReplayWidget(app.arguments().last(), from, to, single, frame);
if (!widget->updates.isEmpty()) {
widget->show();