Graph rendering method and device, electronic equipment, chip and storage medium

By generating the maximum inscribed rectangle and rendering based on the color data of the minimum circumscribed rectangle, the problem of increased calculation amount of the graphics processor when rendering the rounded rectangle is solved, and the rendering efficiency of the GPU is improved.

CN118864618AActive Publication Date: 2024-10-29BEIJING X RING TECHNOLOGY CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202410940223.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-12
Publication Date
2024-10-29
Estimated Expiration
2044-07-12

AI Technical Summary

Technical Problem

When rendering a rounded rectangle, the graphics processor needs to calculate whether each pixel position in the right rectangle is located outside the rounded rectangle, resulting in an increase in calculations and a decrease in performance.

Method used

Generate the maximum inscribed rectangle of the graphics to be rendered, determine the color data of the maximum inscribed rectangle based on the color data of the minimum circumscribed rectangle, and directly render the maximum inscribed rectangle to avoid calculating whether the internal pixels are located inside the image to be rendered.

Benefits of technology

It reduces the amount of calculations performed by the GPU during rendering, reduces the GPU load, and improves rendering efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118864618A_ABST
    Figure CN118864618A_ABST
Patent Text Reader

Abstract

The invention provides a graph rendering method and device, electronic equipment, a chip and a storage medium, and relates to the technical field of graph processing. Comprising the steps of generating a maximum inscribed rectangle corresponding to a to-be-rendered graph under the condition that the to-be-rendered graph is in a preset shape; obtaining first color data corresponding to a minimum enclosing rectangle of the to-be-rendered graph; determining second color data corresponding to the maximum inscribed rectangle according to the first color data; the maximum inscribed rectangle is rendered based on the second color data. Therefore, the maximum inscribed rectangle of the to-be-rendered graph is determined, and the maximum inscribed rectangle is directly rendered according to the second color data without calculating whether the pixel points in the maximum inscribed rectangle are located in the to-be-rendered graph, so that the calculation amount when the GPU renders the to-be-rendered graph can be reduced, the load of the GPU is reduced, and the rendering efficiency of the to-be-rendered graph is improved. And the rendering efficiency of the GPU is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of graphics processing technology, and in particular to a graphics rendering method, device, electronic device, chip and storage medium. Background Art

[0002] For drawing a rectangular rectangle, the graphics processing unit (GPU) directly calculates the color of each pixel in the output rectangle in the fragment shader of the rendering pipeline. However, for a rounded rectangle, the fragment shader needs to calculate whether the position coordinates of each pixel in the rectangular rectangle are outside the rounded rectangle based on the position information of the rectangular rectangle corresponding to the rounded rectangle and the rounded radius of the rounded rectangle, and set the pixels whose coordinates are outside the rounded corners to transparent, thereby achieving the outline effect of the rounded rectangle. The calculation of position coordinates and other calculations for each pixel in the fragment shader will cause a large increase in the amount of calculation of the GPU and a decrease in performance. Summary of the invention

[0003] The present disclosure aims to solve one of the technical problems in the related art at least to some extent.

[0004] The first embodiment of the present disclosure provides a graphics rendering method, including:

[0005] When the graphic to be rendered is a preset shape, generating a maximum inscribed rectangle corresponding to the graphic to be rendered;

[0006] Obtaining first color data corresponding to the minimum circumscribed rectangle of the graphic to be rendered;

[0007] Determine, according to the first color data, second color data corresponding to the maximum inscribed rectangle;

[0008] The maximum inscribed rectangle is rendered based on the second color data.

[0009] A second aspect of the present disclosure provides a graphics rendering device, including:

[0010] A generating module, used for generating a maximum inscribed rectangle corresponding to the graphic to be rendered when the graphic to be rendered is a preset shape;

[0011] An acquisition module, used for acquiring first color data corresponding to the minimum circumscribed rectangle of the graphic to be rendered;

[0012] A determination module, configured to determine second color data corresponding to the maximum inscribed rectangle according to the first color data;

[0013] A rendering module is used to render the maximum inscribed rectangle based on the second color data.

[0014] The third aspect of the present disclosure provides an electronic device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, the graphics rendering method provided in the first aspect of the present disclosure is implemented.

