From: Jinhyung Jo Date: Tue, 26 Jul 2016 07:45:42 +0000 (+0900) Subject: display: add initialization option X-Git-Tag: Tizen_Studio_1.3_Release_p2.3.2~26^2~6^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6b1f06f25070e6d54afe1c887480a0b0f5a9eeda;p=sdk%2Femulator%2Fqemu.git display: add initialization option Add code to run with OpenGL Legacy Profile in Mac OS X. Change-Id: I23967ccdd33d87d96df858460ceaa688b129d41e Signed-off-by: Jinhyung Jo --- diff --git a/tizen/src/ui/qt5.c b/tizen/src/ui/qt5.c index 928c85e871..fe5adaa53c 100644 --- a/tizen/src/ui/qt5.c +++ b/tizen/src/ui/qt5.c @@ -176,6 +176,11 @@ int get_display_pixel_density(void) return pixel_density_dpi; } +void maru_qt5_set_force_legacy(bool isLegacy) +{ + qt5_set_force_legacy(isLegacy); +} + void maru_qt5_display_init(DisplayState *ds, int full_screen) { int i; diff --git a/tizen/src/ui/qt5.h b/tizen/src/ui/qt5.h index 83ee83ac77..68afb3559e 100644 --- a/tizen/src/ui/qt5.h +++ b/tizen/src/ui/qt5.h @@ -39,4 +39,6 @@ void maru_qt5_display_init(DisplayState *ds, int full_screen); void set_display_pixel_density(int dpi); int get_display_pixel_density(void); +void maru_qt5_set_force_legacy(bool isLegacy); + #endif // __QT5_H__ diff --git a/tizen/src/ui/qt5_supplement.cpp b/tizen/src/ui/qt5_supplement.cpp index c2a462a39f..50e8e1c468 100644 --- a/tizen/src/ui/qt5_supplement.cpp +++ b/tizen/src/ui/qt5_supplement.cpp @@ -56,6 +56,7 @@ void loadConFormFromXML(QFile *, UiInformation *); bool qt5IsOnscreen; QApplication *qt5App = NULL; QOpenGLContext *qt5GLContext; +bool isForceLegacy; static int argc = 0; static char *argv[0]; @@ -319,6 +320,11 @@ void qt5_destroy() uiInfo = NULL; } +void qt5_set_force_legacy(bool isLegacy) +{ + isForceLegacy = isLegacy; +} + void qt5_early_prepare(bool isOnscreen) { qt5IsOnscreen = isOnscreen; @@ -346,12 +352,15 @@ void qt5_early_prepare(bool isOnscreen) sfcFormat.setAlphaBufferSize(8); sfcFormat.setDepthBufferSize(24); sfcFormat.setStencilBufferSize(8); - // FIXME: modify the version using the gl_version proerty of VIGS - sfcFormat.setMajorVersion(3); #ifdef CONFIG_DARWIN - sfcFormat.setMinorVersion(2); - sfcFormat.setProfile(QSurfaceFormat::CoreProfile); + // The default OpenGL version for QSurfaceFormat is 2.0. + if (!isForceLegacy) { + sfcFormat.setMajorVersion(3); + sfcFormat.setMinorVersion(2); + sfcFormat.setProfile(QSurfaceFormat::CoreProfile); + } #else + sfcFormat.setMajorVersion(3); sfcFormat.setMinorVersion(1); #endif QSurfaceFormat::setDefaultFormat(sfcFormat); diff --git a/tizen/src/ui/qt5_supplement.h b/tizen/src/ui/qt5_supplement.h index 836af47ce9..dbdcd06be2 100644 --- a/tizen/src/ui/qt5_supplement.h +++ b/tizen/src/ui/qt5_supplement.h @@ -46,6 +46,8 @@ void qt5_switch_internal(void); void qt5_refresh_internal(void); const char* qt5_get_version(void); + +void qt5_set_force_legacy(bool isLegacy); #ifdef __cplusplus } #endif diff --git a/vl.c b/vl.c index 36172f6199..9bd7b3bb74 100644 --- a/vl.c +++ b/vl.c @@ -2282,6 +2282,9 @@ static DisplayType select_display(const char *p) } set_display_pixel_density(dpi); nextopt = endptr; + } else if (strstart(opts, ",forcelegacy", &nextopt)) { + opts = nextopt; + maru_qt5_set_force_legacy(true); } else { invalid_maru_qt_args: error_report(FAILED_TO_DISPLAY_PARSING);