Search

CN-122019035-A - Rendering method, device, equipment and storage medium of container component in interface

CN122019035ACN 122019035 ACN122019035 ACN 122019035ACN-122019035-A

Abstract

The invention provides a rendering method, a device, equipment and a storage medium of a container component in an interface, wherein the method comprises the steps of responding to a rendering request of the container component containing fillets, determining layout information of the container component and view parameters of a screen; the container assembly is used for containing and managing interface sub-elements, determining an interface area of the container assembly in a visible area of a screen based on layout information and view parameters, applying for a local buffer area matched with the interface area in an off-screen buffer area, drawing a target container assembly in the interface area in the local buffer area, performing fillet clipping treatment on the target container assembly in the local buffer area, and rendering the target container assembly subjected to fillet clipping treatment in the local buffer area to a display buffer area of the screen. According to the embodiment, the accuracy of off-screen local rendering is improved, and the occupation of the memory is effectively reduced, so that the consumption of resources such as CPU (Central processing Unit), GPU (graphics processing Unit) and the like is reduced, the off-screen rendering efficiency is improved, and the overall frame rate is improved.

Inventors

  • LIU SHUAI

Assignees

  • 网易有道(杭州)智能科技有限公司

Dates

Publication Date
20260512
Application Date
20260116

Claims (10)

  1. 1. A method of rendering a container assembly in an interface, comprising: determining layout information of a container component containing rounded corners and view parameters of a screen in response to a rendering request of the container component; Determining an interface region of the container assembly in a viewable area of the screen based on the layout information and the view parameters; applying for a local buffer zone adapted to the interface zone in an off-screen buffer zone; drawing a target container component located within the interface region in the local buffer; performing fillet clipping treatment on the target container assembly in the local buffer area; and rendering the target container component which is subjected to fillet clipping treatment in the local buffer area to a display buffer area of the screen.
  2. 2. The method of claim 1, wherein the view parameters are used to represent a viewable area of the screen, wherein the container component is developed based on HaaS UI frames, wherein in a control tree of HaaS UI frames, the container component is represented as a view group; The determining, based on the layout information and the view parameters, an interface region of the container assembly in a viewable area of the screen, comprising: Calculating a first absolute coordinate of a corner point of the view group in a screen in the control tree; constructing a first target area according to the first absolute coordinates and the layout information; And acquiring an intersection set of the view parameter and the first target area to obtain an interface area.
  3. 3. The method of claim 2, wherein calculating in the control tree a first absolute coordinate in a screen of a corner of the view group comprises: traversing the control tree from the view group to the root node layer by layer upwards to obtain a first position offset of each layer of parent node and a first rolling offset of each layer of parent node; And accumulating the first position offset and the first rolling offset to obtain a first absolute coordinate of the corner point of the view group in the screen.
  4. 4. The method of claim 1, wherein applying for a local buffer in the off-screen buffer that is adapted to the interface region comprises: determining a type of rendering engine; And applying for a local buffer zone with the same size as the interface zone in the off-screen buffer zone matched with the type.
  5. 5. The method of claim 1, wherein applying for a local buffer in the off-screen buffer that is adapted to the interface region comprises: determining a type of rendering engine; applying for local buffers of multiple sizes in an off-screen buffer adapted to the type; the local buffer region is allocated to be larger in size than the interface region and closest in size to the interface region.
  6. 6. The method of claim 5, wherein applying for a local buffer in an off-screen buffer that is adapted to the interface region, further comprises: Maintaining the local buffer as the container assembly leaves the viewable area of the screen; determining the running state of the memory; and when the running state meets the preset pressure condition, releasing the local buffer zone.
  7. 7. A rendering apparatus for a container assembly in an interface, comprising: A display parameter determining module for determining layout information of a container component containing rounded corners and view parameters of a screen in response to a rendering request of the container component; an interface region identification module for determining an interface region of the container assembly in a viewable region of the screen based on the layout information and the view parameters; The local buffer area application module is used for applying a local buffer area matched with the interface area in the off-screen buffer area; a container component drawing module for drawing the target container component in the interface area in the local buffer The round corner cutting module is used for carrying out round corner cutting treatment on the target container assembly in the local buffer zone; And the display buffer zone rendering module is used for rendering the target container component which is subjected to fillet clipping treatment in the local buffer zone to the display buffer zone of the screen.
  8. 8. An electronic device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the computer program, implements a method of rendering container components in an interface as claimed in any one of claims 1-6.
  9. 9. A computer readable storage medium storing a computer program, wherein the computer program when executed by a processor implements a method of rendering a container assembly in an interface as claimed in any one of claims 1-6.
  10. 10. A computer program product, characterized in that the computer program product, when run on a computer, causes the computer to perform the rendering method of a container assembly in an interface as claimed in any of claims 1-6.