[0015] A fourth aspect of the present disclosure provides a chip, wherein the chip includes a processing circuit, and the processing circuit is configured to execute the graphics rendering method provided by the first aspect of the present disclosure.

[0016] The fifth aspect embodiment of the present disclosure proposes a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, the graphics rendering method proposed in the first aspect embodiment of the present disclosure is implemented.

[0017] The graphics rendering method, device, electronic device, chip and storage medium provided by the present disclosure have the following beneficial effects:

[0018] In the disclosed embodiment, when the graphics to be rendered are of a preset shape, the maximum inscribed rectangle corresponding to the graphics to be rendered is generated, the first color data corresponding to the minimum circumscribed rectangle of the graphics to be rendered is obtained, and the second color data corresponding to the maximum inscribed rectangle is determined based on the first color data, and finally the maximum inscribed rectangle is rendered based on the second color data. Thus, the maximum inscribed rectangle of the graphics to be rendered is determined, and the maximum inscribed rectangle is directly rendered based on the second color data, without calculating whether the pixel points inside the maximum inscribed rectangle are located inside the image to be rendered, thereby reducing the amount of calculation of the GPU when rendering the graphics to be rendered, reducing the GPU load, and improving the rendering efficiency of the GPU.

[0019] Additional aspects and advantages of the present disclosure will be given in part in the following description and in part will be obvious from the following description or learned through practice of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] The above and / or additional aspects and advantages of the present disclosure will become apparent and easily understood from the following description of the embodiments in conjunction with the accompanying drawings, in which:

[0021] Figure 1 A flowchart of a graphics rendering method provided by an embodiment of the present disclosure;

[0022] Figure 2 A flowchart of a graphics rendering method provided by another embodiment of the present disclosure;

[0023] Figure 3 A schematic diagram of a graphics rendering provided by an embodiment of the present disclosure;

[0024] Figure 4 A schematic diagram of the structure of a graphics rendering device provided by another embodiment of the present disclosure;

[0025] Figure 5 A block diagram of an exemplary electronic device suitable for implementing the embodiments of the present disclosure is shown;

[0026] Figure 6 It is a schematic diagram of the structure of a chip proposed in an embodiment of the present disclosure. DETAILED DESCRIPTION

[0027] Embodiments of the present disclosure are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present disclosure, and should not be construed as limiting the present disclosure.

[0028] The following describes the graphics rendering method, device, electronic device, chip, and storage medium of the embodiments of the present disclosure with reference to the accompanying drawings.

[0029] The embodiment of the present disclosure takes the graphics rendering method being configured in a graphics rendering device as an example. The graphics rendering device can be applied to any electronic device so that the electronic device can perform a graphics rendering function.

[0030] Figure 1 A flowchart of a graphics rendering method provided by an embodiment of the present disclosure is provided.

[0031] like Figure 1 As shown, the graphics rendering method may include the following steps:

[0032] Step 101 : when the graphic to be rendered is a preset shape, generate a maximum inscribed rectangle corresponding to the graphic to be rendered.

[0033] The graphics to be rendered may be graphics whose shape and color have been determined and are waiting to be rendered.

[0034] In some embodiments, after the rendering thread (RenderThread) starts traversing rendering operation commands and draws a graphic to be rendered, and after the surface synthesizer (SurfaceF li nger) determines the color information of the large rendering graphic, it can be determined whether the graphic to be rendered is a preset shape.

[0035] Among them, the preset shape is not a right-angled rectangle, for example, it can be a rounded rectangle, a pentagon, an ellipse, etc., and the present disclosure does not limit this.

[0036] In some embodiments, the maximum inscribed rectangle of the graphics to be rendered may be drawn on a third layer above the first layer where the graphics to be rendered are located. That is, the third layer where the maximum inscribed rectangle is located is displayed on the first layer of the graphics to be rendered.

[0037] In the disclosed embodiment, if the maximum inscribed rectangle of the graphic to be rendered is drawn on the third layer above the first layer where the graphic to be rendered is located, it is necessary to ensure that the transparency property of the first layer where the graphic to be rendered is opaque, thereby avoiding the problem of abnormal appearance of certain transparent pixels when rendering the maximum inscribed rectangle.

