From 5883b6a22c7a484d2fed032d0c51f240f0ef9cd0 Mon Sep 17 00:00:00 2001 From: Andreas Holzammer Date: Tue, 29 Apr 2014 19:16:23 +0200 Subject: [QNX]Clear transparent regions If a region gets painted the buffer beneath needs to be cleared, as it could be that there are leftovers from the last blit. Change-Id: I51f19aa010015059e9a6d9d5e5e4f25fb9532d4e Reviewed-by: Rafael Roquetto Reviewed-by: Fabian Bumberger --- .../platforms/qnx/qqnxrasterbackingstore.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'src/plugins/platforms/qnx/qqnxrasterbackingstore.cpp') diff --git a/src/plugins/platforms/qnx/qqnxrasterbackingstore.cpp b/src/plugins/platforms/qnx/qqnxrasterbackingstore.cpp index 57914cf2fb..3109388fb2 100644 --- a/src/plugins/platforms/qnx/qqnxrasterbackingstore.cpp +++ b/src/plugins/platforms/qnx/qqnxrasterbackingstore.cpp @@ -41,6 +41,8 @@ #include "qqnxrasterbackingstore.h" #include "qqnxrasterwindow.h" +#include "qqnxscreen.h" +#include "qqnxglobal.h" #include @@ -167,6 +169,25 @@ void QQnxRasterBackingStore::beginPaint(const QRegion ®ion) m_hasUnflushedPaintOperations = true; platformWindow()->adjustBufferSize(); + + if (window()->requestedFormat().alphaBufferSize() != 0) { + foreach (const QRect &r, region.rects()) { + // Clear transparent regions + const int bg[] = { + SCREEN_BLIT_COLOR, 0x00000000, + SCREEN_BLIT_DESTINATION_X, r.x(), + SCREEN_BLIT_DESTINATION_Y, r.y(), + SCREEN_BLIT_DESTINATION_WIDTH, r.width(), + SCREEN_BLIT_DESTINATION_HEIGHT, r.height(), + SCREEN_BLIT_END + }; + Q_SCREEN_CHECKERROR(screen_fill(platformWindow()->screen()->nativeContext(), + platformWindow()->renderBuffer().nativeBuffer(), bg), + "failed to clear transparent regions"); + } + Q_SCREEN_CHECKERROR(screen_flush_blits(platformWindow()->screen()->nativeContext(), 0), + "failed to flush blits"); + } } void QQnxRasterBackingStore::endPaint() -- cgit v1.2.3