Damaged area statistics method of wayland optimization graph synthesizer

By differentiating damage types in the Wayland compositor and removing damage that does not cause changes in the visible area, the number of rendering iterations is optimized, solving the problem of unnecessary rendering of occluded areas in the Wayland compositor and improving rendering efficiency and performance.

CN118535116APending Publication Date: 2024-08-23KYLIN CORP
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410745670.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-11
Publication Date
2024-08-23

AI Technical Summary

Technical Problem

The current Wayland compositor does not differentiate between the sources of damage when calculating damage, resulting in occluded areas being counted as needing rendering, causing unnecessary rendering and reducing rendering efficiency.

Method used

During the damage statistics phase, damage is categorized into types that cause changes in the visible area and types that do not. Damage that does not cause changes in the visible area is removed when re-rendering the display frame. The visible area and rendering area are calculated by traversing the nodes to optimize the number of rendering operations.

Benefits of technology

It reduces unnecessary rendering times, improves rendering efficiency and performance, and prevents unnecessary rendering of occluded parts.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118535116A
    Figure CN118535116A
Patent Text Reader

Abstract

The invention discloses a method for counting a damaged area by a wayland optimization graph synthesizer, which comprises the following steps of: S1, respectively collecting damage possibly causing visible area change and damage not causing visible area change, and simultaneously generating a request for re-rendering a display frame; s2, taking the collected damage possibly causing the change of the visible region as an initial overall visible region, wherein the initial invisible region is empty; s3, traversing all nodes from top to bottom in the coordinate system, and calculating a visible region of each node in sequence; s4, obtaining an intersection of the visible areas of all the nodes and the damage of the nodes to obtain an effective damage of each node, and obtaining a union set of the effective damage of all the nodes and the damage possibly causing the change of the visible areas to obtain a total damage; s5, taking an intersection with the visible region of each node by using the overall damage to obtain a rendering region of each node; and step S6, starting a process of re-rendering the frame, and rendering each node according to the rendering area of the node. The rendering area is an area where the updating node needs to be re-rendered to a new display frame; and S7, converting the coordinate system of the node rendering area into a screen coordinate system to render the node, and completing the operation of rendering the node content to a new display frame. Through the method, the number of rendering times and regions is reduced, the computer rendering load is reduced, and the user experience is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the technical field of image rendering, and in particular to a method for statistically analyzing damaged areas of a Wayland optimized graphics synthesizer. Background Art

[0002] The current mainstream Wayland compositors in the world do not distinguish the ways in which damage is generated when counting damage. Regardless of the way in which damage is generated, it is directly counted in the overall damage. When the window is blocked, the current Wayland compositors often count damage that is larger than the actual area that needs to be rendered.

[0003] For example, when a Wayland client is playing a video or a piece of music, or a dynamic wallpaper is used on the desktop, according to the current damage statistics method, even the obscured part will generate damage to the overall damage, so that the synthesizer will render the obscured area at least once unnecessarily. However, in this case, the obscured part does not need to be rendered.

[0004] Chinese patent invention authorization number CN115686727B, a synthetic rendering implementation method based on wlroots, this invention relates to a synthetic rendering implementation method based on wlroots, which distinguishes between transparent areas and opaque areas. When rendering, all nodes are traversed, transparent nodes are filtered first, and opaque nodes are rendered from top to bottom. After traversing all opaque nodes, transparent nodes are traversed again and rendered from bottom to top, that is, the rendering order of opaque nodes from bottom to top in the existing technology is adjusted to rendering from top to bottom. Since the intersection area is eliminated from the beginning, there is no need to render the covered nodes, which reduces the damaged area and rendering times, and improves rendering efficiency and performance. This patent invention is to reduce the rendering times by eliminating the occluded areas after completing the damage statistics, that is, after obtaining the overall damage, and does not involve how to count the damage.

