Search

CN-121996134-A - Display method, electronic device, medium, and program product

CN121996134ACN 121996134 ACN121996134 ACN 121996134ACN-121996134-A

Abstract

The present application relates to the field of computer technologies, and in particular, to a display method, an electronic device, a medium, and a program product. In the method, in the process of displaying the graph in real time by the electronic equipment, after the drawing data of each drawing layer is obtained by the electronic equipment, the drawing data of each drawing layer is not respectively rendered into different images, but the drawing data of each drawing layer is combined and rendered onto the same image to obtain one frame of drawing layer rendering data. Therefore, the electronic device does not need to respectively render multi-frame different layer rendering data, so that the number of layer rendering data for subsequent synthesis is reduced, the matching effect between layers is realized in the rendered one-frame layer rendering data, the situation that the subsequent synthesis process exceeds the capability of hardware (for example, DPU) for synthesis and other hardware (for example, GPU) is needed to be used for synthesis again is avoided, and the rendering efficiency is improved.

Inventors

  • HUANG BANGBANG

Assignees

  • 荣耀终端股份有限公司

Dates

Publication Date
20260508
Application Date
20241101

Claims (16)

  1. 1. A display method applied to an electronic device, the method comprising: detecting a display instruction, wherein the display instruction is used for instructing to display a first interface, and the first interface comprises M overlapped layers; Acquiring the layer drawing data of the M layers, and respectively drawing the M layers to obtain layer drawing data corresponding to each layer; merging and rendering the drawing data of N layers in the M layers to obtain first drawing rendering data corresponding to one layer, wherein, The N layers have a sequential stacking relationship, the first layer rendering data maintains the sequential stacking relationship of the N layers, and N is less than or equal to M, M and N are integers greater than or equal to 2; and displaying the first interface based on the first layer rendering data.
  2. 2. The method of claim 1, wherein a plurality of the layers belong to the same application or a plurality of the layers belong to a plurality of different applications.
  3. 3. The method of claim 1, wherein the displaying the first interface based on the first layer rendering data when M is equal to N comprises: And displaying the first layer rendering data on a screen of the electronic device.
  4. 4. The method of claim 1, further comprising rendering each of the M-N layers based on layer rendering data for M-N layers out of N of the M layers when M is greater than N, resulting in M-N second layer rendering data.
  5. 5. The method of claim 4, wherein a cross-layer effect exists between each of the M-N layers and the N layers, wherein the cross-layer effect comprises at least one of shading, scaling, rounding, blurring; the merging rendering of the layer drawing data of the N layers in the M layers to obtain first layer rendering data corresponding to one layer comprises the following steps: and merging and rendering the layer drawing data of N layers in the M layers and the rendering data of M-N second layers to obtain the rendering data of the first layer corresponding to one layer.
  6. 6. The method of claim 5, wherein displaying the first interface based on the first layer rendering data comprises displaying the first layer rendering data on a screen of the electronic device.
  7. 7. The method of claim 4, wherein no cross-layer effect exists between the M-N layers and the N layers; the rendering data based on the first layer, displaying the first interface, includes: Synthesizing the M-N second layer rendering data with the first layer rendering data to obtain first layer synthesized data; and displaying the first layer data on a screen of the electronic device.
  8. 8. The method of claim 4, wherein there is a cross-layer effect between K of the M-N layers and the N layers, K is less than M-N, and K is greater than or equal to 1; the merging rendering of the layer drawing data of the N layers in the M layers to obtain first layer rendering data corresponding to one layer comprises the following steps: and merging and rendering the layer drawing data of N layers in the M layers and the K second layer rendering data to obtain the first layer rendering data corresponding to one layer.
  9. 9. The method of claim 8, wherein the displaying the first interface based on the first layer rendering data comprises: Synthesizing the M-N-K second layer rendering data with the first layer rendering data to obtain second layer synthesized data; and displaying the second graph layer data on a screen of the electronic device.
  10. 10. The method of claim 1, wherein the merging rendering the layer drawing data of N layers of the M layers to obtain the first layer drawing data corresponding to one layer includes: The rendering service acquires the drawing data of the N layers, and combines the drawing data of the N layers to obtain combined first combined data; and calling a graphic interface, and rendering based on the first combined data by using the GPU to obtain the first layer rendering data corresponding to one layer.
  11. 11. The method according to claim 1, wherein the layer drawing data is in the form of a rendering node tree, and the merging and rendering the layer drawing data of N layers in the M layers to obtain the first layer drawing data corresponding to one layer includes: The layer drawing data corresponding to the N layers is the entire content of the N layers; combining all data of the rendering node trees of the N layers to construct a rendering big tree; And rendering the first layer rendering data according to the rendering big tree.
  12. 12. The method according to claim 1, wherein the layer drawing data is in the form of a rendering node tree, and the merging and rendering the layer drawing data of N layers in the M layers to obtain the first layer drawing data corresponding to one layer includes: the layer drawing data corresponding to the N layers is the content of the change of the N layers; merging the content data of the rendering node tree changes of the N layers to reconstruct a rendering big tree; And rendering the first layer rendering data according to the rendering big tree.
  13. 13. The method of claim 1, wherein the merging rendering the layer drawing data of N layers of the M layers to obtain the first layer drawing data corresponding to one layer includes: obtaining rendering sequences of the N layers, attribute information of the N layers and rendering parameters of each graphic element in the N layers according to the layer drawing data of the N layers, wherein the rendering sequences correspond to the stacking relation; And analyzing the N layers and the graphic elements in the N layers together based on the rendering sequence of the N layers, the attribute information of the N layers and the rendering parameters of the graphic elements in the N layers, so as to render the first layer rendering data of the corresponding layer.
  14. 14. An electronic device, comprising: one or more processors; one or more memories storing one or more programs which, when executed by the one or more processors, cause the electronic device to perform the display method of any of claims 1-13.
  15. 15. A computer readable storage medium having stored thereon instructions which, when executed on a computer, cause the computer to perform the display method of any of claims 1 to 13.
  16. 16. A computer program product comprising computer program code which, when run on a computer, causes the computer to perform the display method as claimed in any one of claims 1 to 13.

