summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* Silence warning about paddingJesus Fernandez2018-07-101-1/+1
| | | | | Change-Id: I640cd8eeaf468fc004ae2b34c00518d3c4b62866 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Remove unused variableJesus Fernandez2018-06-051-1/+0
| | | | | | | | It removes rotatingAngle. It was being serialized in the browser but ignored by the QPA plugin. Sending it is not necessary. Change-Id: I1cc7a4aba10886887fe7ec037139f5c943425494 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Normalize object notationJesus Fernandez2018-06-051-97/+97
| | | | | | | | It removes whitespaces before the colon in object creation. Change-Id: I54d8bc5e5e5a8284dfdd8e0c3a35961f87134196 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Fix typoJesus Fernandez2018-06-042-8/+8
| | | | | | | Replace radious with radius. Change-Id: Ief1373a6eeaa54490ca608d633294438274fa15c Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Prefer object notation over bracesJesus Fernandez2018-06-041-43/+45
| | | | | | | | JSHint recommends it. Change-Id: I70181f0012ad79cafd73071c268c9f1ae05ba42b Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Fix critical messagesJesus Fernandez2018-06-011-2/+2
| | | | | | | | | Fixes a misleading message. Removes the function name from the message. Change-Id: Ie0ef0c7dc0b0fc4b1e2ee4665e2b7aacdd111b5c Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Fix detection of invalid parameterJesus Fernandez2018-05-251-1/+1
| | | | | | | | It fixes the invalid port check. The condition was dead code due to a previous check. Change-Id: I22bb7497f9577aeed0140542337c0a13200e37a8 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Convert port string to ushortJesus Fernandez2018-05-221-1/+1
| | | | | | | Removes clazy warning. Change-Id: Ib019497a8b3f8812ddf51ae59373a7a9501c9b21 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Fix Clang 6 warning about not using the override keywordThiago Macieira2018-04-271-1/+1
| | | | | | | | /qwebglwindow.h:64:19: warning: 'screen' overrides a member function but is not marked 'override' [-Winconsistent-missing-override] Change-Id: I3840d727dee443318644fffd1529390d71aae8d8 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io>
* Fix warningsv5.11.0-beta4Jesus Fernandez2018-04-051-3/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "qwebglintegration.cpp", line 216: warning #68-D: integer conversion resulted in a change of sign WId winId = -1; ^ "qwebglintegration.cpp", line 491: warning #1215-D: function "QWindowSystemInterface::handleMouseEvent(QWindow *, ulong, const)" QPointF &, const QPointF &, Qt::MouseButtons, Qt::KeyboardModifiers, Qt::MouseEventSource) [with] Delivery=QWindowSystemInterface::DefaultDelivery]" (declared at line 85 of "/home/qt/work/install/include/QtGui/5.11.0/QtGui/qpa/qwindowsystemin ce.h") was declared deprecated" QWindowSystemInterface::handleMouseEvent(platformWindow->window(), ^ "qwebglintegration.cpp", line 513: warning #1215-D: function "QWindowSystemInterface::handleWheelEvent(QWindow *, ulong, const QPointF &, const QPointF &, int, Qt::Orientation, Qt::KeyboardModifiers)" (declared at line 153 of "/home/qt/work/install/include/QtGui/5.11.0/QtGui/qpa/qwindowsystemin terface.h") was declared deprecated QWindowSystemInterface::handleWheelEvent(platformWindow->window(), ^ Change-Id: I0b83cc38b6567f3819890c74e973bba52fe2acf8 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Silence complaints about bitwise operationsv5.11.0-beta3Jesus Fernandez2018-03-271-0/+3
| | | | | | | | | | JSLint complains about the bitwise operations. From documentation: Bitwise operators are very rare in JavaScript programs and quite often & is simply a mistyped &&. Change-Id: Ibda95e06bb062b71d4b5866a06010d57a6f321a6 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Remove old partial binary message workaroundJesus Fernandez2018-03-272-28/+6
| | | | | | | | | | | | | | | | The original implementation of the plugin was created using Qt 5.8. A workaround was added to avoid partial binary messages. Apparently, this is not happening anymore, so the workaround is not needed anymore. Removing the workaround can provide a performance boost since the application sends the binary message in a single message and the browser does not need to rebuild the message. Change-Id: I18e7a1c559d8a5d677ab66131098a6a1e855d985 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Fix browser warning and use addEventListenerJesus Fernandez2018-03-221-8/+8
| | | | | | | | | | | | | [Violation] Added non-passive event listener to a scroll-blocking event. Consider marking event handler as 'passive' to make the page more responsive. See https://www.chromestatus.com/feature/5745543795965952 This patch also uses addEventListener instead of assigning the callback directly to the function to be able to mark the event as passive. Change-Id: I6c2336eed0cc4bc562fff09a08737815eaa864ce Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Add missing semicolonsJesus Fernandez2018-03-221-14/+14
| | | | | | Change-Id: I0d4feade770b607e6cc3dc304038281a79097c4a Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Remove unnecessary semicolonJesus Fernandez2018-03-211-1/+1
| | | | | | | Change-Id: I30c344d41514fa46bac1cb00b6cd54edf13c6397 Reviewed-by: Michael Winkelmann <michael.winkelmann@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Reuse body variableJesus Fernandez2018-03-211-2/+1
| | | | | | | Change-Id: I988cd81090557f65b880d55f01958e82490ada85 Reviewed-by: Michael Winkelmann <michael.winkelmann@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Remove unused variablesJesus Fernandez2018-03-211-3/+1
| | | | | | | Change-Id: I9a84f151fdb0c551da141ff2a1641a027bca9163 Reviewed-by: Michael Winkelmann <michael.winkelmann@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Add an environment variable to set the WebSocket Server addressJesus Fernandez2018-03-211-2/+14
| | | | | | | | | | | | | | Using the QT_WEBGL_WEBSOCKETSERVER environment variable the WebSocket Server listen address and port can be configured. [ChangeLog][QtWebGL] QT_WEBGL_WEBSOCKETSERVER environment variable can be used to configure the WebSocket Server address and port. Task-number: QTBUG-65241 Change-Id: I3035aa7cc18d469293a4d55bc36e91cfae5ec03a Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Jason Hihn <jhihn@gmx.com> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Allow customizing the maximum texture sizev5.11.0-beta2Jesus Fernandez2018-03-091-2/+6
| | | | | | | | | | | | | | | | | | | | | Adds a new environment variable, QT_WEBGL_MAX_TEXTURE_SIZE, to configure the maximum texture size. The maximum value was hardcoded to 512 to save bandwidth, but it was giving problems when a high number of glyphs need to be stored in the GPU. After this patch, the maximum texture size allowed by WebGL will be used. The user can set the value to a custom value to optimize the bandwidth if the default value is too high, text rendering issues can happen. [ChangeLog][QWebGLContext] Fix text rendering issues when a lot of different glyphs are used. [ChangeLog][QWebGLContext] QT_WEBGL_MAX_TEXTURE_SIZE environment variable added to customize the maximum texture size. Task-number: QTBUG-66682 Change-Id: Id8a46daf4718a76fcf7d6a2c2cf831f3d6db372d Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Remove spurious blank linesv5.11.0-beta1Jesus Fernandez2018-02-191-2/+0
| | | | | Change-Id: I67a243c3e5f90c58f095824dd12e80b2306cc3ed Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Show more information when the HTTP server fails to initializeJesus Fernandez2018-02-153-2/+12
| | | | | | | | | | When the HTTP server fails to initialize a simple message was shown in the terminal. This patch adds the error string from the QTcpServer to give more information about the problem. Change-Id: Ic52d4a78991e1c5a20f2712ca6cbbdd0738d47e0 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Correct variable name in webqt.jsxEdi Cikovic2018-02-151-1/+1
| | | | | | | | Variable context was renamed to currentContext as glUniform3fv wasn't working as a result of the wrong variable name. Change-Id: I0946441ea063eb6104066a43f963da67bee4e0d8 Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io>
* Return event id instead of deleted eventJesus Fernandez2018-02-151-10/+15
| | | | | | | | | | | | | Under some situations, the QWebGLFunctionCall is destroyed before getting the event id. Increasing the lifetime of the event makes no sense so instead of that, the id can be returned and passed to the query function. Task-number: QTBUG-66031 Change-Id: Iba755b8154fba3fadf81a1a73c87d16f0e31c4f3 Reviewed-by: Michael Winkelmann <michael.winkelmann@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Remove an unused functionv5.11.0-alpha1Jesus Fernandez2018-02-131-14/+4
| | | | | | | | | | Moved its debug message to the one place where its code was almost duplicated, rather than changing this place to call the function and changing the function to accurately do what it did; there's no real sense to a function to send the resize event to the application. Change-Id: I0de3dbbcc762515a282b0192fe7c382d260d4da8 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Force Threaded Render Loop modeJesus Fernandez2018-02-131-0/+5
| | | | | | | | | | It enforces use of the render loop's threaded mode. This enables the plugin to work on Windows and other environments whose render loop uses a different mode by default. Change-Id: I86901fa2c279126e4abb2d79efbb328778861113 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Fix key mapping of Enterv5.10.15.10.15.10Michael Brasser2018-01-173-38/+8
| | | | | | | | | | | | Qt's other platform plugins differentiate Key_Enter and Key_Return. Update the webgl plugin to do the same. Also remove unused code related to key mapping. Task-number: QTBUG-65686 Change-Id: I9e65b9413828f713f56d4942531f120b7d9cc6d7 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io>
* Fix deleteFramebuffers and deleteRenderbuffersMichael Brasser2018-01-151-2/+2
| | | | | | | | Ensure signatures and arguments align. Change-Id: I9537235ab6df6331ec49c6d5b3e37c9ebb8ba40c Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io>
* WebSocket Server refactorJesus Fernandez2018-01-121-4/+7
| | | | | | | | | | | The variable is used only once. The function can be used in the condition. An error message is shown when the WebSocket Server fails to listen. Change-Id: Ia5b54d271ed72bc408d94d24eb275f7d83f290f1 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Michael Brasser <michael.brasser@live.com>
* qCritical if the user creates a raster surfaceJesus Fernandez2018-01-091-0/+1
| | | | | | | | | | | | | Raster surfaces are not allowed due to performance problems. A qCritical message is shown if the user tries to use the plugin in a widget application. [ChangeLog][QtWebGL] The application shows an error message when trying to create a QBackingStore in an application. Task-number: QTBUG-65054 Change-Id: I78bfd2b2714d7dce1f802b1864216655e2d74406 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Fix browser resizeJesus Fernandez2018-01-092-0/+7
| | | | | | | | | | The application was not sending the notification to the browser to resize the canvas. The browser was notifying the application of the resize but the application was not acting on window resize. Task-number: QTBUG-65545 Change-Id: I1ebe3b45c80b8275c74e1e39de3e1a780b953e26 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Add a comment to the sentinel checkJesus Fernandez2018-01-091-1/+1
| | | | | | | | A sentinel is sent in every message to find buffer encoding errors. Change-Id: I23e471517ffc3cdaa368a018308f585cd3d84624 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Fix glDrawArraysJesus Fernandez2018-01-091-1/+3
| | | | | | | | | | Fixes a bug introduced in f73929c2c6c9229f71470502faab14178d561157. The parameters of the current implementation of the glDrawArrays cannot be deduced from the function prototype but the buffer length can be used. Change-Id: I3296bfeff983f517d5a003e1f3c52de39b190b9d Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Instantiate QCoreTextFontDatabaseEngineFactory, not just base classJesus Fernandez2018-01-091-1/+2
| | | | | | | | | We were instantiating the QCoreTextFontDatabase base class, which doesn't provide the full set of required functions. Task-number: QTBUG-65078 Change-Id: I4dbe50b594ca25c61f748170acf29fcaabc65c0b Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Only claim support for capabilities WebGL actually hasJesus Fernandez2018-01-091-7/+6
| | | | | | | | Don't fall back on the platform plugin's capability check, as that's irrelevant to the capabilities deliverable via WebGL. Change-Id: If3520adfa8b0dd9a61a46a3a17f57eadcde536d6 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Remove the parameterCount parameterJesus Fernandez2017-12-055-140/+156
| | | | | | | | | | | | Saves 4 bytes per message. Combined with other optimizations, this can save a lot of bandwidth. It also adds a new serialization type, the array. The parameter count cannot be removed without supporting arrays. Change-Id: I5f9c0901d50fb7d9613461d9860338e18dcbe3cd Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Do not send images filled with zerosJesus Fernandez2017-11-241-4/+15
| | | | | | | | | | | Detect if the image data is all zero: if so, send an empty buffer. This happens for a texture atlas, which is later filled with texSubImage2D, discarding the data originally sent, so not sending the data improves performance, notably reducing the loading time. Change-Id: Ife298bb5e8d7ee96b800f06fcb8371a6d08d2101 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Change variable nameJesus Fernandez2017-11-231-14/+15
| | | | | | | | It improves the readability of the code. Change-Id: Ice1021f23e439c74d1d8817bd2c432c7161c352b Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Send numeric identifiers instead of stringsJesus Fernandez2017-11-234-11/+34
| | | | | | | | | Saves bandwidth by using a number instead of sending the full string to identify the GL command. Change-Id: I5e8010465729d7a9c320d0375582d3a92d76019d Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Fix Javascript errorJesus Fernandez2017-11-221-1/+1
| | | | | | | | | | | | 14:56:58.398 webqt.js:747 Uncaught ReferenceError: context is not defined at WebGLRenderingContext.gl.uniform3fv (webqt.js:747) at execGL (webqt.js:944) at handleGlesMessage (webqt.js:1088) at handleBinaryMessage (webqt.js:1073) at WebSocket.socket.onmessage (webqt.js:1129) Change-Id: Ifa77c853b4cec29f21cc19ffc5b86b741d8ef5ab Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Move the WebGL GLFunction hash into the GLFunction classJesus Fernandez2017-11-221-6/+7
| | | | | | | | | | This change prepares the way for new ways to find local and remote function information. Change-Id: Ie18952720d3570af3037e1bd4f8d16c8bfe8d6dc Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io>
* Use a dictionary instead of an arrayJesus Fernandez2017-11-221-44/+38
| | | | | | | | | | This gives faster look-ups when checking if a function needs to return a value to the application. Change-Id: I732af378b826359e094822d602a6b8c424a65ab0 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io>
* Don't send size as a bufferSubData parameterv5.10.0-rc3v5.10.0-rc2v5.10.0-rc1v5.10.0Jesus Fernandez2017-11-151-1/+1
| | | | | | | | | | The 'size' is not required as a parameter, it's handled by the 'ArrayBuffer' directly. This fixes the WebGL 'bufferSubData' function which has a different argument list than 'glBufferSubData'. Change-Id: I561de68057d456ac3733ca0e0086e8b874b7e8ea Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Handle null values in bufferData functionJesus Fernandez2017-11-151-1/+1
| | | | | | | | The browser was stopping the execution when receiving a 'null' value for the data parameter. Change-Id: I6cc57b5cb90ee1d2bb0eaf7866028c959b299154 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Fix conflicting DEPTH/STENCIL/DEPTH_STENCIL attachments warningJesus Fernandez2017-11-141-1/+7
| | | | | | | | | | | | | | The hack, to convert two consecutive calls to glFramebufferRenderbuffer with parameters GL_STENCIL_ATTACHMENT and GL_DEPTH_ATTACHMENT, was not working properly. Now the call using GL_DEPTH_ATTACHMENT is ignored and the call using GL_STENCIL_ATTACHMENT is converted into a GL_DEPTH_STENCIL_ATTACHMENT. This fixes the QuickItem ShaderEffect using a ShaderEffectSource as source item. Change-Id: Ic77bedf1837e8fa3a11818e6e5aaf8d990d6b8ea Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Improve JavaScript debug messagesv5.10.0-beta4Jesus Fernandez2017-11-031-4/+25
| | | | | | | | | | Tries to write the enumeration value for numbers if possible to improve readability of the parameters. Change-Id: I37163fb3b09be3de7280786ddbc2fd42dfef8750 Reviewed-by: Michael Winkelmann <michael.winkelmann@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Remove unneeded dependency and includeJesus Fernandez2017-11-023-3/+0
| | | | | | | | | QOpenGLPlatformCompositor dependency was a leftover from a previous implementation and it's no longer needed. Task-number: QTBUG-64168 Change-Id: Iaff553a9102d3d1751343c5c32c53259fbbc2529 Reviewed-by: Robert Loehning <robert.loehning@qt.io>
* Fix gl.renderbufferStorage function typov5.10.0-beta3Jesus Fernandez2017-10-251-1/+1
| | | | | | | | | The gl.renderbufferStorage function was failing because the internal format was not converted to the supported WebGL format. Change-Id: I376ad19907ed69e54a6ee56e130f34cca211a7f9 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Remove useless commentsJesus Fernandez2017-10-251-70/+0
| | | | | | | | For further optimizations the values can be added manually. Change-Id: I63b66282443924b433a4f1a2cf1b324956f4c5ea Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Remove undefined variablesJesus Fernandez2017-10-251-3/+0
| | | | | | | | | | Makes no sense to keep a function reference to an undefined function. We are not overriding WebGL functions because they have a different name convention. Change-Id: Ibb3a65a50a73d26cfbf938fe72f2313f23bb07a2 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Fix extra ; warningJesus Fernandez2017-10-241-57/+57
| | | | | Change-Id: I83999c0e99608d763e180b7f4287bc19a7e1d430 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>