Compare commits

...
153 Commits
Author SHA1 Message Date
Vincent Wei 358c940763 use hb_buffer_set_unicode_funcs 2020-07-23 16:55:01 +08:00
Vincent Wei b3d6c70a45 fix bad default harfbuzz include directory 2020-07-21 20:54:06 +08:00
Vincent Wei 5fc1c1101e fix a bug: do not call function in assert() 2020-06-06 12:04:14 +08:00
Vincent Wei f336b8401b Release notes for version 5.0.2. 2020-06-04 10:15:58 +08:00
Vincent Wei 78a0a8addf move code for initializing cfg_res_path to __sysres_get_system_res_path() 2020-06-04 09:15:15 +08:00
Vincent Wei be5f46f92d cleanup 2020-06-04 09:14:24 +08:00
Vincent Wei 07592ad802 cleanup 2020-06-04 09:13:52 +08:00
Vincent Wei 1764c47131 depress compile warnings 2020-06-03 18:07:52 +08:00
Vincent Wei f83c92d91b implement hb_ext_unicode_funcs 2020-06-03 18:07:26 +08:00
Vincent Wei bf85472935 ignore files created by automake 2020-06-03 18:06:29 +08:00
Vincent Wei ff6856ec1f change version to 5.0.2; use harfbuzz instead of harfbuzzex; set use_shmopen to yes by default 2020-06-03 18:03:16 +08:00
Vincent Wei a4d532f85e fix a bug: always retrun TRUE in subtract_rgn_by_node; change version to 5.0.1 2020-05-12 09:17:39 +08:00
Vincent Wei 18f51a113d add missed map.h file 2020-04-10 14:07:10 +08:00
Vincent Wei 12313a2646 change version of minigui-res to 5.0.0 2020-03-29 17:24:26 +08:00
Vincent Wei 3ce8e5e8af set default exdriver for DRM engine: libhidrmdrivers-0.2.so.0 2020-03-27 16:20:31 +08:00
Vincent Wei a8b54bc301 cleanup 2020-03-26 19:21:52 +08:00
Vincent Wei 7f711b383a cleanup 2020-03-26 19:09:39 +08:00
Vincent Wei bbda500121 cleanup 2020-03-26 18:10:51 +08:00
Vincent Wei deb248c96e Merge branch 'rel-5-0' of gitlab.fmsoft.cn:VincentWei/minigui into rel-5-0 2020-03-26 18:10:12 +08:00
Vincent Wei c8e9b72663 a workaround for client windows are not completely updated because of moving a window 2020-03-26 18:10:05 +08:00
Vincent Wei 0ff551a2da call SyncUpdateDC after calling FocusRect on HDC_SCREEN_SYS 2020-03-26 18:08:41 +08:00
Vincent Wei aef1e366f4 cleanup 2020-03-26 10:32:59 +08:00
Vincent Wei 41d8a80c8e bugfixing: merge global dirty rectagnle before synchronizing update 2020-03-26 10:32:33 +08:00
Vincent Wei cbd2cea0e9 remove _DEBUG 2020-03-25 20:07:09 +08:00
Vincent Wei 0c5f5115e6 fix a memory leak: free the default video surface in GAL_SetVideoModeInfo 2020-03-25 20:03:32 +08:00
Vincent Wei 86da42231c only treat ppp and wpp for topmost layer 2020-03-25 17:54:04 +08:00
Vincent Wei 20974f305a use dirty type to optimize the compositor 2020-03-25 17:31:19 +08:00
Vincent Wei 5a22e67680 bugfixing: bad implementation of generate_dirty_region; generate_dirty_region -> merge_dirty_region 2020-03-25 17:28:31 +08:00
Vincent Wei bae24f0964 tune words 2020-03-25 15:36:40 +08:00
Vincent Wei 2871657b65 fix some typos 2020-03-25 15:24:48 +08:00
Vincent Wei 767a8b088e tune URLs to release notes 2020-03-25 10:56:22 +08:00
Vincent Wei 2f77a0a8c8 Tune words 2020-03-24 22:05:07 +08:00
Vincent Wei 2900f37c23 merge from dev-4-1 for 5.0.0 2020-03-24 20:25:27 +08:00
Vincent Wei a693fa7dc2 optimize __mg_composite_dirty_znodes 2020-03-24 13:00:10 +08:00
Vincent Wei f7cb85401c add version to __ex_compositor_get; tune operations of CompositorOps to optimize it 2020-03-24 12:59:37 +08:00
Vincent Wei 433d5d6cc5 try to optimze cursor refresh (not finished) 2020-03-23 22:08:47 +08:00
Vincent Wei 98b66f158f comment out asynchronous update code 2020-03-23 19:00:14 +08:00
Vincent Wei 4fc71946ca support for asynchronous update 2020-03-23 18:45:13 +08:00
Vincent Wei 59c609dc2d fix a conditional compilation error 2020-03-23 18:22:45 +08:00
Vincent Wei ce6525d8f2 calling MainWindowCleanup for AboutDialogBox 2020-03-22 22:53:25 +08:00
Vincent Wei bbd1776911 only increase refcount for surface create for window and menu created by the server 2020-03-22 22:52:57 +08:00
Vincent Wei f196a67afe call EmptyClipRgn for temp region ergn 2020-03-22 22:52:01 +08:00
Vincent Wei 5f895b2ad9 increase refcount of surface for all memory DC 2020-03-22 20:01:36 +08:00
Vincent Wei e5c31ee766 free real screen surface when double buffering enabled 2020-03-22 20:00:44 +08:00
Vincent Wei 9f244a1093 call drmModeDirtyFB in SyncUpdate 2020-03-22 20:00:24 +08:00
Vincent Wei 43c387d0a0 debug for use refcount for all memory dc 2020-03-22 19:59:23 +08:00
Vincent Wei f662f45e86 no need to free surface explicitly 2020-03-22 19:48:51 +08:00
Vincent Wei 602f3c5748 remove debug printf 2020-03-22 18:24:47 +08:00
Vincent Wei 74f727cb2e fix a bug: must reset olddownkey to zero when got a KEYUP event 2020-03-22 18:05:32 +08:00
Vincent Wei dccc997e75 tune 2020-03-22 17:43:50 +08:00
Vincent Wei 41858de966 fix a bug: pass correct select timeout value 2020-03-22 17:37:43 +08:00
Vincent Wei 86b4d9c9ab fix a bug: always pass cli=0 for dskCalculateDefaultPosition 2020-03-22 17:36:18 +08:00
Vincent Wei 4144065fb8 tune comments 2020-03-22 17:35:54 +08:00
Vincent Wei 7932f5f687 tune 2020-03-21 21:49:05 +08:00
Vincent Wei 0a54e292e9 tune 2020-03-21 21:47:03 +08:00
Vincent Wei d3770381b8 add support for alpha_pixel_blt 2020-03-21 19:16:07 +08:00
Vincent Wei a5f13a023c tune ColorLogicalOp with the values from old DrmColorLogicOp 2020-03-21 19:15:37 +08:00
Vincent Wei 039121892b remove DrmColorLogicOp, use ColorLogicalOp instead; add alpha_pixel_blt operation 2020-03-21 19:15:01 +08:00
Vincent Wei 150f670d2e debug for hardware cursor by using plane 2020-03-21 18:49:20 +08:00
Vincent Wei 7fbd3ef4f3 tune code for authenticate client; remove use of drm_magic 2020-03-21 17:52:21 +08:00
Vincent Wei c03386f438 remove auth_magic 2020-03-21 17:48:57 +08:00
Vincent Wei 058db9ccdf handler authenticate_client for REQID_AUTHCLIENT 2020-03-21 17:48:40 +08:00
Vincent Wei a8c623b0dd remove drm_magic 2020-03-21 17:47:59 +08:00
Vincent Wei 50b7ee5fc2 add REQID_AUTHCLIENT 2020-03-21 17:47:43 +08:00
Vincent Wei 9a95f9b706 increase MAX_SYS_REQID for REQID_AUTHCLIENT 2020-03-21 17:47:08 +08:00
Vincent Wei 4da4e0b1ac tune 2020-03-21 15:41:21 +08:00
Vincent Wei 151400eac0 disable alpha for CT_COLORKEY 2020-03-21 15:39:49 +08:00
Vincent Wei f8bd1a67bc fix a conditional compilation error 2020-03-20 19:54:53 +08:00
Vincent Wei 3f65456f3f do not use dumb surface for shadow screen, use GAL_CreateRGBSurfaceInShm instead 2020-03-20 19:12:55 +08:00
Vincent Wei 8c102fcafd remove use of offset fields in GAL_Surface; initialize pixels_off to 0 2020-03-20 19:12:15 +08:00
Vincent Wei e8150805ff add surface-shm.c 2020-03-20 19:11:18 +08:00
Vincent Wei 88391c47d2 implement GAL_CreateRGBSurfaceInShm 2020-03-20 19:11:00 +08:00
Vincent Wei 8d8f51f660 remove offset field add pixels_off field in GAL_Surface; declare GAL_CreateRGBSurfaceInShm 2020-03-20 19:10:23 +08:00
Vincent Wei d2d10421b6 tune map_buffer 2020-03-19 22:29:10 +08:00
Vincent Wei 0e0c95e0a9 tune map_buffer: add scanout argument 2020-03-19 22:28:55 +08:00
Vincent Wei 61e22faeb9 pixels_size -> map_size 2020-03-19 21:45:08 +08:00
Vincent Wei d81d40f9b7 pixels_size -> map_size 2020-03-19 21:42:33 +08:00
Vincent Wei 66de31895a restore old DrmColorLogicOp 2020-03-19 21:41:38 +08:00
Vincent Wei bfec1da2a6 remove some unused code 2020-03-19 15:28:07 +08:00
Vincent Wei c76adc0602 test code: use memcpy directly for blitting from shadow screen to real screen 2020-03-19 12:09:45 +08:00
Vincent Wei 306dd9602a test code of sendfile 2020-03-18 22:40:01 +08:00
Vincent Wei 85c63e90fa use plane for hardware cursor 2020-03-18 18:06:01 +08:00
Vincent Wei cf537dd421 tune implementation accoring to the changes of DrmDriverOps and DrmSurfaceBuffer 2020-03-18 18:00:51 +08:00
Vincent Wei 334a77adaf tune DrmSurfaceInfo struct 2020-03-18 17:59:30 +08:00
Vincent Wei 6ce6de157b tune DrmSurfaceBuffer struct and DrmDriverOps 2020-03-18 17:58:58 +08:00
Vincent Wei 9eb0a8b40c cleanup debug info 2020-03-17 19:41:46 +08:00
Vincent Wei f1d670502c use plane for hardware cursor (not finished) 2020-03-17 17:32:39 +08:00
Vincent Wei 3269650084 use plane for hardware cursor (not finished) 2020-03-17 17:32:34 +08:00
Vincent Wei 53edb5dcba tune warning info 2020-03-17 17:31:46 +08:00
Vincent Wei 1f46ba258e change version to 4.9.2 2020-03-16 23:16:22 +08:00
Vincent Wei 959407d7ea do not use fd for get_shared_surface for sharedfb schema under PROC runmode 2020-03-16 23:01:28 +08:00
Vincent Wei 3eacf471ac tune 2020-03-16 23:00:35 +08:00
Vincent Wei a2b65ba39f add auth_magic 2020-03-16 23:00:09 +08:00
Vincent Wei 444d9bb1f7 call drmSetMaster and drmAuthMagic for sharedfb schema under PROCS runmode 2020-03-16 22:59:39 +08:00
Vincent Wei b54c186688 add auth magic for DRM engine in shared resource segment 2020-03-16 22:58:58 +08:00
Vincent Wei 19372b2fbb no need to use semaphore to lock the dirty rectangle 2020-03-16 22:58:24 +08:00
Vincent Wei 77c76c53ae tune 2020-03-16 22:57:51 +08:00
Vincent Wei 50ddc8e31c tune 2020-03-16 20:48:30 +08:00
Vincent Wei e67849db69 only mmap software shared surface 2020-03-16 20:45:41 +08:00
Vincent Wei 96a085170b tune error info 2020-03-16 20:44:57 +08:00
Vincent Wei ff6f42e291 debug 2020-03-16 20:44:34 +08:00
Vincent Wei f8ced41de6 add CopyVideoInfoToSharedRes method in GAL engine for PROCS and calling this method to copy the video info to shared resource segment when the process is the server 2020-03-16 17:38:50 +08:00
Vincent Wei 072ac4e166 send XVFB_CMD_QUIT command to pcxvfb process when terminating the IAL engine 2020-03-16 17:34:13 +08:00
Vincent Wei 43b8b8de59 add XVFBCmdEventData to send a command to pcxvfb process 2020-03-16 17:33:44 +08:00
Vincent Wei 5fa10b3d7f check name for shared surface 2020-03-16 14:49:16 +08:00
Vincent Wei fdac75dce0 call munmap only for software shared surface 2020-03-16 14:48:40 +08:00
Vincent Wei 44b8552307 call mg_DestroyFreeQMSGList after terminating desktop 2020-03-16 14:47:42 +08:00
Vincent Wei 6ad5529ee7 tune nr_lines_for_header 2020-03-15 22:17:14 +08:00
Vincent Wei 6b47d74be7 fix compilation errors/warnings 2020-03-15 22:11:16 +08:00
Vincent Wei 32f29cc159 implement UpdateRects and SyncUpdate 2020-03-15 21:28:08 +08:00
Vincent Wei 0d4b076fd5 tune fields of DrmVideoData 2020-03-15 21:27:41 +08:00
Vincent Wei cddfc2ed84 pass offset to __drm_create_surface_from_handle and __drm_create_surface_from_prime_fd 2020-03-15 21:27:14 +08:00
Vincent Wei 41b37abc13 define GAL_SharedSurfaceHeader structure for shadow surface bufffer 2020-03-15 19:17:33 +08:00
Vincent Wei d3e1837244 create dumb buffer from handle, name, and prime fd 2020-03-15 13:03:44 +08:00
Vincent Wei 1bc10fb83e use name when request the shared surface 2020-03-15 11:56:12 +08:00
Vincent Wei 7188627084 use name when request the shared surface 2020-03-15 11:55:43 +08:00
Vincent Wei 615d1e72d3 add real_name and shadow_name for double buffering 2020-03-15 11:55:09 +08:00
Vincent Wei cb8fb1a0c1 get info screen surfaces and create real_screen and shadow_screen for clients 2020-03-15 11:54:33 +08:00
Vincent Wei ed728100c3 more fields in SHAREDSURFINFO for convenience 2020-03-15 11:52:37 +08:00
Vincent Wei 56e24ff4ef check double buffering 2020-03-15 10:51:56 +08:00
Vincent Wei ba3a0030fc Do not init the fields in the shared resource segment for DRM engine; left them for DRM engine 2020-03-15 10:50:59 +08:00
Vincent Wei 2094cda9e5 tune fields in the shared resource segment for DRM engine 2020-03-15 10:50:15 +08:00
Vincent Wei aad307d676 define LEN_EXDRIVER_NAME is same as LEN_SO_NAME 2020-03-15 10:49:32 +08:00
Vincent Wei 3fa8169353 define backward compatible APIs for drmCreateDCFromXXX 2020-03-15 10:49:04 +08:00
Vincent Wei 5cf3418c15 more comments 2020-03-15 10:48:03 +08:00
Vincent Wei 3611804ecc change name of field map_size to size 2020-03-14 22:35:07 +08:00
Vincent Wei c121c87b75 add argument offset to drmCreateDCFromXXX functions 2020-03-14 22:34:29 +08:00
Vincent Wei 47f577b672 change field name 2020-03-14 22:34:03 +08:00
Vincent Wei 7ca92b6350 add some fields in GAL_PrivateVideoData for compisiting schema and double buffering 2020-03-14 22:33:32 +08:00
Vincent Wei e4cc1d4c26 code for sharedfb schema 2020-03-14 22:32:39 +08:00
Vincent Wei 9a076cba39 tune the argument types 2020-03-14 22:31:50 +08:00
Vincent Wei 74178caf8c change field map_size to size in SHAREDSURFINFO 2020-03-14 22:31:27 +08:00
Vincent Wei 4fee49aa43 add argument offset to drmCreateDCFromXXX functions 2020-03-14 22:31:01 +08:00
Vincent Wei fa13587088 restore drm_format field just for convenience 2020-03-14 22:29:50 +08:00
Vincent Wei 2b715208c0 add double_buffering key to drm section 2020-03-14 22:28:47 +08:00
Vincent Wei 1bbd5ea4f1 IS_SHAREDFB_SCHEMA -> IS_SHAREDFB_SCHEMA_PROCS; reflects for the changes of fields name and internal functions 2020-03-14 19:03:57 +08:00
Vincent Wei 4ea138ef19 implement methods for compositing schema and PROCS runmode 2020-03-14 19:01:49 +08:00
Vincent Wei a39c1caa4a tune fields name; add GAL_SharedSurfaceHeader for sharedfb schema 2020-03-14 19:00:17 +08:00
Vincent Wei b1b4ce2a66 remove redundant fields in DrmSurfaceInfo 2020-03-14 18:58:36 +08:00
Vincent Wei 7c92a9334d remove redundant fields in DrmSurfaceBuffer; simplify interfaces of DrmDriverOps 2020-03-14 18:57:42 +08:00
Vincent Wei aaa4ad1cbc tune description words 2020-03-13 15:02:03 +08:00
Vincent Wei 7b93d0878d tune COMMLCD engine for nwe GAL engine: use SyncUpdte method and sem_update semaphore insteadll dumb delaying 50ms 2020-03-13 14:34:42 +08:00
Vincent Wei 1c29f6373e fix a conditional compilation error 2020-03-13 14:33:03 +08:00
Vincent Wei 57bdcd4754 use get_sem_key_for_layers 2020-01-22 17:03:42 +08:00
Vincent Wei b95538a415 use a small static buffer for zero size surface 2020-01-22 17:03:19 +08:00
Vincent Wei fa7c84b2b5 enhance to delete old IPC objects 2020-01-22 17:02:57 +08:00
Vincent Wei bc77048488 make lock_zi_for_xxx/unlock_zi_for_xxx static inline 2020-01-22 17:02:22 +08:00
Vincent Wei 2f21b22a49 make lock_zi_for_xxx/unlock_zi_for_xxx static inline 2020-01-22 17:02:12 +08:00
Vincent Wei ec91986854 add inline functions for get shm/sem key for system/layer 2020-01-22 17:01:42 +08:00
Vincent Wei e7b03037be notes for 4.0.5 2020-01-22 17:01:02 +08:00
Vincent Wei 9ff822c7fd change version to 4.0.5 2020-01-03 14:45:12 +08:00
Vincent Wei 239924c63e BUGFIXING: always initialize csr_bmp fields with explicit assignments 2020-01-03 14:38:28 +08:00
Vincent Wei 2f85645e9d change version to 4.0.4 2020-01-03 14:37:50 +08:00
64 changed files with 4303 additions and 1908 deletions
+2 -1
View File
@@ -4,6 +4,8 @@
*.al
*.a
*.so
\#
am--include-marker
Makefile
Makefile.in
.deps/
@@ -23,7 +25,6 @@ Makefile.in
/*config.h
/*config.h.in
/*config.h.in~
/src/font/utils/emoji/
/src/font/utils/ucd/
/src/sysres/font_list
+2 -2
View File
@@ -1,5 +1,5 @@
MAJOR_VERSION = 4
MINOR_VERSION = 1
MAJOR_VERSION = 5
MINOR_VERSION = 0
MICRO_VERSION = 0
EXTRAVERSION =
+150 -85
View File
@@ -6,19 +6,23 @@ A mature and proven cross-platform GUI system for embedded and smart IoT devices
## TABLE OF CONTENTS
- [INTRODUCTION](#introduction)
- [A BRIEF BUILDING INSTRUCTION](#a-brief-building-instruction)
+ [Prerequisites](#prerequisites)
+ [Building MiniGUI Core](#building-minigui-core)
+ [Building whole MiniGUI](#building-whole-minigui)
+ [Unit Tests](#unit-tests)
+ [What's MiniGUI](#whats-minigui)
+ [MiniGUI Components](#minigui-components)
+ [Open Source Apps Based-on MiniGUI](#open-source-apps-based-on-minigui)
+ [MiniGUI and HybridOS](#minigui-and-hybridos)
+ [Source Code Repositories](#source-code-repositories)
- [NEW FEATURES IN VERSION 5.0.x](#new-features-in-version-50x)
+ [Compositing schema](#compositing-schema)
+ [New main window types](#new-main-window-types)
+ [Virtual window](#virtual-window)
+ [Other enhancements](#other-enhancements)
+ [Compositing Schema](#compositing-schema)
+ [New Main Window Types](#new-main-window-types)
+ [Virtual Window](#virtual-window)
+ [Other Enhancements](#other-enhancements)
- [NEW FEATURES IN VERSION 4.0.x](#new-features-in-version-40x)
- [NEW FEATURES IN VERSION 3.2.x](#new-features-in-version-32x)
- [THE RUNTIME MODES OF MINIGUI](#the-runtime-modes-of-minigui)
- [A BRIEF BUILDING INSTRUCTION](#a-brief-building-instruction)
+ [Building Whole MiniGUI](#building-whole-minigui)
+ [Building MiniGUI Core](#building-minigui-core)
+ [Unit Tests](#unit-tests)
- [HISTORY](#history)
- [AUTHORS AND COPYING](#authors-and-copying)
+ [Special Statement](#special-statement)
@@ -28,6 +32,8 @@ A mature and proven cross-platform GUI system for embedded and smart IoT devices
## INTRODUCTION
### What's MiniGUI
MiniGUI is a mature cross-platform windowing system and a GUI (Graphics
User Interface) support system for embedded systems and smart IoT devices.
This is the version 5.0.x of MiniGUI maintained by WEI Yongming.
@@ -41,9 +47,11 @@ embedded systems or smart IoT devices based-on Linux/uClinux, eCos, and other
traditional RTOSes, such as RT-Thread, FreeRTOS, RTEMS, VxWorks, ThreadX,
Nucleus, pSOS, uC/OS-II, and OSE.
This is the source tree of MiniGUI Core, which provides windowing
This is the source tree of MiniGUI Core, which provides the windowing
and graphics interfaces as well as a lot of standard controls (toolkit).
### MiniGUI Components
Besides MiniGUI Core, FMSoft also provides some components
for the developers to develop app much easier:
@@ -82,22 +90,80 @@ from the download zone of the site:
<http://www.minigui.com>
### Open Source Apps Based-on MiniGUI
FMSoft also releases some open source apps for MiniGUI on the site above,
for examples:
* mDolphin, licensed under Apache 2.0, is a full-featured
* `mDolphin`, licensed under Apache 2.0, is a full-featured
WEB/WAP browser, which is developed based on the open source browser
core WebKit and uses MiniGUI as its underlying graphics support system.
* mGallery, licensed under Apache 2.0, intends to
* `mGallery`, licensed under Apache 2.0, intends to
provide a total solution for PMP (Portable Multimedia Player),
which uses MiniGUI as the graphics platform.
* mSpider, licensed under GPL 3.0, intends to provide a
* `mSpider`, licensed under GPL 3.0, intends to provide a
light-weight MiniGUI-based web browser (HTML 3.2 and part JavaScript)
* mEagle, licensed under GPL 3.0, is an embedded GIS development platform
* `mEagle`, licensed under GPL 3.0, is an embedded GIS development platform
which addresses the needs of map browse, query, analysis, etc
### MiniGUI and HybridOS
HybridOS is another large open source project initiated by FMSoft. It is
a totally new open source operating system designed for smart IoT devices
and cloud computing environment.
In practice, MiniGUI and the software which are used to integrated with GPU
constitute the graphics stack of HybridOS.
HybridOS uses MiniGUI as the underlying windowing system, and the members of
HybridOS project are now maintaining the whole graphics stack.
The following chart shows the graphics stack of HybridOS:
```
-----------------------------------------------
| MiniGUI/HybridOS Apps |
|-----------------------------------------------|
| | (Graphics Stack) |
| | ---------------------|
| | | hiMesa |
| | hiCairo | ------------------|
| | MiniGUI | | EGL for MiniGUI |
| C++ libs | hiDRMDrivers | | GL, GLES, VG |
| C libs | libDRM | | GPU drivers |
|-----------------------------------------------|
| Linux Kernel |
| -----------------------------------|
| | DRI and DRI Drivers |
-----------------------------------------------
```
As shown in the chart above, the HybridOS graphics stack consists of
the following software:
- `libDRM` provides some user land APIs for Linux Direct Rendering Infrastructure.
- `hiDRMDrivers` contains the drivers (user land drivers, not kernel drivers) for
MiniGUI DRM engine. The drivers implement the basic hardware accelerated
2D graphics operations of various GPUs for MiniGUI.
- `hiMesa` is the Mesa derivative for HybridOS, while Mesa is the open source
implementation of OpenGL and other graphics APIs, including OpenGL ES
(versions 1, 2, 3), OpenCL, OpenMAX, and Vulkan. It contains the following
components:
+ The implementation of OpenGL, OpenGL ES (v1, 2, 3), and other
graphics APIs.
+ The EGL implementation for MiniGUI platform.
+ The graphics drivers for various GPUs and a software driver called `swrast`.
- `hiCairo` is the Cairo derivative for HybridOS. Cairo is a 2D vector graphics
library for Gtk. We provide support for MiniGUI backend in `hiCairo`.
For more information about HybridOS, please refer to:
<https://hybridos.fmsoft.cn/>
### Source Code Repositories
FMSoft had created the public repositories for MiniGUI Core, MiniGUI
components, and other open source apps on GitHub. You can visit them on:
components, HybridOS, and other open source apps on GitHub. You can visit
them on:
<https://github.com/VincentWei>
@@ -109,75 +175,12 @@ We now maintain all documents about MiniGUI on the following public repo:
<https://github.com/VincentWei/minigui-docs>
## A BRIEF BUILDING INSTRUCTION
This instruction assumes that you are using Ubuntu Linux.
### Prerequisites
You should run `apt install <package_name>` to install the following packages
on your Ubuntu Linux.
* Building tools:
* autoconf
* Dependent libraries (all are optional):
* libjpeg64-dev
* libpng12-dev (use libpng-dev on Ubuntu Linux 18.04 LTS)
* libfreetype6-dev
### Building MiniGUI Core
MiniGUI Core uses GNU autoconf/automake scripts to configure and build the project.
Run
$ ./configure; make; sudo make install
to configure, make, and install the headers and the libraries. If there is not
`configure` file, please run
$ ./autogen.sh
to generate the script.
MiniGUI Core also provides some configuration options to customize the features.
For more information, please run
$ ./configure --help
### Building whole MiniGUI
If you are anxious to see the comprehensive demo of MiniGUI Core
and MiniGUI components, please fetch one of the following repositories
from GitHub and follow the instructions to build MiniGUI Core,
MiniGUI components, the samples, and the demonstration programs:
<https://github.com/VincentWei/build-minigui-5.0>
or
<https://github.com/VincentWei/build-minigui-4.0>
or
<https://github.com/VincentWei/build-minigui-3.2>
### Unit Tests
Since MiniGUI 4.0.0, we organize the unit test code of MiniGUI APIs in the
following repository:
<https://github.com/VincentWei/mg-tests>
If you are interested in hacking the MiniGUI code, please visit this repository.
## NEW FEATURES IN VERSION 5.0.x
In version 5.0.0, we introduced some new and exciting features, and refactored
a lot basic modules of MiniGUI Core.
### Compositing schema
### Compositing Schema
In this version, we enhanced the MiniGUI-Processes runtime mode to support
the compositing schema. Under compositing schema, regardless a main window
@@ -199,7 +202,7 @@ implementation for multi-process environment:
- Better security. One client created by different user cannot
read/write contents in/to another windows owned by other clients.
### New main window types
### New Main Window Types
In this version, we also enhanced the window manager of MiniGUI Core
to support some special main window types.
@@ -225,7 +228,7 @@ There are eight levels in MiniGUI from top to bottom:
This enhancement allows us to create a special app which acts as
screen lock, docker, or launcher.
### Virtual window
### Virtual Window
You know that we can post or send a message to other windows which
may run in another thread under MiniGUI-Threads. The MiniGUI
@@ -256,7 +259,7 @@ and the new thread.
This enhancement provides a very useful facility to you in order to
develop a well-designed multithreaded application.
### Other enhancements
### Other Enhancements
We also tune or enhance the following modules of MiniGUI Core:
@@ -289,7 +292,7 @@ so that the old applications can smoothly migrate to the new
version. However, there are still some slight changes you need to take care.
For more information, please refer to `RELEASE-NOTES.md` file:
<https://github.com/VincentWei/minigui/blob/master/RELEASE-NOTES.md>
<https://github.com/VincentWei/minigui/blob/rel-5-0/RELEASE-NOTES.md>
## NEW FEATURES IN VERSION 4.0.x
@@ -320,7 +323,7 @@ in order to support [HybridOS Foundation Class Library].
For more information, please refer to `RELEASE-NOTES.md` file:
<https://github.com/VincentWei/minigui/blob/tree/rel-4-0/RELEASE-NOTES.md>
<https://github.com/VincentWei/minigui/blob/rel-4-0/RELEASE-NOTES.md>
Because of the changes of some APIs, we recommended strongly that you
use this version for new projects.
@@ -380,6 +383,68 @@ If a client exits or dies for some reasons, it will not damage other
clients and the server.
## A BRIEF BUILDING INSTRUCTION
### Building Whole MiniGUI
If you are anxious to see the comprehensive demo of MiniGUI Core
and MiniGUI components, please fetch one of the following repositories
from GitHub and follow the instructions to build MiniGUI Core,
MiniGUI components, the samples, and the demonstration programs:
<https://github.com/VincentWei/build-minigui-5.0>
or
<https://github.com/VincentWei/build-minigui-4.0>
or
<https://github.com/VincentWei/build-minigui-3.2>
### Building MiniGUI Core
We recommend that you use a latest Linux distribution with long term support,
for example, Ubuntu Linux LTS 16.04 or 18.04.
On Ubuntu Linux LTS 16.04 or 18.04, you should run `apt install <package_name>`
to install the following packages:
* Building tools:
* autoconf
* Dependent libraries (all are optional):
* libjpeg64-dev
* libpng12-dev (use libpng-dev on Ubuntu Linux 18.04 LTS)
* libfreetype6-dev
MiniGUI Core uses GNU autoconf/automake scripts to configure and build the project.
Run
$ ./configure; make; sudo make install
to configure, make, and install the headers and the libraries. If there is not
`configure` file, please run
$ ./autogen.sh
to generate the script.
MiniGUI Core also provides some configuration options to customize the features.
For more information, please run
$ ./configure --help
### Unit Tests
Since MiniGUI 4.0.0, we organize the unit test code of MiniGUI APIs in the
following repository:
<https://github.com/VincentWei/mg-tests>
If you are interested in hacking the MiniGUI code, please visit this repository.
## HISTORY
21 years have pasted since MiniGUI was initially created at
@@ -483,7 +548,7 @@ A brief history description of the development progress is listed as follow:
1. Feb., 2018: FMSoft released MiniGUI version 3.2.0.
1. Apr., 2019: FMSoft released MiniGUI version 3.2.2.
1. Jul., 2019: FMSoft released MiniGUI version 4.0.0.
1. Apr., 2020: FMSoft released MiniGUI version 5.0.0.
1. Mar., 2020: FMSoft released MiniGUI version 5.0.0.
## AUTHORS AND COPYING
+41 -46
View File
@@ -1,9 +1,10 @@
# Release Notes
- [Version 4.9.1](#version-491)
+ [What's new in this version](#whats-new-in-this-version)
- [Version 4.9.0](#version-490)
+ [What's new in this version](#whats-new-in-this-version)
- [Version 5.0.2](#version-502)
+ [What's new in version 5.0.2](#whats-new-in-version-502)
- [Version 5.0.0](#version-500)
+ [What's new in version 5.0.0](#whats-new-in-version-500)
+ [Compositing schema](#compositing-schema)
+ [New main window styles](#new-main-window-styles)
+ [Virtual window](#virtual-window)
@@ -12,46 +13,40 @@
+ [Changes leading to incompatibility](#changes-leading-to-incompatibility)
+ [Deprecated APIs](#deprecated-apis)
## Version 4.9.1
## Version 5.0.2
The MiniGUI development team announces the availability of MiniGUI 4.9.1,
which is the second preview release of MiniGUI 5.0.0.
The MiniGUI development team announces the availability of MiniGUI 5.0.2,
which is the bug fixing release of MiniGUI 5.0.x.
This is an unstable release to show you some new and exciting features.
Here `unstable` means that the new APIs we introduced in this version
may change in the official release.
### What's new in version 5.0.2
Nevertheless, we did our best to ensure backward compatibility of the
existed APIs so that the old applications can smoothly migrate to the new
version. We recommend that you test this version and report any bugs and
In this version, we tuned some code for GCC 9 and fixed some bugs:
* BUGFIXING:
- Initialize `cfg_res_path` in function `__sysres_get_system_res_path()`.
- Always return TRUE in `subtract_rgn_by_node()`.
* ADJUSTMENTS:
- Use upstream Harfbuzz for glyph shaping of complex scripts instead
of the modified version.
* TUNING:
- Tune some code to depress compilation warnings.
## Version 5.0.0
The MiniGUI development team announces the availability of MiniGUI 5.0.0,
which is the first official release of MiniGUI 5.0.x.
This version brings us some new and exciting features, and we did our best
to ensure backward compatibility of the existed APIs so that the old
applications can smoothly migrate to the new version.
We recommend that you use this version and report any bugs and
incompatibilities in
<https://github.com/VincentWei/minigui/tree/dev-4-1>
<https://github.com/VincentWei/minigui/tree/rel-5-0>
### What's new in this version
### What's new in version 5.0.0
- Tune the `fbcon` (Linux Frame Buffer) engine to support compositing schema.
- Fix some bugs.
## Version 4.9.0
The MiniGUI development team announces the availability of MiniGUI 4.9.0,
which is the first preview release of MiniGUI 5.0.0.
This is an unstable release to show you some new and exciting features.
Here `unstable` means that the new APIs we introduced in this version
may change in the official release.
Nevertheless, we did our best to ensure backward compatibility of the
existed APIs so that the old applications can smoothly migrate to the new
version. We recommend that you test this version and report any bugs and
incompatibilities in
<https://github.com/VincentWei/minigui/tree/dev-4-1>
### What's new in this version
In the development of version 4.9.x, we introduced the following new and
In the development of version 5.0.x, we introduced the following new and
exciting features for MiniGUI:
* ENHANCEMENTS:
@@ -89,6 +84,15 @@ exciting features for MiniGUI:
* ADJUSTMENTS:
- `g_rcScr` now is defined a macro calling function `GetScreenRect()`.
- `mgIsServer` now is define a macro calling function `IsServer()`.
* TUNING
- Tune the `drm` (DRM) engine to support MiniGUI-Processes runtime mode
and compositing schema.
- Tune the `fbcon` (Linux Frame Buffer) engine to support compositing schema.
- Tune the `commlcd` (common LCD) engine to support cumulative updating and
compositing schema.
- Tune the `dummy` GAL engine to support MiniGUI-Processes runtime mode.
compositing schema.
- Fix some bugs.
* CLEANUP:
- Cleaned up a lot of internal symbols (the external functions and
global variables) in order to avoid name polution.
@@ -96,15 +100,6 @@ exciting features for MiniGUI:
message queue, event/message handling, and part of graphics abstract
layer.
The following new features will be developed in the successive versions of
4.9.x:
- Enhance DRM engine to support MiniGUI-Processes runtime mode and the
compositing schema.
- Enhance other frequently used GAL engines to support compositing schema.
- Provide a customized compositor which provides window animation effects as
an example in `mg-demos`.
### Compositing schema
In this version, we enhanced the MiniGUI-Processes runtime mode to support
+4 -4
View File
@@ -1,11 +1,11 @@
Version 4.9.1 (2019/03/11)
Version 5.0.0 (2019/03/30)
This is the second preview version of MiniGUI 5.0.0, an unstable version.
This is the first official release of MiniGUI 5.0.x, the stable version.
Other packages for MiniGUI resource, tools, components, and samples:
- GVFB: `gvfb-1.2.4.tar.gz`
- The resource package: `minigui-res-4.0.0.tar.gz`
- GVFB: `gvfb-1.2.5.tar.gz`
- The resource package: `minigui-res-5.0.0.tar.gz`
- mGUtils component: `libmgutils-1.5.0.tar.gz`
- mGPlus component: `libmgplus-1.5.0.tar.gz`
- mGEff component: `libmgeff-1.5.0.tar.gz`
+6 -1
View File
@@ -172,5 +172,10 @@ tab2space() {
# sed -i 's/\<checkAndGetMainWindowPtrOfMainWin\>/checkAndGetMainWinIfMainWin/g' `grep '\<checkAndGetMainWindowPtrOfMainWin\>' -rl include/ src/`
# sed -i 's/\<checkAndGetMainWindowPtrOfControl\>/checkAndGetMainWinIfWindow/g' `grep '\<checkAndGetMainWindowPtrOfControl\>' -rl include/ src/`
sed -i 's/\<mg_GetMsgQueueForThisThread\>/getMsgQueueForThisThread/g' `grep '\<mg_GetMsgQueueForThisThread\>' -rl include/ src/`
# sed -i 's/\<mg_GetMsgQueueForThisThread\>/getMsgQueueForThisThread/g' `grep '\<mg_GetMsgQueueForThisThread\>' -rl include/ src/`
# sed -i 's/\<IS_SHAREDFB_SCHEMA\>/IS_SHAREDFB_SCHEMA_PROCS/g' `grep '\<IS_SHAREDFB_SCHEMA\>' -rl include/ src/`
sed -i 's/\<REQID_GETWPSURFACE\>/REQID_GETSHAREDSURFACE/g' `grep '\<REQID_GETWPSURFACE\>' -rl include/ src/`
exit 0
+9 -9
View File
@@ -1,6 +1,6 @@
dnl Process this file with autoconf to produce a configure script.
AC_PREREQ(2.60)
AC_INIT(libminigui, 4.9.1)
AC_INIT(libminigui, 5.0.2)
AC_CONFIG_SRCDIR(src/main/main.c)
dnl Set various version strings - taken gratefully from the SDL sources
@@ -14,11 +14,11 @@ dnl Set various version strings - taken gratefully from the SDL sources
# if backwards compatibility has been broken,
# set MINIGUI_BINARY_AGE and MINIGUI_INTERFACE_AGE to 0.
#
MINIGUI_MAJOR_VERSION=4
MINIGUI_MINOR_VERSION=9
MINIGUI_MICRO_VERSION=1
MINIGUI_INTERFACE_AGE=1
MINIGUI_BINARY_AGE=1
MINIGUI_MAJOR_VERSION=5
MINIGUI_MINOR_VERSION=0
MINIGUI_MICRO_VERSION=2
MINIGUI_INTERFACE_AGE=2
MINIGUI_BINARY_AGE=2
MINIGUI_VERSION=$MINIGUI_MAJOR_VERSION.$MINIGUI_MINOR_VERSION.$MINIGUI_MICRO_VERSION
AC_SUBST(MINIGUI_MAJOR_VERSION)
@@ -94,7 +94,7 @@ osname="unspecified"
runtime_mode="procs"
compositing_schema="no"
virtual_window="no"
use_shmopen="no"
use_shmopen="yes"
mgslice_use_fallback="no"
incore_res="no"
@@ -2143,7 +2143,7 @@ if test "x$build_ttf_support" = "xyes"; then
if test "x$build_complex_scripts" = "xyes"; then
dnl Check for HarfBuzz library
AC_CHECK_LIB(harfbuzz, hb_version,
DEP_LIBS="$DEP_LIBS -lharfbuzzex -lfreetype",
DEP_LIBS="$DEP_LIBS -lharfbuzz -lfreetype",
build_complex_scripts="no; support for complex scripts requires libharfbuzz")
else
DEP_LIBS="$DEP_LIBS -lfreetype",
@@ -2223,7 +2223,7 @@ if test "x$build_complex_scripts" = "xyes"; then
[ --with-hb-includes=DIR where the HarfBuzz includes are])
if test "x$with_hb_includes" = "x"; then
HB_INC_DIR="-I/usr/local/include/harfbuzz"
HB_INC_DIR="-I/usr/include/harfbuzz"
else
HB_INC_DIR="-I$with_hb_includes"
fi
+7 -1
View File
@@ -72,9 +72,15 @@ device=/dev/dri/card0
# The default value is 96.
dpi=96
# Whether double buffering is enabled.
# Use `true` or `yes` for enabled, anything else for disabled.
# Note that under compositing schema, double buffering is always enabled.
# Since 5.0.0.
double_buffering=true
# The filename of the shared library for the external driver.
# The equivalent environment variable: MG_GAL_DRM_DRIVER
exdriver=libhidrmdrivers.so.0
exdriver=libhidrmdrivers-0.2.so.0
#}}
#{{ifdef _MGIAL_LIBINPUT
+162 -86
View File
@@ -92,64 +92,73 @@ struct _DrmDriver;
typedef struct _DrmDriver DrmDriver;
/**
* The struct type represents the bufffer can be used by
* MiniGUI NEWGAL engine for hardware surface.
* The structure type represents the buffer can be used by
* MiniGUI NEWGAL DRM engine for a hardware surface.
*/
typedef struct _DrmSurfaceBuffer {
/** The prime fd of the buffer */
int prime_fd;
/** The global name of the buffer */
uint32_t name;
/** The local handle of the buffer */
uint32_t handle;
/** The buffer identifier */
uint32_t id;
/** The widht of the buffer */
uint32_t width;
/** The height of the buffer */
uint32_t height;
/** The pitch (row stride in bytes) of the buffer */
uint32_t pitch;
/** The DRM format of the buffer */
uint32_t drm_format;
/**
* The prime file descriptor of the buffer.
* It has a value >= 0 when this buffer has a prime file descriptor;
* otherwise it has the value -1;
*/
int prime_fd;
/**
* The global name of the buffer.
* It has value > 0 when this buffer has a global name;
* otherwise it has the value 0;
*/
uint32_t name;
/**
* The frame buffer identifier if the buffer has been added as a
* frame buffer to the system, otherwise it has the value 0.
*/
uint32_t fb_id;
/** The DRM format of the buffer. */
uint32_t drm_format;
/** The bits per pixel */
uint32_t bpp:8;
/** The bytes per pixel */
uint32_t cpp:8;
/** Is foreign surface */
uint32_t foreign:1;
/** Is it a dumb buffer. Since 5.0.0. */
uint32_t dumb:1;
/** Is it a scanout buffer. Since 5.0.0. */
uint32_t scanout:1;
/** The width of the buffer. */
uint32_t width;
/** The height of the buffer. */
uint32_t height;
/** The pitch (row stride in bytes) of the buffer. */
uint32_t pitch;
/** The whole size in bytes of the buffer */
unsigned long size;
/** The mapped address of the buffer; NULL when the buffer is not mapped yet. */
uint8_t* pixels;
size_t size;
/**
* The offset from the buffer start to the real pixel data in bytes.
* It must be equal to or larger than the size of the buffer header.
* Since 5.0.0.
*/
off_t offset;
/**
* The mapped address of the buffer;
* NULL when the buffer is not mapped yet.
*
* The address of the pixel data:
* uint8_t* pixels = this->buff + this->offset;
*/
uint8_t* buff;
} DrmSurfaceBuffer;
/**
* The color logic operations.
*/
enum DrmColorLogicOp {
COLOR_LOGICOP_COPY = 0,
COLOR_LOGICOP_COPY_INVERTED,
COLOR_LOGICOP_CLEAR,
COLOR_LOGICOP_SET,
COLOR_LOGICOP_NOR,
COLOR_LOGICOP_NAND,
COLOR_LOGICOP_EQUIV,
COLOR_LOGICOP_INVERT,
COLOR_LOGICOP_XOR,
COLOR_LOGICOP_AND,
COLOR_LOGICOP_AND_INVERTED,
COLOR_LOGICOP_AND_REVERSE,
COLOR_LOGICOP_OR,
COLOR_LOGICOP_OR_INVERTED,
COLOR_LOGICOP_OR_REVERSE,
COLOR_LOGICOP_NOOP,
};
/**
* The struct type defines the operations for a DRI driver.
* The structure type defines the operations for a DRM driver.
*/
typedef struct _DrmDriverOps {
/**
@@ -160,81 +169,95 @@ typedef struct _DrmDriverOps {
DrmDriver* (*create_driver) (int device_fd);
/**
* This operation destroies the DrmDriver object.
* This operation destroys the DrmDriver object.
*
* \note The driver must implement this operation.
*/
void (*destroy_driver) (DrmDriver *driver);
/**
* This operation flushs the batch buffer of the driver or the hardware cache.
* This operation flushes the batch buffer of the driver or
* the hardware cache.
*
* \note This operation can be NULL.
*/
void (* flush_driver) (DrmDriver *driver);
/**
* This operation creates a buffer with the specified pixel format,
* width, and height. If succeed, a valid DrmSurfaceBuffer object will
* be returned; NULL on error. Note that the field of `pixels` of the
* DrmSurfaceBuffer object is NULL until the \a map_buffer was called.
* This operation creates a surface buffer with the specified pixel format,
* header size, width, and height. If succeed, a valid DrmSurfaceBuffer
* object will be returned; NULL on error. Note that the field of `buff`
* of the DrmSurfaceBuffer object is NULL until the \a map_buffer was called.
*
* \note The driver must implement this operation.
* \note The driver must implement this operation and fill all fields of
* the new DrmSurfaceBuffer object.
*/
DrmSurfaceBuffer* (* create_buffer) (DrmDriver *driver,
uint32_t drm_format,
unsigned int width, unsigned int height);
uint32_t drm_format, uint32_t hdr_size,
uint32_t width, uint32_t height);
/**
* This operation creates a buffer for the given handle
* with the specified pixel format, width, and height. If succeed,
* a valid DrmSurfaceBuffer object will be returned; NULL on error.
* This operation creates a buffer from a given and possibly foreign handle
* with the size of the buffer. If succeed, a valid DrmSurfaceBuffer object
* will be returned; NULL on error.
*
* \note This operation can be NULL.
* \note This operation can be NULL. Note that the handle might was created
* by a foreign module. If implemented, the driver must
* fill the correct prime_fd, handle, name, and size fields of the new
* DrmSurfaceBuffer object.
*/
DrmSurfaceBuffer* (* create_buffer_from_handle) (DrmDriver *driver,
uint32_t handle, unsigned long size, uint32_t drm_format,
unsigned int width, unsigned int height, unsigned int pitch);
uint32_t handle, size_t size);
/**
* This operation creates a buffer for the given system global name
* with the specified pixel format, width, and height. If succeed,
* a valid DrmSurfaceBuffer object will be returned; NULL on error.
* If succeed, a valid DrmSurfaceBuffer object will be returned;
* NULL on error.
*
* \note This operation can be NULL.
* \note This operation can be NULL. If implemented, the driver must
* fill the correct prime_fd, handle, name, and size fields of the new
* DrmSurfaceBuffer object.
*/
DrmSurfaceBuffer* (* create_buffer_from_name) (DrmDriver *driver,
uint32_t name, uint32_t drm_format,
unsigned int width, unsigned int height, unsigned int pitch);
uint32_t name);
/**
* This operation creates a buffer for the given PRIME file descriptor
* with the specified pixel format, width, height, and pitch. If succeed,
* a valid DrmSurfaceBuffer object will be returned; NULL on error.
*
* \note This operation can be NULL.
* \note This operation can be NULL. If implemented, the driver must
* fill the correct prime_fd, handle, name, and size fields of the new
* DrmSurfaceBuffer object.
*/
DrmSurfaceBuffer* (* create_buffer_from_prime_fd) (DrmDriver *driver,
int prime_fd, unsigned long size, uint32_t drm_format,
unsigned int width, unsigned int height, unsigned int pitch);
int prime_fd, size_t size);
/**
* This operation maps the buffer into the current process's virtual memory
* space, and returns the virtual address. If failed, it returns NULL.
*
* \note The driver must implement this operation.
* When \a for_scanout is not zero, the buffer will be used for scan out
* frame buffer.
*
* \note The driver must implement this operation. The driver must
* set a valid value for buff field of the DrmSurfaceBuffer object
* on success.
*/
uint8_t* (* map_buffer) (DrmDriver *driver, DrmSurfaceBuffer* buffer);
uint8_t* (* map_buffer) (DrmDriver *driver, DrmSurfaceBuffer* buffer,
int for_scanout);
/**
* This operation un-maps a buffer.
*
* \note The driver must implement this operation.
* \note The driver must implement this operation. The driver must
* set NULL for buff field of the DrmSurfaceBuffer object
* on success.
*/
void (* unmap_buffer) (DrmDriver *driver, DrmSurfaceBuffer* buffer);
/**
* This operation destroies a buffer.
* This operation destroys a buffer.
*
* \note The driver must implement this operation.
*/
@@ -256,7 +279,7 @@ typedef struct _DrmDriverOps {
* If succeed, it returns 0.
*
* \note If this operation is set as NULL, it will be supposed that
* the driver does not support any hardware accelerated blit operation.
* the driver does not support any hardware accelerated blitting operation.
*/
int (* check_blit) (DrmDriver *driver,
DrmSurfaceBuffer* src_buf, DrmSurfaceBuffer* dst_buf);
@@ -265,51 +288,104 @@ typedef struct _DrmDriverOps {
* This operation copies bits from a source buffer to a destination buffer.
*
* \note If this operation is set as NULL, the driver does not support
* hardware accelerated copy blit.
* hardware accelerated copy blitting.
*
* \note Currently, the logical operation is ignored.
*/
int (* copy_blit) (DrmDriver *driver,
DrmSurfaceBuffer* src_buf, const GAL_Rect* src_rc,
DrmSurfaceBuffer* dst_buf, const GAL_Rect* dst_rc,
enum DrmColorLogicOp logic_op);
ColorLogicalOp logic_op);
/**
* This operation blits pixles from a source buffer with the source alpha value
* specified to a destination buffer.
* This operation blits pixels from a source buffer with the source alpha
* value specified to a destination buffer.
*
* \note If this operation is set as NULL, the driver does not support
* hardware accelerated blit with alpha.
* hardware accelerated blitting with alpha.
*/
int (* alpha_blit) (DrmDriver *driver,
DrmSurfaceBuffer* src_buf, const GAL_Rect* src_rc,
DrmSurfaceBuffer* dst_buf, const GAL_Rect* dst_rc, uint8_t alpha);
DrmSurfaceBuffer* dst_buf, const GAL_Rect* dst_rc,
uint8_t alpha);
/**
* This operation blits pixles from a source buffer to a destination buffer,
* This operation blits pixels from a source buffer to a destination buffer,
* but skipping the pixel value specified by \a color_key.
*
* \note If this operation is set as NULL, the driver does not support
* hardware accelerated blit with color key.
* hardware accelerated blitting with color key.
*/
int (* key_blit) (DrmDriver *driver,
DrmSurfaceBuffer* src_buf, const GAL_Rect* src_rc,
DrmSurfaceBuffer* dst_buf, const GAL_Rect* dst_rc, uint32_t color_key);
DrmSurfaceBuffer* dst_buf, const GAL_Rect* dst_rc,
uint32_t color_key);
/**
* This operation blits pixles from a source buffer with the source alpha value
* specified to a destination buffer, but skipping the pixel value specified.
* This operation blits pixels from a source buffer with the source alpha
* value specified to a destination buffer, but skipping the pixel value
* specified.
*
* \note If this operation is set as NULL, the driver does not support
* hardware accelerated blit with alpha and color key.
* hardware accelerated blitting with alpha and color key.
*/
int (* alpha_key_blit) (DrmDriver *driver,
DrmSurfaceBuffer* src_buf, const GAL_Rect* src_rc,
DrmSurfaceBuffer* dst_buf, const GAL_Rect* dst_rc,
uint8_t alpha, uint32_t color_key);
/**
* This operation blits pixels from a source buffer with the source alpha
* value of pixels to the destination buffer, and with the specified color
* compositing/blending method (\a ColorBlendMethod).
*
* \note If this operation is set as NULL, the driver does not support
* hardware accelerated blitting with alpha on basis per pixel.
*
* \note Currently, the color compositing/blending method is ignored.
*/
int (* alpha_pixel_blit) (DrmDriver *driver,
DrmSurfaceBuffer* src_buf, const GAL_Rect* src_rc,
DrmSurfaceBuffer* dst_buf, const GAL_Rect* dst_rc,
ColorBlendMethod blend_method);
} DrmDriverOps;
/** Implement this stub to return the DRI driver operations */
DrmDriverOps* __drm_ex_driver_get (const char* driver_name, int device_fd);
/** The current version of DRM driver. */
#define DRM_DRIVER_VERSION 1
/**
* Implement this stub to return the DRI driver operations
*
* This function takes three arguments and returns NULL or
* a valid pointer of DrmDriverOps to MiniGUI.
*
* This function can return different DrmDriverOps to MiniGUI according to
* the driver name and device file descriptor. In this way, your DRM engine
* driver implementation can support multiple GPUs.
*
* If the external stub returns NULL, MiniGUI will try to use the dumb
* frame buffer instead.
*
* \param driver_name This argument gives the driver name determined
* by MiniGUI. Generally, it is the kernel driver name for your GPU.
* For example, for Intel i915/i965 GPUs, the driver name will be `i915`.
* \param device_fd This argument gives the file descriptor of the
* opened DRI device.
* \param version A pointer to an integer which will be used to return
* the interface version of the DRM engine driver.
*
* \return NULL or a valid pointer to DrmDriverOps.
*
* \note We use the version control since 4.0.7. It will be initialized
* to zero by MiniGUI before calling this function. Because an old
* driver for MiniGUI 4.0.6 or earlier will not change the value,
* MiniGUI will deny to load the old driver.
*
* The constant \a DRM_DRIVER_VERSION defines the current version code.
*/
DrmDriverOps* __drm_ex_driver_get (const char* driver_name, int device_fd,
int* version);
/** @} end of external_stubs_dri */
+65 -32
View File
@@ -5304,22 +5304,22 @@ typedef enum {
* The color logical operations.
*/
typedef enum {
COLOR_LOGIC_OP_COPY = 0,
COLOR_LOGIC_OP_COPY_INVERTED,
COLOR_LOGIC_OP_CLEAR,
COLOR_LOGIC_OP_SET,
COLOR_LOGIC_OP_NOR,
COLOR_LOGIC_OP_NAND,
COLOR_LOGIC_OP_EQUIV,
COLOR_LOGIC_OP_INVERT,
COLOR_LOGIC_OP_XOR,
COLOR_LOGIC_OP_AND,
COLOR_LOGIC_OP_AND_INVERTED,
COLOR_LOGIC_OP_AND_REVERSE,
COLOR_LOGIC_OP_OR,
COLOR_LOGIC_OP_OR_INVERTED,
COLOR_LOGIC_OP_OR_REVERSE,
COLOR_LOGIC_OP_NOOP,
COLOR_LOGICOP_CLEAR = 0,
COLOR_LOGICOP_NOR,
COLOR_LOGICOP_AND_INVERTED,
COLOR_LOGICOP_COPY_INVERTED,
COLOR_LOGICOP_AND_REVERSE,
COLOR_LOGICOP_INVERT,
COLOR_LOGICOP_XOR,
COLOR_LOGICOP_NAND,
COLOR_LOGICOP_AND,
COLOR_LOGICOP_EQUIV,
COLOR_LOGICOP_NOOP0,
COLOR_LOGICOP_OR_INVERTED1,
COLOR_LOGICOP_COPY,
COLOR_LOGICOP_OR_REVERSE,
COLOR_LOGICOP_OR,
COLOR_LOGICOP_SET,
} ColorLogicalOp;
/**
@@ -14345,14 +14345,18 @@ MG_EXPORT int drmGetDeviceFD (GHANDLE video);
* THe struct type defines the DRM surface information.
*/
typedef struct _DrmSurfaceInfo {
/** The prime fd of the buffer object. */
int prime_fd;
/** The global name of the buffer object. */
uint32_t name;
/** The local handle of the buffer object. */
uint32_t handle;
/** The buffer identifier. */
uint32_t id;
/** The prime fd of the buffer object. If it was no exported as a global
buffer object, it has the value -1. */
int prime_fd;
/** The global name of the buffer object. It has the value 0 when it was
not expored as global buffer object. */
uint32_t name;
/** The frame buffer identifier. If the buffer was not added as
a frame buffer to the system, it has the value 0. */
uint32_t fb_id;
/** The width of the surface. */
uint32_t width;
/** The height of the surface. */
@@ -14362,7 +14366,9 @@ typedef struct _DrmSurfaceInfo {
/** The DRM pixel format. */
uint32_t drm_format;
/** Size in bytes of the buffer object. */
unsigned long size;
size_t size;
/** The offset from the buffer start to the real pixel data. */
off_t offset;
} DrmSurfaceInfo;
/**
@@ -14384,15 +14390,24 @@ MG_EXPORT BOOL drmGetSurfaceInfo (GHANDLE video, HDC hdc, DrmSurfaceInfo* info);
* \param video The video handle.
* \param name The name handle of the DRM surface.
* \param drm_format The DRM pixel format.
* \param offset The offset from the buffer start to the real pixel data.
* \param width The width of the DRM surface.
* \param height The height of the DRM surface.
* \param pitch The pitch (row stride) of the DRM surface.
*
* \return The handle to the memory DC for success, HDC_INVALID for failure.
*/
MG_EXPORT HDC drmCreateDCFromName (GHANDLE video,
uint32_t name, uint32_t drm_format,
unsigned int width, unsigned int height, uint32_t pitch);
MG_EXPORT HDC drmCreateDCFromNameEx (GHANDLE video,
uint32_t name, uint32_t drm_format, off_t offset,
uint32_t width, uint32_t height, uint32_t pitch);
static inline HDC drmCreateDCFromName (GHANDLE video,
uint32_t name, uint32_t drm_format,
uint32_t width, uint32_t height, uint32_t pitch)
{
return drmCreateDCFromNameEx (video,
name, drm_format, 0, width, height, pitch);
}
/**
* This function creates a memory DC with a DRM surface which is created by
@@ -14402,15 +14417,24 @@ MG_EXPORT HDC drmCreateDCFromName (GHANDLE video,
* \param prime_fd The PRIME file descriptor.
* \param size The size of the DRM surface in bytes.
* \param drm_format The DRM pixel format.
* \param offset The offset from the buffer start to the real pixel data.
* \param width The width of the DRM surface.
* \param height The height of the DRM surface.
* \param pitch The pitch (row stride) of the DRM surface.
*
* \return The handle to the memory DC for success, HDC_INVALID for failure.
*/
MG_EXPORT HDC drmCreateDCFromPrimeFd (GHANDLE video,
int prime_fd, unsigned long size, uint32_t drm_format,
unsigned int width, unsigned int height, uint32_t pitch);
MG_EXPORT HDC drmCreateDCFromPrimeFdEx (GHANDLE video,
int prime_fd, size_t size, uint32_t drm_format, off_t offset,
uint32_t width, uint32_t height, uint32_t pitch);
static inline HDC drmCreateDCFromPrimeFd (GHANDLE video,
int prime_fd, size_t size, uint32_t drm_format,
uint32_t width, uint32_t height, uint32_t pitch)
{
return drmCreateDCFromPrimeFdEx (video,
prime_fd, size, drm_format, 0, width, height, pitch);
}
/**
* This function creates a memory DC with a DRM surface which is created by
@@ -14420,15 +14444,24 @@ MG_EXPORT HDC drmCreateDCFromPrimeFd (GHANDLE video,
* \param handle The handle of the DRM surface.
* \param size The size of the DRM surface in bytes.
* \param drm_format The DRM pixel format.
* \param offset The offset from the buffer start to the real pixel data.
* \param width The width of the DRM surface.
* \param height The height of the DRM surface.
* \param pitch The pitch (row stride) of the DRM surface.
*
* \return The handle to the memory DC for success, HDC_INVALID for failure.
*/
MG_EXPORT HDC drmCreateDCFromHandle (GHANDLE video,
uint32_t handle, unsigned long size, uint32_t drm_format,
unsigned int width, unsigned int height, uint32_t pitch);
MG_EXPORT HDC drmCreateDCFromHandleEx (GHANDLE video,
uint32_t handle, size_t size, uint32_t drm_format, off_t offset,
uint32_t width, uint32_t height, uint32_t pitch);
static inline HDC drmCreateDCFromHandle (GHANDLE video,
uint32_t handle, size_t size, uint32_t drm_format,
uint32_t width, uint32_t height, uint32_t pitch)
{
return drmCreateDCFromHandleEx (video,
handle, size, drm_format, 0, width, height, pitch);
}
/** @} end of gdi_drm_fns */
+35 -6
View File
@@ -1574,23 +1574,44 @@ typedef struct _CompositorOps {
*/
void (*on_layer_op) (CompositorCtxt* ctxt, int layer_op,
MG_Layer* layer, MG_Client* client);
/**
* This operation will be called when the server intends to composite
* the whole screen for the particular layer.
* The compositor can reset the dirty region for the layer.
* If it returns FALSE, the compositor will not handle the layer.
*/
BOOL (*reset_dirty_region) (CompositorCtxt* ctxt, MG_Layer* layer);
/**
* This operation will be called when there are some dirty
* rectangles in the specific popup menu z-node.
* The compositor should merge the dirty rectangles to the
* dirty region maintained for the current layer.
*/
void (*on_dirty_ppp) (CompositorCtxt* ctxt, int zidx);
BOOL (*merge_dirty_ppp) (CompositorCtxt* ctxt, MG_Layer* layer, int zidx);
/**
* This operation will be called when there are some dirty rectangles
* in the specific window z-node on the specific layer.
* The compositor should merge the dirty rectangles to the
* dirty region maintained for the current layer.
*/
void (*on_dirty_win) (CompositorCtxt* ctxt, MG_Layer* layer, int zidx);
BOOL (*merge_dirty_win) (CompositorCtxt* ctxt, MG_Layer* layer, int zidx);
/**
* This operation will be called when there are some dirty rectangles
* in the wallpaper pattern.
* The compositor should merge the dirty rectangles of the wallpaper
* pattern to the dirty region maintained for the current layer.
*/
void (*on_dirty_wpp) (CompositorCtxt* ctxt);
BOOL (*merge_dirty_wpp) (CompositorCtxt* ctxt, MG_Layer* layer);
/**
* This operation will be called to composite the dirty region
* for the particular layer.
*/
BOOL (*refresh_dirty_region) (CompositorCtxt* ctxt, MG_Layer* layer);
/**
* This operation will be called when a z-node was out of action, e.g.,
@@ -1771,18 +1792,26 @@ MG_EXPORT BOOL GUIAPI ServerUnregisterCompositor (const char* name);
MG_EXPORT const CompositorOps* GUIAPI ServerSelectCompositor (
const char* name, CompositorCtxt** ctxt);
#define COMPSOR_OPS_VERSION 1
/**
* Implement this stub to return the compositor operations
* for a specific compositor name if you implement the compositor
* in a shared library.
*
* \param name The name of the compositor desired.
* \param fallback The fallback operations for this compositor.
* \param fallback_ops The fallback operations.
* \param version The version code for the operations of the compositor.
*
* \note The compositor should return the version code it follows through
* \a version argument. If the version code is not matched, MiniGUI
* will refuse to load the compositor. The current version code
* is defined by \a COMPSOR_OPS_VERSION.
*
* \return The compositor operations for specific name, NULL for error.
*/
const CompositorOps* __ex_compositor_get (const char* name,
const CompositorOps* fallback);
const CompositorOps* fallback_ops, int* version);
#endif /* defined _MGSCHEMA_COMPOSITING */
@@ -1822,7 +1851,7 @@ const CompositorOps* __ex_compositor_get (const char* name,
*
* \sa RegisterRequestHandler
*/
#define MAX_SYS_REQID 0x0022
#define MAX_SYS_REQID 0x0023
/**
* \def MAX_REQID
+1 -1
View File
@@ -192,7 +192,7 @@ int GUIAPI ClientRequestEx2 (const REQUEST* request,
&& (__mg_client_id == 0 && request->id != REQID_JOINLAYER)) {
#elif defined(_MGSCHEMA_COMPOSITING)
if (__mg_client_id == 0 && request->id != REQID_JOINLAYER &&
request->id != REQID_GETWPSURFACE) {
request->id != REQID_GETSHAREDSURFACE) {
#else
if (__mg_client_id == 0 && request->id != REQID_JOINLAYER) {
#endif
+4 -2
View File
@@ -1433,10 +1433,12 @@ static LRESULT NewToolbarCtrlProc (HWND hwnd, UINT message, WPARAM wParam, LPARA
item_info->add_data = item->add_data;
if (item_info->which & MTB_WHICH_TEXT)
strncpy (item_info->text, item->text, NTB_TEXT_LEN);
//strncpy (item_info->text, item->text, NTB_TEXT_LEN);
strcpy (item_info->text, item->text);
if (item_info->which & MTB_WHICH_TIP)
strncpy (item_info->tip, item->tip, NTB_TIP_LEN);
//strncpy (item_info->tip, item->tip, NTB_TIP_LEN);
strcpy (item_info->tip, item->tip);
return NTB_OKAY;
}
+11 -13
View File
@@ -1012,8 +1012,9 @@ void GUIAPI DestroyDynamicDevFont (DEVFONT** devfont)
{
char font_name [LEN_UNIDEVFONT_NAME + 1];
memset(font_name, 0, LEN_UNIDEVFONT_NAME + 1);
strncpy(font_name, (*devfont)->name, LEN_UNIDEVFONT_NAME);
//memset(font_name, 0, LEN_UNIDEVFONT_NAME + 1);
//strncpy(font_name, (*devfont)->name, LEN_UNIDEVFONT_NAME);
strcpy(font_name, (*devfont)->name);
font_DelDevFont (font_name);
*devfont = NULL;
@@ -1069,25 +1070,22 @@ static BOOL init_or_term_specifical_fonts (char* etc_section, BOOL is_unload)
added_num ++;
}
else {
/* [DK] Fix Bug #4801, which introduce a absolute path check error in Windows,
* first to load from sytem res path, else load it directly(relative or absolute path).*/
if ((add_dev_font (font_name, font_file, TRUE)) == TRUE)
/* [DK] Fix Bug #4801, which introduce an absolute path check error in Windows,
* first to load from sytem res path, else load it directly (relative or absolute path).*/
if (add_dev_font (font_name, font_file, TRUE))
added_num++;
else if ((0 == __mg_path_joint(font_path, MAX_PATH + 1,
__sysres_get_system_res_path(), font_file))
&& ((add_dev_font (font_name, font_path, TRUE)) == TRUE))
__sysres_get_system_res_path(), font_file)) &&
add_dev_font (font_name, font_path, TRUE))
added_num++;
}
}
if (is_unload || added_num > 0 || added_num == font_num)
{
if (is_unload || added_num > 0 || added_num == font_num) {
return TRUE;
}
else
{
return FALSE;
}
return FALSE;
}
BOOL font_InitSpecificalFonts (char* etc_section)
+26 -31
View File
@@ -120,47 +120,42 @@ hb_minigui_unicode_decompose (hb_unicode_funcs_t *ufuncs,
return UCharDecompose(ab, a, b);
}
static hb_unicode_funcs_t *_funcs;
static hb_unicode_funcs_t *get_unicode_funcs(void)
{
if (_funcs)
return _funcs;
_funcs = hb_unicode_funcs_create (NULL);
hb_unicode_funcs_set_combining_class_func (_funcs,
hb_minigui_unicode_combining_class, NULL, NULL);
hb_unicode_funcs_set_general_category_func (_funcs,
hb_minigui_unicode_general_category, NULL, NULL);
hb_unicode_funcs_set_mirroring_func (_funcs,
hb_minigui_unicode_mirroring, NULL, NULL);
hb_unicode_funcs_set_script_func (_funcs,
hb_minigui_unicode_script, NULL, NULL);
hb_unicode_funcs_set_compose_func (_funcs,
hb_minigui_unicode_compose, NULL, NULL);
hb_unicode_funcs_set_decompose_func (_funcs,
hb_minigui_unicode_decompose, NULL, NULL);
hb_unicode_funcs_make_immutable (_funcs);
return _funcs;
}
typedef hb_unicode_funcs_t *(*hb_get_unicode_funcs) (void);
extern hb_get_unicode_funcs __hb_extern_get_unicode_funcs;
/* extern hb_unicode_funcs_t *__mg_hb_unifuncs */
hb_unicode_funcs_t *__mg_hb_unifuncs;
void __mg_init_harzbuff_funcs(void)
{
_DBG_PRINTF("%s: called\n", __FUNCTION__);
__hb_extern_get_unicode_funcs = get_unicode_funcs;
if (__mg_hb_unifuncs)
return;
__mg_hb_unifuncs = hb_unicode_funcs_create (NULL);
hb_unicode_funcs_set_combining_class_func (__mg_hb_unifuncs,
hb_minigui_unicode_combining_class, NULL, NULL);
hb_unicode_funcs_set_general_category_func (__mg_hb_unifuncs,
hb_minigui_unicode_general_category, NULL, NULL);
hb_unicode_funcs_set_mirroring_func (__mg_hb_unifuncs,
hb_minigui_unicode_mirroring, NULL, NULL);
hb_unicode_funcs_set_script_func (__mg_hb_unifuncs,
hb_minigui_unicode_script, NULL, NULL);
hb_unicode_funcs_set_compose_func (__mg_hb_unifuncs,
hb_minigui_unicode_compose, NULL, NULL);
hb_unicode_funcs_set_decompose_func (__mg_hb_unifuncs,
hb_minigui_unicode_decompose, NULL, NULL);
hb_unicode_funcs_make_immutable (__mg_hb_unifuncs);
return;
}
void __mg_term_harzbuff_funcs(void)
{
_DBG_PRINTF("%s: called\n", __FUNCTION__);
if (_funcs) {
hb_unicode_funcs_destroy(_funcs);
if (__mg_hb_unifuncs) {
hb_unicode_funcs_destroy(__mg_hb_unifuncs);
}
else {
_ERR_PRINTF("%s: hb_unicode_funcs_t object is NULL\n",
+5 -4
View File
@@ -2203,14 +2203,15 @@ static int create_memdc_for_menu (TRACKMENUINFO* ptmi)
static void delete_memdc_for_menu (TRACKMENUINFO* ptmi)
{
if (ptmi->dc != HDC_INVALID) {
GAL_Surface *surf = GetSurfaceFromDC (ptmi->dc);
DeleteMemDC (ptmi->dc);
ptmi->dc = HDC_INVALID;
#if 0 /* deprecated code: we always do refcount++ for any memdc */
/* we must free the surface here, or it can not be freed actually
due to the referenced count. */
GAL_Surface *surf = GetSurfaceFromDC (ptmi->dc);
GAL_FreeSurface (surf);
#endif /* deprecated code */
DeleteMemDC (ptmi->dc);
ptmi->dc = HDC_INVALID;
}
}
+2 -2
View File
@@ -4261,7 +4261,7 @@ HWND GUIAPI CreateMainWindowEx2 (PMAINWINCREATE pCreateInfo, LINT id,
{pCreateInfo->lx, pCreateInfo->ty,
pCreateInfo->rx, pCreateInfo->by} };
// we ignore the retval. may fail for client of procs runmode
// we ignore the retval. may fail for client under procs runmode
SendMessage (HWND_DESKTOP, MSG_CALC_POSITION, 0, (LPARAM)&info);
pCreateInfo->lx = info.rc.left;
@@ -5393,6 +5393,7 @@ static BOOL _wndInvalidateRect(HWND hWnd, const RECT* prc, BOOL bEraseBkgnd, int
#endif
}
else {
_WRN_PRINTF ("The invalid region is forzen\n");
return FALSE;
}
@@ -5573,7 +5574,6 @@ HDC GUIAPI BeginPaint (HWND hWnd)
MG_CHECK_RET (MG_IS_NORMAL_WINDOW(hWnd), HDC_INVALID);
pWin = MG_GET_WINDOW_PTR (hWnd);
if (pWin->pCaretInfo && pWin->pCaretInfo->fBlink) {
HideCaretEx (hWnd, FALSE);
pWin->pCaretInfo->fBlink = TRUE;
+1 -3
View File
@@ -1243,11 +1243,9 @@ static int wait_event_ex (int maxfd, fd_set *in, fd_set *out, fd_set *except,
break;
}
#if 0
default:
_DBG_PRINTF("IAL>LIBINPUT: got a UNKNOWN event type: %d\n", type);
_WRN_PRINTF("IAL>LIBINPUT: got a UNKNOWN event type: %d\n", type);
break;
#endif
}
libinput_event_destroy(event);
+27 -18
View File
@@ -64,6 +64,9 @@ extern "C" {
#define SHOW_HIDE_TYPE 5
#define XVFB_CLOSE_TYPE 6
/* Since 5.0.0: command */
#define CMD_TYPE 7
struct PCXVFbKeyData
{
unsigned int unicode;
@@ -74,36 +77,35 @@ struct PCXVFbKeyData
typedef struct _XVFBKEYDATA
{
unsigned short key_code;
unsigned short key_state;
unsigned short key_code;
unsigned short key_state;
} XVFBKEYDATA;
typedef struct _XVFBMOUSEDATA
{
unsigned short x;
unsigned short y;
unsigned int button;
unsigned short x;
unsigned short y;
unsigned int button;
} XVFBMOUSEDATA;
typedef struct _XVFBEVENTDATA
{
int event_type;
union
{
XVFBKEYDATA key;
XVFBMOUSEDATA mouse;
} data;
int event_type;
union {
XVFBKEYDATA key;
XVFBMOUSEDATA mouse;
} data;
} XVFBEVENT;
typedef struct _XVFBCaptionEventData{
int event_type;
int size;
char buff[0];
int event_type;
int size;
char buff[0];
}XVFBCaptionEventData;
typedef struct _XVFBIMEEventData{
int event_type;
int ime_open;
int event_type;
int ime_open;
}XVFBIMEEventData;
typedef struct _XVFBIMEMSGEventData{
@@ -117,6 +119,13 @@ typedef struct _XVFBShowHideEventData{
int show; /* 0 to hide, 1 to show */
}XVFBShowHideEventData;
/* Since 5.0.0: command */
#define XVFB_CMD_QUIT 0
typedef struct _XVFBCmdEventData {
int event_type;
int cmd;
} XVFBCmdEventData;
extern int __mg_pcxvfb_server_sockfd;
extern int __mg_pcxvfb_client_sockfd;
@@ -124,8 +133,8 @@ BOOL ial_InitPCXVFBInput (INPUT* input, const char* mdev, const char* mtype);
void TermPCXVFBInput (void);
MG_EXPORT void GUIAPI VFBOpenIME(int bOpen);
MG_EXPORT void GUIAPI VFBSetIMETextCallback(void (*setIMEText)(void *, const char* text),
void *user_data);
MG_EXPORT void GUIAPI VFBSetIMETextCallback(void (*setIMEText)(void *,
const char* text), void *user_data);
MG_EXPORT void GUIAPI VFBSetCaption(const char* caption);
MG_EXPORT void GUIAPI VFBShowWindow(int show);
+17 -11
View File
@@ -689,21 +689,19 @@ BOOL ial_InitPCXVFBInput (INPUT* input, const char* mdev, const char* mtype)
{
char path[PATH_MAX], *template;
template = getenv("MG_ENV_RECORD_IAL");
if (template)
{
if (template) {
#if 0
snprintf(path, sizeof(path), "%s%ld", template, time(NULL));
snprintf(path, sizeof(path), "%s%ld", template, time(NULL));
#else
snprintf(path, sizeof(path), "%s", template);
snprintf(path, sizeof(path), "%s", template);
#endif
path[sizeof(path)/sizeof(path[0])-1] = 0;
path[sizeof(path)/sizeof(path[0])-1] = 0;
open_rec (path);
record_time_start = getcurtime();
}
open_rec (path);
record_time_start = getcurtime();
}
}
return TRUE;
}
@@ -725,6 +723,14 @@ void TermPCXVFBInput (void)
socket_file[49] = '\0';
if (__mg_pcxvfb_client_sockfd >= 0) {
/* Since 5.0.0: send a quit command to XVFB */
XVFBCmdEventData cmd = { CMD_TYPE, XVFB_CMD_QUIT };
if (mg_writesocket (__mg_pcxvfb_client_sockfd, &cmd, sizeof (cmd)) <
sizeof (cmd)) {
// do nothing
}
close(__mg_pcxvfb_client_sockfd);
__mg_pcxvfb_client_sockfd = -1;
}
@@ -733,7 +739,7 @@ void TermPCXVFBInput (void)
__mg_pcxvfb_server_sockfd = -1;
}
unlink(socket_file);
#if defined(_MGRM_PROCESSES) && !defined(_MGRM_STANDALONE)
#if defined(_MGRM_PROCESSES)
if (mgIsServer) {
remove("/tmp/.pcxvfb_tmp");
}
@@ -741,4 +747,4 @@ void TermPCXVFBInput (void)
#endif /* WIN32 */
}
#endif /* _MGGAL_PCXVFB*/
#endif /* _MGGAL_PCXVFB */
+1 -1
View File
@@ -7,4 +7,4 @@ noinst_HEADERS = \
ourhdr.h client.h server.h sharedres.h sockio.h drawsemop.h \
gal.h newgal.h memops.h incoreres.h sysres.h clipboard.h \
glyph.h license.h mgsock.h unicode-ops.h \
linux-tty.h debug.h
linux-tty.h debug.h map.h
+19 -5
View File
@@ -101,8 +101,14 @@
#define REQID_COPYCURSOR 0x001B
/* Since 5.0.0 */
// Get global wallpaper pattern surface
#define REQID_GETWPSURFACE 0x001C
// Get shared surface
#define REQID_GETSHAREDSURFACE 0x001C
// for compositing schema
#define SYSSF_WALLPAPER_PATTER "syssf-wallpaper-pattern"
// for sharedfb schema
#define SYSSF_REAL_SCREEN "syssf-real-screen"
#define SYSSF_SHADOW_SCREEN "syssf-shadow-screen"
// Load cursor from PNG file
#define REQID_LOADCURSOR_PNG 0x001D
// Load cursor from in-memory PNG
@@ -117,7 +123,10 @@
// Calculate the position a main window with WS_EX_AUTOPOSITION
#define REQID_CALCPOSITION 0x0022
#define REQID_SYS_LAST REQID_CALCPOSITION
// Authenticate client
#define REQID_AUTHCLIENT 0x0023
#define REQID_SYS_LAST REQID_AUTHCLIENT
/*
* XXX: To fellows who need to add a new REQID,
@@ -135,8 +144,13 @@ MGUI_COMPILE_TIME_ASSERT(sys_request_id, MAX_SYS_REQID >= REQID_SYS_LAST);
/* Since 5.0.0 */
typedef struct _SharedSurfInfo {
Uint32 flags;
size_t map_size;
uint32_t flags; // the flags of the surface
uint32_t width, height;
uint32_t pitch;
uint32_t name; // when use flink name
uint32_t drm_format; // DRM pixel format
size_t size; // whole size of the surface
off_t offset; // offset of pixel data
} SHAREDSURFINFO;
typedef struct JoinLayerInfo {
+4 -4
View File
@@ -62,9 +62,9 @@
#endif
#if defined(_MGRM_PROCESSES) && defined(_MGSCHEMA_SHAREDFB)
# define IS_SHAREDFB_SCHEMA 1
# define IS_SHAREDFB_SCHEMA_PROCS 1
#else
# define IS_SHAREDFB_SCHEMA 0
# define IS_SHAREDFB_SCHEMA_PROCS 0
#endif
/* the maximal number of the dirty rects */
@@ -167,13 +167,13 @@ enum {
#endif
/* constants for engine name and video mode */
#define LEN_SO_NAME 127 // name length of a shared object (library)
#define LEN_DEVICE_NAME 127
#define LEN_EXDRIVER_NAME 127
#define LEN_EXDRIVER_NAME LEN_SO_NAME
#define LEN_ENGINE_NAME 23
#define LEN_VIDEO_MODE 31
#define LEN_MTYPE_NAME 23
#define LEN_FOURCC_FORMAT 7
#define LEN_SO_NAME 255 // name length of a shared object (library)
/* misc constants and utilities */
+1 -1
View File
@@ -162,7 +162,7 @@ dump_message (const MSG* msg, const char* name)
name, msg->message, Message2Str (msg->message),
msg->hwnd, (PVOID)msg->wParam, (PVOID)msg->lParam);
#else
_MG_PRINTF ("Message(%s): %u, Wnd: %p, wP: %p, lP: %p.\n",
_MG_PRINTF ("Message(%s) for %s: %u, Wnd: %p, wP: %p, lP: %p.\n",
#ifdef _MGHAVE_VIRTUAL_WINDOW
msg->pSyncMsg?"SYNC":"NORM",
#else
+53 -19
View File
@@ -64,6 +64,10 @@
#include <semaphore.h>
#endif
#if IS_SHAREDFB_SCHEMA_PROCS
#include <semaphore.h>
#endif
#define DISABLE_THREADS
#define GAL_mutex int
@@ -131,15 +135,10 @@ typedef struct _DirtyInfo {
* than the creator.
*/
typedef struct _SharedSurfaceHeader {
#if 0
/* The semaphore for this shared surface */
sem_t sem_lock;
#else
/* The number of semphore for this surface.
The SysV semaphore set id for synchronizing this shared surface:
SHAREDRES_SEMID_SHARED_SURF. */
int sem_num;
#endif
/* The pid of the creator */
pid_t creator;
@@ -159,27 +158,35 @@ typedef struct _SharedSurfaceHeader {
/* the RGBA masks */
Uint32 Rmask, Gmask, Bmask, Amask;
/* the size of the buffer */
size_t buf_size;
/* the pixels */
char buf[0];
/* the size of the whole buffer */
size_t map_size;
/* the offset of pixels data */
off_t pixels_off;
} GAL_SharedSurfaceHeader;
#endif /* IS_COMPOSITING_SCHEMA */
/* The header for shadow screen; used to store the dirty rectangle. */
typedef struct _ShadowSurfaceHeader {
/* The dirty rectangle */
RECT dirty_rc;
} GAL_ShadowSurfaceHeader;
/*
* This structure should be treated as read-only, except for 'pixels',
* which, if not NULL, contains the raw pixel data for the surface.
*/
typedef struct GAL_Surface {
Uint32 flags; /* Read-only */
GAL_PixelFormat *format; /* Read-only */
void *video; /* Read-only */
int w, h; /* Read-only */
void *video; /* Read-only */
GAL_PixelFormat *format; /* Read-only */
Uint32 flags; /* Read-only */
Uint32 pixels_off; /* Read-only; since 5.0.0, replace old offset */
int w, h; /* Read-only */
/* VW[2018-01-18]: For 64b, use signed int instead of Uint32 for pitch. */
int pitch; /* Read-only */
int dpi; /* Read-only */
void *pixels; /* Read-write */
int offset; /* Private */
int pitch; /* Read-only */
int dpi; /* Read-only */
void *pixels; /* Read-write */
/* Hardware-specific surface info */
struct private_hwdata *hwdata;
@@ -231,8 +238,7 @@ typedef struct GAL_Surface {
/* Evaluates to true if the surface needs to be locked before access */
#define GAL_MUSTLOCK(surface) \
(surface->offset || \
((surface->flags & (GAL_HWSURFACE|GAL_ASYNCBLIT|GAL_RLEACCEL)) != 0))
((surface->flags & (GAL_HWSURFACE|GAL_ASYNCBLIT|GAL_RLEACCEL)) != 0)
/* Useful for determining the video hardware capabilities */
typedef struct {
@@ -958,6 +964,34 @@ BYTE* gal_PutPixelKeyAlpha (GAL_Surface* dst,
#define mg_TerminateGAL GAL_VideoQuit
#ifdef _MGRM_PROCESSES
/* Since 5.0.0: copy video information to the shared resource */
BOOL GAL_CopyVideoInfoToSharedRes (void);
/* Since 5.0.0: create/attach a surface in/to named shared memory */
GAL_Surface * GAL_CreateRGBSurfaceInShm (const char* shm_name, BOOL create,
Uint32 rw_modes, Uint32 hdr_size, int width, int height, int depth,
Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask);
#endif /* _MGRM_PROCESSES */
#ifdef _MGGAL_DRM
/* functions implemented in DRM engine. */
BOOL __drm_get_surface_info (GAL_Surface *surface, DrmSurfaceInfo* info);
GAL_Surface* __drm_create_surface_from_name (GHANDLE video,
uint32_t name, uint32_t drm_format, uint32_t pixels_off,
uint32_t width, uint32_t height, uint32_t pitch);
GAL_Surface* __drm_create_surface_from_handle (GHANDLE video,
uint32_t handle, size_t size, uint32_t drm_format, uint32_t pixels_off,
uint32_t width, uint32_t height, uint32_t pitch);
GAL_Surface* __drm_create_surface_from_prime_fd (GHANDLE video,
int prime_fd, size_t size, uint32_t drm_format, uint32_t pixels_off,
uint32_t width, uint32_t height, uint32_t pitch);
#endif /* defined _MGGAL_DRM */
#ifdef __cplusplus
}
#endif /* __cplusplus */
+12 -5
View File
@@ -102,10 +102,13 @@ typedef struct tagG_RES {
char video_engine [LEN_ENGINE_NAME + 1];
char video_mode [LEN_VIDEO_MODE + 1];
char video_device [LEN_DEVICE_NAME + 1];
char video_exdriver [LEN_EXDRIVER_NAME + 1];
char video_fourcc [LEN_FOURCC_FORMAT + 1];
int video_dpi, video_hres, video_vres, video_depth;
Uint32 video_rmask, video_gmask, video_bmask, video_amask;
#ifdef _MGGAL_DRM
char video_exdriver [LEN_EXDRIVER_NAME + 1];
Uint32 video_drm_format;
Uint32 video_dbl_buff:1;
#endif
int nr_layers;
int semid_layer;
@@ -168,8 +171,6 @@ typedef G_RES* PG_RES;
#define SHAREDRES_VIDEO_ENGINE (((PG_RES)mgSharedRes)->video_engine)
#define SHAREDRES_VIDEO_MODE (((PG_RES)mgSharedRes)->video_mode)
#define SHAREDRES_VIDEO_DEVICE (((PG_RES)mgSharedRes)->video_device)
#define SHAREDRES_VIDEO_FOURCC (((PG_RES)mgSharedRes)->video_fourcc)
#define SHAREDRES_VIDEO_EXDRIVER (((PG_RES)mgSharedRes)->video_exdriver)
#define SHAREDRES_VIDEO_DPI (((PG_RES)mgSharedRes)->video_dpi)
#define SHAREDRES_VIDEO_HRES (((PG_RES)mgSharedRes)->video_hres)
#define SHAREDRES_VIDEO_VRES (((PG_RES)mgSharedRes)->video_vres)
@@ -179,6 +180,12 @@ typedef G_RES* PG_RES;
#define SHAREDRES_VIDEO_BMASK (((PG_RES)mgSharedRes)->video_bmask)
#define SHAREDRES_VIDEO_AMASK (((PG_RES)mgSharedRes)->video_amask)
#ifdef _MGGAL_DRM
#define SHAREDRES_VIDEO_EXDRIVER (((PG_RES)mgSharedRes)->video_exdriver)
#define SHAREDRES_VIDEO_DRM_FORMAT (((PG_RES)mgSharedRes)->video_drm_format)
#define SHAREDRES_VIDEO_DBL_BUFF (((PG_RES)mgSharedRes)->video_dbl_buff)
#endif
#define SHAREDRES_TIMER_COUNTER (((PG_RES)mgSharedRes)->timer_counter)
#define SHAREDRES_TICK_ON_LOCKSEM (((PG_RES)mgSharedRes)->tick_on_locksem)
#define SHAREDRES_TIMEOUT (((PG_RES)mgSharedRes)->timeout)
@@ -205,7 +212,7 @@ typedef G_RES* PG_RES;
# define SHAREDRES_SEMID_SHARED_SURF (((PG_RES)mgSharedRes)->semid_shared_surf)
#endif
#define SHAREDRES_NR_GLOBALS (((PG_RES)mgSharedRes)->nr_globals)
#define SHAREDRES_NR_GLOBALS (((PG_RES)mgSharedRes)->nr_globals)
#define SHAREDRES_DEF_NR_TOPMOSTS (((PG_RES)mgSharedRes)->def_nr_topmosts)
#define SHAREDRES_DEF_NR_NORMALS (((PG_RES)mgSharedRes)->dev_nr_normals)
+124 -99
View File
@@ -67,12 +67,17 @@
#define SIZE_CLIPRC_HEAP 64
#define DIRTY_ZT_PPP 0x01
#define DIRTY_ZT_WIN 0x02
#define DIRTY_ZT_WPP 0x04
struct _CompositorCtxt {
RECT rc_screen; // screen rect - avoid duplicated GetScreenRect calls
BLOCKHEAP cliprc_heap;// heap for clipping rects
CLIPRGN wins_rgn; // visible region for all windows (subtract popup menus)
CLIPRGN dirty_rgn; // the dirty region
CLIPRGN inv_rgn; // the invalid region for a specific znode
Uint32 dirty_types;// the dirty znode types.
};
static CompositorCtxt* initialize (const char* name)
@@ -256,30 +261,6 @@ static inline void tile_dirty_region_for_wallpaper (CompositorCtxt* ctxt)
}
}
static BOOL generate_dirty_region (CompositorCtxt* ctxt,
const ZNODEHEADER* znode_hdr, const CLIPRGN* znode_rgn)
{
EmptyClipRgn (&ctxt->dirty_rgn);
if (znode_hdr && znode_hdr->dirty_rcs) {
int i;
for (i = 0; i < znode_hdr->nr_dirty_rcs; i++) {
RECT rc;
// device coordinates to screen coordinates
rc = znode_hdr->dirty_rcs [i];
OffsetRect (&rc, znode_hdr->rc.left, znode_hdr->rc.top);
AddClipRect (&ctxt->dirty_rgn, &rc);
}
if (znode_rgn)
IntersectRegion (&ctxt->dirty_rgn, &ctxt->dirty_rgn, znode_rgn);
else
IntersectClipRect (&ctxt->dirty_rgn, &ctxt->rc_screen);
}
return !IsEmptyClipRgn (&ctxt->dirty_rgn);
}
static void composite_wallpaper_rect (CompositorCtxt* ctxt,
const RECT* dirty_rc)
{
@@ -300,6 +281,8 @@ static void composite_wallpaper_rect (CompositorCtxt* ctxt,
RECT eff_rc;
if (IntersectRect (&eff_rc, dirty_rc, &rc)) {
SelectClipRect (HDC_SCREEN_SYS, &eff_rc);
SetMemDCColorKey (HDC_SCREEN, 0, 0);
SetMemDCAlpha (HDC_SCREEN, 0, 0);
BitBlt (HDC_SCREEN, 0, 0, RECTW (rc), RECTH (rc),
HDC_SCREEN_SYS, rc.left, rc.top, 0);
}
@@ -351,9 +334,11 @@ static void composite_ppp_znodes (CompositorCtxt* ctxt)
ClipRgnIntersect (&ctxt->inv_rgn, &ctxt->dirty_rgn, rgn);
if (IsEmptyClipRgn (&ctxt->inv_rgn)) {
ServerReleasePopupMenuZNodeHeader (zidx);
break;
_DBG_PRINTF ("ppp %d skipped\n", zidx);
continue;
}
else {
_DBG_PRINTF ("ppp %d composited\n", zidx);
// blit this popup menu to screen
SelectClipRegion (HDC_SCREEN_SYS, &ctxt->inv_rgn);
BitBlt (znode_hdr->mem_dc, 0, 0,
@@ -423,6 +408,7 @@ static void composite_all_lucent_win_znodes_above (CompositorCtxt* ctxt,
switch (znode_hdr->ct & CT_SYSTEM_MASK) {
case CT_COLORKEY:
SetMemDCAlpha (znode_hdr->mem_dc, 0, 0);
SetMemDCColorKey (znode_hdr->mem_dc,
MEMDC_FLAG_SRCCOLORKEY,
DWORD2Pixel (znode_hdr->mem_dc, znode_hdr->ct_arg));
@@ -439,6 +425,7 @@ static void composite_all_lucent_win_znodes_above (CompositorCtxt* ctxt,
break;
case CT_ALPHAPIXEL:
SetMemDCColorKey (znode_hdr->mem_dc, 0, 0);
SetMemDCAlpha (znode_hdr->mem_dc,
MEMDC_FLAG_SRCPIXELALPHA, 0);
break;
@@ -526,63 +513,6 @@ static void composite_on_dirty_region (CompositorCtxt* ctxt, int from)
SyncUpdateDC (HDC_SCREEN_SYS);
}
static void on_dirty_win (CompositorCtxt* ctxt, MG_Layer* layer, int zidx)
{
const ZNODEHEADER* znode_hdr = NULL;
CLIPRGN *rgn;
/* the fallback compositor only manages znodes on the topmost layer. */
if (layer != mgTopmostLayer || zidx <= 0)
return;
_DBG_PRINTF("called: %d\n", zidx);
/* generate the dirty region */
znode_hdr = ServerGetWinZNodeHeader (NULL, zidx, (void**)&rgn, TRUE);
assert (znode_hdr);
if (generate_dirty_region (ctxt, znode_hdr, rgn)) {
if (znode_hdr->changes == 0) {
/* It's the first exposure of the window. */
_MG_PRINTF ("It is the first exposure of the window (%d): %u\n",
zidx, znode_hdr->dirty_age);
}
if (IsEmptyClipRgn (&ctxt->dirty_rgn)) {
goto ret;
}
composite_on_dirty_region (ctxt, zidx);
}
ret:
ServerReleaseWinZNodeHeader (NULL, zidx);
}
static void on_dirty_wpp (CompositorCtxt* ctxt)
{
const ZNODEHEADER* znode_hdr;
//_DBG_PRINTF ("called\n");
znode_hdr = ServerGetWinZNodeHeader (NULL, 0, NULL, TRUE);
assert (znode_hdr);
if (generate_dirty_region (ctxt, znode_hdr, NULL)) {
tile_dirty_region_for_wallpaper (ctxt);
subtract_opaque_win_znodes_above (ctxt, 0);
//subtract_opaque_ppp_znodes (ctxt);
if (IsEmptyClipRgn (&ctxt->dirty_rgn)) {
goto ret;
}
composite_on_dirty_region (ctxt, 0);
}
ret:
ServerReleaseWinZNodeHeader (NULL, 0);
}
static void rebuild_wins_region (CompositorCtxt* ctxt)
{
int i, nr_ppps;
@@ -679,29 +609,122 @@ static void on_showing_ppp (CompositorCtxt* ctxt, int zidx)
SubtractRegion (&ctxt->wins_rgn, &ctxt->wins_rgn, rgn);
}
static void on_dirty_ppp (CompositorCtxt* ctxt, int zidx)
static BOOL reset_dirty_region (CompositorCtxt* ctxt, MG_Layer* layer)
{
if (layer != mgTopmostLayer)
return FALSE;
ctxt->dirty_types = 0;
EmptyClipRgn (&ctxt->dirty_rgn);
return TRUE;
}
static BOOL merge_dirty_region (CompositorCtxt* ctxt,
const ZNODEHEADER* znode_hdr, const CLIPRGN* znode_rgn)
{
EmptyClipRgn (&ctxt->inv_rgn);
if (znode_hdr && znode_hdr->dirty_rcs) {
int i;
for (i = 0; i < znode_hdr->nr_dirty_rcs; i++) {
RECT rc;
// device coordinates to screen coordinates
rc = znode_hdr->dirty_rcs [i];
OffsetRect (&rc, znode_hdr->rc.left, znode_hdr->rc.top);
AddClipRect (&ctxt->inv_rgn, &rc);
}
if (znode_rgn)
IntersectRegion (&ctxt->inv_rgn, &ctxt->inv_rgn, znode_rgn);
else
IntersectClipRect (&ctxt->inv_rgn, &ctxt->rc_screen);
}
if (IsEmptyClipRgn (&ctxt->inv_rgn)) {
return FALSE;
}
UnionRegion (&ctxt->dirty_rgn, &ctxt->dirty_rgn, &ctxt->inv_rgn);
EmptyClipRgn (&ctxt->inv_rgn);
return TRUE;
}
static BOOL merge_dirty_ppp (CompositorCtxt* ctxt, MG_Layer* layer, int zidx)
{
BOOL rc = FALSE;
const ZNODEHEADER* znode_hdr;
CLIPRGN* rgn;
_DBG_PRINTF ("called\n");
_DBG_PRINTF("called: %d\n", zidx);
/* the fallback compositor only manages znodes on the topmost layer. */
if (layer != mgTopmostLayer)
return rc;
znode_hdr = ServerGetPopupMenuZNodeHeader (zidx, (void**)&rgn, TRUE);
assert (znode_hdr);
assert (rgn);
if (generate_dirty_region (ctxt, znode_hdr, rgn)) {
SelectClipRegion (HDC_SCREEN_SYS, &ctxt->dirty_rgn);
BitBlt (znode_hdr->mem_dc, 0, 0,
RECTW (znode_hdr->rc), RECTH (znode_hdr->rc),
HDC_SCREEN_SYS, znode_hdr->rc.left, znode_hdr->rc.top, 0);
SelectClipRect (HDC_SCREEN_SYS, &ctxt->rc_screen);
EmptyClipRgn (&ctxt->dirty_rgn);
if (merge_dirty_region (ctxt, znode_hdr, rgn)) {
ctxt->dirty_types |= DIRTY_ZT_PPP;
rc = TRUE;
}
ServerReleasePopupMenuZNodeHeader (zidx);
return rc;
}
static BOOL merge_dirty_win (CompositorCtxt* ctxt, MG_Layer* layer, int zidx)
{
BOOL rc = FALSE;
const ZNODEHEADER* znode_hdr = NULL;
CLIPRGN *rgn;
/* the fallback compositor only manages znodes on the topmost layer. */
if (layer != mgTopmostLayer)
return rc;
_DBG_PRINTF("called: %d\n", zidx);
/* merge the dirty region */
znode_hdr = ServerGetWinZNodeHeader (NULL, zidx, (void**)&rgn, TRUE);
if (merge_dirty_region (ctxt, znode_hdr, rgn)) {
ctxt->dirty_types |= DIRTY_ZT_WIN;
rc = TRUE;
}
ServerReleaseWinZNodeHeader (NULL, zidx);
return rc;
}
static BOOL merge_dirty_wpp (CompositorCtxt* ctxt, MG_Layer* layer)
{
BOOL rc = FALSE;
const ZNODEHEADER* znode_hdr;
znode_hdr = ServerGetWinZNodeHeader (NULL, 0, NULL, TRUE);
if (merge_dirty_region (ctxt, znode_hdr, NULL)) {
tile_dirty_region_for_wallpaper (ctxt);
//subtract_opaque_win_znodes_above (ctxt, 0);
ctxt->dirty_types |= DIRTY_ZT_WPP;
rc = TRUE;
}
ServerReleaseWinZNodeHeader (NULL, 0);
return rc;
}
BOOL refresh_dirty_region (CompositorCtxt* ctxt, MG_Layer* layer)
{
/* the fallback compositor only manages znodes on the topmost layer. */
if (layer != mgTopmostLayer || IsEmptyClipRgn (&ctxt->dirty_rgn))
return FALSE;
if (ctxt->dirty_types & DIRTY_ZT_PPP)
composite_ppp_znodes (ctxt);
composite_on_dirty_region (ctxt, 0);
EmptyClipRgn (&ctxt->dirty_rgn);
SyncUpdateDC (HDC_SCREEN_SYS);
return TRUE;
}
static void on_hiding_ppp (CompositorCtxt* ctxt, int zidx)
@@ -903,9 +926,11 @@ CompositorOps __mg_fallback_compositor = {
calc_mainwin_pos: calc_mainwin_pos,
purge_ppp_data: purge_ppp_data,
purge_win_data: purge_win_data,
on_dirty_ppp: on_dirty_ppp,
on_dirty_win: on_dirty_win,
on_dirty_wpp: on_dirty_wpp,
reset_dirty_region: reset_dirty_region,
merge_dirty_ppp: merge_dirty_ppp,
merge_dirty_win: merge_dirty_win,
merge_dirty_wpp: merge_dirty_wpp,
refresh_dirty_region: refresh_dirty_region,
on_dirty_screen: on_dirty_screen,
on_showing_ppp: on_showing_ppp,
on_hiding_ppp: on_hiding_ppp,
+134 -2
View File
@@ -88,8 +88,11 @@ static const CompositorOps* load_default_compositor (void)
{
const char* filename = NULL;
char buff [LEN_SO_NAME + 1];
const CompositorOps* (*ex_compsor_get) (const char*, const CompositorOps*);
const CompositorOps* (*ex_compsor_get) (const char*,
const CompositorOps*, int*);
char* error;
const CompositorOps* ops;
int version = 0;
filename = getenv ("MG_DEF_COMPOSITOR_SO");
if (filename == NULL) {
@@ -117,7 +120,13 @@ static const CompositorOps* load_default_compositor (void)
return NULL;
}
return ex_compsor_get (COMPSOR_NAME_DEFAULT, &__mg_fallback_compositor);
ops = ex_compsor_get (COMPSOR_NAME_DEFAULT,
&__mg_fallback_compositor, &version);
if (ops == NULL || version != COMPSOR_OPS_VERSION)
return NULL;
return ops;
}
static void lock_znode_surface (PDC pdc, ZORDERNODE* node)
@@ -151,6 +160,7 @@ static void unlock_znode_surface (PDC pdc, ZORDERNODE* node)
}
}
#if 0 /* not optimized */
void __mg_composite_dirty_znodes (void)
{
MG_Layer* layer;
@@ -245,6 +255,128 @@ void __mg_composite_dirty_znodes (void)
}
}
#else /* not optimized */
static void composite_layer (MG_Layer* layer, CompositorCtxt* ctxt,
const CompositorOps* ops)
{
ZORDERINFO* zi;
ZORDERNODE* nodes;
int i, next;
unsigned int changes_in_dc;
PDC pdc;
zi = (ZORDERINFO*)layer->zorder_info;
if (!ops->reset_dirty_region (ctxt, layer))
return;
/* travel menu znodes on the layer;
this will only work for topmost layer */
if (layer == mgTopmostLayer && zi->nr_popupmenus > 0) {
nodes = GET_MENUNODE(zi);
for (i = 0; i < zi->nr_popupmenus; i++) {
pdc = dc_HDC2PDC (nodes[i].mem_dc);
assert (pdc->surface->dirty_info);
lock_znode_surface (pdc, nodes + i);
changes_in_dc = pdc->surface->dirty_info->dirty_age;
if (changes_in_dc != nodes[i].changes) {
ops->merge_dirty_ppp (ctxt, layer, i);
}
}
}
/* travel win znodes on the layer */
nodes = GET_ZORDERNODE(zi);
next = 0;
while ((next = __kernel_get_next_znode (zi, next)) > 0) {
if (nodes [next].flags & ZOF_VISIBLE) {
pdc = dc_HDC2PDC (nodes[next].mem_dc);
assert (pdc->surface->dirty_info);
lock_znode_surface (pdc, nodes + next);
changes_in_dc = pdc->surface->dirty_info->dirty_age;
if (changes_in_dc != nodes[next].changes) {
ops->merge_dirty_win (ctxt, layer, next);
}
}
}
/* check wallpaper pattern; only call for topmost layer */
if (layer == mgTopmostLayer) {
pdc = dc_HDC2PDC (HDC_SCREEN);
if (pdc->surface->w > 0 && pdc->surface->h > 0) {
assert (pdc->surface->dirty_info);
lock_znode_surface (pdc, nodes);
changes_in_dc = pdc->surface->dirty_info->dirty_age;
if (changes_in_dc != nodes[0].changes) {
ops->merge_dirty_wpp (ctxt, layer);
}
}
}
ops->refresh_dirty_region (ctxt, layer);
/* unlock the znode surfaces for popup menus */
if (layer == mgTopmostLayer && zi->nr_popupmenus > 0) {
nodes = GET_MENUNODE(zi);
for (i = 0; i < zi->nr_popupmenus; i++) {
pdc = dc_HDC2PDC (nodes[i].mem_dc);
nodes[i].changes = pdc->surface->dirty_info->dirty_age;
pdc->surface->dirty_info->nr_dirty_rcs = 0;
unlock_znode_surface (pdc, nodes + i);
}
}
/* unlock the znode surfaces for windows */
nodes = GET_ZORDERNODE(zi);
next = 0;
while ((next = __kernel_get_next_znode (zi, next)) > 0) {
if (nodes [next].flags & ZOF_VISIBLE) {
pdc = dc_HDC2PDC (nodes[next].mem_dc);
nodes[next].changes = pdc->surface->dirty_info->dirty_age;
pdc->surface->dirty_info->nr_dirty_rcs = 0;
unlock_znode_surface (pdc, nodes + next);
}
}
/* unlock the znode surfaces for wallpaper pattern;
only for topmost layer */
if (layer == mgTopmostLayer) {
pdc = dc_HDC2PDC (HDC_SCREEN);
if (pdc->surface->w > 0 && pdc->surface->h > 0) {
nodes[0].changes = pdc->surface->dirty_info->dirty_age;
pdc->surface->dirty_info->nr_dirty_rcs = 0;
unlock_znode_surface (pdc, nodes);
}
}
}
void __mg_composite_dirty_znodes (void)
{
MG_Layer* layer;
CompositorCtxt* ctxt;
const CompositorOps* ops = ServerSelectCompositor (NULL, &ctxt);
assert (ops);
/* first handle the topmost layer */
composite_layer (mgTopmostLayer, ctxt, ops);
/* then handle other layers */
layer = mgLayers;
while (layer) {
if (layer != mgTopmostLayer) {
composite_layer (layer, ctxt, ops);
}
layer = layer->next;
}
}
#endif /* optimized */
static void purge_znodes_private_data_in_layer (const CompositorOps* ops,
CompositorCtxt* ctxt, MG_Layer* layer)
{
+37 -46
View File
@@ -80,7 +80,6 @@
#include "drawsemop.h"
#include "readbmp.h"
static int oldx = -1, oldy;
static RECT cliprc = {0, 0, 0, 0};
#ifdef _MGHAVE_CURSOR
@@ -903,6 +902,7 @@ HCURSOR GUIAPI GetDefaultCursor (void)
/* The return value indicates whether mouse has moved. */
/* TRUE for moved. */
/* NOTE that only server can call this function. */
/* Since 5.0.0, this function only changes the cursor position */
BOOL kernel_RefreshCursor (int* x, int* y, int* button)
{
int curx, cury;
@@ -912,51 +912,14 @@ BOOL kernel_RefreshCursor (int* x, int* y, int* button)
return FALSE;
IAL_GetMouseXY (x, y);
SHAREDRES_MOUSEX = curx = *x;
SHAREDRES_MOUSEY = cury = *y;
curx = *x;
cury = *y;
if (button)
SHAREDRES_BUTTON = *button = IAL_GetMouseButton ();
if (oldx != curx || oldy != cury) {
#ifdef _MGHAVE_CURSOR
#ifdef _MGSCHEMA_SHAREDFB
LOCK_CURSOR_SEM ();
CSR_CURSORX = curx;
CSR_CURSORY = cury;
if (CSR_SHOW_COUNT >= 0 && CSR_CURRENT) {
if (get_hidecursor_sem_val ()) {
reset_hidecursor_sem ();
}
else {
hidecursor ();
}
showcursor ();
GAL_SyncUpdate (__gal_screen);
}
// GAL_SyncUpdate (__gal_screen);
UNLOCK_CURSOR_SEM ();
#else /* _MGSCHEMA_SHAREDFB */
CSR_CURSORX = curx;
CSR_CURSORY = cury;
if (CSR_SHOW_COUNT >= 0 && CSR_CURRENT) {
if (csr_bmp.bmBits) {
hidecursor ();
showcursor ();
GAL_SyncUpdate (__gal_screen);
}
else {
PCURSOR pcsr = (PCURSOR)CSR_CURRENT;
GAL_MoveCursor (pcsr->surface, curx, cury);
}
}
#endif /* _MGSCHEMA_COMPOSITING */
#endif /* _MGHAVE_CURSOR */
oldx = curx;
oldy = cury;
if (SHAREDRES_MOUSEX != curx || SHAREDRES_MOUSEY != cury) {
SHAREDRES_MOUSEX = curx;
SHAREDRES_MOUSEY = cury;
moved = TRUE;
}
@@ -965,21 +928,49 @@ BOOL kernel_RefreshCursor (int* x, int* y, int* button)
#ifdef _MGHAVE_CURSOR
#ifdef _MGSCHEMA_SHAREDFB
/* show cursor hidden by client GDI function */
/* Change cursor position and show cursor hidden by client GDI function */
void kernel_ReShowCursor (void)
{
#ifdef _MGSCHEMA_SHAREDFB
LOCK_CURSOR_SEM ();
if (CSR_SHOW_COUNT >= 0 && CSR_CURRENT) {
if (get_hidecursor_sem_val ()) {
reset_hidecursor_sem ();
showcursor ();
GAL_SyncUpdate (__gal_screen);
}
else if (CSR_CURSORX != SHAREDRES_MOUSEX ||
CSR_CURSORY != SHAREDRES_MOUSEY) {
CSR_CURSORX = SHAREDRES_MOUSEX;
CSR_CURSORY = SHAREDRES_MOUSEY;
hidecursor ();
showcursor ();
GAL_SyncUpdate (__gal_screen);
}
}
UNLOCK_CURSOR_SEM ();
#else /* _MGSCHEMA_SHAREDFB */
if (CSR_SHOW_COUNT >= 0 && CSR_CURRENT &&
(CSR_CURSORX != SHAREDRES_MOUSEX ||
CSR_CURSORY != SHAREDRES_MOUSEY)) {
CSR_CURSORX = SHAREDRES_MOUSEX;
CSR_CURSORY = SHAREDRES_MOUSEY;
if (csr_bmp.bmBits) {
hidecursor ();
showcursor ();
GAL_SyncUpdate (__gal_screen);
}
else {
PCURSOR pcsr = (PCURSOR)CSR_CURRENT;
GAL_MoveCursor (pcsr->surface, CSR_CURSORX, CSR_CURSORY);
}
}
#endif /* _MGSCHEMA_COMPOSITING */
}
#endif /* defined _MGSCHEMA_SHAREDFB */
/* Always call with "setdef = FALSE" for clients at server side. */
HCURSOR GUIAPI SetCursorEx (HCURSOR hcsr, BOOL setdef)
+44 -31
View File
@@ -298,8 +298,10 @@ static int update_client_window_rgn (int cli, HWND hwnd)
msg.lParam = MAKELONG (crc->rc.right, crc->rc.bottom);
ret = __mg_send2client (&msg, mgClients + cli);
if (ret < 0)
if (ret < 0) {
_WRN_PRINTF ("__mg_send2client failed\n");
break;
}
crc = crc->next;
}
@@ -357,8 +359,7 @@ static intptr_t cliAllocZOrderNode (PMAINWIN pWin, const COMPOSITINGINFO* ct_inf
assert (pWin->surf && pWin->surf->shared_header);
info.surf_flags = pWin->surf->flags;
info.surf_size = pWin->surf->shared_header->buf_size;
info.surf_size += sizeof (*pWin->surf->shared_header);
info.surf_size = pWin->surf->shared_header->map_size;
if (ct_info) {
info.ct = ct_info->type;
@@ -474,8 +475,7 @@ static intptr_t cliMoveWindow (PMAINWIN pWin, const RECT* rcWin, int fd)
#ifdef _MGSCHEMA_COMPOSITING
info.surf_flags = pWin->surf->flags;
info.surf_size = pWin->surf->shared_header->buf_size;
info.surf_size += sizeof (*pWin->surf->shared_header);
info.surf_size = pWin->surf->shared_header->map_size;
#endif
if (ClientRequestEx2 (&req, NULL, 0, fd,
@@ -529,8 +529,7 @@ static intptr_t cliStartTrackPopupMenu (PTRACKMENUINFO ptmi)
assert (surf->shared_header);
info.surf_flags = surf->flags;
info.surf_size = surf->shared_header->buf_size;
info.surf_size += sizeof (*surf->shared_header);
info.surf_size = surf->shared_header->map_size;
if (ClientRequestEx2 (&req, NULL, 0, surf->shared_header->fd,
&ret, sizeof (intptr_t), NULL) < 0)
return -1;
@@ -818,6 +817,9 @@ static int srvAllocZOrderNode (int cli, HWND hwnd, HWND main_win,
if (cli == 0) {
PMAINWIN pwin = (PMAINWIN)hwnd;
surf = pwin->surf;
// prevent to free this surface when deleting memdc for znode.
surf->refcount++;
}
else if (fd >= 0) {
surf = GAL_AttachSharedRGBSurface (fd, surf_size, surf_flags, TRUE);
@@ -866,16 +868,25 @@ static BOOL _cb_update_cli_znode (void* context,
if (znode->cli == cli && znode->flags & ZOF_VISIBLE && znode->hwnd) {
MSG msg = {znode->hwnd, MSG_UPDATECLIWIN, 0, 0, __mg_tick_counter};
if (!IsRectEmpty(&(znode->dirty_rc))) {
if (!IsRectEmpty(&znode->dirty_rc)) {
IntersectRect(&rcInv, &znode->dirty_rc, &rcScr);
if (IntersectRect(&rcScr, &znode->rc, &rcScr) &&
IntersectRect(&rcInv, &znode->dirty_rc, &rcScr)) {
rcInv = znode->dirty_rc;
msg.wParam = MAKELONG (rcInv.left, rcInv.top);
msg.lParam = MAKELONG (rcInv.right, rcInv.bottom);
msg.wParam = MAKELONG (rcInv.left, rcInv.top);
msg.lParam = MAKELONG (rcInv.right, rcInv.bottom);
_DBG_PRINTF ("Send MSG_UPDATECLIWIN to client window (%s): "
"%d, %d, %d x %d\n",
znode->caption,
rcInv.left, rcInv.top,
rcInv.right - rcInv.left,
rcInv.bottom - rcInv.top);
SetRectEmpty (&(znode->dirty_rc));
__mg_send2client (&msg, mgClients + znode->cli);
}
__mg_send2client (&msg, mgClients + znode->cli);
SetRectEmpty (&znode->dirty_rc);
return TRUE;
}
}
@@ -964,28 +975,31 @@ static int srvMoveWindow (int cli, int idx_znode, const RECT* rcWin,
if (cli == 0) {
PMAINWIN pwin = (PMAINWIN)hwnd;
surf = pwin->surf;
// prevent to free this surface when deleting memdc for znode.
surf->refcount++;
}
else {
surf = GAL_AttachSharedRGBSurface (fd, surf_size, surf_flags, TRUE);
close (fd);
}
}
if (surf) {
memdc = CreateMemDCFromSurface (surf);
if (memdc == HDC_INVALID) {
if (cli > 0) {
GAL_FreeSurface (surf);
if (surf) {
memdc = CreateMemDCFromSurface (surf);
if (memdc == HDC_INVALID) {
if (cli > 0) {
GAL_FreeSurface (surf);
}
_ERR_PRINTF("KERNEL: failed to create new memory dc for znode\n");
return -1;
}
_ERR_PRINTF("KERNEL: failed to create new memory dc for znode\n");
}
else {
_ERR_PRINTF("KERNEL: failed to attach to shared surface\n");
return -1;
}
}
else if (fd >= 0) {
_ERR_PRINTF("KERNEL: failed to attach to shared surface\n");
return -1;
}
#endif /* def _MGSCHEMA_COMPOSITING */
ret = dskMoveWindow (cli, idx_znode, memdc, rcWin);
@@ -1197,6 +1211,7 @@ static int do_drag_drop_window (int msg, int x, int y)
#ifndef _MGSCHEMA_COMPOSITING
FocusRect (HDC_SCREEN_SYS, _dd_info.rc.left, _dd_info.rc.top,
_dd_info.rc.right, _dd_info.rc.bottom);
SyncUpdateDC (HDC_SCREEN_SYS);
#else /* not defined _MGSCHEMA_COMPOSITING */
msg.wParam = MAKELONG (_dd_info.rc.left, _dd_info.rc.top);
@@ -1224,6 +1239,7 @@ static int do_drag_drop_window (int msg, int x, int y)
SetPenColor (HDC_SCREEN_SYS, PIXEL_lightwhite);
FocusRect (HDC_SCREEN_SYS, _dd_info.rc.left, _dd_info.rc.top,
_dd_info.rc.right, _dd_info.rc.bottom);
SyncUpdateDC (HDC_SCREEN_SYS);
#endif /* not defined _MGSCHEMA_COMPOSITING */
/* post MSG_WINDOWDROPPED to the target window */
@@ -3677,9 +3693,7 @@ static int srvDesktopCommand (int id)
unlock_zi_for_read (__mg_zorder_info);
}
else if (id == IDM_ENDSESSION) {
if (SERVER_HAS_NO_MAINWINDOW()) {
ExitGUISafely (-1);
}
SendMessage (HWND_DESKTOP, MSG_ENDSESSION, 0, 0);
}
#ifdef _MGHAVE_MENU
else if (id >= IDM_FIRSTWINDOW && id < IDM_SWITCH_LAYER) {
@@ -4094,10 +4108,8 @@ static int srvSesseionMessageHandler (int message, WPARAM wParam, LPARAM lParam)
break;
case MSG_ERASEDESKTOP:
if (dsk_ops->paint_desktop)
dsk_ops->paint_desktop(dt_context, hDesktopDC, (PRECT)lParam);
break;
case MSG_DT_KEYLONGPRESS:
@@ -4114,6 +4126,7 @@ static int srvSesseionMessageHandler (int message, WPARAM wParam, LPARAM lParam)
#ifdef _MGHAVE_MENU
case MSG_DT_RBUTTONUP:
if (sg_DesktopMenu)
srvUpdateDesktopMenu ();
#endif
case MSG_DT_LBUTTONDOWN:
@@ -4375,7 +4388,7 @@ static LRESULT DesktopWinProc (HWND hWnd, UINT message,
/* Since 5.0.0 */
case MSG_CALC_POSITION:
if (mgIsServer) {
dskCalculateDefaultPosition (0, (CALCPOSINFO*)lParam);
dskCalculateDefaultPosition ((int)wParam, (CALCPOSINFO*)lParam);
return 0;
}
else
+51 -30
View File
@@ -188,7 +188,7 @@ static BOOL subtract_rgn_by_node (PCLIPRGN region, const ZORDERINFO* zi,
else
SubtractClipRect(region, &(node->rc));
return TRUE;
return TRUE; // !IsEmptyClipRgn(region); We must return TRUE for this callback.
}
#else /* not defined _MGSCHEMA_COMPOSITING */
@@ -427,15 +427,18 @@ void __mg_update_window (HWND hwnd,
((pWin->WinType == TYPE_CONTROL &&
(pWin->dwExStyle & WS_EX_CTRLASMAINWIN)) ||
pWin->WinType != TYPE_CONTROL) && pWin->dwStyle & WS_VISIBLE) {
RECT invrc;
SetRect(&invrc, left, top, right, bottom);
RECT rcInv;
SetRect(&rcInv, left, top, right, bottom);
if (IsRectEmpty (&invrc)) {
_DBG_PRINTF ("Update window (%s): %d, %d, %d, %d\n",
pWin->spCaption, left, top, right, bottom);
if (IsRectEmpty (&rcInv)) {
SendAsyncMessage ((HWND)pWin, MSG_NCPAINT, 0, 0);
InvalidateRect ((HWND)pWin, NULL, TRUE);
}
else {
RECT rcTemp, rcInv, rcWin;
RECT rcTemp, rcWin;
if (pWin->WinType == TYPE_CONTROL &&
(pWin->dwExStyle & WS_EX_CTRLASMAINWIN)){
@@ -444,13 +447,18 @@ void __mg_update_window (HWND hwnd,
else
GetWindowRect(hwnd, &rcWin);
if (IntersectRect (&rcTemp,
&rcWin, &invrc)) {
/* XXX: when we move a window fast, there are some dirty rectangles
were not updated. We update whole area of the window for a work
around. */
if (IntersectRect (&rcTemp, &rcWin, &rcInv)) {
dskScreenToWindow (pWin, &rcTemp, &rcInv);
SendAsyncMessage ((HWND)pWin,
MSG_NCPAINT, 0, (LPARAM)(&rcInv));
MSG_NCPAINT, 0, 0); // (LPARAM)(&rcInv));
dskScreenToClient (pWin, &rcTemp, &rcInv);
InvalidateRect ((HWND)pWin, &rcInv, TRUE);
InvalidateRect ((HWND)pWin, NULL/*&rcInv*/, TRUE);
}
else {
_DBG_PRINTF ("IGNORED update\n");
}
}
}
@@ -465,6 +473,9 @@ static int update_client_window (ZORDERNODE* znode, const RECT* rc)
if (znode->cli != 0) {
if (rc) {
_DBG_PRINTF ("Update window (%s): %d, %d, %d x %d\n",
znode->caption, rc->left, rc->top,
RECTWP(rc), RECTHP(rc));
if (IsRectEmpty (&znode->dirty_rc)) {
SetRect (&znode->dirty_rc,
@@ -473,8 +484,8 @@ static int update_client_window (ZORDERNODE* znode, const RECT* rc)
else {
GetBoundRect (&znode->dirty_rc, &znode->dirty_rc, rc);
}
mgClients [znode->cli].has_dirty = TRUE;
}
mgClients [znode->cli].has_dirty = TRUE;
}
else
#endif /* defined _MGRM_PROCESSES */
@@ -494,7 +505,13 @@ static BOOL _cb_update_znode (void* context,
{
const RECT* rc = (RECT*)context;
if (znode->flags & ZOF_VISIBLE && znode->flags & ZOF_IF_REFERENCE) {
_DBG_PRINTF ("Checking window (%s), visibility: %s, referred: %s\n", znode->caption,
(znode->flags & ZOF_VISIBLE)? "TRUE" : "FALSE",
(znode->flags & ZOF_IF_REFERENCE)? "TRUE" : "FALSE");
if (znode->flags & ZOF_VISIBLE &&
znode->flags & ZOF_IF_REFERENCE) {
_DBG_PRINTF ("Widnow (%s) will be updated\n", znode->caption);
update_client_window (znode, rc);
znode->flags &= ~ZOF_IF_REFERENCE;
return TRUE;
@@ -1570,6 +1587,8 @@ static int srvStartTrackPopupMenu (int cli, const RECT* rc, HWND ptmi,
GAL_Surface* surf;
if (cli == 0) {
surf = GetSurfaceFromDC (((PTRACKMENUINFO)ptmi)->dc);
// prevent to free this surface when deleting memdc for znode.
surf->refcount++;
}
else if (fd >= 0) {
surf = GAL_AttachSharedRGBSurface (fd, surf_size, surf_flags, TRUE);
@@ -3233,7 +3252,7 @@ static int dskMoveWindow (int cli, int idx_znode, HDC memdc, const RECT* rcWin)
slot = nodes [idx_znode].next;
for (; slot != 0; slot = nodes [slot].next) {
if (nodes [slot].flags & ZOF_VISIBLE &&
DoesIntersect (rcWin, &nodes [slot].rc)) {
DoesIntersect (rcWin, &nodes [slot].rc)) {
nodes [slot].age++;
}
}
@@ -3246,6 +3265,7 @@ static int dskMoveWindow (int cli, int idx_znode, HDC memdc, const RECT* rcWin)
//SetClipRgn (&sg_UpdateRgn, rcInv + i);
SetClipRgn (&sg_UpdateRgn, &(nodes [idx_znode].rc));
/* znodes below current znode in the same level */
slot = nodes [idx_znode].next;
for (; slot > 0; slot = nodes [slot].next) {
if (nodes [slot].flags & ZOF_VISIBLE &&
@@ -3256,6 +3276,7 @@ static int dskMoveWindow (int cli, int idx_znode, HDC memdc, const RECT* rcWin)
}
}
/* znodes below current level */
for (level = 0; level < NR_ZORDER_LEVELS; level++) {
if (type > _zof_types_for_level[level]) {
slot = zi->first_in_levels[level];
@@ -3370,12 +3391,10 @@ static int dskMoveWindow (int cli, int idx_znode, HDC memdc, const RECT* rcWin)
do_for_all_znodes (NULL, zi, _cb_exclude_rc, ZT_ALL);
}
while (slot && slot != idx_znode) {
#if 0
if (nodes [slot].flags & ZOF_VISIBLE) {
ExcludeClipRect (HDC_SCREEN_SYS, &nodes [slot].rc);
}
#endif
while (slot) {
if (slot == idx_znode)
break;
/* houhh 20090730, if slot window is no regular.*/
if (nodes [slot].flags & ZOF_VISIBLE) {
if (nodes[slot].idx_mask_rect == 0) {
@@ -3402,6 +3421,7 @@ static int dskMoveWindow (int cli, int idx_znode, HDC memdc, const RECT* rcWin)
}
slot = nodes [slot].next;
}
BitBlt (HDC_SCREEN_SYS, rcOld.left, rcOld.top,
MIN (RECTWP (rcWin), RECTW (rcOld)),
MIN (RECTHP (rcWin), RECTH (rcOld)),
@@ -3415,17 +3435,22 @@ static int dskMoveWindow (int cli, int idx_znode, HDC memdc, const RECT* rcWin)
}
#endif
/* unlock zi for change ... */
unlock_zi_for_change (zi);
do_for_all_znodes (&rcOld, zi, _cb_update_znode, ZT_ALL);
/* check the invalid rect of the window */
if (nodes [0].flags & ZOF_IF_REFERENCE) {
SendMessage (HWND_DESKTOP,
MSG_ERASEDESKTOP, 0, (LPARAM)&rcOld);
nodes [0].flags &= ~ZOF_IF_REFERENCE;
}
/* check the invalid rectangles of the being moved window */
EmptyClipRgn (&sg_UpdateRgn);
nInvCount = SubtractRect (rcInv, &rcOld, &rcScr);
for (i = 0; i < nInvCount; i++) {
AddClipRect (&sg_UpdateRgn, rcInv + i);
}
/* Since 5.0.0: handle levels */
/* Since 5.0.0: handle levels above the current level */
for (level = 0; level < NR_ZORDER_LEVELS; level++) {
if (type < _zof_types_for_level[level]) {
slot = zi->first_in_levels[level];
@@ -3437,6 +3462,7 @@ static int dskMoveWindow (int cli, int idx_znode, HDC memdc, const RECT* rcWin)
}
}
/* handle znodes above the current znode */
slot = *first;
for (; slot != idx_znode; slot = nodes [slot].next) {
if (nodes [slot].flags & ZOF_VISIBLE &&
@@ -3444,20 +3470,15 @@ static int dskMoveWindow (int cli, int idx_znode, HDC memdc, const RECT* rcWin)
AddClipRect(&sg_UpdateRgn, &rcInter);
}
do_for_all_znodes (&rcOld, zi, _cb_update_znode, ZT_ALL);
if (nodes [0].flags & ZOF_IF_REFERENCE) {
SendMessage (HWND_DESKTOP,
MSG_ERASEDESKTOP, 0, (LPARAM)&rcOld);
nodes [0].flags &= ~ZOF_IF_REFERENCE;
}
OffsetRegion (&sg_UpdateRgn,
rcWin->left - rcOld.left,
rcWin->top - rcOld.top);
update_client_window_rgn (nodes [idx_znode].cli,
nodes [idx_znode].hwnd);
/* unlock zi for change ... */
unlock_zi_for_change (zi);
}
else {
lock_zi_for_change (zi);
+3 -1
View File
@@ -348,7 +348,7 @@ BOOL kernel_GetLWEvent (int event, PLWEVENT lwe)
}
timeout_count = __mg_tick_counter + timeout_threshold;
// There was a event occurred.
// There was an event occurred.
if (event & IAL_MOUSEEVENT) {
if (!IAL_UpdateMouse ())
return 0;
@@ -459,6 +459,7 @@ BOOL kernel_GetLWEvent (int event, PLWEVENT lwe)
#endif
ke->event = KE_KEYUP;
ke->scancode = i;
olddownkey = 0;
break;
}
}
@@ -765,6 +766,7 @@ BOOL kernel_GetLWEvent (int event, PLWEVENT lwe)
if(oldkeystate[i] && !keystate[i]) {
ke->event = KE_KEYUP;
ke->scancode = i;
olddownkey = 0;
break;
}
}
+11 -3
View File
@@ -478,8 +478,12 @@ int InitGUI (int argc, const char* agr[])
/* Since 5.0.0
* Copy the video engine information to the shared resource segement
*/
strncpy (SHAREDRES_VIDEO_ENGINE, engine, LEN_ENGINE_NAME);
strncpy (SHAREDRES_VIDEO_MODE, mode, LEN_VIDEO_MODE);
//strncpy (SHAREDRES_VIDEO_ENGINE, engine, LEN_ENGINE_NAME);
strcpy (SHAREDRES_VIDEO_ENGINE, engine);
//strncpy (SHAREDRES_VIDEO_MODE, mode, LEN_VIDEO_MODE);
strcpy (SHAREDRES_VIDEO_MODE, mode);
#if 0 /* deprecated code */
// these fileds will be initialized by DRM engine.
if (GetMgEtcValue (engine, "device",
SHAREDRES_VIDEO_DEVICE, LEN_DEVICE_NAME) < 0)
*SHAREDRES_VIDEO_DEVICE = 0;
@@ -489,6 +493,7 @@ int InitGUI (int argc, const char* agr[])
if (GetMgEtcValue (engine, "exdriver",
SHAREDRES_VIDEO_EXDRIVER, LEN_EXDRIVER_NAME) < 0)
*SHAREDRES_VIDEO_EXDRIVER = 0;
#endif /* deprecated code */
SHAREDRES_VIDEO_DPI = __gal_screen->dpi;
SHAREDRES_VIDEO_HRES = __gal_screen->w;
@@ -498,6 +503,8 @@ int InitGUI (int argc, const char* agr[])
SHAREDRES_VIDEO_GMASK = __gal_screen->format->Gmask;
SHAREDRES_VIDEO_BMASK = __gal_screen->format->Bmask;
SHAREDRES_VIDEO_AMASK = __gal_screen->format->Amask;
GAL_CopyVideoInfoToSharedRes();
}
else {
_DBG_PRINTF("Engien info from shared resource: %s %s %d\n",
@@ -579,7 +586,6 @@ void TerminateGUI (int rcByGUI)
__mg_join_all_message_threads ();
#endif
mg_DestroyFreeQMSGList ();
mg_TerminateAccel ();
mg_TerminateControlClass ();
@@ -613,6 +619,8 @@ void TerminateGUI (int rcByGUI)
}
#endif
mg_DestroyFreeQMSGList ();
#ifdef _MGHAVE_ADV_2DAPI
extern void miFreeArcCache (void);
miFreeArcCache ();
+6 -6
View File
@@ -274,7 +274,7 @@ void __kernel_free_z_order_info (ZORDERINFO* zi)
}
#if 0 /* deprecated code */
#if IS_SHAREDFB_SCHEMA
#if IS_SHAREDFB_SCHEMA_PROCS
int __kernel_alloc_z_order_info (int nr_topmosts, int nr_normals)
{
@@ -299,7 +299,7 @@ int __kernel_alloc_z_order_info (int nr_topmosts, int nr_normals)
return zorder_shmid;
}
#else /* not IS_SHAREDFB_SCHEMA */
#else /* not IS_SHAREDFB_SCHEMA_PROCS */
ZORDERINFO* __kernel_alloc_z_order_info (int nr_topmosts, int nr_normals)
{
@@ -378,14 +378,14 @@ ZORDERINFO* __kernel_alloc_z_order_info (int nr_topmosts, int nr_normals)
return zi;
}
#endif /* not IS_SHAREDFB_SCHEMA */
#endif /* not IS_SHAREDFB_SCHEMA_PROCS */
void __kernel_free_z_order_info (ZORDERINFO* zi)
{
#if IS_SHAREDFB_SCHEMA
#if IS_SHAREDFB_SCHEMA_PROCS
if (shmdt (zi) < 0)
perror ("Detaches shared zorder nodes");
#else /* not IS_SHAREDFB_SCHEMA */
#else /* not IS_SHAREDFB_SCHEMA_PROCS */
#ifdef _MGRM_THREADS
#ifndef __NOUNIX__
@@ -396,7 +396,7 @@ void __kernel_free_z_order_info (ZORDERINFO* zi)
#endif /* _MGRM_THREADS */
free (zi);
#endif /* not IS_SHAREDFB_SCHEMA */
#endif /* not IS_SHAREDFB_SCHEMA_PROCS */
}
#endif /* deprecated code */
+2
View File
@@ -127,6 +127,8 @@ static LRESULT AboutWinProc (HWND hWnd, UINT message,
DestroyMainWindow (hWnd);
#ifdef _MGRM_THREADS
PostQuitMessage (hWnd);
#else
MainWindowCleanup (hWnd);
#endif
return 0;
}
+11 -2
View File
@@ -1433,7 +1433,9 @@ char * strtrimall( char *src)
return src;
}
strcpy (src, src + nIndex1);
// VW: use memmove instead of strcpy to avoid overlapping
// strcpy (src, src + nIndex1);
memmove (src, src + nIndex1, nLen - nIndex1 + 1);
nLen = strlen (src);
nIndex1 = nLen - 1;
@@ -1468,11 +1470,18 @@ int __mg_path_joint (char* dst, int dst_size,
if (__mg_is_abs_path(abs_path) && (!__mg_is_abs_path(sub_path))) {
if (dst_size >= strlen(abs_path) + strlen(sub_path)
+ 2/* size of split '/' and terminator '\0' */) {
sprintf(dst, "%s/%s", abs_path, sub_path);
strcpy (dst, abs_path);
strcat (dst, "/");
strcat (dst, sub_path);
//sprintf(dst, "%s/%s", abs_path, sub_path);
return 0;
}
else {
_WRN_PRINTF ("The buffer space for the full path is too short: %d\n", dst_size);
}
}
}
return -1;
}
+1
View File
@@ -39,6 +39,7 @@ COMMON_SRCS = \
videomem-bucket.c \
surface-shared.c \
surface-cursor.c \
surface-shm.c \
shadow-screen.h \
shadow-screen.c \
$(NULL_FILE)
+4 -4
View File
@@ -476,7 +476,7 @@ int GAL_RLEBlit(GAL_Surface *src, GAL_Rect *srcrect,
/* Set up the source and destination pointers */
x = dstrect->x;
y = dstrect->y;
dstbuf = (Uint8 *)dst->pixels + dst->offset
dstbuf = (Uint8 *)dst->pixels
+ y * dst->pitch + x * src->format->BytesPerPixel;
srcbuf = (Uint8 *)src->map->sw_data->aux_data;
@@ -730,7 +730,7 @@ int GAL_RLEAlphaBlit(GAL_Surface *src, GAL_Rect *srcrect,
x = dstrect->x;
y = dstrect->y;
dstbuf = (Uint8 *)dst->pixels + dst->offset
dstbuf = (Uint8 *)dst->pixels
+ y * dst->pitch + x * df->BytesPerPixel;
srcbuf = (Uint8 *)src->map->sw_data->aux_data + sizeof(RLEDestFormat);
@@ -1098,7 +1098,7 @@ static int RLEAlphaSurface(GAL_Surface *surface)
int x, y;
int h = surface->h, w = surface->w;
GAL_PixelFormat *sf = surface->format;
Uint32 *src = (Uint32 *)((Uint8 *)surface->pixels + surface->offset);
Uint32 *src = (Uint32 *)((Uint8 *)surface->pixels);
Uint8 *lastline = dst; /* end of last non-blank line */
/* opaque counts are 8 or 16 bits, depending on target depth */
@@ -1283,7 +1283,7 @@ static int RLEColorkeySurface(GAL_Surface *surface)
}
/* Set up the conversion */
srcbuf = (Uint8 *)surface->pixels+surface->offset;
srcbuf = (Uint8 *)surface->pixels;
maxn = bpp == 4 ? 65535 : 255;
dst = rlebuf;
rgbmask = ~surface->format->Amask;
+3 -4
View File
@@ -77,13 +77,13 @@ static int GAL_SoftBlit(GAL_Surface *src, GAL_Rect *srcrect,
GAL_loblit RunBlit;
/* Set up the blit information */
info.s_pixels = (Uint8 *)src->pixels + src->offset +
info.s_pixels = (Uint8 *)src->pixels +
(Uint16)srcrect->y*src->pitch +
(Uint16)srcrect->x*src->format->BytesPerPixel;
info.s_width = srcrect->w;
info.s_height = srcrect->h;
info.s_skip=src->pitch-info.s_width*src->format->BytesPerPixel;
info.d_pixels = (Uint8 *)dst->pixels + dst->offset +
info.d_pixels = (Uint8 *)dst->pixels +
(Uint16)dstrect->y*dst->pitch +
(Uint16)dstrect->x*dst->format->BytesPerPixel;
info.d_width = dstrect->w;
@@ -290,8 +290,7 @@ int GAL_CalculateBlit(GAL_Surface *surface)
if(surface->flags & GAL_RLEACCELOK
&& (surface->flags & GAL_HWACCEL) != GAL_HWACCEL) {
if(surface->map->identity
&& (blit_index == 1
if(surface->map->identity && (blit_index == 1
|| (blit_index == 3 && !surface->format->Amask))) {
if ( GAL_RLESurface(surface) == 0 )
surface->map->sw_blit = GAL_RLEBlit;
+62 -10
View File
@@ -94,26 +94,70 @@ static void COMMLCD_DeleteDevice(GAL_VideoDevice *device)
static void COMMLCD_UpdateRects_Sync (_THIS, int numrects, GAL_Rect *rects)
{
int i;
RECT bound;
/* sync update */
bound = this->hidden->rc_dirty;
for (i = 0; i < numrects; i++) {
RECT rc;
SetRect (&rc, rects[i].x, rects[i].y,
rects[i].x + rects[i].w, rects[i].y + rects[i].h);
if (!IsRectEmpty (&rc)) {
__mg_commlcd_ops.update (&rc);
if (IsRectEmpty (&bound))
bound = rc;
else
GetBoundRect (&bound, &bound, &rc);
}
if (!IsRectEmpty (&bound)) {
RECT rcScr = GetScreenRect();
if (IntersectRect (&bound, &bound, &rcScr)) {
this->hidden->rc_dirty = bound;
this->hidden->dirty = TRUE;
}
}
}
static BOOL _valid_async_updater = TRUE;
static BOOL COMMLCD_SyncUpdate_Sync (_THIS)
{
if (!IsRectEmpty (&this->hidden->rc_dirty)) {
__mg_commlcd_ops.update (&this->hidden->rc_dirty);
SetRect (&this->hidden->rc_dirty, 0, 0, 0, 0);
this->hidden->dirty = FALSE;
return TRUE;
}
return FALSE;
}
static BOOL COMMLCD_SyncUpdate_Async (_THIS)
{
BOOL rc = FALSE;
pthread_mutex_lock (&this->hidden->update_lock);
if (this->hidden->dirty) {
// signal the update thread to do update
sem_post (&this->hidden->sem_update);
rc = TRUE;
}
pthread_mutex_unlock (&this->hidden->update_lock);
return rc;
}
static void* task_do_update (void* data)
{
_THIS;
this = data;
if (pthread_setcancelstate (PTHREAD_CANCEL_ENABLE, NULL))
return NULL;
do {
sem_wait (&this->hidden->sem_update);
pthread_testcancel ();
pthread_mutex_lock (&this->hidden->update_lock);
if (this->hidden->dirty) {
__mg_commlcd_ops.update (&this->hidden->rc_dirty);
@@ -122,8 +166,11 @@ static void* task_do_update (void* data)
this->hidden->dirty = FALSE;
}
pthread_mutex_unlock (&this->hidden->update_lock);
#if 0 /* since 5.0.0: use semaphore */
__mg_os_time_delay(50); /* 50 ms */
} while (_valid_async_updater);
#endif
} while (1);
return NULL;
}
@@ -186,12 +233,13 @@ static GAL_VideoDevice *COMMLCD_CreateDevice (int devindex)
device->SetColors = COMMLCD_SetColors;
device->VideoQuit = COMMLCD_VideoQuit;
device->AllocHWSurface = COMMLCD_AllocHWSurface;
device->FreeHWSurface = COMMLCD_FreeHWSurface;
device->CheckHWBlit = NULL;
device->FillHWRect = NULL;
device->SetHWColorKey = NULL;
device->SetHWAlpha = NULL;
device->FreeHWSurface = COMMLCD_FreeHWSurface;
device->UpdateRects = NULL;
device->SyncUpdate = NULL;
device->free = COMMLCD_DeleteDevice;
return device;
@@ -307,11 +355,15 @@ static GAL_Surface *COMMLCD_SetVideoMode(_THIS, GAL_Surface *current,
if (li.update_method == COMMLCD_UPDATE_NONE) {
this->UpdateRects = NULL;
this->SyncUpdate = NULL;
this->hidden->update_th = 0;
}
else if (li.update_method == COMMLCD_UPDATE_ASYNC) {
this->UpdateRects = COMMLCD_UpdateRects_Async;
this->SyncUpdate = COMMLCD_SyncUpdate_Async;
pthread_mutex_init (&this->hidden->update_lock, NULL);
sem_init (&this->hidden->sem_update, 0, 0);
#if 0
pthread_attr_t new_attr;
@@ -324,10 +376,10 @@ static GAL_Surface *COMMLCD_SetVideoMode(_THIS, GAL_Surface *current,
pthread_create (&this->hidden->update_th, NULL,
task_do_update, this);
#endif
pthread_mutex_init (&this->hidden->update_lock, NULL);
}
else {
this->UpdateRects = COMMLCD_UpdateRects_Sync;
this->SyncUpdate = COMMLCD_SyncUpdate_Sync;
this->hidden->update_th = 0;
}
@@ -342,9 +394,9 @@ static void COMMLCD_VideoQuit (_THIS)
}
if (this->hidden->update_th) {
/* quit the update task */
_valid_async_updater = FALSE;
pthread_join(this->hidden->update_th, NULL);
/* send cancel request */
pthread_cancel (this->hidden->update_th);
pthread_join (this->hidden->update_th, NULL);
}
if (__mg_commlcd_ops.release)
+3
View File
@@ -47,6 +47,8 @@
#ifndef _GAL_COMMLCD_H
#define _GAL_COMMLCD_H
#include <semaphore.h>
#include "sysvideo.h"
#include "exstubs.h"
@@ -68,6 +70,7 @@ struct GAL_PrivateVideoData {
RECT rc_dirty;
pthread_t update_th;
pthread_mutex_t update_lock;
sem_t sem_update;
};
struct commlcd_ops {
+2 -2
View File
@@ -117,7 +117,7 @@ GAL_FunctionTable mgGALFuncTable = {
DFB_SetColors,
DFB_UpdateRects,
DFB_VideoQuit,
#if IS_SHAREDFB_SCHEMA
#if IS_SHAREDFB_SCHEMA_PROCS
DFB_RequestHWSurface,
#endif
DFB_AllocHWSurface,
@@ -167,7 +167,7 @@ static GAL_VideoDevice *DFB_CreateDevice (int devindex)
device->SetColors = DFB_SetColors;
device->VideoQuit = DFB_VideoQuit;
device->UpdateRects = DFB_UpdateRects;
#if IS_SHAREDFB_SCHEMA
#if IS_SHAREDFB_SCHEMA_PROCS
device->RequestHWSurface = DFB_RequestHWSurface;
#endif
device->AllocHWSurface = DFB_AllocHWSurface;
+2620 -1066
View File
File diff suppressed because it is too large Load Diff
+45 -15
View File
@@ -15,7 +15,7 @@
* and Graphics User Interface (GUI) support system for embedded systems
* and smart IoT devices.
*
* Copyright (C) 2019, Beijing FMSoft Technologies Co., Ltd.
* Copyright (C) 2019 ~ 2020, Beijing FMSoft Technologies Co., Ltd.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -58,9 +58,49 @@
typedef struct drm_mode_info DrmModeInfo;
typedef struct GAL_PrivateVideoData {
char dev_name[LEN_DEVICE_NAME + 1];
/* For compositing schema, we force to use double buffering */
#ifdef _MGSCHEMA_COMPOSITING
GAL_Surface *real_screen, *shadow_screen;
DrmSurfaceBuffer *cursor_buff;
uint32_t cursor_plane_id;
/* Used to simulate the hardware cursor when hardware cursor not available. */
GAL_Surface *cursor;
int csr_x, csr_y;
int hot_x, hot_y;
#if 0 /* test code */
/* for asynchronous update */
pthread_t update_th;
pthread_mutex_t update_lock;
sem_t sem_update;
#endif /* test code */
#else /* defined _MGSCHEMA_COMPOSITING */
/* When double buffering supported, the real surface represents the ultimate
* scan-out frame buffer, and the shadow screen represents the rendering
* surface. When double buffering disabled, shadow_screen is NULL. */
GAL_Surface *real_screen, *shadow_screen;
/* the global names of real screen and shadow screen */
uint32_t real_name, shadow_name;
#endif /* not defined _MGSCHEMA_COMPOSITING */
#if !IS_SHAREDFB_SCHEMA_PROCS
RECT dirty_rc;
#endif
char* dev_name;
char* ex_driver;
int dev_fd;
/* capabilities */
uint32_t cap_cursor_width;
uint32_t cap_cursor_height;
uint32_t cap_dumb:1;
uint32_t dbl_buff:1;
uint32_t scanout_buff_id;
void* exdrv_handle;
DrmDriverOps* driver_ops;
DrmDriver* driver;
@@ -68,23 +108,13 @@ typedef struct GAL_PrivateVideoData {
DrmModeInfo* mode_list;
GAL_Rect** modes;
int bpp;
uint32_t width;
uint32_t height;
uint32_t pitch;
uint32_t size;
uint32_t scanout_buff_id;
uint8_t* scanout_fb;
DrmModeInfo* saved_info;
drmModeCrtc* saved_crtc;
/* only valid when using DUMB frame buffer */
uint32_t handle;
/* only valid when using DRM driver */
#if 0 /* deprecated code */
uint32_t console_buff_id;
uint8_t* scanout_fb;
#endif /* deprecated code */
} DrmVideoData;
#endif /* _NEWGAL_DRIVIDEO_H */
+16 -5
View File
@@ -152,6 +152,12 @@ static int FB_Available(void)
static void FB_DeleteDevice(GAL_VideoDevice *device)
{
#ifdef _MGSCHEMA_COMPOSITING
if (device->hidden->shadow_screen) {
GAL_FreeSurface (device->hidden->real_screen);
}
#endif /* _MGSCHEMA_COMPOSITING */
free(device->hidden);
free(device);
}
@@ -251,9 +257,11 @@ static int FB_EnterGraphicsMode (_THIS)
_WRN_PRINTF ("Can't open %s: %m\n", tty_dev);
goto fail;
}
if (ioctl (ttyfd, KDSETMODE, KD_GRAPHICS) == -1) {
_WRN_PRINTF ("Error when setting the terminal to graphics mode: %m\n");
_WRN_PRINTF ("Maybe is not a console.\n");
_WRN_PRINTF ("Error when setting the terminal (%s) "
"to graphics mode: %m\n", tty_dev);
_WRN_PRINTF ("It might is not a console.\n");
goto fail;
}
#ifdef _MGRM_PROCESSES
@@ -858,7 +866,8 @@ static void FB_FreeHWSurfaces(_THIS)
surfaces.next = NULL;
}
static void FB_RequestHWSurface (_THIS, const REQ_HWSURFACE* request, REP_HWSURFACE* reply)
static void FB_RequestHWSurface (_THIS, const REQ_HWSURFACE* request,
REP_HWSURFACE* reply)
{
if (request->bucket == NULL) { /* alloc hw surface */
vidmem_bucket *bucket;
@@ -948,9 +957,9 @@ static void FB_RequestHWSurface (_THIS, const REQ_HWSURFACE* request, REP_HWSURF
break;
}
}
if (bucket && bucket->used) {
/* Add the memory back to the total */
_DBG_PRINTF ("Freeing bucket of %d bytes\n", bucket->size);
surfaces_memleft += bucket->size;
/* Can we merge the space with surrounding buckets? */
@@ -1009,12 +1018,14 @@ static int FB_AllocHWSurface (_THIS, GAL_Surface *surface)
surface->pitch = reply.pitch;
surface->pixels = mapped_mem + reply.offset;
surface->hwdata = (struct private_hwdata *)reply.bucket;
return 0;
}
static void FB_FreeHWSurface(_THIS, GAL_Surface *surface)
{
REQ_HWSURFACE request = {surface->w, surface->h, surface->pitch, 0, surface->hwdata};
REQ_HWSURFACE request = {surface->w, surface->h, surface->pitch, 0,
surface->hwdata};
REP_HWSURFACE reply = {0, 0};
request.offset = (char*)surface->pixels - (char*)mapped_mem;
+1 -1
View File
@@ -236,7 +236,7 @@ static GAL_VideoDevice *HI3560A_CreateDevice(int devindex)
device->SetVideoMode = HI3560A_SetVideoMode;
device->SetColors = HI3560A_SetColors;
device->VideoQuit = HI3560A_VideoQuit;
#if IS_SHAREDFB_SCHEMA
#if IS_SHAREDFB_SCHEMA_PROCS
device->RequestHWSurface = HI3560A_RequestHWSurface;
#endif
device->AllocHWSurface = HI3560A_AllocHWSurface;
+1 -1
View File
@@ -1851,7 +1851,7 @@ static GAL_VideoDevice *HI3510_CreateDevice (int devindex)
this->SetVideoMode = HI3510_SetVideoMode;
//this->SetColors = FB_SetColors;
this->VideoQuit = HI3510_VideoQuit;
#if IS_SHAREDFB_SCHEMA
#if IS_SHAREDFB_SCHEMA_PROCS
this->RequestHWSurface = HI3510_RequestHWSurface;
#endif
this->AllocHWSurface = HI3510_AllocHWSurface;
+1 -1
View File
@@ -1843,7 +1843,7 @@ static GAL_VideoDevice *HI3560_CreateDevice (int devindex)
this->ListModes = HI3560_ListModes;
this->SetVideoMode = HI3560_SetVideoMode;
this->VideoQuit = HI3560_VideoQuit;
#if IS_SHAREDFB_SCHEMA
#if IS_SHAREDFB_SCHEMA_PROCS
this->RequestHWSurface = HI3560_RequestHWSurface;
#endif
this->AllocHWSurface = HI3560_AllocHWSurface;
+11 -11
View File
@@ -219,8 +219,10 @@ static GAL_Surface* create_wp_surface(GAL_Surface* screen)
screen->format->BitsPerPixel,
screen->format->Rmask, screen->format->Gmask,
screen->format->Bmask, screen->format->Amask);
_DBG_PRINTF ("GAL_CreateSharedRGBSurface: buf_size: %lu, fd: %d\n",
wp_surf->shared_header->buf_size, wp_surf->shared_header->fd);
_DBG_PRINTF ("GAL_CreateSharedRGBSurface: map size: %lu, fd: %d, RGBAmasks: %x, %x, %x, %x\n",
wp_surf->shared_header->map_size, wp_surf->shared_header->fd,
wp_surf->format->Rmask, wp_surf->format->Gmask,
wp_surf->format->Bmask, wp_surf->format->Amask);
}
else {
goto empty;
@@ -233,17 +235,17 @@ static GAL_Surface* create_wp_surface(GAL_Surface* screen)
int fd = -1;
SHAREDSURFINFO info;
req.id = REQID_GETWPSURFACE;
req.data = &fd;
req.len_data = sizeof(int);
req.id = REQID_GETSHAREDSURFACE;
req.data = SYSSF_WALLPAPER_PATTER;
req.len_data = strlen (SYSSF_WALLPAPER_PATTER) + 1;
if ((ClientRequestEx2 (&req, NULL, 0, -1,
&info, sizeof (SHAREDSURFINFO), &fd) < 0) || (fd < 0))
goto empty;
_DBG_PRINTF ("REQID_GETWPSURFACE: map_size (%lu), flags (0x%x), fd: %d\n",
info.map_size, info.flags, fd);
wp_surf = GAL_AttachSharedRGBSurface (fd, info.map_size,
_DBG_PRINTF ("REQID_GETSHAREDSURFACE: size (%lu), flags (0x%x), fd: %d\n",
info.size, info.flags, fd);
wp_surf = GAL_AttachSharedRGBSurface (fd, info.size,
info.flags, TRUE);
close (fd);
@@ -302,9 +304,7 @@ int mg_InitGAL (char* engine, char* mode)
if (GAL_VideoInit (engine, 0)) {
GAL_VideoQuit ();
_ERR_PRINTF ("NEWGAL: Does not find matched engine: %s.\n", engine);
if (IS_COMPOSITING_SCHEMA) {
_ERR_PRINTF (" Or the specified engine does not support compositing schema.\n");
}
_ERR_PRINTF (" Or failed to initialize the engine.\n");
return ERR_NO_MATCH;
}
+12
View File
@@ -269,6 +269,8 @@ static void PCXVFB_UpdateRects (_THIS, int numrects, GAL_Rect *rects)
static BOOL PCXVFB_SyncUpdate (_THIS)
{
RECT dirty_rc;
if (IsRectEmpty (&this->hidden->dirty_rc))
return FALSE;
@@ -278,6 +280,16 @@ static BOOL PCXVFB_SyncUpdate (_THIS)
shm_lock(semid);
#endif
dirty_rc.left = this->hidden->hdr->dirty_rc_l;
dirty_rc.top = this->hidden->hdr->dirty_rc_t;
dirty_rc.right = this->hidden->hdr->dirty_rc_r;
dirty_rc.bottom = this->hidden->hdr->dirty_rc_b;
if (dirty_rc.right == -1) dirty_rc.right = 0;
if (dirty_rc.bottom == -1) dirty_rc.bottom = 0;
GetBoundRect (&this->hidden->dirty_rc, &dirty_rc,
&this->hidden->dirty_rc);
shadowScreen_BlitToReal (this);
this->hidden->hdr->dirty_rc_l = this->hidden->dirty_rc.left;

Some files were not shown because too many files have changed in this diff Show More