Rendering node detection method and electronic equipment

By detecting the overlapping information between rectangular areas and scan line segments in electronic devices, the redundant drawing problem of obscured rendering nodes is solved, and the efficiency of rendering node detection and processor performance are improved.

CN120704774APending Publication Date: 2025-09-26HUAWEI TECH CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202510013306.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-03
Publication Date
2025-09-26

AI Technical Summary

Technical Problem

In the prior art, electronic devices still generate drawing instructions for obscured rendering nodes during the graphics rendering process, resulting in redundant processor load, causing lag and performance loss.

Method used

A rendering node detection method is adopted. By obtaining the overlapping information of rectangular areas and scan line segments, a one-dimensional algorithm is used to determine whether the rendering node is blocked, thereby reducing the detection complexity and overhead.

Benefits of technology

It effectively reduces the processor load, reduces redundant drawing instructions, and improves the efficiency of rendering node detection and system performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120704774A_ABST
    Figure CN120704774A_ABST
Patent Text Reader

Abstract

The invention discloses a rendering node detection method and electronic equipment, and relates to the technical field of electronic equipment. The shielded rendering nodes can be detected, the detection complexity and overhead are reduced, and the detection efficiency is improved. The method comprises the steps that the electronic equipment obtains certain rectangular areas included in a to-be-rendered image, and each rectangular area is used for drawing a rendering node; then, the electronic equipment determines a length unit which is included in each scanning line segment which is overlapped with the rectangular area and is overlapped with the rectangular area; when each length unit which is included in each scanning line segment and is overlapped with the rectangular area and the corresponding first information represent that the corresponding length unit is overlapped with the rectangular area on the upper layer of the rectangular area, the rendering node corresponding to the rectangular area is hidden.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of electronic equipment, in particular to a method for detecting a rendering node and an electronic device. Background Art

[0002] With the advancement of electronic device technology, graphics rendering and display, as a key function of electronic devices, have brought users an increasingly rich visual experience. This function relies on the cooperation of the electronic device's processors, such as the central processing unit (CPU) and graphics processing unit (GPU). If the load brought by this function exceeds the processing capacity of the processor, it can easily cause various problems such as lag, frame drop, and image lag.

[0003] In reality, the graphical interface generated by graphics rendering consists of many rendering nodes, some of which may be obscured and hidden from the user. However, during the graphics rendering process, the electronic device's processor still generates drawing instructions for these invisible rendering nodes to render them, which places a significant redundant load on the processor. Therefore, detecting these obscured rendering nodes and avoiding their rendering is crucial for reducing processor load and saving processor overhead. Summary of the Invention

[0004] The present application provides a rendering node detection method and electronic device, which can detect obscured rendering nodes, reduce detection complexity and overhead, and improve detection efficiency.

[0005] To achieve the above objectives, this application adopts the following technical solutions:

[0006] In a first aspect, a rendering node detection method is provided for an electronic device with a display screen. The method includes: obtaining a first rectangular area, the first rectangular area being one of M rectangular areas included in an image to be rendered, each of the M rectangular areas being used to draw a rendering node, where M is an integer greater than or equal to 1; and determining K length units that overlap with the first rectangular area in each of X scan line segments, the X scan line segments being scan line segments corresponding to the M rectangular areas that overlap with the first rectangular area, where X and K are both integers greater than or equal to 1, and the scan line segments corresponding to the M rectangular areas being obtained based on two scan line segments obtained from each of the M rectangular areas, the two scan line segments respectively coinciding with two parallel boundary lines included in the rectangular area. The electronic device can determine whether the rendering node corresponding to the first rectangular area is hidden based on first information corresponding to each of the K length units included in each of the X scan line segments.

[0007] Based on the above technical solution, for each rectangular area corresponding to a rendering node in an image to be rendered, the electronic device can determine each scan line segment that overlaps with the rectangular area. Then, based on the first information corresponding to the length unit included in each scan line segment that overlaps with the rectangular area, the electronic device can determine whether the rendering node corresponding to the rectangular area is hidden. In this way, the electronic device only needs to detect scan line segments that overlap with each rectangular area in the image to be rendered. For an image to be rendered, the average number of scan line segments that overlap with each rectangular area in the image to be rendered is a fixed value. Therefore, the algorithm complexity of the above detection scheme can meet the requirements of a one-dimensional algorithm (a×c), where a represents the number of rectangular areas corresponding to all rendering nodes in the graphical interface (i.e., an image to be rendered), and c represents the average number of scan line segments that overlap with a rectangular area. c is a constant value and must be less than a. Compared to a two-layer loop implemented using a two-dimensional algorithm, a single-layer loop implemented using this one-dimensional algorithm can significantly reduce detection complexity and overhead, thereby improving detection efficiency.

[0008] In one possible design, when the first information corresponding to each of the K length units included in each of the X scan line segments indicates that the length unit overlaps with a second rectangular area among the M rectangular areas, the rendering node corresponding to the first rectangular area is hidden, where the second rectangular area is a rectangular area above the first rectangular area. Optionally, the number of the second rectangular areas is at least one.

[0009] Thus, when the first information corresponding to the length unit overlapping with a rectangular area included in each scan line segment of all scan line segments overlapping with the rectangular area indicates that the corresponding length unit overlaps with a rectangular area above the rectangular area, the rectangular area is hidden by the rectangular area above it, and thus, the rendering node corresponding to the rectangular area is hidden. For a rectangular area, the electronic device can determine whether the rectangular area is hidden, and thus whether the rendering node corresponding to the rectangular area is hidden, by detecting the first information corresponding to several length units overlapping with the rectangular area.

[0010] In one possible design, the method further includes: when first information corresponding to at least one length unit of the K length units included in at least one scan line segment among the X scan line segments indicates that the at least one length unit does not overlap with the second rectangular area, the rendering node corresponding to the first rectangular area is not hidden.

[0011] In this way, when a scan line segment that overlaps with a rectangular area includes first information corresponding to a certain length unit in the length units that overlap with the rectangular area, indicating that the length unit does not overlap with the rectangular area above the rectangular area, it means that the area in the rectangular area that overlaps with the length unit is not blocked, and it can be determined that the corresponding rendering node in the rectangular area is not hidden.

[0012] In one possible design, before detecting that the rendering node corresponding to the first rectangular area is hidden, the method further includes: obtaining the second rectangular area; determining that each of the Y scan line segments includes L length units that overlap with the second rectangular area, the Y scan line segments being the scan line segments corresponding to the M rectangular areas that overlap with the second rectangular area, and both Y and L are integers greater than or equal to 1; determining the first information corresponding to each of the L length units, the L length units including part or all of the K length units. Optionally, the electronic device determining the first information corresponding to the length unit may refer to generating the first information, that is, the first information does not exist before the electronic device performs the operation of determining the first information. Alternatively, the electronic device determining the first information corresponding to the length unit may also refer to updating the content of the first information.

[0013] When a second rectangular area completely blocks a first rectangular area, the L length units may include all of the K length units. When multiple second rectangular areas jointly block a first rectangular area, the L length units included in one of the second rectangular areas may include part of the K length units. Alternatively, when a rectangular area is not jointly blocked by at least one second rectangular area, the L length units included in one of the second rectangular areas may also include part of the K length units, or may not include any of the K length units.

[0014] In this way, the electronic device can detect the second rectangular area before detecting the first rectangular area. The second rectangular area is a rectangular area in the upper layer of the first rectangular area. That is to say, the electronic device can detect the rectangular areas in order from the upper layer to the lower layer. Moreover, when the electronic device has finished detecting the upper rectangular area, it can determine the first information corresponding to each length unit that overlaps with the upper rectangular area to indicate that these length units have overlapped with the upper rectangular area. Subsequently, for the lower rectangular area, the electronic device can determine whether the lower rectangular area is hidden by obtaining the first information corresponding to each length unit that has been previously determined to overlap with the rectangular area. By traversing the rectangular areas from the upper layer to the lower layer and determining the first information corresponding to the length unit, when detecting the lower rectangular area, the first information is used to avoid the need to judge whether each length unit that overlaps with the rectangular area overlaps with each rectangular area in the upper layer one by one, thereby reducing the complexity and overhead of detection and improving detection efficiency.

[0015] In one possible design, before acquiring the second rectangular area, the first information corresponding to each of the L length units is used to indicate that the length unit does not overlap with the rectangular area. Thus, before detecting the topmost rectangular area, the first information corresponding to the length units that overlap with the rectangular area can be used to indicate that the length units do not overlap with the rectangular area. Subsequently, after detecting the rectangular area, the first information corresponding to the length units that overlap with the rectangular area can be updated to indicate that these length units overlap with the rectangular area using the updated first information.

[0016] In one possible design, determining the first information corresponding to each of the L length units includes: determining the first information to be a first value when the length unit does not overlap with a rectangular area; determining the first information to be a second value when the length unit overlaps with the rectangular area; and the first value being different from the second value. That is, when the first information indicates that the length unit does not overlap with the rectangular area, the first information is the first value; when the first information indicates that the length unit overlaps with the rectangular area, the first information is the second value, and the first value is different from the second value.

[0017] In this way, the first information can be implemented as different values ​​to indicate whether the corresponding length unit overlaps with the rectangular area.

[0018] In one possible design, the first value may include w zeros, and the value 2 may include w ones. Alternatively, the value 1 may include w ones, and the value 2 may include w zeros, where w is a preset integer greater than or equal to 1.

[0019] In one possible design, the two parallel boundary lines are the upper boundary line and the lower boundary line of the rectangular area, and the length of the scanning line segment is greater than or equal to the width of the display screen; or the two parallel boundary lines are the left boundary line and the right boundary line of the rectangular area, and the length of the scanning line segment is less than or equal to the height of the display screen.

[0020] In one possible design, each of the scan line segments corresponding to the M rectangular areas is equally divided into N length units, where N is a preset positive integer, and the K length units included in each of the scan line segments that overlap with the first rectangular area are part or all of the N length units into which the scan line segment is equally divided.

[0021] In one possible design, each of the scan line segments corresponding to the M rectangular areas is equally divided into q intervals, each of the q intervals includes p length units, N = p × q, and p and q are both preset positive integers; determining the K length units that overlap with the first rectangular area in each of the X scan line segments includes: determining V intervals that overlap with the first rectangular area in each of the X scan line segments, the V intervals including the K length units, where V is an integer greater than or equal to 1 and less than or equal to q.

[0022] It is understood that, for a rectangular area, the intervals that overlap with the rectangular area may include intervals that partially overlap with the rectangular area and intervals that completely overlap with the rectangular area. That is, when a portion of an interval overlaps with the rectangular area, the interval is also considered to overlap with the rectangular area.

[0023] Thus, for a scan line segment that overlaps with a rectangular area, the intervals included in the scan line segment that overlap with the rectangular area are determined. An interval can include at least one length unit. By detecting the intervals, the detection efficiency can be improved.

[0024] In one possible design, when determining, based on the first information corresponding to each of the K length units, that the length unit overlaps with a second rectangular area in the M rectangular areas, detecting that the rendering node corresponding to the first rectangular area is hidden includes: obtaining a first mask corresponding to each of the R intervals and a second mask corresponding to each of the VR intervals, where the V intervals include the R intervals and the VR intervals, R is a positive integer greater than or equal to 1 and less than or equal to V, each of the R intervals partially overlaps with the first rectangular area, and each of the VR intervals completely overlaps with the first rectangular area, the first mask includes p bits, and the second mask includes 1 bit; the first mask corresponding to the R intervals indicates that a length unit in the interval that overlaps with the first rectangular area overlaps with the second rectangular area, and the second mask corresponding to the VR intervals indicates that the interval overlaps with the second rectangular area, and the first rectangular area is hidden. The first mask corresponding to an interval is determined based on the first information corresponding to each length unit in the interval. In other words, the first mask corresponding to an interval indicates the first information corresponding to each length unit in the interval. The second mask corresponding to an interval is determined according to the first mask corresponding to the interval.

[0025] In this way, for intervals that overlap with a rectangular area, the first mask corresponding to the interval that partially overlaps with the rectangular area is obtained, and the second mask corresponding to the interval that overlaps with the rectangular area is obtained. In other words, for intervals that completely overlap with the rectangular area, the electronic device can perform detection based on the second mask. For intervals that partially overlap with the rectangular area, the electronic device can perform detection based on the first mask. Because the second mask has fewer bits than the first mask, this allows the electronic device to process fewer bits of data, further improving detection efficiency.

[0026] In one possible design, before detecting that the rendering node corresponding to the first rectangular area is hidden, the method further includes: obtaining the second rectangular area; determining J intervals included in each of Y scan line segments that overlap with the second rectangular area, the Y scan line segments being scan line segments corresponding to the M rectangular areas that overlap with the second rectangular area, and J being an integer greater than or equal to 1 and less than or equal to q; and determining the first mask and the second mask corresponding to each of the J intervals, the J intervals including the V intervals. Optionally, when the first rectangular area is completely obscured by one second rectangular area, the J intervals may include the V intervals; and when the first rectangular area is jointly obscured by multiple second rectangular areas, the J intervals may include part of the V intervals.

