Search

CN-122019039-A - Page rendering method, page rendering device, readable medium, electronic device and program product

CN122019039ACN 122019039 ACN122019039 ACN 122019039ACN-122019039-A

Abstract

A page rendering method, apparatus, readable medium, electronic device and program product. The method comprises the steps of responding to a first frame synchronizing signal triggered by a first page, generating a first drawing command and a first drawing command set corresponding to the first view through a main thread when the first page comprises the first view, wherein the first drawing command set is used for generating first texture data corresponding to the first view, the first drawing command is bound with an executable object, the executable object is provided with a first interface, the first interface is used for acquiring the first texture data, executing the first drawing command set through a first rendering thread to acquire the first texture data, executing the first drawing command through a second rendering thread to call the first interface to acquire the first texture data, and rendering the first view in the first page based on the first texture data. The page rendering is realized through one-time cross-thread data copying, so that the occupied memory bandwidth and rendering delay can be reduced, and the interactive experience of a user is further improved.

Inventors

  • FEI YUE
  • FAN JINSONG

Assignees

  • 北京字跳网络技术有限公司

Dates

Publication Date
20260512
Application Date
20260129

Claims (11)

  1. 1. A page rendering method, the page rendering method comprising: Generating a first drawing command and a first drawing command set corresponding to a first view through a main thread under the condition that the first page comprises the first view in response to a first frame synchronous signal triggered by the first page, wherein the first drawing command set is used for generating first texture data corresponding to the first view, the first drawing command is bound with an executable object, and the executable object is provided with a first interface which is used for acquiring the first texture data; Executing the first drawing command set through a first rendering thread to obtain the first texture data; executing the first drawing command through a second rendering thread, calling the first interface to acquire the first texture data, and rendering the first view in the first page based on the first texture data.
  2. 2. The page rendering method of claim 1, wherein the executing, by a first rendering thread, the first set of drawing commands to obtain the first texture data comprises: Creating a first frame buffer object corresponding to the first view through the first rendering thread, executing the first drawing command set to obtain a first execution result, and writing the first execution result into the first frame buffer object; and performing texture sampling on the first frame buffer object through the first rendering thread to obtain the first texture data.
  3. 3. The page rendering method of claim 1, further comprising: storing the first texture data into a shared memory through the first rendering thread, and transmitting a first shared identifier corresponding to the first texture data to the second rendering thread; The invoking the first interface to obtain the first texture data and render the first view in the first page based on the first texture data includes: Calling the first interface by the second rendering thread based on the first sharing identifier, acquiring the first texture data from the shared memory, and writing the first texture data into a second frame buffer object corresponding to the second rendering thread; rendering the first view in the first page based on the second frame buffer object.
  4. 4. A page rendering method according to claim 3, wherein the executable object includes a derivative object corresponding to a preset texture type, and the writing the first texture data into a second frame buffer object corresponding to the second rendering thread includes: performing format conversion on the first texture data according to a texture format corresponding to the preset texture type to obtain second texture data; The second texture data is written to the second frame buffer object by executing the derived object.
  5. 5. The page rendering method according to any one of claims 1 to 4, further comprising: Generating a second drawing command set corresponding to a second view through the main thread under the condition that the first page further comprises the second view, wherein the second drawing command set is used for generating third texture data corresponding to the second view, and the types of the first view and the second view are different; and executing the second drawing command set through the second rendering thread to obtain the third texture data, and rendering the second view in the first page based on the third texture data.
  6. 6. The page rendering method of claim 5, further comprising: Writing the first texture data and the third texture data into a second frame buffer object corresponding to the second rendering thread through the second rendering thread; Rendering the first view and the second view in the first page based on the second frame buffer object.
  7. 7. The page rendering method of claim 5, the executable object further configured with a second interface for triggering the second rendering thread, the page rendering method further comprising: Triggering the second interface after the first drawing command and the second drawing command set are obtained through the main thread; The executing, by a second rendering thread, the first drawing command, comprising: Responsive to triggering the second interface, executing the first drawing command by the second rendering thread; the executing, by the second rendering thread, the second set of drawing commands, comprising: in response to triggering the second interface, executing the second set of drawing commands by the second rendering thread.
  8. 8. A page rendering device, the page rendering device comprising: The device comprises a generation module, a first display module and a first display module, wherein the generation module is used for responding to a first frame synchronous signal triggered by a first page, and generating a first drawing command and a first drawing command set corresponding to the first view through a main thread when the first page comprises the first view, wherein the first drawing command set is used for generating first texture data corresponding to the first view, the first drawing command is bound with an executable object, and the executable object is provided with a first interface, and the first interface is used for acquiring the first texture data; The execution module is used for executing the first drawing command set through a first rendering thread to obtain the first texture data; And the rendering module is used for executing the first drawing command through a second rendering thread, calling the first interface to acquire the first texture data, and rendering the first view in the first page based on the first texture data.
  9. 9. A computer readable medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processing device, carries out the steps of the method according to any one of claims 1-7.
  10. 10. An electronic device, comprising: a storage device having a computer program stored thereon; processing means for executing said computer program in said storage means to carry out the steps of the method according to any one of claims 1-7.
  11. 11. A computer program product comprising a computer program, characterized in that the computer program, when being executed by a processor, implements the steps of the method according to any of claims 1-7.

