aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items/context2d/qquickcontext2d.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-02-151-2/+7
|\ | | | | | | | | | | | | Conflicts: src/qml/qml/qqmlpropertycache.cpp Change-Id: Ie7727499700b85cc0959ef3abb30d55dc728b659
| * Canvas: Handle switching between object and string based colorsAndy Shaw2019-02-141-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | When switching between the two it should respect whatever the color is regardless of whether it is a color value or a string based color. This also accounts for "invalid" colors as this should set the stroke-style to be #000000 to be inline with the default stroke-style indicated in the specification. Change-Id: I00bee6c9a85787762271882838510b4187798ee0 Fixes: QTBUG-42155 Fixes: QTBUG-52959 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Merge remote-tracking branch 'origin/5.12' into devLiang Qi2019-01-291-144/+166
|\| | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/3rdparty/masm/yarr/YarrJIT.cpp src/qml/compiler/qv4instr_moth.cpp src/quick/handlers/qquicksinglepointhandler_p.h src/quick/handlers/qquicktaphandler.cpp src/quick/items/context2d/qquickcontext2d.cpp Done-With: Ulf Hermann <ulf.hermann@qt.io> Change-Id: I109453131f9f0a05316ae37c7d6ed1edc8c0f9d4
| * Canvas: Guard context pointer against external deletionUlf Hermann2019-01-231-144/+166
| | | | | | | | | | | | | | | | | | You cannot keep the context when reparenting the canvas item. Use a QPointer prevent dangling. Task-number: QTBUG-73113 Change-Id: Ie7021c6f0bb0d09923eb358dc7e51d6727e74a7a Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Fix QFont-related deprecation warningsFriedemann Kleint2019-01-081-3/+3
|/ | | | | | | | | | | | | | Replace QFontMetrics::width() by horizontalAdvance(), fixing: items/qquicktextcontrol.cpp:1001:80: warning: ‘int QFontMetrics::width(QChar) const’ is deprecated: Use QFont::horizontalAdvance [-Wdeprecated-declarations] items/qquicktextinput.cpp:880:60: warning: ‘int QFontMetrics::width(QChar) const’ is deprecated: Use QFont::horizontalAdvance [-Wdeprecated-declarations] items/qquicktextinput.cpp:1380:60: warning: ‘int QFontMetrics::width(QChar) const’ is deprecated: Use QFont::horizontalAdvance [-Wdeprecated-declarations] items/context2d/qquickcontext2d.cpp:2980:57: warning: ‘int QFontMetrics::width(const QString&, int) const’ is deprecated: Use QFont::horizontalAdvance [-Wdeprecated-declarations] items/context2d/qquickcontext2d.cpp:4060:36: warning: ‘int QFontMetrics::width(const QString&, int) const’ is deprecated: Use QFont::horizontalAdvance [-Wdeprecated-declarations] items/context2d/qquickcontext2d.cpp:4063:36: warning: ‘int QFontMetrics::width(const QString&, int) const’ is deprecated: Use QFont::horizontalAdvance [-Wdeprecated-declarations] Change-Id: Ie97be4a6cf1ce087caeb4d83fe016fa1a471f3ec Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Cleanups in Value/PrimitiveLars Knoll2018-09-171-11/+11
| | | | | | | | | | | | Get rid of Primitive and move the corresponding methods directly into Value. Mark many methods in Value as constexpr and turn Value into a POD type again. Keep Primitive as a pure alias to Value for source compatibility of other modules that might be using it. Change-Id: Icb47458947dd3482c8852e95782123ea4346f5ec Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Add LineStyle support to Context2dColin Ogilvie2018-07-121-0/+127
| | | | | | | | | | Allow Context2D lines to be drawn as dashed, dotted etc. [ChangeLog][QtQuick][Canvas] Added set/get lineDash and lineDashOffset to Context2D to allow non solid lines to be drawn. Task-number: QTBUG-31807 Change-Id: I9ffcc5d93dc352dbd0aec4ac8a616c999239c48d Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Quick: Use devicePixelRatioF rather than devicePixelRatioUlf Hermann2018-07-121-1/+1
| | | | | | | | | | The integer version of devicePixelRatio cannot handle fractional ratios and will lead to arithmetic exceptions for ratios between 0 and 1. Change-Id: I4a06a12742fa85e6d2f0e24193ae796dec7e2f15 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
* Prefix vtable methods with virtualLars Knoll2018-07-031-6/+6
| | | | | | | | | Turns out that the overloading of vtable methods and regular ones is problematic in some cases. So let's rather make it explicit which methods are part of the vtable, and which aren't. Change-Id: Ifee32a26104d30f3c82bca8b5a9cdea2d4f4f526 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Replace Identifier by PropertyKeyLars Knoll2018-07-021-4/+4
| | | | | | | | Change all uses of Identifier to use the new PropertyKey class and get rid of Identifier. Change-Id: Ib7e83b06a3c923235e145b6e083fe980dc240452 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Unify the get and getIndexed vtable functions of QV4::ObjectLars Knoll2018-07-021-2/+7
| | | | | | | | This finalizes the refactoring of Object's vtable API. Also added the receiver argument to the method as required by the ES7 spec. Change-Id: I36f9989211c47458788fe9f7e929862bcfe7b845 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Unify put and putIndexedLars Knoll2018-07-021-2/+6
| | | | | | | | | | Pass an Identifier through those virtual methods to unify the string and integer based versions. Also add the receiver that's required in ES7 Change-Id: I4e7f01b4c97cc80bcb3c485f6343f28213dc9e6b Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Merge "Merge remote-tracking branch 'origin/5.11' into dev" into ↵Liang Qi2018-06-251-4/+4
|\ | | | | | | refs/staging/dev
| * Merge remote-tracking branch 'origin/5.11' into devUlf Hermann2018-06-251-4/+4
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/plugins/qmltooling/packetprotocol/qpacketprotocol.cpp src/quick/handlers/qquickhandlerpoint.cpp src/quick/handlers/qquicksinglepointhandler.cpp tests/auto/qml/ecmascripttests/test262 Change-Id: I8908ec8c6116ca626fbd269af7625d4c429429ca
| | * Doc: Add missing dots (qtdeclarative)Paul Wicking2018-06-191-4/+4
| | | | | | | | | | | | | | | | | | Task-number: QTBUG-68933 Change-Id: Ibb5aa227e82825085e7214e17dcffcb17fd44157 Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* | | Add Proxy support for prototype handlingLars Knoll2018-06-251-5/+5
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | Cleanup get/setPrototypeOf and fix some smaller incompatibilities in the default implementation for Object. Add the methods to the vtable and reimplement them according to spec for ProxyObjects. Clean up the Object.prototype.get/setPrototypeOf/__proto__ methods and fix a smaller bug in the Reflect API for those methods. Change-Id: I6e438753332ec4db963d6cdcf86f340ff212777a Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Merge remote-tracking branch 'origin/5.11' into devLars Knoll2018-05-241-1/+1
|\| | | | | | | Change-Id: I0127f2c16de1d930bdd8cbccd42ec6785f31ab96
| * Pass the arguments correctly to QRadialGradientAndy Shaw2018-05-151-1/+1
| | | | | | | | | | | | | | | | | | | | The parameters for createRadialGradient indicate the position and radius for the two circles. Therefore the radius arguments should be used with their respective circle positions. Task-number: QTBUG-67960 Change-Id: Ifacba4d43939bafeed451e713250f716a11d30d1 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | Disambiguate different allocation functions in the memory managerLars Knoll2018-04-121-8/+8
|/ | | | | | | | | | | Some compilers (in this case MingW 5.3) don't manage to properly disambiguate the template overloads, and try to instantiate the wrong template function. Solve this by renaming the one of the template functions. Change-Id: I3574e617fe96c4bd52920a0127a1dfe39cc3d302 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* use nullptr consistently (clang-tidy)Shawn Rutledge2018-02-261-12/+12
| | | | | | | | | | | | | 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>
* doc: Fix remaining "Can't tie this..." errorsMartin Smith2018-02-231-2/+2
| | | | | | | | This update mostly removes qdoc comment markers from comments that should not have been qdoc comments. Change-Id: I8ccaa7fd4ae610371e25066e048fcba6cfba8038 Reviewed-by: Martin Smith <martin.smith@qt.io>
* Convert canvas2d methods to new calling conventionLars Knoll2018-01-121-457/+459
| | | | | Change-Id: I543ae856a5c56ee69f7e7cc6f1ff9a8ce2a6b489 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Bring back markObjects(), this time generatedLars Knoll2017-11-141-4/+5
| | | | | | | | Doing the marking of objects in a function instead of using the table seems to be somewhat faster. Change-Id: I9ec00cc0264f9a15c69b285db493bee31d99bf96 Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
* Merge remote-tracking branch 'origin/dev' into HEADLars Knoll2017-10-221-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/qml/compiler/qv4codegen.cpp src/qml/compiler/qv4compileddata.cpp src/qml/compiler/qv4compileddata_p.h src/qml/compiler/qv4isel_moth_p.h src/qml/compiler/qv4ssa.cpp src/qml/jit/qv4assembler_p.h src/qml/jit/qv4isel_masm_p.h src/qml/jit/qv4regalloc.cpp src/qml/jsruntime/qv4engine.cpp src/qml/jsruntime/qv4qmlcontext_p.h src/qml/jsruntime/qv4regexp.cpp src/qml/jsruntime/qv4regexp_p.h src/qml/jsruntime/qv4regexpobject.cpp src/qml/jsruntime/qv4runtime.cpp src/qml/jsruntime/qv4vme_moth.cpp src/qml/qml/v8/qqmlbuiltinfunctions.cpp tests/auto/qml/qml.pro tests/auto/qml/qmlplugindump/tst_qmlplugindump.cpp tools/qmlcachegen/qmlcachegen.cpp Change-Id: I1577e195c736f3414089036b957a01cb91a3ca23
| * Replace Q_DECL_OVERRIDE with overrideKevin Funk2017-09-251-1/+1
| | | | | | | | | | Change-Id: I176f91a8c51e81a2df3fe91733118261491223ee Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Change CallData::argc to be a QV4::ValueErik Verbruggen2017-09-191-47/+47
| | | | | | | | | | | | | | | | | | | | | | Instead of mimicking a Value. This makes sure that argc now stays correct even when anything on Value changes. Most of the change is mechanical: replace callData->argc by callData->argc(). Change-Id: I521831ae1ffb3966bad6589c18d7a373e13439d7 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Merge remote-tracking branch 'origin/dev' into wip/new-backendLars Knoll2017-08-221-1/+2
|\| | | | | | | Change-Id: Iff06429f948ac6cdec77a9e5bb8c5375c56fe705
| * Merge remote-tracking branch 'origin/dev' into wip/scenegraphngLaszlo Agocs2017-05-311-0/+2
| |\ | | | | | | | | | Change-Id: Iea0bb0788357bc615d0e9ea411087114b8b3b720
| * | Move PathItem to qt.labsLaszlo Agocs2017-04-251-1/+2
| | | | | | | | | | | | | | | | | | | | | Change-Id: I1cd686cff60bd40fe2cbbc34f917fac7835b6b7d Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Andy Nichols <andy.nichols@qt.io> Reviewed-by: Robin Burchell <robin.burchell@crimson.no>
* | | Remove Scope::result and convert calling convention for builtinsLars Knoll2017-08-081-253/+333
| |/ |/| | | | | | | | | | | | | Allow for faster calling of builtins, and completely avoid scope creation in many cases. Change-Id: I0f1681e19e9908db10def85a74e134a87fc2e44c Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Merge remote-tracking branch 'origin/5.9' into devLars Knoll2017-05-021-0/+2
|\ \ | |/ |/| | | Change-Id: I71275a2076c3d32ee2896571be882067320a2e9e
| * Run includemocs in qtdeclarativeThiago Macieira2017-04-261-0/+2
| | | | | | | | | | Change-Id: I84e363d735b443cb9beefffd14b8c023a37aa489 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Merge remote-tracking branch 'origin/5.9' into devSimon Hausmann2017-04-071-1/+1
|\| | | | | | | | | | | | | | | | | | | Conflicts: src/qml/jit/qv4assembler.cpp src/qml/jit/qv4assembler_p.h src/qml/jit/qv4isel_masm.cpp src/qml/jsruntime/qv4vme_moth.cpp Change-Id: I865d794e550a263387a39ca8d051ebf48b70cbc0
| * Fix QQuickCanvasItem::toImage() high-DPI captureMorten Johan Sørvig2017-03-311-1/+1
| | | | | | | | | | | | | | | | | | | | | | Make toImage() work for devicePixelRatio > 1 by scaling the source rect. Also set the devicePixelRatio on the returned image. Task-number: QTBUG-59170 Change-Id: I0c8ccd562c1cf1e89ff37ca1806b46296480b0d0 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | Separate the stack used for GC from the regular JS stackLars Knoll2017-04-071-3/+3
| | | | | | | | | | | | | | | | This is required to be able to implement concurrent or incremental garbage collection. Change-Id: Ib3c5eee3779ca2ee08a57cd3961dbcb0537bbb54 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Merge remote-tracking branch 'origin/5.9' into HEADSimon Hausmann2017-03-231-2/+8
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/plugins/qmltooling/qmldbg_debugger/qv4datacollector.cpp src/qml/jit/qv4assembler.cpp src/qml/jit/qv4assembler_p.h src/qml/jit/qv4isel_masm.cpp src/qml/jsruntime/qv4context.cpp src/qml/jsruntime/qv4context_p.h src/qml/jsruntime/qv4engine.cpp src/qml/jsruntime/qv4vme_moth.cpp src/qml/memory/qv4mmdefs_p.h Change-Id: I9966750b7cd9106b78e4c4779f12b95a481cca40
| * Build fix for -no-feature-quick-pathPaul Olav Tvete2017-03-131-2/+8
| | | | | | | | | | Change-Id: Ib52d45a12b367fa08982535a69c14881beec597e Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Use qRadiansToDegrees() more widelyEdward Welbourne2017-03-161-7/+5
| | | | | | | | | | | | | | | | It documents the meaning of the computation more clearly. Task-number: QTBUG-58083 Change-Id: Ie2d486d1e1919569de5a1565e783703b9b3bc813 Reviewed-by: Robin Burchell <robin.burchell@crimson.no>
* | Merge remote-tracking branch 'origin/5.9' into devLiang Qi2017-03-141-0/+2
|\| | | | | | | Change-Id: I0ec164ce6e8099e6e4d6b40a3c7340737473ef4b
| * Build fix for -no-feature-quick-shadereffectPaul Olav Tvete2017-03-101-0/+2
| | | | | | | | | | Change-Id: Ie1f601c6ae4c6c5d8d23b14a6670979d9c24e209 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Merge remote-tracking branch 'origin/5.9' into devLars Knoll2017-02-141-6/+6
|\| | | | | | | Change-Id: I372850330c1d92edc5b07596759f0db3a59082a8
| * Fix a crash in canvas2d when calling some methodsLars Knoll2017-02-071-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | This fixes a regression introduced in change 4d23faf34192cef372f846dcf02fd8cc398b14c0, where some return values from functions weren't properly encoded as QV4::Value. Task-number: QTBUG-58683 Change-Id: I9dc5f1eb8f5779c58f8b062b9ae3d02284ab2678 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* | Object: Allow put and putIndexed to return success or failureRobin Burchell2017-02-091-3/+6
|/ | | | | | | | | Some parts of the ES6 (and even ES5!) spec specifically require handling of a property write failure. This will be introduced in followup changes, as it's going to be rather more involved than this. Change-Id: Ie482493fcf4780df0e23619650a856421d20bd55 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Port builtin methods in Canvas2D to new calling conventionLars Knoll2017-01-251-680/+617
| | | | | Change-Id: I0d141b3d655161a7892ffd0e5b8f019b3df51da9 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Get rid of most QT_NO_FOO usagesLars Knoll2016-11-291-7/+7
| | | | | | | | Instead use QT_CONFIG(foo). This change actually detected a few mis-spelled macros and invalid usages. Change-Id: I06ac327098dd1a458e6bc379d637b8e2dac52f85 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* QML: Also check for correct destroy() chainingErik Verbruggen2016-10-061-2/+8
| | | | | | | | | Check that the destroy() method of Heap::Base was called when a Managed object needs destruction. This checks if a call to the parent's destroy() method was accidentally omitted. Change-Id: Id025ecd6d4744bf3eab23503fbe317ed2a461138 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* QML: Make Heap::Object and all subclasses trivialErik Verbruggen2016-10-061-7/+9
| | | | | | | | | | | | GCC6 might dead-store-eliminate out our secret write to Base::mmdata, because it expects all memory content to be "undefined" before constructor calls. Clang might take the same approach if the constructor of Heap::Object is removed. By making these structs trivial, it also makes them memcpy-able. Change-Id: I055b2ad28311b997fbe059849ebda4d5894eaa9b Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* QML: Introduce destroy() on Base subclassesErik Verbruggen2016-10-051-37/+41
| | | | | | | | This removes the destructors of subclasses of Base, making them nearly trivial. Change-Id: Ia6f7d467e87899b5ad37b8709a8f633a51689d59 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Fix 'lighter' compositionmode in Context2DGunnar Sletta2016-08-121-2/+2
| | | | | | | | 'lighter' is defined as Source + Destination which is the equivalent of QPainter::CompositionMode_Plus. Change-Id: I88857ffbabe319e955f588b6d74bc96da8714f3d Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Merge "Merge remote-tracking branch 'origin/wip/scenegraphng' into dev" into ↵Laszlo Agocs2016-06-101-6/+39
|\ | | | | | | refs/staging/dev