mirror of
https://github.com/VincentWei/MiniGUI.git
synced 2026-09-28 16:17:09 +08:00
Compare commits
20
Commits
ver-5-0-15
...
drm
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ef713488e3 | ||
|
|
60200cbbcd | ||
|
|
6dec838cd8 | ||
|
|
2ccb876134 | ||
|
|
d9da7747d0 | ||
|
|
e48af7072a | ||
|
|
210e996b56 | ||
|
|
0d0246adbe | ||
|
|
08d4ab78e5 | ||
|
|
0cda03a2eb | ||
|
|
4cf4d204e7 | ||
|
|
6aa294e75b | ||
|
|
7718be5200 | ||
|
|
78e6d6581e | ||
|
|
62b3dc11d0 | ||
|
|
67cddafa19 | ||
|
|
4ae46a4b94 | ||
|
|
2791dc99ef | ||
|
|
b7525f3001 | ||
|
|
4c55f2eac3 |
@@ -10,6 +10,7 @@ Makefile
|
|||||||
Makefile.in
|
Makefile.in
|
||||||
.deps/
|
.deps/
|
||||||
.libs/
|
.libs/
|
||||||
|
m4/*.m4
|
||||||
/acinclude.m4
|
/acinclude.m4
|
||||||
/aclocal.m4
|
/aclocal.m4
|
||||||
/autom4te.cache
|
/autom4te.cache
|
||||||
@@ -21,6 +22,7 @@ Makefile.in
|
|||||||
/depcomp
|
/depcomp
|
||||||
/install-sh
|
/install-sh
|
||||||
/libtool
|
/libtool
|
||||||
|
/ltmain.sh
|
||||||
/*.pc
|
/*.pc
|
||||||
/*config.h
|
/*config.h
|
||||||
/*config.h.in
|
/*config.h.in
|
||||||
@@ -30,3 +32,5 @@ Makefile.in
|
|||||||
/src/sysres/font_list
|
/src/sysres/font_list
|
||||||
/src/sysres/license/dat_files/
|
/src/sysres/license/dat_files/
|
||||||
/configure~
|
/configure~
|
||||||
|
.cache
|
||||||
|
compile_commands.json
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
ACLOCAL_AMFLAGS = -I m4
|
||||||
|
|
||||||
SUBDIRS = src 3rd-party include rtos etc m4 cmake build
|
SUBDIRS = src 3rd-party include rtos etc m4 cmake build
|
||||||
|
|
||||||
EXTRA_DIST = minigui.pc.in \
|
EXTRA_DIST = minigui.pc.in \
|
||||||
|
|||||||
@@ -566,7 +566,7 @@ A brief history description of the development progress is listed as follow:
|
|||||||
1. Jan., 2022: FMSoft released MiniGUI version 5.0.9.
|
1. Jan., 2022: FMSoft released MiniGUI version 5.0.9.
|
||||||
1. Sep., 2022: FMSoft released MiniGUI version 5.0.10.
|
1. Sep., 2022: FMSoft released MiniGUI version 5.0.10.
|
||||||
1. Aug., 2023: FMSoft released MiniGUI version 5.0.13.
|
1. Aug., 2023: FMSoft released MiniGUI version 5.0.13.
|
||||||
1. May., 2025: FMSoft released MiniGUI version 5.0.15.
|
1. May., 2025: FMSoft released MiniGUI version 5.0.16.
|
||||||
|
|
||||||
## AUTHORS AND COPYING
|
## AUTHORS AND COPYING
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
# Release Notes
|
# Release Notes
|
||||||
|
|
||||||
|
- [Version 5.0.16](#version-5016)
|
||||||
|
+ [What's new in version 5.0.16](#whats-new-in-version-5016)
|
||||||
- [Version 5.0.15](#version-5015)
|
- [Version 5.0.15](#version-5015)
|
||||||
+ [What's new in version 5.0.15](#whats-new-in-version-5015)
|
+ [What's new in version 5.0.15](#whats-new-in-version-5015)
|
||||||
- [Version 5.0.13](#version-5013)
|
- [Version 5.0.13](#version-5013)
|
||||||
@@ -34,6 +36,19 @@
|
|||||||
+ [Changes leading to incompatibility](#changes-leading-to-incompatibility)
|
+ [Changes leading to incompatibility](#changes-leading-to-incompatibility)
|
||||||
+ [Deprecated APIs](#deprecated-apis)
|
+ [Deprecated APIs](#deprecated-apis)
|
||||||
|
|
||||||
|
## Version 5.0.16
|
||||||
|
|
||||||
|
On May 27, 2025, FMSoft announces the availability of MiniGUI 5.0.16,
|
||||||
|
which is a bugfix release with some minor enhancements of MiniGUI 5.0.x.
|
||||||
|
|
||||||
|
* BUGFIXING:
|
||||||
|
- The desktop thread can not handle the request from other threads as soon as possible.
|
||||||
|
- The `MSG_TIMEOUT` message can not be fired correctly under MiniGUI-Threads mode.
|
||||||
|
- Bad subpixel rendering when background color is RGBA0000.
|
||||||
|
* TUNING:
|
||||||
|
- Tune `configure.ac` and `Makefile.am` to use the system libtool scripts.
|
||||||
|
- Do not check `pciaccess` if the target architecture is not `i386`.
|
||||||
|
|
||||||
## Version 5.0.15
|
## Version 5.0.15
|
||||||
|
|
||||||
On May 09, 2025, FMSoft announces the availability of MiniGUI 5.0.15,
|
On May 09, 2025, FMSoft announces the availability of MiniGUI 5.0.15,
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
Version 5.0.15 (2025/05/09)
|
Version 5.0.16 (2025/05/27)
|
||||||
|
|
||||||
This is a minor enhancement and bugfix release of MiniGUI 5.0.x, the stable version.
|
This is a minor enhancement and bugfix release of MiniGUI 5.0.x, the stable version.
|
||||||
|
|
||||||
|
|||||||
+2
-1
@@ -1,6 +1,7 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
cat m4/*.m4 > acinclude.m4
|
libtoolize
|
||||||
|
cat m4/*.m4 > aclocal.m4
|
||||||
aclocal
|
aclocal
|
||||||
autoheader
|
autoheader
|
||||||
automake --add-missing --foreign --copy
|
automake --add-missing --foreign --copy
|
||||||
|
|||||||
+30
-28
@@ -1,7 +1,8 @@
|
|||||||
dnl Process this file with autoconf to produce a configure script.
|
dnl Process this file with autoconf to produce a configure script.
|
||||||
AC_PREREQ(2.60)
|
AC_PREREQ([2.71])
|
||||||
AC_INIT(libminigui, 5.0.15)
|
AC_INIT([libminigui],[5.0.16])
|
||||||
AC_CONFIG_SRCDIR(src/main/main.c)
|
AC_CONFIG_SRCDIR(src/main/main.c)
|
||||||
|
AC_CONFIG_MACRO_DIRS([m4])
|
||||||
|
|
||||||
dnl Set various version strings - taken gratefully from the SDL sources
|
dnl Set various version strings - taken gratefully from the SDL sources
|
||||||
#
|
#
|
||||||
@@ -16,9 +17,9 @@ dnl Set various version strings - taken gratefully from the SDL sources
|
|||||||
#
|
#
|
||||||
MINIGUI_MAJOR_VERSION=5
|
MINIGUI_MAJOR_VERSION=5
|
||||||
MINIGUI_MINOR_VERSION=0
|
MINIGUI_MINOR_VERSION=0
|
||||||
MINIGUI_MICRO_VERSION=15
|
MINIGUI_MICRO_VERSION=16
|
||||||
MINIGUI_INTERFACE_AGE=0
|
MINIGUI_INTERFACE_AGE=1
|
||||||
MINIGUI_BINARY_AGE=0
|
MINIGUI_BINARY_AGE=1
|
||||||
MINIGUI_VERSION=$MINIGUI_MAJOR_VERSION.$MINIGUI_MINOR_VERSION.$MINIGUI_MICRO_VERSION
|
MINIGUI_VERSION=$MINIGUI_MAJOR_VERSION.$MINIGUI_MINOR_VERSION.$MINIGUI_MICRO_VERSION
|
||||||
|
|
||||||
AC_SUBST(MINIGUI_MAJOR_VERSION)
|
AC_SUBST(MINIGUI_MAJOR_VERSION)
|
||||||
@@ -40,27 +41,24 @@ AC_SUBST(LT_CURRENT)
|
|||||||
AC_SUBST(LT_REVISION)
|
AC_SUBST(LT_REVISION)
|
||||||
AC_SUBST(LT_AGE)
|
AC_SUBST(LT_AGE)
|
||||||
|
|
||||||
AC_CANONICAL_SYSTEM
|
AC_CANONICAL_TARGET
|
||||||
|
|
||||||
dnl ========================================================================
|
dnl ========================================================================
|
||||||
dnl Init automake
|
dnl Init automake
|
||||||
AM_INIT_AUTOMAKE
|
AM_INIT_AUTOMAKE
|
||||||
|
|
||||||
AC_CONFIG_HEADER(mgconfig.h)
|
AC_CONFIG_HEADERS([mgconfig.h])
|
||||||
|
|
||||||
dnl ========================================================================
|
dnl ========================================================================
|
||||||
dnl Check for tools
|
dnl Check for tools
|
||||||
AC_PROG_LIBTOOL
|
|
||||||
AC_PROG_CC
|
AC_PROG_CC
|
||||||
AC_PROG_LD
|
|
||||||
AC_PROG_RANLIB
|
|
||||||
AC_PROG_INSTALL
|
AC_PROG_INSTALL
|
||||||
AC_PROG_LN_S
|
AC_PROG_LN_S
|
||||||
AC_PROG_MAKE_SET
|
AC_PROG_MAKE_SET
|
||||||
|
LT_INIT
|
||||||
|
|
||||||
dnl ========================================================================
|
dnl ========================================================================
|
||||||
dnl Checks for header files.
|
dnl Checks for header files.
|
||||||
AC_HEADER_STDC
|
|
||||||
AC_HEADER_DIRENT
|
AC_HEADER_DIRENT
|
||||||
AC_CHECK_HEADERS(limits.h math.h stdatomic.h locale.h unistd.h termio.h sys/types.h sys/time.h sys/select.h sys/memfd.h)
|
AC_CHECK_HEADERS(limits.h math.h stdatomic.h locale.h unistd.h termio.h sys/types.h sys/time.h sys/select.h sys/memfd.h)
|
||||||
|
|
||||||
@@ -68,7 +66,6 @@ dnl Checks for typedefs, structures, and compiler characteristics.
|
|||||||
AC_C_CONST
|
AC_C_CONST
|
||||||
AC_C_INLINE
|
AC_C_INLINE
|
||||||
AC_TYPE_SIZE_T
|
AC_TYPE_SIZE_T
|
||||||
AC_HEADER_TIME
|
|
||||||
AC_STRUCT_TM
|
AC_STRUCT_TM
|
||||||
|
|
||||||
dnl Checks for library functions.
|
dnl Checks for library functions.
|
||||||
@@ -884,14 +881,14 @@ CheckFBCON()
|
|||||||
if test "x$enable_video_fbcon" = "xyes"; then
|
if test "x$enable_video_fbcon" = "xyes"; then
|
||||||
AC_MSG_CHECKING(for FrameBuffer console support)
|
AC_MSG_CHECKING(for FrameBuffer console support)
|
||||||
video_fbcon=no
|
video_fbcon=no
|
||||||
AC_TRY_COMPILE([
|
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
|
||||||
#include <linux/fb.h>
|
#include <linux/fb.h>
|
||||||
#include <linux/kd.h>
|
#include <linux/kd.h>
|
||||||
#include <linux/keyboard.h>
|
#include <linux/keyboard.h>
|
||||||
],[
|
]], [[
|
||||||
],[
|
]])],[
|
||||||
video_fbcon=yes
|
video_fbcon=yes
|
||||||
])
|
],[])
|
||||||
AC_MSG_RESULT($video_fbcon)
|
AC_MSG_RESULT($video_fbcon)
|
||||||
if test "x$video_fbcon" = "xyes"; then
|
if test "x$video_fbcon" = "xyes"; then
|
||||||
AC_DEFINE(_MGGAL_FBCON, 1,
|
AC_DEFINE(_MGGAL_FBCON, 1,
|
||||||
@@ -899,9 +896,13 @@ CheckFBCON()
|
|||||||
VIDEO_SUBDIRS="$VIDEO_SUBDIRS fbcon"
|
VIDEO_SUBDIRS="$VIDEO_SUBDIRS fbcon"
|
||||||
VIDEO_DRIVERS="$VIDEO_DRIVERS fbcon/libvideo_fbcon.la"
|
VIDEO_DRIVERS="$VIDEO_DRIVERS fbcon/libvideo_fbcon.la"
|
||||||
|
|
||||||
have_pciaccess="yes"
|
if test "x$target_cpu" = "xi386"; then
|
||||||
AC_CHECK_LIB(pciaccess, pci_system_init,
|
have_pciaccess="yes"
|
||||||
DEP_LIBS="$DEP_LIBS -lpciaccess", have_pciaccess="no")
|
AC_CHECK_LIB(pciaccess, pci_system_init,
|
||||||
|
DEP_LIBS="$DEP_LIBS -lpciaccess", have_pciaccess="no")
|
||||||
|
else
|
||||||
|
have_pciaccess="no"
|
||||||
|
fi
|
||||||
|
|
||||||
if test "x$have_pciaccess" = "xyes"; then
|
if test "x$have_pciaccess" = "xyes"; then
|
||||||
AC_DEFINE(_MGHAVE_PCIACCESS, 1,
|
AC_DEFINE(_MGHAVE_PCIACCESS, 1,
|
||||||
@@ -1170,12 +1171,12 @@ CheckDirectFBVideo()
|
|||||||
if test "x$enable_video_dfb" = "xyes"; then
|
if test "x$enable_video_dfb" = "xyes"; then
|
||||||
AC_MSG_CHECKING(for DirectFB support)
|
AC_MSG_CHECKING(for DirectFB support)
|
||||||
video_dfb=no
|
video_dfb=no
|
||||||
AC_TRY_COMPILE([
|
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
|
||||||
#include <directfb.h>
|
#include <directfb.h>
|
||||||
],[
|
]], [[
|
||||||
],[
|
]])],[
|
||||||
video_dfb=yes
|
video_dfb=yes
|
||||||
])
|
],[])
|
||||||
AC_MSG_RESULT($video_dfb)
|
AC_MSG_RESULT($video_dfb)
|
||||||
if test "x$video_dfb" = "xyes"; then
|
if test "x$video_dfb" = "xyes"; then
|
||||||
AC_DEFINE(_MGGAL_DFB, 1,
|
AC_DEFINE(_MGGAL_DFB, 1,
|
||||||
@@ -2641,7 +2642,7 @@ if test "x$devel_mode" = "xyes"; then
|
|||||||
CPPFLAGS="$CPPFLAGS -D_DEBUG"
|
CPPFLAGS="$CPPFLAGS -D_DEBUG"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if test "$ac_cv_prog_gcc" = "yes"; then
|
if test "$ac_cv_c_compiler_gnu" = "yes"; then
|
||||||
CFLAGS="$CFLAGS -Wall -Werror"
|
CFLAGS="$CFLAGS -Wall -Werror"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -2651,7 +2652,7 @@ else
|
|||||||
CPPFLAGS="$CPPFLAGS -DNDEBUG"
|
CPPFLAGS="$CPPFLAGS -DNDEBUG"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if test "$ac_cv_prog_gcc" = "yes"; then
|
if test "$ac_cv_c_compiler_gnu" = "yes"; then
|
||||||
CFLAGS="$CFLAGS -fmax-errors=10 -Wstrict-prototypes -pipe"
|
CFLAGS="$CFLAGS -fmax-errors=10 -Wstrict-prototypes -pipe"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -2688,8 +2689,7 @@ AM_CONDITIONAL(MGLIB_MVFB, test "x$with_libsuffix" = "xmvfb")
|
|||||||
AM_CONDITIONAL(MG_ENABLE_SPLASH, test "x$build_splash" = "xyes")
|
AM_CONDITIONAL(MG_ENABLE_SPLASH, test "x$build_splash" = "xyes")
|
||||||
AM_CONDITIONAL(MG_ENABLE_SCREENSAVER, test "x$build_screensaver" = "xyes")
|
AM_CONDITIONAL(MG_ENABLE_SCREENSAVER, test "x$build_screensaver" = "xyes")
|
||||||
|
|
||||||
AC_OUTPUT(
|
AC_CONFIG_FILES([minigui.pc
|
||||||
minigui.pc
|
|
||||||
Makefile
|
Makefile
|
||||||
cmake/Makefile
|
cmake/Makefile
|
||||||
src/Makefile
|
src/Makefile
|
||||||
@@ -2756,7 +2756,8 @@ etc/Makefile
|
|||||||
3rd-party/scripteasy/Makefile
|
3rd-party/scripteasy/Makefile
|
||||||
m4/Makefile
|
m4/Makefile
|
||||||
build/Makefile
|
build/Makefile
|
||||||
)
|
])
|
||||||
|
AC_OUTPUT
|
||||||
|
|
||||||
CCVERSION=`$CC --version | head -n 1`
|
CCVERSION=`$CC --version | head -n 1`
|
||||||
|
|
||||||
@@ -2765,6 +2766,7 @@ AC_MSG_NOTICE([
|
|||||||
# Main building configuration:
|
# Main building configuration:
|
||||||
|
|
||||||
## Global Features:
|
## Global Features:
|
||||||
|
* Architecture: ${target_cpu}
|
||||||
* Operating system: ${osname}
|
* Operating system: ${osname}
|
||||||
* Runtime mode: ${runtime_mode}
|
* Runtime mode: ${runtime_mode}
|
||||||
* Virtual Window: ${virtual_window}
|
* Virtual Window: ${virtual_window}
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
# This file does not do anything, except making sure these files are included
|
# This file does not do anything, except making sure these files are included
|
||||||
# when you run 'make dist'.
|
# when you run 'make dist'.
|
||||||
|
|
||||||
EXTRA_DIST = libtool.m4
|
EXTRA_DIST =
|
||||||
|
|||||||
Vendored
-3724
File diff suppressed because it is too large
Load Diff
@@ -55,6 +55,7 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
#include <time.h>
|
||||||
|
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
|
|
||||||
@@ -141,12 +142,31 @@ BOOL mg_InitDesktop (void)
|
|||||||
|
|
||||||
#include "debug.h"
|
#include "debug.h"
|
||||||
|
|
||||||
static IDLEHANDLER std_idle_handler;
|
/* According to a bug report, we use sem_timedwait() instead of
|
||||||
|
calling std_idle_handler for desktop thread.
|
||||||
|
Otherwise, the desktop might not handle the request from other GUI threads
|
||||||
|
as soon as possible. */
|
||||||
static BOOL idle_handler_for_desktop_thread (MSGQUEUE *msg_queue, BOOL wait)
|
static BOOL idle_handler_for_desktop_thread (MSGQUEUE *msg_queue, BOOL wait)
|
||||||
{
|
{
|
||||||
|
int retv, n = 0;
|
||||||
|
|
||||||
__mg_update_tick_count (msg_queue);
|
__mg_update_tick_count (msg_queue);
|
||||||
return std_idle_handler (msg_queue, wait);
|
|
||||||
|
if (wait) {
|
||||||
|
struct timespec ts;
|
||||||
|
if (clock_gettime (CLOCK_REALTIME, &ts) != -1) {
|
||||||
|
ts.tv_nsec += 10 * 1000 * 1000L; // 10ms
|
||||||
|
if (ts.tv_nsec >= 1000 * 1000 * 1000L) {
|
||||||
|
ts.tv_sec += 1;
|
||||||
|
ts.tv_nsec -= 1000 * 1000 * 1000L;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (sem_timedwait (&msg_queue->wait, &ts) == 0)
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return n > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void* __kernel_desktop_main (void* data)
|
void* __kernel_desktop_main (void* data)
|
||||||
@@ -162,7 +182,6 @@ void* __kernel_desktop_main (void* data)
|
|||||||
|
|
||||||
/* For bug reported in Issue #116, under threads mode, the idle handler
|
/* For bug reported in Issue #116, under threads mode, the idle handler
|
||||||
for the desktop thread should call __mg_update_tick_count () */
|
for the desktop thread should call __mg_update_tick_count () */
|
||||||
std_idle_handler = __mg_dsk_msg_queue->OnIdle;
|
|
||||||
__mg_dsk_msg_queue->OnIdle = idle_handler_for_desktop_thread;
|
__mg_dsk_msg_queue->OnIdle = idle_handler_for_desktop_thread;
|
||||||
|
|
||||||
/* init desktop window */
|
/* init desktop window */
|
||||||
|
|||||||
+7
-7
@@ -562,6 +562,13 @@ int GUIAPI InitGUI (int args, const char *agr[])
|
|||||||
|
|
||||||
_is_minigui_running = 1;
|
_is_minigui_running = 1;
|
||||||
|
|
||||||
|
/* init timer for tick counter */
|
||||||
|
step++;
|
||||||
|
if (!mg_InitTimer()) {
|
||||||
|
_ERR_PRINTF ("KERNEL>InitGUI: failed to start time counter\n");
|
||||||
|
goto failure;
|
||||||
|
}
|
||||||
|
|
||||||
step++;
|
step++;
|
||||||
if (!SystemThreads()) {
|
if (!SystemThreads()) {
|
||||||
_ERR_PRINTF ("KERNEL>InitGUI: failed to init system threads!\n");
|
_ERR_PRINTF ("KERNEL>InitGUI: failed to init system threads!\n");
|
||||||
@@ -575,13 +582,6 @@ int GUIAPI InitGUI (int args, const char *agr[])
|
|||||||
goto failure;
|
goto failure;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* init timer for tick counter */
|
|
||||||
step++;
|
|
||||||
if (!mg_InitTimer()) {
|
|
||||||
_ERR_PRINTF ("KERNEL>InitGUI: failed to start time counter\n");
|
|
||||||
goto failure;
|
|
||||||
}
|
|
||||||
|
|
||||||
SetKeyboardLayout ("default");
|
SetKeyboardLayout ("default");
|
||||||
|
|
||||||
SetCursor (GetSystemCursor (IDC_ARROW));
|
SetCursor (GetSystemCursor (IDC_ARROW));
|
||||||
|
|||||||
+5
-5
@@ -100,14 +100,14 @@ DWORD __mg_update_tick_count (MSGQUEUE* msg_queue)
|
|||||||
/* Since 5.0.0, the desktop only handles caret blinking in MSG_TIMEOUT
|
/* Since 5.0.0, the desktop only handles caret blinking in MSG_TIMEOUT
|
||||||
message, and the interval for the timer of desktop changes to 0.05s.
|
message, and the interval for the timer of desktop changes to 0.05s.
|
||||||
*/
|
*/
|
||||||
if (msg_queue == __mg_dsk_msg_queue) {
|
if (msg_queue == __mg_dsk_msg_queue &&
|
||||||
if (ticks > __mg_dsk_msg_queue->last_ticks +
|
ticks > __mg_dsk_msg_queue->old_tick_count +
|
||||||
DESKTOP_TIMER_INERTVAL) {
|
DESKTOP_TIMER_INERTVAL) {
|
||||||
__mg_dsk_msg_queue->dwState |= QS_DESKTIMER;
|
__mg_dsk_msg_queue->dwState |= QS_DESKTIMER;
|
||||||
#ifdef _MGRM_THREADS /* only wake up desktop for threads mode */
|
#ifdef _MGRM_THREADS /* only wake up desktop for threads mode */
|
||||||
POST_MSGQ (__mg_dsk_msg_queue);
|
POST_MSGQ (__mg_dsk_msg_queue);
|
||||||
#endif
|
#endif
|
||||||
}
|
__mg_dsk_msg_queue->old_tick_count = ticks;
|
||||||
}
|
}
|
||||||
|
|
||||||
msg_queue->last_ticks = ticks;
|
msg_queue->last_ticks = ticks;
|
||||||
|
|||||||
@@ -495,28 +495,6 @@ DWORD __mg_os_get_time_ticks (void)
|
|||||||
return (current - startup_time_win32) / 10;
|
return (current - startup_time_win32) / 10;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0 /* deprecated code */
|
|
||||||
DWORD __mg_os_get_elapsed_ms (void)
|
|
||||||
{
|
|
||||||
static DWORD last;
|
|
||||||
DWORD current = timeGetTime();
|
|
||||||
DWORD elapsed;
|
|
||||||
|
|
||||||
if (current >= last) {
|
|
||||||
elapsed = current - last;
|
|
||||||
return elapsed;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
/* overflowed */
|
|
||||||
elapsed = BITMASK_DWORD - last;
|
|
||||||
elapsed += current;
|
|
||||||
}
|
|
||||||
|
|
||||||
last = current;
|
|
||||||
return elapsed;
|
|
||||||
}
|
|
||||||
#endif /* deprecated code */
|
|
||||||
|
|
||||||
#elif defined (HAVE_CLOCK_GETTIME)
|
#elif defined (HAVE_CLOCK_GETTIME)
|
||||||
|
|
||||||
static struct timespec timeval_startup;
|
static struct timespec timeval_startup;
|
||||||
@@ -573,68 +551,6 @@ DWORD __mg_os_get_time_ticks (void)
|
|||||||
return ds * 100 + dms;
|
return ds * 100 + dms;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0 /* deprecated code */
|
|
||||||
DWORD __mg_os_get_elapsed_ms (void)
|
|
||||||
{
|
|
||||||
static struct timespec last;
|
|
||||||
DWORD ds, dms;
|
|
||||||
struct timespec current;
|
|
||||||
|
|
||||||
clock_gettime (CLOCK_MONOTONIC, ¤t);
|
|
||||||
ds = (current.tv_sec - last.tv_sec);
|
|
||||||
|
|
||||||
if (current.tv_sec == last.tv_sec) {
|
|
||||||
dms = (current.tv_nsec - last.tv_nsec) / 1000000L;
|
|
||||||
}
|
|
||||||
else if (current.tv_nsec >= last.tv_nsec) {
|
|
||||||
dms = (current.tv_nsec - last.tv_nsec) / 1000000L;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
assert (ds > 0);
|
|
||||||
|
|
||||||
ds--;
|
|
||||||
dms = 1000L - (last.tv_nsec - current.tv_nsec) / 1000000L;
|
|
||||||
}
|
|
||||||
|
|
||||||
last = current;
|
|
||||||
return ds * 1000 + dms;
|
|
||||||
}
|
|
||||||
|
|
||||||
#include <unistd.h>
|
|
||||||
#include <poll.h>
|
|
||||||
#include <sys/time.h>
|
|
||||||
|
|
||||||
static struct timeval timeval_startup;
|
|
||||||
void __mg_os_start_time(void)
|
|
||||||
{
|
|
||||||
gettimeofday(&timeval_startup, NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
DWORD __mg_os_get_time_ms(void)
|
|
||||||
{
|
|
||||||
DWORD ds, dms;
|
|
||||||
struct timeval current;
|
|
||||||
|
|
||||||
gettimeofday(¤t, NULL);
|
|
||||||
ds = (current.tv_sec - timeval_startup.tv_sec);
|
|
||||||
|
|
||||||
if (current.tv_sec == timeval_startup.tv_sec) {
|
|
||||||
dms = (current.tv_usec - timeval_startup.tv_usec) / 1000L;
|
|
||||||
}
|
|
||||||
else if (current.tv_usec >= timeval_startup.tv_usec) {
|
|
||||||
dms = (current.tv_usec - timeval_startup.tv_usec) / 1000L;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
assert(ds > 0);
|
|
||||||
|
|
||||||
ds--;
|
|
||||||
dms = 1000L - (timeval_startup.tv_usec - current.tv_usec) / 1000L;
|
|
||||||
}
|
|
||||||
|
|
||||||
return ds * 1000 + dms;
|
|
||||||
}
|
|
||||||
#endif /* deprecated code */
|
|
||||||
|
|
||||||
#else /* defined HAVE_CLOCK_GETTIME */
|
#else /* defined HAVE_CLOCK_GETTIME */
|
||||||
|
|
||||||
#error "Please implement __mg_os_start_time and __mg_os_get_time_ticks for your OS"
|
#error "Please implement __mg_os_start_time and __mg_os_get_time_ticks for your OS"
|
||||||
|
|||||||
+274
-41
File diff suppressed because it is too large
Load Diff
@@ -89,6 +89,12 @@ typedef struct GAL_PrivateVideoData {
|
|||||||
uint32_t real_name, shadow_name;
|
uint32_t real_name, shadow_name;
|
||||||
#endif /* not defined _MGSCHEMA_COMPOSITING */
|
#endif /* not defined _MGSCHEMA_COMPOSITING */
|
||||||
|
|
||||||
|
/* flip buffer used for page flipping */
|
||||||
|
DrmSurfaceBuffer *flip_buff;
|
||||||
|
|
||||||
|
/* current buffer pointer for managing buffer switching */
|
||||||
|
DrmSurfaceBuffer *curr_buff;
|
||||||
|
|
||||||
sem_t *update_lock;
|
sem_t *update_lock;
|
||||||
|
|
||||||
#if !IS_SHAREDFB_SCHEMA_PROCS
|
#if !IS_SHAREDFB_SCHEMA_PROCS
|
||||||
|
|||||||
+81
-9
@@ -1092,6 +1092,67 @@ nodraw_ret:
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef _MGFONT_FT2
|
#ifdef _MGFONT_FT2
|
||||||
|
|
||||||
|
static RGB blend_pixel(RGB font_pixel, RGB fg_color, RGB bg_color)
|
||||||
|
{
|
||||||
|
RGB result;
|
||||||
|
|
||||||
|
Uint8 src_pre_r, src_pre_g, src_pre_b;
|
||||||
|
Uint8 bg_pre_r, bg_pre_g, bg_pre_b, alpha_bg;
|
||||||
|
Uint8 out_r, out_g, out_b, alpha_out;
|
||||||
|
|
||||||
|
uint8_t alpha_font = 0.299 * font_pixel.r + 0.587 * font_pixel.g +
|
||||||
|
0.114 * font_pixel.b;
|
||||||
|
|
||||||
|
uint16_t alpha_src = (fg_color.a * alpha_font + 127) / 255;
|
||||||
|
|
||||||
|
if (alpha_src == 0) {
|
||||||
|
result = bg_color;
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
|
src_pre_r = (fg_color.r * alpha_src + 127) / 255;
|
||||||
|
src_pre_g = (fg_color.g * alpha_src + 127) / 255;
|
||||||
|
src_pre_b = (fg_color.b * alpha_src + 127) / 255;
|
||||||
|
|
||||||
|
bg_pre_r = (bg_color.r * bg_color.a + 127) / 255;
|
||||||
|
bg_pre_g = (bg_color.g * bg_color.a + 127) / 255;
|
||||||
|
bg_pre_b = (bg_color.b * bg_color.a + 127) / 255;
|
||||||
|
alpha_bg = bg_color.a;
|
||||||
|
|
||||||
|
out_r = src_pre_r + (bg_pre_r * (255 - alpha_src)) / 255;
|
||||||
|
out_g = src_pre_g + (bg_pre_g * (255 - alpha_src)) / 255;
|
||||||
|
out_b = src_pre_b + (bg_pre_b * (255 - alpha_src)) / 255;
|
||||||
|
alpha_out = alpha_src + (alpha_bg * (255 - alpha_src)) / 255;
|
||||||
|
|
||||||
|
if (out_r > 255) {
|
||||||
|
out_r = 255;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (out_g > 255) {
|
||||||
|
out_g = 255;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (out_b > 255) {
|
||||||
|
out_b = 255;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (alpha_out > 0) {
|
||||||
|
result.r = (out_r * 255 + alpha_out / 2) / alpha_out;
|
||||||
|
result.g = (out_g * 255 + alpha_out / 2) / alpha_out;
|
||||||
|
result.b = (out_b * 255 + alpha_out / 2) / alpha_out;
|
||||||
|
result.a = (uint8_t) alpha_out;
|
||||||
|
} else {
|
||||||
|
result.r = 0;
|
||||||
|
result.g = 0;
|
||||||
|
result.b = 0;
|
||||||
|
result.a = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
out:
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
static void _dc_ft2subpixel_scan_line(PDC pdc, int xpos, int ypos,
|
static void _dc_ft2subpixel_scan_line(PDC pdc, int xpos, int ypos,
|
||||||
SCANLINE_CTXT* ctxt)
|
SCANLINE_CTXT* ctxt)
|
||||||
{
|
{
|
||||||
@@ -1112,8 +1173,8 @@ static void _dc_ft2subpixel_scan_line(PDC pdc, int xpos, int ypos,
|
|||||||
ctxt->glyph_ascent, ctxt->glyph_line,
|
ctxt->glyph_ascent, ctxt->glyph_line,
|
||||||
ctxt->glyph_advance);
|
ctxt->glyph_advance);
|
||||||
|
|
||||||
GAL_GetRGB (pdc->textcolor, pdc->surface->format, &rgba_fg.r,
|
GAL_GetRGBA (pdc->textcolor, pdc->surface->format, &rgba_fg.r,
|
||||||
&rgba_fg.g, &rgba_fg.b);
|
&rgba_fg.g, &rgba_fg.b, &rgba_fg.a);
|
||||||
|
|
||||||
for (x = 0; x < ctxt->bmp_w; x++) {
|
for (x = 0; x < ctxt->bmp_w; x++) {
|
||||||
if (!PtInRect (&pdc->rc_output, x+xpos, ypos)) {
|
if (!PtInRect (&pdc->rc_output, x+xpos, ypos)) {
|
||||||
@@ -1130,8 +1191,8 @@ static void _dc_ft2subpixel_scan_line(PDC pdc, int xpos, int ypos,
|
|||||||
_glyph_move_to_pixel (pdc, x+xpos, ypos);
|
_glyph_move_to_pixel (pdc, x+xpos, ypos);
|
||||||
pixel = _mem_get_pixel(pdc->cur_dst, GAL_BytesPerPixel (pdc->surface));
|
pixel = _mem_get_pixel(pdc->cur_dst, GAL_BytesPerPixel (pdc->surface));
|
||||||
|
|
||||||
GAL_GetRGB (pixel, pdc->surface->format, &rgba_cur.r,
|
GAL_GetRGBA (pixel, pdc->surface->format, &rgba_cur.r,
|
||||||
&rgba_cur.g, &rgba_cur.b);
|
&rgba_cur.g, &rgba_cur.b, &rgba_cur.a);
|
||||||
|
|
||||||
#define C_ALPHA(p, Cs, Cd) \
|
#define C_ALPHA(p, Cs, Cd) \
|
||||||
if (*p++) { \
|
if (*p++) { \
|
||||||
@@ -1140,14 +1201,25 @@ static void _dc_ft2subpixel_scan_line(PDC pdc, int xpos, int ypos,
|
|||||||
Cd = sub_val >> 8; \
|
Cd = sub_val >> 8; \
|
||||||
}
|
}
|
||||||
|
|
||||||
C_ALPHA(bits, rgba_fg.r, rgba_cur.r);
|
if (rgba_cur.r == 0 && rgba_cur.g == 0 && rgba_cur.b == 0 &&
|
||||||
C_ALPHA(bits, rgba_fg.g, rgba_cur.g);
|
rgba_cur.a == 0) {
|
||||||
C_ALPHA(bits, rgba_fg.b, rgba_cur.b);
|
RGB font_pixel = {bits[0], bits[1], bits[2], 255};
|
||||||
|
RGB ret = blend_pixel(font_pixel, rgba_fg, rgba_cur);
|
||||||
|
rgba_cur = ret;
|
||||||
|
bits += 3;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
C_ALPHA(bits, rgba_fg.r, rgba_cur.r);
|
||||||
|
C_ALPHA(bits, rgba_fg.g, rgba_cur.g);
|
||||||
|
C_ALPHA(bits, rgba_fg.b, rgba_cur.b);
|
||||||
|
rgba_cur.a = 255.0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#undef C_ALPHA
|
#undef C_ALPHA
|
||||||
|
|
||||||
pdc->cur_pixel = GAL_MapRGB (pdc->surface->format, rgba_cur.r,
|
pdc->cur_pixel = GAL_MapRGBA (pdc->surface->format, rgba_cur.r,
|
||||||
rgba_cur.g, rgba_cur.b);
|
rgba_cur.g, rgba_cur.b, rgba_cur.a);
|
||||||
|
|
||||||
if (pdc->cur_pixel != pixel) {
|
if (pdc->cur_pixel != pixel) {
|
||||||
_glyph_draw_pixel (pdc, x+xpos, ypos, pdc->cur_pixel);
|
_glyph_draw_pixel (pdc, x+xpos, ypos, pdc->cur_pixel);
|
||||||
|
|||||||
Reference in New Issue
Block a user