[0027] In this way, the electronic device can detect the second rectangular area before detecting the first rectangular area. The second rectangular area is a rectangular area located above the first rectangular area. Moreover, when the electronic device has completed detecting the upper rectangular area, it can determine the first mask and the second mask corresponding to each interval that overlaps with the upper rectangular area to indicate that these intervals have overlapped with the upper rectangular area, or that certain length units in these intervals have overlapped with the upper rectangular area. Subsequently, for the lower rectangular area, the electronic device can determine whether the lower rectangular area is hidden by obtaining the first mask corresponding to the previously determined intervals that partially overlap with the rectangular area and the second mask corresponding to the intervals that completely overlap with the rectangular area. By traversing the rectangular areas from the upper layer to the lower layer and determining the first mask and the second mask corresponding to the intervals, when detecting the lower rectangular area, the first mask and the second mask are used, eliminating the need to determine whether the intervals that overlap with the rectangular area overlap with each rectangular area in the upper layer one by one. This can reduce the complexity and overhead of detection and improve detection efficiency.

[0028] In one possible design, before obtaining the second rectangular area, each of the q intervals corresponds to a first mask and a second mask, and the bit values ​​in the first mask and the second mask are both third values; determining the first mask and the second mask corresponding to each of the J intervals includes: updating part or all of the bit values ​​in the first mask and the second mask corresponding to each of the J intervals to a fourth value, and the fourth value is different from the third value.

[0029] Thus, before detecting the rectangular area, each of the q intervals obtained by division corresponds to a first mask and a second mask, and both of these masks now take the third value. Subsequently, after detecting the upper rectangular area, the first and second masks corresponding to the intervals that overlap with the rectangular area are determined, and both of these masks now take the fourth value, which is different from the third value. That is, the values ​​of the first and second masks corresponding to the area that overlaps with the rectangular area are updated from the third value to the fourth value. In this way, by utilizing bitwise operations on binary integers, it is possible to efficiently detect whether the rendering node corresponding to the rectangular area is hidden, significantly reducing detection overhead.

[0030] In one possible design, when the first mask corresponding to the R intervals represents that the length unit in the interval that overlaps with the first rectangular area overlaps with the second rectangular area, and the second mask corresponding to the VR intervals represents that the interval overlaps with the second rectangular area, the first rectangular area is hidden, including: when the bit value in the first mask corresponding to the length unit in the R intervals that overlaps with the first rectangular area is a fourth value, and the bit value in the second mask corresponding to the VR intervals is a fourth value, the first rectangular area is hidden. In this way, for a rectangular area, the electronic device can determine whether the rectangular area is hidden by judging whether the first mask and the second mask corresponding to the interval that overlaps with the rectangular area are updated to the fourth value. This can improve detection efficiency and reduce detection overhead and complexity.

[0031] In one possible design, the third value is 0 and the fourth value is 1; or the third value is 1 and the fourth value is 0.

[0032] In one possible design, the values ​​of p and q are both one of 8, 16, 32, and 64. In this way, the values ​​of p and q are set to 8, 16, 32, and 64, which are related to the bandwidth of the processor of the electronic device and can be easily processed by the electronic device.

[0033] In one possible design, the image to be rendered is the S+1th frame image, and the M rectangular areas included in the image to be rendered are determined based on all rendering nodes included in the Sth frame image and the changed rendering nodes, where S is an integer greater than or equal to 1; or, the image to be rendered is the S+1th frame image, and the M rectangular areas included in the image to be rendered are determined based on all rendering nodes included in the S+1th frame image, where S is an integer greater than or equal to 0. The changed rendering nodes may be determined in the rendering service process corresponding to the S+1th frame image, and all rendering nodes included in the Sth frame image may be determined in the rendering service process corresponding to the Sth frame image.

[0034] Thus, when all rendering nodes included in the current frame image cannot be obtained before executing the drawing instruction for generating rendering nodes in the rendering service process of the current frame image, all rendering nodes included in the current frame image can be determined based on all rendering nodes included in the previous frame image obtained in the rendering service process of the previous frame image and the changed rendering nodes obtained in the current frame. When all rendering nodes included in the current frame image can be obtained before executing the drawing instruction for generating rendering nodes in the rendering service process of the current frame image, all rendering nodes included in the current frame image can be obtained in the rendering service process of the current frame image.

[0035] In one possible design, after detecting that the rendering node corresponding to the first rectangular area is hidden, the method further includes: not generating drawing instructions for the rendering node corresponding to the first rectangular area, the rendering instructions being used to draw the rendering node. Thus, not generating drawing instructions for the hidden rendering node avoids redundant processor load, thereby reducing processor overhead and lowering the likelihood of lag, frame drop, and unsmooth rendering.

[0036] In a second aspect, an electronic device is provided, which has the function of implementing the method of any of the designs in any of the above aspects. The function can be implemented by hardware or by hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the above functions.

[0037] In a third aspect, an electronic device is provided, comprising: a processor, a memory, and a display screen. The memory and the display screen are coupled to the processor. The memory is used to store program code, which includes instructions. The processor reads the instructions from the memory to cause the electronic device to perform any of the above-described aspects and any of the methods therein. Optionally, the memory may be coupled to the processor or may be independent of the memory. The display screen may be used to perform display operations in the electronic device.

[0038] In a fourth aspect, a computer-readable storage medium is provided, the computer-readable storage medium including a computer program, which enables the electronic device to execute any of the methods designed in any of the above aspects when the computer program is run on the electronic device.

[0039] In a fifth aspect, a computer program product is provided, which includes: a computer program or instructions, which, when the computer program or instructions are run on a computer, enable the computer to execute any of the methods designed in any of the above aspects.

[0040] In the sixth aspect, a chip system is provided, comprising at least one processor and at least one interface circuit, wherein the at least one interface circuit is used to perform transceiver functions and send instructions to the at least one processor. When the at least one processor executes the instructions, the at least one processor executes a method designed in any of the above aspects.

[0041] The technical effects of the aforementioned aspects can be referenced with each other and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] Figure 1 A schematic diagram of an application transition scenario provided in an embodiment of the present application;

[0043] Figure 2 A schematic diagram of a pop-up window scenario provided in an embodiment of the present application;

[0044] Figure 3 A schematic diagram of a multi-tasking scenario provided in an embodiment of the present application;

[0045] Figure 4 A schematic diagram of the occlusion relationship of a rendering node provided in an embodiment of the present application;

[0046] Figure 5 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application;

[0047] Figure 6 A schematic diagram of a scanning line segment provided in an embodiment of the present application;

[0048] Figure 7 A schematic diagram of a mask provided in an embodiment of the present application;

[0049] Figure 8 A schematic diagram of occlusion detection for a rectangular area provided in an embodiment of the present application;

[0050] Figure 9 A schematic diagram of another method for performing occlusion detection on a rectangular area provided in an embodiment of the present application;

[0051] Figure 10 A schematic diagram of another method for performing occlusion detection on a rectangular area provided in an embodiment of the present application;

[0052] Figure 11 A schematic diagram of a scenario in which an occlusion detection solution provided in an embodiment of the present application is applied;

[0053] Figure 12 A flowchart of a rendering node detection method provided in an embodiment of the present application;

[0054] Figure 13 A schematic structural diagram of another electronic device provided in an embodiment of the present application;

[0055] Figure 14 A schematic diagram of a chip system provided in an embodiment of the present application. DETAILED DESCRIPTION

[0056] In the description of this application, unless otherwise specified, " / " indicates that the objects associated before and after are in an "or" relationship, for example, A / B can represent A or B; "and / or" in this application is merely a description of the association relationship of associated objects, indicating that three relationships may exist, for example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural.

[0057] In the description of this application, unless otherwise specified, "plurality" means two or more than two. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, or c can mean: a, b, c, a and b, a and c, b and c, a, b, and c, where a, b, and c can be single or plural.

[0058] In addition, to facilitate the clear description of the technical solutions of the embodiments of the present application, in the embodiments of the present application, the words "first" and "second" are used to distinguish between identical or similar items with substantially the same functions and effects. Those skilled in the art will understand that the words "first" and "second" do not limit the quantity or execution order, and the words "first" and "second" do not necessarily mean different.

[0059] Currently, the graphical interface (or described as an interface, user interface, etc.) obtained by graphics rendering may include at least one layer, and each layer may include multiple rendering nodes. In other words, a graphical interface can be composed of many rendering nodes. In an embodiment of the present application, a rendering node may refer to the smallest drawing unit in a graphical interface, such as a search box, a picture, a button, an icon, and a text can all be a rendering node. A rendering node may also be called a control, a component, etc. A rendering node may correspond to a rectangular area, and each rectangular area can be used to draw or carry the rendering node. In some scenarios, some rendering nodes in a graphical interface may be obscured by other rendering nodes in the graphical interface, that is, these rendering nodes may be hidden and not seen by the user. However, in the process of graphics rendering, in order to facilitate developers to achieve various dynamic effects for the graphical interface, the processor of the electronic device will still generate drawing instructions for these rendering nodes that are invisible to the user to draw these rendering nodes, which brings a large redundant load to the processor.

[0060] For example: Figure 1Take the application transition scenario shown in the following example as an example. Figure 1 As shown in (1), the electronic device displays the main interface 100 of the travel application, which may include one or more rendering nodes, such as rendering node 101 "ride", rendering node 102 "train icon" ( Figure 1 (1) shows only two), etc. The rectangular area corresponding to each rendering node can be a dotted rectangular box outside the rendering node. Then, the user can perform various user operations to achieve interface jump. For example, the user performs an operation such as clicking on the "homestay apartment" control 103 in the main interface 100. Figure 1 As shown in (3), the electronic device displays the homestay booking interface 110. The homestay booking interface 110 may also include one or more rendering nodes, such as Figure 1 As shown in (3), the rendering node 111 "homestay apartment" and the rendering node 112 "delete icon" ( Figure 1 (3) also only shows two), etc., and the rectangular area corresponding to each rendering node can also be a dotted rectangular box outside the rendering node.

[0061] Among them, the electronic device is composed of a display such as Figure 1 The main interface 100 shown in (1) is displayed as follows Figure 1 In the process of the homestay reservation interface 110 shown in (3), as shown in Figure 1 As shown in (2), the homestay booking interface 110 will gradually block the main interface 100. That is, the rendering nodes in the homestay booking interface 110 will block the rendering nodes in the main interface 100. Figure 1 The interface shown in (2) consisting of the main interface 100 and the homestay reservation interface 110 can be a graphical interface. Figure 1 When the graphical interface is shown in (2), for the rendering nodes hidden in the main interface 100 (ie, invisible to the user), the processor of the electronic device still generates drawing instructions for these rendering nodes.

[0062] For example: Figure 2 Take the pop-up window scenario shown as an example. Figure 2 As shown in (1), the electronic device displays the main interface 200 of the alarm clock application. Similarly, the main interface 200 of the alarm clock application can also include one or more rendering nodes. Then, the user can perform an operation such as clicking on the new button 201 included in the main interface 200. In response to the operation, Figure 2 As shown in (2), the electronic device can display a pop-up interface 210, and the rendering nodes in the pop-up interface 210 will block the rendering nodes in the main interface 200. Figure 2 The interface shown in (2) consisting of the main interface 200 and the pop-up window interface 210 can be a graphical interface. Figure 2 When the graphical interface shown in (2) is used, for the hidden rendering nodes in the main interface 200, the processor of the electronic device still generates drawing instructions for these rendering nodes.

[0063] For example: Figure 3 As an example, the multi-tasking scenario shown in Figure 3 As shown, the electronic device displays a split-screen gallery interface 300 and a video interface 302, as well as a floating memo interface 301, a video call interface 303, a text message interface 305, and a shopping interface 304. The rendering nodes in some of these multiple interfaces may obscure each other. For example, the rendering nodes in the text message interface 305 may obscure the rendering nodes in the shopping interface 304, the video interface 302, and the gallery interface 300. The rendering nodes in the shopping interface 304 may in turn obscure the rendering nodes in the memo interface 301, the video interface 302, the gallery interface 300, and so on. Similarly, in this scenario, the interface composed of the gallery interface 300, the video interface 302, the memo interface 301, the video call interface 303, the text message interface 305, and the shopping interface 304 may be a graphical interface. When the electronic device renders this graphical interface, the processor of the electronic device will also generate drawing instructions for the hidden rendering nodes.

