Method and electronic device for superimposing multiple image layers

By enabling local refresh functionality in the graphics processor and reducing the number of image format bits, the problem of layer transparency information consuming resources was solved, enabling more efficient layer overlay processing and improving system performance.

CN122336029APending Publication Date: 2026-07-03MEDIATEK SINGAPORE PTE LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
MEDIATEK SINGAPORE PTE LTD
Filing Date
2025-01-02
Publication Date
2026-07-03

AI Technical Summary

Technical Problem

Existing layer transparency information consumes a lot of memory and bandwidth resources in certain application scenarios, and when some layer content is updated, all layers need to be re-overlaid, wasting computing resources.

Method used

By judging the changes in layer information and the area of ​​dirty regions, the local refresh function of the graphics processor is enabled, reducing the image format from 32 bits to 24 bits, refreshing only the dirty region image layer, and reducing the computational load of the graphics processor.

Benefits of technology

It reduces the number of instructions per second (MIPS), lowers bandwidth and memory usage, and improves system efficiency and performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122336029A_ABST
    Figure CN122336029A_ABST
Patent Text Reader

Abstract

This invention provides a method for overlaying multiple image layers, comprising the following steps: receiving image layers from an application; collecting processing information, the processing information including a first image format of the overlay image output by a graphics processor and dirty areas of the image layers; determining whether to enable the local refresh function of the graphics processor; in response to enabling the local refresh function, changing the first image format of the overlay image to a second image format, wherein the data size of the second image format is smaller than the data size of the first image format; performing overlay processing on the layers and outputting the overlay image in the second image format; and refreshing the dirty areas of the overlay image.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to an electronic device, and more particularly to a method and electronic device for overlaying multiple image layers. Background Technology

[0002] In existing mobile phone display processes, layer transparency has no practical effect in certain application scenarios. The output format includes an alpha channel, which consumes a lot of memory and bandwidth resources. The alpha format carries layer transparency information.

[0003] In certain application scenarios, when the content of some layers is updated, all layers need to be re-overlaid, wasting memory resources; in scenarios where the same content is displayed on multiple screens, layers need to be repeatedly overlaid, wasting computing resources. Summary of the Invention

[0004] An embodiment of the present invention provides a method for overlaying multiple image layers. The method includes the following steps: receiving image layers from an application; collecting processing information, including a first image format of the overlay image output by a graphics processor and dirty areas of the image layers; determining whether to enable the local refresh function of the graphics processor; when it is determined that the local refresh function of the graphics processor is enabled, setting the overlay processing to be used for the image layers; changing the first image format of the overlay image to a second image format, wherein the data size of the second image format is smaller than the data size of the first image format; performing overlay processing on the image layers and outputting the overlay image in the second image format; and refreshing the dirty areas of the overlay image.

[0005] According to the above method, the processing information includes display information and image layer information. The step of determining whether to enable the local refresh function of the graphics processor includes: determining whether the image layer information of the previous 10 frames has changed; and determining whether the area occupied by the dirty region in the image layer is less than a threshold percentage.

[0006] According to the above method, the display information includes the number of displays and the display size, and the layer information of the image layer includes the number of layers, layer size, dirty areas, layer transparency (alpha), layer position, and layer name.

[0007] According to the above method, the first image format of the overlaid image includes red, green, blue, and transparency (alpha). The second image format of the overlaid image includes red, green, and blue.

[0008] The method further includes the following step: when overlay processing is set, the graphics processor is turned on to perform overlay processing on the image layer.

[0009] The method further includes: storing the overlay image of the second image format into memory via a write direct memory access (WDMA) element; and reading the overlay image of the second image format from memory via a read direct memory access (RDMA) element.

[0010] According to the method described above, the threshold percentage is 20%.

[0011] The method also includes enabling the local refresh function of the graphics processor when the layer information of the image layer in the current 10 frames has not changed and when the area occupied by the dirty region in the image layer is less than a threshold percentage.

[0012] The method also includes enabling the graphics processor to overlay layers by setting the layer composition type to client.