[0005] Chinese invention patent authorization number CN107291561B, a graphics synthesis method, an information interaction method and a system, the application discloses a graphics synthesis method, an information interaction method and a system. In this application, the first control in the first subsystem receives the graphic data sent by the graphic object corresponding to the first control in the graphic synthesizer of the second subsystem, and the first control sends the received graphic data to the graphic synthesizer of the first subsystem. It can be seen that in the first subsystem, there is a corresponding first control corresponding to the graphic object in the graphic synthesizer of the second subsystem. The first control provides a transmission function of graphic data between the two subsystems, thereby achieving compatibility between different operating systems at the graphics processing level. However, this application does not involve the problem of damage formation of the graphic synthesizer, but solves the problem of data synchronization of controls under different graphic synthesizers, thereby achieving compatibility between systems. Summary of the invention

[0006] To solve the above problems, the purpose of the present invention is to provide a method for Wayland to optimize the statistics of damaged areas of a graphics synthesizer, by eliminating unnecessary damage in the damage statistics stage, thereby optimizing the rendering times.

[0007] The method for calculating the damaged area of ​​the Wayland optimized graphic synthesizer of the present invention comprises the following steps: Step S1: respectively collecting damage that may cause visible area changes and damage that does not cause visible area changes, and generating a request for re-rendering a display frame at the same time; Step S2: The collected damage that may cause the visible area change is used as the initial overall visible area, and the initial invisible area is empty; Step S3: traverse all nodes in order from top to bottom in the coordinate system, and calculate the visible area of ​​each node in turn; Step S4, taking the intersection of the visible area of ​​all nodes and the damage of the nodes to obtain the effective damage of each node, and taking the union of the effective damage of all nodes and the damage that may cause the visible area change to obtain the overall damage; Step S5, using the overall damage and the visible area of ​​each node to obtain the rendering area of ​​each node; Step S6, starting the process of re-rendering the frame, rendering each node according to its rendering area. The rendering area is the area where the updated node needs to be re-rendered to the new display frame; Step S7, converting the coordinate system of the node rendering area into the screen coordinate system to render the node, and completing the operation of rendering the node content to the new display frame.

[0008] Wherein, the step S3 comprises: Step S31: converting the visible area of ​​the corresponding node in the initial state into the scene coordinate system, minus the intersection of the overall invisible area in the previous traversal cycle and the corresponding node area in the updated state, to obtain the first visible area of ​​the corresponding node; Step S32: taking the intersection of the corresponding node area in the updated state and the overall visible area in the previous traversal cycle to obtain the second visible area of ​​the corresponding node; Step S33: taking the union of the first visible area and the second visible area to obtain the visible area of ​​the corresponding node.

[0009] Wherein, the step S3 further includes: Step S34: updating the overall visible area and the overall invisible area of ​​the current traversal cycle as a basis for calculating the visible area of ​​the corresponding node in the next traversal cycle.

[0010] Wherein, in the step S34, The total visible area of ​​the current traversal cycle = the total visible area of ​​the previous traversal cycle minus the intersection of the opaque area of ​​the corresponding node in the corresponding update state of the current traversal cycle and the damage that may cause the visible area to change; The total invisible area of ​​the current traversal cycle = the union of the total invisible area of ​​the previous traversal cycle and "the intersection of the opaque area of ​​the corresponding node in the corresponding update state of the current traversal cycle and the damage that may cause changes in the visible area".

[0011] The beneficial effects of the present invention are as follows: 1. The node visible area is calculated only after the new display frame is re-rendered. Compared with updating the node visible area immediately every time the node is moved or adjusted, unnecessary calculations are reduced. 2. The originality of the implementation method, which classifies the damage collected by the synthesizer; 3. Prevents unnecessary rendering when updating the content of the obscured part. BRIEF DESCRIPTION OF THE DRAWINGS