Description

Display method, electronic device, medium, and program product Technical Field The present application relates to the field of computer technologies, and in particular, to a display method, an electronic device, a medium, and a program product. Background The screen interface of an electronic device may typically consist of multiple layers of multiple Applications (APP). For example, a desktop application interface, a wallpaper application interface, and a status bar application interface may be displayed on a screen of the mobile phone, and each application may be composed of one or more layers. Each layer includes specific graphic elements of each application, such as text, icons, pictures, basic graphics, and the like. When the screen of the electronic device needs to display graphic elements of a plurality of applications, the contents of each layer needing to be displayed can be respectively rendered through a graphic rendering technology to obtain one frame of image data corresponding to each layer, and multi-frame image data can be obtained at the moment. It will be appreciated that the generated image data is capable of characterizing content subsequently presented on the screen. When the image data of a plurality of layers are required to be displayed on the screen of the electronic equipment, at the moment, the image data corresponding to the layers required to be displayed are synthesized according to a certain hierarchical structure, so that a final piece of overlapped image data is finally displayed on the screen. However, when image data of a plurality of layers is synthesized, there is a case where hardware for supporting the synthesis cannot synthesize, and it is necessary to synthesize the image data again using other hardware, which is inefficient. Disclosure of Invention In order to solve the above-mentioned problems, the present application proposes a display method, an electronic device, a medium, and a program product, which enable the electronic device to avoid the situation that the subsequent synthesis process exceeds the capability of hardware (e.g., DPU) for synthesis and needs to use other hardware (e.g., GPU) for synthesis again, thereby improving the rendering efficiency. The display method comprises the steps of detecting a display instruction, wherein the display instruction is used for instructing to display a first interface, the first interface comprises M layers which are overlapped, obtaining layer drawing data of the M layers, drawing the M layers respectively to obtain layer drawing data corresponding to each layer, merging and rendering the layer drawing data of the N layers in the M layers to obtain first layer rendering data corresponding to one layer, the N layers have a sequential lamination relation, the first layer rendering data is kept in the sequential lamination relation of the N layers, N is less than or equal to M, M and N are integers which are larger than or equal to 2, and displaying the first interface based on the first layer rendering data. It will be appreciated that when the electronic device initiates a display, detects a user operation on a screen interface, or detects a change in a system event, the electronic device may detect a display instruction, where the display instruction is used to instruct the display of a desired first interface, for example, the first interface is a screen interface of the electronic device. The first interface may be displayed by overlapping M layers (i.e., multiple layers). At this time, the electronic device draws and renders the layer to be displayed. In the process of drawing and rendering the M layers, after obtaining the layer drawing data of each layer, the electronic device may not render the layer drawing data of each layer into different images, but may use a unified rendering manner for all layers or part of the layers, that is, combine and render the layer drawing data of N layers (for example, the N layers may be the first layer below) that need to use the unified rendering manner onto the same image, so as to obtain the first layer drawing data corresponding to one layer, that is, one frame of layer drawing data. For example, the rendering node tree data of N layers which are uniformly rendered is uniformly rendered together, so that the first layer rendering data which can represent the effects of N layers after superposition of one frame is directly obtained. At this time, the electronic device merges and renders the layer drawing data of N layers (for example, the N layers may be the first layer below) into one frame of layer drawing data corresponding to one layer, so as to reduce the number of layer drawing data of subsequent synthesis, and when performing unified rendering, since the layer drawing data of each layer are rendered together, instead of rendering the layer drawing data of each layer separately, the matching effect between the layers is already implemented in the rendered one frame of