[0038] Step 102: Obtain first color data corresponding to the minimum bounding rectangle of the graphic to be rendered.

[0039] In some embodiments, if the graphic to be rendered is a rounded rectangle, the CPU will determine the position, color data, and corner radius information of the circumscribed rectangle of the rounded rectangle, and send the position and corner radius information of the circumscribed rectangle of the rounded rectangle to the GPU. Therefore, the first color data corresponding to the minimum circumscribed rectangle can be obtained.

[0040] In some embodiments, the first color data corresponding to the minimum bounding rectangle may include color data corresponding to each pixel in the minimum bounding rectangle, wherein the color data corresponding to the pixel may be the value of the red component, the value of the green component, and the value of the blue component.

[0041] The color data corresponding to each pixel in the minimum circumscribed rectangle may be the same or different, and the present disclosure does not limit this.

[0042] Step 103: Determine the second color data corresponding to the maximum inscribed rectangle according to the first color data.

[0043] The second color data may include color data corresponding to each pixel in the maximum inscribed rectangle.

[0044] In some embodiments, when any third pixel in the maximum inscribed rectangle coincides with any fourth pixel in the minimum circumscribed rectangle, the first color data corresponding to any fourth pixel is determined as the second color data corresponding to any third pixel. Thus, the color information of the maximum inscribed rectangle of the rounded rectangle may not be changed, ensuring that the appearance of the newly generated maximum inscribed rectangle is consistent with that of the area in the rounded rectangle.

[0045] Step 104: Rendering the maximum inscribed rectangle based on the second color data.

[0046] In the disclosed embodiment, after determining the second color data corresponding to the maximum inscribed rectangle, the maximum inscribed rectangular area in the rounded rectangle can be rendered directly based on the second color data, without having to determine whether the pixels within the maximum inscribed rectangular area are located inside the rounded rectangle, thereby reducing the amount of calculation required by the GPU when rendering preset shape graphics, reducing the GPU load, and improving the rendering efficiency of the GPU.

[0047] In some embodiments, if the maximum inscribed rectangle of the graphic to be rendered is drawn on a third layer above the first layer where the graphic to be rendered is located, after determining the second color data, the first color data of the area in the first layer that is stored in the same position as the maximum inscribed rectangle can be deleted, and the second color data can be stored. Thus, based on the second color data, the maximum inscribed rectangle of the third layer can be rendered. When rendering the first layer, there is no need to render the area corresponding to the maximum inscribed rectangle, and only other pixels outside the maximum inscribed rectangle need to be rendered. This can reduce the amount of calculation of the GPU when rendering the graphic to be rendered, reduce the GPU load, and improve the rendering efficiency of the GPU.

[0048] In some embodiments, it is also necessary to render other pixel points in the graphics to be rendered except for the largest inscribed rectangle, so as to complete the rendering effect of the graphics to be rendered. Specifically, determine other areas in the minimum circumscribed rectangle except for the largest inscribed rectangle, so as to obtain the first pixel point located inside the graphics to be rendered in other areas, and the second pixel point located outside the graphics to be rendered, and determine the third color data corresponding to the first pixel point based on the first color data, and render the first pixel point based on the third color data, and set the second pixel point to be transparent. Therefore, the GPU only needs to determine the relationship between other pixel points in the minimum circumscribed rectangle except for the largest inscribed rectangle and the graphics to be rendered, thereby reducing the overall calculation amount of the GPU when rendering the graphics to be rendered, reducing the GPU load, and improving the rendering efficiency of the GPU.

[0049] Since the first color data includes color data corresponding to each pixel in the minimum circumscribed rectangle, the third color data corresponding to the first pixel can be determined based on the first color data.

[0050] In the disclosed embodiment, when the graphics to be rendered are of a preset shape, the maximum inscribed rectangle corresponding to the graphics to be rendered is generated, the first color data corresponding to the minimum circumscribed rectangle of the graphics to be rendered is obtained, and the second color data corresponding to the maximum inscribed rectangle is determined based on the first color data, and finally the maximum inscribed rectangle is rendered based on the second color data. Thus, the maximum inscribed rectangle of the graphics to be rendered is determined, and the maximum inscribed rectangle is directly rendered based on the second color data, without calculating whether the pixel points inside the maximum inscribed rectangle are located inside the image to be rendered, thereby reducing the amount of calculation of the GPU when rendering the graphics to be rendered, reducing the GPU load, and improving the rendering efficiency of the GPU.

