summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/android/qandroidplatformopenglwindow.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Fixes for surface creation/destructionBogDan Vatra2015-01-101-8/+12
| | | | | | | | | | | | | | | | | | | - After reset a surface we must call makeCurrent before we are usign swapBuffers. - No need to set the surface in QPA when surfaceCreated are called in QtSurface.java, some time the OpenGL surface is not fully initialized at this stage. Is better to wait for surfaceChanged which is always fired at least once. - DO NOT reset m_surfaceId to 1 when there is no surface. The problem is that if we have one surface and when we distory it we don't (need to) wait for its surfaceChanged/surfaceDestroyed notifications, and if we create another one quicly it will have the same id (1). Task-number: QTBUG-39712 Change-Id: I2aa31e5b59d81ef3b03624d4636a4381eea6d543 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
* Android: deadlock avoidancePaul Olav Tvete2014-10-201-0/+5
| | | | | | | | | | | | | This change adds deadlock protection to all places where we lock one thread while waiting for the other to do something. If we detect that the other thread is going to block, we abort the operation. This could cause unexpected problems, such as painting errors, text input errors, or even crashes, but the alternative is a guaranteed deadlock. Task-number: QTBUG-41369 Change-Id: I2627a955cfafc4bce54eb9d0d38e19b768b06956 Reviewed-by: Christian Stromme <christian.stromme@digia.com>
* Update license headers and add new license filesMatti Paaso2014-09-241-19/+11
| | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 - Removed LICENSE.GPL Change-Id: Iec3406e3eb3f133be549092015cefe33d259a3f2 Reviewed-by: Iikka Eklund <iikka.eklund@digia.com>
* Android: don't recreate surface on shutdownPaul Olav Tvete2014-09-051-0/+4
| | | | | | | | | When we suspend the app, we destroy the surface to save resources. We don't want to create it again just as we are shutting down. Task-number: QTBUG-41072 Change-Id: I7a616249bee869b92716d0911201a80d73c2f8da Reviewed-by: Christian Stromme <christian.stromme@digia.com>
* Support QOpenGLWidget and QQuickWidget on AndroidLaszlo Agocs2014-08-251-5/+34
| | | | | | | | | | | | | | | | | | | | | | | | It gets somewhat complicated due to the fact that a RasterGLSurface window (i.e. any widget window since 5.3) may behave either like an OpenGLSurface or a RasterSurface, and the expected behavior may change on each backingstore sync. This does not fit designs where the platform window implementation is separated and there is different behavior for raster and GL windows. Therefore QAndroidPlatformOpenGLWindow is now made capable of behaving like the raster one, based on a flag communicated from the widget stack via QWindowPrivate (since the plugin knows nothing about widgets). This means that widget windows that do not have renderToTexture children (QOpenGLWidget, QQuickWidget) will go through the raster path, while the ones that have will behave like an OpenGL window with the actual rendering happening in QPlatformBackingStore::composeAndFlush(). The surface type is RasterGLSurface in both cases nonetheless. Task-number: QTBUG-37907 Change-Id: I6f9261fc0fd993afcda7f30d379c5410069033d3 Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
* Make the expose region local on all platformsLaszlo Agocs2014-08-121-1/+1
| | | | | | | | | | | | | | | | | | | | | QExposeEvent::region() reports a region in a random coordinate system. The behavior is undocumented and the platform plugins do different things. xcb, offscreen and ios are correct. These set the region in local coordinates, which is the most logical interpretation of the expose region. windows is almost correct, except for one occurrence. cocoa and others need changes: passing in geometry() as the exposed region is always wrong. The patch documents the expected behavior both for QExposeEvent and internally in QWindowSystemInterface. The problematic plugins are fixed to use local coordinates. Task-number: QTBUG-40470 Change-Id: I6ded3154d14254fa71d4292d8e1b5e6cf696c81a Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
* Android: Fix expose region.BogDan Vatra2014-07-311-2/+2
| | | | | | | | It seems that the second parameter of handleExposeEvent function is about the region inside the window, not its position on the screen. Change-Id: I89f5b2b13c9b0993253542823a84547d6a994c31 Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
* Android: Release all windows when the application is suspended.BogDan Vatra2014-07-311-4/+21
| | | | | | | | | | | | | | When an application is suspended on Android all its Gl surfaces are destroyed and can't be used to render anymore, so we should release them in order to give back to the system the memory used by them. [ChangeLog] [Android] Release all windows when the application is suspended. Task-number: QTBUG-29069 Change-Id: I038aaa2006da1f3188fccba943ec4ffb3e551cf0 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
* Android: Support offscreen surfaces on pbuffersEskil Abrahamsen Blomfeldt2014-06-041-0/+9
| | | | | | | | This is pretty much the same thing that eglfs does. Task-number: QTBUG-38960 Change-Id: Ibf310ca8e3a4e31e5310ab3a3d3e851eae31a4ad Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* Android: Fix flashing on startup/shutdownEskil Abrahamsen Blomfeldt2014-06-041-3/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There were several issues on startup of the application which were caused by the fact that we would get the wrong available screen geometry on startup, set this as the initial surface size and then expose native windows with this size. This would cause first a flicker of white on the early expose and the window contents to jump around as the window was resized to the actual available space on screen. The fix for this is to postpone the first expose until we have actually got a proper screen size from the main layout. We use width,height = 0 as an indicator that the available geometry is not yet known, and we skip posting any expose events before this is set by the layout. In addition, since we removed the surface before we shut down the application, it was by a white rectangle before the shutdown transition happens, and this white rectangle will be animated instead of application contents. To rectify this, we make sure the last surface in the stack remains in the layout until it is either replaced by a different surface or until the application has shut down. This way, the shutdown animation will work on this surface instead. [ChangeLog][Android] Fixed regression where there would be flickering on startup and shutdown of the application. Task-number: QTBUG-38960 Change-Id: Ia1579ca8c522d8beeab066f78070ad49009d0238 Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
* Make full use of QT_ANDROID_RASTER_IMAGE_DEPTH env variable.BogDan Vatra2014-02-221-1/+1
| | | | | | | | If raster only apps set QT_ANDROID_RASTER_IMAGE_DEPTH to 16 (RGB16), we should create also RGB16 native surface. Change-Id: I82692ff34b0e604e627d1d86a437272e3700daf8 Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
* Fix surface leak, cleanup opengl window.BogDan Vatra2014-01-311-9/+4
| | | | | | | | | | ANativeWindow_fromSurface already acquires the surface, no need to call ANativeWindow_acquire. Remove unused variables. Change-Id: I563573072687927256aef76fab20f645f35778a2 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
* Android: Remove debug output from platform windowEskil Abrahamsen Blomfeldt2014-01-211-6/+0
| | | | | | | Some debug info and a #warning had somehow made it through :) Change-Id: I420a7637bfd5d1a79a342eacefcc35430994feff Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
* Support multiple native surfaces on Android.BogDan Vatra2014-01-171-0/+160
Support for multiple native surfaces is needed by applications that need to mix raster windows with GL windows. Rework the raster and opengl implementation, get rid of eglfs and fbconvenience dependencies. Create a single android platform plugin. [ChangeLog][Android] Rework the raster and opengl implementation. [ChangeLog][Android] Create a single android platform plugin. Task-number: QTBUG-34650 Change-Id: I9b1ab51554823329dda8cfbf8fef27c38f917c7b Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>