[0013] According to the above method, the steps for refreshing the dirty areas of the overlay image include: refreshing the dirty areas of the overlay image only when the layer information of the dirty areas of the overlay image changes in the previous 10 frames or when the area occupied by the dirty areas in the image layer is greater than a threshold percentage.

[0014] This invention provides an electronic device including a graphics processor (GPU) and a processor electrically connected to the GPU. The processor receives multiple image layers from an application, collects processing information, and determines whether to enable a local refresh function of the GPU. The processing information includes a first image format of the overlay image output by the GPU and dirty areas of the image layers. The GPU is configured to, upon determining that the local refresh function is enabled, set the overlay processing to be used for the image layers; and change the first image format of the overlay image to a second image format. The data size of the second image format is smaller than that of the first image format. The GPU performs overlay processing on the layers, outputs the overlay image in the second image format, and refreshes the dirty areas of the overlay image.

[0015] According to the aforementioned electronic device, the processing information includes display information and image layer information. The processor determines whether the image layer information has changed in the previous 10 frames and whether the area occupied by the dirty region in the image layer is less than a threshold percentage.

[0016] According to the aforementioned electronic device, the display information includes the number of displays and the display size. The layer information of the image layer includes the number of layers, layer size, dirty areas, layer transparency (alpha), layer position, and layer name.

[0017] According to the aforementioned electronic device, the first image format of the overlaid image includes red, green, blue, and transparency (alpha). The second image format of the overlaid image includes red, green, and blue.

[0018] According to the aforementioned electronic device, when overlay processing is set for an image layer, the graphics processor performs overlay processing on the image layer.

[0019] The electronic device further includes a memory, a write direct memory access (WDMA) element, and a read direct memory access (RDMA) element. The WDMA element is electrically connected between the graphics processor and the memory, and stores the overlaid second image format image in the memory. The RDMA element is electrically connected to the memory, and reads the overlaid second image format image from the memory.

[0020] According to the aforementioned electronic device, the threshold percentage is 20%.

[0021] According to the aforementioned electronic device, when the layer information of the image layer in the current 10 frames has not changed, and the area occupied by the dirty region in the image layer is less than a threshold percentage, the processor enables the local refresh function of the graphics processor.

[0022] According to the aforementioned electronic device, the processor enables the graphics processor to overlay image layers by setting the layer composition type to client.

[0023] According to the aforementioned electronic device, the graphics processor refreshes the dirty areas of the overlay image until the layer information of the image layer in the previous 10 frames changes or the area occupied by the dirty area in the image layer is greater than a threshold percentage. Attached Figure Description

[0024] For a more complete understanding of the present invention, please read the following detailed description and embodiments and refer to the accompanying drawings, wherein:

[0025] Figure 1 A flowchart illustrating a method for superimposing multiple image layers according to some embodiments of the present invention;

[0026] Figure 2 A detailed flowchart of step S104 in the layer overlay method provided in the embodiment of the present invention is shown;

[0027] Figure 3 A flowchart illustrating a method for overlaying image layers according to some embodiments of the present invention;

[0028] Figure 4 A schematic diagram illustrating a picture-in-picture (PIP) video playback scene according to some embodiments of the present invention;

[0029] Figure 5 Superimposed according to some embodiments of the present invention Figure 1A schematic diagram of the data path of the image layer method in the diagram; and

[0030] Figure 6 A schematic diagram of an electronic device 600 according to some embodiments of the present invention is shown. Detailed Implementation

[0031] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the embodiments of the present invention will be described in detail below with reference to the accompanying drawings.

[0032] In the various embodiments described below, the same reference numerals represent the same or similar elements or components.

[0033] Throughout this specification and the appended claims, certain terms are used to refer to specific elements. As will be understood by those skilled in the art, electronic device manufacturers may use different names to refer to elements. This document is not intended to distinguish between elements with different names but the same function. It should be understood that the use of words such as “comprising,” “having,” and “including” is open-ended and should therefore be interpreted as “including but not limited to…”. Thus, the terms “comprising,” “having,” or “including” as used in this invention are used to indicate the presence of a specific technical feature, value, method step, operation, unit, or element. However, the possibility of adding more technical features, values, method steps, workflows, units, elements, or any combination thereof is not excluded.