[0064] In order to solve the problem that the generation of drawing instructions for hidden rendering nodes brings redundant load to the processor, resulting in high processor overhead, the hidden rendering nodes can be detected so as not to generate drawing instructions for these hidden rendering nodes, thereby achieving the purpose of reducing processor overhead. In a possible detection scheme, the electronic device can traverse the rectangular areas corresponding to all rendering nodes included in the graphical interface. For each rectangular area, the electronic device can perform occlusion judgment on the rectangular area and all rectangular areas except the rectangular area to determine which rectangular area the rectangular area is occluded by, or which rectangular areas are jointly occluded by the rectangular area. For example, Figure 4 An example of a rectangular area being blocked is shown. Figure 4 As shown in (1), in the display screen 400, there are three rectangular areas, namely rectangular area 401 to rectangular area 403, each of which corresponds to a rendering node. Among them, rectangular area 402 is blocked by multiple rectangular areas (ie, rectangular area 403 and rectangular area 401). Figure 4 As shown in (2), in the display screen 400, there are two rectangular areas, namely rectangular area 411 and rectangular area 412, each of which corresponds to a rendering node. Among them, rectangular area 411 is blocked by a rectangular area (ie rectangular area 412). It can be understood that, Figure 4In the example shown, rectangular areas corresponding to several rendering nodes in a graphical user interface displayed on the display screen 400 are taken as an example. In actual scenarios, a graphical interface may include more rendering nodes.

[0065] In the above detection scheme, the complexity of the algorithm satisfies (a 2 +a×b 3 ). Where a represents the number of rectangular areas corresponding to all rendering nodes included in the graphical interface, and b represents the average number of overlapping rectangular areas. The average number of overlapping rectangular areas refers to the average number of rectangular areas that overlap with one rectangular area. This solution requires at least two layers of nested loop algorithms, which is too complex and takes an average of about 1.5 milliseconds, which is unacceptable for electronic devices with a current frame rate of 120 frames per second (FPS). This solution has a large processor overhead and low detection efficiency.

[0066] For example, Table 1 shows examples of the results when the above detection scheme is adopted in some scenarios.

[0067] Table 1

[0068]

[0069] In Table 1, the duration refers to the duration of the occlusion detection process. As shown in Table 1, taking the alarm clock application as an example, the transition from the main interface to the alarm clock pop-up interface takes 1265.8 μs when using the above detection solution.

[0070] Based on this, an embodiment of the present application provides a rendering node detection method that can detect obscured rendering nodes, reduce detection complexity and overhead, and improve detection efficiency.

[0071] The technical solution provided by the embodiment of the present application can be applied to the electronic device 100, or to a system including the electronic device 100.

[0072] The electronic device 100 may be a mobile phone, a personal digital assistant (PDA), a desktop computer, a laptop computer, a handheld computer, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook, an augmented reality (AR) device, a virtual reality (VR) device, an artificial intelligence (AI) device, a wearable device, an in-vehicle device, a smart home device and / or a smart city device. Optionally, the electronic device 100 may be a fixed device or a portable device. Optionally, the operating system installed on the electronic device 100 may include but is not limited to The embodiment of the present application does not impose any specific restrictions on the specific type of the electronic device and the installed operating system.

[0073] For example, Figure 5 A structural diagram of an electronic device 100 provided in an embodiment of the present application is shown.

[0074] like Figure 5 As shown, the electronic device 100 may include a processor 110, a memory 120, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a button 180, a display screen 190, etc.

[0075] The processor 110 may include one or more processing units. For example, the processor 110 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU). The different processing units may be independent devices or integrated into one or more processors.

[0076] The controller can generate operation control signals according to the instruction operation code and timing signal to complete the control of instruction fetching and execution.

[0077] Processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in processor 110 is a cache memory. This memory can store instructions or data that have just been used or are being recycled by processor 110. If processor 110 needs to use the same instruction or data again, it can directly access the memory. This avoids duplicate accesses, reduces processor 110 latency, and thus improves system efficiency.

[0078] In some embodiments, the processor 110 may include one or more interfaces, such as a USB interface 130 .

[0079] The charging management module 140 is configured to receive charging input from a charger. While charging the battery 142 , the charging management module 140 can also provide power to the electronic device through the power management module 141 .

[0080] The power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140 to provide power to the processor 110, the memory 120, the display 190, and the wireless communication module 160.

[0081] The wireless communication function of the electronic device 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.

[0082] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve antenna utilization.

[0083] The mobile communication module 150 can provide wireless communication solutions including 2G / 3G / 4G / 5G applied on the electronic device 100.

[0084] The wireless communication module 160 can provide wireless communication solutions for application on the electronic device 100, including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), Star Flash, global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared technology (IR), etc.

[0085] In some embodiments, the antenna 1 of the electronic device 100 is coupled to the mobile communication module 150, and the antenna 2 is coupled to the wireless communication module 160, so that the electronic device 100 can communicate with the network and other devices through wireless communication technology. The wireless communication technology may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), time-division code division multiple access (TD-SCDMA), long term evolution (LTE), BT, star flash, GNSS, WLAN, NFC, FM, and / or IR technology.

[0086] The display screen 190 is used to display images, videos, etc. The display screen 190 includes a display panel. In some embodiments of the present application, the display screen 190 can be used to display various graphical interfaces.

[0087] The memory 120 can be used to store computer executable program code, which includes instructions. The memory 120 may include a program storage area and a data storage area. The program storage area may store an operating system, an application required for at least one function, etc. The data storage area may store data created during the use of the electronic device 100, etc. In addition, the memory 120 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc. The processor 110 executes various functional applications and data processing of the electronic device 100 by running instructions stored in the memory 120 and / or instructions stored in a memory provided in the processor.

[0088] The audio module 170 is used to convert digital audio information into analog audio signals for output, and is also used to convert analog audio input into digital audio signals.

[0089] The buttons 180 include a power button, a volume button, and the like. The buttons 180 may be mechanical buttons or touch buttons. The electronic device 100 may receive key inputs and generate key signal inputs related to user settings and function control of the electronic device 100.

[0090] It is understandable that Figure 5 The illustrated structure does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown, or may combine or separate certain components, or arrange the components differently. The processing steps or functional characteristics of the illustrated components may be implemented in hardware, software, or a combination of software and hardware.

[0091] The technical solutions involved in the following embodiments can all be implemented in Figure 5 The present invention is implemented in the device of the structure shown.

[0092] An embodiment of the present application provides a rendering node detection method, in which an electronic device can obtain rectangular areas (e.g., M rectangular areas, where M is an integer greater than or equal to 1) included in an image to be rendered. It is understandable that for each frame of an image to be rendered, the image to be rendered can include at least one rendering node, each rendering node can correspond to a rectangular area, and the rectangular area corresponding to each rendering node can be used to draw the rendering node. The electronic device can detect the rectangular area based on the presence of overlapping scan line segments (which can be simply referred to as scan lines) in each rectangular area to determine whether the rectangular area is hidden, and further determine whether the rendering node corresponding to the rectangular area is hidden.

[0093] Optionally, when the electronic device determines that a rendering node corresponding to a rectangular area is hidden, the electronic device may not generate drawing instructions for the rendering node. When the rendering node corresponding to a rectangular area is not hidden, the electronic device may generate drawing instructions for the rendering node. The drawing instructions for the rendering node can be used to draw the rendering node. By not generating drawing instructions for the hidden rendering node, redundant processor load is avoided, thereby reducing processor overhead and minimizing the likelihood of lag, frame drops, and unsmooth rendering.

[0094] The following first introduces the scanning line segments described in the embodiments of the present application.

[0095] In some embodiments, the electronic device may obtain the scan line segments based on boundary lines of all rectangular areas included in the image to be rendered.

[0096] In this embodiment, as a possible implementation, the electronic device may obtain two scan line segments based on the upper boundary line and the lower boundary line included in each rectangular area. These two scan line segments overlap with the upper boundary line and the lower boundary line of the rectangular area, respectively. The electronic device may then obtain the scan line segments corresponding to all rectangular areas included in the image to be rendered based on the two scan line segments obtained for each rectangular area.

[0097] For example, Figure 6 As shown in (1), taking the rectangular areas included in the image to be rendered as rectangular areas 601, 602, and 603 as an example, the two scan line segments obtained based on the upper boundary line and the lower boundary line of rectangular area 601 are scan line 1 and scan line 4, respectively. The two scan line segments obtained based on the upper boundary line and the lower boundary line of rectangular area 602 are scan line 2 and scan line 5, respectively. The two scan line segments obtained based on the upper boundary line and the lower boundary line of rectangular area 603 are scan line 3 and scan line 4, respectively. Furthermore, in this example, the scan line segments corresponding to all the rectangular areas included in the image to be rendered obtained by the electronic device include scan lines 1 to scan lines 5.

[0098] like Figure 6 In the implementation shown in (1), the length of each scan line segment obtained by the electronic device is equal, and the length of each scan line segment is greater than or equal to the width of the display screen 600. The length of each scan line segment is equal to the width of the created virtual canvas (i.e., the rectangular area 610) and is located within the virtual canvas. In other words, the width of the created virtual canvas is greater than or equal to the width of the display screen 600. The position of the display screen 600 must be within the virtual canvas. This ensures that all rectangular areas included in the image to be rendered on the display screen 600 can be detected based on the scan line segments.

[0099] It can be understood that in the embodiments of the present application, since the electronic device may be in different usage states, such as: portrait screen usage state, landscape screen usage state, etc., the width of the electronic device display screen described in the embodiments of the present application can refer to the length of the display screen in the horizontal direction, and the height of the display screen can refer to the length of the display screen in the vertical direction, which are uniformly explained here.

[0100] As another possible implementation, the electronic device may also obtain two scan line segments based on the left and right border lines of each rectangular area. These two scan line segments may overlap with the left and right border lines of the rectangular area, respectively. Then, based on the two scan line segments obtained for each rectangular area, the electronic device may also obtain scan line segments corresponding to all rectangular areas included in the image to be rendered.

[0101] For example, Figure 6As shown in (3), taking the rectangular areas included in the image to be rendered as rectangular areas 601, 602, and 603 as an example, the two scan line segments obtained based on the left and right border lines of rectangular area 601 are scan line 2 and scan line 4, respectively. The two scan line segments obtained based on the left and right border lines of rectangular area 602 are scan line 1 and scan line 3, respectively. The two scan line segments obtained based on the left and right border lines of rectangular area 603 are scan line 2 and scan line 4, respectively. Furthermore, in this example, the scan line segments corresponding to all the rectangular areas included in the image to be rendered obtained by the electronic device include scan lines 1 to scan lines 4.

[0102] It is understandable that Figure 6 (1) and Figure 6 In the two methods of obtaining scan line segments shown in (3), the number of scan line segments corresponding to all rectangular areas included in the image to be rendered may be the same or different. For example, if the image to be rendered includes M rectangular areas, the number of scan line segments corresponding to all rectangular areas included in the image to be rendered must be less than or equal to 2M, where M is a positive integer.

[0103] like Figure 6 In the implementation shown in (3), the length of each scan line segment obtained by the electronic device is equal, and the length of each scan line segment must be greater than or equal to the height of the display screen 600. The length of each scan line segment is equal to the height of the created virtual canvas (i.e., rectangular area 610) and is located within the virtual canvas. In other words, the height of the created virtual canvas must be greater than or equal to the height of the display screen 600. The position of the display screen 600 must be within the virtual canvas. This ensures that all rectangular areas included in the image to be rendered on the display screen 600 can be detected based on the scan line segments.

[0104] It is understandable that the scan line segments that overlap with each rectangular area may include at least two, and the number of scan line segments that overlap with different rectangular areas may be the same or different. Figure 6 Taking the scan line segments shown in (1) as an example, there are 4 scan line segments overlapping with the rectangular area 601 (which can be used as examples of Y, where Y is an integer greater than or equal to 1), namely scan line 1 to scan line 4. There are 4 scan line segments overlapping with the rectangular area 602 (which can be used as examples of X, where X is an integer greater than or equal to 1), namely scan line 2 to scan line 5. There are 2 scan line segments overlapping with the rectangular area 603 (which can also be used as examples of X), namely scan line 3 and scan line 4. For another example: Figure 6Taking the scan line segments shown in (3) as an example, there are three scan line segments overlapping with rectangular area 601, namely scan line 2 to scan line 4. There are three scan line segments overlapping with rectangular area 602, namely scan line 1 to scan line 3. There are three scan line segments overlapping with rectangular area 603, namely scan line 2 to scan line 4. And so on.

[0105] It is understood that, in the embodiments of the present application, for a rectangular area, a scan line segment that overlaps with the rectangular area may refer to a scan line segment that passes through the rectangular area. For a scan line segment that overlaps with the rectangular area, it is possible that only a portion of the scan line segment overlaps with the rectangular area, or it is possible that the entire scan line segment overlaps with the rectangular area. In other words, in the embodiments of the present application, a scan line segment that partially overlaps with the rectangular area and a scan line segment that completely overlaps with the rectangular area are both referred to as a scan line segment that overlaps with the rectangular area.