[0012] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0013] Figure 1-1 This is a schematic diagram of the first embodiment of the present invention in an initial state; Figure 1-2 This is a schematic diagram of the first embodiment of the present invention in an updated state; Figure 1-3This is a schematic diagram after traversing node 1 in the first embodiment of the present invention; Figure 1-4 This is a schematic diagram after traversing node 2 and node 3 in the first embodiment of the present invention; Figure 2-1 This is a schematic diagram of the second embodiment of the present invention in the initial state; Figure 2-2 This is a schematic diagram of the second embodiment of the present invention in an updated state; Figure 2-3 This is a schematic diagram after traversing node 1 in the second embodiment of the present invention; Figure 2-4 This is a schematic diagram after traversing nodes 2 and 3 in the second embodiment of the present invention; Figure 3-1 This is a schematic diagram of the initial state of the third embodiment of the present invention; Figure 3-2 This is a schematic diagram of the third embodiment of the present invention in an updated state. DETAILED DESCRIPTION

[0014] The technical scheme in the embodiment of the present invention is described clearly and completely below in conjunction with the accompanying drawings in the embodiment of the present invention. In the following description, many specific details are set forth to facilitate a full understanding of the present invention, but the present invention can also be implemented in other ways different from those described herein, and those skilled in the art can make similar generalizations without violating the connotation of the present invention, so the present invention is not limited by the specific embodiments disclosed below.

[0015] First, the abbreviations and key term definitions used in the present invention are introduced: Graphics synthesizer: refers to a service in the operating system that manages clients and synthesizes all client content into a display frame and sends it to the hardware device for display output. The Wayland synthesizer is a type of operating system graphics synthesizer. For the convenience of description, the Wayland synthesizer described in the present invention is the graphics synthesizer.

[0016] Wayland: Wayland is a communication protocol that specifies the communication method between the display service and its client, and the display service using this protocol is called a Wayland compositor.

[0017] Node: The smallest unit that needs to be displayed on the desktop operating system. A window of the Wayland client can be regarded as a node.

[0018] Damage area: The damage area (hereafter referred to as damage) is a direct translation of the English word "damage". In a graphics display system, it is an area indicating that the next frame displayed has undergone a change in the image compared to the previous frame displayed.

[0019] As can be seen from the background technology, the current Wayland compositor, according to the damage statistics method, even the occluded part will cause damage to the overall damage, so that the compositor performs unnecessary rendering on the occluded area at least once.

[0020] In order to overcome the above problems, the present invention provides a method for Wayland to optimize the statistics of damaged areas of a graphics synthesizer, which eliminates unnecessary damage in the damage statistics stage, thereby optimizing rendering calculations and rendering times and improving rendering efficiency and performance.

[0021] When damage is formed, this method divides the damage into damage that causes changes in the visible area and damage that does not cause changes in the visible area. The damage that causes changes in the visible area is taken as the overall damage. For damage that does not cause changes in the visible area, this damage is recorded in the current node for subsequent use. At this time, a request to re-render the display frame is issued and the node is updated. When the display frame synthesis is started, the node visible area of ​​the node in the desktop operating system is first calculated and updated based on the damage that causes changes in the visible area. Then, the intersection of the damage that does not cause changes in the visible area and the node visible area is taken, and the intersection is counted into the overall damage. The overall damage is counted by traversing all nodes, and synthetic rendering is performed based on the overall damage, thereby eliminating unnecessary rendering.

[0022] In order to enable persons skilled in the art to better understand the present application, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments.

[0023] Reference Figure 1-1 to Figure 1-4 As shown, a first embodiment of a method for calculating the damaged area of ​​a Wayland optimized graphics synthesizer according to the present invention specifically includes the following steps: Step S1, collecting damage that may cause visible area changes and damage that does not cause visible area changes respectively, and generating a request for re-rendering a display frame at the same time; Specifically, refer to Figure 1-1 and Figure 1-2 As shown in the figure, the damage that may cause changes in the visible area involves damage caused by moving the window, adjusting the window hierarchy, adjusting the window size, etc. Figure 1-1 and Figure 1-2 The specific manifestation in the figure is that node 1 (the purple circled area) and node 2 (the yellow circled area) move to the right, so that the area position of the corresponding node changes. All areas that may change are regarded as areas that may cause changes in the visible area. Figure 1-1 to Figure 1-4It is represented by the area encircled by the green part (this area is determined in advance based on all the nodes that cause the position change of the area, and only node 1 and node 2 are shown in this embodiment); in other words, the position of the nodes within the green area will change, and the position of the nodes outside the green area will not change (otherwise the range of the green area needs to be reconfirmed).