[0034] Directional terms used in the specification and claims, such as "on," "upward," "above," "downward," "below," "front," "back," "rear," "left," "right," etc., refer only to directions in the drawings. Therefore, directional terms are used for interpretation, not for limiting the invention. Regarding the drawings, they illustrate general features of methods, structures, or materials used in specific embodiments. However, the drawings should not be construed as defining or limiting the scope or characteristics covered by these embodiments. For example, for clarity, the relative dimensions, thicknesses, and locations of each layer, region, or structure may be reduced or enlarged.

[0035] When a corresponding element (e.g., a layer or region) is referred to as "on another element," it may be directly on that other element, or there may be other elements between them. On the other hand, when an element is referred to as "directly on another element (or a variation thereof)," there are no elements between them. Furthermore, when a corresponding element is referred to as "on another element," the corresponding element has a top-down / vertical arrangement relationship with the other element; the corresponding element may be below or above the other element, and the top-down / vertical arrangement relationship is determined by the orientation of the device.

[0036] It should be understood that when a component or layer is said to be "connected to" another component or layer, it can be directly connected to that other component or layer, or there may be intermediate components or layers. Conversely, when a component is said to be "directly connected to" another component or layer, there are no intermediate components or layers.

[0037] The electrical connection or coupling described in this disclosure may refer to a direct connection or an indirect connection. In the case of a direct connection, the endpoints of the components in two circuits are directly connected or interconnected through conductor segments; while in the case of an indirect connection, there is a switch, diode, capacitor, inductor, resistor, other suitable component, or combination of the above components between the endpoints of the components in two circuits, but the intermediate components are not limited to these.

[0038] The terms "first," "second," and "third" are used to describe components, but do not indicate the priority or progression of the components. They are simply used to distinguish components with the same name.

[0039] It is worth noting that the technical features in the different embodiments described below can be substituted for, recombined or mixed to form another embodiment without departing from the spirit of the present invention.

[0040] Figure 1 A flowchart illustrating a method for superimposing multiple image layers according to some embodiments of the present invention is provided. In some embodiments, the method for superimposing image layers according to the present invention is applied to an electronic device. The electronic device may be a smartphone, tablet computer, or laptop computer, but the present invention is not limited thereto. The electronic device may include a processor and a graphics processor, but the present invention is not limited thereto. Figure 1 As shown, the method for overlaying image layers according to the present invention includes the following steps: receiving an image layer from an application (step S100). Collecting processing information; the processing information includes a first image format of the overlay image output by the graphics processor and dirty areas of the image layer (step S102). Determining whether to enable the local refresh function of the graphics processor (step S104). When it is determined that the local refresh function of the graphics processor is enabled, the overlay processing is set to be used for the image layer (step S106). When the local refresh function is enabled, the overlay processing is set to be used for the image layer. If it is determined that the local refresh function of the graphics processor should not be enabled, the original display processing is used. When it is set to use overlay processing for the image layer, the first image format of the overlay image is changed to a second image format, the data size of the second image format is smaller than the data size of the first image format (step S108), the image layer is overlaid, and an overlay image with the second image format is output (step S110), and the dirty areas of the overlay image are refreshed (step S112).

[0041] In step S100, the application generates an image layer based on the user's actions. In step S102, the processing information may include display information and layer information of the image layer. Display information may include the number of displays and the display size, but the invention is not limited thereto. The number of displays refers to the number of screens connected to the electronic device. This includes scenarios involving screen mirroring and screen recording, which are considered virtual multi-screen environments. The layer information of the image layer may include the number of layers, layer size, dirty areas, layer transparency alpha (the alpha value of each pixel determines the transparency, typically ranging from 0 to 255), layer position, and layer name, but the invention is not limited thereto. Dirty areas refer to the parts of a view or window that need to be redrawn. The concept of dirty areas is used to optimize rendering performance by avoiding unnecessary full-screen redraws, thereby improving the responsiveness and efficiency of the application. When a part of the view changes (such as content updates, position changes, or size adjustments), the system marks these changes as dirty areas. Only these dirty areas are redrawn, while unchanged parts are not redrawn. This mechanism can greatly reduce the overhead of rendering operations. Furthermore, in step S102, the first image format of the overlay image may include red (R), green (G), blue (B), and alpha (A). In some embodiments, the data size of the first image format of the overlay image may be 32 bits. Before performing step S104, the overlay image output by the graphics processor is initially generated in the first image format.