[0106] The above describes the scanning line segments described in the embodiments of the present application. The following describes the process of detecting a rectangular area based on the presence of overlapping scanning line segments in each rectangular area.

[0107] In some embodiments, for a rectangular area, the electronic device determines at least one scan line segment that overlaps with the rectangular area. For each of the scan line segments, the electronic device can determine the line segments included in the scan line segment that overlap with the rectangular area. It is understandable that the line segments included in the scan line segment that overlap with the rectangular area (hereinafter referred to as the overlapping line segments included in the scan line segment) may be part or all of the scan line segment. The electronic device can then determine whether the rectangular area is hidden by whether the overlapping line segments included in each scan line segment overlap with the rectangular area above the rectangular area at the same time. It is understandable that the overlapping line segments included in the scan line segment overlap with the rectangular area above the rectangular area can mean that the overlapping line segments included in the scan line segment are covered by at least one rectangular area above the rectangular area.

[0108] For the rectangular area, if all the overlapping line segments included in the scan line segments overlap with the upper rectangular area of ​​the rectangular area, then the rectangular area is blocked. Conversely, if there is a scan line segment that includes overlapping line segments that does not overlap with the upper rectangular area of ​​the rectangular area, then the rectangular area is not blocked. It can be understood that the overlapping line segments included in the scan line segment do not overlap with the upper rectangular area can mean that part or all of the overlapping line segments included in the scan line segment are not covered by the upper rectangular area of ​​the rectangular area.

[0109] In some embodiments, the electronic device may determine the area in the scan line segment that overlaps with the rectangular area by dividing the scan line segment into intervals or length units.

[0110] In some embodiments, as Figure 6 As shown in (2) or (4), the electronic device can divide each scan line segment obtained into q intervals, namely, intervals A, B, C, D, and E. Each interval includes p length units. For ease of understanding, Figure 6 Chinese (2) Figure 6 In (4), p is 4 as an example, and only the length units divided by a certain interval are shown. The same applies to other intervals. In other words, each scan line segment can be divided into p times q length units, that is, N length units, N = p × q. N, p, and q are all preset positive integers. In the embodiment of the present application, the length unit can be a fixed length or a fixed number of pixels.

[0111] Optionally, the values ​​of p and q can be determined based on the bandwidth of the electronic device's processor. As a specific example, the value of p can be 2r, where r is greater than or equal to 3. For example, the value of p can be any one of 8, 16, 32, and 64. The value of q can also be 2r. For example, the value of q can be any one of 8, 16, 32, and 64. The value of p and the value of q can be the same or different. Accordingly, the value of N can be 64, 128, 256, etc.

[0112] Then, the electronic device can detect each rectangular area in the rendered image in order from the upper layer to the lower layer to determine whether the rectangular area is hidden. Optionally, the electronic device can determine which rectangle is on the upper layer of which rectangle based on the Z-order value of each rectangular area. The higher the Z-order value, the higher the level of the rectangular area. It can be understood that rectangles in the same layer may include one or more. When there are multiple rectangular areas in the same layer, the electronic device can traverse these rectangular areas in turn to detect each rectangular area in the same layer. After the detection of the rectangular areas in the same layer is completed, the electronic device continues to detect the rectangular areas in the next layer.

[0113] In one possible implementation, the rectangular area in the layer to be rendered to which this solution applies includes at least two levels, with at least one rectangular area in each level. In this embodiment, as a possible implementation, the electronic device can detect the rectangular area based on the N length units obtained by division. For example, the electronic device can first sequentially detect each rectangular area in the topmost layer (which can be referred to as the first layer) (which can be used as an example of the second rectangular area). For a rectangular area in the topmost layer, the electronic device can determine Y scan line segments that overlap with the rectangular area. Then, for each of the Y scan line segments, the electronic device can determine the L length units that overlap with the rectangular area. Where L and Y are both integers greater than or equal to 1. It is understood that the number of length units that overlap with the rectangular area in each scan line segment can be the same or different; this applies to the overlap determination of other rectangular areas or scan line segments and will not be further described below. Next, the electronic device can determine the information 1 corresponding to each of the L length units included in each of the Y scan line segments.

[0114] For an introduction to determining the scan line segments that overlap with the rectangular area in this implementation, reference may be made to the above description. It is understandable that the line segments that overlap with the rectangular area included in a scan line segment may include at least one length unit.

[0115] Next, after the electronic device completes detecting the rectangular areas of the first layer, it can sequentially detect each rectangular area of ​​the next layer (which can be called the second layer) (which can be used as an example of the first rectangular area). For a rectangular area of ​​the second layer, the electronic device can determine X scan line segments that overlap with the rectangular area. Then, for each of the X scan line segments, the electronic device can determine K length units included in the scan line segment that overlap with the rectangular area. Wherein, X and K are both integers greater than or equal to 1. Then, the electronic device can determine whether the rectangular area is hidden based on the information 1 corresponding to the K length units included in each of the X scan line segments.

[0116] After the electronic device has detected a rectangular area of ​​the second layer, the electronic device can also determine information 1 corresponding to each of the K length units included in each of the X scanning line segments.

[0117] Then, after the electronic device completes the detection of the rectangular areas in the second layer, it can continue to detect each rectangular area in the next layer (which can be called the third layer). When a rectangular area in the third layer is used as an example of the first rectangular area, the rectangular areas in the second layer and the rectangular areas in the first layer can both be used as examples of the second rectangular area. For the introduction to detecting rectangular areas in the third layer, refer to the introduction to detecting rectangular areas in the second layer. And so on, until all rectangular areas are detected.

[0118] In this implementation, for example: Figure 6 Taking the example shown in (2) as an example, the image to be rendered includes rectangular area 601, rectangular area 602, and rectangular area 603. Rectangular area 601 has the highest hierarchy level, that is, rectangular area 601 (which can be used as an example of a second rectangular area) is at the top layer, and rectangular area 603 (which can be used as an example of a first rectangular area) has the lowest hierarchy level, that is, rectangular area 603 is at the bottom layer. The electronic device can detect rectangular area 601, rectangular area 602 (which can also be used as an example of a first rectangular area), and rectangular area 603 in sequence.

[0119] Taking the rectangular area 601 as an example, for each scanning line segment that overlaps with the rectangular area 601, there may be Y scanning line segments, where Y is an integer greater than or equal to 1, such as Figure 6 In the example shown in (2), the exemplary value of Y is 4. The electronic device can determine at least one length unit that overlaps with the rectangular area 601, such as L length units, where L is an integer greater than or equal to 1. It can be understood that in the embodiment of the present application, for each scan line segment that overlaps with a rectangular area, the length units that overlap with the rectangular area can be part or all of the length units into which the scan line segment is divided. It can be understood that for a length unit, as long as part of the length unit overlaps with the rectangular area, the length unit is determined to be a length unit that overlaps with the rectangular area.

[0120] For example, taking scan line 1 that overlaps with rectangular area 601 as an example, the electronic device can determine that there are a total of 16 length units included in scan line 1 that overlap with rectangular area 601. In this example, the exemplary value of L is 16. These 16 length units are 4 length units included in each of intervals B, C, and D, 1 length unit included in interval A (i.e., a1), and 3 length units included in interval E (i.e., e1, e2, and e3). For example, part of the 1 length unit included in interval A overlaps with rectangular area 601, so the 1 length unit included in interval A is also determined to be a length unit that overlaps with rectangular area 601. Similarly, for scan lines 2 to 4 that overlap with rectangular area 601, the electronic device can also determine the length units included therein that overlap with rectangular area 601. In this example, scan lines 2 to 4 each include 16 length units, the same as scan line 1. The electronic device may then determine information 1 corresponding to each length unit that overlaps with the rectangular area 601 , wherein the information 1 corresponding to each length unit may be used to indicate that the length unit overlaps with the rectangular area.

[0121] Optionally, the electronic device determines that the information 1 (or first information) corresponding to each length unit that overlaps with the rectangular area 601 may refer to the generation of the information 1, that is, before the electronic device performs the operation of generating the information 1 corresponding to a certain length unit, the corresponding information 1 may not exist for the length unit.

[0122] Alternatively, the electronic device determines that the information 1 corresponding to each length unit that overlaps with the rectangular area 601 may also refer to the content of the updated information 1, that is, before the electronic device performs the operation of determining the information 1 corresponding to a certain length unit, the length unit may have corresponding information 1, but the information 1 at this time can be used to represent that the length unit does not overlap with the rectangular area. For example: before the electronic device detects the top rectangular area in the image to be rendered, the electronic device can preset the information 1 corresponding to each length unit in all the length units included in each scanning line segment, that is, the initialization information 1. At this time, the preset information 1 can be used to represent that the corresponding length unit does not overlap with the rectangular area. In this implementation, combined with the example of detecting the rectangular area 601, before the electronic device detects the rectangular area 601, the information 1 corresponding to each length unit that overlaps with the rectangular area 601 can represent that the corresponding length unit does not overlap with the rectangular area.

[0123] Exemplarily, when information 1 represents that the length unit does not overlap with the rectangular area, information 1 can be value 1 (or called the first value), and when information 1 represents that the length unit overlaps with the rectangular area, information 1 can be value 2 (or called the second value). Value 1 is different from value 2. In a specific example, value 1 can include w zeros, and value 2 can include w ones. Alternatively, value 1 can include w ones, and value 2 can include w zeros, where w is a preset integer greater than or equal to 1. Optionally, the value of w can be set based on the bandwidth of the electronic device processor. For example, value 1 can be 0, and value 2 can be 1.

[0124] After completing the detection of each scan line segment in rectangular area 601, the electronic device can proceed to detect rectangular area 602. Similarly, for each scan line segment that overlaps with rectangular area 602, the electronic device can also determine the at least one length unit that overlaps with rectangular area 602. For example, taking scan line 2, which overlaps with rectangular area 602, as an example, the electronic device can determine that scan line 2 includes four length units that overlap with rectangular area 602. In this example, when rectangular area 602 is used as an example of the first rectangular area, the exemplary value of K is 4. When rectangular area 602 is used as an example of the second rectangular area, the exemplary value of L is 4. These four length units are the three length units included in interval A and the one length unit included in interval B. Similarly, for scan lines 3 through 5 that overlap with rectangular area 602, the electronic device can also determine the length units that overlap with rectangular area 602. In this example, scan lines 3 through 5 each include four length units, the same as scan line 2. The electronic device may then determine whether the rectangular area 602 is hidden based on the information 1 corresponding to each length unit that overlaps with the rectangular area 602 .

[0125] As one possible scenario, for each length unit that overlaps with a rectangular area, if the information 1 corresponding to the length unit indicates that the length unit overlaps with a rectangular area other than the rectangular area, the electronic device can detect that the rectangular area has been hidden. It is understandable that because the electronic device traverses and detects the rectangular areas in order from top to bottom, the aforementioned rectangular areas other than the rectangular area can refer to rectangular areas that are in the same image to be rendered as the rectangular area and are located above the rectangular area.

[0126] Alternatively, in this case, all length units that overlap with the rectangular area may overlap with multiple rectangular areas above the rectangular area. In other words, there may be multiple rectangular areas above the rectangular area, and the rectangular area may be collectively obscured by multiple upper rectangular areas. Of course, the rectangular area may also be completely obscured by a single upper rectangular area.

[0127] In this case, when a rectangular area is completely obscured by an upper rectangular area, the length units that overlap with the upper rectangular area may include all of the length units that overlap with the obscured rectangular area. Alternatively, when a rectangular area is jointly obscured by multiple upper rectangular areas, the length units that overlap with the multiple upper rectangular areas may include all of the length units that overlap with the obscured rectangular area, and the length units that overlap with one of the upper rectangular areas may include part of the length units that overlap with the obscured rectangular area.

[0128] As another possible situation, in a length unit that overlaps with a rectangular area, if there is information 1 corresponding to a length unit, indicating that the length unit does not overlap with a rectangular area other than the rectangular area, the electronic device can detect that the rectangular area is not hidden. Figure 6 (2) is an example in which the rectangular area 602 is not hidden. For the introduction of rectangular areas other than the rectangular area, please refer to the introduction of the previous case.

[0129] Optionally, in this other case, all length units that overlap with the rectangular area above the rectangular area may include length units that partially overlap with the rectangular area. Figure 6 In the example shown in (2), rectangular area 601 is located above rectangular area 602, and all length units that overlap with rectangular area 601 include a portion of all length units that overlap with rectangular area 602. Alternatively, in this other case, all length units that overlap with the rectangular area may not overlap with any rectangular area above the rectangular area, that is, the length units that overlap with the rectangular area are not included in the length units that overlap with the rectangular area above the rectangular area.