[0051] Figure 2 A flowchart of a graphics rendering method provided by an embodiment of the present disclosure is shown as follows: Figure 2 As shown, the graphics rendering method may include the following steps:

[0052] Step 201 : when the graphic to be rendered is a preset shape, there is a second layer below the first layer where the graphic to be rendered is located, and the transparency attribute of the first layer is opaque, a maximum inscribed rectangle corresponding to the graphic to be rendered is generated.

[0053] There is a second layer below the first layer where the graphics to be rendered are located, indicating that there is a background below the graphics to be rendered.

[0054] In some embodiments, a maximum inscribed rectangle of the graphics to be rendered is drawn on a third layer above the first layer where the graphics to be rendered are located.

[0055] In the disclosed embodiment, the corresponding area of ​​the largest inscribed rectangle in the graphics to be rendered in the first layer and the corresponding area of ​​the largest inscribed rectangle in the background of the second layer are completely covered by the largest inscribed rectangle of the graphics to be rendered in the third layer. If the transparency property of the second layer is transparent, it is necessary to merge the graphics to be rendered in the first layer with the background in the second layer. If the largest inscribed rectangle is used to completely cover them, the rendered graphics will have abnormal appearance. Therefore, it is necessary to use this method when the transparency property of the first layer is opaque.

[0056] Step 202: Obtain first color data corresponding to the minimum bounding rectangle of the graphics to be rendered.

[0057] Step 203: Determine the second color data corresponding to the maximum inscribed rectangle according to the first color data.

[0058] The specific implementation forms of step 202 and step 203 can refer to the detailed descriptions in other embodiments of the present disclosure, and will not be described in detail here.

[0059] Step 204, deleting the first color data of the area corresponding to the maximum inscribed rectangle in the first layer and the fourth color data of the area corresponding to the maximum inscribed rectangle in the second layer.

[0060] Figure 3 A schematic diagram of a graphics rendering provided by an embodiment of the present disclosure is shown as follows: Figure 3 As shown, the graphics to be rendered are rounded rectangles, the first layer where the graphics to be rendered is located is the upper layer of the second layer where the background is located, and the third layer where the maximum inscribed rectangle is located is the upper layer of the first layer. Therefore, the CPU first determines the fourth color data corresponding to each pixel in the second layer where the background is located, and sends the fourth color data corresponding to each pixel in the second layer to the GPU for storage. Then, the CPU determines the first color data corresponding to each pixel in the minimum circumscribed rectangle in the first layer of the graphics to be rendered, and sends the first color data in the first layer to the GPU for storage. Finally, the second color data of the maximum inscribed rectangle in the third layer is determined. After sending the second color data to the GPU, the GPU can delete the first color data corresponding to the area of ​​the maximum inscribed rectangle in the first layer and the fourth color data of the maximum inscribed rectangle in the second layer that have been stored. Therefore, when rendering, the GPU only needs to render the maximum inscribed rectangle area in the third layer, and does not need to process the maximum inscribed rectangle areas in the first layer and the second layer, thereby further reducing the GPU load and improving the GPU performance.

[0061] It should be noted that in the embodiment of the present disclosure, the front-end pixel killing technology (FPK) is adopted to eliminate the first color data of the area corresponding to the maximum inscribed rectangle in the first layer and the fourth color data of the area corresponding to the maximum inscribed rectangle in the second layer based on the second color data.

[0062] Among them, FPK is a hidden surface elimination method in the GPU. For opaque objects, when rendering in order from back to front, hidden pixels can be eliminated to avoid entering the fragment shader for redundant calculations, thereby improving GPU performance.