[0042] Figure 2 Some embodiments according to the present invention are shown. Figure 1 A detailed flowchart of step S104 of the image layer overlay method of the present invention is provided. In step S104, the image layer overlay method of the present invention includes the following steps: determining whether the layer information of the image layer in the previous 10 frames has changed (step S200); determining whether the area occupied by the dirty region in the image layer is less than a threshold percentage (step S202). In some embodiments, when the layer information of the image layer in the previous 10 frames has not changed and the area occupied by the dirty region in the image layer is less than the threshold percentage, the image layer overlay method of the present invention enables the local refresh function of the graphics processor. In some embodiments, the threshold percentage may be 20%, but the present invention is not limited thereto.

[0043] In a specific embodiment, after executing step S104, according to the layer overlay method of the present invention, when it is determined in step S106 that the local refresh function of the graphics processor is enabled, the overlay processing is set to be used for the image layer. The image layer overlay method of the present invention enables the graphics processor to perform overlay processing on the image layer when overlay processing is set to be used on the image layer. In a specific embodiment, the image layer overlay method of the present invention enables the graphics processor to perform overlay processing on the image layer by setting the layer combination type to client. When the layer combination type is set to client, the graphics processor can perform overlay processing on the image layer to generate an overlay image.

[0044] Please refer to this again. Figure 1 In step S108, the first image format of the overlaid image is converted to a second image format. The second image format of the overlaid image may include red (R), green (G), and blue (B). Alpha (layer transparency of the image layer) is removed from the image overlaid with the second image format. In some embodiments, the data size of the second image format of the overlaid image may be 24 bits. Since the data size of the overlaid image is reduced from 32 bits to 24 bits, the mega-instructions per second (MIPS) of the electronic device performing the method of the present invention is reduced, thereby reducing bandwidth usage and memory usage.

[0045] In step S110, the graphics processor overlays the image layers from the application, outputting an overlaid image with a second image format. Next, in step S112, the graphics processor refreshes the dirty areas of the overlaid image. Specifically, the graphics processor refreshes the dirty areas of the overlaid image until the layer information of the previous 10 frames changes. Alternatively, the graphics processor refreshes the dirty areas of the overlaid image until the area occupied by the dirty areas in the layer exceeds a threshold percentage.

[0046] Figure 3 A flowchart illustrating an image layer overlay method according to some embodiments of the present invention is provided. Figure 3 As shown, in step S300, the application outputs multiple image layers. Then, in step 302, the image layer overlay method of the present invention receives processing information. Specifically, the processing information includes display information 310, layer information 312, and output information 314. In some embodiments, display information 310 includes display count and display size. Layer information 312 includes layer count, layer size, dirty areas, layer transparency (alpha), layer position, and layer name. Output information 314 includes the image format of the overlay image output by the graphics processor.

[0047] Next, in step 304, an overlay determination is performed. For example, in step 316, the overlay layer method of the present invention determines whether the local refresh function of the graphics processor is enabled. If the local refresh function of the graphics processor is enabled, the overlay layer method of the present invention sets the overlay mode. For example, when setting the overlay processing to be applied to the layer, the overlay layer method of the present invention causes the graphics processor to perform overlay processing on the layer; when setting the layer composition type to client, the overlay layer method of the present invention causes the graphics processor to perform overlay processing on the layer.

