summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--hw/vigs/vigs_qt5.cpp9
-rw-r--r--hw/vigs/vigs_server.c1
-rw-r--r--include/sysemu/sysemu.h3
-rw-r--r--tizen/src/display/maru_display.c10
-rw-r--r--tizen/src/display/maru_display.h2
-rw-r--r--tizen/src/display/qt5.c8
-rw-r--r--tizen/src/display/qt5_supplement.cpp16
-rw-r--r--tizen/src/display/qt5_supplement.h2
-rw-r--r--vl.c23
9 files changed, 51 insertions, 23 deletions
diff --git a/hw/vigs/vigs_qt5.cpp b/hw/vigs/vigs_qt5.cpp
index 1166c8d561..927d558320 100644
--- a/hw/vigs/vigs_qt5.cpp
+++ b/hw/vigs/vigs_qt5.cpp
@@ -34,6 +34,7 @@
#include <qpa/qplatformnativeinterface.h>
#include <stdio.h>
+extern bool qt5IsOnscreen;
extern QApplication *qt5App;
extern QOpenGLContext *qt5GLContext;
extern QSurfaceFormat qt5GLFormat;
@@ -46,14 +47,10 @@ extern void qt5_process_captured(bool captured, void *pixels,
bool vigs_qt5_onscreen_enabled(void)
{
-#ifndef CONFIG_DARWIN
- /* Qt5 bug, QGLWidget has some problem on MacOS.
- * (scrambled screen when resizing, invalid region masking) */
- if (qt5App != NULL) {
+ // TODO: on Darwin?
+ if (qt5App != NULL && qt5IsOnscreen) {
return true;
}
-#endif
-
return false;
}
diff --git a/hw/vigs/vigs_server.c b/hw/vigs/vigs_server.c
index 5e266295c4..13575b538c 100644
--- a/hw/vigs/vigs_server.c
+++ b/hw/vigs/vigs_server.c
@@ -458,6 +458,7 @@ static void vigs_server_capture_work(struct work_queue_item *wq_item)
if (pixels) {
captured = server->capture(server, root_sfc, pixels);
+ /* TODO: brightness composite to pixels */
}
server->capture_ops->process_captured(captured,
diff --git a/include/sysemu/sysemu.h b/include/sysemu/sysemu.h
index 57b31073ad..7652c16fa5 100644
--- a/include/sysemu/sysemu.h
+++ b/include/sysemu/sysemu.h
@@ -103,7 +103,8 @@ typedef enum DisplayType
#ifdef CONFIG_MARU
DT_MARU_SDL,
DT_MARU_SHM,
- DT_MARU_QT,
+ DT_MARU_QT_ONSCREEN,
+ DT_MARU_QT_OFFSCREEN,
#endif
DT_NONE,
} DisplayType;
diff --git a/tizen/src/display/maru_display.c b/tizen/src/display/maru_display.c
index b3aa9c2c6c..db2abfb78e 100644
--- a/tizen/src/display/maru_display.c
+++ b/tizen/src/display/maru_display.c
@@ -64,8 +64,11 @@ void maru_display_early_init(DisplayType display_type)
{
switch (display_type) {
#ifdef CONFIG_QT
- case DT_MARU_QT:
- maru_qt5_display_early_init();
+ case DT_MARU_QT_ONSCREEN:
+ maru_qt5_display_early_init(true);
+ break;
+ case DT_MARU_QT_OFFSCREEN:
+ maru_qt5_display_early_init(false);
break;
#endif
default:
@@ -92,7 +95,8 @@ void maru_display_init(DisplayState *ds, DisplayType display_type,
break;
#endif
#ifdef CONFIG_QT
- case DT_MARU_QT:
+ case DT_MARU_QT_ONSCREEN:
+ case DT_MARU_QT_OFFSCREEN:
maru_qt5_display_init(mdcl, full_screen);
break;
#endif
diff --git a/tizen/src/display/maru_display.h b/tizen/src/display/maru_display.h
index c58a4aff5b..caee72c542 100644
--- a/tizen/src/display/maru_display.h
+++ b/tizen/src/display/maru_display.h
@@ -74,7 +74,7 @@ void maru_sdl_pre_init(MaruDisplayChangeListener *mdcl);
void maru_shm_pre_init(MaruDisplayChangeListener *mdcl);
/* maru_qt */
-void maru_qt5_display_early_init(void);
+void maru_qt5_display_early_init(bool isOnscreen);
void maru_qt5_display_init(MaruDisplayChangeListener *mdcl, int full_screen);
diff --git a/tizen/src/display/qt5.c b/tizen/src/display/qt5.c
index 495a17d5e9..6f33a22a47 100644
--- a/tizen/src/display/qt5.c
+++ b/tizen/src/display/qt5.c
@@ -27,10 +27,12 @@
*
*/
+#include <png.h>
#include "ui/console.h"
#include "emul_state.h"
#include "maru_display.h"
#include "qt5_supplement.h"
+#include "maru_display_processing.h"
extern QemuMutex sdl_mutex;
extern QemuCond sdl_cond;
@@ -65,6 +67,8 @@ static void qt5_update(DisplayChangeListener *dcl,
return;
}
+ composite_brightness_image(surf->image);
+
qt5_update_internal(surface_data(surf),
surface_width(surf),
surface_height(surf));
@@ -105,7 +109,7 @@ void ns_run_in_event_loop(void (*func)());
void set_application_icon(char *path);
#endif
-void maru_qt5_display_early_init(void)
+void maru_qt5_display_early_init(bool isOnscreen)
{
#ifdef CONFIG_DARWIN
ns_run_in_event_loop(&qt5_early_prepare);
@@ -124,7 +128,7 @@ void maru_qt5_display_early_init(void)
set_application_icon(icon_path);
g_free(icon_path);
#else
- qt5_early_prepare();
+ qt5_early_prepare(isOnscreen);
#endif
}
diff --git a/tizen/src/display/qt5_supplement.cpp b/tizen/src/display/qt5_supplement.cpp
index e46e2462fc..41af9f39c7 100644
--- a/tizen/src/display/qt5_supplement.cpp
+++ b/tizen/src/display/qt5_supplement.cpp
@@ -45,6 +45,7 @@ void qMessageOutput(QtMsgType, const QMessageLogContext &, const QString &);
void loadMainFormFromXML(QFile *, UIInformation *);
void loadConFormFromXML(QFile *, UIInformation *);
+bool qt5IsOnscreen;
QApplication *qt5App = NULL;
static int argc = 0;
@@ -257,8 +258,9 @@ void qt5_destroy()
delete uiInfo;
}
-void qt5_early_prepare(void)
+void qt5_early_prepare(bool isOnscreen)
{
+ qt5IsOnscreen = isOnscreen;
Q_INIT_RESOURCE(resource);
qInstallMessageHandler(qMessageOutput);
@@ -294,17 +296,17 @@ void qt5_prepare(void)
void qt5_update_internal(void *data, int width, int height)
{
+ QMatrix matrix = QMatrix();
QPixmap pixmap = QPixmap();
QLabel *screenWidget = mainwindow->getScreenWidget();
- /*
- * TODO: support rotation.
- */
+ matrix.scale(mainwindow->getUIState()->getScaleFactor(),
+ mainwindow->getUIState()->getScaleFactor());
+ matrix.rotate(mainwindow->uiInfo->getMainFormDisplayType()->getAngle());
QImage image = QImage((uchar *)data, width, height, QImage::Format_RGB32);
- pixmap.convertFromImage(image);
- screenWidget->setPixmap(pixmap.scaled(screenWidget->size(),
- Qt::KeepAspectRatio, Qt::SmoothTransformation));
+ pixmap.convertFromImage(image.transformed(matrix, Qt::SmoothTransformation));
+ screenWidget->setPixmap(pixmap);
}
void qt5_switch_internal(void)
diff --git a/tizen/src/display/qt5_supplement.h b/tizen/src/display/qt5_supplement.h
index 74b96a8c41..d9a9189444 100644
--- a/tizen/src/display/qt5_supplement.h
+++ b/tizen/src/display/qt5_supplement.h
@@ -36,7 +36,7 @@ extern "C" {
#endif
void qt5_graphic_hw_invalidate(void);
int qt5_graphic_hw_display(void);
-void qt5_early_prepare(void);
+void qt5_early_prepare(bool isOnscreen);
void qt5_prepare(void);
void qt5_destroy(void);
diff --git a/vl.c b/vl.c
index 22e4ee4eeb..18269c722d 100644
--- a/vl.c
+++ b/vl.c
@@ -2209,7 +2209,25 @@ static DisplayType select_display(const char *p)
# endif
} else if (strstart(p, "maru_qt", &opts)) {
# ifdef CONFIG_QT
- display = DT_MARU_QT;
+ if (*opts) {
+ const char *nextopt;
+ if (strstart(opts, ",rendering=", &nextopt)) {
+ opts = nextopt;
+ if (strstart(opts, "onscreen", &nextopt)) {
+ display = DT_MARU_QT_ONSCREEN;
+ } else if (strstart(opts, "offscreen", &nextopt)) {
+ display = DT_MARU_QT_OFFSCREEN;
+ } else {
+ goto invalid_maru_qt_args;
+ }
+ } else {
+ invalid_maru_qt_args:
+ fprintf(stderr, "Invalid maru_qt option string: %s\n", p);
+ exit(1);
+ }
+ } else {
+ display = DT_MARU_QT_ONSCREEN;
+ }
# else
fprintf(stderr, "maru_qt is disabled\n");
@@ -4544,7 +4562,8 @@ int main(int argc, char **argv, char **envp)
break;
#endif
#if defined(CONFIG_QT)
- case DT_MARU_QT:
+ case DT_MARU_QT_ONSCREEN:
+ case DT_MARU_QT_OFFSCREEN:
maru_display_init(ds, display_type, full_screen);
break;
#endif