[0063] The principle of the FPK feature is that a 2x2 pixel quad will not be immediately sent to the fragment shader for processing, but will be transferred to a first-in-first-out queue (FIFO) with a capacity of 128 for storage. When a quad at the same position is added later, the cached quad will be removed, thereby ensuring that the obscured pixel quad will not enter the fragment shader for redundant calculation, thereby improving the GPU performance. Therefore, in the embodiment of the present disclosure, based on the second color data, the first color data of the area corresponding to the maximum inscribed rectangle in the first layer and the fourth color data of the area corresponding to the maximum inscribed rectangle in the second layer are removed, thereby avoiding redundant calculation of the color data of the lower layer of the maximum inscribed rectangle in the fragment shader, thereby improving the performance of the GPU.

[0064] Step 205: store the second color data.

[0065] In the embodiment of the present disclosure, after deleting the first color data and the fourth color data corresponding to the maximum inscribed rectangular area, the second color data may be stored in the corresponding storage location.

[0066] In some embodiments, based on the second color data, the first color data of the area corresponding to the maximum inscribed rectangle in the first layer and the fourth color data of the area corresponding to the maximum inscribed rectangle in the second layer stored in a first-in-first-out queue (FIFO) can be eliminated, and the second color data can be stored in the storage location of the corresponding pixel point, so that when the GPU is rendering, the fragment shader can read the second color data from the first-in-first-out queue to render the maximum inscribed rectangle.

[0067] For example, if the position of any pixel in the maximum inscribed rectangle is the i-th row and j-th column, and the storage position corresponding to the pixel in the i-th row and j-th column in the FIFO has already stored the first color data and the fourth color data of the pixel in the i-th row and j-th column, then the first color data and the fourth color data in the storage position corresponding to the pixel in the i-th row and j-th column are deleted, and the second color data corresponding to the pixel in the i-th row and j-th column are stored in the storage position.

[0068] It should be noted that the second color data can be determined by the CPU when generating the maximum inscribed rectangle, and the rendering of the maximum inscribed rectangle is processed by the CPU controlling the GPU. Therefore, the second color data needs to be stored so that the GPU can read the color data from the storage location for rendering.

[0069] Step 206: Render the maximum inscribed rectangle based on the second color data.

[0070] In the disclosed embodiment, during the rendering process, the GPU first renders the maximum inscribed rectangle in the third layer based on the second color data, then determines whether other pixels in the first layer except the maximum inscribed rectangle area are located inside the graphic to be rendered, and based on the first color data corresponding to the first pixel located inside the graphic to be rendered, renders the first pixel located inside the graphic to be rendered, and sets the second pixel located outside the graphic to be rendered to be transparent, and finally, based on the fourth color data corresponding to the pixels in other areas of the first layer except the graphic to be rendered, renders other areas of the first layer except the graphic to be rendered to obtain the final rendering result.

[0071] In the disclosed embodiment, when there is a second layer below the first layer where the graphics to be rendered are located, and the transparency attribute of the first layer is opaque, the maximum inscribed rectangle corresponding to the graphics to be rendered is generated, the first color data corresponding to the minimum circumscribed rectangle of the graphics to be rendered is obtained, and the second color data corresponding to the maximum inscribed rectangle is determined based on the first color data, and the first color data of the area corresponding to the maximum inscribed rectangle in the first layer and the fourth color data of the area corresponding to the maximum inscribed rectangle in the second layer are deleted, the second color data is stored, and finally the maximum inscribed rectangle is rendered based on the second color data. Thus, based on the minimum circumscribed rectangle, the first color data of the area corresponding to the maximum inscribed rectangle in the first layer and the fourth color data of the area corresponding to the maximum inscribed rectangle in the second layer are eliminated, so that not only is it not necessary to calculate whether the pixel points in the maximum inscribed rectangle are located inside the graphics to be rendered, but also the color data of the lower layer of the maximum inscribed rectangle is avoided from being redundantly calculated in the fragment shader, thereby further reducing the complexity of the GPU and further improving the performance of the GPU.

[0072] In order to implement the above embodiment, the present disclosure also proposes a graphics rendering device.

[0073] Figure 4 A schematic diagram of the structure of a graphics rendering device provided in an embodiment of the present disclosure.

[0074] like Figure 4 As shown, the graphics rendering device 400 may include:

[0075] A generating module 401 is used to generate a maximum inscribed rectangle corresponding to the graphic to be rendered when the graphic to be rendered is a preset shape;

[0076] An acquisition module 402 is used to acquire first color data corresponding to each first pixel point in a minimum circumscribed rectangle of a graphic to be rendered;