[0024] Damage that does not cause changes in the visible area (referred to as node damage, not shown in the figure) involves, for example, changes in the window display content, and the change in the display content does not affect the transparent and opaque areas of the node. Figure 1-1 to Figure 1-4 The blue circled area of ​​Node 3 is shown in the figure (the position of Node 3 does not change after the update relative to the initial state). Part of Node 3 is outside the green area, so the position of Node 3 does not change before and after the update.

[0025] In this embodiment, when a user uses a desktop operating system that uses a Wayland synthesizer, part of the user's interaction with the operating system will be mapped to the communication between the Wayland client and the Wayland synthesizer, and part will interact directly with the Wayland synthesizer.

[0026] There is a part of the content in the wayland client and the wayland synthesizer that represents the damage caused by the client, indicating that this part of the client content has changed. The synthesizer needs to re-render this area in the next frame. This damage will not cause changes in the visible area of ​​the wayland client, that is, changes in the visible area of ​​the node.

[0027] Damage can also occur when the user interacts directly with the Wayland compositor, such as moving windows, adjusting window levels, and resizing windows. These operations will cause changes in the visible area of ​​the Wayland client, which is called damage that causes visible area changes.

[0028] Step S2: Figure 1-2 As shown, the collected damage that may cause changes in the visible area is used as the initial overall visible area, and the initial invisible area is empty.

[0029] Step S3: traverse all nodes in order from top to bottom in the coordinate system, and calculate the visible area of ​​each node in turn; Specifically, the coordinate system takes the direction perpendicular to the screen as the Z axis, Z+ is the direction pointing to the front of the screen, z- is the direction pointing to the back of the screen, and the node with the larger Z axis value is the upper layer.

[0030] The present invention Figure 1-1 to Figure 1-4The process of traversing from node 1 to node 3 from top to bottom is shown. In this embodiment, it is assumed that the entire node from node 1 to node 3 is an opaque area. Taking node 3 as an example, the specific process of calculating the visible area of ​​a node includes: Step S31: convert the visible area of ​​node 3 in the initial state into the scene coordinate system, and then subtract the intersection of the overall invisible area in the previous traversal cycle and the area of ​​node 3 in the updated state to obtain the first visible area of ​​node 3; "Node 3 area" refers to the area where the entire node 3 is located. In the initial state, it corresponds to Figure 1-1 The set of shaded areas pointed to by the blue lines A and B in the middle corresponds to the updated state. Figure 1-2 The set of shaded areas pointed to by the blue lines A' and B'; the shaded areas pointed to by the lines B and B' are the parts of node 3 that are blocked by the opaque areas of nodes 1 and 2; The meaning of "the visible area of ​​node 3 in the scene coordinate system in the initial state" is: Figure 1-1 The area pointed to by the blue line A (i.e. the area of ​​node 3 that is not covered by other nodes in the initial state) is converted to Figure 1-2 The visible area obtained in the updated state. In this embodiment, since the position of node 3 has not changed, the positions of "the visible area of ​​node 3 in the initial state" and "the visible area of ​​node 3 in the scene coordinate system in the initial state" are coincident. Figure 1-1 The area pointed by the middle blue line A; The "total invisible area in the previous traversal cycle" refers to the total invisible area after traversing nodes 1 and 2 (that is, after traversing node 2), corresponding to Figure 1-4 The dark shadow part of the middle picture; In fact, since nodes 1 and 2 move to the right, the intersection of the total invisible area in the previous traversal cycle and the area of ​​node 3 in the updated state decreases after the update (expressed as Figure 1-2 The shaded area pointed by the blue line B' is relative to Figure 1-1 The shaded area pointed to by the blue line B in the figure is reduced); therefore, in this embodiment, the essence of step S31 is to subtract the area B' which has no intersection with area A from area A, and the result is still area A itself; and after the update of node 3, since the area blocked by nodes 1 and 2 is reduced, the visible area of ​​node 3 should be larger than that of area A; Therefore, it is necessary to calculate the newly exposed part after the update. Figure 1-3 and Figure 1-4 The area pointed to by the blue line C (that is, the area where nodes 1 and 2 move to the right); Step S32: Take the intersection of the node 3 area in the updated state and the overall visible area in the previous traversal cycle to obtain the second visible area of ​​node 3, corresponding to Figure 1-4 The area pointed to by the middle blue line D; Step S33: taking the union of the first visible area and the second visible area to obtain the visible area of ​​node 3.

