CN112748921A - Low-computation-quantity GUI rendering method in embedded equipment - Google Patents
Low-computation-quantity GUI rendering method in embedded equipment Download PDFInfo
- Publication number
- CN112748921A CN112748921A CN202011630859.2A CN202011630859A CN112748921A CN 112748921 A CN112748921 A CN 112748921A CN 202011630859 A CN202011630859 A CN 202011630859A CN 112748921 A CN112748921 A CN 112748921A
- Authority
- CN
- China
- Prior art keywords
- virtual screen
- interface
- glibc
- virtual
- computation
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 37
- 238000009877 rendering Methods 0.000 title claims abstract description 27
- 230000008569 process Effects 0.000 claims abstract description 17
- 230000006870 function Effects 0.000 claims description 27
- 239000007787 solid Substances 0.000 claims description 6
- 238000011084 recovery Methods 0.000 claims description 3
- 230000001960 triggered effect Effects 0.000 claims description 3
- 230000003068 static effect Effects 0.000 description 5
- 230000003139 buffering effect Effects 0.000 description 2
- 238000005457 optimization Methods 0.000 description 2
- 238000010586 diagram Methods 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- 239000002184 metal Substances 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/30—Creation or generation of source code
- G06F8/38—Creation or generation of source code for implementing user interfaces
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/30—Creation or generation of source code
- G06F8/36—Software reuse
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/445—Program loading or initiating
- G06F9/44521—Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading
- G06F9/44526—Plug-ins; Add-ons
Abstract
The invention provides a low-computation-quantity GUI rendering method in embedded equipment, which comprises the following steps: s1, drawing a graphic interface by using the embedded equipment; s2, drawing a virtual screen interface by using a graphic interface; s3, realizing a virtual screen management interface by using a virtual screen drawing interface; and S4, displaying data by connecting the external equipment with the virtual screen management interface. The GUI rendering method realizes a graphical interface based on a frame buffer area, optimizes the rendering process according to the content characteristics of the control and reduces the calculation amount.
Description
Technical Field
The invention belongs to the technical field of software rendering, and particularly relates to a low-computation-quantity GUI rendering method in embedded equipment.
Background
A GUI (graphical user interface) is a very popular way of user-machine interaction. The modern GUI framework is generally composed of a control library and a platform graphics API, the graphics API comprises DirectX, OpenGL, Metal, Vulkan and the like, the control library is realized by a project programming language, and the C/C + + realization of the control library is still mainstream at an embedded end.
The GUI technical solution is closely related to the product characteristics, the CPU, the memory, and the Flash are scarce resources in the embedded platform, and in the GUI project mainly based on the static content, using the mature cross-platform framework of Qt or the OpenGL graphics interface may cause a great pressure on system resources.
Aiming at the situation, the Framebuffer based on the Linux equipment realizes a GUI rendering mode with low calculation amount. And a rich control library is provided for engineers in GUI development, and the calculation amount of GUI single-frame rendering is reduced while the development efficiency is not influenced by combining a special rendering mode.
Disclosure of Invention
In view of this, the present invention is directed to a low-computation-amount GUI rendering method in an embedded device, so as to solve the problem of saving system resources and having a fast running speed in the GUI rendering process.
In order to achieve the purpose, the technical scheme of the invention is realized as follows:
a low-computation-quantity GUI rendering method in an embedded device comprises the following steps:
s1, drawing a graphic interface by using the embedded equipment;
s2, drawing a virtual screen interface by using a graphic interface;
s3, realizing a virtual screen management interface by using a virtual screen drawing interface;
and S4, displaying data by connecting the external equipment with the virtual screen management interface.
Further, the process of drawing the graphic interface in step S1 is as follows:
101. an engineer realizes that a drawing point function draws a pixel to a specified memory position by using a memcpy function provided by the glibc;
102. utilizing a memcpy function provided by the glibc to realize that a line drawing function draws a line segment to a specified memory position;
103. drawing a rectangle function to a specified memory position by using a memcpy function provided by the glibc to draw a rectangle;
104. utilizing a memcpy function provided by the glibc to realize that a text drawing function draws a section of text to a specified memory position;
105. and utilizing a memcpy function provided by the glibc to realize that the picture is drawn to the appointed memory position.
Further, the process of drawing the virtual screen interface in step S2 is as follows:
201. defining a data structure for describing the memory address and the attribute of a virtual screen on the embedded equipment;
202. detecting whether two virtual screens overlap or not by utilizing glibc, and acquiring an overlapping area if the two virtual screens overlap;
203. backing up data of the virtual screen overlapping area by using a glibc solid virtual screen content backup interface;
204. restoring the data of the virtual screen overlapping area by using a glibc solid virtual screen content restoring interface;
205. and acquiring the virtual screen information by using the glibc interface, and drawing data into the virtual screen memory through the graphical interface realized in the step S1.
Further, the process of implementing the virtual screen management interface in step S3 is as follows:
301. defining a virtual screen updating linked list through embedded equipment, and adding and deleting a virtual screen which is triggered by a user and needs to be redrawn into the linked list;
302. realizing a virtual screen updating thread interface, traversing a virtual screen updating linked list in a timing or thread circulation mode, and updating a virtual screen by acquiring a virtual screen instance interface and a graphic interface;
further, the process of traversing the virtual screen is as follows:
traversing the virtual screen in the sequence of the layers from low to high;
and detecting whether the current virtual screen is overlapped with the drawn virtual screen or not through the virtual screen instance interface in the traversal process, if the overlapped area is the drawn virtual screen, backing up the overlapped area through the virtual screen content backup interface, and recovering the overlapped area through the virtual screen content recovery interface after the current screen is drawn.
Compared with the prior art, the low-computation-quantity GUI rendering method in the embedded device has the following advantages:
(1) the GUI rendering method can save system resources and enable embedded equipment to process more tasks; the dependence of a third-party graphic library is reduced, and the software complexity is reduced; and directly operating the frame buffer data, and multiplexing the data by referring to the general data.
(2) According to the GUI rendering method, different virtual screens are established to store the same data, when the universal data is needed to be used in the control, the dynamic control can be constructed by referring to the virtual screen in which the universal data is stored, and the occupation of a memory is reduced through data multiplexing.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate an embodiment of the invention and, together with the description, serve to explain the invention and not to limit the invention. In the drawings:
FIG. 1 is a schematic diagram illustrating a low-computation-amount GUI rendering method in an embedded device according to an embodiment of the present invention;
fig. 2 is a flowchart illustrating a low-computation-amount GUI rendering method in an embedded device according to an embodiment of the present invention.
Detailed Description
It should be noted that the embodiments and features of the embodiments may be combined with each other without conflict.
In the description of the present invention, it is to be understood that the terms "center", "longitudinal", "lateral", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer", and the like, indicate orientations or positional relationships based on those shown in the drawings, and are used only for convenience in describing the present invention and for simplicity in description, and do not indicate or imply that the referenced devices or elements must have a particular orientation, be constructed and operated in a particular orientation, and thus, are not to be construed as limiting the present invention. Furthermore, the terms "first", "second", etc. are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first," "second," etc. may explicitly or implicitly include one or more of that feature. In the description of the present invention, "a plurality" means two or more unless otherwise specified.
In the description of the present invention, it should be noted that, unless otherwise explicitly specified or limited, the terms "mounted," "connected," and "connected" are to be construed broadly, e.g., as meaning either a fixed connection, a removable connection, or an integral connection; can be mechanically or electrically connected; they may be connected directly or indirectly through intervening media, or they may be interconnected between two elements. The specific meaning of the above terms in the present invention can be understood by those of ordinary skill in the art through specific situations.
The present invention will be described in detail below with reference to the embodiments with reference to the attached drawings.
As shown in fig. 1 to 2, a low computation amount GUI rendering method in an embedded device includes the following steps:
s1, drawing a graphic interface by using the embedded equipment;
101. an engineer realizes a drawing point function (Drawdot) to draw a pixel to a specified memory position by using a memcpy function provided by the glibc;
102. utilizing a memcpy function provided by glibc to realize that a drawing line function (DrawLine) draws a line segment to a specified memory position;
103. drawing a rectangle (DrawRect) function to a specified memory position by using a memcpy function provided by glibc;
104. drawing a segment of characters from a designated memory position by using a drawing character function (DrawText) realized by using a memcpy function provided by the glibc;
105. and drawing the picture (DrawBmp) to a specified memory position by utilizing a memcpy function provided by the glibc.
S2, drawing a virtual screen interface by using a graphic interface;
201. defining a data structure for describing the memory address and the attribute of a virtual screen on the embedded equipment;
202. detecting whether two virtual screens overlap or not by using a VScrenHaveOverlay interface of the glibc, and acquiring an overlapping area if the two virtual screens overlap;
203. backing up data of the virtual screen overlapping area by using a solid virtual screen content backup interface (VScrenBack interface) of glibc;
204. restoring the virtual screen overlapping area data by using a glibc solid virtual screen content restoration interface (VScrenRecover interface);
205. acquiring virtual screen information through a virtual screen instance interface (vscreeninstrument interface) by utilizing glibc, and drawing data into the virtual screen memory through the graphical interface realized in step S1.
S3, realizing a virtual screen management interface by using a virtual screen drawing interface;
301. defining a virtual screen updating linked list through an embedded device, and adding and deleting a virtual screen which is triggered by a user and needs to be redrawn into the linked list through VScrenListAdd and VScrenListDel;
302. a virtual screen updating thread interface (VScrenUpdateThread interface) is realized, a virtual screen updating linked list is traversed in a timing or thread circulation mode, and a virtual screen is updated by acquiring a virtual screen instance interface and a graphic interface;
the process of traversing the virtual screen is as follows:
traversing the virtual screen in the sequence of the layers from low to high;
detecting whether a current virtual screen is overlapped with a drawn virtual screen through a virtual screen instance interface in a traversal process, if the overlapped area is the drawn virtual screen, backing up the overlapped area through a virtual screen content backup interface, and recovering the overlapped area through a virtual screen content recovery interface after the current screen is drawn;
s4, displaying data by connecting an external device with the virtual screen management interface;
and setting the initial address of the frame buffer equipment through ioctl to realize double buffering, and finishing display.
Explanation:
frame buffering: and the display equipment frame buffer area is used for storing final display data, and the final data flow direction is the final data flow direction after the rendering process in the scheme.
Virtual screen: the abstract name of the packaged data in the scheme is used for displaying dynamic content or realizing complex controls.
User GUI operation: after user input is captured, the control data is updated.
Rendering a virtual screen: and copying the updated control data to a frame buffer area.
The specific idea is as follows:
the method realizes a graphic interface based on a frame buffer area, optimizes the rendering process and reduces the calculated amount according to the content characteristics of the control, and mainly optimizes the method through the following aspects:
1. control optimization
According to the control characteristics, the control is divided into a static control and a dynamic control, the static control is drawn by using a drawing interface realized based on a frame buffer area, and after single drawing, if a user does not have an operation interface, the content of the frame buffer area is consistent with the control, the display can be kept; if the user switches the interface, the static control of the current interface is redrawn, that is, the number of times of drawing the static control can be reduced. The dynamic control is realized based on the virtual screen, when the content in the dynamic control changes, the dynamic control is added into a dynamic control updating queue, and the event cycle of the software re-renders the dynamic control needing to be updated in the queue to the frame buffer area corresponding to the virtual screen, so that only the changed control area is rendered, and the rendering times of the dynamic control are reduced.
2. Data optimization
According to the characteristics of display contents, different virtual screens are established to store the same data, when the universal data is needed to be used in the control, the dynamic control can be constructed by referring to the virtual screen in which the universal data is stored, and the occupation of a memory is reduced through data multiplexing.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like that fall within the spirit and principle of the present invention are intended to be included therein.
Claims (5)
1. A low-computation-quantity GUI rendering method in an embedded device is characterized by comprising the following steps:
s1, drawing a graphic interface by using the embedded equipment;
s2, drawing a virtual screen interface by using a graphic interface;
s3, realizing a virtual screen management interface by using a virtual screen drawing interface;
and S4, displaying data by connecting the external equipment with the virtual screen management interface.
2. The method for low-computation-amount GUI rendering in an embedded device according to claim 1, wherein: the process of drawing the graphic interface in step S1 is as follows:
101. an engineer realizes that a drawing point function draws a pixel to a specified memory position by using a memcpy function provided by the glibc;
102. utilizing a memcpy function provided by the glibc to realize that a line drawing function draws a line segment to a specified memory position;
103. drawing a rectangle function to a specified memory position by using a memcpy function provided by the glibc to draw a rectangle;
104. utilizing a memcpy function provided by the glibc to realize that a text drawing function draws a section of text to a specified memory position;
105. and utilizing a memcpy function provided by the glibc to realize that the picture is drawn to the appointed memory position.
3. The method for low-computation-amount GUI rendering in an embedded device according to claim 1, wherein: the process of drawing the virtual screen interface in step S2 is as follows:
201. defining a data structure for describing the memory address and the attribute of a virtual screen on the embedded equipment;
202. detecting whether two virtual screens overlap or not by utilizing glibc, and acquiring an overlapping area if the two virtual screens overlap;
203. backing up data of the virtual screen overlapping area by using a glibc solid virtual screen content backup interface;
204. restoring the data of the virtual screen overlapping area by using a glibc solid virtual screen content restoring interface;
205. and acquiring the virtual screen information by using the glibc interface, and drawing data into the virtual screen memory through the graphical interface realized in the step S1.
4. The method for low-computation-amount GUI rendering in embedded device according to claim 3, wherein: the process of implementing the virtual screen management interface in step S3 is as follows:
301. defining a virtual screen updating linked list through embedded equipment, and adding and deleting a virtual screen which is triggered by a user and needs to be redrawn into the linked list;
302. and updating the virtual screen by acquiring the virtual screen instance interface and the graphical interface.
5. The method for low-computation-amount GUI rendering in an embedded device according to claim 4, wherein: the process of traversing the virtual screen is as follows:
traversing the virtual screen in the sequence of the layers from low to high;
and detecting whether the current virtual screen is overlapped with the drawn virtual screen or not through the virtual screen instance interface in the traversal process, if the overlapped area is the drawn virtual screen, backing up the overlapped area through the virtual screen content backup interface, and recovering the overlapped area through the virtual screen content recovery interface after the current screen is drawn.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011630859.2A CN112748921A (en) | 2020-12-30 | 2020-12-30 | Low-computation-quantity GUI rendering method in embedded equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011630859.2A CN112748921A (en) | 2020-12-30 | 2020-12-30 | Low-computation-quantity GUI rendering method in embedded equipment |
Publications (1)
Publication Number | Publication Date |
---|---|
CN112748921A true CN112748921A (en) | 2021-05-04 |
Family
ID=75650755
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202011630859.2A Pending CN112748921A (en) | 2020-12-30 | 2020-12-30 | Low-computation-quantity GUI rendering method in embedded equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112748921A (en) |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104166552A (en) * | 2014-08-15 | 2014-11-26 | 成都天奥信息科技有限公司 | Transplantable memory bitmap graphics library application method |
US20160321778A1 (en) * | 2015-04-28 | 2016-11-03 | Dell Products, L.P. | Rendering graphics using framebuffer nodes with event handler mapping in a binary search tree |
CN106598739A (en) * | 2016-12-14 | 2017-04-26 | 合网络技术(北京)有限公司 | Video rendering method and device |
CN107729095A (en) * | 2017-09-13 | 2018-02-23 | 深信服科技股份有限公司 | Image processing method, virtual platform and computer-readable recording medium |
CN111797184A (en) * | 2020-05-29 | 2020-10-20 | 北京百度网讯科技有限公司 | Information display method, device, equipment and medium |
-
2020
- 2020-12-30 CN CN202011630859.2A patent/CN112748921A/en active Pending
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104166552A (en) * | 2014-08-15 | 2014-11-26 | 成都天奥信息科技有限公司 | Transplantable memory bitmap graphics library application method |
US20160321778A1 (en) * | 2015-04-28 | 2016-11-03 | Dell Products, L.P. | Rendering graphics using framebuffer nodes with event handler mapping in a binary search tree |
CN106598739A (en) * | 2016-12-14 | 2017-04-26 | 合网络技术(北京)有限公司 | Video rendering method and device |
CN107729095A (en) * | 2017-09-13 | 2018-02-23 | 深信服科技股份有限公司 | Image processing method, virtual platform and computer-readable recording medium |
CN111797184A (en) * | 2020-05-29 | 2020-10-20 | 北京百度网讯科技有限公司 | Information display method, device, equipment and medium |
Non-Patent Citations (1)
Title |
---|
仇浩健: ""操作系统图形用户界面的研究与实现"", 《中国优秀博硕士学位论文全文数据库 信息科技辑》 * |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US20100289806A1 (en) | Memory management based on automatic full-screen detection | |
US20100058229A1 (en) | Compositing Windowing System | |
US20150100884A1 (en) | Hardware overlay assignment | |
US20100079445A1 (en) | Method for reducing graphics rendering failures | |
EP2997547B1 (en) | Primitive-based composition | |
CN104866318A (en) | Method and device for displaying label pages in multiple windows | |
US20230419454A1 (en) | Control blurring method and apparatus, terminal device, and readable storage medium | |
US20220121307A1 (en) | Method and device of drawing handwriting track, electronic apparatus, medium, and program product | |
CN114741044A (en) | Cross-operating environment display output sharing method based on heterogeneous rendering | |
CN104765595A (en) | Method and device for displaying graphical user interface | |
CN114579246A (en) | Screen capturing method for android application in multi-window mode in android compatible environment | |
US9324299B2 (en) | Atlasing and virtual surfaces | |
CN104199628A (en) | Character display method and system based on QT Embedded system | |
WO2024007293A1 (en) | Graphics processing system and method and gpu based on bitmap primitives | |
CN112748921A (en) | Low-computation-quantity GUI rendering method in embedded equipment | |
WO2023179501A1 (en) | Interface display method and electronic device | |
CN109416828A (en) | Frame buffering is mapped to the device and method of logic eye | |
CN109800039B (en) | User interface display method and device, electronic equipment and storage medium | |
CN111402349B (en) | Rendering method, rendering device and rendering engine | |
KR102640054B1 (en) | A minimization method for rendering by extending a frame, and computer-readable recording medium recorded with computer program executing the same | |
JP3797371B2 (en) | Image transfer using drawing command hook | |
CN115543244A (en) | Multi-screen splicing method and device, electronic equipment and storage medium | |
JP3826941B2 (en) | Image transfer using drawing command hook | |
CN104424661A (en) | Three-dimensional object display method and device | |
KR20230052988A (en) | GPU Kernel Optimization with SIMO Approach for Downscaling with GPU Cache |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20210504 |