From 3f1ac5899476307923686166705812c24a2e3578 Mon Sep 17 00:00:00 2001 From: Jesus Fernandez Date: Tue, 25 Apr 2017 14:22:13 +0200 Subject: Add QPlatformSurface::screen() const Classes inheriting QPlatformSurface need to return the QPlatformScreen to allow the platform integration plugin to know information about the used screen by the surface. QPlatformSurface and QPlatformWindow had the same function defined, but it was not possible to call it without casting the QPlatformSurface pointer. Change-Id: I1f93fe7c13ebbc51769677038edeca4de5db0024 Reviewed-by: Qt CI Bot Reviewed-by: Laszlo Agocs --- src/plugins/platforms/qnx/qqnxrasterwindow.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/plugins/platforms/qnx/qqnxrasterwindow.cpp') diff --git a/src/plugins/platforms/qnx/qqnxrasterwindow.cpp b/src/plugins/platforms/qnx/qqnxrasterwindow.cpp index 7f11de228e..dc844189d1 100644 --- a/src/plugins/platforms/qnx/qqnxrasterwindow.cpp +++ b/src/plugins/platforms/qnx/qqnxrasterwindow.cpp @@ -141,6 +141,7 @@ QQnxBuffer &QQnxRasterWindow::renderBuffer() // Check if render buffer is invalid if (m_currentBufferIndex == -1) { + auto platformScreen = static_cast(screen()); // Get all buffers available for rendering screen_buffer_t buffers[MAX_BUFFER_COUNT]; const int result = screen_get_window_property_pv(nativeHandle(), SCREEN_PROPERTY_RENDER_BUFFERS, @@ -153,11 +154,11 @@ QQnxBuffer &QQnxRasterWindow::renderBuffer() // Clear Buffer int bg[] = { SCREEN_BLIT_COLOR, 0x00000000, SCREEN_BLIT_END }; - Q_SCREEN_CHECKERROR(screen_fill(screen()->nativeContext(), buffers[i], bg), + Q_SCREEN_CHECKERROR(screen_fill(platformScreen->nativeContext(), buffers[i], bg), "Failed to clear window buffer"); } - Q_SCREEN_CHECKERROR(screen_flush_blits(screen()->nativeContext(), 0), + Q_SCREEN_CHECKERROR(screen_flush_blits(platformScreen->nativeContext(), 0), "Failed to flush blits"); // Use the first available render buffer @@ -185,7 +186,7 @@ void QQnxRasterWindow::adjustBufferSize() int QQnxRasterWindow::pixelFormat() const { - return screen()->nativeFormat(); + return static_cast(screen())->nativeFormat(); } void QQnxRasterWindow::resetBuffers() -- cgit v1.2.3