Commit Graph

11 Commits

Author SHA1 Message Date
Jan Arve Saether 1e1ad53904 Don't call render during expose, since we are already calling render().
This causes drawing artifacts on Win7 with ANGLES d3d11 backend.

Task-number: QTBUG-49923

Change-Id: I801282c4359bd485d1894e409e34393b4264d994
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
2016-02-05 10:56:41 +00:00
Friedemann Kleint 1e2e356f0f Port examples to new connection syntax.
Change-Id: I121c59ac0ad56acb4cd54b99ecd37567368385ce
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
2015-07-22 22:16:19 +00:00
Laszlo Agocs e3f56a8b8d Fix rendercontrol example for screens with different dpr
renderWindow() was not reimplemented in the example. This is pretty
bad since renderWindowFor() fails to find a window and thus falls
back to using the default device pixel ratio (which is the highest
dpr present in the system). The result is broken content from Quick
because it operates with a dpr of 2 any time a retina screen is connected,
even when the example's own QWindow is placed on a normal screen.

Add also a note to the QQuickRenderControl docs because it is easy to
overlook.

Task-number: QTBUG-45613
Change-Id: I31bf92ec285f3d9867a5604a4b4e3bea73791932
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2015-04-28 15:02:06 +00:00
Laszlo Agocs 4da32851de Recreate the FBO on dpr change in rendercontrol example
Even when the window size is not changing. This provides a useful
example of connecting to the screenChanged() signal.

Task-number: QTBUG-45613
Change-Id: I0652838d9c0cfec8b64b3422997159f385445b20
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2015-04-28 15:01:49 +00:00
Laszlo Agocs facf3b15b3 Avoid showing garbage when resizing the rendercontrol example
The threaded variant was working well since that triggers a render
when resizing. The single threaded version lacked this and this
resulted in showing garbage on OS X at least since the new FBO had
undefined contents. Avoid this.

Task-number: QTBUG-45613
Change-Id: Ibb3d3f7640bab5da913df1c0c63cc3a3aaafb140
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2015-04-28 15:01:26 +00:00
Jani Heikkinen 20c207815a Fixed license headers
Change-Id: I4d5640ff95e1361ec7e65fb3e87d7726d8185ff5
Reviewed-by: Sergio Ahumada <sahumada@texla.cl>
2015-02-17 13:33:18 +00:00
Jani Heikkinen c5796292ad Update copyright headers
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>
2015-02-12 10:28:11 +00:00
Laszlo Agocs fae16f9d2f Prevent windows outside the gui thread in rendercontrol example
In the multithreaded case we attempted to create QWindows outside
the gui thread on platforms where QOffscreenSurface is backed by
the hidden QWindow in the absence of a better solution. This has
to be avoided. Therefore, pass a suitable surface from the gui
thread instead.

This will avoid "Attempting to create QWindow-based QOffscreenSurface
outside the gui thread." type of warnings when running on OS X with
--threaded.

Change-Id: Ie3ebeeeaa9e6bdf83e763e40213e2940fbfde667
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com>
Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
2015-01-07 13:21:00 +01:00
Laszlo Agocs 5a7b256a62 rendercontrol example: calculate fbo size correctly
Change-Id: Ida1e7cb9426d31ed6406dd6db86f5834f0f1a6ac
Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
2014-12-18 10:15:26 +01:00
Laszlo Agocs 92a1c1f60c rendercontrol example: Add missing flushes
Otherwise we will show broken output with some drivers.
QQuickWidget does this already.

Change-Id: I5193595c4606d0497dbe85f6f8c670618ca366e9
Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
2014-12-17 10:17:12 +01:00
Laszlo Agocs 6179550a0c Support threading with QQuickRenderControl
Reorganize the rendercontrol example to demonstrate both the single
and multi threaded approaches.

A small helper function is introduced to the QQuickRenderControl API:
The QSGRenderContext has to live on the render thread. Previously there
was no way for applications to move it to the desired thread. This is
now possible.

Pass --threaded to the rendercontrol example to use a separate render thread.

[ChangeLog][QtQuick] QQuickRenderControl can now be used to render the Qt Quick
scene on a dedicated render thread, similarly to how the built-in threaded render
loop operates.

Task-number: QTBUG-42813
Change-Id: I01c3b2ffca8a174d9d2c267a51f2e484ed7b34b3
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
2014-12-12 12:19:14 +01:00