[0130] Furthermore, after the electronic device detects the rectangular area 602, the electronic device may determine the information 1 corresponding to each length unit that overlaps with the rectangular area 602, wherein the information 1 corresponding to each length unit is used to indicate that the length unit overlaps with the rectangular area. Optionally, in the length unit that overlaps with the rectangular area 602, when the information 1 corresponding to a certain length unit already indicates that the length unit overlaps with the rectangular area, the electronic device may no longer determine the information 1 corresponding to the length unit. For example: when the electronic device detects the rectangular area (such as the rectangular area 601) above the rectangular area 602, the electronic device has determined several pieces of information 1 that indicate that the length unit overlaps with the rectangular area. In this case, the electronic device may no longer determine these pieces of information 1. In the length unit that overlaps with the rectangular area 602, when the information 1 corresponding to a certain length unit does not indicate that the length unit overlaps with the rectangular area, the electronic device may determine the information 1 corresponding to the length unit, so as to use the information 1 to indicate that the length unit overlaps with the rectangular area.

[0131] For example: Combined with Figure 6 In the example shown in (2), taking scan line 2 as an example, the length units included therein that overlap with the rectangular area 602 include: 3 length units included in interval A (i.e., a2, a3, and a4), and 1 length unit included in interval B (i.e., b1). Among them, 1 length unit (i.e., a2) in interval A and 1 length unit (i.e., b1) in interval B overlap with the rectangular area 601 at the same time. When detecting the rectangular area 601, the information 1 corresponding to these two length units has been determined. Therefore, after detecting the rectangular area 602, it is not necessary to determine the information 1 corresponding to these two length units. The remaining two length units (i.e., a3 and a4) in interval A do not overlap with the rectangular area above the rectangular area 602. Therefore, after detecting the rectangular area 602, the electronic device can determine the information 1 corresponding to the remaining two length units, such as updating the value of information 1 from value 1 to value 2. The same applies to the length units in other scan line segments that overlap with the rectangular area 602.

[0132] That is to say, for the same scanning line segment, the electronic device can determine the length units in the scanning line segment that are overlapped by the rectangular area according to the hierarchical order of the rectangular areas, and in this process, it will not re-judge the length units that have been judged to overlap with the upper rectangular area.

[0133] Optionally, the electronic device may determine the implementation of the information 1 corresponding to each length unit that overlaps with the rectangular area 602 , with reference to the corresponding implementation when detecting the rectangular area 601 .

[0134] Next, the electronic device can continue to detect the rectangular area 603. Similarly, for each scan line segment that overlaps with the rectangular area 603, the electronic device can also determine at least one length unit included therein that overlaps with the rectangular area 603. For example: taking the scan line 3 that overlaps with the rectangular area 603 as an example, the electronic device can determine that there are a total of 14 length units included in the scan line 3 that overlap with the rectangular area 603. In this example, the exemplary value of K is 14. These 14 length units are the 4 length units included in each of the C and D intervals, the 3 length units included in B (i.e., b2, b3, b4), and the 3 length units included in the E interval (i.e., e7, e8, e9). Similarly, for the scan line 4 that overlaps with the rectangular area 603, the electronic device can also determine the length units included therein that overlap with the rectangular area 603. In this example, the scan line 4 also includes 14 length units, the same as the scan line 3. Then, the electronic device may also determine whether the rectangular area 603 is hidden based on the information 1 corresponding to each length unit that overlaps with the rectangular area 603 .

[0135] Similarly, when detecting the rectangular area 603 , there may be the two situations described above when detecting the rectangular area 602 . For the introduction of these two situations, please refer to the relevant introduction of the detection area rectangle 602 described above. Figure 6 In (2), the rectangular area 603 is completely hidden by the rectangular area 601 as an example.

[0136] Furthermore, after the electronic device detects the rectangular area 603, the electronic device can also determine the information 1 corresponding to each length unit that overlaps with the rectangular area 603. The information 1 corresponding to each length unit is used to indicate that the length unit overlaps with the rectangular area. Figure 6 In the example shown in (2), taking scan line 3 as an example, the length units that overlap with rectangular area 603 include: 4 length units in each of intervals C and D, and 3 length units in each of intervals B and E. These length units also overlap with rectangular area 601. When rectangular area 601 is detected, the information 1 corresponding to these length units has been determined. Therefore, after detecting rectangular area 603, it is not necessary to determine the information 1 corresponding to these length units.

[0137] For the implementation of the electronic device determining the information 1 corresponding to each length unit overlapping with the rectangular area 603 , reference may be made to the implementation of determining the information 1 corresponding to each length unit overlapping with the rectangular area 602 described above.

[0138] By analogy, the electronic device can complete the detection of all rectangular areas included in the image to be rendered.

[0139] Through the above scheme, the electronic device only needs to detect the scan line segments that overlap with each rectangular area. For an image to be rendered, the average number of scan line segments that overlap with each rectangular area in the image to be rendered is a fixed value. Therefore, the algorithm complexity of the detection scheme provided by the embodiment of the present application can meet (a×c), where a represents the number of rectangular areas corresponding to all rendering nodes included in the graphical interface (i.e., an image to be rendered), and c represents the average number of scan line segments that overlap with a rectangular area. c is a fixed value, and c is less than a. Compared with the complexity of the above detection scheme (a 2 +a×b 3 ), the technical solution provided by the embodiment of the present application converts the two-dimensional algorithm into a one-dimensional one, simplifying the double-layer loop into a single-layer loop. This reduces the complexity and cost of detection and improves detection efficiency.

[0140] In the above embodiment, the electronic device performs overlap judgment on a single length unit included in each scan line as an example. In some embodiments, in order to improve the detection efficiency, the electronic device can also perform overlap judgment on the entire interval included in each scan line. The interval can be q intervals obtained by the division described above. Figure 7 The A, B, C, D, and E intervals are shown. For ease of understanding, Figure 7 In the examples of the subsequent figures, the value of q is 5.

[0141] In some embodiments, each interval may correspond to a mask 1 (or referred to as a first mask), and mask 1 may be used to determine whether a length unit in the interval overlaps with a rectangular area. As a possible example, mask 1 may include p bit values, i.e., p binary bits. Each bit value corresponds in turn to a length unit in the interval to characterize whether the length unit overlaps with a rectangular area. That is, in this embodiment, information 1 may be implemented as a 1-bit value in mask 1. For the introduction to p and q, please refer to the above. For example: Figure 7 As shown, the mask 1 corresponding to intervals A, B, C, D, and E are "0111", "1111", "1111", "1111", and "1100" respectively. It can be understood that for ease of understanding, Figure 7 In the examples of other subsequent figures, the value of p is 4.

[0142] In this way, the mask 1 includes exactly p bit values, that is, each length unit is represented by 1 binary bit, which can make the electronic device process less bit data and make the detection efficiency higher.

[0143] Of course, in other examples, Mask 1 may also include 2p bit values, 3p bit values, 4p bit values, etc. Every two bit values ​​correspond to one length unit in the interval. It can be understood that using the same number of bits to represent each length unit can simplify the calculation of the electronic device.

[0144] Optionally, to further improve the detection efficiency, each interval may also correspond to a mask 2 (or called a second mask), which can be used to determine whether the interval overlaps with the rectangular area. The number of bit values ​​included in mask 2 may be less than the number of bit values ​​included in mask 1. As a possible example, mask 2 may include 1 bit value, i.e., 1 binary bit. For example: Figure 7 As shown, Mask 2 corresponding to intervals A, B, C, D, and E is "0," "1," "1," "1," and "0," respectively. Mask 2 thus includes only one bit, meaning each interval (i.e., p length units) is represented by one binary bit. This further reduces the number of bits processed by the electronic device, resulting in higher detection efficiency.

[0145] Of course, in other examples, mask 2 may also include more than 1 but less than p bit values, such as 2 bit values, 3 bit values, etc. This can also reduce the number of bit data processed by the electronic device and improve detection efficiency.