[0077] A determination module 403 is used to determine second color data corresponding to each second pixel point in the maximum inscribed rectangle according to the first color data;

[0078] The rendering module 404 is used to render the maximum inscribed rectangle based on the second color data.

[0079] In some embodiments, the system further includes a processing module for:

[0080] Determine the area other than the maximum inscribed rectangle in the minimum enclosing rectangle;

[0081] Determine a first pixel point located inside the graphics to be rendered and a second pixel point located outside the graphics to be rendered in other regions;

[0082] Based on the first color data, determining third color data corresponding to the first pixel;

[0083] Rendering the first pixel based on the third color data;

[0084] Set the second pixel to transparent.

[0085] In some embodiments, the generating module 401 is used to:

[0086] In the case that a second layer exists below a first layer where the graphics to be rendered are located, and the transparency attribute of the first layer is opaque, a maximum inscribed rectangle corresponding to the graphics to be rendered is generated.

[0087] In some embodiments, the generating module 401 is used to:

[0088] On a third layer above the first layer where the graphics to be rendered are located, a maximum inscribed rectangle of the graphics to be rendered is drawn.

[0089] In some embodiments, a storage module is further included for:

[0090] Deleting the first color data of the area corresponding to the maximum inscribed rectangle in the first layer and the fourth color data of the area corresponding to the maximum inscribed rectangle in the second layer;

[0091] The second color data is stored.

[0092] In some embodiments, the determination module 403 is configured to:

[0093] When any third pixel point in the maximum inscribed rectangle coincides with any fourth pixel point in the minimum circumscribed rectangle, the first color data corresponding to any fourth pixel point is determined as the second color data corresponding to any third pixel point.

[0094] The functions and specific implementation principles of the above modules in the embodiments of the present disclosure can be referred to the above method embodiments, and will not be repeated here.

[0095] The graphics rendering device of the disclosed embodiment first generates the maximum inscribed rectangle corresponding to the graphics to be rendered when the graphics to be rendered are of a preset shape, obtains the first color data corresponding to the minimum circumscribed rectangle of the graphics to be rendered, and determines the second color data corresponding to the maximum inscribed rectangle based on the first color data, and finally renders the maximum inscribed rectangle based on the second color data. Thus, the maximum inscribed rectangle of the graphics to be rendered is determined, and the maximum inscribed rectangle is directly rendered based on the second color data, without calculating whether the pixel points inside the maximum inscribed rectangle are located inside the image to be rendered, thereby reducing the amount of calculation of the GPU when rendering the graphics to be rendered, reducing the GPU load, and improving the rendering efficiency of the GPU.

[0096] In order to implement the above embodiments, the present disclosure further proposes an electronic device, including: a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, the graphics rendering method proposed in the above embodiments of the present disclosure is implemented.

[0097] Figure 5 A block diagram of an exemplary electronic device suitable for implementing embodiments of the present disclosure is shown. Figure 5 The electronic device 12 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.

[0098] like Figure 5 As shown, the electronic device 12 is in the form of a general purpose computing device. The components of the electronic device 12 may include, but are not limited to: one or more processors or processing units 16, a system memory 28, and a bus 18 that connects various system components (including the system memory 28 and the processing unit 16).

[0099] The bus 18 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, a graphics acceleration port, a processor, or a local bus using any of a variety of bus structures. For example, these architectures include, but are not limited to, an Industry Standard Architecture (ISA) bus, a Micro Channel Architecture (MAC) bus, an Enhanced ISA bus, a Video Electronics Standards Association (VESA) local bus, and a Peripheral Component Interconnect (PCI) bus.

[0100] The electronic device 12 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by the electronic device 12, including volatile and non-volatile media, removable and non-removable media.

[0101] The memory 28 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 30 and / or cache memory 32. The electronic device 12 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, the storage system 34 may be used to read and write non-removable, non-volatile magnetic media ( Figure 5 not shown, usually called a "hard drive"). Although Figure 5 Not shown in the figure, a disk drive for reading and writing a removable non-volatile disk (e.g., a "floppy disk"), and an optical disk drive for reading and writing a removable non-volatile optical disk (e.g., a compact disk read only memory (hereinafter referred to as: CD-ROM), a digital versatile disk read only memory (hereinafter referred to as: DVD-ROM) or other optical media) may be provided. In these cases, each drive may be connected to the bus 18 via one or more data medium interfaces. The memory 28 may include at least one program product having a set (e.g., at least one) of program modules configured to perform the functions of the various embodiments of the present disclosure.