[0048] Next, in step 306, overlay processing is performed. For example, in step 320, the method for overlaying image layers of the present invention determines whether the graphics processor is enabled to perform overlay processing. If the graphics processor is enabled to perform overlay processing, then in step 322, the graphics processor changes the image format of the output image (i.e., the overlay image) from a first format to a second format. The data size of the second format is smaller than that of the first format. In step 324, the graphics processor performs a local refresh. In step 326, the graphics processor performs overlay processing (OVL) to generate the overlay image. Finally, in step 328, the graphics processor stores the overlay image in memory. In some embodiments, the memory may be dynamic random access memory (DRAM), but the present invention is not limited thereto.

[0049] In certain embodiments, if the graphics processor does not enable overlay processing, the image layer overlay method of the present invention can directly perform overlay processing without the assistance of the graphics processor. In some embodiments, the overlay image stored in the memory can be sent to the first display DISP1 and / or the second display DISP2. In certain embodiments, the first display DISP1 can be an internal display and the second display DISP2 can be an external display, but the present invention is not limited thereto.

[0050] Figure 4 This diagram illustrates a picture-in-picture (PIP) video playback scenario according to some embodiments of the present invention. For example, the user interface 400 includes a status bar 402, a settings page 404, a PIP activity layer 406, a PIP video layer 408, and a navigation bar 410. Figure 4In some embodiments, the coordinates of the status bar 402 are (0, 0, 1080, 78). That is, coordinates (0, 0) are the top left point of the status bar 402, and coordinates (1080, 78) are the bottom right point of the status bar 402. The coordinates of the settings page 404 are (0, 0, 1080, 2400). That is, coordinates (0, 0) are the top left point of the settings page 404, and coordinates (1080, 2400) are the bottom right point of the settings page 404. The status bar 402 and the settings page 404 are superimposed, with the status bar 402 located above the settings page 404. In some embodiments, the refresh rate of the status bar 402 can be 1 frame / second, and the refresh rate of the settings page 404 can be 0 frames / second.

[0051] The coordinates of PIP activity layer 406 are (48, 698, 1032, 1254), meaning (48, 698) is the top-left point of PIP activity layer 406, and (1032, 1254) is the bottom-right point of PIP activity layer 406. The coordinates of PIP video layer 408 are (48, 766, 1032, 1185), meaning (48, 7668) is the top-left point of PIP video layer 408, and (1032, 1185) is the bottom-right point of PIP video layer 408. PIP activity layer 406 and PIP video layer 408 are superimposed. PIP video layer 408 is located above PIP activity layer 406. In some embodiments, PIP video layer 408 is... Figure 1 Step S102 and Figure 2 The dirty area in step S202. Figure 1 In step S110, the graphics processor refreshes the PIP video layer 408 at a rate of 30 frames per second. The refresh rate of the PIP active layer 406 can be zero frames per second.

[0052] The coordinates of navigation bar 410 are (0, 2256, 1080, 2400), meaning (0, 2256) is the top-left point of navigation bar 410, and (1080, 2400) is the bottom-right point. The refresh rate of navigation bar 410 can be zero times per second. Figure 4 In some embodiments, the size of the PIP video layer 408 is equal to 864*368. The size of the user interface 400 is equal to 1080*2400. Since the layer information of the status bar 402, settings page 404, PIP activity layer 406, PIP video layer 408, and navigation bar 410 does not change in the first 10 frames, and the area occupied by the PIP video layer 408 is less than 20% of the user interface 400 (i.e., (864*368) / (1080*2400) = 12.3%), the graphics processor continuously refreshes the PIP video layer 408.

[0053] Figure 5 Some embodiments according to the present invention are shown. Figure 1 A schematic diagram of the data path for the method of overlaying image layers. (See diagram below.) Figure 5 As shown, frame 520 follows frame 510 and is later than frame 510. In frame 510, the method of overlaying image layers according to the present invention receives five layers from the application, such as layer 0, layer 1, layer 2, layer 3, and layer 4. After the local refresh function of the graphics processor (GPU) 502 is enabled, in step 500, the method of overlaying image layers according to the present invention enables the graphics processor 502 to change the image format of its output image from a first image format to a second image format. In some embodiments, the data size of the second image format is smaller than the data size of the first image format. Next, the graphics processor 502 stores layers 0 to 5 and the (N-1)th frame buffer target (FBT) 514 into the FBT cache 504.