[0031] In the present invention, the so-called invisible area is the union of the opaque areas of all nodes in the traversal cycle before the current traversal cycle in the damage that may cause changes in the visible area. Therefore, in the actual calculation process, the opaque area of ​​each node in the green area is continuously subtracted in an accumulation manner to obtain the overall visible area and the overall invisible area of ​​each traversal cycle.

[0032] Step S34: updating the overall visible area and the overall invisible area of ​​the current traversal cycle as a basis for calculating the visible area of ​​node 4 in the next traversal cycle; The total visible area of ​​the current traversal cycle = the total visible area of ​​the previous traversal cycle minus "the intersection of the opaque area of ​​node 3 in the corresponding update state of the current traversal cycle and the damage that may cause changes in the visible area"; corresponding Figure 1-4 The black area in the bottom picture; The total invisible area of ​​the current traversal cycle = the union of the total invisible area of ​​the previous traversal cycle and the intersection of the opaque area of ​​node 3 in the corresponding update state of the current traversal cycle and the damage that may cause changes in the visible area; or, the total invisible area of ​​the current traversal cycle = the damage that may cause changes in the visible area minus the total visible area of ​​the current traversal cycle; Step S4, taking the intersection of the visible area of ​​all nodes and the damage of the nodes (not shown in the figure) to obtain the effective damage of each node, and taking the union of the effective damage of all nodes and the damage that may cause the visible area to change to obtain the overall damage.

[0033] Step S5: Using the overall damage and the visible area of ​​each node to obtain the intersection, the rendering area of ​​each node is obtained.

[0034] Another concise way to say step S4 and step S5 is: the rendering area of ​​each node = the intersection of the visible area of ​​each node and the node damage + the intersection of the visible area of ​​each node and the damage that may cause the visible area to change; Step S6, start the process of re-rendering the frame, and render each node according to its rendering area. The rendering area is the area where the updated node needs to be re-rendered to the new display frame.

[0035] Step S7, converting the coordinate system of the node rendering area into the screen coordinate system to render the node, and completing the operation of rendering the node content to the new display frame.

[0036] Figure 2-1 to Figure 2-4 FIG. 1 is a flow chart of another embodiment of the present invention, which also shows a detailed traversal process in step S3. The difference from the first embodiment is that after the node is updated, node 1 and node 2 move left, and the shadow area covering node 3 becomes larger. At this time, when implementing step S31, Figure 2-1 The area pointed by the blue line A is subtracted Figure 2-4 The union of the shadow part of the middle picture and the node 3 area is Figure 2-3 and Figure 2-4 The area pointed to by the blue line A' is easy to understand.

[0037] It should be particularly noted that for this embodiment, when step S32 is implemented, the obtained second visible area is empty.