[0146] In some embodiments, there may be a correspondence between Mask 2 and Mask 1 corresponding to the same interval. When Mask 1 corresponding to the interval indicates that all length units of the interval overlap with the rectangular area, Mask 2 corresponding to the interval indicates that the interval overlaps with the rectangular area. When Mask 1 corresponding to the interval indicates that there are length units in the interval that do not overlap with the rectangular area, Mask 2 corresponding to the interval indicates that the interval does not overlap with the rectangular area. As a specific example, Figure 7 As shown, for an interval, when the interval (such as Figure 7 When the bit values ​​included in the mask 1 corresponding to any one of the intervals B, C, and D shown in FIG1 are all "1" (which can be used as an example of the fourth value), it indicates that all length units in the interval overlap with the rectangular area, and the mask 2 corresponding to the interval can be "1". The mask 2 of "1" can be used to indicate that the interval overlaps with the rectangular area. For an interval, when the interval (such as Figure 7 When the bit value included in the mask 1 corresponding to any one of the A and E intervals shown is "0" (which can be used as an example of the third value), "0" indicates that the corresponding length unit does not overlap with the rectangular area, and the mask 2 corresponding to the interval can be "0". The mask 2 of "0" can be used to represent that the interval does not overlap with the rectangular area.

[0147] Alternatively, for an interval, when the bit values ​​included in Mask 1 corresponding to the interval are all "0", it indicates that all length units in the interval overlap with the rectangular area, and Mask 2 corresponding to the interval can be "0". This Mask 2 of "0" can be used to indicate that the interval overlaps with the rectangular area. For an interval, when the bit value included in Mask 1 corresponding to the interval is "1", then "1" indicates that the corresponding length unit does not overlap with the rectangular area, and Mask 2 corresponding to the interval can be "1". This Mask 2 of "1" can be used to indicate that the interval does not overlap with the rectangular area.

[0148] Alternatively, for an interval, when the bit values ​​included in the mask 1 corresponding to the interval are all "1", it indicates that all length units in the interval overlap with the rectangular area, and the mask 2 corresponding to the interval can be "0". The mask 2 of "0" can be used to indicate that the interval overlaps with the rectangular area. For an interval, when the bit value included in the mask 1 corresponding to the interval is "0", "0" indicates that the corresponding length unit does not overlap with the rectangular area, and the mask 2 corresponding to the interval can be "1". The mask 2 of "1" can be used to indicate that the interval does not overlap with the rectangular area.

[0149] Alternatively, for an interval, when the bit values ​​included in the mask 1 corresponding to the interval are all "0", it indicates that all length units in the interval overlap with the rectangular area, and the mask 2 corresponding to the interval can be "1". The mask 2 of "1" can be used to indicate that the interval overlaps with the rectangular area. For an interval, when the bit value included in the mask 1 corresponding to the interval is "1", the "1" indicates that the corresponding length unit does not overlap with the rectangular area, and the mask 2 corresponding to the interval can be "0". The mask 2 of "0" can be used to indicate that the interval does not overlap with the rectangular area.

[0150] It is understandable that, in the embodiment of the present application, for an interval, there is a corresponding relationship between mask 1, which represents that all length units of the interval overlap with the rectangular area, and mask 2, which represents that the interval overlaps with the rectangular area. There is a corresponding relationship between mask 1, which represents that there are length units in the interval that do not overlap with the rectangular area, and mask 2, which represents that the interval does not overlap with the rectangular area. However, the embodiment of the present application does not limit the specific bit value (such as "0" or "1") used to represent the mask 1 and mask 2 that have the corresponding relationship.

[0151] In this embodiment, as a possible implementation, the electronic device can detect the rectangular area based on the q intervals obtained by division and the mask 1 corresponding to each interval. For example, the electronic device can first detect each rectangular area of ​​the top layer (which can be called the first layer) in sequence (which can be used as an example of the second rectangular area). For a rectangular area of ​​the top layer, the electronic device can determine the Y scan line segments that overlap with the rectangular area. Then, for each scan line segment in the Y scan line segments, the electronic device can determine the J intervals included in the scan line segment that overlap with the rectangular area. Wherein, J is an integer greater than or equal to 1 and less than or equal to q. It can be understood that the number of intervals in each scan line segment that overlap with the rectangular area can be the same or different; this is applicable to the overlap judgment of other rectangular areas or intervals, and will not be repeated later. Then, the electronic device can determine the mask 1 corresponding to each of the J intervals included in each scan line segment in the Y scan line segments.

[0152] Then, after the electronic device completes the detection of the rectangular area of ​​the first layer, the electronic device can sequentially detect each rectangular area of ​​the next layer (which can be called the second layer) (which can be used as an example of the first rectangular area). For a rectangular area of ​​the second layer, the electronic device can determine the X scan line segments that overlap with the rectangular area. Then, for each of the X scan line segments, the electronic device can determine the V intervals included in the scan line segment that overlap with the rectangular area. The V intervals include the above-mentioned K length units. V is an integer greater than or equal to 1 and less than or equal to q. Then, the electronic device can determine whether the rectangular area is hidden based on the mask 1 corresponding to the V intervals included in each of the X scan line segments.

[0153] After the electronic device has finished detecting a rectangular area of ​​the second layer, the electronic device can also determine the mask 1 corresponding to each of the V intervals included in each of the X scanning line segments.

[0154] Then, after the electronic device completes the detection of the rectangular areas in the second layer, it can continue to detect each rectangular area in the next layer (which can be called the third layer). When a rectangular area in the third layer is used as an example of the first rectangular area, the rectangular areas in the second layer and the rectangular areas in the first layer can both be used as examples of the second rectangular area. For the introduction to detecting rectangular areas in the third layer, refer to the introduction to detecting rectangular areas in the second layer. And so on, until all rectangular areas are detected.

[0155] In this implementation, the detection process of the electronic device is introduced by taking the detection of rectangular areas 601 to 603 in sequence as an example, combining the method of performing overlap judgment on the entire interval included in each scanning line segment and the above-mentioned mask.

[0156] Take the detection of rectangular area 601 as an example, Figure 8 As shown in (1) or (2), for each scan line segment that overlaps with the rectangular area 601, the electronic device can determine at least one interval that overlaps with the rectangular area 601, if it can be J intervals, J is an integer greater than or equal to 1 and less than or equal to q. It can be understood that in the embodiment of the present application, for each scan line segment that overlaps with a rectangular area, the interval that overlaps with the rectangular area can be part or all of the intervals into which the scan line segment is divided. In the embodiment of the present application, for each scan line segment, the at least one interval that overlaps with the rectangular area includes a completely overlapping interval and a partially overlapping interval. That is, a certain interval that partially overlaps with the rectangular area is also determined to be an interval that overlaps with the rectangular area.

[0157] For example: Figure 8 As shown in (2), taking scan line 1 that overlaps with the rectangular area as an example, the electronic device can determine that the intervals included in scan line 1 that overlap with the rectangular area 601 include intervals A, B, C, D, and E, where intervals A and E are intervals that partially overlap with the rectangular area 601, and intervals B, C, and D are intervals that completely overlap with the rectangular area. In this example, the exemplary value of J is 5. The electronic device can determine the mask 1 corresponding to each of these intervals. The mask 1 corresponding to each interval can be used to indicate that some or all of the length units included in the interval overlap with the rectangular area 601.

[0158] For example: Figure 8 As shown in (2), after the electronic device detects scan line 1, the mask 1 of the A, B, C, D, and E intervals determined by the electronic device are "0001", "1111", "1111", "1111", and "1110", respectively. Among them, the mask 1 corresponding to the B, C, and D intervals is used to represent that all length units in the corresponding intervals overlap with the rectangular area. The mask 1 corresponding to the A interval is used to represent that the rightmost length unit included in the interval overlaps with the rectangular area, and the other length units do not overlap with the rectangular area. The mask 1 corresponding to the E interval is used to represent that the rightmost length unit included in the interval does not overlap with the rectangular area, and the other length units overlap with the rectangular area. Similarly, after the electronic device detects other scan lines that overlap with the rectangular area 601, it can also determine the mask 1 corresponding to the intervals included in these scan lines that overlap with the rectangular area 601.

[0159] Similarly, in this embodiment, the electronic device determines that the mask 1 corresponding to each interval overlapping with the rectangular area 601 may refer to generating mask 1, that is, before the electronic device performs the operation of generating mask 1 corresponding to a certain interval, the interval may not have a corresponding mask 1.

[0160] Alternatively, the electronic device determining the mask 1 corresponding to each interval that overlaps with the rectangular area 601 may also refer to updating the bit value in the mask 1. That is, before the electronic device performs the operation of determining the mask 1 corresponding to a certain interval, the interval may have a corresponding mask 1, but the mask 1 at this time can be used to indicate that the length unit included in the interval does not overlap with the rectangular area. For example: Figure 8 As shown in (1), before detecting the rectangular area 601, the mask 1 corresponding to the intervals A, B, C, D, and E included in the scan line 1 is all "0000". Figure 8 As shown in (2), after the electronic device detects the rectangular area 601, the electronic device can update the bit value in the mask 1 corresponding to the interval based on whether the length units included in the intervals A, B, C, D, and E overlap with the rectangular area 601.

[0161] Then, after the electronic device has finished detecting each scanning line segment of the rectangular area 601, the electronic device can continue to detect the rectangular area 602. Similarly, for each scanning line segment that overlaps with the rectangular area 602, the electronic device can also determine at least one interval that overlaps with the rectangular area 602. For example: Figure 9 As shown in (1), taking the scan line 2 that overlaps with the rectangular area 602 as an example, the electronic device can determine that the intervals included in the scan line 2 that overlap with the rectangular area include intervals A and B. In this example, when the rectangular area 602 is used as an example of the first rectangular area, the exemplary value of V is 2. When the rectangular area 602 is used as an example of the second rectangular area, the exemplary value of J is 2. For another example: Figure 9 As shown in (3), taking the scan line segment that overlaps with the rectangular area 602 as scan line 5 as an example, the electronic device can determine that the intervals included in the scan line 5 that overlap with the rectangular area 602 include intervals A and B.

[0162] The electronic device can determine whether the rectangular area 602 is hidden based on the mask 1 corresponding to each interval that overlaps with the rectangular area 602. Similarly, as a possible scenario, for each interval that overlaps with a certain rectangular area, if the mask 1 corresponding to the interval represents that the length units included in the interval that overlap with the rectangular area all overlap with rectangular areas other than the rectangular area, the electronic device can detect that the rectangular area is hidden. In this case, when a rectangular area is completely blocked by an upper rectangular area, the interval that overlaps with the upper rectangular area may include all of the intervals that overlap with the blocked rectangular area. Alternatively, when a rectangular area is blocked by multiple upper rectangular areas, the interval that overlaps with these multiple upper rectangular areas may include all of the intervals that overlap with the blocked rectangular area, and the interval that overlaps with one of the upper rectangular areas may include part of the interval that overlaps with the blocked rectangular area.

[0163] As another possible situation, for each interval that overlaps with a rectangular area, if the mask 1 corresponding to the interval represents that a certain length unit included in the interval that overlaps with the rectangular area does not overlap with a rectangular area other than the rectangular area, then the electronic device can detect that the rectangular area is not hidden. Figure 9 In the figure, the rectangular area 602 is taken as an example where it is not hidden.

[0164] For example: Figure 9 As shown in (1), taking scan line 2 as an example, the intervals that overlap with the rectangular area include intervals A and B. Before detecting the rectangular area 602, the mask 1 corresponding to interval A is "0001", which represents the overlap between the rightmost length unit in interval A and the rectangular area above the rectangular area 602 ( Figure 9 (Taking rectangular area 601 as an example), there is overlap, and the three length units on the left side of interval A do not overlap with the rectangular area above rectangular area 602. In interval A, the length units overlapping with rectangular area 602 are the three length units on the right side. Therefore, the middle two length units in interval A overlap with rectangular area 602 and do not overlap with the rectangular area above rectangular area 602. Mask 1 corresponding to interval B is "1111", and the mask 1 indicates that all length units in interval B overlap with the rectangular area above rectangular area 602. In interval B, the length unit overlapping with rectangular area 602 is the leftmost length unit. Therefore, based on the mask 1, the electronic device can determine that in the interval overlapping with rectangular area 602, the middle two length units included in interval A that overlap with rectangular area 602 do not overlap with the rectangular area above rectangular area 602, and the electronic device can detect that rectangular area 602 is not hidden.

[0165] For example: Figure 9 As shown in (3), taking scan line 5 as an example, the intervals included therein that overlap with the rectangular area include intervals A and B. Before the rectangular area 602 is detected, the mask 1 corresponding to interval A is "0000", and the mask 1 indicates that all the length units included in interval A do not overlap with the rectangular area above the rectangular area 602. In interval A, the length units that overlap with the rectangular area 602 are the three length units on the right. The mask 1 corresponding to interval B is "0000", and the mask 1 indicates that all the length units of interval B do not overlap with the rectangular area above the rectangular area 602. In interval B, the length unit that overlaps with the rectangular area 602 is the leftmost length unit. Therefore, the electronic device can also detect that the rectangular area 602 is not hidden based on the mask 1.

[0166] Similarly, after the electronic device detects the rectangular area 602, it can also determine the mask 1 corresponding to the interval of the scan line that overlaps with the rectangular area 602. For example, taking scan line 2 as an example, the electronic device can Figure 9 The mask 1 "0001" corresponding to the interval A shown in (1) is updated as follows Figure 9 The mask 1 shown in (2) is "0111". Figure 9 The mask 1 "1111" corresponding to the interval B shown in (1) can no longer be updated. For example, taking scan line 5 as an example, the electronic device can Figure 9 The mask 1 "0000" corresponding to the interval A shown in (3) is updated as follows Figure 9 The mask 1 "0111" shown in (4) will be Figure 9 The mask 1 "0000" corresponding to the interval B shown in (3) is updated as follows Figure 9 The mask 1 "1000" shown in (4) is shown in FIG.

[0167] Regarding the implementation of determining the mask 1 corresponding to the interval overlapped with the rectangular area 602 and included in the scan line overlapped with the rectangular area 602 , reference may be made to the related implementation when detecting the rectangular area 601 .

[0168] Next, the electronic device may continue to detect the rectangular area 603. Similarly, for each scanning line segment that overlaps with the rectangular area 603, the electronic device may also determine at least one interval that overlaps with the rectangular area 603. Figure 10As shown in (1), taking the scan line 3 that overlaps with the rectangular area as an example, the electronic device can determine that the intervals included in the scan line 3 that overlap with the rectangular area 603 include intervals B, C, D, and E. It can be understood that since there is no overlap between the rectangular area 602 and the rectangular area 603, for ease of understanding, Figure 10 The rectangular area 602 is not shown.

[0169] The electronic device can also determine whether rectangular area 603 is hidden based on mask 1 corresponding to each interval that overlaps with rectangular area 603. Similarly, when detecting rectangle 603, the two situations described above when detecting rectangular area 602 may also occur. For an introduction to these two situations, please refer to the relevant introduction to detecting area rectangle 602 described above. Figure 10 It is taken as an example that the rectangular area 603 is completely hidden by the rectangular area 601 .

[0170] like Figure 10 As shown in (1), the mask 1 corresponding to the intervals B, C, and D is "1111", which indicates that all the length units included in the corresponding interval are the same as the rectangular area above the rectangular area 602 ( Figure 10 In interval B, the length units that overlap with rectangular area 603 are the three length units on the right. In intervals C and D, the length units that overlap with rectangular area 603 are all the length units included. Mask 1 corresponding to interval E is "1110". This mask 1 indicates that only the three length units on the left side of interval E overlap with the rectangular area above rectangular area 602, and in interval E, the length units that overlap with rectangular area 603 are also the three length units on the left. Therefore, based on this mask 1, the electronic device can detect that rectangular area 603 is hidden.

[0171] Furthermore, after the electronic device detects the rectangular area 603, the electronic device may also determine the mask 1 corresponding to the interval that overlaps with the rectangular area 603 and is included in the scan line that overlaps with the rectangular area 603. For example: Figure 10 As shown, taking the intervals B, C, D, and E included in scan line 3 and overlapping with the rectangular area 603 as an example, since the rectangular area 603 is completely hidden by the rectangular area 601, the mask 1 corresponding to these intervals has been updated when the rectangular area 601 is detected. Therefore, after the rectangular area 603 is detected this time, there is no need to update the mask 1 corresponding to these intervals. Figure 10 (1) and Figure 10As shown in (2), the mask 1 corresponding to these intervals is the same before and after the detection of the rectangular area 603. Regarding the implementation of determining the mask 1 corresponding to the intervals overlapping with the rectangular area 603 included in the scan lines that overlap with the rectangular area 603, please refer to the relevant introduction when detecting the rectangular area 602.

[0172] In the embodiment of the present application, for a rectangular area, the electronic device can uniformly update Mask 1, Mask 2, etc. corresponding to all scan line segments that overlap with the rectangular area after detecting all scan line segments. Of course, in other embodiments, the electronic device can also update Mask 1, Mask 2, etc. corresponding to a scan line segment after detecting the scan line segment.

[0173] In the above embodiment, the electronic device detects the rectangular area based on Mask 1. In some embodiments, the electronic device may also detect the rectangular area in combination with Mask 2 to improve detection efficiency.

[0174] In some embodiments, for intervals that overlap with a rectangular area, the electronic device may classify the intervals into interval segments based on the overlap between the rectangular area and the interval. An interval segment may include at least one interval. Exemplarily, the interval segment may include at least one type of interval segment that completely overlaps with the rectangular area and an interval segment that partially overlaps with the rectangular area. In other words, the electronic device may classify the intervals into different types based on the overlap between the rectangular area and the interval. Exemplarily, the interval types obtained by the division may include at least one type of interval segment that completely overlaps with the rectangular area and an interval segment that partially overlaps with the rectangular area. Among them, an interval segment that completely overlaps with the rectangular area may refer to an interval included in the interval segment that completely overlaps with the rectangular area. An interval segment that partially overlaps with the rectangular area may refer to an interval included in the interval segment that partially overlaps with the rectangular area.

[0175] For example, Figure 8 As shown in (3) or (4), the intervals A, B, C, D, and E that overlap with the rectangular area 601 can be divided into the middle, left, and right segments. The intervals B, C, and D included in the middle segment completely overlap with the rectangular area 601, while the interval A included in the left segment and the interval E included in the right segment partially overlap with the rectangular area 601.

[0176] For example, Figure 9 As shown, the intervals A and B that overlap with the rectangular area 602 can be divided into a left segment and a right segment, wherein the interval A included in the left segment and the interval B included in the right segment partially overlap with the rectangular area 602 .

[0177] For example, Figure 10As shown, intervals B, C, D, and E that overlap with rectangular area 603 can be divided into a middle segment, a left segment, and a right segment. Intervals C and D included in the middle segment completely overlap with rectangular area 603, while interval B included in the left segment and interval E included in the right segment partially overlap with rectangular area 603.

[0178] It is understood that for an interval that overlaps with a rectangular area, the interval segments that can be divided into may include at least one of the left segment, the middle segment, and the right segment. The interval included in the middle segment completely overlaps with the rectangular area, and the interval included in the left segment or the right segment partially overlaps with the rectangular area.

[0179] In this embodiment, for different types of intervals, that is, for different types of intervals, the electronic device can use different masks (such as mask 1 and mask 2) to detect the rectangular area. For example: for an interval that completely overlaps with the rectangular area, that is, for an interval that completely overlaps with the rectangular area, the electronic device can perform detection based on mask 2. For an interval that partially overlaps with the rectangular area, that is, for an interval that partially overlaps with the rectangular area, the electronic device can perform detection based on mask 1. Since the number of bits in mask 2 is less than that in mask 1, this allows the electronic device to process fewer bits of data, further improving detection efficiency.

[0180] For example: Combine Figure 8 In the examples shown in (3) and (4), when the electronic device detects the intervals included in the scan line 1 that overlap with the rectangular area 601, namely the intervals A, B, C, D, and E, that is, the left segment, the middle segment, and the right segment, the electronic device can detect the rectangular area 601 based on the mask 2 corresponding to each interval included in the middle segment, and the mask 1 corresponding to each interval in the left segment and the right segment. Similarly, in this example, after the electronic device detects the scan line 1, the electronic device can determine the mask 1 and mask 2 corresponding to all the intervals included in the left segment, the middle segment, and the right segment. Among them, the mask 1 corresponding to each interval can be used to indicate that some or all of the length units included in the interval overlap with the rectangular area 601. The mask 2 corresponding to each interval can be used to indicate that the interval overlaps with the rectangular area 601.

[0181] For ease of understanding, in the drawings described in the embodiments of the present application, mask 1 is represented by 4 bits and mask 2 is represented by 1 bit.

[0182] For example, the electronic device can update the mask 1 and mask 2 before detection as shown in (3) in 8 to Figure 8Mask 1 and mask 2 shown in (4). For example, the mask 1 "0000" corresponding to interval A is updated to "0001", and the mask 2 "0" corresponding to interval A is not updated. The mask 1 "0000" corresponding to intervals B, C, and D are all updated to "1111", and the mask 2 "0" corresponding to intervals B, C, and D are all updated to "1". The mask 1 "0000" corresponding to interval E is all updated to "1110", and the mask 2 "0" corresponding to interval E is not updated. Among them, mask 2 is "0" to indicate that the interval corresponding to mask 2 does not overlap with the rectangular area, and mask 2 is "1" to indicate that the interval corresponding to mask 2 overlaps with the rectangular area. It can be understood that when mask 2 is "0" to indicate that the interval corresponding to mask 2 does not overlap with the rectangular area, it can include two situations, namely: the entire interval corresponding to mask 2 does not overlap with the rectangular area, and part of the interval corresponding to mask 2 does not overlap with the rectangular area. Similarly, when mask 2 uses other values ​​to represent that the interval corresponding to mask 2 does not fit in the rectangular area, the above two cases are also included. Figure 8 In the example shown in (4), the mask 2 corresponding to intervals A and E is "0", which specifically means that the portion of the interval corresponding to the mask 2 does not overlap with the rectangular area.

[0183] For example: Combine Figure 9 In the examples shown in (1) and (2), when the electronic device detects the intervals included in the scan line 2 that overlap with the rectangular area 602, namely, intervals A and B, i.e., the left segment and the right segment, the electronic device can detect the rectangular area 601 based on the mask 1 corresponding to each interval in the left segment and the right segment. Figure 9 The same applies to the examples shown in (3) and (4).

[0184] For example: Combined with Figure 10 In the example shown, when the electronic device detects the intervals that overlap with the rectangular area 603 in the detection scan line 3, namely, intervals B, C, D, and E, i.e., the left segment, the middle segment, and the right segment, the electronic device can detect the rectangular area 603 based on the mask 2 corresponding to each interval included in the middle segment, and the mask 1 corresponding to each interval in the left segment and the right segment. Figure 10As shown in (1), the mask 2 corresponding to intervals C and D (which can be used as examples of VR intervals) is both "1", and the electronic device can determine that intervals C and D overlap with the rectangular area above rectangular area 603. The mask 1 corresponding to interval B (which can be used as an example of one of the R intervals) is "1111", and the electronic device can determine that the length unit in interval B that overlaps with rectangular area 603 overlaps with the rectangular area above rectangular area 603. The mask 1 corresponding to interval E (which can be used as an example of one of the R intervals) is "1110", and the electronic device can determine that the length unit in interval E that overlaps with rectangular area 603 overlaps with the rectangular area above rectangular area 603. Similarly, in this example, after the electronic device detects scan line 3, the electronic device can also determine the masks 1 and 2 corresponding to all intervals included in the left segment, middle segment, and right segment. For this introduction, please refer to the relevant introduction of rectangular area 601. Optionally, the electronic device can only determine the masks 1 and 2 of the left segment and right segment, and not determine the masks 1 and 2 of the middle segment.

[0185] Based on the above scheme of using Mask 1, Mask 2, etc. to detect rectangular areas, by utilizing bit operations of binary integers, it is possible to efficiently detect whether the rendering nodes corresponding to the rectangular areas are hidden, which can significantly reduce the detection overhead.

[0186] In some embodiments, the operating system of the electronic device may include a rendering service process that can be used to uniformly render all applications. Each frame of an image to be rendered may correspond to a rendering service process that can be used to render the image to be rendered, which may include at least one application window or interface.

[0187] In this embodiment, as a possible application scenario, for example: for HarmonyOS The electronic device, such as an operating system, may apply the detection solution provided in the embodiments of the present application to detect all rendering nodes included in the S+1th frame image when the image to be rendered is the S+1th frame image, to determine which rendering nodes in the S+1th frame image are hidden. Where S is an integer greater than or equal to 1.

[0188] For example: in this application scenario, when the electronic device executes the rendering service process of the S-th frame image to render the S-th frame image, if the rendering service process can only obtain all the rendering nodes included in the S-th frame image when or after generating the drawing instructions for all the rendering nodes included in the S-th frame image. Then the electronic device can apply the detection scheme provided by the embodiment of the present application again when the image to be rendered is the S+1-th frame. Among them, all the rendering nodes (that is, all rectangular areas) included in the S+1-th frame image can be determined based on all the rendering nodes included in the S-th frame image and the changed rendering nodes obtained when executing the rendering service process of the S+1-th frame image. That is to say, the rendering service process corresponding to this frame image can obtain the changed rendering nodes of this frame image relative to the previous frame image before generating the drawing instructions.

[0189] For example: Figure 11 As shown in (1), the rendering service process includes a rendering service main thread (hereinafter referred to as the main thread) and a unified rendering thread (hereinafter referred to as the child thread). In this example, the main thread is responsible for some pre-processing and updating tasks of rendering nodes in the dirty region during the preparation stage. The main thread can obtain rendering nodes that have changed relative to the previous frame image during the preparation stage. It can be understood that the dirty region in graphics rendering can refer to an area where elements have changed (such as changes in color, shape, position, etc.). Thread synchronization can be used to synchronize data between the main thread and the child thread. The child thread is responsible for generating drawing instructions for the rendering node during the drawing stage and for sending the image to the display screen during the display stage. The child thread can obtain all rendering nodes included in the current frame image during the drawing stage. It can be understood that when the vertical synchronization signal (VSYNC) arrives, the electronic device can start the rendering service process for a frame of image.

[0190] like Figure 11 In the example shown in (1), the electronic device can obtain the rendering nodes that have changed relative to the S-th frame image in the preparation stage of the main thread corresponding to the S+1-th frame image, and obtain all the rendering nodes included in the S-th frame image in the drawing stage of the sub-thread corresponding to the S-th frame image, and then obtain all the rendering nodes included in the S+1-th frame image. Subsequently, the detection scheme provided by the embodiment of the present application can be executed in the occlusion detection stage of the sub-thread to obtain the hidden rendering nodes. It can be understood that the occlusion detection stage is before the drawing stage. Then, the drawing instructions for the hidden rendering nodes can be omitted in the drawing stage. And the S+1-th frame image is sent to the display screen for display in the display stage.

[0191] As another possible application scenario, for example: The electronic device, such as an operating system, may apply the detection solution provided by the embodiment of the present application to detect all rendering nodes included in the S-th frame image when the image to be rendered is the S-th frame image, to determine which rendering nodes in the S-th frame image are hidden. Where S is an integer greater than or equal to 1.

[0192] For example, in this scenario, when the electronic device executes the rendering service process for the S-th frame image to render the S-th frame image, if the rendering service process can obtain all rendering nodes included in the S-th frame image before generating drawing instructions for all rendering nodes included in the S-th frame image, then the electronic device can apply the detection solution provided by the embodiment of the present application when the image to be rendered is the S-th frame. In other words, the rendering service process corresponding to the current frame image can obtain the rendering nodes that have changed in the current frame image relative to the previous frame image before generating drawing instructions.

[0193] For example: Figure 11 As shown in (2), the rendering service process may also include a main thread and a child thread. In this example, the main thread may be responsible for the preprocessing operations of all rendering nodes in the preparation stage. The main thread may obtain all rendering nodes included in the current frame image in the preparation stage. Therefore, the electronic device may obtain all rendering nodes included in the S-frame image in the preparation stage of the main thread corresponding to the S-frame image. Subsequently, the detection scheme provided by the embodiment of the present application may be executed in the occlusion detection stage of the child thread to obtain the hidden rendering nodes. Then, the drawing instructions for the hidden rendering nodes may not be generated in the drawing stage. And the S-frame image may be sent to the display screen for display in the display stage.

[0194] In the above application scenarios, the technical solution provided by the embodiments of the present application can achieve the purpose of reducing the load of the rendering service process, reducing the rendering time of a single frame image, and improving the frame rate.

[0195] For example, Table 2 shows a comparison of the results of using the detection solution provided in the embodiments of the present application and the above-mentioned solution in some scenarios.

[0196] Table 2

[0197]

[0198] As shown in Table 2, under the same application scenario, the detection solution provided by the embodiment of the present application takes far less time than the solution described above, achieving a speed increase of at least 30 times. Furthermore, the technical solution provided by the embodiment of the present application can achieve the same culling rate as the solution described above, where the culling rate refers to the number of obscured rendering nodes in the graphical interface divided by the total number of rendering nodes in the rectangular interface, thus achieving the same accuracy.

[0199] For example, Figure 12 FIG. 1 shows a flow chart of a rendering node detection method provided by an embodiment of the present application. Figure 12 As shown, the method includes the following steps:

[0200] S1201: The electronic device obtains a first rectangular area.

[0201] The first rectangular area is one of M rectangular areas included in the image to be rendered, each of the M rectangular areas is used to draw a rendering node, and M is an integer greater than or equal to 1.

[0202] S1202: The electronic device determines K length units included in each of the X scan line segments and overlapping with the first rectangular area.

[0203] Among them, the X scan line segments are the scan line segments corresponding to the M rectangular areas that overlap with the first rectangular area, X and K are both integers greater than or equal to 1, and the scan line segments corresponding to the M rectangular areas are obtained based on two scan line segments obtained from each rectangular area of ​​the M rectangular areas, and the two scan line segments respectively coincide with two parallel boundary lines included in the rectangular area.

[0204] S1203: When the first information corresponding to each length unit in the K length units included in each scan line segment in the X scan line segments indicates that the length unit overlaps with a second rectangular area in the M rectangular areas, a rendering node corresponding to the first rectangular area is hidden.

[0205] The second rectangular area is a rectangular area located above the first rectangular area. It is understandable that there may be at least one second rectangular area.

[0206] Illustratively, in this step, the first rectangular area may be the rectangular area 603 described above, and the second rectangular area may be the rectangular area 601 described above.

[0207] S1204: When the first information corresponding to at least one length unit among the K length units included in at least one scan line segment among the X scan line segments indicates that the at least one length unit does not overlap with the second rectangular area, the rendering node corresponding to the first rectangular area is not hidden.

[0208] Illustratively, in this step, the first rectangular area may be the rectangular area 602 described above, and the second rectangular area may be the rectangular area 601 described above.

[0209] Among them, about Figure 12 For the specific implementation, please refer to the introduction above.

[0210] The above mainly introduces the solution provided by the embodiment of the present application from the perspective of method. It is understandable that, in order to realize the above functions, the electronic device includes a hardware structure and / or software module corresponding to the execution of each function. In combination with the units and algorithm steps of each example described in the embodiment disclosed in this application, the embodiment of the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer-driven hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to realize the described functions for each specific application, but such implementation should not be considered to exceed the scope of the technical solution of the embodiment of the present application.

[0211] The present application is an embodiment that can divide the functional modules of the electronic device according to the above method example. For example, each functional module can be divided corresponding to each function, or two or more functions can be integrated into one processing unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional modules. It should be noted that the division of units in the embodiment of the present application is schematic and is only a logical function division. There may be other division methods in actual implementation.

[0212] like Figure 13 FIG2 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. The electronic device 1300 can be used to implement the methods performed by the electronic devices described in the above method embodiments. For example, the electronic device 1300 may include a processing unit 1301 and a display unit 1302.

[0213] Processing unit 1301, used to support electronic device 1300 to execute Figures 1 to 12 Any of the processing functions, the display unit 1302 is used to support the electronic device 1300 to perform Figures 1 to 12 Any one of the display functions described above.

[0214] Optional, Figure 13 The electronic device 1300 shown may further include a storage unit 1303, which stores a program or instruction. When the processing unit 1301 executes the program or instruction, Figure 13 The electronic device 1300 shown can execute the method described in the above method embodiment.

[0215] Figure 13 The technical effects of the electronic device 1300 shown can refer to the technical effects described in the above method embodiment, and will not be repeated here. Figure 13The processing unit 1301 involved in the electronic device 1300 shown can be implemented by a processor or processor-related circuit components, and can be a processor or a processing module. The display unit 1302 can be implemented by display screen-related components.

[0216] The present application also provides a chip system. Figure 14 As shown, the chip system includes at least one processor 1401 and at least one interface circuit 1402. The processor 1401 and the interface circuit 1402 can be interconnected via lines. For example, the interface circuit 1402 can be used to receive signals from other devices. For another example, the interface circuit 1402 can be used to send signals to other devices (such as the processor 1401). Exemplarily, the interface circuit 1402 can read instructions stored in the memory and send the instructions to the processor 1401. When the instructions are executed by the processor 1401, the electronic device can execute the various steps performed by the electronic device in the above embodiment. Of course, the chip system can also include other discrete devices, which is not specifically limited in the embodiments of the present application.

[0217] Optionally, there may be one or more processors in the chip system. The processor may be implemented in hardware or software. When implemented in hardware, the processor may be a logic circuit, an integrated circuit, etc. When implemented in software, the processor may be a general-purpose processor implemented by reading software code stored in a memory.

[0218] Optionally, the memory in the chip system may be one or more memories. The memory may be integrated with the processor or may be provided separately from the processor, which is not limited in this application. For example, the memory may be a non-transient processor, such as a read-only memory (ROM), which may be integrated with the processor on the same chip or provided on different chips. This application does not specifically limit the type of memory or the configuration of the memory and the processor.

[0219] Exemplarily, the chip system can be a field programmable gate array (FPGA), an application specific integrated circuit (ASIC), a system on chip (SoC), a central processor unit (CPU), a network processor (NP), a digital signal processor (DSP), a microcontroller unit (MCU), a programmable logic device (PLD) or other integrated chips.

[0220] It should be understood that each step in the above method embodiment can be completed by hardware integrated logic circuits in a processor or by software instructions. The method steps disclosed in the embodiments of the present application can be directly embodied as being executed by a hardware processor, or by a combination of hardware and software modules in a processor.

[0221] An embodiment of the present application further provides a computer storage medium, in which computer instructions are stored. When the computer instructions are executed on an electronic device, the electronic device executes the method described in the above method embodiment.

[0222] An embodiment of the present application provides a computer program product, which includes: a computer program or instructions, which, when executed on a computer, causes the computer to execute the method described in the above method embodiment.

[0223] In addition, an embodiment of the present application also provides a device, which can specifically be a chip, component or module, and the device may include a connected processor and memory; wherein the memory is used to store computer-executable instructions, and when the device is running, the processor can execute the computer-executable instructions stored in the memory to enable the device to execute the methods in the above-mentioned method embodiments.

[0224] Among them, the electronic device, computer storage medium, computer program product or chip provided in this embodiment is used to execute the corresponding method provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding method provided above, and will not be repeated here.

[0225] Through the description of the above implementation methods, technical personnel in the relevant field can understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be distributed and completed by different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.

[0226] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. The various embodiments can be combined with each other or referenced to each other without conflict. The device embodiments described above are merely schematic. For example, the division of modules or units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0227] Units described as separate components may or may not be physically separate, and components shown as units may be one physical unit or multiple physical units, that is, they may be located in one place or distributed in multiple places. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0228] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.

[0229] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling a device (which can be a single-chip microcomputer, chip, etc.) or a processor (processor) to execute all or part of the steps of the various embodiments of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0230] The above content is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this application should be included in the scope of protection of the present application. Therefore, the scope of protection of the present application should be based on the scope of protection of the claims.

Claims

1. A rendering node detection method, characterized in that: Applied to an electronic device having a display screen, the method includes: Obtain a first rectangular area, where the first rectangular area is one of M rectangular areas included in the image to be rendered, each of the M rectangular areas is used to draw a rendering node, and M is an integer greater than or equal to 1; Determining K length units that overlap with the first rectangular area in each of X scan line segments, where the X scan line segments are scan line segments that overlap with the first rectangular area among the scan line segments corresponding to the M rectangular areas, where X and K are both integers greater than or equal to 1, and the scan line segments corresponding to the M rectangular areas are obtained based on two scan line segments obtained from each of the M rectangular areas, where the two scan line segments respectively overlap with two parallel boundary lines of the rectangular areas; When the first information corresponding to each length unit of the K length units included in each scan line segment of the X scan line segments indicates that the length unit overlaps with a second rectangular area among the M rectangular areas, a rendering node corresponding to the first rectangular area is hidden, wherein the second rectangular area is a rectangular area located above the first rectangular area.

2. The method according to claim 1, characterized in that The method further comprises: When the first information corresponding to at least one length unit of the K length units included in at least one scan line segment among the X scan line segments indicates that the at least one length unit does not overlap with the second rectangular area, the rendering node corresponding to the first rectangular area is not hidden.

3. The method according to claim 1 or 2, characterized in that Before detecting that the rendering node corresponding to the first rectangular area is hidden, the method further includes: Get the second rectangular area; Determine L length units that overlap with the second rectangular area in each of Y scan line segments, where the Y scan line segments are scan line segments that overlap with the second rectangular area among the scan line segments corresponding to the M rectangular areas, and Y and L are both integers greater than or equal to 1; Determine the first information corresponding to each length unit in the L length units, where the L length units include part or all of the K length units.

4. The method according to claim 3, characterized in that Before acquiring the second rectangular area, the first information corresponding to each length unit in the L length units is used to indicate that the length unit does not overlap with the rectangular area.

5. The method according to claim 3 or 4, characterized in that The determining the first information corresponding to each length unit in the L length units includes: When the length unit does not overlap with the rectangular area, determining that the first information is a first value; When the length unit overlaps with the rectangular area, the first information is determined to be a second value; and the first value is different from the second value.

6. The method according to any one of claims 1 to 5, characterized in that The two parallel boundary lines are the upper boundary line and the lower boundary line of the rectangular area, and the length of the scanning line segment is greater than or equal to the width of the display screen; or the two parallel boundary lines are the left boundary line and the right boundary line of the rectangular area, and the length of the scanning line segment is less than or equal to the height of the display screen.

7. The method according to any one of claims 1 to 6, characterized in that Each of the scan line segments corresponding to the M rectangular areas is equally divided into N length units, where N is a preset positive integer, and the K length units included in each of the scan line segments that overlap with the first rectangular area are part or all of the N length units into which the scan line segment is equally divided.

8. The method according to claim 7, characterized in that Each scanning line segment corresponding to the M rectangular areas is equally divided into q intervals, each of the q intervals includes p length units, N=p×q, and p and q are both preset positive integers; The step of determining K length units that overlap with the first rectangular area in each of the X scan line segments includes: Determine V intervals included in each of the X scan line segments and overlapping with the first rectangular area, where the V intervals include the K length units, and V is an integer greater than or equal to 1 and less than or equal to q.

9. The method according to claim 8, characterized in that The method of detecting that a rendering node corresponding to a second rectangular area in the M rectangular areas is hidden when determining, based on the first information corresponding to each length unit in the K length units, that the length unit overlaps with a second rectangular area in the M rectangular areas includes: Obtain a first mask corresponding to each of the R intervals and a second mask corresponding to each of the VR intervals, where the V intervals include the R intervals and the VR intervals, R is a positive integer greater than or equal to 1 and less than or equal to V, each of the R intervals partially overlaps with the first rectangular area, and each of the VR intervals completely overlaps with the first rectangular area, the first mask includes p bit values, and the second mask includes 1 bit value; When the first mask corresponding to the R intervals indicates that a length unit in the interval that overlaps with the first rectangular area overlaps with the second rectangular area, and the second mask corresponding to the VR intervals indicates that the interval overlaps with the second rectangular area, the first rectangular area is hidden.

10. The method according to claim 9, characterized in that Before detecting that the rendering node corresponding to the first rectangular area is hidden, the method further includes: Get the second rectangular area; Determine J intervals of each of the Y scan line segments that overlap with the second rectangular area, where the Y scan line segments are scan line segments corresponding to the M rectangular areas that overlap with the second rectangular area, and J is an integer greater than or equal to 1 and less than or equal to q; Determine the first mask and the second mask corresponding to each interval of the J intervals, where the J intervals include the V intervals.

11. The method according to claim 10, characterized in that Before obtaining the second rectangular area, each of the q intervals corresponds to a first mask and a second mask, and bit values ​​in the first mask and the second mask are both third values; and determining the first mask and the second mask corresponding to each of the J intervals includes: Part or all of the bit values ​​in the first mask and the second mask corresponding to each interval in the J intervals are updated to a fourth value, where the fourth value is different from the third value.

12. The method according to claim 11, characterized in that When the first mask corresponding to the R intervals indicates that a length unit in the interval that overlaps with the first rectangular area overlaps with the second rectangular area, and the second mask corresponding to the VR intervals indicates that the interval overlaps with the second rectangular area, the first rectangular area is hidden, including: When the bit value in the first mask corresponding to the length unit overlapping with the first rectangular area in the R intervals is the fourth value, and the bit value in the second mask corresponding to the VR intervals is the fourth value, the first rectangular area is hidden.

13. The method according to claim 11 or 12, characterized in that The third value is 0, and the fourth value is 1; or the third value is 1, and the fourth value is 0.

14. The method according to any one of claims 8 to 13, characterized in that The values ​​of p and q are both one of 8, 16, 32, and 64.

15. The method according to any one of claims 1 to 14, characterized in that The image to be rendered is the S+1th frame image, the M rectangular areas included in the image to be rendered are determined based on all rendering nodes included in the Sth frame image and the changed rendering nodes, where S is an integer greater than or equal to 1; Alternatively, the image to be rendered is an S+1th frame image, the M rectangular areas included in the image to be rendered are determined based on all rendering nodes included in the S+1th frame image, and S is an integer greater than or equal to 0.

16. The method according to any one of claims 1 to 15, characterized in that After detecting that the rendering node corresponding to the first rectangular area is hidden, the method further includes: A drawing instruction for the rendering node corresponding to the first rectangular area is not generated, and the drawing instruction for the rendering node is used to draw the rendering node.

17. An electronic device, characterized in that: include: A processor, a memory, and a display screen, wherein the memory and the display screen are coupled to the processor, the memory is used to store program code, the program code includes instructions, and the processor reads the instructions from the memory to enable the electronic device to execute the method according to any one of claims 1 to 16.

18. A computer-readable storage medium, characterized in that The computer-readable storage medium comprises a computer program, and when the computer program is run on an electronic device, the electronic device is caused to perform the method according to any one of claims 1 to 16.

19. A computer program product, characterized in that The computer program product comprises: a computer program or instructions, and when the computer program or instructions are run on a computer, the computer is caused to perform the method according to any one of claims 1 to 16.

Citation Information

Cited By

  • Rendering node detection method and electronic device

    WO2026144529A1