[0054] Subsequently, in frame 510, FBT 516 includes the (N-1)th FBT 514 received in frame 510. Graphics processor 502 performs overlay processing (OVL) 626 on layers 0-5 and the (N-1)th FBT 514 (i.e., the dirty region in frame 510) to obtain the overlay image in frame 510. In a scenario where the same image is displayed on the first display (DISP1) 612, the second display (DISP2) 614, and the third display (WFD) 616, the overlay image in frame 510 is sent to the first display (DISP1) 612, a write direct memory access (WDMA) element 608 stores the overlay image in frame 510 with a second image format in memory 606, and a read direct memory access (RDMA) 610 reads the overlay image with the second image format. The third display 616 can directly read the image overlaid with the second image format in frame 510 via a communication protocol.

[0055] In frame 520, since the partial refresh function of the graphics processor 502 is enabled, the graphics processor 502 performs dirty region modification (step 506) based on the FBT N 152 received in frame 520 to modify the dirty region of layer 2, i.e., the image layer. For example, the graphics processor 502 receives FBT N-1 514 in frame 510. In frame 520, since the partial refresh function of the graphics processor 502 is still enabled, the graphics processor 502 replaces FBT N-1 514 with the Nth FBT 512 and stores layers 0 to 5 together with the Nth FBT 512 in the FBT cache 504.

[0056] Subsequently, FBT 516 includes FBT N 514 received in frame 520. Graphics processor 502 performs an overlay process 626 on layers 0-5 and the Nth FBT 512 (i.e., the dirty region in frame 520) to obtain the overlay image in frame 520. In a scenario where the first display 612, second display 614, and third display 616 display the same image, the overlay image in frame 520 is sent to the first display 612, WDMA element 608 stores the overlay image in frame 520 with a second image format in memory 606, and RDMA 610 reads the overlay image in frame 520 with a second image format from memory 606 for use by the second display 614. The third display 616 can read the overlay image in frame 520 with a second image format directly via the communication protocol.

[0057] Figure 6 A schematic diagram of an electronic device 600 according to some embodiments of the present invention is shown. For example... Figure 6 As shown, the electronic device 600 includes a processor 602, a graphics processor 604, a memory 606, a write direct memory access (WDMA) element 608, a read direct memory access (RDMA) element 610, and a first display (DISP1) 612. In some embodiments, the electronic device 600 may be a smartphone, a tablet computer, or a laptop computer, but the invention is not limited thereto. The processor 602 is electrically connected to the graphics processor 604. The first display 612 is electrically connected to the graphics processor 604. The WDMA 608 is electrically connected between the graphics processor 604 and the memory 606. The RDMA 610 is electrically connected between a second display 614 and the memory 606. The second display 614 is electrically connected to the RDMA 610. A third display 616 is electrically connected to the memory 606.

[0058] In some embodiments, application 620 executes on processor 602. Code 622 executes on processor 602, causing the processor to be configured to perform the following operations: Processor 602 receives multiple image layers from application 620, collects processing information, and determines whether to enable the partial refresh function 624 of graphics processor 604. When the partial refresh function 624 is enabled, overlay processing is set to be used on the image layers. If it is determined that the partial refresh function 624 of the graphics processor should not be enabled, original display processing is used. The processing information includes a first image format of the overlay image output by graphics processor 604 and dirty areas of the image layers.

[0059] When overlay processing is applied to an image layer, the graphics processor 604 changes the first image format of the overlay image to a second image format. The data size of the second image format is smaller than that of the first image format. For example, the data size of the first image format may be 32 bits, and the data size of the second image format may be 24 bits, but the present invention is not limited thereto. The graphics processor 604 performs overlay processing 626 on the image layer, outputs the overlay image in the second image format, and refreshes the dirty areas of the overlay image.