[0038] Figure 3-1 and Figure 3-2 This is a flow chart of the third embodiment of the present invention, which only shows the initial state and the update state, and does not show the complete traversal process. Figure 3-1 and Figure 3-2 To facilitate understanding of the above-mentioned "the visible area of ​​node 3 in the initial state is converted into the scene coordinate system", in this embodiment, the positions of nodes 1 to 3 have all changed, and together with other nodes (not shown in the figure), the damage circled in green that causes the visible area to change is determined. Compared with the initial state, the updated state has nodes 1 to 3 moving to the right by a certain position. Figure 3-2 The area pointed by the red line C is the rightward shift of node 1-node 3. Assuming that the visible area of ​​node 3 in the initial state (that is, Figure 3-1 Area A in the previous traversal cycle minus the intersection of the overall invisible area and the area of ​​node 3 in the updated state (that is, Figure 3-2 The first visible area of ​​node 3 will be Figure 3-2The set of areas pointed to by line A' and line C in the middle; in other words, when determining the visible area of ​​a node whose position has changed, if the node is not converted to the scene coordinate system, the part of the visible area C that is the difference between the initial state and the updated state of this node will also be calculated, and this C obviously does not belong to the visible area of ​​node 3 in the updated state. Therefore, it is necessary to convert the scene coordinate system of the node corresponding to the current traversal cycle: after aligning the position of node 3 in the initial state with the position of node 3 in the updated state, the visible area of ​​node 3 in the initial state is mapped to the corresponding area on node 3 in the updated state, which is the visible area obtained after the visible area of ​​node 3 in the initial state is converted to the scene coordinate system.

[0039] Although the present invention has been described using the above preferred embodiments, they are not intended to limit the scope of protection of the present invention. Any person skilled in the art may make various changes and modifications to the above embodiments without departing from the spirit and scope of the present invention. The scope of protection of the present invention shall be based on the definition of the claims.

Claims

1. A method for optimizing the statistical damage area of ​​the graphics synthesizer in Wayland, It is characterized in that The following steps are involved: Step S1: respectively collecting damage that may cause visible area changes and damage that does not cause visible area changes, and generating a request for re-rendering a display frame at the same time; Step S2: The collected damage that may cause the visible area change is used as the initial overall visible area, and the initial invisible area is empty; Step S3: traverse all nodes in order from top to bottom in the coordinate system, and calculate the visible area of ​​each node in turn; Step S4, taking the intersection of the visible area of ​​all nodes and the damage of the nodes to obtain the effective damage of each node, and taking the union of the effective damage of all nodes and the damage that may cause the visible area change to obtain the overall damage; Step S5, using the overall damage and the visible area of ​​each node to obtain the rendering area of ​​each node; Step S6, starting the process of re-rendering the frame, rendering each node according to its rendering area; the rendering area is the area where the updated node needs to be re-rendered to the new display frame; Step S7, converting the coordinate system of the node rendering area into the screen coordinate system to render the node, and completing the operation of rendering the node content to the new display frame.

2. The method for optimizing the statistics of the damaged area of ​​the graphics synthesizer by wayland as claimed in claim 1, Features: The step S3 comprises: Step S31: converting the visible area of ​​the corresponding node in the initial state into the scene coordinate system, minus the intersection of the overall invisible area in the previous traversal cycle and the corresponding node area in the updated state, to obtain the first visible area of ​​the corresponding node; Step S32: taking the intersection of the corresponding node area in the updated state and the overall visible area in the previous traversal cycle to obtain the second visible area of ​​the corresponding node; Step S33: taking the union of the first visible area and the second visible area to obtain the visible area of ​​the corresponding node.

3. The method for optimizing the statistics of damaged areas of a graphics synthesizer by wayland as claimed in claim 2, Features: The step S3 further comprises: Step S34: updating the overall visible area and the overall invisible area of ​​the current traversal cycle as a basis for calculating the visible area of ​​the corresponding node in the next traversal cycle.

4. The method for optimizing the statistics of damaged areas of a graphics synthesizer using Wayland as claimed in claim 3, Features: In the step S34, The total visible area of ​​the current traversal cycle = the total visible area of ​​the previous traversal cycle minus the intersection of the opaque area of ​​the corresponding node in the corresponding update state of the current traversal cycle and the damage that may cause changes in the visible area; The total invisible area of ​​the current traversal cycle = the union of the total invisible area of ​​the previous traversal cycle and "the intersection of the opaque area of ​​the corresponding node in the corresponding update state of the current traversal cycle and the damage that may cause changes in the visible area".