Description

Page rendering method, page rendering device, readable medium, electronic device and program product Technical Field The technical scheme relates to the technical field of computers, in particular to a page rendering method, a page rendering device, a readable medium, electronic equipment and a program product. Background The mixed rendering of Android (Android) native views and non-native views is an important scene in Android application development. In order to realize mixed-row rendering, in the related technology, two data copies of a cross-CPU (Central Processing Unit, a central processing unit) and a GPU (Graphics Processing Unit, a graphic processor) memory are generated between a rendering engine (a production end) of a non-native view and an Android rendering thread (a consumption end), so that a large amount of memory bandwidth is occupied, rendering delay is caused, problems of frame rate reduction, interface blocking and the like are easy to occur in a high-resolution or dynamic interaction scene, and interaction experience of a user is further affected. Disclosure of Invention This section is provided to introduce concepts in a simplified form that are further described below in the detailed description section. This section is not intended to identify key features or essential features of the claimed subject matter, nor is it intended to be used to limit the scope of the claimed subject matter. In a first aspect, a page rendering method is provided, including: Generating a first drawing command and a first drawing command set corresponding to a first view through a main thread under the condition that the first page comprises the first view in response to a first frame synchronous signal triggered by the first page, wherein the first drawing command set is used for generating first texture data corresponding to the first view, the first drawing command is bound with an executable object, and the executable object is provided with a first interface which is used for acquiring the first texture data; Executing the first drawing command set through a first rendering thread to obtain the first texture data; executing the first drawing command through a second rendering thread, calling the first interface to acquire the first texture data, and rendering the first view in the first page based on the first texture data. In a second aspect, there is provided a page rendering apparatus including: The device comprises a generation module, a first display module and a first display module, wherein the generation module is used for responding to a first frame synchronous signal triggered by a first page, and generating a first drawing command and a first drawing command set corresponding to the first view through a main thread when the first page comprises the first view, wherein the first drawing command set is used for generating first texture data corresponding to the first view, the first drawing command is bound with an executable object, and the executable object is provided with a first interface, and the first interface is used for acquiring the first texture data; The execution module is used for executing the first drawing command set through a first rendering thread to obtain the first texture data; And the rendering module is used for executing the first drawing command through a second rendering thread, calling the first interface to acquire the first texture data, and rendering the first view in the first page based on the first texture data. In a third aspect, there is provided a computer readable medium having stored thereon a computer program which, when executed by a processing device, implements the steps of the method described in the first aspect. In a fourth aspect, there is provided an electronic device comprising: a storage device having a computer program stored thereon; processing means for executing said computer program in said storage means to carry out the steps of the method described in the first aspect. In a fifth aspect, there is provided a computer program product comprising a computer program which, when executed by a processor, implements the steps of the method described in the first aspect. According to the technical scheme, the first frame synchronization signal triggered by the first page is responded, the first drawing command and the first drawing command set corresponding to the first view are generated through the main thread under the condition that the first page comprises the first view, the first drawing command set is further executed through the first rendering thread to obtain first texture data, finally the first drawing command is executed through the second rendering thread, the first interface is called to obtain the first texture data, and the first view is rendered in the first page based on the first texture data. The first drawing command set is used for generating first texture data corresponding to the first view, the first drawing command is