[0060] In some embodiments, the processing information includes display information, image information of the image layer, and output information. The processor 602 determines whether the layer information of the image layer has changed in the previous 10 frames and whether the area occupied by the dirty region in the image layer is less than a threshold percentage. In some embodiments, the threshold percentage can be 20%, but the invention is not limited thereto. In some embodiments, the display information includes the number of displays and the display size. The layer information of the image layer includes the number of layers, layer size, dirty region, layer transparency (alpha), layer position, and layer name. The output information includes the image format of the overlay image output by the graphics processor 604.

[0061] In some embodiments, the first image format of the overlaid image includes red, green, blue, and alpha. The second image format of the overlaid image includes red, green, and blue. In some embodiments, when overlay processing is set for an image layer, processor 602 enables graphics processor 604 to perform overlay processing on the image layer. Specifically, processor 602 enables graphics processor 604 to perform overlay processing on the image layer by setting the layer composition type as a client.

[0062] In some embodiments, when the layer information of the image layer in the current 10 frames has not changed and the area occupied by the dirty area in the layer is less than a threshold percentage, the processor 602 enables the local refresh function of the graphics processor 604.

[0063] In some embodiments, WDMA element 608 stores the overlay image in a second image format in memory 606. RDMA element 610 reads the overlay image in the second image format from memory 606. Graphics processor 604 refreshes dirty areas of the overlay image until the layer information of the image layer in the previous 10 frames changes or the area occupied by dirty areas in the image layer exceeds a threshold percentage.

[0064] The image layer overlay method and electronic device 600 of the present invention reduce bandwidth and memory usage by reducing the data size of the image layers and the number of millions of instructions per second (MIPS) of the application during the image layer overlay process.

[0065] According to the methods described above, by converting the overlaid image from a first image format (e.g., 32-bit) to a second image format (e.g., 24-bit), the data size is significantly reduced. This helps reduce bandwidth utilization and memory consumption, thereby improving system efficiency. Reducing the image data size reduces the number of instructions per second (MIPS) required by the graphics processor to execute the overlay process. This results in faster task completion and improved overall system performance. These methods allow for the dynamic enabling or disabling of local refresh functionality based on changes in layer information and the size of dirty areas. This flexibility ensures that the system can optimize performance according to the actual use case.

[0066] While the invention has been described by way of example and preferred embodiments, it should be understood that the invention is not limited to the disclosed embodiments. Rather, the invention is intended to cover various modifications and similar arrangements (which will be apparent to those skilled in the art). Therefore, the scope of the appended claims should be given the broadest interpretation to cover all such modifications and similar arrangements.

Claims

1. A method for overlaying multiple image layers, comprising: Receive multiple image layers from the application; Collect and process information; wherein, the processing information includes a first image format of the overlay image output by the graphics processor and dirty regions of the plurality of image layers; Determine whether to enable the partial refresh function of the graphics processor; When it is determined that the local refresh function of the graphics processor is enabled, the overlay processing is set for the plurality of image layers; The first image format of the overlaid image is changed to a second image format; wherein the data size of the second image format is smaller than the data size of the first image format; The overlay process is performed on the plurality of image layers to output the overlay image having the second image format, and Refresh the dirty areas of the overlay image.

2. The method for superimposing multiple image layers as described in claim 1, characterized in that, in, The processing information includes display information and layer information of the multiple image layers; the step of determining whether to enable the local refresh function of the graphics processor includes: Determine whether the layer information of multiple image layers in the first 10 frames has changed; Determine whether the area occupied by the dirty region in the multiple image layers is less than a threshold percentage.

3. The method for superimposing multiple image layers as described in claim 2, characterized in that, The display information includes the number of displays and the display size; and the layer information of the multiple image layers includes the number of layers, layer size, dirty area, layer transparency (alpha), layer position, and layer name.

4. The method for superimposing multiple image layers as described in claim 1, characterized in that, The first image format of the overlay image includes red, green, blue, and transparency (alpha); and the second image format of the overlay image includes red, green, and blue.

5. The method for superimposing multiple image layers as described in claim 1, characterized in that, Also includes: When the overlay process is set, the graphics processor performs overlay processing on the plurality of image layers.