[0102] A program / utility 40 having a set (at least one) of program modules 42 may be stored, for example, in the memory 28, such program modules 42 including but not limited to an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment. The program modules 42 generally perform the functions and / or methods of the embodiments described in the present disclosure.

[0103] The electronic device 12 may also communicate with one or more external devices 14 (e.g., keyboard, pointing device, display 24, etc.), may also communicate with one or more devices that enable a user to interact with the electronic device 12, and / or may communicate with any device that enables the electronic device 12 to communicate with one or more other computing devices (e.g., network card, modem, etc.). Such communication may be performed via an input / output (I / O) interface 22. Furthermore, the electronic device 12 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) via a network adapter 20. As shown, the network adapter 20 communicates with other modules of the electronic device 12 via a bus 18. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 12, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0104] The processing unit 16 executes various functional applications and data processing by running programs stored in the system memory 28, such as implementing the methods mentioned in the above embodiments.

[0105] In order to implement the above embodiments, the present disclosure further proposes a chip, including: the chip includes a processing circuit, and the processing circuit is configured to execute the graphics rendering method provided by the above embodiments.

[0106] Figure 6 is a schematic diagram of the structure of the chip proposed in the embodiment of the present disclosure. Figure 6 The structure of the chip 600 is shown, but is not limited to this.

[0107] The chip 600 includes a processing circuit 601 , and the processing circuit 601 is configured to execute any of the above methods.

[0108] In some embodiments, the chip 600 further includes one or more interface circuits 602. Optionally, the interface circuit 602 is connected to the memory 603, and the interface circuit 602 can be used to receive signals from the memory 603 or other devices, and the interface circuit 602 can be used to send signals to the memory 603 or other devices. For example, the interface circuit 602 can read instructions stored in the memory 603 and send the instructions to the processing circuit 601.

[0109] In some embodiments, the interface circuit 602 performs at least one of the communication steps such as sending and / or receiving in the above method, and the processing circuit 601 performs other steps.

[0110] In some embodiments, terms such as interface circuit, interface, transceiver pin, and transceiver may be used interchangeably.

[0111] In some embodiments, the chip 600 further includes one or more memories 603 for storing instructions. Optionally, all or part of the memory 603 may be outside the chip 600.

[0112] In order to implement the above embodiments, the present disclosure further proposes a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, the graphics rendering method proposed in the above embodiments of the present disclosure is implemented.

[0113] The collection, storage, use, processing, transmission, provision and disclosure of user personal information involved in this disclosure shall comply with the relevant laws and regulations and shall not violate public order and good morals.

[0114] It should be noted that personal information from users should be collected for legitimate and reasonable purposes and should not be shared or sold outside of these legitimate uses. In addition, such collection / sharing should be carried out after receiving the user's informed consent, including but not limited to notifying the user to read the user agreement / user notice and sign the agreement / authorization including authorization of relevant user information before the user uses the function. In addition, any necessary steps should be taken to protect and safeguard access to such personal information data and ensure that others who have access to personal information data comply with its privacy policy and procedures.

[0115] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present disclosure. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradiction.

[0116] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of the features. In the description of the present disclosure, "plurality" means at least two, such as two, three, etc., unless otherwise clearly and specifically defined.

[0117] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, segment or portion of code that includes one or more executable instructions for implementing the steps of a custom logical function or process, and the scope of the preferred embodiments of the present disclosure includes additional implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in reverse order depending on the functions involved, which should be understood by technicians in the technical field to which the embodiments of the present disclosure belong.

[0118] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute the instructions), or in combination with these instruction execution systems, devices or apparatuses. For the purpose of this specification, "computer-readable medium" can be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in combination with these instruction execution systems, devices or apparatuses. More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection with one or more wires (electronic device), a portable computer disk box (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), a fiber optic device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium and then editing, interpreting or processing in other suitable ways if necessary, and then stored in a computer memory.