Description

Rendering method, device, equipment and storage medium of container component in interface Technical Field The invention belongs to the technical field of application rendering, and particularly relates to a rendering method, device and equipment of a container assembly in an interface and a storage medium. Background In the UI (User Interface) of an APP (application program), there are a plurality of containers (especially rectangular containers) such as portraits, cards, icons, etc., which are usually cut into rounded corners. In some scenes, when rendering a container in an APP, the container is rendered using off-screen rendering (Offscreen Rendering) and rounded for the container, and the UI that completes the container rounded clipping is rendered to the display buffer (Framebuffer, also known as a frame buffer) of the screen for display on the screen. The off-screen rendering is to newly open a buffer area outside the frame buffer area of the screen to execute rendering operation, and this process consumes extra memory and time, so that the off-screen rendering efficiency is low, the overall frame rate is low, about 10FPS (frames per second), and the effect of blocking is easy to generate, and the operation experience of the user is affected. Disclosure of Invention In view of the foregoing, the present invention provides a method, apparatus, device and storage medium for rendering container components in an interface, so as to improve the efficiency of off-screen rendering and clipping fillets. A first aspect of the present invention provides a method of rendering a container assembly in an interface, comprising: determining layout information of a container component containing rounded corners and view parameters of a screen in response to a rendering request of the container component; Determining an interface region of the container assembly in a viewable area of the screen based on the layout information and the view parameters; applying for a local buffer zone adapted to the interface zone in an off-screen buffer zone; drawing a target container component located within the interface region in the local buffer; performing fillet clipping treatment on the target container assembly in the local buffer area; and rendering the target container component which is subjected to fillet clipping treatment in the local buffer area to a display buffer area of the screen. A second aspect of the present invention provides a rendering apparatus of a container assembly in an interface, comprising: A display parameter determining module for determining layout information of a container component containing rounded corners and view parameters of a screen in response to a rendering request of the container component; an interface region identification module for determining an interface region of the container assembly in a viewable region of the screen based on the layout information and the view parameters; The local buffer area application module is used for applying a local buffer area matched with the interface area in the off-screen buffer area; a container component drawing module for drawing the target container component in the interface area in the local buffer The round corner cutting module is used for carrying out round corner cutting treatment on the target container assembly in the local buffer zone; And the display buffer zone rendering module is used for rendering the target container component which is subjected to fillet clipping treatment in the local buffer zone to the display buffer zone of the screen. A third aspect of the invention provides an electronic device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, the processor implementing a method of rendering a container assembly in an interface as described in the first aspect above when the computer program is executed. A fourth aspect of the invention provides a computer-readable storage medium storing a computer program which, when executed by a processor, implements a method of rendering container components in an interface as described in the first aspect above. A fifth aspect of the invention provides a computer program product which, when run on a computer, causes the computer to perform a method of rendering a container assembly in an interface as described in the first aspect above. Compared with the background technology, the embodiment of the invention has the following beneficial effects: In the embodiment, in response to a rendering request of a container component containing fillets, determining layout information of the container component and view parameters of a screen, wherein the container component is used for accommodating and managing interface sub-elements, determining an interface area of the container component in a visible area of the screen based on the layout information and the view parameters, applying for a local buffer area matched with the interfa