6. The method for superimposing multiple image layers as described in claim 1, characterized in that, Also includes: The overlay image having the second image format is stored in the memory via a write direct memory access (WDMA) element; as well as The overlay image having the second image format is read from the memory via a read direct memory access (RDMA) element.

7. The method for superimposing multiple image layers as described in claim 2, characterized in that, The threshold percentage is 20%.

8. The method for superimposing multiple image layers as described in claim 2, characterized in that, Also includes: If the layer information has not changed in the previous 10 frames and the proportion of the dirty area in the multiple image layers is less than a threshold, then the local refresh function of the graphics processor is enabled.

9. The method for superimposing multiple image layers as described in claim 5, characterized in that, Also includes: By setting the layer composition type to client, the graphics processor performs the overlay processing on the multiple image layers.

10. The method for superimposing multiple image layers as described in claim 2, characterized in that, The step of refreshing the dirty areas of the overlaid image includes: The dirty areas of the overlay image are refreshed until the layer information of the multiple image layers in the previous 10 frames changes or the area occupied by the dirty areas in the multiple image layers is greater than the threshold percentage.

11. An electronic device for overlaying multiple image layers, comprising: Graphics processor; as well as A processor, electrically connected to the graphics processor, is configured to receive multiple image layers from an application, collect processing information, and determine whether to enable the graphics processor's local refresh function; wherein the processing information includes a first image format of the overlay image output by the graphics processor and dirty regions of the image layers; The graphics processor is configured to, upon determining that the local refresh function of the graphics processor is enabled, set the overlay processing to be used for the plurality of image layers; and change the first image format of the overlay image to a second image format; wherein the data size of the second image format is smaller than the data size of the first image format; The graphics processor is configured to perform the overlay process on the plurality of image layers to output the overlay image having the second image format, and to refresh the dirty areas of the overlay image.

12. The electronic device for overlaying multiple image layers as described in claim 11, characterized in that, The processing information includes display information and layer information of the multiple image layers; the processor is used to determine whether the layer information of the multiple image layers has changed in the first 10 frames, and to determine whether the area occupied by the dirty region in the multiple image layers is less than a threshold percentage.

13. The electronic device for overlaying multiple image layers as described in claim 12, characterized in that, The display information includes the number of displays and the display size; the layer information of the multiple image layers includes the number of layers, layer size, dirty area, layer transparency (alpha), layer position, and layer name.

14. The electronic device for overlaying multiple image layers as described in claim 11, characterized in that, The first image format of the overlay image includes red, green, blue, and transparency (alpha); and the second image format of the overlay image includes red, green, and blue.

15. The electronic device for overlaying multiple image layers as described in claim 11, characterized in that, The processor is configured to cause the graphics processor to perform the overlay process on the plurality of image layers when the overlay process is set.

16. The electronic device for overlaying multiple image layers as described in claim 11, characterized in that, Also includes: Memory; Write Direct Memory Access (WDMA) element, electrically connected between the graphics processor and the memory, for storing the overlay image having the second image format in the memory; as well as A read direct memory access (RDMA) element, electrically connected to the memory, is used to read the overlay image having the second image format from the memory.

17. The electronic device for overlaying multiple image layers as described in claim 12, characterized in that, The threshold percentage is 20%.

18. The electronic device for overlaying multiple image layers as described in claim 12, characterized in that, The processor is configured to enable the local refresh function of the graphics processor in response to the fact that the layer information of the plurality of image layers has not changed in the previous 10 frames and the proportion of the dirty area in the plurality of image layers is less than the threshold percentage.

19. The electronic device for overlaying multiple image layers as described in claim 15, characterized in that, The processor is configured to overlay the multiple image layers by setting the layer composition type to client.

20. The electronic device for overlaying multiple image layers as described in claim 12, characterized in that, The graphics processor is configured to refresh the dirty regions of the overlay image until the layer information of the plurality of image layers changes in the previous 10 frames or the area occupied by the dirty regions in the plurality of image layers is greater than the threshold percentage.