CN111330270B - User interface rendering method - Google Patents
User interface rendering method Download PDFInfo
- Publication number
- CN111330270B CN111330270B CN202010127457.4A CN202010127457A CN111330270B CN 111330270 B CN111330270 B CN 111330270B CN 202010127457 A CN202010127457 A CN 202010127457A CN 111330270 B CN111330270 B CN 111330270B
- Authority
- CN
- China
- Prior art keywords
- rendering
- queue
- batch
- user interface
- adjacent
- 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.)
- Active
Links
Classifications
-
- A—HUMAN NECESSITIES
- A63—SPORTS; GAMES; AMUSEMENTS
- A63F—CARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
- A63F13/00—Video games, i.e. games using an electronically generated display having two or more dimensions
- A63F13/50—Controlling the output signals based on the game progress
- A63F13/52—Controlling the output signals based on the game progress involving aspects of the displayed game scene
-
- 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/451—Execution arrangements for user interfaces
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Multimedia (AREA)
- Theoretical Computer Science (AREA)
- Human Computer Interaction (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- User Interface Of Digital Computer (AREA)
Abstract
The invention provides a user interface rendering method, which comprises the steps of obtaining a UI rendering queue; carrying out batch processing according to the UI rendering queue; and rendering is carried out on the UI batch units after the batch processing, so that the occupied Draw Call number is reduced, the switching of rendering states is reduced, and the time occupied by UI rendering is greatly reduced.
Description
Technical Field
The invention relates to the technical field of data processing, in particular to a user interface rendering method.
Background
The UI in the hand tour is a very large block consumed, so how to reduce the performance overhead of the UI becomes a critical issue for hand tour optimization.
Therefore, a method and a device for image rendering are needed to reduce the number of drawcall occupied by the UI in the hand tour, reduce the switching of rendering states, and greatly reduce the time occupied by the UI rendering.
Disclosure of Invention
First, the technical problem to be solved
In order to solve the above problems in the prior art, the present invention provides a method for rendering a user interface with high rendering efficiency.
(II) technical scheme
In order to achieve the above purpose, the main technical scheme adopted by the invention comprises the following steps:
a method of user interface rendering, comprising the steps of:
s1, acquiring a UI rendering queue;
s2, carrying out batch processing according to the UI rendering queue;
and S3, rendering the UI batch unit subjected to the batch processing.
(III) beneficial effects
The invention has the beneficial effects that: acquiring a UI rendering queue; carrying out batch processing according to the UI rendering queue; and rendering is carried out on the UI batch units after the batch processing, so that the occupied Draw Call number is reduced, the switching of rendering states is reduced, and the time occupied by UI rendering is greatly reduced.
Drawings
FIG. 1 is a flow chart of a method of user interface rendering according to an embodiment of the present invention.
Detailed Description
The invention will be better explained by the following detailed description of the embodiments with reference to the drawings.
Example 1
Referring to fig. 1, a method for rendering a user interface includes the steps of:
s1, acquiring a UI rendering queue;
and carrying out grouping processing according to the UI rendering queue.
The grouping processing according to the UI batch unit specifically comprises the following steps:
according to the UI rendering queue, each UI and a corresponding grouping identifier in the UI rendering queue are obtained one by one;
the UIs with the same group identity are combined into a group.
S2, carrying out batch processing according to the UI rendering queue;
the step S2 specifically comprises the following steps:
according to the UI rendering queue, each UI and corresponding UI attributes in the UI rendering queue are obtained one by one;
and carrying out batch processing according to the UI attribute.
The batch processing according to the UI attribute specifically comprises the following steps:
and respectively judging whether the rendering state of the adjacent UI is the same as the affiliated atlas, and if the rendering state of the adjacent UI is the same as the affiliated atlas, carrying out batch processing on the adjacent UI.
The batch processing of adjacent UI is specifically as follows:
creating a batch, and caching data of the adjacent UI into the batch.
The step S3 is preceded by the following steps:
and rendering the UI rendering queue after the grouping processing.
And S3, performing rendering treatment on the UI rendering queue subjected to the batch treatment.
The step S3 specifically comprises the following steps:
and rendering the UI in the batch.
Example two
The difference between the present embodiment and the first embodiment is that the present embodiment will further explain how the above-mentioned user interface rendering method of the present invention is implemented with reference to a specific application scenario:
s1, acquiring a UI rendering queue;
and carrying out grouping processing according to the UI rendering queue.
The grouping processing according to the UI rendering queue specifically comprises the following steps:
according to the UI rendering queue, each UI and a corresponding grouping identifier in the UI rendering queue are obtained one by one;
the UIs with the same group identity are combined into a group.
Specifically, a groupId attribute, i.e., a packet identifier, is added to the UI, and a default value of 0 indicates that the packet is not involved.
When the groupId of the UI is set to a value other than 0, multiple rendering packets are newly created according to the differences of the groupId (how many kinds of groupids establish how many packets), that is, each time a new groupId occurs, one rendering packet is newly created, and the groupId of the UI contained in each rendering packet is the same, that is, the UIs representing the groupId are merged into the same packet for rendering.
In order to reduce the consumption of updating the rendering packet, all the rendering packet data has one copy on the GPU, if the cpu does not notify the update, the rendering packet is not required to be reconstructed according to the data on the original GPU, such as that the picture of the UI is not changed, the rendering state is not changed, and the information such as the position is not changed. If the above situation changes, the rendering packet corresponding to the original groupId needs to be cleared, and the vertex buffer data and index buffer data corresponding to the UI corresponding to the groupId need to be rewritten.
In order to control the rendering sequence of the rendering group, the UI is layered, and the UI contained in each layer is independently rendered, for example, the UI with the level of 2 is rendered after all the UI with the level of 1 is rendered, so that the problem of disordered rendering sequence is avoided.
S2, carrying out batch processing according to the UI rendering queue;
the step S2 specifically comprises the following steps:
according to the UI rendering queue, each UI and corresponding UI attributes in the UI rendering queue are obtained one by one;
and carrying out batch processing according to the UI attribute.
The batch processing according to the UI attribute specifically comprises the following steps:
and respectively judging whether the rendering state of the adjacent UI is the same as the affiliated atlas, and if the rendering state of the adjacent UI is the same as the affiliated atlas, carrying out batch processing on the adjacent UI.
The batch processing of adjacent UI is specifically as follows:
creating a batch, and caching data of the adjacent UI into the batch.
Specifically, the UI is rendered one by one according to the UI rendering queue, but before the current UI is rendered, a buffer policy is adopted, whether the rendering states of the current UI and the next UI to be rendered are the same (such as whether the rendering states of depthwrite, depthtest, stencilwrite, stenciltest, scissor, blend modes and the like are the same) is checked, whether the adopted primitives belong to the same atlas or not, if the conditions are satisfied, batch combination processing is performed, the rendering processing is temporarily not performed, the next traversal in the queue is continued, and the next or the same rendering state and atlas are performed, or the next or the same batch is stuffed, and the rendering processing is performed until the traversal reaches the rendering state or the atlas is different.
If the above conditions are met, a batch (including vertex buffer and index buffer) is newly created for merging individual UIs together for rendering, vertex buffer data and index buffer data of the UIs are written into the vertex buffer and index buffer created before writing, vertex coordinates are converted from local coordinates to world coordinates before writing, if the subsequent UI rendering state is the same as the current UI rendering state, the new vertex buffer and index buffer are written into the new vertex buffer and index buffer in the manner described above, the buffer is equivalent to a large container, and vertex buffer and index buffer data with the same rendering state of adjacent UIs and the corresponding atlas are merged into one.
The processing of vertex buffer data mainly comprises two points, namely, converting vertex coordinates from local coordinates to world coordinates, facilitating all UI unified coordinate systems in the same rendering state, and adding new parameters in vertex buffer, wherein the parameters represent indexes of primitives used by the UI in an atlas.
Taking a rendering process of a rendering queue comprising a UI1, a UI2, a UI3 and a UI4 as an example, wherein the rendering state of the UI1 is S1, the mapping is T1, the rendering state of the UI2 is S1, the mapping is T1, the rendering state of the UI3 is S2, the mapping is T2, the rendering state of the UI4 is S3, and the mapping is T3, so when the UI1 is rendered, when the rendering states of the UI2 and the UI1 are detected to be the same as the mapping, a new batch is created, and the data of the UI1 is cached in the batch; when the UI2 is rendered, detecting that the rendering states or the maps of the UI2 and the UI3 are different, adding the UI2 into the batch just established, and forcedly rendering the batch; when rendering the UI3, detecting that the UI3 and the UI4 are different in rendering state from the map, and forcing the UI3 to be directly rendered.
The step S3 is preceded by the following steps:
and rendering the UI rendering queue after the grouping processing.
Specifically, the UI for packet processing is to pull the UI after the packets out of the rendering queue, merge the batches, and then uniformly render at the end of the queue.
And S3, rendering the UI batch unit subjected to the batch processing.
The step S3 specifically comprises the following steps:
and rendering the UI in the batch.
The foregoing description is only illustrative of the present invention and is not intended to limit the scope of the invention, and all equivalent changes made by the specification and drawings of the present invention, or direct or indirect application in the relevant art, are included in the scope of the present invention.
Claims (6)
1. A method of user interface rendering, comprising the steps of:
s1, acquiring a UI rendering queue;
s2, carrying out batch processing according to the UI rendering queue;
s3, rendering the UI batch units subjected to batch processing;
the step S2 further includes:
performing grouping processing according to the UI rendering queue;
the grouping processing according to the UI rendering queue specifically comprises the following steps:
according to the UI rendering queue, each UI and a corresponding grouping identifier in the UI rendering queue are obtained one by one;
merging the UI with the same grouping identification into a group;
all the rendering packet data have one copy on the GPU, if the CPU does not notify updating, the data on the original GPU is rendered, if the UI picture is not changed, the rendering state is not changed and the position information is not changed, the rendering packet is not required to be reconstructed, if the situation is changed, the rendering packet corresponding to the original groupId is required to be cleared, and the vertex buffer data and the index buffer data corresponding to the UI corresponding to the groupId are rewritten.
2. The method of user interface rendering according to claim 1, wherein step S2 is specifically:
according to the UI rendering queue, each UI and corresponding UI attributes in the UI rendering queue are obtained one by one;
and carrying out batch processing according to the UI attribute.
3. The method for rendering a user interface according to claim 2, wherein the batch processing according to the UI attribute is specifically:
and respectively judging whether the rendering state of the adjacent UI is the same as the affiliated atlas, and if the rendering state of the adjacent UI is the same as the affiliated atlas, carrying out batch processing on the adjacent UI.
4. A method for rendering a user interface according to claim 3, wherein the batch processing of adjacent UIs is specifically:
creating a batch, and caching data of the adjacent UI into the batch.
5. The method of user interface rendering according to claim 4, wherein step S3 is specifically:
and rendering the UI in the batch.
6. The method of user interface rendering according to claim 1, further comprising, prior to step S3:
and rendering the UI rendering queue after the grouping processing.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010127457.4A CN111330270B (en) | 2020-02-28 | 2020-02-28 | User interface rendering method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010127457.4A CN111330270B (en) | 2020-02-28 | 2020-02-28 | User interface rendering method |
Publications (2)
Publication Number | Publication Date |
---|---|
CN111330270A CN111330270A (en) | 2020-06-26 |
CN111330270B true CN111330270B (en) | 2023-08-01 |
Family
ID=71173976
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010127457.4A Active CN111330270B (en) | 2020-02-28 | 2020-02-28 | User interface rendering method |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111330270B (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116541111B (en) * | 2023-04-06 | 2024-02-27 | 上海数聚软件***股份有限公司 | Canvas graphic rendering method, canvas graphic rendering device, electronic equipment and computer readable medium |
CN117271046B (en) * | 2023-11-23 | 2024-03-15 | 厦门东软汉和信息科技有限公司 | User interface rendering system, method, device and medium |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR20090023943A (en) * | 2007-09-03 | 2009-03-06 | 삼성전자주식회사 | Universal remote controller apparatus, universal remote controller system, and method thereof |
CN106296785A (en) * | 2016-08-09 | 2017-01-04 | 腾讯科技(深圳)有限公司 | A kind of picture rendering intent and picture rendering apparatus |
CN109646955A (en) * | 2018-12-20 | 2019-04-19 | 网易(杭州)网络有限公司 | Interface generation method, device and storage medium |
CN110555900A (en) * | 2019-09-05 | 2019-12-10 | 网易(杭州)网络有限公司 | rendering instruction processing method and device, storage medium and electronic equipment |
-
2020
- 2020-02-28 CN CN202010127457.4A patent/CN111330270B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR20090023943A (en) * | 2007-09-03 | 2009-03-06 | 삼성전자주식회사 | Universal remote controller apparatus, universal remote controller system, and method thereof |
CN106296785A (en) * | 2016-08-09 | 2017-01-04 | 腾讯科技(深圳)有限公司 | A kind of picture rendering intent and picture rendering apparatus |
CN109646955A (en) * | 2018-12-20 | 2019-04-19 | 网易(杭州)网络有限公司 | Interface generation method, device and storage medium |
CN110555900A (en) * | 2019-09-05 | 2019-12-10 | 网易(杭州)网络有限公司 | rendering instruction processing method and device, storage medium and electronic equipment |
Also Published As
Publication number | Publication date |
---|---|
CN111330270A (en) | 2020-06-26 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP3216059B2 (en) | Work station | |
US10013503B2 (en) | Canvas element rendering method and apparatus implemented on android system based on GPU | |
US8941663B2 (en) | Method and device for rendering user interface font | |
CN111330270B (en) | User interface rendering method | |
CN109471900B (en) | Interaction method and system for chart data custom action data | |
CN113368492A (en) | Rendering method and device | |
CN106340055A (en) | Multithreading-based OpenGL quick drawing method | |
WO2023160167A1 (en) | Image processing method, electronic device, and storage medium | |
CN105847319A (en) | Mobile terminal network request method and system | |
CN109271247A (en) | Memory Optimize Method, device, computer installation and storage medium | |
US20200013137A1 (en) | Fixed-stride draw tables for tiled rendering | |
CN106683033B (en) | Out-of-order OpenGL interface processing method | |
CN117274030A (en) | Vulkan drawing flow optimization method for mobile terminal | |
US20150242988A1 (en) | Methods of eliminating redundant rendering of frames | |
CN111475231A (en) | Method and device for generating occupation bitmap, electronic equipment and readable medium | |
CN111078384A (en) | Method and device for migrating core data, computer equipment and storage medium | |
CN110874856A (en) | Optimization method for real-time rendering of GUI (graphical user interface) based on GPU (graphics processing Unit) characteristics | |
CN115861510A (en) | Object rendering method, device, electronic equipment, storage medium and program product | |
CN115373618A (en) | Multi-screen display method and device, vehicle machine and storage medium | |
CN107193908B (en) | The update method and device of visual field list | |
CN108897537A (en) | Document display method, computer-readable medium and a kind of computer | |
US11941740B2 (en) | System, devices and/or processes for graphics vertex processing | |
WO2023020124A1 (en) | Data processing method and apparatus, and computing device and system | |
CN112348934B (en) | Game map display method, device and medium based on large linked list | |
WO2022161199A1 (en) | Image editing method and device |
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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |