display: fix transparency bug
authorJinhyung Jo <jinhyung.jo@samsung.com>
Mon, 19 Sep 2016 11:22:20 +0000 (20:22 +0900)
committerSeokYeon Hwang <syeon.hwang@samsung.com>
Tue, 20 Sep 2016 13:06:01 +0000 (22:06 +0900)
If the alpha value of the color less than 1.0,
there is a issue that the desktop background is blended
on the offscreen mode. So fixed it.

Change-Id: Ic5c80aa7274a8ce6e9b433dc87e2581b0761619c
Signed-off-by: Jinhyung Jo <jinhyung.jo@samsung.com>
tizen/src/ui/displayswwidget.cpp
tizen/src/ui/qt5_supplement.cpp

index 9ca59a6..97c968e 100644 (file)
@@ -40,11 +40,11 @@ DisplaySWWidget::DisplaySWWidget(QWidget *parent,
     DisplayType *displayForm, QSize resolution, qreal scaleFactor) :
     QLabel(parent), DisplayBase(displayForm, resolution, scaleFactor, this)
 {
-    /* fill the screen with black surface */
+    /* fill the screen with black(with full alpha) surface */
     QPixmap initImage(
         displayForm->getRect().width() * scaleFactor,
         displayForm->getRect().height() * scaleFactor);
-    initImage.fill(Qt::black);
+    initImage.fill(QColor(0, 0, 0, 255));
     setPixmap(initImage);
     /* to be enable to drop events */
     setAcceptDrops(true);
index 016a2ec..d87d2d3 100644 (file)
@@ -513,10 +513,10 @@ void qt5_prepare(void)
 
 void qt5_update_internal(void *data, int width, int height)
 {
-    QImage image((uchar *)data, width, height, QImage::Format_RGB32);
+    QImage image((uchar *)data, width, height, QImage::Format_ARGB32);
 
-    mainwindow->getScreenWidget()->setPixmap(
-        QPixmap::fromImage(image.transformed(
+    mainwindow->getScreenWidget()->setPixmap(QPixmap::fromImage(
+            image.convertToFormat(QImage::Format_RGB32).transformed(
             mainwindow->getDisplayMatrix(), Qt::SmoothTransformation)));
 }