aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items/context2d/qquickcontext2d_p.h
Commit message (Collapse)AuthorAgeFilesLines
* use nullptr consistently (clang-tidy)Shawn Rutledge2018-02-261-2/+2
| | | | | | | | | | | | | From now on we prefer nullptr instead of 0 to clarify cases where we are assigning or testing a pointer rather than a numeric zero. Also, replaced cases where 0 was passed as Qt::KeyboardModifiers with Qt::NoModifier (clang-tidy replaced them with nullptr, which waas wrong, so it was just as well to make the tests more readable rather than to revert those lines). Change-Id: I4735d35e4d9f42db5216862ce091429eadc6e65d Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Merge remote-tracking branch 'origin/5.8' into devLiang Qi2016-10-181-1/+4
|\ | | | | | | | | | | | | | | | | | | Conflicts: src/qml/jsruntime/qv4variantobject.cpp src/qml/types/qquickworkerscript.cpp src/quick/scenegraph/util/qsgdefaultpainternode_p.h tools/qmljs/qmljs.cpp Change-Id: I876242714ec8c046238d8fd673a5ace2455b2b59
| * Make the Canvas item configurableLars Knoll2016-10-101-1/+4
| | | | | | | | | | | | Change-Id: I22a84098bf3a7e2d48f09981c9c953f2e53e6cc1 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Mark some methods as constAnton Kudryavtsev2016-10-061-2/+2
| | | | | | | | | | | | | | These methods do not modify objects. Change-Id: I4909f382cc19c5ce6f07e0421fef68a63cfe518f Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* | Quick items: add missing 'override'Anton Kudryavtsev2016-09-201-7/+7
|/ | | | | | | ... and drop redundant 'virtual' Change-Id: I1b1a85c859077e813a423743f661ef616ca7252b Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Use predefined color instead of creation from stringAnton Kudryavtsev2016-08-261-2/+2
| | | | | Change-Id: I64687d96e38044577870b8dfe60fd7b3a631180d Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* V4: allow inlining of ExecutionEngine::{qml,js}Engine()Erik Verbruggen2016-05-201-0/+1
| | | | | | | | All other changes are just to be able to include qv8engine_p.h in qv4engine_p.h Change-Id: I71ba2ec42cdc20d5c7d97a74b99b4d1ada1a5ed8 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Updated license headersJani Heikkinen2016-01-191-14/+20
| | | | | | | | | | | From Qt 5.7 -> LGPL v2.1 isn't an option anymore, see http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/ Updated license headers to use new LGPL header instead of LGPL21 one (in those files which will be under LGPL v3) Change-Id: Ic36f1a0a1436fe6ac6eeca8c2375a79857e9cb12 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* Add missing "We mean it" comments to private headers.Friedemann Kleint2015-10-061-0/+11
| | | | | | Task-number: QTBUG-48594 Change-Id: Ifc207938de7f0c8995fc712df92665f222612647 Reviewed-by: Alan Alpert <aalpert@blackberry.com>
* Get rid of qv4value_inl_p.h and replace it by qv4typedvalue_p.hLars Knoll2015-04-241-1/+1
| | | | | | | | This is a cleaner separation and further reduces include dependencies in the definitions of our basic data structured. Change-Id: I18aa86cdea0c0dfbc16075d4d617af97e638811e Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Update copyright headersJani Heikkinen2015-02-121-7/+7
| | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Change-Id: I61120571787870c0ed17066afb31779b1e6e30e9 Reviewed-by: Iikka Eklund <iikka.eklund@theqtcompany.com>
* Remove v8engine from qmlcomponent and canvas2dLars Knoll2015-01-081-2/+2
| | | | | Change-Id: I575ba208de24ffe90bd02905aba67b0b08c5115e Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Update license headers and add new licensesJani Heikkinen2014-08-251-19/+11
| | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 & LICENSE.GPLv2 - Removed LICENSE.GPL Change-Id: I84a565e2e0caa3b76bf291a7d188a57a4b00e1b0 Reviewed-by: Jani Heikkinen <jani.heikkinen@digia.com>
* More QQuickCanvas cleanup handling.Gunnar Sletta2014-08-011-2/+1
| | | | | | | | | | | | | | | | Avoid calling into QQuickContext2D from QQuickContext2DTexture after QQuickContext2D has been deleted. We acheive this by 1. Giving the texture a direct pointer to the gl context and and surface, so that it doesn't need to go through m_context to get to them (which may have been deleted). 2. Protect access to QQuickContext2DTexture::m_context with a mutex and make sure it is set to 0 in a safe manner when the QQuickContext2D object is deleted. Change-Id: Ie0a30f9fc46f844224838a7cdf2f28a62e8ce322 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* Prevent initial clipping in Context2DUlf Hermann2014-06-031-0/+2
| | | | | | | | | Don't set an initial clip path and only start clipping once a clip path has manually been set. Task-number: QTBUG-39114 Change-Id: Id277775d6eb0be87bead0e5d076f32a07ebdfe5c Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
* Use an offscreen surface in CanvasLaszlo Agocs2014-03-271-2/+3
| | | | | | | | | | | | | | | | | | | | | | | Canvas elements using the default Immediate render strategy and an FBO result in a failing makeCurrent() and subsequent crashes due to trying to make the Quick window's surface current on the gui thread while it is current on the scenegraph render thread. The EGL spec disallows this explicitly and so the makeCurrent fails with EGL_BAD_ACCESS. Others, like GLX, do not seem to have this issue since the spec says nothing about this scenario. To overcome this, a QOffscreenSurface is used instead since what the canvas does (rendering into an FBO on a thread that is different than the one on which the rest of the rendering happens) is a primary use case for offscreen surfaces (pbuffers) anyway. This makes demos like stocqt functional again. Task-number: QTBUG-37772 Change-Id: Id89f71545154856415bbbe4fa924176b25b5086f Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Rename some filesLars Knoll2014-01-311-1/+1
| | | | | | | | | | | | Rename qv4value_def_p.h -> qv4value_p.h and qv4value_p.h to qv4value_inl_p.h. It makes more sense to have the class definition in the file that is named after the class and move the inline methods into a _inl file. Doing this now, as I expect we'll be needing a few more _inl files soon. Change-Id: Ib59e9380e9e976254c6b4369574157f39b1b5f51 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Improve the Canvas threading modelGunnar Sletta2013-12-031-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The canvas classes were mixing scene graph resources and GL content across threads. This led to a number of potential crashes in addition to that the FBO based rendering had significant potential for stalling. QQuickContext2DTexture is no longer a QSGTexture with ambiguous ownership. Instead we use textureForNextFrame which is called on the render thread while the GUI is locked to synchronize state from the Context2D's "texture" into the actual QSGTexture. This means that cleanup of the QQuickContext2DTexture and the QSGTexture used for display is no longer in conflict. QQuickPixmap no longer contains a QSGTexture either as these are strictly for use on the scene graph thread. The Images are anyway loaded explicitly as QImage files in QQuickContext2DContext and uploaded again for every Canvas, so relying on the GL paint engine to do the caching will give us the same with less code. I also changed the default strategy to Immediate as that one supports the full API (cooperative does not support readback) and because cooperative is pretty bad for performance since the rendering happens in the sync() step. Task-number: QTBUG-34268 Task-number: QTBUG-31052 Task-number: QTBUG-21935 Task-number: QTBUG-30689 Task-number: QTBUG-29007 Change-Id: Ic540b22d5faa1188e21e56a3beee24191d13f423 Reviewed-by: Mitch Curtis <mitch.curtis@digia.com> Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* Fix license headers of QtQuick sources.Gunnar Sletta2013-09-301-1/+1
| | | | | Change-Id: I3750c47640bf21c3567c5fa1c4667e3e2552942e Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Fix API of QQmlV4HandleLars Knoll2013-09-261-1/+1
| | | | | Change-Id: Iac4a3fefebd33a5990408598486231a5add8e639 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Merge branch 'dev' of ssh://codereview.qt-project.org/qt/qtdeclarative into ↵Simon Hausmann2013-06-241-1/+2
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | wip/v4 Conflicts: src/imports/qtquick2/plugins.qmltypes src/qml/debugger/qv8debugservice.cpp src/qml/qml/qml.pri src/qml/qml/qqmlcompiler.cpp src/qml/qml/qqmlcomponent.cpp src/qml/qml/qqmlcontext.cpp src/qml/qml/qqmldata_p.h src/qml/qml/qqmlengine_p.h src/qml/qml/qqmljavascriptexpression.cpp src/qml/qml/qqmlxmlhttprequest.cpp src/qml/qml/v4/qv4bindings.cpp src/qml/qml/v4/qv4irbuilder.cpp src/qml/qml/v4/qv4jsonobject_p.h src/qml/qml/v8/qqmlbuiltinfunctions.cpp src/qml/qml/v8/qv8bindings.cpp src/qml/qml/v8/qv8contextwrapper.cpp src/qml/qml/v8/qv8listwrapper.cpp src/qml/qml/v8/qv8qobjectwrapper.cpp src/qml/qml/v8/qv8qobjectwrapper_p.h src/qml/qml/v8/qv8sequencewrapper_p_p.h src/qml/qml/v8/qv8typewrapper.cpp src/qml/qml/v8/qv8valuetypewrapper.cpp src/qml/types/qqmldelegatemodel.cpp src/quick/items/context2d/qquickcanvasitem.cpp src/quick/items/context2d/qquickcontext2d.cpp sync.profile tests/auto/qml/qjsengine/tst_qjsengine.cpp tests/benchmarks/qml/animation/animation.pro tools/qmlprofiler/qmlprofiler.pro Change-Id: I18a76b8a81d87523247fa03a44ca334b1a2360c9
| * Set default font size to 10px as per spec, not 10pt.Mitch Curtis2013-06-141-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | See: http://www.w3.org/TR/2dcontext/#dom-context-2d-font Also removes duplicated assignments that are done as part of the default constructor. Task-number: QTBUG-31716 Change-Id: I5bd131c14a5defd422d858f02974c215de7adae9 Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
* | Remove usage of v8 from the context2d headerLars Knoll2013-06-101-3/+4
| | | | | | | | | | Change-Id: Icfcae6d55d5f912a756630d10e6a098adada0591 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Initial port of JS canvas bindings to use QV4::Object subclass instead of V8 ↵Simon Hausmann2013-05-101-2/+2
| | | | | | | | | | | | | | | | | | | | | | resources This patch comes with the same prototype injection as during the QML locale patch. This will allow for incremental porting method by method for this huge binding. Change-Id: Ie258f021ac6f926302bb375a8ce7a12fb5e0512a Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | Remove v8::Persistent usage from qquickcanvasLars Knoll2013-05-081-1/+1
| | | | | | | | | | Change-Id: If714583818f894e8ac839cd35cd475deff00eafb Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Get rid of v8::LocalLars Knoll2013-05-061-2/+2
|/ | | | | | | | | The class was doing exactly the same thing as v8::Handle in our implementation. Removing it cleans up quite a bit of code. Change-Id: I37a3dcdef062fc388751e9ef0a158b5926ba2efb Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Remove QT_{BEGIN,END}_HEADER macro usageSergio Ahumada2013-01-281-4/+0
| | | | | | | | | | | The macro was made empty in qtbase/ba3dc5f3b56d1fab6fe37fe7ae08096d7dc68bcb and is no longer necessary or used. Discussed-on: http://lists.qt-project.org/pipermail/development/2013-January/009284.html Change-Id: Ia07e99676e0134fde5e32880edb95e57c779a7ff Reviewed-by: Laszlo Papp <lpapp@kde.org> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com> Reviewed-by: Alan Alpert <aalpert@rim.com>
* Complete rewrite of threaded render loop.Gunnar Sletta2013-01-181-2/+0
| | | | | | | | | | | | | | | | This change starts using the superior implementation of the scene graph render loop which has been worked on in the scenegraph-playground project for a while. It uses a far more straightforward locking/sync paradigm compared to the existing one and is less deadlock and error prone. It also enables the scene graph thread to run on its own when the GUI thread is blocked, enabling threaded animations. This changes also introduces a naming change inside Qt Quick from "Window Manager" -> "Render Loop" as that fits better to what the code does. Change-Id: I1c2170ee04fcbef79660bd7dae6cace647cdb276 Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
* Update copyright year in Digia's license headersSergio Ahumada2013-01-101-1/+1
| | | | | | Change-Id: I6c3bd7bebe3d62d1cfd0fa6334544c9db8398c76 Reviewed-by: Akseli Salovaara <akseli.salovaara@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* Change copyrights from Nokia to DigiaIikka Eklund2012-09-231-24/+24
| | | | | | | Change copyrights and license headers from Nokia to Digia Change-Id: Ie7f5d49ed8235d7a7845ab68f99ad1c220e64d5c Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Use the new antialiasing property for canvas paintingCharles Yin2012-08-281-1/+1
| | | | | Change-Id: I76f21d055696978f2f6936006eea038dd73cce6c Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
* Refactor context2d thread logicCharles Yin2012-07-311-2/+8
| | | | | | | | | | 1. Use QQuickContext2DRenderThread for Threaded rendering 2. Make FBO target works with all render strategies 3. Remove some unnessary locks, call texture methods by invoking meta calls 4. Run existing tests with all render targets and strategies (except Cooperative) Change-Id: I0db5c91d848b86bcc1536c30d7a5804b66a817f1 Reviewed-by: Yunqiao Yin <charles.yin@nokia.com>
* Introduce QQuickCanvasPixmapCharles Yin2012-06-051-1/+2
| | | | | | | | | | 1. QQuickPixmap now only store textures instead of QImage data, however context2d still need to access the QImage in some places, so cache the loaded images to avoid the expensive GL readback operations. 2. Use texture directly if the render target is FBO. Change-Id: I6228011e5698fa00f2e3420a3a4a305995b8a238 Reviewed-by: Yunqiao Yin <charles.yin@nokia.com>
* Enable threaded/immediate rendering for FBO(step 1)Charles Yin2012-05-311-1/+9
| | | | | | | | | 1. Create a new gl context if the scenegraph render thread is different with context2d render thread 2. Expose the gl context and window surface from context2d 3. Get the right current gl context before painting Change-Id: I5e252a8142d760442f9dfb53ed8a8ce289379af9 Reviewed-by: Glenn Watson <glenn.watson@nokia.com>
* Add Q_DISABLE_COPY to QQuickContext2DCharles Yin2012-05-291-0/+2
| | | | | Change-Id: I367bb3b630b916775c1c35656fd74838dbbb00bd Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
* Remove unnecessary exportsMatthew Vogt2012-05-181-1/+1
| | | | | | | | | Reduce library load time by removing any exports which are not required by existing clients. Task-number: QTBUG-24768 Change-Id: Ia5754d6f97bb2ed46e290820a5b092f85a4bc5b0 Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Fix context2d transform issuesCharles Yin2012-03-301-2/+20
| | | | | | | | | After calling transform related methods, the current path should be transformed with the same method but in reversal mode. So that during painting, the painter will apply the CTM to this path again, otherwise path will be transformed twice. Change-Id: I7e12bdff82dabb408f47152ba07b608872d4093f Task-number: QTBUG-24988 Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
* Continue refactor of Canvas rendering.Justin McPherson2012-03-061-9/+6
| | | | | | | | - Remove sync() - not necessary - Queue buffer before flush Change-Id: If7dea8e56a612d241c67a82eae265febc45059a8 Reviewed-by: Yunqiao Yin <charles.yin@nokia.com>
* Rename QDeclarative symbols to QQuick and QQmlMatthew Vogt2012-02-241-4/+4
| | | | | | | | | | | | | Symbols beginning with QDeclarative are already exported by the quick1 module. Users can apply the bin/rename-qtdeclarative-symbols.sh script to modify client code using the previous names of the renamed symbols. Task-number: QTBUG-23737 Change-Id: Ifaa482663767634931e8711a8e9bf6e404859e66 Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Remove non-standard canvas filter/mirror functionsCharles Yin2012-02-131-12/+1
| | | | | | | | | They are not standard context 2d APIs, and now the same effects can be implemented by the ShaderEffect/QtGraphicEffects as well, so remove them from canvas 2d to reduce the duplicated features. Change-Id: If77ea6794e839a59927a313702aeea2282384844 Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
* Refactor Canvas rendering paths.Justin McPherson2012-02-101-6/+39
| | | | | | | Refactor Canvas rendering paths to enable different drawing contexts. Change-Id: If0e00a14baa673fca6b999a787b4e89885bb1e51 Reviewed-by: Yunqiao Yin <charles.yin@nokia.com>
* Remove "All rights reserved" line from license headers.Jason McDonald2012-01-301-1/+1
| | | | | | | | | | As in the past, to avoid rewriting various autotests that contain line-number information, an extra blank line has been inserted at the end of the license text to ensure that this commit does not change the total number of lines in the license header. Change-Id: If39bd256b0fa85eba17ea30f8ab87ea27d758908 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Update obsolete contact address.Jason McDonald2012-01-231-1/+1
| | | | | | | | Replace Nokia contact email address with Qt Project website. Change-Id: I6a730abc0c396fb545a48b2d6938abedac2e3f1c Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com> Reviewed-by: Alan Alpert <alan.alpert@nokia.com>
* Update copyright year in Nokia copyright headers.Jason McDonald2012-01-171-1/+1
| | | | | | | | Update copyright headers from before 2011, and a couple of new ones that were merged after the previous change to copyright headers. Change-Id: Ia76e08e2734afa4ef3f1207dbcda5ff3bc81b366 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Say hello to QtQuick moduleKent Hansen2011-12-021-0/+210
This change moves the QtQuick 2 types and C++ API (including SceneGraph) to a new module (AKA library), QtQuick. 99% of this change is moving files from src/declarative to src/quick, and from tests/auto/declarative to tests/auto/qtquick2. The loading of QtQuick 2 ("import QtQuick 2.0") is now delegated to a plugin, src/imports/qtquick2, just like it's done for QtQuick 1. All tools, examples, and tests that use QtQuick C++ API have gotten "QT += quick" or "QT += quick-private" added to their .pro file. A few additional internal QtDeclarative classes had to be exported (via Q_DECLARATIVE_PRIVATE_EXPORT) since they're needed by the QtQuick 2 implementation. The old header locations (e.g. QtDeclarative/qquickitem.h) will still be supported for some time, but will produce compile-time warnings. (To avoid the QtQuick implementation using the compatibility headers (since QtDeclarative's includepath comes first), a few include statements were modified, e.g. from "#include <qsgnode.h>" to "#include <QtQuick/qsgnode.h>".) There's a change in qtbase that automatically adds QtQuick to the module list if QtDeclarative is used. Together with the compatibility headers, this should help reduce the migration pain for existing projects. In theory, simply getting an existing QtDeclarative-based project to compile and link shouldn't require any changes for now -- but porting to the new scheme is of course recommended, and will eventually become mandatory. Task-number: QTBUG-22889 Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Change-Id: Ia52be9373172ba2f37e7623231ecb060316c96a7 Reviewed-by: Kent Hansen <kent.hansen@nokia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@nokia.com>