[0119] It should be understood that the various parts of the present disclosure can be implemented in hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, multiple steps or methods can be implemented in software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, any one of the following technologies known in the art or a combination thereof can be used to implement: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.

[0120] A person skilled in the art may understand that all or part of the steps in the method for implementing the above-mentioned embodiment may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, which, when executed, includes one or a combination of the steps of the method embodiment.

[0121] In addition, each functional unit in each embodiment of the present disclosure may be integrated into a processing module, or each unit may exist physically separately, or two or more units may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium.

[0122] The storage medium mentioned above may be a read-only memory, a disk or an optical disk, etc. Although the embodiments of the present disclosure have been shown and described above, it can be understood that the above embodiments are exemplary and cannot be understood as limitations of the present disclosure. A person of ordinary skill in the art may change, modify, replace and modify the above embodiments within the scope of the present disclosure.

Claims

1. A graphics rendering method, characterized in that: The method comprises: When the graphic to be rendered is a preset shape, generating a maximum inscribed rectangle corresponding to the graphic to be rendered; Obtaining first color data corresponding to the minimum circumscribed rectangle of the graphic to be rendered; Determine, according to the first color data, second color data corresponding to the maximum inscribed rectangle; The maximum inscribed rectangle is rendered based on the second color data.

2. The method according to claim 1, characterized in that The method further comprises: Determine other areas of the minimum circumscribed rectangle except the maximum inscribed rectangle; Determine a first pixel point located inside the graphics to be rendered and a second pixel point located outside the graphics to be rendered in the other area; Determine third color data corresponding to the first pixel based on the first color data; Rendering the first pixel based on the third color data; The second pixel is set to be transparent.

3. The method according to claim 1, characterized in that The generating of the maximum inscribed rectangle corresponding to the graphic to be rendered includes: In a case where a second layer exists below a first layer where the graphic to be rendered is located, and the transparency attribute of the first layer is opaque, a maximum inscribed rectangle corresponding to the graphic to be rendered is generated.

4. The method according to claim 1 or 3, characterized in that: The generating of the maximum inscribed rectangle corresponding to the graphic to be rendered includes: A maximum inscribed rectangle of the graphic to be rendered is drawn on a third layer above the first layer where the graphic to be rendered is located.

5. The method according to claim 3, characterized in that: After determining the second color data corresponding to the maximum inscribed rectangle according to the first color data, the method further includes: Deleting the first color data of the area corresponding to the maximum inscribed rectangle in the first layer and the fourth color data of the area corresponding to the maximum inscribed rectangle in the second layer; The second color data is stored.

6. The method according to claim 1, characterized in that The determining, according to the first color data, second color data corresponding to the maximum inscribed rectangle includes: When any third pixel point in the maximum inscribed rectangle coincides with any fourth pixel point in the minimum circumscribed rectangle, the first color data corresponding to the any fourth pixel point is determined as the second color data corresponding to the any third pixel point.

7. A graphics rendering device, characterized in that: The device comprises: A generating module, used for generating a maximum inscribed rectangle corresponding to the graphic to be rendered when the graphic to be rendered is a preset shape; An acquisition module, used for acquiring first color data corresponding to the minimum circumscribed rectangle of the graphic to be rendered; A determination module, configured to determine second color data corresponding to the maximum inscribed rectangle according to the first color data; A rendering module is used to render the maximum inscribed rectangle based on the second color data.

8. An electronic device, characterized in that: The invention comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the graphics rendering method as claimed in any one of claims 1 to 6 is implemented.

9. A chip, characterized in that: The chip comprises a processing circuit, and the processing circuit is configured to execute the graphics rendering method as claimed in any one of claims 1-6.

10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the graphics rendering method as described in any one of claims 1 to 6 is implemented.

Citation Information

Patent Citations

  • Graphic processing method, device and system

    CN104809684A

  • 3D scene text picture synthetic method and system

    CN108416828A

  • Synthetic rendering method and device, electronic equipment and medium

    CN111191580A

  • Graph rendering method and device and storage medium

    CN114627225A

  • Graph hybrid rendering method and device based on OpenGL and storage medium

    CN116912395A