WO2016155329A1 - Graphic processing method, device and system - Google Patents

Graphic processing method, device and system Download PDF

Info

Publication number
WO2016155329A1
WO2016155329A1 PCT/CN2015/094969 CN2015094969W WO2016155329A1 WO 2016155329 A1 WO2016155329 A1 WO 2016155329A1 CN 2015094969 W CN2015094969 W CN 2015094969W WO 2016155329 A1 WO2016155329 A1 WO 2016155329A1
Authority
WO
WIPO (PCT)
Prior art keywords
command
drawing command
irregular
commands
area
Prior art date
Application number
PCT/CN2015/094969
Other languages
French (fr)
Chinese (zh)
Inventor
姜霄棠
周振坤
李云夕
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Priority to EP15887283.8A priority Critical patent/EP3267391B1/en
Publication of WO2016155329A1 publication Critical patent/WO2016155329A1/en
Priority to US15/719,073 priority patent/US10198785B2/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T1/00General purpose image data processing
    • G06T1/20Processor architectures; Processor configuration, e.g. pipelining
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T11/002D [Two Dimensional] image generation
    • G06T11/20Drawing from basic elements, e.g. lines or circles
    • G06T11/206Drawing of charts or graphs
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T11/002D [Two Dimensional] image generation
    • G06T11/40Filling a planar surface by adding surface attributes, e.g. colour or texture
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T11/002D [Two Dimensional] image generation
    • G06T11/60Editing figures and text; Combining figures or text

Definitions

  • Embodiments of the present invention relate to the field of image processing, and, more particularly, to a graphics processing method, apparatus, and system.
  • the graphics engine is a graphics library that encapsulates graphics operations for application development. Designed by the system or designed by the developer. Every time the interface changes (start, slide, jump, animation, etc.), the graphics engine needs to completely draw the appropriate interface.
  • a large number of central processing units (CPUs), graphics processing units (Graphic Processing Units), and double rate synchronous dynamic random access memory (Double Data Rate, DDR) resources are consumed depending on the number of pixels.
  • CPUs central processing units
  • graphics processing units Graphic Processing Units
  • DDR double rate synchronous dynamic random access memory
  • the number of pixels that the graphics engine draws at a time is the width and height of the screen, but it exceeds this number when overdraws. Over-drawing refers to the case where the same pixel is repeatedly drawn.
  • An existing method for eliminating over-drawing uses a method of intersection detection and drawing command merging in drawing to remove over-drawing.
  • Embodiments of the present invention provide a graphics processing method, apparatus, and system, which can eliminate excessive drawing to some extent while reducing the complexity of intersection detection.
  • a graphics processing method comprising: receiving a command queue of a current frame input, the command queue includes a plurality of drawing commands, each of the drawing commands carrying an outsourcing rectangle information, an execution content, a drawing mode, and Draw area information, which includes overlay mode, mixed a mode or a waiting mode; according to the outsourcing rectangle information and the drawing area information, splitting each of the plurality of drawing commands into at least one first drawing command and at least one second drawing command, wherein The drawing area of the first type of drawing command is a rectangle in the drawing area corresponding to the irregular drawing command, and the drawing area of the at least one second type drawing command is the drawing area corresponding to the irregular drawing command, and the at least one first is removed.
  • the drawing area of the at least one first type drawing command is the same as the drawing mode of the irregular drawing command, and the drawing mode of the at least one second type drawing command is a waiting mode;
  • the outsourcing rectangle information and the drawing area information the rule drawing command of the plurality of drawing commands, and the first type drawing command and the second class drawing after the irregular drawing drawing command of the plurality of drawing commands are split Commands are grouped into multiple drawing command sets so that drawing commands belonging to different drawing command sets do not intersect each other;
  • the outsourcing rectangle information and the drawing area information the intersection of the plurality of drawing command sets is respectively detected, so that the drawing commands in each drawing command set do not intersect each other; according to the execution content, the drawing mode and the drawing area information And respectively drawing the command combination for the plurality of drawing command sets subjected to the intersection detection; performing the combined drawing command of each drawing command set.
  • each of the plurality of drawing commands is split into at least one first type drawing command according to the outsourcing rectangle information and the drawing area information.
  • the at least one second type drawing command is specifically implemented as: obtaining the maximum inscribed rectangle information of the irregular drawing command according to the outsourcing rectangle information and the drawing area information of the irregular drawing command; and using the outsourcing rectangle information of the irregular drawing command And the maximum inscribed rectangle information, the irregular drawing command is split into a first type drawing command and at least one second type drawing command, wherein the area corresponding to the first type drawing command is the irregular drawing command Corresponding maximum inscribed rectangle, the drawing area corresponding to the at least one second type drawing command is a corner area of the drawing area corresponding to the irregular drawing command except the maximum inscribed rectangle.
  • each of the plurality of drawing commands is split into at least one first type drawing command according to the outsourcing rectangle information and the drawing area information.
  • the at least one second type drawing command is specifically implemented as: when the drawing area corresponding to the irregular drawing command is an irregular polygon, the drawing area of the irregular polygon is divided into a plurality of triangular drawing areas, and according to the irregularity
  • the segmentation method of the polygon splits the irregular drawing command into a plurality of third class drawing commands, and the plurality of third class drawing commands have a one-to-one correspondence with the drawing regions of the plurality of triangles;
  • Three types of drawing commands, according to the third class The outsourcing rectangle information and the drawing area information of the command are drawn, and the maximum inscribed rectangle information of the third type drawing command is obtained; and the third type drawing command is obtained by using the outsourcing rectangle information and the maximum inscribed rectangle information of the third type drawing command.
  • the area corresponding to the first type of drawing command is a maximum inscribed rectangle corresponding to the third type drawing command
  • the at least one second The drawing area corresponding to the class drawing command is a corner area of the drawing area corresponding to the third type drawing command except the maximum inscribed rectangle.
  • a graphics processing method comprising: receiving a command queue of a current frame input, the command queue including a plurality of application programming interface API commands; converting the plurality of API commands into a plurality of drawing commands, Each of the drawing commands carries the outsourcing rectangle information, the execution content, the drawing mode, and the drawing area information, and the drawing mode includes an overlay mode, a blending mode, or a waiting mode; according to the outsourcing rectangle information and the drawing area information, the plurality of drawing commands are Each of the irregular drawing commands is split into at least one first type drawing command and at least one second type drawing command, wherein the drawing area of the first type drawing command is a rectangle in the drawing area corresponding to the irregular drawing command The drawing area of the at least one second type drawing command is a corner area remaining after the drawing area corresponding to the at least one first type drawing command is removed by the drawing area corresponding to the irregular drawing command, and the at least one first type drawing command is The drawing mode is the same as the drawing mode of the irregular drawing command, the at
  • each of the plurality of drawing commands is split into at least one first type drawing command according to the outsourcing rectangle information and the drawing area information.
  • the at least one second type drawing command is specifically implemented as: obtaining the maximum inscribed rectangle information of the irregular drawing command according to the outsourcing rectangle information and the drawing area information of the irregular drawing command; and using the outsourcing rectangle information of the irregular drawing command And the maximum inscribed rectangle information, the irregular drawing command is split into a first type drawing command and at least one second type drawing command, wherein the area corresponding to the first type drawing command is the irregular drawing command Corresponding maximum An inscribed rectangle, the drawing area corresponding to the at least one second type drawing command is a corner area of the drawing area corresponding to the irregular drawing command except the maximum inscribed rectangle.
  • each of the plurality of drawing commands is split into at least one first type drawing command according to the outsourcing rectangle information and the drawing area information.
  • the at least one second type drawing command is specifically implemented as: when the drawing area corresponding to the irregular drawing command is an irregular polygon, the drawing area of the irregular polygon is divided into a plurality of triangular drawing areas, and according to the irregularity
  • the polygon segmentation method splits the irregular drawing command into a plurality of third class drawing commands, and each of the drawing classes corresponding to the third class drawing command is one of the drawing regions of the plurality of triangles; for each third The class drawing command obtains the maximum inscribed rectangle information of the third type drawing command according to the outsourcing rectangle information and the drawing area information of the third class drawing command; and the outsourcing rectangle information and the maximum inscribed rectangle by using the third class drawing command Information, splitting the third type of drawing command into one first type drawing command and at least one second type drawing command, The area corresponding to the first type of drawing command is a maximum inscribed rectangle corresponding
  • a graphics processing apparatus comprising: a command collection module, configured to receive a command queue of a current frame input, the command queue includes a plurality of drawing commands, each of the drawing commands carrying an outer rectangle Information, execution content, drawing mode, and drawing area information, the drawing mode includes an overlay mode, a mixed mode, or a wait mode; a command splitting module for each of the plurality of drawing commands according to the outsourcing rectangle information and the drawing area information
  • An irregular drawing command is split into at least one first drawing command and at least one second drawing command, wherein a drawing area of the first drawing command is a rectangle in a drawing area corresponding to the irregular drawing command,
  • the drawing area of the at least one second type drawing command is a drawing area corresponding to the drawing area corresponding to the irregular drawing command, and the remaining corner area after the drawing area of the at least one first type drawing command is removed, and the drawing mode of the at least one first type drawing command Same as the drawing mode of the irregular drawing command, the at least one second type drawing
  • the command splitting module is specifically configured to: obtain an outer bounding rectangle of the irregular drawing command according to the outsourcing rectangle information and the drawing area information of the irregular drawing command Information; using the outsourcing rectangle information and the maximum inscribed rectangle information of the irregular drawing command, splitting the irregular drawing command into one first type drawing command and at least one second type drawing command, wherein the first The area corresponding to the class drawing command is the largest inscribed rectangle corresponding to the irregular drawing command, and the drawing area corresponding to the at least one second type drawing command is the drawing area corresponding to the irregular drawing command except the largest inscribed rectangle Corner area.
  • the command splitting module is specifically configured to: when the drawing area corresponding to the irregular drawing command is an irregular polygon, the drawing area of the irregular polygon is divided into a drawing area of the plurality of triangles, and splitting the irregular drawing command into a plurality of third type drawing commands according to the segmentation method of the irregular polygon, the plurality of third type drawing commands and the drawing area of the plurality of triangles a one-to-one correspondence relationship; for each third type drawing command, obtaining the maximum inscribed rectangle information of the third type drawing command according to the outsourcing rectangle information and drawing area information of the third type drawing command; The outsourcing rectangle information of the three types of drawing commands and the maximum inscribed rectangle information, the third type drawing command is split into a first class drawing command and at least one second class drawing command, wherein the first class drawing command The corresponding area is a maximum inscribed rectangle corresponding to the third type drawing command, and the drawing area corresponding to the at least one second type drawing command is the third type drawing Drawing command corresponding to the region except
  • a graphics processing apparatus comprising: a command collection module, configured to receive a command queue of a current frame input, the command queue includes a plurality of application programming interface API commands; and a command conversion module Converting the plurality of API commands into a plurality of drawing commands, each of the drawing commands carrying outsourcing rectangle information, execution content, drawing mode, and drawing area information, the drawing mode including an overlay mode, a mixed mode, or a waiting mode; a sub-module, configured to split each of the plurality of drawing commands into at least one first-type drawing command and at least one second-type drawing command according to the outsourcing rectangle information and the drawing area information, where The drawing area of the first type of drawing command is a rectangle in the drawing area corresponding to the irregular drawing command, and the drawing area of the at least one second type drawing command is the drawing area corresponding to the irregular drawing command, and the at least one first class is removed.
  • the remaining corner area after drawing the drawing area of the command, the at least one The drawing mode of the first type drawing command is the same as the drawing mode of the irregular drawing command, the drawing mode of the at least one second type drawing command is a waiting mode;
  • the command grouping module is configured to use the outsourcing rectangle information and the drawing area information, The rule drawing command of the plurality of drawing commands, and the first type drawing command and the second type drawing command after the split drawing command of the plurality of drawing commands are grouped into a plurality of drawing command sets, The drawing commands belonging to different drawing command sets are mutually disjoint;
  • the intersection detecting module is configured to perform intersection detection on the plurality of drawing command sets according to the outsourcing rectangle information and the drawing area information, so that each of the plurality of drawing command sets is drawn The command in the command set does not intersect with each other;
  • the command merge module is configured to respectively perform drawing command combining on the plurality of drawing command sets subjected to intersection detection according to the execution content, the drawing mode, and the drawing area information; and the executing module is
  • the command splitting module is configured to: obtain an outer bounding rectangle of the irregular drawing command according to the outsourcing rectangle information and the drawing area information of the irregular drawing command Information; using the outsourcing rectangle information and the maximum inscribed rectangle information of the irregular drawing command, splitting the irregular drawing command into one first type drawing command and at least one second type drawing command, wherein the first The area corresponding to the class drawing command is the largest inscribed rectangle corresponding to the irregular drawing command, and the drawing area corresponding to the at least one second type drawing command is the drawing area corresponding to the irregular drawing command except the largest inscribed rectangle Corner area.
  • the command splitting module is specifically configured to: when the drawing area corresponding to the irregular drawing command is an irregular polygon, the drawing area of the irregular polygon is divided into a drawing area of the plurality of triangles, and splitting the irregular drawing command into a plurality of third type drawing commands according to the segmentation method of the irregular polygon, the plurality of third type drawing commands and the drawing area of the plurality of triangles a one-to-one correspondence relationship; for each third type drawing command, obtaining the maximum inscribed rectangle information of the third type drawing command according to the outsourcing rectangle information and drawing area information of the third type drawing command; The outsourcing rectangle information of the three types of drawing commands and the maximum inscribed rectangle information, the third type drawing command is split into a first class drawing command and at least one second class drawing command, wherein the first class drawing command The corresponding area is a maximum inscribed rectangle corresponding to the third type drawing command, and the drawing area corresponding to the at least one second type drawing command is the third type drawing Drawing command corresponding to the region except
  • a computer system comprising a processor and a memory
  • This memory is used to store the program
  • the processor is used to execute a program stored in the memory, and is specifically used to perform the following operations:
  • the command queue includes a plurality of drawing commands, each of which carries an outsourcing rectangle information, an execution content, a drawing mode, and a drawing area information, and the drawing mode includes an overlay mode, a mixed mode, or a standby mode. ;
  • each of the plurality of drawing commands into at least one first class drawing command and at least one second class drawing command, wherein the first class drawing command
  • the drawing area is a rectangle in the drawing area corresponding to the irregular drawing command
  • the drawing area of the at least one second type drawing command is a drawing area corresponding to the irregular drawing command
  • the drawing area of the at least one first type drawing command is removed.
  • a remaining corner area a drawing mode of the at least one first type drawing command is the same as a drawing mode of the irregular drawing command, and a drawing mode of the at least one second type drawing command is a waiting mode;
  • the rule drawing command of the plurality of drawing commands, and the first type drawing command and the second class drawing after the irregular drawing drawing command of the plurality of drawing commands are split Commands are grouped into multiple drawing command sets so that drawing commands belonging to different drawing command sets do not intersect each other;
  • the method is configured to split each of the plurality of drawing commands into at least one first class drawing according to the outsourcing rectangle information and the drawing area information.
  • the processor is specifically configured to: obtain the maximum inscribed rectangle information of the irregular drawing command according to the outsourcing rectangle information and the drawing area information of the irregular drawing command;
  • the outsourcing rectangle information of the rule drawing command and the maximum inscribed rectangle information, the irregular drawing command is split into a first class drawing command and at least one second class drawing command, wherein the first class drawing command corresponds to The area is a maximum inscribed rectangle corresponding to the irregular drawing command, and the drawing area corresponding to the at least one second type drawing command is a corner area of the drawing area corresponding to the irregular drawing command except the maximum inscribed rectangle.
  • the processor is specifically used to: When the drawing area corresponding to the irregular drawing command is an irregular polygon, the drawing area of the irregular polygon is divided into a drawing area of a plurality of triangles, and the irregular drawing command is split according to the segmentation method of the irregular polygon.
  • Dividing into a plurality of third class drawing commands, the plurality of third class drawing commands and the drawing regions of the plurality of triangles have a one-to-one correspondence relationship; for each third class drawing command, drawing commands according to the third class The outer rectangle information and the drawing area information are obtained, and the maximum inscribed rectangle information of the third type drawing command is obtained; and the third type drawing command is split by using the outsourcing rectangle information and the maximum inscribed rectangle information of the third type drawing command.
  • the first type drawing command and the at least one second type drawing command wherein the area corresponding to the first type drawing command is a maximum inscribed rectangle corresponding to the third type drawing command, and the at least one second type drawing
  • the drawing area corresponding to the command is a corner area of the drawing area corresponding to the third type drawing command except the maximum inscribed rectangle.
  • a computer system comprising a processor and a memory
  • This memory is used to store the program
  • the processor is used to execute a program stored in the memory, and is specifically used to perform the following operations:
  • each of the plurality of drawing commands into at least one first class drawing command and at least one second class drawing command, wherein the first class drawing command
  • the drawing area is a rectangle in the drawing area corresponding to the irregular drawing command
  • the drawing area of the at least one second type drawing command is a drawing area corresponding to the irregular drawing command
  • the drawing area of the at least one first type drawing command is removed.
  • a remaining corner area a drawing mode of the at least one first type drawing command is the same as a drawing mode of the irregular drawing command, and a drawing mode of the at least one second type drawing command is a waiting mode;
  • the rule drawing command of the plurality of drawing commands, and the first type drawing command and the second class drawing after the irregular drawing drawing command of the plurality of drawing commands are split Commands are grouped into multiple drawing command sets so that drawing commands belonging to different drawing command sets do not intersect each other;
  • the method is configured to split each of the plurality of drawing commands into at least one first class drawing according to the outsourcing rectangle information and the drawing area information.
  • the processor is specifically configured to: obtain the maximum inscribed rectangle information of the irregular drawing command according to the outsourcing rectangle information and the drawing area information of the irregular drawing command;
  • the outsourcing rectangle information of the rule drawing command and the maximum inscribed rectangle information, the irregular drawing command is split into a first class drawing command and at least one second class drawing command, wherein the first class drawing command corresponds to The area is a maximum inscribed rectangle corresponding to the irregular drawing command, and the drawing area corresponding to the at least one second type drawing command is a corner area of the drawing area corresponding to the irregular drawing command except the maximum inscribed rectangle.
  • the processor is specifically configured to: when the drawing area corresponding to the irregular drawing command is an irregular polygon, the drawing area of the irregular polygon is divided into multiple triangles.
  • a graphic display system comprising:
  • the graphic display device has a communication connection with the graphic processing device for displaying a graphic obtained by the graphic processing device executing the merged drawing command.
  • a graphic display system comprising:
  • the graphic display device has a communication connection with the graphic processing device for displaying a graphic obtained by the graphic processing device executing the merged drawing command.
  • the graphics processing method, apparatus, and system of the embodiment of the present invention split the irregular drawing command in the command queue of the current frame into a rule drawing command and an irregular drawing command according to the drawing area, and divide the pre-split rule.
  • the drawing command and the split rule drawing command and the irregular drawing command are grouped into a plurality of mutually disjoint drawing command sets, and then each drawing command set is respectively subjected to intersection detection and command merging, since the drawing commands are grouped into multiple Drawing the command set and then performing the intersection detection can greatly reduce the time of the intersection detection, and since the original irregular drawing command is split into the rule drawing command and the irregular drawing command, the split rule drawing command obtains several after the intersection detection.
  • a new rule drawing command, one or more of the several new rule drawing commands may be merged in the command merge operation, which can increase the effect of eliminating over-drawing to a certain extent, thereby improving the performance of graphics processing. .
  • the graphics processing method, apparatus, and system of the embodiment of the present invention convert a plurality of API commands in a command queue of a current frame into a plurality of drawing commands, and then press the irregular drawing commands of the plurality of drawing commands.
  • the drawing area is divided into a rule drawing command and an irregular drawing command, and the rule drawing command before splitting and the split rule drawing command and the irregular drawing command are grouped into a plurality of mutually disjoint drawing command sets, and then Each drawing command set performs intersection detection and command merging separately. Since the drawing commands are grouped into multiple drawing command sets and then intersected detection, the time of intersection detection can be greatly reduced, and the original irregular drawing command is split into rule drawing commands.
  • the split rule drawing command obtains a number of new rule drawing commands after the intersection detection, and one or more of the several new rule drawing commands may be one or more in the command combining operation. Merging, can increase the effect of eliminating over-drawing to a certain extent, thereby improving the performance of graphics processing
  • FIG. 1 is a schematic diagram of a logical architecture of a terminal device.
  • FIG. 2 is a schematic diagram of a method of intersection detection according to an embodiment of the present invention.
  • FIG. 3 is a schematic illustration of the principles of the invention in accordance with an embodiment of the present invention.
  • FIG. 4 is a schematic flow chart of a graphics processing method according to an embodiment of the present invention.
  • FIG. 5 is a schematic flowchart of a method for command splitting according to an embodiment of the present invention.
  • Fig. 6 is a schematic view showing the maximum inscribed rectangle in a rectangle rotated at an arbitrary angle.
  • Figure 7 is a schematic illustration of the largest inscribed rectangle in the ellipse.
  • Figure 8 is a schematic illustration of the largest inscribed rectangle in the triangle.
  • FIG. 9 is a schematic diagram of a drawing area corresponding to a drawing command of a display space according to an embodiment of the present invention.
  • FIG. 10 is a schematic diagram of a drawing area after the display space is divided by the R+tree algorithm according to an embodiment of the present invention.
  • FIG. 11 is a schematic diagram of a drawing area after a secondary partitioning of a display space by using an R+tree algorithm according to an embodiment of the present invention.
  • FIG. 12 is a schematic diagram of a node of an R+ tree according to an embodiment of the present invention.
  • FIG. 13 is a schematic diagram showing the evolution of a command queue in a graphics processing method according to an embodiment of the present invention.
  • FIG. 14 is a schematic structural diagram of a graphics processing apparatus according to an embodiment of the present invention.
  • FIG. 15 is a schematic diagram of a specific process of graphics processing according to an embodiment of the present invention.
  • Figure 16 is a block diagram showing the structure of a computer system according to an embodiment of the present invention.
  • FIG. 17 is a schematic diagram of another graphics processing method according to an embodiment of the present invention.
  • FIG. 18 is a schematic structural diagram of another graphics processing apparatus according to an embodiment of the present invention.
  • FIG. 19 is a schematic diagram of a specific process of another graphics process according to an embodiment of the present invention.
  • 20 is a schematic structural diagram of another computer system according to an embodiment of the present invention.
  • Figure 21 is a block diagram showing the structure of a graphic display system in accordance with an embodiment of the present invention.
  • FIG. 22 is a schematic structural diagram of another graphic display system according to an embodiment of the present invention.
  • FIG. 23 is a schematic structural diagram of still another graphic display system according to an embodiment of the present invention.
  • FIG. 24 is a schematic structural diagram of still another graphic display system according to an embodiment of the present invention.
  • a terminal which may be referred to as a User Equipment ("UE"), a user, etc., may be performed by a radio access network (for example, a Radio Access Network (“RAN”) and one or more core networks.
  • the communication may be a mobile terminal, such as a mobile phone (or "cellular" phone) and a computer with a mobile terminal, for example, a portable, pocket, handheld, computer built-in or car-mounted mobile device, which is wireless
  • the access network exchanges languages and/or data.
  • the four vertices are on the edge of the graph, and the rectangles formed are all inside the graph.
  • the rectangle is called the inscribed rectangle of the graph.
  • the area of the inscribed rectangle is the largest, it is called the maximum inscribed rectangle.
  • the maximum inscribed rectangle in the embodiment of the present invention must also satisfy the condition: it may be assumed that one side of the desktop of the terminal is A, and the two parallel sides of the largest inscribed rectangle are parallel to the side A, and the other two parallel sides and the side A vertical.
  • the graphic engine renders the graphics rendering command to the terminal.
  • it can include four types of information: Rect, Work, Mode, and Shape.
  • Rect represents the outsourcing rectangle information of the area drawn by the drawing command
  • Work represents the execution content of the drawing command
  • Mode represents the drawing mode of the drawing command, that is, the drawing mode and the mixed mode on the canvas, including overlay (Opaque), blending (Blend) ) and wait (Wait) three types
  • Shape describes the shape of the area of the drawing command, such as rectangle / circle / point / line, etc., draw the shape of the area of the command, that is, the drawing area of the drawing command.
  • FIG. 1 is a schematic structural diagram of a terminal device.
  • the computing node may be a terminal device, and the terminal device may specifically be a smart phone.
  • the hardware layer of the terminal device includes a CPU, a GPU, and the like, and may further include a memory, an input/output device, a memory, a memory controller, a network interface, and the like.
  • the input device may include a keyboard, a mouse, a touch screen, and the like.
  • the output device may include a display device such as an LCD, a CRT, a Holographic image, a Projector, and the like.
  • the core library is the core part of the operating system, including input/output services, core services, graphics device interfaces, and graphics engine (Graphics Engine) for CPU and GPU graphics processing.
  • the graphics engine may include a 2D engine, a 3D engine, a composition, a Frame Buffer, an EGL, and the like.
  • the terminal further includes a driving layer, a frame layer, and an application layer.
  • the driver layer can include CPU driver, GPU driver, display Controller drive, etc.
  • the framework layer may include a graphic service (Graphic Service), a system service (System service), a web service (Web Service), and a customer service (Customer Service); and the graphic service may include, for example, a widget (widget) or a canvas (Canvas). , Views, Render Script, etc.
  • the application layer may include a desktop, a media player, a browser, and the like.
  • the method of the embodiment of the present invention may be performed by a 2D engine in the core library layer of FIG. 1.
  • the graphics processing method provided by the embodiment of the present invention is applied to a computing node, where the computing node may be a terminal device, where the hardware layer of the terminal device may include a processor, for example, a central processing unit (Center Processing) Unit, CPU), Graphic Processing Unit (GPU), Display Controller, Memory, Memory Controller, Input Device, Display Device, etc.
  • the Kernel Library can include input/ The output structure (I/O Service), the core service (Kernel Service), and the graphics engine (Graphic Engine), it should be understood that the logical structure of the execution body of the method of the embodiment of the present invention can refer to FIG.
  • An existing method for eliminating over-drawing uses intersecting detection, command merging, and over-drawing in drawing, and the algorithm of the intersection detection algorithm and the command merging algorithm is as follows.
  • Input a series of drawing commands with drawing areas within a drawing partition
  • Output A series of disjoint drawing areas with drawing commands.
  • FIG. 2 is a schematic diagram of a method of intersection detection according to an embodiment of the present invention. As shown in the left diagram of FIG. 2, the drawing area A1 (large rectangular area) and the drawing area A2 (small rectangular area) intersect, and the intersection area is B3 (actually A2); at this time, as shown in FIG. As shown in the figure on the right, A1 and A2 can be divided into B1, B2, B3, B4, and B5 according to the intersection area B3.
  • the drawing partition is a large area range.
  • the drawing command is said to be a drawing command in the drawing partition.
  • the two drawing areas do not intersect, which means that there is no overlapping area between the two drawing areas. If the two drawing commands do not intersect, it refers to the area where there is no overlap between the drawing areas of the two drawing commands. Similarly, multiple drawing areas do not intersect, which means that there is no overlapping area between multiple drawing areas; if multiple drawing commands do not intersect, it means that there is no overlapping area between drawing areas of multiple drawing commands.
  • the current command identifier is Blend, and the identifier of the previous command is not Wait, and the Work of the previous command can be mixed with the Work of the current command, the current command is merged with the previous command into one command.
  • Work represents the execution content of the drawing command. For example, image sampling, and so on.
  • FIG. 3 is a schematic illustration of the principles of the invention in accordance with an embodiment of the present invention.
  • the method of the embodiment of the present invention can be divided into a collection phase and an execution phase.
  • a set of commands that apply input in the same frame are collected and assembled into an original command queue;
  • the execution phase the original queue is over-drawn and culled by over-drawing the culling engine to form a new set of commands, and then Execute the output to the display device.
  • delayed rendering although it is divided into two processes of collecting and executing, there are the following differences: (1) Each command is independent of each other except the rendering target; (2) There are no instructions that only change state, all commands produce actual rendering effects, and each command has its own independent state.
  • FIG. 4 is a schematic diagram of a graphics processing method according to an embodiment of the present invention.
  • the method of Figure 4 is performed by a graphics processing device.
  • the graphics processing device may be a computer system such as a graphics engine or the like, or a graphics processor such as a GPU chip, and the like.
  • the method includes:
  • the command queue includes a plurality of drawing commands, each of which carries an outsourcing rectangle information, an execution content, a drawing mode, and a drawing area information, and the drawing mode includes an overlay mode, a mixed mode, or a waiting mode.
  • the drawing command generally includes four types of information: outer rectangle information (Rect), execution content (Work), drawing mode (Mode), and drawing area (Shape).
  • Rect represents the outsourcing rectangle information of the drawing area corresponding to the drawing command, and the drawing area is located in the outer rectangle.
  • the outer bounding rectangle of the drawing area is;
  • Work represents the execution content of the drawing command;
  • Mode represents the drawing mode of the drawing command, that is, the drawing result and the mixed mode on the canvas, including coverage (Opaque), blending (Blend), and waiting (Wait).
  • Three types Shape describes the shape of the area in which the command is drawn, such as rectangle/circle/point/line, etc., and draws the shape of the area of the command, that is, the drawing area of the drawing command.
  • the drawing area of the at least one first type drawing command is a rectangle in the drawing area corresponding to the irregular drawing command
  • the drawing area of the at least one second type drawing command is the drawing area corresponding to the irregular drawing command. Remaining at least one drawing area of the first type of drawing command a corner area, the drawing mode of the at least one first type drawing command is the same as the drawing mode of the irregular drawing command, and the drawing mode of the at least one second type drawing command is a waiting mode.
  • the regular shape refers to a rectangle parallel to the boundary corresponding to the display desktop.
  • the display area of the display desktop is a rectangle, assuming a rectangular ABCD.
  • the rectangle EFGH is located in the rectangle ABCD, and the side EF is parallel to the side AB, the side FG is parallel to the side BC, it can be said that the rectangle EFGH is a regular shaped area.
  • the drawing area corresponding to the drawing command is a regular shape, which may be called a rule command; the drawing area corresponding to the drawing command is an irregular shape, and may be called an irregular command.
  • the drawing content is correspondingly reflected in the drawing command after splitting.
  • the execution content of the drawing command is image sampling.
  • the execution content of the split drawing command is also image sampling, and the respective drawing regions are respectively image-sampled.
  • the command splitting process is not required for the rule command, and the command splitting process is required for the irregular command.
  • an irregular drawing command may be split into a first class drawing command and at least one second class drawing command.
  • a specific command splitting method is shown in FIG. 5, which may include:
  • the maximum inscribed rectangle of the irregular drawing command refers to a rectangle of a regular shape having the largest area among the inscribed rectangles of the drawing area corresponding to the irregular drawing command.
  • a rectangle of a regular shape that is, a rectangle whose boundary is parallel to the boundary corresponding to the display desktop.
  • Fig. 6 is a schematic view showing the maximum inscribed rectangle in a rectangle rotated at an arbitrary angle.
  • the rectangle ABCD is a rotation rectangle
  • the rectangle PSQR is an inscribed rectangle of the rotation rectangle ABCD.
  • the coordinates of point A are (0, 0)
  • the coordinates of point B are (x2, y2)
  • the coordinates of point C are (x1, y1)
  • P is the inscribed rectangle PSQR and long side.
  • the intersection of AC, Q is the intersection of the inscribed rectangle PSQR and the long side BD. It is possible to record the value of AP/AC as p, and the value of BQ/BD as q, then the solution equation of the largest inscribed rectangle can be obtained:
  • Figure 7 is a schematic illustration of the largest inscribed rectangle in the ellipse.
  • the center point of the hypothetical ellipse is not (x 0 , y 0 )
  • the distance between the coordinates of the intersection of the inscribed rectangle and the ellipse (A, B, C or D) to the center point of the ellipse is r
  • the angle is p, which lists the parametric equation of the rectangle ABCD:
  • Figure 8 is a schematic illustration of the largest inscribed rectangle in the triangle.
  • the rectangle ABCD is an inscribed rectangle of the triangle EFG. Find the best segmentation point on each edge of each of the three rows to obtain the corresponding inscribed rectangle on each edge. For example, take point A on the edge of EF, and then take two lines from point A in parallel with the side of the display desktop. The two lines drawn intersect with the edges FG, EG of the triangle EFG and points B and C, respectively, to determine the rectangle ABCD.
  • EA/EF is p
  • the area S of the rectangular ABCD can be expressed as a parameter expression containing p. When the area of S is the largest, point A is the best dividing point of the edge EF.
  • the best segmentation points on the edges FG, EG can be obtained separately.
  • the specific calculation method belongs to the category of geometric mathematics, and the embodiments of the present invention are not described herein again.
  • the area of the first type of drawing command is the maximum inscribed rectangle of the irregular drawing command
  • the drawing area of the at least one second type drawing command is the drawing area of the irregular drawing command except the maximum inscribed rectangle.
  • the corners draw the area.
  • the outer envelope is divided into a maximum inscribed rectangle and a plurality of irregular corner regions.
  • the drawing mode remains unchanged, and the drawing mode of the remaining corner areas is changed to the waiting mode state.
  • the original irregular command of the triangle, the rotation rectangle or the ellipse with the shape of the drawing area is split into a rule drawing command and a plurality of new irregular drawing commands according to the maximum inscribed rectangle, and split.
  • the rule drawing command after the intersection detection, several new rule drawing commands are obtained, and one or more of the new rule drawing commands may be merged in the command combining operation, thereby being able to Increase the effect of eliminating overdraw.
  • one irregular drawing command may be split into multiple first class drawing commands and multiple second class drawing commands.
  • step 420 may be specifically implemented as:
  • splitting the third class drawing command into one first class drawing command and at least one second class drawing command wherein the first The area corresponding to the class drawing command is the largest inscribed rectangle corresponding to the third type drawing command, and the drawing area corresponding to the at least one second type drawing command is the drawing area corresponding to the third type drawing command except the maximum inscribed rectangle. Corner area.
  • each triangle is split into a maximum inscribed rectangle and three corner regions, and the original drawing command is removed according to the split region.
  • the split rule drawing commands obtain a number of new rule drawing commands after the intersection detection, and the new rule drawing commands may be One or more of them are merged in the command merge operation, so that the effect of eliminating over-drawing can be increased to some extent.
  • Class drawing commands are grouped into multiple drawing command sets so that drawing commands belonging to different drawing command sets do not intersect each other.
  • the current command queue includes a rule drawing command that exists when the command queue is received, and a first type drawing command and a second type drawing command after the irregular command is split.
  • the drawing area in the current command queue can be divided into multiple drawing partitions, so that the drawing areas in different drawing partitions do not intersect each other, that is, the drawing areas of different drawing partitions There is no overlapping area between them. Then, the drawing commands in each drawing partition are combined into one drawing command set, and one drawing partition corresponds to one drawing command set.
  • the entire desktop is divided into a number of different drawing command sets.
  • the drawing command in each drawing command set is a finite number, and the time for intersecting detection of the drawing command in the drawing command set can be greatly reduced.
  • a method of an embodiment of the present invention uses an R+tree algorithm to select a loading factor, each time loading a finite strip drawing command to divide the drawing command into a plurality of drawing command sets.
  • each command can be added with a depth value in the order of execution so that the order of execution is known later.
  • FIG. 9 is a schematic diagram of a drawing area corresponding to a drawing command of a display space according to an embodiment of the present invention. Among them, there are 12 drawing commands, which respectively correspond to 12 drawing areas on the display space.
  • the command grouping of the R+ tree algorithm is performed.
  • FIG. 10 is a schematic diagram of a drawing area after the display space is divided by the R+ algorithm in the embodiment of the present invention. According to the R+ tree algorithm, the boundary line of each rectangle is exhausted. The first division is as shown in FIG. 10, and five rectangles (1, 2.1, 3, 4, 5.1) are divided, and the area of the divided rectangle is the smallest. Incorporate the rectangle (1, 2.1, 3, 4, 5.1) into the first leaf node.
  • FIG. 11 is a schematic diagram of a drawing area after the display space is secondarily divided by the R+ algorithm according to an embodiment of the present invention.
  • the boundary line of each rectangle is exhausted in the remaining area, and the second division is as shown in FIG. 11, and five rectangles (2.2, 6.1, 7, 9, 10) are divided, and the rectangle is divided. The smallest area. Incorporate the rectangle (2.2, 6.1, 7, 9, 10) into the second leaf node.
  • FIG. 12 is a schematic diagram of a node of an R+ tree according to an embodiment of the present invention. After two divisions of the R+ tree algorithm, an R+ tree diagram as shown in FIG. 12 is finally formed.
  • the R+ tree includes leaf nodes (1, 2.1, 3, 4, 5.1), (2.2, 6.1, 7, 9, 10) and (5.2, 8, 11, 12), each leaf node represents a drawing Command set.
  • the drawing command grouping can be quickly performed, and each drawing command set after grouping is controlled to a certain scale, thereby reducing the time complexity of the intersection detection and greatly improving the time complexity.
  • the graphics processing efficiency of the graphics processing device by using the R+ tree algorithm, the drawing command grouping can be quickly performed, and each drawing command set after grouping is controlled to a certain scale, thereby reducing the time complexity of the intersection detection and greatly improving the time complexity.
  • the drawing command in each drawing command set can be detected by the intersection.
  • the specific implementation can refer to the prior art, and details are not described herein again.
  • S450 Perform drawing command combining on the plurality of drawing command sets subjected to the intersection detection according to the execution content, the drawing mode, and the drawing area information.
  • the drawing command may be combined according to the execution content, the drawing mode, and the drawing area information of each drawing command to eliminate the over-drawn portion.
  • the drawing command may be combined according to the execution content, the drawing mode, and the drawing area information of each drawing command to eliminate the over-drawn portion.
  • the order of execution can be determined according to the depth of each drawing command.
  • the irregular drawing command in the command queue of the current frame is divided into a rule drawing command and an irregular drawing command according to the drawing area, and the rule drawing command and the split rule before the splitting are drawn.
  • the command and the irregular drawing command are grouped into a plurality of mutually dissimilar drawing command sets, and then each of the drawing command sets are respectively subjected to intersection detection and command merging, since the drawing commands are grouped into a plurality of drawing command sets and then intersected detection can be greatly The time for the intersection detection is reduced, and since the original irregular drawing command is split into the rule drawing command and the irregular drawing command, the split rule drawing command obtains several new rule drawing commands after the intersection detection, the plurality of It is possible that one or more of the new rule drawing commands will be merged in the command merging operation, which can increase the effect of eliminating over-drawing to a certain extent, thereby improving the performance of graphics processing.
  • FIG. 13 is a schematic diagram showing the evolution of a command queue in a graphics processing method according to an embodiment of the present invention.
  • the specific evolution process is as follows:
  • Step 1 Enter the command queue.
  • step S410 the command queue of the current frame input is received.
  • Step 2 Command split.
  • the input command queue is split according to step S420 of FIG. 4 to form a temporary command queue.
  • the third step command partition.
  • the temporary command queue is command-partitioned to obtain a series of drawing partitions, and each drawing partition corresponds to a sub-command set of drawing commands.
  • the drawing commands in different sub-command sets do not intersect.
  • the two drawing commands do not intersect, which means that the drawing areas corresponding to the two drawing commands do not overlap.
  • the fourth step intersection detection.
  • Intersection detection is performed for each sub-command set in accordance with step S440 of FIG. After each sub-command set performs intersection detection, it will get a series of disjoint drawing commands. It should be understood that after the intersection detection, the drawing areas corresponding to any two drawing commands in the same sub-command set do not overlap each other.
  • the fifth step is to merge the commands.
  • step S450 of FIG. 4 the drawing commands obtained after the intersection detection of each sub-command set are combined and combined to form a new command queue.
  • the command queue is the input command queue.
  • the irregular drawing command in the command queue of the current frame is divided into a rule drawing command and an irregular drawing command according to the drawing area, and the rule drawing command before splitting and
  • the split rule drawing command and the irregular drawing command are grouped into a plurality of mutually dissimilar drawing command sets, and then each drawing command set is respectively subjected to intersection detection and command merging, since the drawing commands are grouped into multiple drawing command sets.
  • Performing the intersection detection can greatly reduce the time of intersection detection, and since the original irregular drawing command is split into the rule drawing command and the irregular drawing command, the split rule drawing command obtains several new rules after the intersection detection.
  • Drawing commands, one or more of the several new rule drawing commands may be merged in the command merging operation, which can increase the effect of eliminating over-drawing to a certain extent, thereby improving the performance of graphics processing.
  • FIG. 14 is a schematic structural diagram of a graphics processing apparatus 1400 according to an embodiment of the present invention.
  • the graphics processing apparatus 1400 may include a command collection module 1401, a command splitting module 1402, a command grouping module 1403, an intersection detecting module 1404, a command combining module 1405, and an executing module 1406. among them,
  • the command collection module 1401 is configured to receive a command queue of the current frame input.
  • the command queue includes a plurality of drawing commands, each of which carries an outsourcing rectangle information, an execution content, a drawing mode, and a drawing area information, and the drawing mode includes an overlay mode, a mixed mode, or a waiting mode.
  • the command splitting module 1402 is configured to split each of the plurality of drawing commands into at least one first type drawing command and at least one second type drawing command according to the outsourcing rectangle information and the drawing area information.
  • the drawing area of the first type of drawing command is a rectangle in the drawing area corresponding to the irregular drawing command
  • the drawing area of the at least one second type drawing command is the drawing area corresponding to the irregular drawing command, and the at least one is removed.
  • a drawing area remaining after the drawing area of the first type drawing command, the drawing mode of the at least one first type drawing command is the same as the drawing mode of the irregular drawing command, and the drawing mode of the at least one second type drawing command is waiting mode.
  • the command grouping module 1403 is configured to: according to the outsourcing rectangle information and the drawing area information, the rule drawing command of the plurality of drawing commands, and the first drawing of the irregular drawing command of the plurality of drawing commands after the splitting
  • the command and the second type of drawing command are grouped into a plurality of drawing command sets such that drawing commands belonging to different drawing command sets do not intersect each other.
  • the intersection detecting module 1404 is configured to perform intersection detection on the plurality of drawing command sets according to the outsourcing rectangle information and the drawing area information, so that the drawing commands in each drawing command set in the plurality of drawing command sets do not intersect each other.
  • the command merging module 1405 is configured to separately perform drawing command merging on the plurality of drawing command sets that have undergone intersection detection according to the execution content, the drawing mode, and the drawing area information.
  • the execution module 1406 is configured to execute the merged drawing command for each drawing command set.
  • the graphics processing apparatus 1400 splits the irregular drawing command in the command queue of the current frame into a rule drawing command and an irregular drawing command according to the drawing area, and draws the command and splits the rule before the splitting.
  • the following rule drawing command and irregular drawing command are grouped into a plurality of mutually dissimilar drawing command sets, and then each drawing command set is respectively subjected to intersection detection and command merging, and the drawing commands are grouped into a plurality of drawing command sets.
  • Intersection detection can greatly reduce the time of intersection detection, and since the original irregular drawing command is split into a rule drawing command and an irregular drawing command, the split rule drawing command obtains several new rule drawing commands after the intersection detection.
  • One or more of the several new rule drawing commands may be merged in the command merge operation, which can increase the effect of eliminating over-drawing to a certain extent, thereby improving the performance of graphics processing.
  • command splitting module 1402 is specifically configured to:
  • the irregular drawing command is split into a first class drawing command and at least one second class drawing command, wherein the first class drawing
  • the area corresponding to the command is a maximum inscribed rectangle corresponding to the irregular drawing command
  • the drawing area corresponding to the at least one second type drawing command is a corner area of the drawing area corresponding to the irregular drawing command except the maximum inscribed rectangle .
  • the graphics processing apparatus 1400 splits the original irregular command of the triangle, the rotation rectangle, or the ellipse with the shape of the drawing area into a rule drawing command and several new irregular drawing according to the maximum inscribed rectangle.
  • the command, the split rule drawing command obtains a number of new rule drawing commands after the intersection detection, and one or more of the new rule drawing commands may be merged in the command merge operation, thereby enabling To some extent, the effect of eliminating over-drawing is increased.
  • command splitting module 1402 is specifically configured to:
  • the drawing area corresponding to the irregular drawing command is an irregular polygon
  • the drawing area of the irregular polygon is divided into a drawing area of a plurality of triangles, and the irregular drawing command is split according to the segmentation method of the irregular polygon.
  • Dividing into a plurality of third class drawing commands, the plurality of third class drawing commands and the drawing regions of the plurality of triangles have a one-to-one correspondence relationship;
  • the outsourcing rectangle information and drawing according to the third class drawing command The area information is obtained, and the maximum inscribed rectangle information of the third type drawing command is obtained;
  • splitting the third class drawing command into one first class drawing command and at least one second class drawing command wherein the first The area corresponding to the class drawing command is the largest inscribed rectangle corresponding to the third type drawing command, and the drawing area corresponding to the at least one second type drawing command is the drawing area corresponding to the third type drawing command except the maximum inscribed rectangle. Corner area.
  • the graphics processing apparatus 1400 splits the irregular polygon into a plurality of triangles, and then splits each triangle into a maximum inscribed rectangle and three corner regions, and according to the split region,
  • the original drawing command is split into a plurality of rule drawing commands and a plurality of new irregular drawing commands, and the split rule drawing commands obtain a plurality of new rule drawing commands after the intersection detection, and the plurality of new rule drawing commands It is possible that one or more of them will be merged in the command merge operation, so that the effect of eliminating over-drawing can be increased to some extent.
  • the command grouping module 1403 is specifically configured to: according to the outsourcing rectangle information and the drawing area information, draw a command in the plurality of drawing commands, and an irregular drawing command in the plurality of drawing commands by adopting an R+ tree algorithm.
  • the split first drawing command and the second type drawing command are grouped into a plurality of drawing command sets, so that drawing commands belonging to different drawing command sets do not intersect each other.
  • the graphics processing apparatus 1400 can quickly perform drawing command grouping by using the R+ tree algorithm, and control each drawing command set after grouping to a certain scale, thereby reducing the time complexity of the intersection detection.
  • the graphics processing efficiency of the graphics processing device is greatly improved.
  • the graphics processing device 1400 can also perform the functions of the FIG. 4 and FIG. 13 and implement the functions of the graphics processing device in the embodiments shown in FIG. 4 and FIG.
  • the command collection module may be implemented by a communication interface, a command splitting module, a command grouping module, an intersection detecting module, and a command merge.
  • the module, the execution module may be implemented by a processor executing a program or instruction in a memory (in other words, by a processor and a special instruction in a memory coupled to the processor); in another
  • the command collection module, the command splitting module, the command grouping module, the intersection detecting module, the command combining module, and the executing module can also be implemented by an Application Specific Integrated Circuit (ASIC), and the specific implementation manner is as follows. There is technology, no more details here; the invention includes but is not limited to The foregoing implementation manners are understood to be within the scope of the embodiments of the present invention as long as they are implemented according to the embodiments of the present invention.
  • ASIC Application Specific Integrated Circuit
  • FIG. 15 is a schematic diagram of a specific process of graphics processing according to an embodiment of the present invention.
  • the application is a user-oriented product that requires physical support for graphics processing.
  • the application can be a web game, a CAD drawing tool, or the like.
  • the graphics processing device 1400 may correspond to the implementation of the combination of software and hardware of the graphics engine, the processor driver and the processor shown in FIG. 15 (it should be understood that the graphics engine and the processor driver herein can be understood as programs stored in the memory). Or instruction).
  • the drawing command output by the application is processed by the graphics engine to obtain a series of new drawing commands, and the graphics engine sends the processed series of new drawing commands to the corresponding processor through the processor driver (for example, the graphics engine will process After a series of new drawing commands are sent to the DSP by Digital Signal Processing (DSP) driver, or sent to the CPU through the CPU driver, or sent to the GPU through the GPU driver, and then by the processor (for example)
  • DSP Digital Signal Processing
  • CPU CPU
  • GPU GPU driver
  • the DSP, CPU or GPU executes, and the final rendering result is output to a display device (such as the display unit in Fig. 16).
  • the graphics processing apparatus 1400 in the above-described embodiments of the present invention may be implemented in the form of hardware, software, or a combination of hardware and software, and in particular, may be implemented as one or more computer systems or other processing systems.
  • FIG. 16 An exemplary implementation of the graphics processing apparatus will now be described with reference to FIG. 16.
  • the graphics processing apparatus of the following embodiments are collectively referred to as a computer system:
  • FIG. 16 is a block diagram showing the structure of a computer system 1600 according to an embodiment of the present invention.
  • computer system 1600 can include a processor 1602, a memory 1604, a communication interface 1601, and a display interface 1603.
  • the processor 1602, the memory 1604, the communication interface 1601, and the display interface 1603 are interconnected by a communication architecture 1606.
  • the communication architecture 1606 can be a bus or a network or the like. Specifically, when the communication architecture 1606 is a bus, the bus may be an ISA bus, a PCI bus, or an EISA bus. The bus can be divided into an address bus, a data bus, a control bus, and the like.
  • the communication infrastructure 1606 is a network, the network can be a wired network, such as a fiber optic network, a telephone line, etc., or a wireless network such as a cell connection, a radio frequency connection, or other communication channel.
  • Display interface 1603 can be coupled to display unit 1605.
  • Display unit 1605 includes a display (eg, a touch screen, LCD, CRT, Holographic, or Projector) Wait).
  • the display interface 1603 is for outputting the display data of the computer system 1600 to the display unit 1605 to which the computer system 1600 is connected, and is displayed by the display unit 1605.
  • the memory 1603 may further include a frame buffer, and the computer system 1600 processes the display data in the frame buffer, and outputs the data of the frame buffer to the display unit 1605 through the display interface 1603 after the processing.
  • the display unit 1605 can be used to display information input by the user or information provided to the user and various menu interfaces in the device (eg, mobile terminal, computer, smart set top box, smart integrated machine, etc.) in which the graphics processing device is located.
  • the display unit 1605 can include a display panel.
  • the display panel can be configured in the form of an LCD (Liquid Crystal Display) or an OLED (Organic Light-Emitting Diode).
  • the display unit 1605 can further include a touch panel, the touch panel is overlaid on the display panel to form a touch display screen.
  • Communication interface 1601 is used to enable communication between computer system 1600 and devices external to computer system 1600.
  • Communication interface 1601 can convert data from computer system 1600 to signal 1607, via communication path 1608, or receive signal 1607 from communication path 1608 and convert to data.
  • the communication interface 1601 can be a modem, a network interface (eg, an Ethernet interface), a communication port, a PCMCIA expansion slot, a PCMCIA expansion card, and the like.
  • Signal 1607 can be an optical signal, an electrical signal, or other form of signal.
  • Communication path 1608 can be a fiber optic network, a telephone line, a cell connection, a radio frequency connection, or other communication channel.
  • the memory 1604 is configured to store a program.
  • the program can include program code, the program code including computer operating instructions.
  • Memory 1604 can include read only memory and random access memory and provides instructions and data to processor 1602.
  • Memory 1604 may include high speed RAM memory and may also include non-volatile memory, such as at least one disk memory.
  • the processor 1602 executes the program stored in the memory 1604, and is specifically configured to perform the following operations:
  • the command queue includes a plurality of drawing commands, each of which carries an outsourcing rectangle information, an execution content, a drawing mode, and a drawing area information, and the drawing mode includes an overlay mode, a mixed mode, or a standby mode. ;
  • each of the plurality of drawing commands into at least one first class drawing command and at least one second class drawing command, wherein the first class drawing command
  • the drawing area is within the drawing area corresponding to the irregular drawing command a rectangle
  • the drawing area of the at least one second type drawing command is a corner area remaining after the drawing area corresponding to the irregular drawing command is removed from the drawing area of the at least one first type drawing command
  • the at least one first type drawing command The drawing mode is the same as the drawing mode of the irregular drawing command, and the drawing mode of the at least one second type drawing command is the waiting mode;
  • the rule drawing command of the plurality of drawing commands, and the first type drawing command and the second class drawing after the irregular drawing drawing command of the plurality of drawing commands are split Commands are grouped into multiple drawing command sets so that drawing commands belonging to different drawing command sets do not intersect each other;
  • computer system 1600 can include one or more processors 1602.
  • the processor 1602 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method may be completed by an integrated logic circuit of hardware in the processor 1602 or an instruction in a form of software.
  • the processor 1602 may be a general-purpose processor, including a central processing unit (CPU), a network processor (Network Processor, NP for short, etc.; or a digital signal processor (DSP), an application specific integrated circuit.
  • CPU central processing unit
  • NP Network Processor
  • DSP digital signal processor
  • ASIC application-the-shelf programmable gate array
  • FPGA field-programmable gate array
  • PPU Graphic Processing Unit
  • the processor 1602 can implement or perform the various methods, steps, and logic blocks disclosed in the embodiments of the present invention.
  • the general purpose processor may be a microprocessor or the processor or any conventional processor or the like. The steps of the method disclosed in the embodiments of the present invention may be directly implemented by the hardware decoding processor, or may be performed by a combination of hardware and software modules in the decoding processor.
  • the software module can be located in a conventional storage medium such as random access memory, flash memory, read only memory, programmable read only memory or electrically erasable programmable memory, registers, and the like.
  • the storage medium is located in the memory 1603, and the processor 1602 reads the information in the memory 1604 and completes the steps of the above method in combination with its hardware.
  • the graphics processing apparatus 1600 splits the irregular drawing command in the command queue of the current frame into a rule drawing command and an irregular drawing command according to the drawing area, and draws the command and splits the rule before the splitting.
  • the following rule drawing command and irregular drawing command are grouped into a plurality of mutually dissimilar drawing command sets, and then each drawing command set is respectively subjected to intersection detection and command merging, and the drawing commands are grouped into a plurality of drawing command sets.
  • Intersection detection can greatly reduce the time of intersection detection, and since the original irregular drawing command is split into a rule drawing command and an irregular drawing command, the split rule drawing command obtains several new rule drawing commands after the intersection detection.
  • One or more of the several new rule drawing commands may be merged in the command merge operation, which can increase the effect of eliminating over-drawing to a certain extent, thereby improving the performance of graphics processing.
  • the processor 1602 is specifically configured to:
  • the irregular drawing command is split into a first class drawing command and at least one second class drawing command, wherein the first class drawing
  • the area corresponding to the command is a maximum inscribed rectangle corresponding to the irregular drawing command
  • the drawing area corresponding to the at least one second type drawing command is a corner area of the drawing area corresponding to the irregular drawing command except the maximum inscribed rectangle .
  • the computer system 1600 splits the original incomplete command of the triangle, the rotation rectangle or the ellipse with the shape of the drawing area into a rule drawing command and several new irregular drawing commands according to the maximum inscribed rectangle.
  • the split rule drawing command obtains a number of new rule drawing commands after the intersection detection, and one or more of the new rule drawing commands may be merged in the command combining operation, thereby being able to To some extent, the effect of eliminating excessive drawing is increased.
  • the processor 1602 is specifically configured to:
  • the drawing area corresponding to the irregular drawing command is an irregular polygon
  • the drawing area of the irregular polygon is divided into a drawing area of a plurality of triangles, and according to the cutting of the irregular polygon
  • the sub-method divides the irregular drawing command into a plurality of third-type drawing commands, and the plurality of third-class drawing commands have a one-to-one correspondence with the drawing regions of the plurality of triangles;
  • splitting the third class drawing command into one first class drawing command and at least one second class drawing command wherein the first The area corresponding to the class drawing command is the largest inscribed rectangle corresponding to the third type drawing command, and the drawing area corresponding to the at least one second type drawing command is the drawing area corresponding to the third type drawing command except the maximum inscribed rectangle. Corner area.
  • the computer system 1600 splits the irregular polygon into a plurality of triangles, and then splits each triangle into a maximum inscribed rectangle and three corner regions, and according to the split region, the original The drawing command is split into a plurality of rule drawing commands and a plurality of new irregular drawing commands, and the split rule drawing commands obtain a plurality of new rule drawing commands after the intersection detection, and the plurality of new rule drawing commands are It is possible that one or more of them will be merged in the command merge operation, thereby increasing the effect of eliminating over-drawing to some extent.
  • the processor 1602 is specifically configured to: according to the outsourcing rectangle information and the drawing area information, draw a command in the plurality of drawing commands, and an irregular drawing command in the multiple drawing commands by adopting an R+ tree algorithm.
  • the split first drawing command and the second type drawing command are grouped into a plurality of drawing command sets, so that drawing commands belonging to different drawing command sets do not intersect each other.
  • the computer system 1600 can quickly perform drawing command grouping by using the R+ tree algorithm, and control each drawing command set after grouping to a certain scale, thereby reducing the time complexity of intersection detection, and greatly To a certain extent, the graphics processing efficiency of the graphics processing device is improved.
  • the computer system 1600 can also perform the functions of the FIG. 4 and FIG. 13 and implement the functions of the graphics processing apparatus in the embodiment shown in FIG. 4 and FIG.
  • FIG. 17 is a schematic diagram of another graphics processing method according to an embodiment of the present invention.
  • the method of Figure 17 is performed by a graphics processing device.
  • the graphics processing device may be a computer system such as a graphics engine or the like, or a graphics processor such as a GPU chip, and the like.
  • the method includes:
  • the command queue includes multiple application programming interfaces (Application Programming Interface, API) command.
  • API Application Programming Interface
  • Each of the drawing commands carries outsourcing rectangle information, execution content, drawing mode, and drawing area information
  • the drawing mode includes an overlay mode, a mixed mode, or a standby mode.
  • the Skia module in the Android terminal can be modified, a class of delayed rendering function (SkDeferredMultiCanvas class) is created, and a command parsing module SkCommand is newly created, and the Skia drawing API is converted into an over-drawing culling engine to be recognized.
  • SkDeferredMultiCanvas class a class of delayed rendering function
  • SkCommand a command parsing module
  • the drawing area of the first type of drawing command is a rectangle in the drawing area corresponding to the irregular drawing command
  • the drawing area of the at least one second type drawing command is the drawing area corresponding to the irregular drawing command, and the at least one is removed.
  • a drawing area remaining after the drawing area of the first type drawing command, the drawing mode of the at least one first type drawing command is the same as the drawing mode of the irregular drawing command, and the drawing mode of the at least one second type drawing command is waiting mode
  • step S1730 For the specific implementation of step S1730, refer to the embodiment shown in step S420 and FIG. 5.
  • the rule drawing command in the plurality of drawing commands, and the first type drawing command and the second after the irregular drawing command in the plurality of drawing commands are split according to the outsourcing rectangle information and the drawing area information.
  • Class drawing commands are grouped into multiple drawing command sets so that drawing commands belonging to different drawing command sets do not intersect each other.
  • step S1740 For the specific implementation of step S1740, reference may be made to the embodiment shown in step 230.
  • S1750 Perform intersection detection on the plurality of drawing command sets according to the outsourcing rectangle information and the drawing area information, so that the drawing commands in each drawing command set in the plurality of drawing command sets do not intersect each other.
  • S1760 Perform drawing command combining on the plurality of drawing command sets subjected to intersection detection according to the execution content, the drawing mode, and the drawing area information.
  • the command parsing module When rendering the calling API, the command parsing module first parses the command into the command queue. When it needs to be displayed on the screen, the over-drawing culling engine is called to process the command queue, and the rendering task is cropped. Then execute the command to call the SkCanvas that actually performs the drawing.
  • the irregular drawing commands in the plurality of drawing commands are divided into rule drawing commands and irregularities according to the drawing area.
  • the split rule since dividing the drawing command into multiple drawing command sets and performing intersection detection can greatly reduce the time of intersection detection, and splitting the original irregular drawing command into a rule drawing command and an irregular drawing command, the split rule
  • the drawing command obtains a number of new rule drawing commands after the intersection detection, and one or more of the several new rule drawing commands may be merged in the command combining operation, which can increase the elimination over-drawing to some extent.
  • the effect of the graphics processing can be improved.
  • step S1730 is specifically implemented as:
  • the irregular drawing command is split into a first class drawing command and at least one second class drawing command, wherein the first class drawing
  • the area corresponding to the command is a maximum inscribed rectangle corresponding to the irregular drawing command
  • the drawing area corresponding to the at least one second type drawing command is a corner area of the drawing area corresponding to the irregular drawing command except the maximum inscribed rectangle .
  • the original irregular command of the triangle, the rotation rectangle or the ellipse with the shape of the drawing area is split into a rule drawing command and a plurality of new irregular drawing commands according to the maximum inscribed rectangle, and split.
  • the rule drawing command after the intersection detection, several new rule drawing commands are obtained, and one or more of the new rule drawing commands may be merged in the command combining operation, thereby being able to Increase the effect of eliminating overdraw.
  • step S1730 is specifically implemented as:
  • the drawing area corresponding to the irregular drawing command is an irregular polygon
  • the drawing area of the irregular polygon is divided into a drawing area of a plurality of triangles, and the irregular drawing command is split according to the segmentation method of the irregular polygon.
  • Dividing into a plurality of third class drawing commands, the plurality of third class drawing commands and the drawing regions of the plurality of triangles have a one-to-one correspondence relationship;
  • splitting the third class drawing command into one first class drawing command and at least one second class drawing command wherein the first The area corresponding to the class drawing command is the largest inscribed rectangle corresponding to the third type drawing command, and the drawing area corresponding to the at least one second type drawing command is the drawing area corresponding to the third type drawing command except the maximum inscribed rectangle. Corner area.
  • each triangle is split into a maximum inscribed rectangle and three corner regions, and the original drawing command is removed according to the split region.
  • the split rule drawing commands obtain a number of new rule drawing commands after the intersection detection, and the new rule drawing commands may be One or more of them are merged in the command merge operation, so that the effect of eliminating over-drawing can be increased to some extent.
  • step S1740 is specifically implemented by: using an R+tree algorithm, according to the outsourcing rectangle information and the drawing area information, the rule drawing command in the plurality of drawing commands, and the irregular drawing command in the plurality of drawing commands.
  • the split first type drawing command and the second type drawing command are grouped into a plurality of drawing command sets, so that drawing commands belonging to different drawing command sets do not intersect each other.
  • the drawing command grouping can be quickly performed, and each drawing command set after grouping is controlled to a certain scale, thereby reducing the time complexity of the intersection detection and greatly improving the time complexity.
  • the graphics processing efficiency of the graphics processing device by using the R+ tree algorithm, the drawing command grouping can be quickly performed, and each drawing command set after grouping is controlled to a certain scale, thereby reducing the time complexity of the intersection detection and greatly improving the time complexity.
  • FIG. 18 is a schematic structural diagram of a graphics processing apparatus 1800 according to an embodiment of the present invention.
  • the graphics processing apparatus 1800 may include a command collection module 1801, a command conversion module 1802, a command splitting module 1803, a command grouping module 1804, an intersection detecting module 1805, a command combining module 1806, and an executing module 1807. among them,
  • the command collection module 1801 is configured to receive a command queue of a current frame input, where the command queue includes a plurality of API commands.
  • the command conversion module 1802 is configured to convert the plurality of API commands into a plurality of drawing commands, each of the drawing commands carrying outsourcing rectangle information, execution content, drawing mode, and drawing area information, where the drawing mode includes an overlay mode and a mixed mode. Or wait mode.
  • the command splitting module 1803 is configured to, according to the outsourcing rectangle information and the drawing area information, the plurality of Each of the irregular drawing commands in the drawing command is split into at least one first type drawing command and at least one second type drawing command.
  • the drawing area of the first type of drawing command is a rectangle in the drawing area corresponding to the irregular drawing command
  • the drawing area of the at least one second type drawing command is the drawing area corresponding to the irregular drawing command, and the at least one is removed.
  • a drawing area remaining after the drawing area of the first type drawing command, the drawing mode of the at least one first type drawing command is the same as the drawing mode of the irregular drawing command, and the drawing mode of the at least one second type drawing command is waiting mode.
  • the command grouping module 1804 is configured to: according to the outsourcing rectangle information and the drawing area information, the rule drawing command of the plurality of drawing commands, and the first drawing of the irregular drawing command of the plurality of drawing commands after the splitting
  • the command and the second type of drawing command are grouped into a plurality of drawing command sets such that drawing commands belonging to different drawing command sets do not intersect each other.
  • the intersection detecting module 1805 is configured to perform intersection detection on the plurality of drawing command sets according to the outsourcing rectangle information and the drawing area information, so that the drawing commands in each drawing command set in the plurality of drawing command sets do not intersect each other.
  • the command merging module 1806 is configured to separately perform drawing command merging on the plurality of drawing command sets that have undergone intersection detection according to the execution content, the drawing mode, and the drawing area information.
  • the execution module 1807 is configured to execute the merged drawing command for each drawing command set.
  • the graphics processing apparatus 1800 converts multiple API commands in the command queue of the current frame into multiple drawing commands, and then divides the irregular drawing commands of the multiple drawing commands into rules according to the drawing area.
  • the command and the irregular drawing command, and the rule drawing command before the splitting and the split rule drawing command and the irregular drawing command are grouped into a plurality of mutually dissimilar drawing command sets, and then each drawing command set is separately performed.
  • Intersection detection and command merging since the drawing commands are grouped into multiple drawing command sets and then intersected detection can greatly reduce the time of intersection detection, and since the original irregular drawing command is split into a rule drawing command and an irregular drawing command,
  • the divided rule drawing command obtains several new rule drawing commands after the intersection detection, and one or more of the several new rule drawing commands may be merged in the command combining operation, which can be to some extent Increase the effect of eliminating over-draw, which can improve the performance of graphics processing.
  • command splitting module 1803 is specifically configured to:
  • the irregularity is The drawing command is split into a first type drawing command and at least one second type drawing command, wherein the area corresponding to the first type drawing command is a maximum inscribed rectangle corresponding to the irregular drawing command, the at least one The drawing area corresponding to the second type of drawing command is a corner area of the drawing area corresponding to the irregular drawing command except the maximum inscribed rectangle.
  • the graphics processing apparatus 1800 splits the original irregular command of the triangle, the rotation rectangle, or the ellipse with the shape of the drawing area into a rule drawing command and several new irregular drawing according to the maximum inscribed rectangle.
  • the command, the split rule drawing command obtains a number of new rule drawing commands after the intersection detection, and one or more of the new rule drawing commands may be merged in the command merge operation, thereby enabling To some extent, the effect of eliminating over-drawing is increased.
  • command splitting module 1803 is specifically configured to:
  • the drawing area corresponding to the irregular drawing command is an irregular polygon
  • the drawing area of the irregular polygon is divided into a drawing area of a plurality of triangles, and the irregular drawing command is split according to the segmentation method of the irregular polygon.
  • the method is divided into a plurality of third class drawing commands, and the plurality of third class drawing commands have a one-to-one correspondence with the drawing regions of the plurality of triangles.
  • the maximum inscribed rectangle information of the third type drawing command is obtained according to the outsourcing rectangle information and the drawing area information of the third type drawing command.
  • splitting the third class drawing command into one first class drawing command and at least one second class drawing command wherein the first The area corresponding to the class drawing command is the largest inscribed rectangle corresponding to the third type drawing command, and the drawing area corresponding to the at least one second type drawing command is the drawing area corresponding to the third type drawing command except the maximum inscribed rectangle. Corner area.
  • the graphics processing apparatus 1800 splits the irregular polygon into a plurality of triangles, and then splits each triangle into a maximum inscribed rectangle and three corner regions, and according to the split region,
  • the original drawing command is split into a plurality of rule drawing commands and a plurality of new irregular drawing commands, and the split rule drawing commands obtain a plurality of new rule drawing commands after the intersection detection, and the plurality of new rule drawing commands It is possible that one or more of them will be merged in the command merge operation, so that the effect of eliminating over-drawing can be increased to some extent.
  • the command grouping module 1804 is specifically configured to: according to the outsourcing rectangle information and the drawing area information, draw a command in the plurality of drawing commands, and an irregular drawing command in the plurality of drawing commands by adopting an R+ tree algorithm.
  • the first type of drawing command and the second type of drawing after splitting Commands are grouped into multiple drawing command sets so that drawing commands belonging to different drawing command sets do not intersect each other.
  • the graphics processing apparatus 1800 can quickly perform drawing command grouping by using the R+ tree algorithm, and control each drawing command set after grouping to a certain scale, thereby reducing the time complexity of the intersection detection.
  • the graphics processing efficiency of the graphics processing device is greatly improved.
  • the graphics processing device 1800 can also perform the method of FIG. 17 and implement the functions of the graphics processing device in the embodiment shown in FIG.
  • the command collection module may be implemented by a communication interface, a command splitting module, a command grouping module, an intersection detecting module, and a command merge.
  • the module, the execution module may be implemented by a processor executing a program or instruction in a memory (in other words, by a processor and a special instruction in a memory coupled to the processor); in another
  • the command collection module, the command splitting module, the command grouping module, the intersection detecting module, the command combining module, and the executing module can also be implemented by an Application Specific Integrated Circuit (ASIC), and the specific implementation manner is as follows.
  • ASIC Application Specific Integrated Circuit
  • FIG. 19 is a schematic diagram of a specific process of graphics processing according to an embodiment of the present invention.
  • the application is a user-oriented product that requires physical support for graphics processing.
  • the application can be a web game, a CAD drawing tool, or the like.
  • the graphics processing device 1800 can correspond to the implementation of the combination of software and hardware of the graphics engine, the processor driver and the processor shown in FIG. 19 (it should be understood that the graphics engine and the processor driver herein can be understood as programs stored in the memory). Or instruction).
  • the drawing command output by the application is processed by the graphics engine to obtain a series of new drawing commands, and the graphics engine sends the processed series of new drawing commands to the corresponding processor through the processor driver (for example, the graphics engine will process After a series of new drawing commands are sent to the DSP by Digital Signal Processing (DSP) driver, or sent to the CPU through the CPU driver, or sent to the GPU through the GPU driver, and then by the processor (for example)
  • DSP Digital Signal Processing
  • CPU CPU
  • GPU GPU driver
  • the DSP, CPU or GPU executes, and the final rendering result is output to a display device (such as the display unit in Fig. 20).
  • FIG. 20 An exemplary implementation of the graphics processing apparatus will now be described with reference to FIG. 20.
  • the graphics processing apparatus of the following embodiments are collectively referred to as a computer system:
  • FIG. 20 is a schematic structural diagram of a computer system 2000 according to an embodiment of the present invention.
  • computer system 2000 can include a processor 2002, a memory 2004, a communication interface 2001, and a display interface 2003.
  • the processor 2002, the memory 2004, the communication interface 2001, and the display interface 2003 are interconnected by a communication architecture 2006.
  • the communication architecture 2006 can be a bus or a network.
  • the bus may be an ISA bus, a PCI bus, or an EISA bus.
  • the bus can be divided into an address bus, a data bus, a control bus, and the like.
  • the communication infrastructure 2006 is a network
  • the network may be a wired network, such as a fiber optic network, a telephone line, etc., or a wireless network such as a cell connection, a radio frequency connection, or other communication channel.
  • the display interface 2003 can be connected to the display unit 2005.
  • the display unit 2005 includes a display (eg, a touch screen, an LCD, a CRT, a Holographic or Projector, etc.).
  • the display interface 2003 is for outputting display data of the computer system 2000 to the display unit 2005, and is displayed by the display unit 2005.
  • the memory 2003 may further include a frame buffer, and the computer system 2000 processes the display data in the frame buffer, and outputs the data of the frame buffer to the display unit 2005 through the display interface 2003 after the processing.
  • the display unit 2005 can be used to display information input by the user or information provided to the user and various menu interfaces in the device (eg, mobile terminal, computer, smart set top box, smart integrated machine, etc.) in which the graphics processing device is located.
  • the display unit 2005 may include a display panel.
  • the display panel may be configured in the form of an LCD (Liquid Crystal Display) or an OLED (Organic Light-Emitting Diode).
  • the display unit 2005 further includes a touch panel, and the touch panel is overlaid on the display panel to form a touch display screen.
  • the communication interface 2001 is for implementing communication between the computer system 2000 and devices external to the computer system 2000.
  • Communication interface 2001 may convert data from computer system 2000 to signal 2007, via communication path 2008, or receive signal 2007 from communication path 2008 and convert to data.
  • the communication interface 2001 can be a modem, a network interface (eg, an Ethernet interface), a communication port, a PCMCIA expansion slot, a PCMCIA expansion card, and the like.
  • Signal 2007 can be an optical signal, an electrical signal, or other form of signal.
  • the communication path 2008 can be a fiber optic network, a telephone line, a cell connection, a radio frequency connection, or other communication channel.
  • the memory 2004 is used to store programs. Specifically, the program may include program code, the process The sequence code includes computer operating instructions.
  • Memory 2004 can include read only memory and random access memory and provides instructions and data to processor 2002.
  • the memory 2004 may include a high speed RAM memory and may also include a non-volatile memory such as at least one disk memory.
  • the processor 2002 executes the program stored in the memory 2004, and is specifically configured to perform the following operations:
  • each of the plurality of drawing commands into at least one first class drawing command and at least one second class drawing command, wherein the first class drawing command
  • the drawing area is a rectangle in the drawing area corresponding to the irregular drawing command
  • the drawing area of the at least one second type drawing command is a drawing area corresponding to the irregular drawing command
  • the drawing area of the at least one first type drawing command is removed.
  • a remaining corner area a drawing mode of the at least one first type drawing command is the same as a drawing mode of the irregular drawing command, and a drawing mode of the at least one second type drawing command is a waiting mode;
  • the rule drawing command of the plurality of drawing commands, and the first type drawing command and the second class drawing after the irregular drawing drawing command of the plurality of drawing commands are split Commands are grouped into multiple drawing command sets so that drawing commands belonging to different drawing command sets do not intersect each other;
  • processor 2002 may be an integrated circuit chip with signal processing capabilities.
  • processors 2002 may be an integrated circuit chip with signal processing capabilities.
  • the steps of the above method can be adopted The integrated logic circuit of the hardware in the processor 2002 or the instruction in the form of software is completed.
  • the processor 2002 may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP Processor, etc.), or a digital signal processor (DSP), an application specific integrated circuit.
  • CPU central processing unit
  • NP Processor network processor
  • DSP digital signal processor
  • ASIC application-the-shelf programmable gate array
  • FPGA field-programmable gate array
  • PPU Graphic Processing Unit
  • the processor 2002 can implement or perform the various methods, steps, and logic blocks disclosed in the embodiments of the present invention.
  • the general purpose processor may be a microprocessor or the processor or any conventional processor or the like. The steps of the method disclosed in the embodiments of the present invention may be directly implemented by the hardware decoding processor, or may be performed by a combination of hardware and software modules in the decoding processor.
  • the software module can be located in a conventional storage medium such as random access memory, flash memory, read only memory, programmable read only memory or electrically erasable programmable memory, registers, and the like.
  • the storage medium is located in the memory 2003, and the processor 2002 reads the information in the memory 2004 and performs the steps of the above method in combination with its hardware.
  • the computer system 2000 converts multiple API commands in the command queue of the current frame into multiple drawing commands, and then splits the irregular drawing commands of the multiple drawing commands into rule drawing commands according to the drawing area. And irregularly drawing commands, and grouping the rule drawing commands before splitting and the split rule drawing commands and irregular drawing commands into a plurality of mutually disjoint drawing command sets, and then respectively intersecting each drawing command set Detection and command merging, since dividing the drawing command into multiple drawing command sets and performing intersection detection can greatly reduce the time of intersection detection, and splitting the original irregular drawing command into a rule drawing command and an irregular drawing command, splitting After the rule drawing command, after the intersection detection, several new rule drawing commands are obtained, and one or more of the new rule drawing commands may be merged in the command combining operation, which can be increased to some extent. Eliminate the effects of over-drawing, which can improve the performance of graphics processing.
  • the processor 2002 is specifically used to:
  • splitting the irregular drawing command into one first type drawing command and at least one second type drawing command splitting the irregular drawing command into one first type drawing command and at least one second type drawing command,
  • the area corresponding to the first type of drawing command is the largest inscribed rectangle corresponding to the irregular drawing command
  • the drawing area corresponding to the at least one second type drawing command is the drawing area corresponding to the irregular drawing command except the maximum Connect the corner area outside the rectangle.
  • the computer system 2000 divides the original irregular command of the triangle, the rotation rectangle or the ellipse with the shape of the drawing area into a rule drawing command and several new irregular drawing commands according to the maximum inscribed rectangle.
  • the split rule drawing command obtains a number of new rule drawing commands after the intersection detection, and one or more of the new rule drawing commands may be merged in the command combining operation, thereby being able to To some extent, the effect of eliminating excessive drawing is increased.
  • the processor 2002 is specifically used to:
  • the drawing area corresponding to the irregular drawing command is an irregular polygon
  • the drawing area of the irregular polygon is divided into a drawing area of a plurality of triangles, and the irregular drawing command is split according to the segmentation method of the irregular polygon.
  • Dividing into a plurality of third class drawing commands, the plurality of third class drawing commands and the drawing regions of the plurality of triangles have a one-to-one correspondence relationship;
  • splitting the third class drawing command into one first class drawing command and at least one second class drawing command wherein the first The area corresponding to the class drawing command is the largest inscribed rectangle corresponding to the third type drawing command, and the drawing area corresponding to the at least one second type drawing command is the drawing area corresponding to the third type drawing command except the maximum inscribed rectangle. Corner area.
  • the computer system 2000 divides the original irregular command of the triangle, the rotation rectangle or the ellipse with the shape of the drawing area into a rule drawing command and several new irregular drawing commands according to the maximum inscribed rectangle.
  • the split rule drawing command obtains a number of new rule drawing commands after the intersection detection, and one or more of the new rule drawing commands may be merged in the command combining operation, thereby being able to To some extent, the effect of eliminating excessive drawing is increased.
  • the processor 2002 is specifically configured to: according to the outsourcing rectangle information and the drawing area information, draw a command in the plurality of drawing commands, and the multiple drawing by adopting an R+tree algorithm
  • the first type drawing command and the second type drawing command after the splitting of the irregular drawing command in the command are grouped into a plurality of drawing command sets, so that drawing commands belonging to different drawing command sets do not intersect each other.
  • the computer system 2000 splits the irregular polygon into a plurality of triangles, and then splits each triangle into a maximum inscribed rectangle and three corner regions, and according to the split region, the original The drawing command is split into a plurality of rule drawing commands and a plurality of new irregular drawing commands, and the split rule drawing commands obtain a plurality of new rule drawing commands after the intersection detection, and the plurality of new rule drawing commands are It is possible that one or more of them will be merged in the command merge operation, thereby increasing the effect of eliminating over-drawing to some extent.
  • the computer system 2000 can also perform the method of FIG. 17 and implement the functions of the graphics processing apparatus in the embodiment shown in FIG.
  • FIG. 21 is a schematic structural diagram of a graphic display system 2100 according to an embodiment of the present invention.
  • the graphic display system 2100 can include a graphics processing device 2101 and a graphics display device 2102. among them,
  • the graphics processing device 2101 may be the graphics processing device 1400 shown in the embodiment of FIG.
  • the graphic display device 2102 has a communication connection with the graphic processing device 2101 for displaying a graphic obtained by the graphic processing device executing the merged drawing command.
  • the graphic display system 2100 splits the irregular drawing command in the command queue of the current frame into a rule drawing command and an irregular drawing command according to the drawing area, and draws the command and splits the rule before the splitting.
  • the following rule drawing command and irregular drawing command are grouped into a plurality of mutually dissimilar drawing command sets, and then each drawing command set is respectively subjected to intersection detection and command merging, and the drawing commands are grouped into a plurality of drawing command sets.
  • Intersection detection can greatly reduce the time of intersection detection, and since the original irregular drawing command is split into a rule drawing command and an irregular drawing command, the split rule drawing command obtains several new rule drawing commands after the intersection detection.
  • One or more of the several new rule drawing commands may be merged in the command merge operation, which can increase the effect of eliminating over-drawing to a certain extent, thereby improving the performance of graphics processing.
  • FIG. 22 is a schematic structural diagram of a graphic display system 2200 according to an embodiment of the present invention.
  • the graphic display system 2200 can include a graphics processing device 2201 and a graphics display device 2202. among them,
  • the graphics processing device 2201 may be the graphics processing device 1800 shown in the embodiment of FIG.
  • the graphic display device 2202 has a communication connection with the graphic processing device 2201 for displaying a graphic obtained by the graphic processing device executing the merged drawing command.
  • the graphic display system 2200 passes the command queue of the current frame.
  • the API commands are converted into multiple drawing commands, and the irregular drawing commands of the plurality of drawing commands are divided into the rule drawing command and the irregular drawing command according to the drawing area, and the rules before the splitting are drawn and the commands are split.
  • the rule drawing command and the irregular drawing command are grouped into a plurality of mutually dissimilar drawing command sets, and then each drawing command set is respectively subjected to intersection detection and command merging, and the drawing commands are grouped into a plurality of drawing command sets and then intersected.
  • the detection can greatly reduce the time of intersection detection, and since the original irregular drawing command is split into the rule drawing command and the irregular drawing command, the split rule drawing command obtains several new rule drawing commands after the intersection detection.
  • One or more of the several new rule drawing commands may be merged in the command merging operation, which can increase the effect of eliminating over-drawing to a certain extent, thereby improving the performance of graphics processing.
  • FIG. 23 is a schematic structural diagram of a graphic display system 2300 according to an embodiment of the present invention.
  • graphics display system 2300 can include computer system 2301 and graphics display device 2302. among them,
  • Computer system 2301 can be computer system 1600 shown in the embodiment of FIG.
  • the graphic display device 2302 has a communication connection with the computer system 2301 for displaying a graphic obtained by the computer system executing the merged drawing command.
  • the graphic display system 2300 splits the irregular drawing command in the command queue of the current frame into a rule drawing command and an irregular drawing command according to the drawing area, and draws the command and splits the rule before the splitting.
  • the following rule drawing command and irregular drawing command are grouped into a plurality of mutually dissimilar drawing command sets, and then each drawing command set is respectively subjected to intersection detection and command merging, and the drawing commands are grouped into a plurality of drawing command sets.
  • Intersection detection can greatly reduce the time of intersection detection, and since the original irregular drawing command is split into a rule drawing command and an irregular drawing command, the split rule drawing command obtains several new rule drawing commands after the intersection detection.
  • One or more of the several new rule drawing commands may be merged in the command merge operation, which can increase the effect of eliminating over-drawing to a certain extent, thereby improving the performance of graphics processing.
  • FIG. 24 is a schematic structural diagram of a graphic display system 2400 according to an embodiment of the present invention.
  • graphics display system 2400 can include computer system 2401 and graphics display device 2402. among them,
  • Computer system 2401 may be computer system 2000 as shown in the embodiment of FIG.
  • the graphic display device 2402 has a communication connection with the computer system 2401 for displaying a graphic obtained by the computer system executing the merged drawing command.
  • the graphic display system 2400 converts multiple API commands in the command queue of the current frame into multiple drawing commands, and then presses the irregular drawing commands of the plurality of drawing commands.
  • the drawing area is divided into a rule drawing command and an irregular drawing command, and the rule drawing command before splitting and the split rule drawing command and the irregular drawing command are grouped into a plurality of mutually disjoint drawing command sets, and then Each drawing command set performs intersection detection and command merging separately. Since the drawing commands are grouped into multiple drawing command sets and then intersected detection, the time of intersection detection can be greatly reduced, and the original irregular drawing command is split into rule drawing commands.
  • the split rule drawing command obtains a number of new rule drawing commands after the intersection detection, and one or more of the several new rule drawing commands may be one or more in the command combining operation. Merging can increase the effect of eliminating over-drawing to a certain extent, thereby improving the performance of graphics processing.
  • the disclosed systems, devices, and methods may be implemented in other manners.
  • the device embodiments described above are merely illustrative.
  • the division of the unit is only a logical function division.
  • there may be another division manner for example, multiple units or components may be combined or Can be integrated into another system, or some features can be ignored or not executed.
  • the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, device or unit, and may be in an electrical, mechanical or other form.
  • the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of the embodiment.
  • each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
  • the function is implemented in the form of a software functional unit and sold or made as a standalone product When used, it can be stored in a computer readable storage medium.
  • the technical solution of the present invention which is essential or contributes to the prior art, or a part of the technical solution, may be embodied in the form of a software product, which is stored in a storage medium, including
  • the instructions are used to cause a computer device (which may be a personal computer, server, or network device, etc., specifically, for example, a processor in a computer device) to perform all or part of the steps of the methods described in various embodiments of the present invention.
  • the foregoing storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, and the like. .

Abstract

A graphic processing method, device and system. The method comprises: receiving a command queue inputted by a current frame, the command queue comprising a plurality of drawing commands; splitting, according to bounding rectangle information and drawing area information, each of irregular drawing commands into at least one first type of drawing command and at least one second type of drawing command; classifying, according to the bounding rectangle information and the drawing area information, regular drawing commands in the plurality of drawing commands, and the split first type of drawing command and the second type of drawing command, into a plurality of drawing command sets, such that drawing commands belonging to different drawing command sets are not intersected with each other; performing, according to the bounding rectangle information and the drawing area information, an intersection test on the plurality of drawing command sets; merging, according to an execution content, a drawing mode and the drawing area information, drawing commands of the plurality of drawing command sets undergone the intersection test; and executing the merged drawing command of each of the drawing command sets.

Description

图形处理方法、装置及系统Graphic processing method, device and system
本申请要求于2015年4月2日提交中国专利局、申请号为201510154809.4、发明名称为“图形处理方法、装置及系统”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。The present application claims priority to Chinese Patent Application No. 201510154809.4, entitled "Graphical Processing Method, Apparatus and System", filed on Apr. 2, 2015, the entire contents of .
技术领域Technical field
本发明实施例涉及图像处理领域,并且更具体地,涉及一种图形处理方法、装置及系统。Embodiments of the present invention relate to the field of image processing, and, more particularly, to a graphics processing method, apparatus, and system.
背景技术Background technique
图形引擎是为了方便应用开发,对图形操作进行封装而成的图形库。由系统提供或开发者自行设计。在每次界面发生变化(启动、滑动、跳转、动画等),都需要图形引擎把适合的界面完全绘制出来。图形引擎绘制时,根据像素的多少,需要消耗大量中央处理单元(Central Processing Unit;CPU)、图形处理单元(Graphic Processing Unit)和双倍速率同步动态随机存储器(Double Data Rate、DDR)资源。理想情况下,图形引擎每次绘制的像素数即是屏幕的宽高积,但在发生过度绘制时会超过这个数。过度绘制是指同一个像素反复被绘制的情况。The graphics engine is a graphics library that encapsulates graphics operations for application development. Designed by the system or designed by the developer. Every time the interface changes (start, slide, jump, animation, etc.), the graphics engine needs to completely draw the appropriate interface. When the graphics engine is drawn, a large number of central processing units (CPUs), graphics processing units (Graphic Processing Units), and double rate synchronous dynamic random access memory (Double Data Rate, DDR) resources are consumed depending on the number of pixels. Ideally, the number of pixels that the graphics engine draws at a time is the width and height of the screen, but it exceeds this number when overdraws. Over-drawing refers to the case where the same pixel is repeatedly drawn.
现有的一种消除过度绘制的方法,在绘制时采用相交检测、绘制命令合并的方法,去除过度绘制。An existing method for eliminating over-drawing uses a method of intersection detection and drawing command merging in drawing to remove over-drawing.
但是,现有的消除过度绘制的方法,无法绘制不规则图形,如任意角度旋转的矩形,三角形,椭圆等,同时,相交检测的时间复杂度高,在绘制图形很多的情况下抵消了消除过度绘制的收益。However, the existing method of eliminating over-drawing cannot draw irregular graphics, such as rectangles, triangles, and ellipses rotated at any angle. At the same time, the time complexity of intersection detection is high, and the over-elimination is offset in the case of many graphics. The income drawn.
发明内容Summary of the invention
本发明实施例提供一种图形处理方法、装置及系统,能够在减少相交检测复杂度的同时,一定程度上消除过度绘制。Embodiments of the present invention provide a graphics processing method, apparatus, and system, which can eliminate excessive drawing to some extent while reducing the complexity of intersection detection.
第一方面,提供了一种图形处理方法,该方法包括:接收当前帧输入的命令队列,该命令队列包括多个绘制命令,每个该绘制命令都携带外包矩形信息、执行内容、绘制模式与绘制区域信息,该绘制模式包括覆盖模式、混 合模式或等待模式;根据外包矩形信息与绘制区域信息,将该多个绘制命令中的每一个不规则绘制命令拆分成至少一个第一类绘制命令和至少一个第二类绘制命令,其中,该第一类绘制命令的绘制区域为该不规则绘制命令对应的绘制区域内的矩形,该至少一个第二类绘制命令的绘制区域为该不规则绘制命令对应的绘制区域去掉该至少一个第一类绘制命令的绘制区域后剩余的边角区域,该至少一个第一类绘制命令的绘制模式与该不规则绘制命令的绘制模式相同,该至少一个第二类绘制命令的绘制模式为等待模式;根据外包矩形信息和绘制区域信息,将该多个绘制命令中的规则绘制命令,以及该多个绘制命令中的不规则绘制命令经拆分后的该第一类绘制命令和该第二类绘制命令,分组成多个绘制命令集,使得属于不同绘制命令集的绘制命令互不相交;根据外包矩形信息和绘制区域信息,对该多个绘制命令集分别进行相交检测,使得该多个绘制命令集中每一个绘制命令集内绘制命令互不相交;根据执行内容、绘制模式和绘制区域信息,对经过相交检测的该多个绘制命令集分别进行绘制命令合并;执行每个绘制命令集经合并后的绘制命令。In a first aspect, a graphics processing method is provided, the method comprising: receiving a command queue of a current frame input, the command queue includes a plurality of drawing commands, each of the drawing commands carrying an outsourcing rectangle information, an execution content, a drawing mode, and Draw area information, which includes overlay mode, mixed a mode or a waiting mode; according to the outsourcing rectangle information and the drawing area information, splitting each of the plurality of drawing commands into at least one first drawing command and at least one second drawing command, wherein The drawing area of the first type of drawing command is a rectangle in the drawing area corresponding to the irregular drawing command, and the drawing area of the at least one second type drawing command is the drawing area corresponding to the irregular drawing command, and the at least one first is removed. The drawing area of the at least one first type drawing command is the same as the drawing mode of the irregular drawing command, and the drawing mode of the at least one second type drawing command is a waiting mode; And according to the outsourcing rectangle information and the drawing area information, the rule drawing command of the plurality of drawing commands, and the first type drawing command and the second class drawing after the irregular drawing drawing command of the plurality of drawing commands are split Commands are grouped into multiple drawing command sets so that drawing commands belonging to different drawing command sets do not intersect each other; According to the outsourcing rectangle information and the drawing area information, the intersection of the plurality of drawing command sets is respectively detected, so that the drawing commands in each drawing command set do not intersect each other; according to the execution content, the drawing mode and the drawing area information And respectively drawing the command combination for the plurality of drawing command sets subjected to the intersection detection; performing the combined drawing command of each drawing command set.
结合第一方面,在第一种可能的实现方式中,根据该外包矩形信息与该绘制区域信息,将该多个绘制命令中的每一个不规则绘制命令拆分成至少一个第一类绘制命令和至少一个第二类绘制命令具体实现为:根据该不规则绘制命令的外包矩形信息与绘制区域信息,获取该不规则绘制命令的最大内接矩形信息;利用该不规则绘制命令的外包矩形信息与最大内接矩形信息,将该不规则绘制命令拆分成一个该第一类绘制命令和至少一个该第二类绘制命令,其中,该第一类绘制命令对应的区域为该不规则绘制命令对应的最大内接矩形,该至少一个第二类绘制命令对应的绘制区域为该不规则绘制命令对应的绘制区域除该最大内接矩形外的边角区域。With reference to the first aspect, in a first possible implementation, each of the plurality of drawing commands is split into at least one first type drawing command according to the outsourcing rectangle information and the drawing area information. And the at least one second type drawing command is specifically implemented as: obtaining the maximum inscribed rectangle information of the irregular drawing command according to the outsourcing rectangle information and the drawing area information of the irregular drawing command; and using the outsourcing rectangle information of the irregular drawing command And the maximum inscribed rectangle information, the irregular drawing command is split into a first type drawing command and at least one second type drawing command, wherein the area corresponding to the first type drawing command is the irregular drawing command Corresponding maximum inscribed rectangle, the drawing area corresponding to the at least one second type drawing command is a corner area of the drawing area corresponding to the irregular drawing command except the maximum inscribed rectangle.
结合第一方面,在第二种可能的实现方式中,根据该外包矩形信息与该绘制区域信息,将该多个绘制命令中的每一个不规则绘制命令拆分成至少一个第一类绘制命令和至少一个第二类绘制命令具体实现为:当该不规则绘制命令对应的绘制区域为不规则多边形时,将该不规则多边形的绘制区域切分成多个三角形的绘制区域,并根据该不规则多边形的切分方法将该不规则绘制命令拆分成多个第三类绘制命令,该多个第三类绘制命令与该多个三角形的绘制区域之间是一一对应关系;针对每个第三类绘制命令,根据该第三类 绘制命令的外包矩形信息与绘制区域信息,获取该第三类绘制命令的最大内接矩形信息;利用该第三类绘制命令的外包矩形信息与最大内接矩形信息,将该第三类绘制命令拆分成一个该第一类绘制命令和至少一个该第二类绘制命令,其中,该第一类绘制命令对应的区域为该第三类绘制命令对应的最大内接矩形,该至少一个第二类绘制命令对应的绘制区域为该第三类绘制命令对应的绘制区域除该最大内接矩形外的边角区域。With reference to the first aspect, in a second possible implementation, each of the plurality of drawing commands is split into at least one first type drawing command according to the outsourcing rectangle information and the drawing area information. And the at least one second type drawing command is specifically implemented as: when the drawing area corresponding to the irregular drawing command is an irregular polygon, the drawing area of the irregular polygon is divided into a plurality of triangular drawing areas, and according to the irregularity The segmentation method of the polygon splits the irregular drawing command into a plurality of third class drawing commands, and the plurality of third class drawing commands have a one-to-one correspondence with the drawing regions of the plurality of triangles; Three types of drawing commands, according to the third class The outsourcing rectangle information and the drawing area information of the command are drawn, and the maximum inscribed rectangle information of the third type drawing command is obtained; and the third type drawing command is obtained by using the outsourcing rectangle information and the maximum inscribed rectangle information of the third type drawing command. Splitting into a first type of drawing command and at least one of the second type of drawing commands, wherein the area corresponding to the first type of drawing command is a maximum inscribed rectangle corresponding to the third type drawing command, the at least one second The drawing area corresponding to the class drawing command is a corner area of the drawing area corresponding to the third type drawing command except the maximum inscribed rectangle.
第二方面,提供了一种图形处理方法,该方法包括:接收当前帧输入的命令队列,该命令队列包括多个应用程序编程接口API命令;将该多个API命令转换为多个绘制命令,每个该绘制命令都携带外包矩形信息、执行内容、绘制模式与绘制区域信息,该绘制模式包括覆盖模式、混合模式或等待模式;根据外包矩形信息与绘制区域信息,将该多个绘制命令中的每一个不规则绘制命令拆分成至少一个第一类绘制命令和至少一个第二类绘制命令,其中,该第一类绘制命令的绘制区域为该不规则绘制命令对应的绘制区域内的矩形,该至少一个第二类绘制命令的绘制区域为该不规则绘制命令对应的绘制区域去掉该至少一个第一类绘制命令的绘制区域后剩余的边角区域,该至少一个第一类绘制命令的绘制模式与该不规则绘制命令的绘制模式相同,该至少一个第二类绘制命令的绘制模式为等待模式;根据外包矩形信息和绘制区域信息,将该多个绘制命令中的规则绘制命令,以及该多个绘制命令中的不规则绘制命令经拆分后的该第一类绘制命令和该第二类绘制命令,分组成多个绘制命令集,使得属于不同绘制命令集的绘制命令互不相交;根据外包矩形信息和绘制区域信息,对该多个绘制命令集分别进行相交检测,使得该多个绘制命令集中每一个绘制命令集内绘制命令互不相交;根据执行内容、绘制模式和绘制区域信息,对经过相交检测的该多个绘制命令集分别进行绘制命令合并;执行每个绘制命令集经合并后的绘制命令。In a second aspect, a graphics processing method is provided, the method comprising: receiving a command queue of a current frame input, the command queue including a plurality of application programming interface API commands; converting the plurality of API commands into a plurality of drawing commands, Each of the drawing commands carries the outsourcing rectangle information, the execution content, the drawing mode, and the drawing area information, and the drawing mode includes an overlay mode, a blending mode, or a waiting mode; according to the outsourcing rectangle information and the drawing area information, the plurality of drawing commands are Each of the irregular drawing commands is split into at least one first type drawing command and at least one second type drawing command, wherein the drawing area of the first type drawing command is a rectangle in the drawing area corresponding to the irregular drawing command The drawing area of the at least one second type drawing command is a corner area remaining after the drawing area corresponding to the at least one first type drawing command is removed by the drawing area corresponding to the irregular drawing command, and the at least one first type drawing command is The drawing mode is the same as the drawing mode of the irregular drawing command, the at least one second class The drawing mode of the command is a waiting mode; according to the outsourcing rectangle information and the drawing area information, the rule drawing command of the plurality of drawing commands, and the irregular drawing command of the plurality of drawing commands are split by the first The class drawing command and the second class drawing command are grouped into a plurality of drawing command sets, so that the drawing commands belonging to different drawing command sets do not intersect each other; according to the outsourcing rectangle information and the drawing area information, the plurality of drawing command sets are respectively performed The intersecting detection is such that the drawing commands in each of the plurality of drawing command sets do not intersect each other; and the drawing commands are merged respectively according to the execution content, the drawing mode, and the drawing area information; Perform a merged draw command for each draw command set.
结合第二方面,在第一种可能的实现方式中,根据该外包矩形信息与该绘制区域信息,将该多个绘制命令中的每一个不规则绘制命令拆分成至少一个第一类绘制命令和至少一个第二类绘制命令具体实现为:根据该不规则绘制命令的外包矩形信息与绘制区域信息,获取该不规则绘制命令的最大内接矩形信息;利用该不规则绘制命令的外包矩形信息与最大内接矩形信息,将该不规则绘制命令拆分成一个该第一类绘制命令和至少一个该第二类绘制命令,其中,该第一类绘制命令对应的区域为该不规则绘制命令对应的最大 内接矩形,该至少一个第二类绘制命令对应的绘制区域为该不规则绘制命令对应的绘制区域除该最大内接矩形外的边角区域。With reference to the second aspect, in a first possible implementation, each of the plurality of drawing commands is split into at least one first type drawing command according to the outsourcing rectangle information and the drawing area information. And the at least one second type drawing command is specifically implemented as: obtaining the maximum inscribed rectangle information of the irregular drawing command according to the outsourcing rectangle information and the drawing area information of the irregular drawing command; and using the outsourcing rectangle information of the irregular drawing command And the maximum inscribed rectangle information, the irregular drawing command is split into a first type drawing command and at least one second type drawing command, wherein the area corresponding to the first type drawing command is the irregular drawing command Corresponding maximum An inscribed rectangle, the drawing area corresponding to the at least one second type drawing command is a corner area of the drawing area corresponding to the irregular drawing command except the maximum inscribed rectangle.
结合第二方面,在第二种可能的实现方式中,根据该外包矩形信息与该绘制区域信息,将该多个绘制命令中的每一个不规则绘制命令拆分成至少一个第一类绘制命令和至少一个第二类绘制命令具体实现为:当该不规则绘制命令对应的绘制区域为不规则多边形时,将该不规则多边形的绘制区域切分成多个三角形的绘制区域,并根据该不规则多边形的切分方法将该不规则绘制命令拆分成多个第三类绘制命令,每一个该第三类绘制命令对应的绘制区域为该多个三角形的绘制区域之一;针对每个第三类绘制命令,根据该第三类绘制命令的外包矩形信息与绘制区域信息,获取该第三类绘制命令的最大内接矩形信息;利用该第三类绘制命令的外包矩形信息与最大内接矩形信息,将该第三类绘制命令拆分成一个该第一类绘制命令和至少一个该第二类绘制命令,其中,该第一类绘制命令对应的区域为该第三类绘制命令对应的最大内接矩形,该至少一个第二类绘制命令对应的绘制区域为该第三类绘制命令对应的绘制区域除该最大内接矩形外的边角区域。With reference to the second aspect, in a second possible implementation, each of the plurality of drawing commands is split into at least one first type drawing command according to the outsourcing rectangle information and the drawing area information. And the at least one second type drawing command is specifically implemented as: when the drawing area corresponding to the irregular drawing command is an irregular polygon, the drawing area of the irregular polygon is divided into a plurality of triangular drawing areas, and according to the irregularity The polygon segmentation method splits the irregular drawing command into a plurality of third class drawing commands, and each of the drawing classes corresponding to the third class drawing command is one of the drawing regions of the plurality of triangles; for each third The class drawing command obtains the maximum inscribed rectangle information of the third type drawing command according to the outsourcing rectangle information and the drawing area information of the third class drawing command; and the outsourcing rectangle information and the maximum inscribed rectangle by using the third class drawing command Information, splitting the third type of drawing command into one first type drawing command and at least one second type drawing command, The area corresponding to the first type of drawing command is a maximum inscribed rectangle corresponding to the third type drawing command, and the drawing area corresponding to the at least one second type drawing command is the drawing area corresponding to the third type drawing command except the maximum The corner area outside the rectangle is inscribed.
第三方面,提供了一种图形处理装置,该图形处理装置包括:命令收集模块,用于接收当前帧输入的命令队列,该命令队列包括多个绘制命令,每个该绘制命令都携带外包矩形信息、执行内容、绘制模式与绘制区域信息,该绘制模式包括覆盖模式、混合模式或等待模式;命令拆分模块,用于根据外包矩形信息与绘制区域信息,将该多个绘制命令中的每一个不规则绘制命令拆分成至少一个第一类绘制命令和至少一个第二类绘制命令,其中,该第一类绘制命令的绘制区域为该不规则绘制命令对应的绘制区域内的矩形,该至少一个第二类绘制命令的绘制区域为该不规则绘制命令对应的绘制区域去掉该至少一个第一类绘制命令的绘制区域后剩余的边角区域,该至少一个第一类绘制命令的绘制模式与该不规则绘制命令的绘制模式相同,该至少一个第二类绘制命令的绘制模式为等待模式;命令分组模块,用于根据外包矩形信息和绘制区域信息,将该多个绘制命令中的规则绘制命令,以及该多个绘制命令中的不规则绘制命令经拆分后的该第一类绘制命令和该第二类绘制命令,分组成多个绘制命令集,使得属于不同绘制命令集的绘制命令互不相交;相交检测模块,用于根据外包矩形信息和绘制区域信息,对该多个绘制命令集分别进行相交检测,使得该多个绘制命令集中每一个绘制命令集内 绘制命令互不相交;命令合并模块,用于根据执行内容、绘制模式和绘制区域信息,对经过相交检测的该多个绘制命令集分别进行绘制命令合并;执行模块,用于执行每个绘制命令集经合并后的绘制命令。In a third aspect, a graphics processing apparatus is provided, the graphics processing apparatus comprising: a command collection module, configured to receive a command queue of a current frame input, the command queue includes a plurality of drawing commands, each of the drawing commands carrying an outer rectangle Information, execution content, drawing mode, and drawing area information, the drawing mode includes an overlay mode, a mixed mode, or a wait mode; a command splitting module for each of the plurality of drawing commands according to the outsourcing rectangle information and the drawing area information An irregular drawing command is split into at least one first drawing command and at least one second drawing command, wherein a drawing area of the first drawing command is a rectangle in a drawing area corresponding to the irregular drawing command, The drawing area of the at least one second type drawing command is a drawing area corresponding to the drawing area corresponding to the irregular drawing command, and the remaining corner area after the drawing area of the at least one first type drawing command is removed, and the drawing mode of the at least one first type drawing command Same as the drawing mode of the irregular drawing command, the at least one second type drawing The drawing mode of the command is a waiting mode; the command grouping module is configured to split the rule drawing command of the plurality of drawing commands and the irregular drawing command of the plurality of drawing commands according to the outsourcing rectangle information and the drawing area information The first type drawing command and the second type drawing command are grouped into a plurality of drawing command sets, so that the drawing commands belonging to different drawing command sets do not intersect each other; the intersection detecting module is configured to use the outsourcing rectangle information and the drawing area Information, respectively performing intersection detection on the plurality of drawing command sets, so that the plurality of drawing commands are collectively in each drawing command set The drawing commands do not intersect each other; the command merging module is configured to respectively perform drawing command merging on the plurality of drawing command sets subjected to intersection detection according to the execution content, the drawing mode, and the drawing area information; and the executing module is configured to execute each drawing command Set the merged draw command.
结合第三方面,在第一种可能的实现方式中,该命令拆分模块具体用于:根据该不规则绘制命令的外包矩形信息与绘制区域信息,获取该不规则绘制命令的最大内接矩形信息;利用该不规则绘制命令的外包矩形信息与最大内接矩形信息,将该不规则绘制命令拆分成一个该第一类绘制命令和至少一个该第二类绘制命令,其中,该第一类绘制命令对应的区域为该不规则绘制命令对应的最大内接矩形,该至少一个第二类绘制命令对应的绘制区域为该不规则绘制命令对应的绘制区域除该最大内接矩形外的边角区域。With reference to the third aspect, in a first possible implementation manner, the command splitting module is specifically configured to: obtain an outer bounding rectangle of the irregular drawing command according to the outsourcing rectangle information and the drawing area information of the irregular drawing command Information; using the outsourcing rectangle information and the maximum inscribed rectangle information of the irregular drawing command, splitting the irregular drawing command into one first type drawing command and at least one second type drawing command, wherein the first The area corresponding to the class drawing command is the largest inscribed rectangle corresponding to the irregular drawing command, and the drawing area corresponding to the at least one second type drawing command is the drawing area corresponding to the irregular drawing command except the largest inscribed rectangle Corner area.
结合第三方面,在第二种可能的实现方式中,该命令拆分模块具体用于:当该不规则绘制命令对应的绘制区域为不规则多边形时,将该不规则多边形的绘制区域切分成多个三角形的绘制区域,并根据该不规则多边形的切分方法将该不规则绘制命令拆分成多个第三类绘制命令,该多个第三类绘制命令与该多个三角形的绘制区域之间是一一对应关系;针对每个第三类绘制命令,根据该第三类绘制命令的外包矩形信息与绘制区域信息,获取该第三类绘制命令的最大内接矩形信息;利用该第三类绘制命令的外包矩形信息与最大内接矩形信息,将该第三类绘制命令拆分成一个该第一类绘制命令和至少一个该第二类绘制命令,其中,该第一类绘制命令对应的区域为该第三类绘制命令对应的最大内接矩形,该至少一个第二类绘制命令对应的绘制区域为该第三类绘制命令对应的绘制区域除该最大内接矩形外的边角区域。With reference to the third aspect, in a second possible implementation, the command splitting module is specifically configured to: when the drawing area corresponding to the irregular drawing command is an irregular polygon, the drawing area of the irregular polygon is divided into a drawing area of the plurality of triangles, and splitting the irregular drawing command into a plurality of third type drawing commands according to the segmentation method of the irregular polygon, the plurality of third type drawing commands and the drawing area of the plurality of triangles a one-to-one correspondence relationship; for each third type drawing command, obtaining the maximum inscribed rectangle information of the third type drawing command according to the outsourcing rectangle information and drawing area information of the third type drawing command; The outsourcing rectangle information of the three types of drawing commands and the maximum inscribed rectangle information, the third type drawing command is split into a first class drawing command and at least one second class drawing command, wherein the first class drawing command The corresponding area is a maximum inscribed rectangle corresponding to the third type drawing command, and the drawing area corresponding to the at least one second type drawing command is the third type drawing Drawing command corresponding to the region except the corner region of the largest inscribed rectangle.
第四方面,提供了一种图形处理装置,该图形处理装置包括:命令收集模块,用于接收当前帧输入的命令队列,该命令队列包括多个应用程序编程接口API命令;命令转换模块,用于将该多个API命令转换为多个绘制命令,每个该绘制命令都携带外包矩形信息、执行内容、绘制模式与绘制区域信息,该绘制模式包括覆盖模式、混合模式或等待模式;命令拆分模块,用于根据外包矩形信息与绘制区域信息,将该多个绘制命令中的每一个不规则绘制命令拆分成至少一个第一类绘制命令和至少一个第二类绘制命令,其中,该第一类绘制命令的绘制区域为该不规则绘制命令对应的绘制区域内的矩形,该至少一个第二类绘制命令的绘制区域为该不规则绘制命令对应的绘制区域去掉该至少一个第一类绘制命令的绘制区域后剩余的边角区域,该至少一个 第一类绘制命令的绘制模式与该不规则绘制命令的绘制模式相同,该至少一个第二类绘制命令的绘制模式为等待模式;命令分组模块,用于根据外包矩形信息和绘制区域信息,将该多个绘制命令中的规则绘制命令,以及该多个绘制命令中的不规则绘制命令经拆分后的该第一类绘制命令和该第二类绘制命令,分组成多个绘制命令集,使得属于不同绘制命令集的绘制命令互不相交;相交检测模块,用于根据外包矩形信息和绘制区域信息,对该多个绘制命令集分别进行相交检测,使得该多个绘制命令集中每一个绘制命令集内绘制命令互不相交;命令合并模块,用于根据执行内容、绘制模式和绘制区域信息,对经过相交检测的该多个绘制命令集分别进行绘制命令合并;执行模块,用于执行每个绘制命令集经合并后的绘制命令。In a fourth aspect, a graphics processing apparatus is provided, the graphics processing apparatus comprising: a command collection module, configured to receive a command queue of a current frame input, the command queue includes a plurality of application programming interface API commands; and a command conversion module Converting the plurality of API commands into a plurality of drawing commands, each of the drawing commands carrying outsourcing rectangle information, execution content, drawing mode, and drawing area information, the drawing mode including an overlay mode, a mixed mode, or a waiting mode; a sub-module, configured to split each of the plurality of drawing commands into at least one first-type drawing command and at least one second-type drawing command according to the outsourcing rectangle information and the drawing area information, where The drawing area of the first type of drawing command is a rectangle in the drawing area corresponding to the irregular drawing command, and the drawing area of the at least one second type drawing command is the drawing area corresponding to the irregular drawing command, and the at least one first class is removed. The remaining corner area after drawing the drawing area of the command, the at least one The drawing mode of the first type drawing command is the same as the drawing mode of the irregular drawing command, the drawing mode of the at least one second type drawing command is a waiting mode; the command grouping module is configured to use the outsourcing rectangle information and the drawing area information, The rule drawing command of the plurality of drawing commands, and the first type drawing command and the second type drawing command after the split drawing command of the plurality of drawing commands are grouped into a plurality of drawing command sets, The drawing commands belonging to different drawing command sets are mutually disjoint; the intersection detecting module is configured to perform intersection detection on the plurality of drawing command sets according to the outsourcing rectangle information and the drawing area information, so that each of the plurality of drawing command sets is drawn The command in the command set does not intersect with each other; the command merge module is configured to respectively perform drawing command combining on the plurality of drawing command sets subjected to intersection detection according to the execution content, the drawing mode, and the drawing area information; and the executing module is configured to execute each The drawing command set is a combined drawing command.
结合第四方面,在第一种可能的实现方式中,该命令拆分模块具体用于:根据该不规则绘制命令的外包矩形信息与绘制区域信息,获取该不规则绘制命令的最大内接矩形信息;利用该不规则绘制命令的外包矩形信息与最大内接矩形信息,将该不规则绘制命令拆分成一个该第一类绘制命令和至少一个该第二类绘制命令,其中,该第一类绘制命令对应的区域为该不规则绘制命令对应的最大内接矩形,该至少一个第二类绘制命令对应的绘制区域为该不规则绘制命令对应的绘制区域除该最大内接矩形外的边角区域。With reference to the fourth aspect, in a first possible implementation manner, the command splitting module is configured to: obtain an outer bounding rectangle of the irregular drawing command according to the outsourcing rectangle information and the drawing area information of the irregular drawing command Information; using the outsourcing rectangle information and the maximum inscribed rectangle information of the irregular drawing command, splitting the irregular drawing command into one first type drawing command and at least one second type drawing command, wherein the first The area corresponding to the class drawing command is the largest inscribed rectangle corresponding to the irregular drawing command, and the drawing area corresponding to the at least one second type drawing command is the drawing area corresponding to the irregular drawing command except the largest inscribed rectangle Corner area.
结合第四方面,在第二种可能的实现方式中,该命令拆分模块具体用于:当该不规则绘制命令对应的绘制区域为不规则多边形时,将该不规则多边形的绘制区域切分成多个三角形的绘制区域,并根据该不规则多边形的切分方法将该不规则绘制命令拆分成多个第三类绘制命令,该多个第三类绘制命令与该多个三角形的绘制区域之间是一一对应关系;针对每个第三类绘制命令,根据该第三类绘制命令的外包矩形信息与绘制区域信息,获取该第三类绘制命令的最大内接矩形信息;利用该第三类绘制命令的外包矩形信息与最大内接矩形信息,将该第三类绘制命令拆分成一个该第一类绘制命令和至少一个该第二类绘制命令,其中,该第一类绘制命令对应的区域为该第三类绘制命令对应的最大内接矩形,该至少一个第二类绘制命令对应的绘制区域为该第三类绘制命令对应的绘制区域除该最大内接矩形外的边角区域。With reference to the fourth aspect, in a second possible implementation, the command splitting module is specifically configured to: when the drawing area corresponding to the irregular drawing command is an irregular polygon, the drawing area of the irregular polygon is divided into a drawing area of the plurality of triangles, and splitting the irregular drawing command into a plurality of third type drawing commands according to the segmentation method of the irregular polygon, the plurality of third type drawing commands and the drawing area of the plurality of triangles a one-to-one correspondence relationship; for each third type drawing command, obtaining the maximum inscribed rectangle information of the third type drawing command according to the outsourcing rectangle information and drawing area information of the third type drawing command; The outsourcing rectangle information of the three types of drawing commands and the maximum inscribed rectangle information, the third type drawing command is split into a first class drawing command and at least one second class drawing command, wherein the first class drawing command The corresponding area is a maximum inscribed rectangle corresponding to the third type drawing command, and the drawing area corresponding to the at least one second type drawing command is the third type drawing Drawing command corresponding to the region except the corner region of the largest inscribed rectangle.
第五方面,提出了一种计算机系统,该计算机系统包括处理器和存储器;In a fifth aspect, a computer system is provided, the computer system comprising a processor and a memory;
该存储器用于存放程序;This memory is used to store the program;
该处理器用于执行存储器所存放的程序,并具体用于执行以下操作: The processor is used to execute a program stored in the memory, and is specifically used to perform the following operations:
接收当前帧输入的命令队列,该命令队列包括多个绘制命令,每个该绘制命令都携带外包矩形信息、执行内容、绘制模式与绘制区域信息,该绘制模式包括覆盖模式、混合模式或等待模式;Receiving a command queue of a current frame input, the command queue includes a plurality of drawing commands, each of which carries an outsourcing rectangle information, an execution content, a drawing mode, and a drawing area information, and the drawing mode includes an overlay mode, a mixed mode, or a standby mode. ;
根据外包矩形信息与绘制区域信息,将该多个绘制命令中的每一个不规则绘制命令拆分成至少一个第一类绘制命令和至少一个第二类绘制命令,其中,该第一类绘制命令的绘制区域为该不规则绘制命令对应的绘制区域内的矩形,该至少一个第二类绘制命令的绘制区域为该不规则绘制命令对应的绘制区域去掉该至少一个第一类绘制命令的绘制区域后剩余的边角区域,该至少一个第一类绘制命令的绘制模式与该不规则绘制命令的绘制模式相同,该至少一个第二类绘制命令的绘制模式为等待模式;Decoding, according to the outsourcing rectangle information and the drawing area information, each of the plurality of drawing commands into at least one first class drawing command and at least one second class drawing command, wherein the first class drawing command The drawing area is a rectangle in the drawing area corresponding to the irregular drawing command, and the drawing area of the at least one second type drawing command is a drawing area corresponding to the irregular drawing command, and the drawing area of the at least one first type drawing command is removed. a remaining corner area, a drawing mode of the at least one first type drawing command is the same as a drawing mode of the irregular drawing command, and a drawing mode of the at least one second type drawing command is a waiting mode;
根据外包矩形信息和绘制区域信息,将该多个绘制命令中的规则绘制命令,以及该多个绘制命令中的不规则绘制命令经拆分后的该第一类绘制命令和该第二类绘制命令,分组成多个绘制命令集,使得属于不同绘制命令集的绘制命令互不相交;And according to the outsourcing rectangle information and the drawing area information, the rule drawing command of the plurality of drawing commands, and the first type drawing command and the second class drawing after the irregular drawing drawing command of the plurality of drawing commands are split Commands are grouped into multiple drawing command sets so that drawing commands belonging to different drawing command sets do not intersect each other;
根据外包矩形信息和绘制区域信息,对该多个绘制命令集分别进行相交检测,使得该多个绘制命令集中每一个绘制命令集内绘制命令互不相交;Performing intersection detection on the plurality of drawing command sets according to the outsourcing rectangle information and the drawing area information, so that the drawing commands in each drawing command set in the plurality of drawing command sets do not intersect each other;
根据执行内容、绘制模式和绘制区域信息,对经过相交检测的该多个绘制命令集分别进行绘制命令合并;Performing drawing command combining on the plurality of drawing command sets subjected to intersection detection according to the execution content, the drawing mode, and the drawing area information;
执行每个绘制命令集经合并后的绘制命令。Perform a merged draw command for each draw command set.
结合第五方面,在第一种可能的实现方式中,在用于根据外包矩形信息与绘制区域信息,将该多个绘制命令中的每一个不规则绘制命令拆分成至少一个第一类绘制命令和至少一个第二类绘制命令的过程中,处理器具体用于:根据该不规则绘制命令的外包矩形信息与绘制区域信息,获取该不规则绘制命令的最大内接矩形信息;利用该不规则绘制命令的外包矩形信息与最大内接矩形信息,将该不规则绘制命令拆分成一个该第一类绘制命令和至少一个该第二类绘制命令,其中,该第一类绘制命令对应的区域为该不规则绘制命令对应的最大内接矩形,该至少一个第二类绘制命令对应的绘制区域为该不规则绘制命令对应的绘制区域除该最大内接矩形外的边角区域。With reference to the fifth aspect, in a first possible implementation, the method is configured to split each of the plurality of drawing commands into at least one first class drawing according to the outsourcing rectangle information and the drawing area information. In the process of the command and the at least one second type of drawing command, the processor is specifically configured to: obtain the maximum inscribed rectangle information of the irregular drawing command according to the outsourcing rectangle information and the drawing area information of the irregular drawing command; The outsourcing rectangle information of the rule drawing command and the maximum inscribed rectangle information, the irregular drawing command is split into a first class drawing command and at least one second class drawing command, wherein the first class drawing command corresponds to The area is a maximum inscribed rectangle corresponding to the irregular drawing command, and the drawing area corresponding to the at least one second type drawing command is a corner area of the drawing area corresponding to the irregular drawing command except the maximum inscribed rectangle.
结合第五方面,在第二种可能的实现方式中,在用于根据外包矩形信息与绘制区域信息,将该多个绘制命令中的每一个不规则绘制命令拆分成至少一个第一类绘制命令和至少一个第二类绘制命令的过程中,处理器具体用于: 当该不规则绘制命令对应的绘制区域为不规则多边形时,将该不规则多边形的绘制区域切分成多个三角形的绘制区域,并根据该不规则多边形的切分方法将该不规则绘制命令拆分成多个第三类绘制命令,该多个第三类绘制命令与该多个三角形的绘制区域之间是一一对应关系;针对每个第三类绘制命令,根据该第三类绘制命令的外包矩形信息与绘制区域信息,获取该第三类绘制命令的最大内接矩形信息;利用该第三类绘制命令的外包矩形信息与最大内接矩形信息,将该第三类绘制命令拆分成一个该第一类绘制命令和至少一个该第二类绘制命令,其中,该第一类绘制命令对应的区域为该第三类绘制命令对应的最大内接矩形,该至少一个第二类绘制命令对应的绘制区域为该第三类绘制命令对应的绘制区域除该最大内接矩形外的边角区域。With reference to the fifth aspect, in a second possible implementation, in the method for splitting each of the plurality of drawing commands into at least one first class drawing according to the outsourcing rectangle information and the drawing area information In the process of commanding and at least one second type of drawing command, the processor is specifically used to: When the drawing area corresponding to the irregular drawing command is an irregular polygon, the drawing area of the irregular polygon is divided into a drawing area of a plurality of triangles, and the irregular drawing command is split according to the segmentation method of the irregular polygon. Dividing into a plurality of third class drawing commands, the plurality of third class drawing commands and the drawing regions of the plurality of triangles have a one-to-one correspondence relationship; for each third class drawing command, drawing commands according to the third class The outer rectangle information and the drawing area information are obtained, and the maximum inscribed rectangle information of the third type drawing command is obtained; and the third type drawing command is split by using the outsourcing rectangle information and the maximum inscribed rectangle information of the third type drawing command. The first type drawing command and the at least one second type drawing command, wherein the area corresponding to the first type drawing command is a maximum inscribed rectangle corresponding to the third type drawing command, and the at least one second type drawing The drawing area corresponding to the command is a corner area of the drawing area corresponding to the third type drawing command except the maximum inscribed rectangle.
第六方面,提出了一种计算机系统,该计算机系统包括处理器和存储器;In a sixth aspect, a computer system is provided, the computer system comprising a processor and a memory;
该存储器用于存放程序;This memory is used to store the program;
该处理器用于执行存储器所存放的程序,并具体用于执行以下操作:The processor is used to execute a program stored in the memory, and is specifically used to perform the following operations:
接收当前帧输入的命令队列,该命令队列包括多个应用程序编程接口API命令;Receiving a command queue of a current frame input, the command queue including a plurality of application programming interface API commands;
将该多个API命令转换为多个绘制命令,每个该绘制命令都携带外包矩形信息、执行内容、绘制模式与绘制区域信息,该绘制模式包括覆盖模式、混合模式或等待模式;Converting the plurality of API commands into a plurality of drawing commands, each of the drawing commands carrying outsourcing rectangle information, execution content, drawing mode, and drawing area information, the drawing mode including an overlay mode, a mixed mode, or a waiting mode;
根据外包矩形信息与绘制区域信息,将该多个绘制命令中的每一个不规则绘制命令拆分成至少一个第一类绘制命令和至少一个第二类绘制命令,其中,该第一类绘制命令的绘制区域为该不规则绘制命令对应的绘制区域内的矩形,该至少一个第二类绘制命令的绘制区域为该不规则绘制命令对应的绘制区域去掉该至少一个第一类绘制命令的绘制区域后剩余的边角区域,该至少一个第一类绘制命令的绘制模式与该不规则绘制命令的绘制模式相同,该至少一个第二类绘制命令的绘制模式为等待模式;Decoding, according to the outsourcing rectangle information and the drawing area information, each of the plurality of drawing commands into at least one first class drawing command and at least one second class drawing command, wherein the first class drawing command The drawing area is a rectangle in the drawing area corresponding to the irregular drawing command, and the drawing area of the at least one second type drawing command is a drawing area corresponding to the irregular drawing command, and the drawing area of the at least one first type drawing command is removed. a remaining corner area, a drawing mode of the at least one first type drawing command is the same as a drawing mode of the irregular drawing command, and a drawing mode of the at least one second type drawing command is a waiting mode;
根据外包矩形信息和绘制区域信息,将该多个绘制命令中的规则绘制命令,以及该多个绘制命令中的不规则绘制命令经拆分后的该第一类绘制命令和该第二类绘制命令,分组成多个绘制命令集,使得属于不同绘制命令集的绘制命令互不相交;And according to the outsourcing rectangle information and the drawing area information, the rule drawing command of the plurality of drawing commands, and the first type drawing command and the second class drawing after the irregular drawing drawing command of the plurality of drawing commands are split Commands are grouped into multiple drawing command sets so that drawing commands belonging to different drawing command sets do not intersect each other;
根据外包矩形信息和绘制区域信息,对该多个绘制命令集分别进行相交检测,使得该多个绘制命令集中每一个绘制命令集内绘制命令互不相交; Performing intersection detection on the plurality of drawing command sets according to the outsourcing rectangle information and the drawing area information, so that the drawing commands in each drawing command set in the plurality of drawing command sets do not intersect each other;
根据执行内容、绘制模式和绘制区域信息,对经过相交检测的该多个绘制命令集分别进行绘制命令合并;Performing drawing command combining on the plurality of drawing command sets subjected to intersection detection according to the execution content, the drawing mode, and the drawing area information;
执行每个绘制命令集经合并后的绘制命令。Perform a merged draw command for each draw command set.
结合第六方面,在第一种可能的实现方式中,在用于根据外包矩形信息与绘制区域信息,将该多个绘制命令中的每一个不规则绘制命令拆分成至少一个第一类绘制命令和至少一个第二类绘制命令的过程中,处理器具体用于:根据该不规则绘制命令的外包矩形信息与绘制区域信息,获取该不规则绘制命令的最大内接矩形信息;利用该不规则绘制命令的外包矩形信息与最大内接矩形信息,将该不规则绘制命令拆分成一个该第一类绘制命令和至少一个该第二类绘制命令,其中,该第一类绘制命令对应的区域为该不规则绘制命令对应的最大内接矩形,该至少一个第二类绘制命令对应的绘制区域为该不规则绘制命令对应的绘制区域除该最大内接矩形外的边角区域。With reference to the sixth aspect, in a first possible implementation, the method is configured to split each of the plurality of drawing commands into at least one first class drawing according to the outsourcing rectangle information and the drawing area information. In the process of the command and the at least one second type of drawing command, the processor is specifically configured to: obtain the maximum inscribed rectangle information of the irregular drawing command according to the outsourcing rectangle information and the drawing area information of the irregular drawing command; The outsourcing rectangle information of the rule drawing command and the maximum inscribed rectangle information, the irregular drawing command is split into a first class drawing command and at least one second class drawing command, wherein the first class drawing command corresponds to The area is a maximum inscribed rectangle corresponding to the irregular drawing command, and the drawing area corresponding to the at least one second type drawing command is a corner area of the drawing area corresponding to the irregular drawing command except the maximum inscribed rectangle.
结合第六方面,在第二种可能的实现方式中,在用于根据外包矩形信息与绘制区域信息,将该多个绘制命令中的每一个不规则绘制命令拆分成至少一个第一类绘制命令和至少一个第二类绘制命令的过程中,处理器具体用于:当该不规则绘制命令对应的绘制区域为不规则多边形时,将该不规则多边形的绘制区域切分成多个三角形的绘制区域,并根据该不规则多边形的切分方法将该不规则绘制命令拆分成多个第三类绘制命令,该多个第三类绘制命令与该多个三角形的绘制区域之间是一一对应关系;针对每个第三类绘制命令,根据该第三类绘制命令的外包矩形信息与绘制区域信息,获取该第三类绘制命令的最大内接矩形信息;利用该第三类绘制命令的外包矩形信息与最大内接矩形信息,将该第三类绘制命令拆分成一个该第一类绘制命令和至少一个该第二类绘制命令,其中,该第一类绘制命令对应的区域为该第三类绘制命令对应的最大内接矩形,该至少一个第二类绘制命令对应的绘制区域为该第三类绘制命令对应的绘制区域除该最大内接矩形外的边角区域。With reference to the sixth aspect, in a second possible implementation, in the method for splitting each of the plurality of drawing commands according to the outsourcing rectangle information and the drawing area information into at least one first class drawing In the process of the command and the at least one second type of drawing command, the processor is specifically configured to: when the drawing area corresponding to the irregular drawing command is an irregular polygon, the drawing area of the irregular polygon is divided into multiple triangles. a region, and splitting the irregular drawing command into a plurality of third class drawing commands according to the segmentation method of the irregular polygon, wherein the plurality of third class drawing commands and the drawing regions of the plurality of triangles are one by one Corresponding relationship; for each third type drawing command, obtaining the maximum inscribed rectangle information of the third type drawing command according to the outsourcing rectangle information and drawing area information of the third type drawing command; using the third type drawing command Outsourcing rectangle information and maximum inscribed rectangle information, splitting the third type drawing command into one first type drawing command and at least one second a drawing command, wherein the area corresponding to the first type of drawing command is a maximum inscribed rectangle corresponding to the third type drawing command, and the drawing area corresponding to the at least one second type drawing command is a drawing corresponding to the third type drawing command The area except the maximum inscribed rectangle.
第七方面,提出了一种图形显示系统,该图形显示系统包括:In a seventh aspect, a graphic display system is provided, the graphic display system comprising:
如第三方面或第三方面的第一种可能的实现方式或第三方面的第二种可能的实现方式的图形处理装置;以及a graphics processing apparatus according to the third aspect or the first possible implementation of the third aspect or the second possible implementation of the third aspect;
图形显示装置,与该图形处理装置具有通信连接,用于显示该图形处理装置执行完经合并后的绘制命令所得到的图形。The graphic display device has a communication connection with the graphic processing device for displaying a graphic obtained by the graphic processing device executing the merged drawing command.
第八方面,提出了一种图形显示系统,该图形显示系统包括: In an eighth aspect, a graphic display system is provided, the graphic display system comprising:
如第四方面或第四方面的第一种可能的实现方式或第四方面的第二种可能的实现方式的图形处理装置;以及a graphics processing apparatus according to the fourth aspect or the first possible implementation of the fourth aspect or the second possible implementation of the fourth aspect;
图形显示装置,与该图形处理装置具有通信连接,用于显示该图形处理装置执行完经合并后的绘制命令所得到的图形。The graphic display device has a communication connection with the graphic processing device for displaying a graphic obtained by the graphic processing device executing the merged drawing command.
一方面,本发明实施例的图形处理方法、装置及系统,将当前帧的命令队列中的不规则绘制命令按绘制区域拆分成规则绘制命令和不规则绘制命令,并将拆分前的规则绘制命令及拆分后的规则绘制命令和不规则绘制命令分组为多个互不相交的绘制命令集,再对每个绘制命令集分别进行相交检测和命令合并,由于将绘制命令分组成多个绘制命令集再进行相交检测能够大大减少相交检测的时间,并且由于将原始不规则绘制命令拆分成规则绘制命令和不规则绘制命令,拆分后的规则绘制命令在经过相交检测后得到若干个新的规则绘制命令,该若干个新的规则绘制命令中有可能会有一个或多个在命令合并操作中被合并,能够在一定程度上增加消除过度绘制的效果,从而能够提高图形处理的性能。In one aspect, the graphics processing method, apparatus, and system of the embodiment of the present invention split the irregular drawing command in the command queue of the current frame into a rule drawing command and an irregular drawing command according to the drawing area, and divide the pre-split rule. The drawing command and the split rule drawing command and the irregular drawing command are grouped into a plurality of mutually disjoint drawing command sets, and then each drawing command set is respectively subjected to intersection detection and command merging, since the drawing commands are grouped into multiple Drawing the command set and then performing the intersection detection can greatly reduce the time of the intersection detection, and since the original irregular drawing command is split into the rule drawing command and the irregular drawing command, the split rule drawing command obtains several after the intersection detection. A new rule drawing command, one or more of the several new rule drawing commands may be merged in the command merge operation, which can increase the effect of eliminating over-drawing to a certain extent, thereby improving the performance of graphics processing. .
另一方面,本发明实施例的图形处理方法、装置及系统,通过将当前帧的命令队列中的多个API命令转换为多个绘制命令,再将多个绘制命令中的不规则绘制命令按绘制区域拆分成规则绘制命令和不规则绘制命令,并将拆分前的规则绘制命令及拆分后的规则绘制命令和不规则绘制命令分组为多个互不相交的绘制命令集,再对每个绘制命令集分别进行相交检测和命令合并,由于将绘制命令分组成多个绘制命令集再进行相交检测能够大大减少相交检测的时间,并且由于将原始不规则绘制命令拆分成规则绘制命令和不规则绘制命令,拆分后的规则绘制命令在经过相交检测后得到若干个新的规则绘制命令,该若干个新的规则绘制命令中有可能会有一个或多个在命令合并操作中被合并,能够在一定程度上增加消除过度绘制的效果,从而能够提高图形处理的性能。On the other hand, the graphics processing method, apparatus, and system of the embodiment of the present invention convert a plurality of API commands in a command queue of a current frame into a plurality of drawing commands, and then press the irregular drawing commands of the plurality of drawing commands. The drawing area is divided into a rule drawing command and an irregular drawing command, and the rule drawing command before splitting and the split rule drawing command and the irregular drawing command are grouped into a plurality of mutually disjoint drawing command sets, and then Each drawing command set performs intersection detection and command merging separately. Since the drawing commands are grouped into multiple drawing command sets and then intersected detection, the time of intersection detection can be greatly reduced, and the original irregular drawing command is split into rule drawing commands. And the irregular drawing command, the split rule drawing command obtains a number of new rule drawing commands after the intersection detection, and one or more of the several new rule drawing commands may be one or more in the command combining operation. Merging, can increase the effect of eliminating over-drawing to a certain extent, thereby improving the performance of graphics processing
附图说明DRAWINGS
为了更清楚地说明本发明实施例的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其它的附图。 In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the embodiments or the prior art description will be briefly described below. Obviously, the drawings in the following description are only some of the present invention. For the embodiments, those skilled in the art can obtain other drawings according to the drawings without any creative work.
图1是一种终端设备的逻辑架构示意图。FIG. 1 is a schematic diagram of a logical architecture of a terminal device.
图2是本发明实施例相交检测的方法示意图。2 is a schematic diagram of a method of intersection detection according to an embodiment of the present invention.
图3是本发明实施例的发明原理示意图。Figure 3 is a schematic illustration of the principles of the invention in accordance with an embodiment of the present invention.
图4是本发明实施例一种图形处理方法的流程示意图。4 is a schematic flow chart of a graphics processing method according to an embodiment of the present invention.
图5是本发明实施例命令拆分的方法的流程示意图。FIG. 5 is a schematic flowchart of a method for command splitting according to an embodiment of the present invention.
图6是任意角度旋转的矩形中求取最大内接矩形的示意图。Fig. 6 is a schematic view showing the maximum inscribed rectangle in a rectangle rotated at an arbitrary angle.
图7是椭圆中求取最大内接矩形的示意图。Figure 7 is a schematic illustration of the largest inscribed rectangle in the ellipse.
图8是三角形中求取最大内接矩形的示意图。Figure 8 is a schematic illustration of the largest inscribed rectangle in the triangle.
图9是本发明实施例显示空间的绘制命令对应的绘制区域示意图。FIG. 9 is a schematic diagram of a drawing area corresponding to a drawing command of a display space according to an embodiment of the present invention.
图10是本发明实施例显示空间采用R+树算法进行一次划分后的绘制区域示意图。FIG. 10 is a schematic diagram of a drawing area after the display space is divided by the R+tree algorithm according to an embodiment of the present invention.
图11是本发明实施例显示空间采用R+树算法进行二次划分后的绘制区域示意图。FIG. 11 is a schematic diagram of a drawing area after a secondary partitioning of a display space by using an R+tree algorithm according to an embodiment of the present invention.
图12是本发明实施例的R+树的节点示意图。FIG. 12 is a schematic diagram of a node of an R+ tree according to an embodiment of the present invention.
图13是本发明实施例图形处理方法中命令队列的演变示意图。FIG. 13 is a schematic diagram showing the evolution of a command queue in a graphics processing method according to an embodiment of the present invention.
图14是本发明实施例图形处理装置的结构示意图。FIG. 14 is a schematic structural diagram of a graphics processing apparatus according to an embodiment of the present invention.
图15是本发明实施例图形处理的具体流程示意图。FIG. 15 is a schematic diagram of a specific process of graphics processing according to an embodiment of the present invention.
图16是本发明实施例计算机系统的结构示意图。Figure 16 is a block diagram showing the structure of a computer system according to an embodiment of the present invention.
图17是本发明实施例的另一图形处理方法示意图。FIG. 17 is a schematic diagram of another graphics processing method according to an embodiment of the present invention.
图18是本发明实施例的另一图形处理装置的结构示意图。FIG. 18 is a schematic structural diagram of another graphics processing apparatus according to an embodiment of the present invention.
图19是本发明实施例的另一图形处理的具体流程示意图。FIG. 19 is a schematic diagram of a specific process of another graphics process according to an embodiment of the present invention.
图20是本发明实施例另一计算机系统的结构示意图。20 is a schematic structural diagram of another computer system according to an embodiment of the present invention.
图21是本发明实施例图形显示系统的结构示意图。Figure 21 is a block diagram showing the structure of a graphic display system in accordance with an embodiment of the present invention.
图22是本发明实施例另一图形显示系统的结构示意图。FIG. 22 is a schematic structural diagram of another graphic display system according to an embodiment of the present invention.
图23是本发明实施例再一图形显示系统的结构示意图。FIG. 23 is a schematic structural diagram of still another graphic display system according to an embodiment of the present invention.
图24是本发明实施例再一图形显示系统的结构示意图。FIG. 24 is a schematic structural diagram of still another graphic display system according to an embodiment of the present invention.
具体实施方式detailed description
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有作出创 造性劳动前提下所获得的所有其它实施例,都属于本发明保护的范围。The technical solutions in the embodiments of the present invention are clearly and completely described in the following with reference to the accompanying drawings in the embodiments of the present invention. It is obvious that the described embodiments are a part of the embodiments of the present invention, but not all embodiments. Based on the embodiments of the present invention, those of ordinary skill in the art are not making innovations. All other embodiments obtained under the premise of productive labor are within the scope of the invention.
终端(Terminal),可以称之为用户设备(User Equipment,简称“UE”)、用户等,可以经无线接入网(例如,Radio Access Network,简称“RAN”)与一个或多个核心网进行通信,可以是移动终端,如移动电话(或称为“蜂窝”电话)和具有移动终端的计算机,例如,可以是便携式、袖珍式、手持式、计算机内置的或者车载的移动装置,它们与无线接入网交换语言和/或数据。A terminal, which may be referred to as a User Equipment ("UE"), a user, etc., may be performed by a radio access network (for example, a Radio Access Network ("RAN") and one or more core networks. The communication may be a mobile terminal, such as a mobile phone (or "cellular" phone) and a computer with a mobile terminal, for example, a portable, pocket, handheld, computer built-in or car-mounted mobile device, which is wireless The access network exchanges languages and/or data.
为了方便理解本发明实施例,首先在此介绍本发明实施例描述中会引入的几个要素。In order to facilitate the understanding of the embodiments of the present invention, several elements introduced in the description of the embodiments of the present invention are first described herein.
最大内接矩形:四个顶点都在图形的边上,且构成的矩形都在该图形的内部,则该矩形称为该图形的内接矩形。当内接矩形的面积最大时,称为最大内接矩形。本发明实施例中的最大内接矩形,还必须满足条件:不妨假设终端的桌面的一条边为A,则最大内接矩形的两条平行边与边A平行,另两条平行边与边A垂直。Maximum Inscribed Rectangle: The four vertices are on the edge of the graph, and the rectangles formed are all inside the graph. The rectangle is called the inscribed rectangle of the graph. When the area of the inscribed rectangle is the largest, it is called the maximum inscribed rectangle. The maximum inscribed rectangle in the embodiment of the present invention must also satisfy the condition: it may be assumed that one side of the desktop of the terminal is A, and the two parallel sides of the largest inscribed rectangle are parallel to the side A, and the other two parallel sides and the side A vertical.
绘制命令:图形引擎对终端的显示桌面的图形渲染命令。一般可包括Rect、Work、Mode和Shape四类信息。其中,Rect表示绘制命令所绘制的区域的外包矩形信息;Work表示绘制命令的执行内容;Mode表示绘制命令的绘制模式,即绘制结果与画布上的混合模式,包括覆盖(Opaque)、混合(Blend)和等待(Wait)三类;Shape描述绘制命令的区域形状,如矩形/圆形/点/线等,绘制命令的区域形状,也就是绘制命令的绘制区域。Drawing command: The graphic engine renders the graphics rendering command to the terminal. Generally, it can include four types of information: Rect, Work, Mode, and Shape. Among them, Rect represents the outsourcing rectangle information of the area drawn by the drawing command; Work represents the execution content of the drawing command; Mode represents the drawing mode of the drawing command, that is, the drawing mode and the mixed mode on the canvas, including overlay (Opaque), blending (Blend) ) and wait (Wait) three types; Shape describes the shape of the area of the drawing command, such as rectangle / circle / point / line, etc., draw the shape of the area of the command, that is, the drawing area of the drawing command.
图1是一种终端设备的结构示意图。FIG. 1 is a schematic structural diagram of a terminal device.
以图1为例介绍本发明实施例提供的图形处理方法应用的计算节点的逻辑结构。该计算节点可以是终端设备,该终端设备具体可以为一智能手机。如图1所示,该终端设备的硬件层包括CPU、GPU等,当然还可以包括存储器、输入/输出设备、内存、内存控制器、网络接口等,输入设备可包括键盘、鼠标、触摸屏等,输出设备可包括显示设备如LCD、CRT、全息成像(Holographic)、投影(Projector)等。在硬件层之上可运行有操作系统(如Android等)以及一些应用程序。核心库是操作系统的核心部分,包括输入/输出服务、核心服务、图形设备接口以及实现CPU、GPU图形处理的图形引擎(Graphics Engine)等。图形引擎可包括2D引擎、3D引擎、合成器(Composition)、帧缓冲区(Frame Buffer)、EGL等。除此之外,该终端还包括驱动层、框架层和应用层。驱动层可包括CPU驱动、GPU驱动、显示 控制器驱动等。框架层可包括图形服务(Graphic Service)、系统服务(System service)、网页服务(Web Service)和用户服务(Customer Service)等;图形服务中,可包括如微件(Widget)、画布(Canvas)、视图(Views)、Render Script等。应用层可包括桌面(launcher)、媒体播放器(Media Player)、浏览器(Browser)等。The logical structure of a computing node applied by the graphics processing method provided by the embodiment of the present invention is described by using FIG. 1 as an example. The computing node may be a terminal device, and the terminal device may specifically be a smart phone. As shown in FIG. 1 , the hardware layer of the terminal device includes a CPU, a GPU, and the like, and may further include a memory, an input/output device, a memory, a memory controller, a network interface, and the like. The input device may include a keyboard, a mouse, a touch screen, and the like. The output device may include a display device such as an LCD, a CRT, a Holographic image, a Projector, and the like. Above the hardware layer you can run an operating system (such as Android) and some applications. The core library is the core part of the operating system, including input/output services, core services, graphics device interfaces, and graphics engine (Graphics Engine) for CPU and GPU graphics processing. The graphics engine may include a 2D engine, a 3D engine, a composition, a Frame Buffer, an EGL, and the like. In addition, the terminal further includes a driving layer, a frame layer, and an application layer. The driver layer can include CPU driver, GPU driver, display Controller drive, etc. The framework layer may include a graphic service (Graphic Service), a system service (System service), a web service (Web Service), and a customer service (Customer Service); and the graphic service may include, for example, a widget (widget) or a canvas (Canvas). , Views, Render Script, etc. The application layer may include a desktop, a media player, a browser, and the like.
本发明实施例的方法,可由图1的核心库层中的2D引擎执行。The method of the embodiment of the present invention may be performed by a 2D engine in the core library layer of FIG. 1.
以图1为例,本发明实施例提供的图形处理方法,应用于计算节点,该计算节点可以是终端设备,其中,该终端设备的硬件层可包括处理器,(例如中央处理器(Center Processing Unit,CPU)、图形处理器(Graphic Processing Unit,GPU))、显示控制器(Display Controller)、内存、内存控制器、输入设备、显示设备等硬件,核心库层(Kernel Library)可包括输入/输出服务(I/O Service)、核心服务(Kernel Service)及图形引擎(Graphic Engine),应当理解的是,本发明实施例方法的执行主体的逻辑结构可参考图1。As shown in FIG. 1 , the graphics processing method provided by the embodiment of the present invention is applied to a computing node, where the computing node may be a terminal device, where the hardware layer of the terminal device may include a processor, for example, a central processing unit (Center Processing) Unit, CPU), Graphic Processing Unit (GPU), Display Controller, Memory, Memory Controller, Input Device, Display Device, etc. The Kernel Library can include input/ The output structure (I/O Service), the core service (Kernel Service), and the graphics engine (Graphic Engine), it should be understood that the logical structure of the execution body of the method of the embodiment of the present invention can refer to FIG.
现有的一种消除过度绘制的方法,在绘制时采用相交检测,命令合并的方法,去除过度绘制,其相交检测算法及命令合并算法的算法思想如下所示。An existing method for eliminating over-drawing uses intersecting detection, command merging, and over-drawing in drawing, and the algorithm of the intersection detection algorithm and the command merging algorithm is as follows.
相交检测算法:Intersection detection algorithm:
输入:一个绘制分区内的一系列带绘制区域的绘制命令Input: a series of drawing commands with drawing areas within a drawing partition
输出:一系列带绘制命令的不相交的绘制区域。Output: A series of disjoint drawing areas with drawing commands.
步骤:step:
1、把所有绘制区域放入区域池。1. Put all drawing areas into the area pool.
2、开始检查第一个绘制区域A:2. Start checking the first drawing area A:
3、检测A与区域池中其它绘制区域是否相交。3. Detect whether A intersects with other drawing areas in the area pool.
4、如果无相交,则处理下一个绘制区域。4. If there is no intersection, the next drawing area is processed.
5、如果区域池中存在绘制区域B与A相交,则求出A与B的相交区域C,C中聚合A和B的命令,并将A和B按C划分为一系列子区域。区域池中删除A、B,并将C和子区域加入区域池。图2是本发明实施例相交检测的方法示意图。如图2的左侧图所示,绘制区域A1(大的矩形区域)和绘制区域A2(小的矩形区域)相交,相交区域即为B3(实际上就是A2);此时,如图2的右侧图所示,可将A1和A2按照相交区域B3划分成B1、B2、B3、B4和B5。5. If there is a drawing area B intersecting A in the area pool, then the intersection area A and B are obtained, and the commands of A and B are aggregated in C, and A and B are divided into a series of sub-areas by C. Delete A and B in the zone pool and add C and subzones to the zone pool. 2 is a schematic diagram of a method of intersection detection according to an embodiment of the present invention. As shown in the left diagram of FIG. 2, the drawing area A1 (large rectangular area) and the drawing area A2 (small rectangular area) intersect, and the intersection area is B3 (actually A2); at this time, as shown in FIG. As shown in the figure on the right, A1 and A2 can be divided into B1, B2, B3, B4, and B5 according to the intersection area B3.
6、遍历区域池,直到遍历完区域池的所有区域。 6. Traverse the area pool until you have traversed all areas of the area pool.
应理解,在相交检测中,绘制分区是一个较大的区域范围。当绘制命令的绘制区域在绘制分区覆盖的范围内,则称该绘制命令为该绘制分区内的绘制命令。It should be understood that in the intersection detection, the drawing partition is a large area range. When the drawing area of the drawing command is within the range covered by the drawing partition, the drawing command is said to be a drawing command in the drawing partition.
此外,两个绘制区域不相交,是指两个绘制区域之间没有重叠的区域。两个绘制命令不相交,则指两个绘制命令的绘制区域之间没有重叠的区域。类似地,多个绘制区域不相交,是指多个绘制区域之间没有重叠的区域;多个绘制命令不相交,则指多个绘制命令的绘制区域之间没有重叠的区域。In addition, the two drawing areas do not intersect, which means that there is no overlapping area between the two drawing areas. If the two drawing commands do not intersect, it refers to the area where there is no overlap between the drawing areas of the two drawing commands. Similarly, multiple drawing areas do not intersect, which means that there is no overlapping area between multiple drawing areas; if multiple drawing commands do not intersect, it means that there is no overlapping area between drawing areas of multiple drawing commands.
命令合并算法:Command merge algorithm:
输入:一个绘制区域,内含一系列绘制命令Input: A drawing area with a series of drawing commands
输出:一个绘制区域,内含一系列绘制命令Output: A drawing area with a series of drawing commands
步骤:step:
1、将绘制区域中所有绘制命令按深度排序1. Sort all drawing commands in the drawing area by depth
2、从第二个命令开始,依次进行命令合成:2. Start with the second command and sequence the commands in sequence:
如果当前命令的标识符为等待(Wait),则不做处理;If the identifier of the current command is Wait, no processing is performed;
如果当前命令标识符为覆盖(Opaque),则去除当前命令前面的所有命令;If the current command identifier is Override (Opaque), remove all commands preceding the current command;
如果当前命令标识符为混合(Blend),且前一个命令的标识符为Wait,则不做处理;If the current command identifier is Blend and the identifier of the previous command is Wait, no processing is performed;
如果当前命令标识符为混合(Blend),且前一个命令的工作(Work)不能与当前命令的Work混合,则不处理;If the current command identifier is Blend, and the work of the previous command cannot be mixed with the Work of the current command, it is not processed;
如果当前命令标识符为混合(Blend),且前一个命令的标识符不为Wait,且前一个命令的Work能与当前命令的Work混合,则将当前命令与前一个命令合并为一个命令。If the current command identifier is Blend, and the identifier of the previous command is not Wait, and the Work of the previous command can be mixed with the Work of the current command, the current command is merged with the previous command into one command.
应理解,在绘制命令中,Work表示绘制命令的执行内容。例如,图像采样,等等。It should be understood that in the drawing command, Work represents the execution content of the drawing command. For example, image sampling, and so on.
图3是本发明实施例的发明原理示意图。如图3所示,本发明实施例的方法,可分为收集阶段和执行阶段。在收集阶段,收集应用输入在同一帧中的一组命令,汇集成一个原始命令队列;在执行阶段,通过过度绘制剔除引擎,将原始队列进行过度绘制剔除处理,形成一组新的命令,然后执行输出到显示设备。与延迟渲染相比,尽管均分为收集和执行两个过程,但存在如下区别:(1)每个命令除了渲染目标相同之外,其它资源均相互独立;(2) 没有仅改变状态的指令,所有命令均会产生实际渲染效果,每个命令有自己独立的状态。Figure 3 is a schematic illustration of the principles of the invention in accordance with an embodiment of the present invention. As shown in FIG. 3, the method of the embodiment of the present invention can be divided into a collection phase and an execution phase. In the collection phase, a set of commands that apply input in the same frame are collected and assembled into an original command queue; in the execution phase, the original queue is over-drawn and culled by over-drawing the culling engine to form a new set of commands, and then Execute the output to the display device. Compared with delayed rendering, although it is divided into two processes of collecting and executing, there are the following differences: (1) Each command is independent of each other except the rendering target; (2) There are no instructions that only change state, all commands produce actual rendering effects, and each command has its own independent state.
图4是本发明实施例一种图形处理方法示意图。图4的方法由图形处理装置执行。具体地,该图形处理装置可以是一个计算机系统,例如图形引擎等,或者是一个图形处理器,例如GPU芯片,等等。如图4所示,该方法包括:4 is a schematic diagram of a graphics processing method according to an embodiment of the present invention. The method of Figure 4 is performed by a graphics processing device. Specifically, the graphics processing device may be a computer system such as a graphics engine or the like, or a graphics processor such as a GPU chip, and the like. As shown in FIG. 4, the method includes:
S410,接收当前帧输入的命令队列。S410. Receive a command queue of a current frame input.
其中,该命令队列包括多个绘制命令,每个该绘制命令都携带外包矩形信息、执行内容、绘制模式与绘制区域信息,该绘制模式包括覆盖模式、混合模式或等待模式。The command queue includes a plurality of drawing commands, each of which carries an outsourcing rectangle information, an execution content, a drawing mode, and a drawing area information, and the drawing mode includes an overlay mode, a mixed mode, or a waiting mode.
绘制命令中,一般可包括外包矩形信息(Rect)、执行内容(Work)、绘制模式(Mode)和绘制区域(Shape)四类信息。The drawing command generally includes four types of information: outer rectangle information (Rect), execution content (Work), drawing mode (Mode), and drawing area (Shape).
其中,Rect表示绘制命令所对应的的绘制区域的外包矩形信息,该绘制区域位于外包矩形内。优选地,绘制区域的外包矩形为;Work表示绘制命令的执行内容;Mode表示绘制命令的绘制模式,即绘制结果与画布上的混合模式,包括覆盖(Opaque)、混合(Blend)和等待(Wait)三类;Shape描述绘制命令的区域形状,如矩形/圆形/点/线等,绘制命令的区域形状,也就是绘制命令的绘制区域。Where Rect represents the outsourcing rectangle information of the drawing area corresponding to the drawing command, and the drawing area is located in the outer rectangle. Preferably, the outer bounding rectangle of the drawing area is; Work represents the execution content of the drawing command; Mode represents the drawing mode of the drawing command, that is, the drawing result and the mixed mode on the canvas, including coverage (Opaque), blending (Blend), and waiting (Wait). Three types; Shape describes the shape of the area in which the command is drawn, such as rectangle/circle/point/line, etc., and draws the shape of the area of the command, that is, the drawing area of the drawing command.
一个具体绘制命令实例,将一幅椭圆图像覆盖到[20,20]To[300,400]的区域上,椭圆参数方程为[((x-160)/140)]^2+[((y-210)/190)]^2=1。该绘制命令的内容可包括:An example of a specific drawing command, covering an elliptical image onto the region of [20,20]To[300,400], the elliptic parameter equation is [((x-160)/140)]^2+[((y-210) ) / 190)] ^ 2 = 1. The content of the drawing command may include:
外包矩形:[20,20]To[300,300]Outsourcing rectangle: [20,20]To[300,300]
执行内容:图像采样Execution content: image sampling
绘制模式:覆盖Drawing mode: overlay
区域形状:椭圆参数方程[((x-160)/140)]^2+[((y-210)/190)]^2=1Area shape: elliptic parameter equation [((x-160)/140)]^2+[((y-210)/190)]^2=1
S420,根据外包矩形信息与绘制区域信息,将该多个绘制命令中的每一个不规则绘制命令拆分成至少一个第一类绘制命令和至少一个第二类绘制命令。S420. Split each of the plurality of drawing commands into at least one first type drawing command and at least one second type drawing command according to the outsourcing rectangle information and the drawing area information.
其中,该至少一个第一类绘制命令的绘制区域为该不规则绘制命令对应的绘制区域内的矩形,该至少一个第二类绘制命令的绘制区域为该不规则绘制命令对应的绘制区域去掉该至少一个第一类绘制命令的绘制区域后剩余 的边角区域,该至少一个第一类绘制命令的绘制模式与该不规则绘制命令的绘制模式相同,该至少一个第二类绘制命令的绘制模式为等待模式。The drawing area of the at least one first type drawing command is a rectangle in the drawing area corresponding to the irregular drawing command, and the drawing area of the at least one second type drawing command is the drawing area corresponding to the irregular drawing command. Remaining at least one drawing area of the first type of drawing command a corner area, the drawing mode of the at least one first type drawing command is the same as the drawing mode of the irregular drawing command, and the drawing mode of the at least one second type drawing command is a waiting mode.
应理解,本发明实施例中,规则形状是指与边界与显示桌面对应的边界平行的矩形。通常情况下,显示桌面的显示区域为一个矩形,假设为矩形ABCD。假设矩形EFGH位于矩形ABCD内,且边EF平行与边AB,边FG平行与边BC,则可以说矩形EFGH是一个规则形状的区域。It should be understood that, in the embodiment of the present invention, the regular shape refers to a rectangle parallel to the boundary corresponding to the display desktop. Normally, the display area of the display desktop is a rectangle, assuming a rectangular ABCD. Assuming that the rectangle EFGH is located in the rectangle ABCD, and the side EF is parallel to the side AB, the side FG is parallel to the side BC, it can be said that the rectangle EFGH is a regular shaped area.
规则形状以外的所有形状,都称为不规则形状。绘制命令对应的绘制区域为规则形状的,可称为规则命令;绘制命令对应的绘制区域为不规则形状的,可称为不规则命令。All shapes except the regular shape are called irregular shapes. The drawing area corresponding to the drawing command is a regular shape, which may be called a rule command; the drawing area corresponding to the drawing command is an irregular shape, and may be called an irregular command.
应理解,一个绘制命令拆分后,其绘制内容相应的会体现在拆分后的绘制命令中。例如。上述例子中,绘制命令的执行内容为图像采样,绘制命令拆分后,拆分后的绘制命令的执行内容也为图像采样,分别对各自的绘制区域进行图像采样。It should be understood that after a drawing command is split, the drawing content is correspondingly reflected in the drawing command after splitting. E.g. In the above example, the execution content of the drawing command is image sampling. After the drawing command is split, the execution content of the split drawing command is also image sampling, and the respective drawing regions are respectively image-sampled.
本发明实施例中,对于规则命令,不需要进行命令拆分处理,对于不规则命令,则需要进行命令拆分处理。In the embodiment of the present invention, the command splitting process is not required for the rule command, and the command splitting process is required for the irregular command.
可选地作为一个实施例,可将一个不规则绘制命令拆成一个第一类绘制命令和至少一个第二类绘制命令。一种具体的命令拆分方法如图5所示,可包括:Optionally, as an embodiment, an irregular drawing command may be split into a first class drawing command and at least one second class drawing command. A specific command splitting method is shown in FIG. 5, which may include:
S421,根据该不规则绘制命令的外包矩形信息与绘制区域信息,获取该不规则绘制命令的最大内接矩形信息。S421: Obtain out the maximum inscribed rectangle information of the irregular drawing command according to the outsourcing rectangle information and the drawing area information of the irregular drawing command.
本发明实施例中,不规则绘制命令的最大内接矩形,是指不规则绘制命令对应的绘制区域的内接矩形中,面积最大的规则形状的矩形。规则形状的矩形,即前文所述的边界与显示桌面对应的边界平行的矩形。In the embodiment of the present invention, the maximum inscribed rectangle of the irregular drawing command refers to a rectangle of a regular shape having the largest area among the inscribed rectangles of the drawing area corresponding to the irregular drawing command. A rectangle of a regular shape, that is, a rectangle whose boundary is parallel to the boundary corresponding to the display desktop.
下面以几种常见的不规则图形为例,求取其最大内接矩形。Let's take several common irregular patterns as an example to find the maximum inscribed rectangle.
图6是任意角度旋转的矩形中求取最大内接矩形的示意图。如图6所示,矩形ABCD为旋转矩形,矩形PSQR为旋转矩形ABCD的内接矩形。其中,旋转矩形ABCD的四个顶点中,A点坐标为(0,0),B点坐标为(x2,y2),C点坐标为(x1,y1),P为内接矩形PSQR与长边AC的交点,Q为内接矩形PSQR与长边BD的交点。不妨将AP/AC的值记为p,BQ/BD的值记为q,则可得到最大内接矩形的求解方程:Fig. 6 is a schematic view showing the maximum inscribed rectangle in a rectangle rotated at an arbitrary angle. As shown in FIG. 6, the rectangle ABCD is a rotation rectangle, and the rectangle PSQR is an inscribed rectangle of the rotation rectangle ABCD. Among them, among the four vertices of the rotating rectangle ABCD, the coordinates of point A are (0, 0), the coordinates of point B are (x2, y2), the coordinates of point C are (x1, y1), and P is the inscribed rectangle PSQR and long side. The intersection of AC, Q is the intersection of the inscribed rectangle PSQR and the long side BD. It is possible to record the value of AP/AC as p, and the value of BQ/BD as q, then the solution equation of the largest inscribed rectangle can be obtained:
0.0≤p≤1.0; 0.0 ≤ p ≤ 1.0;
0.0≤q≤1.0;0.0≤q≤1.0;
max:((2-q)x2+(1-p-q)x1)*((2-q)y2+(1-p-q)y1)。Max: ((2-q)x2+(1-p-q)x1)*((2-q)y2+(1-p-q)y1).
图7是椭圆中求取最大内接矩形的示意图。如图7所示,不放假设椭圆的中心点为(x0,y0),椭圆参数方程为:[((x-x0)/a)]^2+[((y-y0)/b)]^2=1,内接矩形与椭圆交点的坐标(A、B、C或D)到椭圆中心点的距离为r,角度为p,列出矩形ABCD的参数方程:Figure 7 is a schematic illustration of the largest inscribed rectangle in the ellipse. As shown in Fig. 7, the center point of the hypothetical ellipse is not (x 0 , y 0 ), and the elliptic parameter equation is: [((xx 0 )/a)]^2+[((yy 0 )/b)] ^2=1, the distance between the coordinates of the intersection of the inscribed rectangle and the ellipse (A, B, C or D) to the center point of the ellipse is r, and the angle is p, which lists the parametric equation of the rectangle ABCD:
(x-x0,y-y0)=(a*cos(p),b*sin(p));(xx 0 , yy 0 )=(a*cos(p), b*sin(p));
其外接矩形为:(x0-a,y0-b)To(x0+a,y0+b);Its circumscribed rectangle is: (x 0 -a, y 0 -b) To(x 0 +a, y 0 +b);
根据p与面积的函数对p求导可知,当p等于45度时,取得最大内接矩形,可表示为:According to the function of p and area, p is obtained. When p is equal to 45 degrees, the maximum inscribed rectangle is obtained, which can be expressed as:
(x0-a*cos(45°),y0-b*sin(45°))To(x0+a*cos(45°),y0+b*sin(45°))。(x 0 -a*cos(45°), y 0 -b*sin(45°)) To(x 0 +a*cos(45°), y 0 +b*sin(45°)).
图8是三角形中求取最大内接矩形的示意图。如图8所示,矩形ABCD是三角形EFG的一个内接矩形。在三条行的每条边上分别求取每条上的最佳分割点,得到每条边上对应的内接矩形。例如,在EF边上取点A,再从点A引出两条线分别与显示桌面的边并行。引出的两条线分别与三角形EFG的边FG、EG相交与点B和C,从而确定矩形ABCD。不妨记EA/EF为p,则矩形ABCD的面积S可表示为包含p的一个参数表达式。当S的面积最大时,A点即为边EF的最佳分割点。类似地,可分别求取边FG、EG上的最佳分割点。三个边上的最佳分割点对应的矩形面积中最大的一个,即为三角形EFG所求的最大内接矩形。具体计算的方法,属于几何数学的范畴,本发明实施例在此不再赘述。Figure 8 is a schematic illustration of the largest inscribed rectangle in the triangle. As shown in Fig. 8, the rectangle ABCD is an inscribed rectangle of the triangle EFG. Find the best segmentation point on each edge of each of the three rows to obtain the corresponding inscribed rectangle on each edge. For example, take point A on the edge of EF, and then take two lines from point A in parallel with the side of the display desktop. The two lines drawn intersect with the edges FG, EG of the triangle EFG and points B and C, respectively, to determine the rectangle ABCD. It may be noted that EA/EF is p, and the area S of the rectangular ABCD can be expressed as a parameter expression containing p. When the area of S is the largest, point A is the best dividing point of the edge EF. Similarly, the best segmentation points on the edges FG, EG can be obtained separately. The largest of the rectangular areas corresponding to the best dividing points on the three sides, that is, the largest inscribed rectangle obtained by the triangle EFG. The specific calculation method belongs to the category of geometric mathematics, and the embodiments of the present invention are not described herein again.
当然,还可能存在其它类型的不规则图形,求取该不规则图形的最大内接矩形的算法属于几何数学的范畴,本发明实施例在此不再赘述。Of course, there may be other types of irregular patterns. The algorithm for determining the maximum inscribed rectangle of the irregular pattern belongs to the category of geometric mathematics, and details are not described herein again.
S422,利用该不规则绘制命令的外包矩形信息与最大内接矩形信息,将该不规则绘制命令拆分成一个第一类绘制命令和至少一个第二类绘制命令。S422. Split the irregular drawing command into a first class drawing command and at least one second class drawing command by using the outsourcing rectangle information and the maximum inscribed rectangle information of the irregular drawing command.
其中,该第一类绘制命令的区域为该不规则绘制命令的最大内接矩形,该至少一个第二类绘制命令的绘制区域为该不规则绘制命令的绘制区域除该最大内接矩形外的边角绘制区域。The area of the first type of drawing command is the maximum inscribed rectangle of the irregular drawing command, and the drawing area of the at least one second type drawing command is the drawing area of the irregular drawing command except the maximum inscribed rectangle. The corners draw the area.
例如,在图6、图7、图8所示的图形中,将其外包矩形分割为最大内接矩形和若干个不规则的边角区域。同时,对于最大内接矩形区域,其绘制模式保持不变,其余边角区域的绘制模式改为等待模式状态。 For example, in the graphs shown in FIGS. 6, 7, and 8, the outer envelope is divided into a maximum inscribed rectangle and a plurality of irregular corner regions. At the same time, for the maximum inscribed rectangular area, the drawing mode remains unchanged, and the drawing mode of the remaining corner areas is changed to the waiting mode state.
本发明实施例中,通过将绘制区域的形状为的三角形、旋转矩形或椭圆形的原始不规则命令按最大内接矩形拆分成一个规则绘制命令和若干个新的不规则绘制命令,拆分后的规则绘制命令在经过相交检测后得到若干个新的规则绘制命令,该若干个新的规则绘制命令中有可能会有一个或多个在命令合并操作中被合并,从而能够在一定程度上增加消除过度绘制的效果。In the embodiment of the present invention, the original irregular command of the triangle, the rotation rectangle or the ellipse with the shape of the drawing area is split into a rule drawing command and a plurality of new irregular drawing commands according to the maximum inscribed rectangle, and split. After the rule drawing command, after the intersection detection, several new rule drawing commands are obtained, and one or more of the new rule drawing commands may be merged in the command combining operation, thereby being able to Increase the effect of eliminating overdraw.
可选地,作为另一个实施例,可将一个不规则绘制命令拆成多个第一类绘制命令和多个第二类绘制命令。当该不规则绘制命令对应的绘制区域为不规则多边形时,步骤420具体可实现为:Optionally, as another embodiment, one irregular drawing command may be split into multiple first class drawing commands and multiple second class drawing commands. When the drawing area corresponding to the irregular drawing command is an irregular polygon, step 420 may be specifically implemented as:
将该不规则多边形的绘制区域切分成多个三角形的绘制区域,并根据该不规则多边形的切分方法将该不规则绘制命令拆分成多个第三类绘制命令,该多个第三类绘制命令与该多个三角形的绘制区域之间是一一对应关系;Dividing the drawing area of the irregular polygon into a drawing area of a plurality of triangles, and splitting the irregular drawing command into a plurality of third type drawing commands according to the segmentation method of the irregular polygon, the plurality of third types a one-to-one correspondence between the drawing command and the drawing area of the plurality of triangles;
针对每个第三类绘制命令,根据该第三类绘制命令的外包矩形信息与绘制区域信息,获取该第三类绘制命令的最大内接矩形信息;And for each third type drawing command, obtaining the maximum inscribed rectangle information of the third type drawing command according to the outsourcing rectangle information and the drawing area information of the third type drawing command;
利用该第三类绘制命令的外包矩形信息与最大内接矩形信息,将该第三类绘制命令拆分成一个该第一类绘制命令和至少一个该第二类绘制命令,其中,该第一类绘制命令对应的区域为该第三类绘制命令对应的最大内接矩形,该至少一个第二类绘制命令对应的绘制区域为该第三类绘制命令对应的绘制区域除该最大内接矩形外的边角区域。Using the outsourcing rectangle information and the maximum inscribed rectangle information of the third class drawing command, splitting the third class drawing command into one first class drawing command and at least one second class drawing command, wherein the first The area corresponding to the class drawing command is the largest inscribed rectangle corresponding to the third type drawing command, and the drawing area corresponding to the at least one second type drawing command is the drawing area corresponding to the third type drawing command except the maximum inscribed rectangle. Corner area.
本发明实施例中,通过将不规则多边形拆分成多个三角形,再针对每个三角形拆分成一个最大内接矩形和三个边角区域,并根据拆分后的区域将原始绘制命令拆分成多个规则绘制命令和多个新的不规则绘制命令,拆分后的规则绘制命令在经过相交检测后得到若干个新的规则绘制命令,该若干个新的规则绘制命令中有可能会有一个或多个在命令合并操作中被合并,从而能够在一定程度上增加消除过度绘制的效果。In the embodiment of the present invention, by splitting the irregular polygon into a plurality of triangles, each triangle is split into a maximum inscribed rectangle and three corner regions, and the original drawing command is removed according to the split region. Divided into a plurality of rule drawing commands and a plurality of new irregular drawing commands, the split rule drawing commands obtain a number of new rule drawing commands after the intersection detection, and the new rule drawing commands may be One or more of them are merged in the command merge operation, so that the effect of eliminating over-drawing can be increased to some extent.
S430,根据外包矩形信息和绘制区域信息,将该多个绘制命令中的规则绘制命令,以及该多个绘制命令中的不规则绘制命令经拆分后的该第一类绘制命令和该第二类绘制命令,分组成多个绘制命令集,使得属于不同绘制命令集的绘制命令互不相交。S430, according to the outsourcing rectangle information and the drawing area information, the rule drawing command of the plurality of drawing commands, and the first type drawing command and the second after the irregular drawing drawing command of the plurality of drawing commands are split Class drawing commands are grouped into multiple drawing command sets so that drawing commands belonging to different drawing command sets do not intersect each other.
经过步骤S420的命令拆分后,当前的命令队列中包括接收命令队列时就存在的规则绘制命令,以及不规则命令经拆分后的第一类绘制命令和第二类绘制命令。 After the splitting of the command in step S420, the current command queue includes a rule drawing command that exists when the command queue is received, and a first type drawing command and a second type drawing command after the irregular command is split.
根据各个绘制命令的外包矩形区域信息和绘制区域信息,可将当前的命令队列中的绘制区域划分成多个绘制分区,使得处于不同绘制分区的绘制区域互不相交,即不同绘制分区的绘制区域之间没有重叠的区域。然后,将每个绘制分区内的绘制命令组成一个绘制命令集,一个绘制分区对应于一个绘制命令集。According to the outsourcing rectangular area information and the drawing area information of each drawing command, the drawing area in the current command queue can be divided into multiple drawing partitions, so that the drawing areas in different drawing partitions do not intersect each other, that is, the drawing areas of different drawing partitions There is no overlapping area between them. Then, the drawing commands in each drawing partition are combined into one drawing command set, and one drawing partition corresponds to one drawing command set.
进行绘制命令分区后,整个桌面将划分成多个不同的绘制命令集。After the drawing command is partitioned, the entire desktop is divided into a number of different drawing command sets.
通过对绘制命令按照绘制区域进行分区,使得每个绘制命令集内的绘制命令为有限个数,可以使得绘制命令集内的绘制命令进行相交检测的时间大幅缩小。By dividing the drawing command according to the drawing area, the drawing command in each drawing command set is a finite number, and the time for intersecting detection of the drawing command in the drawing command set can be greatly reduced.
本发明实施例的一种方法,采用R+树算法,选择一个装填因子,每次装载有限条绘制命令,以将绘制命令分成若干个绘制命令集。A method of an embodiment of the present invention uses an R+tree algorithm to select a loading factor, each time loading a finite strip drawing command to divide the drawing command into a plurality of drawing command sets.
包括选择分裂线的Sweep算法和总体算法PackSweep algorithm and overall algorithm pack including split line selection
Figure PCTCN2015094969-appb-000001
Figure PCTCN2015094969-appb-000001
反复进行直到S’为空Repeat until S’ is empty
由于命令分割时,会将命令的顺序打乱。因此,可给每个命令按照执行的先后顺序添加一个深度值,以便后续得知执行的先后顺序。When the command is split, the order of the commands is scrambled. Therefore, each command can be added with a depth value in the order of execution so that the order of execution is known later.
图9是本发明实施例显示空间的绘制命令对应的绘制区域示意图。其中,包括12个绘制命令,分别对应显示空间上的12个绘制区域。 FIG. 9 is a schematic diagram of a drawing area corresponding to a drawing command of a display space according to an embodiment of the present invention. Among them, there are 12 drawing commands, which respectively correspond to 12 drawing areas on the display space.
以装填因子ff等于5为例,进行R+树算法的命令分组。Taking the loading factor ff equal to 5 as an example, the command grouping of the R+ tree algorithm is performed.
图10是本发明实施例显示空间采用R+算法进行一次划分后的绘制区域示意图。根据R+树算法穷举每个矩形的边界线,第一次划分如图10所示,划分出5个矩形(1,2.1,3,4,5.1),且划分矩形的面积最小。将矩形(1,2.1,3,4,5.1)纳入第一个叶节点。FIG. 10 is a schematic diagram of a drawing area after the display space is divided by the R+ algorithm in the embodiment of the present invention. According to the R+ tree algorithm, the boundary line of each rectangle is exhausted. The first division is as shown in FIG. 10, and five rectangles (1, 2.1, 3, 4, 5.1) are divided, and the area of the divided rectangle is the smallest. Incorporate the rectangle (1, 2.1, 3, 4, 5.1) into the first leaf node.
图11是本发明实施例显示空间采用R+算法进行二次划分后的绘制区域示意图。根据R+树算法在剩下的区域中穷举每个矩形的边界线,第二次划分如图11所示,划分出5个矩形(2.2,6.1,7,9,10),且划分矩形的面积最小。将矩形(2.2,6.1,7,9,10)纳入第二个叶节点。FIG. 11 is a schematic diagram of a drawing area after the display space is secondarily divided by the R+ algorithm according to an embodiment of the present invention. According to the R+ tree algorithm, the boundary line of each rectangle is exhausted in the remaining area, and the second division is as shown in FIG. 11, and five rectangles (2.2, 6.1, 7, 9, 10) are divided, and the rectangle is divided. The smallest area. Incorporate the rectangle (2.2, 6.1, 7, 9, 10) into the second leaf node.
两次划分后剩余的矩形数已经不超过装填因子,因此剩余区域的矩形(5.2,8,11,12)直接建子节点。The number of rectangles remaining after the two divisions has not exceeded the loading factor, so the rectangles (5.2, 8, 11, 12) of the remaining area directly construct the child nodes.
图12是本发明实施例的R+树的节点示意图。经过R+树算法的两次划分,最终形成如图12所示的R+树图。图12中,R+树包括叶节点(1,2.1,3,4,5.1)、(2.2,6.1,7,9,10)和(5.2,8,11,12),每个叶节点表示一个绘制命令集。FIG. 12 is a schematic diagram of a node of an R+ tree according to an embodiment of the present invention. After two divisions of the R+ tree algorithm, an R+ tree diagram as shown in FIG. 12 is finally formed. In Figure 12, the R+ tree includes leaf nodes (1, 2.1, 3, 4, 5.1), (2.2, 6.1, 7, 9, 10) and (5.2, 8, 11, 12), each leaf node represents a drawing Command set.
本发明实施例中,通过采用R+树算法,能够快速地进行绘制命令分组,并使得分组后的每一个绘制命令集控制在一定的规模,从而减少相交检测的时间复杂度,极大程度上提高了图形处理装置的图形处理效率。In the embodiment of the present invention, by using the R+ tree algorithm, the drawing command grouping can be quickly performed, and each drawing command set after grouping is controlled to a certain scale, thereby reducing the time complexity of the intersection detection and greatly improving the time complexity. The graphics processing efficiency of the graphics processing device.
S440,根据外包矩形信息和绘制区域信息,对该多个绘制命令集分别进行相交检测,使得该多个绘制命令集中每一个绘制命令集内绘制命令互不相交。S440. Perform intersection detection on the plurality of drawing command sets according to the outsourcing rectangle information and the drawing area information, so that the drawing commands in each drawing command set in the plurality of drawing command sets do not intersect each other.
划分完绘制命令集后,可分别对每个绘制命令集内的绘制命令进行相交检测,具体实现可参考现有技术,本发明实施例在此不再赘述。After the drawing command set is divided, the drawing command in each drawing command set can be detected by the intersection. The specific implementation can refer to the prior art, and details are not described herein again.
S450,根据执行内容、绘制模式和绘制区域信息,对经过相交检测的该多个绘制命令集分别进行绘制命令合并。S450: Perform drawing command combining on the plurality of drawing command sets subjected to the intersection detection according to the execution content, the drawing mode, and the drawing area information.
经过相交检测的绘制命令集,可根据每一个绘制命令的执行内容、绘制模式和绘制区域信息,进行绘制命令合并,以剔除过度绘制部分。具体实现可参考现有技术,本发明实施例在此不再赘述。After the intersecting detection drawing command set, the drawing command may be combined according to the execution content, the drawing mode, and the drawing area information of each drawing command to eliminate the over-drawn portion. For a specific implementation, reference may be made to the prior art, and details are not described herein again.
S460,执行每个绘制分区经合并后的绘制命令。S460: Perform a merged drawing command for each drawing partition.
具体地,在执行每个绘制分区的绘制命令时,可按照每个绘制命令的深度确定执行的顺序。Specifically, when the drawing command of each drawing partition is executed, the order of execution can be determined according to the depth of each drawing command.
应理解,每个绘制分区最终的绘制命令,是指每个绘制分区经过相交检 测与绘制命令合并后得到绘制命令。It should be understood that the final drawing command for each drawing partition means that each drawing partition is cross-checked. The test and draw commands are combined to get the draw command.
本发明实施例中,通过将当前帧的命令队列中的不规则绘制命令按绘制区域拆分成规则绘制命令和不规则绘制命令,并将拆分前的规则绘制命令及拆分后的规则绘制命令和不规则绘制命令分组为多个互不相交的绘制命令集,再对每个绘制命令集分别进行相交检测和命令合并,由于将绘制命令分组成多个绘制命令集再进行相交检测能够大大减少相交检测的时间,并且由于将原始不规则绘制命令拆分成规则绘制命令和不规则绘制命令,拆分后的规则绘制命令在经过相交检测后得到若干个新的规则绘制命令,该若干个新的规则绘制命令中有可能会有一个或多个在命令合并操作中被合并,能够在一定程度上增加消除过度绘制的效果,从而能够提高图形处理的性能。In the embodiment of the present invention, the irregular drawing command in the command queue of the current frame is divided into a rule drawing command and an irregular drawing command according to the drawing area, and the rule drawing command and the split rule before the splitting are drawn. The command and the irregular drawing command are grouped into a plurality of mutually dissimilar drawing command sets, and then each of the drawing command sets are respectively subjected to intersection detection and command merging, since the drawing commands are grouped into a plurality of drawing command sets and then intersected detection can be greatly The time for the intersection detection is reduced, and since the original irregular drawing command is split into the rule drawing command and the irregular drawing command, the split rule drawing command obtains several new rule drawing commands after the intersection detection, the plurality of It is possible that one or more of the new rule drawing commands will be merged in the command merging operation, which can increase the effect of eliminating over-drawing to a certain extent, thereby improving the performance of graphics processing.
图13是本发明实施例图形处理方法中命令队列的演变示意图。具体演变流程如下:FIG. 13 is a schematic diagram showing the evolution of a command queue in a graphics processing method according to an embodiment of the present invention. The specific evolution process is as follows:
第一步:输入命令队列。Step 1: Enter the command queue.
在图4中,即为步骤S410,接收当前帧输入的命令队列。In FIG. 4, that is, step S410, the command queue of the current frame input is received.
第二步:命令拆分。Step 2: Command split.
按照图4的步骤S420对输入的命令队列进行命令拆分,形成暂存命令队列。The input command queue is split according to step S420 of FIG. 4 to form a temporary command queue.
第三步:命令分区。The third step: command partition.
按照图4的步骤S430对暂存命令队列进行命令分区,得到一系列的绘制分区,每个绘制分区中对应着绘制命令的一个子命令集。其中,不同子命令集内的绘制命令不相交。两个绘制命令不相交,是指两个绘制命令对应的绘制区域没有重叠的区域。According to step S430 of FIG. 4, the temporary command queue is command-partitioned to obtain a series of drawing partitions, and each drawing partition corresponds to a sub-command set of drawing commands. Among them, the drawing commands in different sub-command sets do not intersect. The two drawing commands do not intersect, which means that the drawing areas corresponding to the two drawing commands do not overlap.
第四步:相交检测。The fourth step: intersection detection.
按照图4的步骤S440对每个子命令集进行相交检测。每一个子命令集进行相交检测后,会得到一系列不相交的绘制命令。应理解,相交检测后,同一个子命令集中任意两个绘制命令对应的绘制区域互不重叠。Intersection detection is performed for each sub-command set in accordance with step S440 of FIG. After each sub-command set performs intersection detection, it will get a series of disjoint drawing commands. It should be understood that after the intersection detection, the drawing areas corresponding to any two drawing commands in the same sub-command set do not overlap each other.
第五步,命令合并。The fifth step is to merge the commands.
按照图4的步骤S450对每个子命令集相交检测后得到的绘制命令进行命令合并,汇总形成一个新的命令队列。该命令队列即为输入命令队列。According to step S450 of FIG. 4, the drawing commands obtained after the intersection detection of each sub-command set are combined and combined to form a new command queue. The command queue is the input command queue.
本发明实施例中,通过将当前帧的命令队列中的不规则绘制命令按绘制区域拆分成规则绘制命令和不规则绘制命令,并将拆分前的规则绘制命令及 拆分后的规则绘制命令和不规则绘制命令分组为多个互不相交的绘制命令集,再对每个绘制命令集分别进行相交检测和命令合并,由于将绘制命令分组成多个绘制命令集再进行相交检测能够大大减少相交检测的时间,并且由于将原始不规则绘制命令拆分成规则绘制命令和不规则绘制命令,拆分后的规则绘制命令在经过相交检测后得到若干个新的规则绘制命令,该若干个新的规则绘制命令中有可能会有一个或多个在命令合并操作中被合并,能够在一定程度上增加消除过度绘制的效果,从而能够提高图形处理的性能。In the embodiment of the present invention, the irregular drawing command in the command queue of the current frame is divided into a rule drawing command and an irregular drawing command according to the drawing area, and the rule drawing command before splitting and The split rule drawing command and the irregular drawing command are grouped into a plurality of mutually dissimilar drawing command sets, and then each drawing command set is respectively subjected to intersection detection and command merging, since the drawing commands are grouped into multiple drawing command sets. Performing the intersection detection can greatly reduce the time of intersection detection, and since the original irregular drawing command is split into the rule drawing command and the irregular drawing command, the split rule drawing command obtains several new rules after the intersection detection. Drawing commands, one or more of the several new rule drawing commands may be merged in the command merging operation, which can increase the effect of eliminating over-drawing to a certain extent, thereby improving the performance of graphics processing.
图14是本发明实施例图形处理装置1400的结构示意图。如图14所示,图形处理装置1400可包括:命令收集模块1401、命令拆分模块1402、命令分组模块1403、相交检测模块1404、命令合并模块1405和执行模块1406。其中,FIG. 14 is a schematic structural diagram of a graphics processing apparatus 1400 according to an embodiment of the present invention. As shown in FIG. 14, the graphics processing apparatus 1400 may include a command collection module 1401, a command splitting module 1402, a command grouping module 1403, an intersection detecting module 1404, a command combining module 1405, and an executing module 1406. among them,
命令收集模块1401,用于接收当前帧输入的命令队列。其中,该命令队列包括多个绘制命令,每个该绘制命令都携带外包矩形信息、执行内容、绘制模式与绘制区域信息,该绘制模式包括覆盖模式、混合模式或等待模式。The command collection module 1401 is configured to receive a command queue of the current frame input. The command queue includes a plurality of drawing commands, each of which carries an outsourcing rectangle information, an execution content, a drawing mode, and a drawing area information, and the drawing mode includes an overlay mode, a mixed mode, or a waiting mode.
命令拆分模块1402,用于根据外包矩形信息与绘制区域信息,将该多个绘制命令中的每一个不规则绘制命令拆分成至少一个第一类绘制命令和至少一个第二类绘制命令。其中,该第一类绘制命令的绘制区域为该不规则绘制命令对应的绘制区域内的矩形,该至少一个第二类绘制命令的绘制区域为该不规则绘制命令对应的绘制区域去掉该至少一个第一类绘制命令的绘制区域后剩余的边角区域,该至少一个第一类绘制命令的绘制模式与该不规则绘制命令的绘制模式相同,该至少一个第二类绘制命令的绘制模式为等待模式。The command splitting module 1402 is configured to split each of the plurality of drawing commands into at least one first type drawing command and at least one second type drawing command according to the outsourcing rectangle information and the drawing area information. The drawing area of the first type of drawing command is a rectangle in the drawing area corresponding to the irregular drawing command, and the drawing area of the at least one second type drawing command is the drawing area corresponding to the irregular drawing command, and the at least one is removed. a drawing area remaining after the drawing area of the first type drawing command, the drawing mode of the at least one first type drawing command is the same as the drawing mode of the irregular drawing command, and the drawing mode of the at least one second type drawing command is waiting mode.
命令分组模块1403,用于根据外包矩形信息和绘制区域信息,将该多个绘制命令中的规则绘制命令,以及该多个绘制命令中的不规则绘制命令经拆分后的该第一类绘制命令和该第二类绘制命令,分组成多个绘制命令集,使得属于不同绘制命令集的绘制命令互不相交。The command grouping module 1403 is configured to: according to the outsourcing rectangle information and the drawing area information, the rule drawing command of the plurality of drawing commands, and the first drawing of the irregular drawing command of the plurality of drawing commands after the splitting The command and the second type of drawing command are grouped into a plurality of drawing command sets such that drawing commands belonging to different drawing command sets do not intersect each other.
相交检测模块1404,用于根据外包矩形信息和绘制区域信息,对该多个绘制命令集分别进行相交检测,使得该多个绘制命令集中每一个绘制命令集内绘制命令互不相交。The intersection detecting module 1404 is configured to perform intersection detection on the plurality of drawing command sets according to the outsourcing rectangle information and the drawing area information, so that the drawing commands in each drawing command set in the plurality of drawing command sets do not intersect each other.
命令合并模块1405,用于根据执行内容、绘制模式和绘制区域信息,对经过相交检测的该多个绘制命令集分别进行绘制命令合并。 The command merging module 1405 is configured to separately perform drawing command merging on the plurality of drawing command sets that have undergone intersection detection according to the execution content, the drawing mode, and the drawing area information.
执行模块1406,用于执行每个绘制命令集经合并后的绘制命令。The execution module 1406 is configured to execute the merged drawing command for each drawing command set.
本发明实施例中,图形处理装置1400通过将当前帧的命令队列中的不规则绘制命令按绘制区域拆分成规则绘制命令和不规则绘制命令,并将拆分前的规则绘制命令及拆分后的规则绘制命令和不规则绘制命令分组为多个互不相交的绘制命令集,再对每个绘制命令集分别进行相交检测和命令合并,由于将绘制命令分组成多个绘制命令集再进行相交检测能够大大减少相交检测的时间,并且由于将原始不规则绘制命令拆分成规则绘制命令和不规则绘制命令,拆分后的规则绘制命令在经过相交检测后得到若干个新的规则绘制命令,该若干个新的规则绘制命令中有可能会有一个或多个在命令合并操作中被合并,能够在一定程度上增加消除过度绘制的效果,从而能够提高图形处理的性能。In the embodiment of the present invention, the graphics processing apparatus 1400 splits the irregular drawing command in the command queue of the current frame into a rule drawing command and an irregular drawing command according to the drawing area, and draws the command and splits the rule before the splitting. The following rule drawing command and irregular drawing command are grouped into a plurality of mutually dissimilar drawing command sets, and then each drawing command set is respectively subjected to intersection detection and command merging, and the drawing commands are grouped into a plurality of drawing command sets. Intersection detection can greatly reduce the time of intersection detection, and since the original irregular drawing command is split into a rule drawing command and an irregular drawing command, the split rule drawing command obtains several new rule drawing commands after the intersection detection. One or more of the several new rule drawing commands may be merged in the command merge operation, which can increase the effect of eliminating over-drawing to a certain extent, thereby improving the performance of graphics processing.
可选地,作为一个实施例,该命令拆分模块1402具体用于:Optionally, as an embodiment, the command splitting module 1402 is specifically configured to:
根据该不规则绘制命令的外包矩形信息与绘制区域信息,获取该不规则绘制命令的最大内接矩形信息;Obtaining a maximum inscribed rectangle information of the irregular drawing command according to the outsourcing rectangle information and the drawing area information of the irregular drawing command;
利用该不规则绘制命令的外包矩形信息与最大内接矩形信息,将该不规则绘制命令拆分成一个该第一类绘制命令和至少一个该第二类绘制命令,其中,该第一类绘制命令对应的区域为该不规则绘制命令对应的最大内接矩形,该至少一个第二类绘制命令对应的绘制区域为该不规则绘制命令对应的绘制区域除该最大内接矩形外的边角区域。Using the outsourcing rectangle information and the maximum inscribed rectangle information of the irregular drawing command, the irregular drawing command is split into a first class drawing command and at least one second class drawing command, wherein the first class drawing The area corresponding to the command is a maximum inscribed rectangle corresponding to the irregular drawing command, and the drawing area corresponding to the at least one second type drawing command is a corner area of the drawing area corresponding to the irregular drawing command except the maximum inscribed rectangle .
本发明实施例中,图形处理装置1400通过将绘制区域的形状为的三角形、旋转矩形或椭圆形的原始不规则命令按最大内接矩形拆分成一个规则绘制命令和若干个新的不规则绘制命令,拆分后的规则绘制命令在经过相交检测后得到若干个新的规则绘制命令,该若干个新的规则绘制命令中有可能会有一个或多个在命令合并操作中被合并,从而能够在一定程度上增加消除过度绘制的效果。In the embodiment of the present invention, the graphics processing apparatus 1400 splits the original irregular command of the triangle, the rotation rectangle, or the ellipse with the shape of the drawing area into a rule drawing command and several new irregular drawing according to the maximum inscribed rectangle. The command, the split rule drawing command obtains a number of new rule drawing commands after the intersection detection, and one or more of the new rule drawing commands may be merged in the command merge operation, thereby enabling To some extent, the effect of eliminating over-drawing is increased.
可选地,作为另一个实施例,该命令拆分模块1402具体用于:Optionally, as another embodiment, the command splitting module 1402 is specifically configured to:
当该不规则绘制命令对应的绘制区域为不规则多边形时,将该不规则多边形的绘制区域切分成多个三角形的绘制区域,并根据该不规则多边形的切分方法将该不规则绘制命令拆分成多个第三类绘制命令,该多个第三类绘制命令与该多个三角形的绘制区域之间是一一对应关系;When the drawing area corresponding to the irregular drawing command is an irregular polygon, the drawing area of the irregular polygon is divided into a drawing area of a plurality of triangles, and the irregular drawing command is split according to the segmentation method of the irregular polygon. Dividing into a plurality of third class drawing commands, the plurality of third class drawing commands and the drawing regions of the plurality of triangles have a one-to-one correspondence relationship;
针对每个第三类绘制命令,根据该第三类绘制命令的外包矩形信息与绘 制区域信息,获取该第三类绘制命令的最大内接矩形信息;For each third class drawing command, the outsourcing rectangle information and drawing according to the third class drawing command The area information is obtained, and the maximum inscribed rectangle information of the third type drawing command is obtained;
利用该第三类绘制命令的外包矩形信息与最大内接矩形信息,将该第三类绘制命令拆分成一个该第一类绘制命令和至少一个该第二类绘制命令,其中,该第一类绘制命令对应的区域为该第三类绘制命令对应的最大内接矩形,该至少一个第二类绘制命令对应的绘制区域为该第三类绘制命令对应的绘制区域除该最大内接矩形外的边角区域。Using the outsourcing rectangle information and the maximum inscribed rectangle information of the third class drawing command, splitting the third class drawing command into one first class drawing command and at least one second class drawing command, wherein the first The area corresponding to the class drawing command is the largest inscribed rectangle corresponding to the third type drawing command, and the drawing area corresponding to the at least one second type drawing command is the drawing area corresponding to the third type drawing command except the maximum inscribed rectangle. Corner area.
本发明实施例中,图形处理装置1400通过将不规则多边形拆分成多个三角形,再针对每个三角形拆分成一个最大内接矩形和三个边角区域,并根据拆分后的区域将原始绘制命令拆分成多个规则绘制命令和多个新的不规则绘制命令,拆分后的规则绘制命令在经过相交检测后得到若干个新的规则绘制命令,该若干个新的规则绘制命令中有可能会有一个或多个在命令合并操作中被合并,从而能够在一定程度上增加消除过度绘制的效果。In the embodiment of the present invention, the graphics processing apparatus 1400 splits the irregular polygon into a plurality of triangles, and then splits each triangle into a maximum inscribed rectangle and three corner regions, and according to the split region, The original drawing command is split into a plurality of rule drawing commands and a plurality of new irregular drawing commands, and the split rule drawing commands obtain a plurality of new rule drawing commands after the intersection detection, and the plurality of new rule drawing commands It is possible that one or more of them will be merged in the command merge operation, so that the effect of eliminating over-drawing can be increased to some extent.
可选地,命令分组模块1403具体用于通过采用R+树算法,根据外包矩形信息和绘制区域信息,将该多个绘制命令中的规则绘制命令,以及该多个绘制命令中的不规则绘制命令经拆分后的该第一类绘制命令和该第二类绘制命令,分组成多个绘制命令集,使得属于不同绘制命令集的绘制命令互不相交。Optionally, the command grouping module 1403 is specifically configured to: according to the outsourcing rectangle information and the drawing area information, draw a command in the plurality of drawing commands, and an irregular drawing command in the plurality of drawing commands by adopting an R+ tree algorithm. The split first drawing command and the second type drawing command are grouped into a plurality of drawing command sets, so that drawing commands belonging to different drawing command sets do not intersect each other.
本发明实施例中,图形处理装置1400通过采用R+树算法,能够快速地进行绘制命令分组,并使得分组后的每一个绘制命令集控制在一定的规模,从而减少相交检测的时间复杂度,极大程度上提高了图形处理装置的图形处理效率。In the embodiment of the present invention, the graphics processing apparatus 1400 can quickly perform drawing command grouping by using the R+ tree algorithm, and control each drawing command set after grouping to a certain scale, thereby reducing the time complexity of the intersection detection. The graphics processing efficiency of the graphics processing device is greatly improved.
此外,图形处理装置1400还可执行图4、图13的方法,并实现图形处理装置在图4、图13所示实施例中的功能,本发明实施例在此不再赘述。In addition, the graphics processing device 1400 can also perform the functions of the FIG. 4 and FIG. 13 and implement the functions of the graphics processing device in the embodiments shown in FIG. 4 and FIG.
在上述图形处理装置的多个实施例中,应当理解的是,在一种实现方式下,命令收集模块可以是由通信接口来实现,命令拆分模块、命令分组模块、相交检测模块、命令合并模块、执行模块可以是可以由处理器执行存储器中的程序或指令来实现的(换言之,即由处理器以及与所述处理器耦合的存储器中的特殊指令相互配合来实现);在另一种实现方式下,命令收集模块、命令拆分模块、命令分组模块、相交检测模块、命令合并模块和执行模块也可以分别通过专用集成电路(Application Specific Integrated Circuit,ASIC)来实现,具体实现方式参见现有技术,这里不再赘述;本发明包括但不限于 前述实现方式,应当理解的是,只要按照本发明的思想实现的方案,都落入本发明实施例所保护的范围。In various embodiments of the above graphics processing apparatus, it should be understood that, in one implementation, the command collection module may be implemented by a communication interface, a command splitting module, a command grouping module, an intersection detecting module, and a command merge. The module, the execution module may be implemented by a processor executing a program or instruction in a memory (in other words, by a processor and a special instruction in a memory coupled to the processor); in another In the implementation mode, the command collection module, the command splitting module, the command grouping module, the intersection detecting module, the command combining module, and the executing module can also be implemented by an Application Specific Integrated Circuit (ASIC), and the specific implementation manner is as follows. There is technology, no more details here; the invention includes but is not limited to The foregoing implementation manners are understood to be within the scope of the embodiments of the present invention as long as they are implemented according to the embodiments of the present invention.
本发明实施例图形处理装置的一种具体应用方法如图15所示。图15是本发明实施例的图形处理的具体流程示意图。在图15中,应用程序是一个面向用户的产品,需要具备图形处理能力的实体支撑运行。具体地,该应用程序可以是网络游戏、CAD制图工具等等。图形处理装置1400可以对应于图15所示的图形引擎、处理器驱动和处理器的软硬件结合的实现方式(应当理解的是:这里的图形引擎和处理器驱动可以理解为内存中存放的程序或指令)。具体的,应用程序输出的绘制命令经过图形引擎处理后得到一系列新的绘制命令,图形引擎将处理后的一系列新的绘制命令通过处理器驱动发给对应的处理器(例如图形引擎将处理后的一系列新的绘制命令通过数字信号处理(Digital Signal Processing,DSP)驱动(Driver)发给DSP,或通过CPU驱动发给CPU,或通过GPU驱动发给GPU),然后由处理器(例如DSP、CPU或GPU)执行,将最终的渲染结果输出到显示设备(例如图16中的显示单元)中。A specific application method of the graphics processing apparatus of the embodiment of the present invention is shown in FIG. FIG. 15 is a schematic diagram of a specific process of graphics processing according to an embodiment of the present invention. In Figure 15, the application is a user-oriented product that requires physical support for graphics processing. Specifically, the application can be a web game, a CAD drawing tool, or the like. The graphics processing device 1400 may correspond to the implementation of the combination of software and hardware of the graphics engine, the processor driver and the processor shown in FIG. 15 (it should be understood that the graphics engine and the processor driver herein can be understood as programs stored in the memory). Or instruction). Specifically, the drawing command output by the application is processed by the graphics engine to obtain a series of new drawing commands, and the graphics engine sends the processed series of new drawing commands to the corresponding processor through the processor driver (for example, the graphics engine will process After a series of new drawing commands are sent to the DSP by Digital Signal Processing (DSP) driver, or sent to the CPU through the CPU driver, or sent to the GPU through the GPU driver, and then by the processor (for example) The DSP, CPU or GPU executes, and the final rendering result is output to a display device (such as the display unit in Fig. 16).
本发明的上述实施例中的图形处理装置1400可以用硬件、软件或软硬件结合的形式实现,具体地,可实现为一个或多个计算机系统或其它处理系统。The graphics processing apparatus 1400 in the above-described embodiments of the present invention may be implemented in the form of hardware, software, or a combination of hardware and software, and in particular, may be implemented as one or more computer systems or other processing systems.
下面结合图16对图形处理装置的一种示例的实现方式进行介绍,为了便于描述,如下实施例的图形处理装置统称为计算机系统:An exemplary implementation of the graphics processing apparatus will now be described with reference to FIG. 16. For ease of description, the graphics processing apparatus of the following embodiments are collectively referred to as a computer system:
图16是本发明实施例计算机系统1600的结构示意图。本发明的一个实施例如图16所示,计算机系统1600可包括处理器1602、存储器1604、通信接口1601和显示接口1603。16 is a block diagram showing the structure of a computer system 1600 according to an embodiment of the present invention. One embodiment of the present invention, as shown in FIG. 16, computer system 1600 can include a processor 1602, a memory 1604, a communication interface 1601, and a display interface 1603.
处理器1602、存储器1604、通信接口1601和显示接口1603通过通信架构1606互相连接。其中,该通信架构1606可以是总线或网络等。具体地,当通信架构1606为总线时,所述总线可以是ISA总线、PCI总线或EISA总线等。所述总线可以分为地址总线、数据总线、控制总线等。当通信架构1606为网络时,该网络可以是有线网络,例如光纤网络、电话线路等,或无线网络例如小区连接、射频连接或其它通信通道。The processor 1602, the memory 1604, the communication interface 1601, and the display interface 1603 are interconnected by a communication architecture 1606. The communication architecture 1606 can be a bus or a network or the like. Specifically, when the communication architecture 1606 is a bus, the bus may be an ISA bus, a PCI bus, or an EISA bus. The bus can be divided into an address bus, a data bus, a control bus, and the like. When the communication infrastructure 1606 is a network, the network can be a wired network, such as a fiber optic network, a telephone line, etc., or a wireless network such as a cell connection, a radio frequency connection, or other communication channel.
显示接口1603可以连接到显示单元1605。显示单元1605包括显示器(例如,触摸屏、LCD、CRT、全息成像(Holographic)或者投影(Projector) 等)。显示接口1603用于将计算机系统1600的显示数据输出到计算机系统1600所连接的显示单元1605,通过显示单元1605显示。具体地,存储器1603中还可包括帧缓冲区,计算机系统1600在帧缓冲区进行处理显示数据,处理完毕后通过显示接口1603将帧缓冲区的数据输出到显示单元1605。该显示单元1605可用于显示由用户输入的信息或提供给用户的信息以及图形处理装置所在的设备(例如,移动终端、计算机、智能机顶盒、智能一体机,等等)中的各种菜单界面。该显示单元1605可包括显示面板,可选的,可以采用LCD(Liquid Crystal Display,液晶显示器)或OLED(Organic Light-Emitting Diode,有机发光二极管)等形式来配置显示面板。可选地,该显示单元1605还可包括触控面板,该触控面板覆盖在该显示面板上,形成触摸显示屏。Display interface 1603 can be coupled to display unit 1605. Display unit 1605 includes a display (eg, a touch screen, LCD, CRT, Holographic, or Projector) Wait). The display interface 1603 is for outputting the display data of the computer system 1600 to the display unit 1605 to which the computer system 1600 is connected, and is displayed by the display unit 1605. Specifically, the memory 1603 may further include a frame buffer, and the computer system 1600 processes the display data in the frame buffer, and outputs the data of the frame buffer to the display unit 1605 through the display interface 1603 after the processing. The display unit 1605 can be used to display information input by the user or information provided to the user and various menu interfaces in the device (eg, mobile terminal, computer, smart set top box, smart integrated machine, etc.) in which the graphics processing device is located. The display unit 1605 can include a display panel. Alternatively, the display panel can be configured in the form of an LCD (Liquid Crystal Display) or an OLED (Organic Light-Emitting Diode). Optionally, the display unit 1605 can further include a touch panel, the touch panel is overlaid on the display panel to form a touch display screen.
通信接口1601,用于实现计算机系统1600与计算机系统1600外部的设备之间的通信。通信接口1601可将计算机系统1600的数据转换为信号1607,经由通信路径1608发出,或接收来自通信路径1608的信号1607并转换为数据。具体地,该通信接口1601可以是调制解调器、网络接口(例如,以太网接口)、通信端口、PCMCIA扩展槽、PCMCIA扩展卡等等。信号1607可以是光信号、电信号或其它形式的信号。通信路径1608,可以是光纤网络、电话线路、小区连接、射频连接或其它通信通道。 Communication interface 1601 is used to enable communication between computer system 1600 and devices external to computer system 1600. Communication interface 1601 can convert data from computer system 1600 to signal 1607, via communication path 1608, or receive signal 1607 from communication path 1608 and convert to data. In particular, the communication interface 1601 can be a modem, a network interface (eg, an Ethernet interface), a communication port, a PCMCIA expansion slot, a PCMCIA expansion card, and the like. Signal 1607 can be an optical signal, an electrical signal, or other form of signal. Communication path 1608 can be a fiber optic network, a telephone line, a cell connection, a radio frequency connection, or other communication channel.
存储器1604,用于存放程序。具体地,程序可以包括程序代码,所述程序代码包括计算机操作指令。存储器1604可以包括只读存储器和随机存取存储器,并向处理器1602提供指令和数据。存储器1604可能包含高速RAM存储器,也可能还包括非易失性存储器(non-volatile memory),例如至少一个磁盘存储器。The memory 1604 is configured to store a program. In particular, the program can include program code, the program code including computer operating instructions. Memory 1604 can include read only memory and random access memory and provides instructions and data to processor 1602. Memory 1604 may include high speed RAM memory and may also include non-volatile memory, such as at least one disk memory.
处理器1602,执行存储器1604所存放的程序,并具体用于执行以下操作:The processor 1602 executes the program stored in the memory 1604, and is specifically configured to perform the following operations:
接收当前帧输入的命令队列,该命令队列包括多个绘制命令,每个该绘制命令都携带外包矩形信息、执行内容、绘制模式与绘制区域信息,该绘制模式包括覆盖模式、混合模式或等待模式;Receiving a command queue of a current frame input, the command queue includes a plurality of drawing commands, each of which carries an outsourcing rectangle information, an execution content, a drawing mode, and a drawing area information, and the drawing mode includes an overlay mode, a mixed mode, or a standby mode. ;
根据外包矩形信息与绘制区域信息,将该多个绘制命令中的每一个不规则绘制命令拆分成至少一个第一类绘制命令和至少一个第二类绘制命令,其中,该第一类绘制命令的绘制区域为该不规则绘制命令对应的绘制区域内的 矩形,该至少一个第二类绘制命令的绘制区域为该不规则绘制命令对应的绘制区域去掉该至少一个第一类绘制命令的绘制区域后剩余的边角区域,该至少一个第一类绘制命令的绘制模式与该不规则绘制命令的绘制模式相同,该至少一个第二类绘制命令的绘制模式为等待模式;Decoding, according to the outsourcing rectangle information and the drawing area information, each of the plurality of drawing commands into at least one first class drawing command and at least one second class drawing command, wherein the first class drawing command The drawing area is within the drawing area corresponding to the irregular drawing command a rectangle, the drawing area of the at least one second type drawing command is a corner area remaining after the drawing area corresponding to the irregular drawing command is removed from the drawing area of the at least one first type drawing command, and the at least one first type drawing command The drawing mode is the same as the drawing mode of the irregular drawing command, and the drawing mode of the at least one second type drawing command is the waiting mode;
根据外包矩形信息和绘制区域信息,将该多个绘制命令中的规则绘制命令,以及该多个绘制命令中的不规则绘制命令经拆分后的该第一类绘制命令和该第二类绘制命令,分组成多个绘制命令集,使得属于不同绘制命令集的绘制命令互不相交;And according to the outsourcing rectangle information and the drawing area information, the rule drawing command of the plurality of drawing commands, and the first type drawing command and the second class drawing after the irregular drawing drawing command of the plurality of drawing commands are split Commands are grouped into multiple drawing command sets so that drawing commands belonging to different drawing command sets do not intersect each other;
根据外包矩形信息和绘制区域信息,对该多个绘制命令集分别进行相交检测,使得该多个绘制命令集中每一个绘制命令集内绘制命令互不相交;Performing intersection detection on the plurality of drawing command sets according to the outsourcing rectangle information and the drawing area information, so that the drawing commands in each drawing command set in the plurality of drawing command sets do not intersect each other;
根据执行内容、绘制模式和绘制区域信息,对经过相交检测的该多个绘制命令集分别进行绘制命令合并;Performing drawing command combining on the plurality of drawing command sets subjected to intersection detection according to the execution content, the drawing mode, and the drawing area information;
执行每个绘制命令集经合并后的绘制命令。Perform a merged draw command for each draw command set.
上述如本发明图4或图13中任一实施例揭示的图形处理装置执行的方法可以应用于处理器1602中,或者由处理器1602实现。本发明实施例中,计算机系统1600可包括一个或多个处理器1602。处理器1602可能是一种集成电路芯片,具有信号的处理能力。在实现过程中,上述方法的各步骤可以通过处理器1602中的硬件的集成逻辑电路或者软件形式的指令完成。上述的处理器1602可以是通用处理器,包括中央处理器(Central Processing Unit,简称CPU)、网络处理器(Network Processor,简称NP)等;还可以是数字信号处理器(DSP)、专用集成电路(ASIC)、现成可编程门阵列(FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件,或者是专用处理器,例如图形处理器(Graphic Processing Unit,简称PPU)。处理器1602可以实现或者执行本发明实施例中的公开的各方法、步骤及逻辑框图。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。结合本发明实施例所公开的方法的步骤可以直接体现为硬件译码处理器执行完成,或者用译码处理器中的硬件及软件模块组合执行完成。软件模块可以位于随机存储器,闪存、只读存储器,可编程只读存储器或者电可擦写可编程存储器、寄存器等本领域成熟的存储介质中。该存储介质位于存储器1603,处理器1602读取存储器1604中的信息,结合其硬件完成上述方法的步骤。 The method performed by the graphics processing apparatus disclosed in any of the embodiments of FIG. 4 or FIG. 13 of the present invention may be applied to the processor 1602 or implemented by the processor 1602. In an embodiment of the invention, computer system 1600 can include one or more processors 1602. The processor 1602 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method may be completed by an integrated logic circuit of hardware in the processor 1602 or an instruction in a form of software. The processor 1602 may be a general-purpose processor, including a central processing unit (CPU), a network processor (Network Processor, NP for short, etc.; or a digital signal processor (DSP), an application specific integrated circuit. (ASIC), off-the-shelf programmable gate array (FPGA) or other programmable logic device, discrete gate or transistor logic device, discrete hardware component, or dedicated processor, such as a Graphic Processing Unit (PPU). The processor 1602 can implement or perform the various methods, steps, and logic blocks disclosed in the embodiments of the present invention. The general purpose processor may be a microprocessor or the processor or any conventional processor or the like. The steps of the method disclosed in the embodiments of the present invention may be directly implemented by the hardware decoding processor, or may be performed by a combination of hardware and software modules in the decoding processor. The software module can be located in a conventional storage medium such as random access memory, flash memory, read only memory, programmable read only memory or electrically erasable programmable memory, registers, and the like. The storage medium is located in the memory 1603, and the processor 1602 reads the information in the memory 1604 and completes the steps of the above method in combination with its hardware.
本发明实施例中,图形处理装置1600通过将当前帧的命令队列中的不规则绘制命令按绘制区域拆分成规则绘制命令和不规则绘制命令,并将拆分前的规则绘制命令及拆分后的规则绘制命令和不规则绘制命令分组为多个互不相交的绘制命令集,再对每个绘制命令集分别进行相交检测和命令合并,由于将绘制命令分组成多个绘制命令集再进行相交检测能够大大减少相交检测的时间,并且由于将原始不规则绘制命令拆分成规则绘制命令和不规则绘制命令,拆分后的规则绘制命令在经过相交检测后得到若干个新的规则绘制命令,该若干个新的规则绘制命令中有可能会有一个或多个在命令合并操作中被合并,能够在一定程度上增加消除过度绘制的效果,从而能够提高图形处理的性能。In the embodiment of the present invention, the graphics processing apparatus 1600 splits the irregular drawing command in the command queue of the current frame into a rule drawing command and an irregular drawing command according to the drawing area, and draws the command and splits the rule before the splitting. The following rule drawing command and irregular drawing command are grouped into a plurality of mutually dissimilar drawing command sets, and then each drawing command set is respectively subjected to intersection detection and command merging, and the drawing commands are grouped into a plurality of drawing command sets. Intersection detection can greatly reduce the time of intersection detection, and since the original irregular drawing command is split into a rule drawing command and an irregular drawing command, the split rule drawing command obtains several new rule drawing commands after the intersection detection. One or more of the several new rule drawing commands may be merged in the command merge operation, which can increase the effect of eliminating over-drawing to a certain extent, thereby improving the performance of graphics processing.
可选地,作为一个实施例,在用于根据外包矩形信息与绘制区域信息,将该多个绘制命令中的每一个不规则绘制命令拆分成至少一个第一类绘制命令和至少一个第二类绘制命令的过程中,处理器1602具体用于:Optionally, as an embodiment, in the method according to the outsourcing rectangle information and the drawing area information, splitting each of the plurality of drawing commands into at least one first type drawing command and at least one second In the process of class drawing commands, the processor 1602 is specifically configured to:
根据该不规则绘制命令的外包矩形信息与绘制区域信息,获取该不规则绘制命令的最大内接矩形信息;Obtaining a maximum inscribed rectangle information of the irregular drawing command according to the outsourcing rectangle information and the drawing area information of the irregular drawing command;
利用该不规则绘制命令的外包矩形信息与最大内接矩形信息,将该不规则绘制命令拆分成一个该第一类绘制命令和至少一个该第二类绘制命令,其中,该第一类绘制命令对应的区域为该不规则绘制命令对应的最大内接矩形,该至少一个第二类绘制命令对应的绘制区域为该不规则绘制命令对应的绘制区域除该最大内接矩形外的边角区域。Using the outsourcing rectangle information and the maximum inscribed rectangle information of the irregular drawing command, the irregular drawing command is split into a first class drawing command and at least one second class drawing command, wherein the first class drawing The area corresponding to the command is a maximum inscribed rectangle corresponding to the irregular drawing command, and the drawing area corresponding to the at least one second type drawing command is a corner area of the drawing area corresponding to the irregular drawing command except the maximum inscribed rectangle .
本发明实施例中,计算机系统1600通过将绘制区域的形状为的三角形、旋转矩形或椭圆形的原始不规则命令按最大内接矩形拆分成一个规则绘制命令和若干个新的不规则绘制命令,拆分后的规则绘制命令在经过相交检测后得到若干个新的规则绘制命令,该若干个新的规则绘制命令中有可能会有一个或多个在命令合并操作中被合并,从而能够在一定程度上增加消除过度绘制的效果。In the embodiment of the present invention, the computer system 1600 splits the original incomplete command of the triangle, the rotation rectangle or the ellipse with the shape of the drawing area into a rule drawing command and several new irregular drawing commands according to the maximum inscribed rectangle. The split rule drawing command obtains a number of new rule drawing commands after the intersection detection, and one or more of the new rule drawing commands may be merged in the command combining operation, thereby being able to To some extent, the effect of eliminating excessive drawing is increased.
可选地,作为另一个实施例,在用于根据外包矩形信息与绘制区域信息,将该多个绘制命令中的每一个不规则绘制命令拆分成至少一个第一类绘制命令和至少一个第二类绘制命令的过程中,处理器1602具体用于:Optionally, as another embodiment, in the method for splitting each of the plurality of drawing commands into at least one first type drawing command and at least one according to the outsourcing rectangle information and the drawing area information. In the process of drawing a command of the second class, the processor 1602 is specifically configured to:
当该不规则绘制命令对应的绘制区域为不规则多边形时,将该不规则多边形的绘制区域切分成多个三角形的绘制区域,并根据该不规则多边形的切 分方法将该不规则绘制命令拆分成多个第三类绘制命令,该多个第三类绘制命令与该多个三角形的绘制区域之间是一一对应关系;When the drawing area corresponding to the irregular drawing command is an irregular polygon, the drawing area of the irregular polygon is divided into a drawing area of a plurality of triangles, and according to the cutting of the irregular polygon The sub-method divides the irregular drawing command into a plurality of third-type drawing commands, and the plurality of third-class drawing commands have a one-to-one correspondence with the drawing regions of the plurality of triangles;
针对每个第三类绘制命令,根据该第三类绘制命令的外包矩形信息与绘制区域信息,获取该第三类绘制命令的最大内接矩形信息;And for each third type drawing command, obtaining the maximum inscribed rectangle information of the third type drawing command according to the outsourcing rectangle information and the drawing area information of the third type drawing command;
利用该第三类绘制命令的外包矩形信息与最大内接矩形信息,将该第三类绘制命令拆分成一个该第一类绘制命令和至少一个该第二类绘制命令,其中,该第一类绘制命令对应的区域为该第三类绘制命令对应的最大内接矩形,该至少一个第二类绘制命令对应的绘制区域为该第三类绘制命令对应的绘制区域除该最大内接矩形外的边角区域。Using the outsourcing rectangle information and the maximum inscribed rectangle information of the third class drawing command, splitting the third class drawing command into one first class drawing command and at least one second class drawing command, wherein the first The area corresponding to the class drawing command is the largest inscribed rectangle corresponding to the third type drawing command, and the drawing area corresponding to the at least one second type drawing command is the drawing area corresponding to the third type drawing command except the maximum inscribed rectangle. Corner area.
本发明实施例中,计算机系统1600通过将不规则多边形拆分成多个三角形,再针对每个三角形拆分成一个最大内接矩形和三个边角区域,并根据拆分后的区域将原始绘制命令拆分成多个规则绘制命令和多个新的不规则绘制命令,拆分后的规则绘制命令在经过相交检测后得到若干个新的规则绘制命令,该若干个新的规则绘制命令中有可能会有一个或多个在命令合并操作中被合并,从而能够在一定程度上增加消除过度绘制的效果。In the embodiment of the present invention, the computer system 1600 splits the irregular polygon into a plurality of triangles, and then splits each triangle into a maximum inscribed rectangle and three corner regions, and according to the split region, the original The drawing command is split into a plurality of rule drawing commands and a plurality of new irregular drawing commands, and the split rule drawing commands obtain a plurality of new rule drawing commands after the intersection detection, and the plurality of new rule drawing commands are It is possible that one or more of them will be merged in the command merge operation, thereby increasing the effect of eliminating over-drawing to some extent.
可选地,处理器1602具体用于:通过采用R+树算法,根据外包矩形信息和绘制区域信息,将该多个绘制命令中的规则绘制命令,以及该多个绘制命令中的不规则绘制命令经拆分后的该第一类绘制命令和该第二类绘制命令,分组成多个绘制命令集,使得属于不同绘制命令集的绘制命令互不相交。Optionally, the processor 1602 is specifically configured to: according to the outsourcing rectangle information and the drawing area information, draw a command in the plurality of drawing commands, and an irregular drawing command in the multiple drawing commands by adopting an R+ tree algorithm. The split first drawing command and the second type drawing command are grouped into a plurality of drawing command sets, so that drawing commands belonging to different drawing command sets do not intersect each other.
本发明实施例中,计算机系统1600通过采用R+树算法,能够快速地进行绘制命令分组,并使得分组后的每一个绘制命令集控制在一定的规模,从而减少相交检测的时间复杂度,极大程度上提高了图形处理装置的图形处理效率。In the embodiment of the present invention, the computer system 1600 can quickly perform drawing command grouping by using the R+ tree algorithm, and control each drawing command set after grouping to a certain scale, thereby reducing the time complexity of intersection detection, and greatly To a certain extent, the graphics processing efficiency of the graphics processing device is improved.
此外,计算机系统1600还可执行图4、图13的方法,并实现图形处理装置在图4、图13所示实施例中的功能,本发明实施例在此不再赘述。In addition, the computer system 1600 can also perform the functions of the FIG. 4 and FIG. 13 and implement the functions of the graphics processing apparatus in the embodiment shown in FIG. 4 and FIG.
图17是本发明实施例的另一种图形处理方法示意图。图17的方法由图形处理装置执行。具体地,该图形处理装置可以是一个计算机系统,例如图形引擎等,或者是一个图形处理器,例如GPU芯片,等等。如图17所示,该方法包括:FIG. 17 is a schematic diagram of another graphics processing method according to an embodiment of the present invention. The method of Figure 17 is performed by a graphics processing device. Specifically, the graphics processing device may be a computer system such as a graphics engine or the like, or a graphics processor such as a GPU chip, and the like. As shown in FIG. 17, the method includes:
S1710,接收当前帧输入的命令队列。S1710: Receive a command queue of the current frame input.
其中,该命令队列包括多个应用程序编程接口(Application Programming  Interface,API)命令。The command queue includes multiple application programming interfaces (Application Programming Interface, API) command.
S1720,将该多个API命令转换为多个绘制命令。S1720. Convert the plurality of API commands into multiple drawing commands.
其中,每个该绘制命令都携带外包矩形信息、执行内容、绘制模式与绘制区域信息,该绘制模式包括覆盖模式、混合模式或等待模式。Each of the drawing commands carries outsourcing rectangle information, execution content, drawing mode, and drawing area information, and the drawing mode includes an overlay mode, a mixed mode, or a standby mode.
在具体的应用中,可对Android终端中的Skia模块进行改造,新建一个延迟渲染功能的类(SkDeferredMultiCanvas类),并新建一个命令解析模块SkCommand,将Skia的绘制API转换为过度绘制剔除引擎可识别的命令。In a specific application, the Skia module in the Android terminal can be modified, a class of delayed rendering function (SkDeferredMultiCanvas class) is created, and a command parsing module SkCommand is newly created, and the Skia drawing API is converted into an over-drawing culling engine to be recognized. The command.
S1730,根据外包矩形信息与绘制区域信息,将该多个绘制命令中的每一个不规则绘制命令拆分成至少一个第一类绘制命令和至少一个第二类绘制命令。S1730. Split each of the plurality of drawing commands into at least one first type drawing command and at least one second type drawing command according to the outsourcing rectangle information and the drawing area information.
其中,该第一类绘制命令的绘制区域为该不规则绘制命令对应的绘制区域内的矩形,该至少一个第二类绘制命令的绘制区域为该不规则绘制命令对应的绘制区域去掉该至少一个第一类绘制命令的绘制区域后剩余的边角区域,该至少一个第一类绘制命令的绘制模式与该不规则绘制命令的绘制模式相同,该至少一个第二类绘制命令的绘制模式为等待模式The drawing area of the first type of drawing command is a rectangle in the drawing area corresponding to the irregular drawing command, and the drawing area of the at least one second type drawing command is the drawing area corresponding to the irregular drawing command, and the at least one is removed. a drawing area remaining after the drawing area of the first type drawing command, the drawing mode of the at least one first type drawing command is the same as the drawing mode of the irregular drawing command, and the drawing mode of the at least one second type drawing command is waiting mode
步骤S1730的具体实现可参考步骤S420所示实施例及图5。For the specific implementation of step S1730, refer to the embodiment shown in step S420 and FIG. 5.
S1740,根据外包矩形信息和绘制区域信息,将该多个绘制命令中的规则绘制命令,以及该多个绘制命令中的不规则绘制命令经拆分后的该第一类绘制命令和该第二类绘制命令,分组成多个绘制命令集,使得属于不同绘制命令集的绘制命令互不相交。S1740. The rule drawing command in the plurality of drawing commands, and the first type drawing command and the second after the irregular drawing command in the plurality of drawing commands are split according to the outsourcing rectangle information and the drawing area information. Class drawing commands are grouped into multiple drawing command sets so that drawing commands belonging to different drawing command sets do not intersect each other.
步骤S1740的具体实现可参考步骤230所示实施例。For the specific implementation of step S1740, reference may be made to the embodiment shown in step 230.
S1750,根据外包矩形信息和绘制区域信息,对该多个绘制命令集分别进行相交检测,使得该多个绘制命令集中每一个绘制命令集内绘制命令互不相交。S1750: Perform intersection detection on the plurality of drawing command sets according to the outsourcing rectangle information and the drawing area information, so that the drawing commands in each drawing command set in the plurality of drawing command sets do not intersect each other.
S1760,根据执行内容、绘制模式和绘制区域信息,对经过相交检测的该多个绘制命令集分别进行绘制命令合并。S1760: Perform drawing command combining on the plurality of drawing command sets subjected to intersection detection according to the execution content, the drawing mode, and the drawing area information.
步骤S1750和S1760的具体实现可参考现有技术,本发明实施例在此不再赘述。For the specific implementation of the steps S1750 and S1760, reference may be made to the prior art, and details are not described herein again.
S1770,执行每个绘制命令集经合并后的绘制命令。S1770, performing a combined drawing command for each drawing command set.
在渲染调用API时,先被命令解析模块解析成命令放入命令队列,在需要在屏幕上显示时,调用过度绘制剔除引擎处理命令队列,裁剪渲染任务, 然后执行命令,调用真正执行绘制的SkCanvas。When rendering the calling API, the command parsing module first parses the command into the command queue. When it needs to be displayed on the screen, the over-drawing culling engine is called to process the command queue, and the rendering task is cropped. Then execute the command to call the SkCanvas that actually performs the drawing.
修改Android Framework层,调用新的SkDeferredMultiCanvas替代原先的SkCanvas进行绘制。Modify the Android Framework layer and call the new SkDeferredMultiCanvas instead of the original SkCanvas for drawing.
本发明实施例中,通过将当前帧的命令队列中的多个API命令转换为多个绘制命令,再将多个绘制命令中的不规则绘制命令按绘制区域拆分成规则绘制命令和不规则绘制命令,并将拆分前的规则绘制命令及拆分后的规则绘制命令和不规则绘制命令分组为多个互不相交的绘制命令集,再对每个绘制命令集分别进行相交检测和命令合并,由于将绘制命令分组成多个绘制命令集再进行相交检测能够大大减少相交检测的时间,并且由于将原始不规则绘制命令拆分成规则绘制命令和不规则绘制命令,拆分后的规则绘制命令在经过相交检测后得到若干个新的规则绘制命令,该若干个新的规则绘制命令中有可能会有一个或多个在命令合并操作中被合并,能够在一定程度上增加消除过度绘制的效果,从而能够提高图形处理的性能。In the embodiment of the present invention, by converting a plurality of API commands in the command queue of the current frame into multiple drawing commands, the irregular drawing commands in the plurality of drawing commands are divided into rule drawing commands and irregularities according to the drawing area. Draw a command, and group the rule drawing command before splitting and the rule drawing command and the irregular drawing command into a plurality of disjoint drawing command sets, and then perform intersection detection and command respectively for each drawing command set. Merging, since dividing the drawing command into multiple drawing command sets and performing intersection detection can greatly reduce the time of intersection detection, and splitting the original irregular drawing command into a rule drawing command and an irregular drawing command, the split rule The drawing command obtains a number of new rule drawing commands after the intersection detection, and one or more of the several new rule drawing commands may be merged in the command combining operation, which can increase the elimination over-drawing to some extent. The effect of the graphics processing can be improved.
可选地,作为一个实施例,步骤S1730具体实现为:Optionally, as an embodiment, step S1730 is specifically implemented as:
根据该不规则绘制命令的外包矩形信息与绘制区域信息,获取该不规则绘制命令的最大内接矩形信息;Obtaining a maximum inscribed rectangle information of the irregular drawing command according to the outsourcing rectangle information and the drawing area information of the irregular drawing command;
利用该不规则绘制命令的外包矩形信息与最大内接矩形信息,将该不规则绘制命令拆分成一个该第一类绘制命令和至少一个该第二类绘制命令,其中,该第一类绘制命令对应的区域为该不规则绘制命令对应的最大内接矩形,该至少一个第二类绘制命令对应的绘制区域为该不规则绘制命令对应的绘制区域除该最大内接矩形外的边角区域。Using the outsourcing rectangle information and the maximum inscribed rectangle information of the irregular drawing command, the irregular drawing command is split into a first class drawing command and at least one second class drawing command, wherein the first class drawing The area corresponding to the command is a maximum inscribed rectangle corresponding to the irregular drawing command, and the drawing area corresponding to the at least one second type drawing command is a corner area of the drawing area corresponding to the irregular drawing command except the maximum inscribed rectangle .
本发明实施例中,通过将绘制区域的形状为的三角形、旋转矩形或椭圆形的原始不规则命令按最大内接矩形拆分成一个规则绘制命令和若干个新的不规则绘制命令,拆分后的规则绘制命令在经过相交检测后得到若干个新的规则绘制命令,该若干个新的规则绘制命令中有可能会有一个或多个在命令合并操作中被合并,从而能够在一定程度上增加消除过度绘制的效果。In the embodiment of the present invention, the original irregular command of the triangle, the rotation rectangle or the ellipse with the shape of the drawing area is split into a rule drawing command and a plurality of new irregular drawing commands according to the maximum inscribed rectangle, and split. After the rule drawing command, after the intersection detection, several new rule drawing commands are obtained, and one or more of the new rule drawing commands may be merged in the command combining operation, thereby being able to Increase the effect of eliminating overdraw.
可选地,作为另一个实施例,步骤S1730具体实现为:Optionally, as another embodiment, step S1730 is specifically implemented as:
当该不规则绘制命令对应的绘制区域为不规则多边形时,将该不规则多边形的绘制区域切分成多个三角形的绘制区域,并根据该不规则多边形的切分方法将该不规则绘制命令拆分成多个第三类绘制命令,该多个第三类绘制命令与该多个三角形的绘制区域之间是一一对应关系; When the drawing area corresponding to the irregular drawing command is an irregular polygon, the drawing area of the irregular polygon is divided into a drawing area of a plurality of triangles, and the irregular drawing command is split according to the segmentation method of the irregular polygon. Dividing into a plurality of third class drawing commands, the plurality of third class drawing commands and the drawing regions of the plurality of triangles have a one-to-one correspondence relationship;
针对每个第三类绘制命令,根据该第三类绘制命令的外包矩形信息与绘制区域信息,获取该第三类绘制命令的最大内接矩形信息;And for each third type drawing command, obtaining the maximum inscribed rectangle information of the third type drawing command according to the outsourcing rectangle information and the drawing area information of the third type drawing command;
利用该第三类绘制命令的外包矩形信息与最大内接矩形信息,将该第三类绘制命令拆分成一个该第一类绘制命令和至少一个该第二类绘制命令,其中,该第一类绘制命令对应的区域为该第三类绘制命令对应的最大内接矩形,该至少一个第二类绘制命令对应的绘制区域为该第三类绘制命令对应的绘制区域除该最大内接矩形外的边角区域。Using the outsourcing rectangle information and the maximum inscribed rectangle information of the third class drawing command, splitting the third class drawing command into one first class drawing command and at least one second class drawing command, wherein the first The area corresponding to the class drawing command is the largest inscribed rectangle corresponding to the third type drawing command, and the drawing area corresponding to the at least one second type drawing command is the drawing area corresponding to the third type drawing command except the maximum inscribed rectangle. Corner area.
本发明实施例中,通过将不规则多边形拆分成多个三角形,再针对每个三角形拆分成一个最大内接矩形和三个边角区域,并根据拆分后的区域将原始绘制命令拆分成多个规则绘制命令和多个新的不规则绘制命令,拆分后的规则绘制命令在经过相交检测后得到若干个新的规则绘制命令,该若干个新的规则绘制命令中有可能会有一个或多个在命令合并操作中被合并,从而能够在一定程度上增加消除过度绘制的效果。In the embodiment of the present invention, by splitting the irregular polygon into a plurality of triangles, each triangle is split into a maximum inscribed rectangle and three corner regions, and the original drawing command is removed according to the split region. Divided into a plurality of rule drawing commands and a plurality of new irregular drawing commands, the split rule drawing commands obtain a number of new rule drawing commands after the intersection detection, and the new rule drawing commands may be One or more of them are merged in the command merge operation, so that the effect of eliminating over-drawing can be increased to some extent.
可选地,步骤S1740具体实现为:通过采用R+树算法,根据外包矩形信息和绘制区域信息,将该多个绘制命令中的规则绘制命令,以及该多个绘制命令中的不规则绘制命令经拆分后的该第一类绘制命令和该第二类绘制命令,分组成多个绘制命令集,使得属于不同绘制命令集的绘制命令互不相交。Optionally, step S1740 is specifically implemented by: using an R+tree algorithm, according to the outsourcing rectangle information and the drawing area information, the rule drawing command in the plurality of drawing commands, and the irregular drawing command in the plurality of drawing commands The split first type drawing command and the second type drawing command are grouped into a plurality of drawing command sets, so that drawing commands belonging to different drawing command sets do not intersect each other.
本发明实施例中,通过采用R+树算法,能够快速地进行绘制命令分组,并使得分组后的每一个绘制命令集控制在一定的规模,从而减少相交检测的时间复杂度,极大程度上提高了图形处理装置的图形处理效率。In the embodiment of the present invention, by using the R+ tree algorithm, the drawing command grouping can be quickly performed, and each drawing command set after grouping is controlled to a certain scale, thereby reducing the time complexity of the intersection detection and greatly improving the time complexity. The graphics processing efficiency of the graphics processing device.
图18是本发明实施例图形处理装置1800的结构示意图。如图18所示,图形处理装置1800可包括:命令收集模块1801、命令转换模块1802、命令拆分模块1803、命令分组模块1804、相交检测模块1805、命令合并模块1806和执行模块1807。其中,FIG. 18 is a schematic structural diagram of a graphics processing apparatus 1800 according to an embodiment of the present invention. As shown in FIG. 18, the graphics processing apparatus 1800 may include a command collection module 1801, a command conversion module 1802, a command splitting module 1803, a command grouping module 1804, an intersection detecting module 1805, a command combining module 1806, and an executing module 1807. among them,
命令收集模块1801,用于接收当前帧输入的命令队列,该命令队列包括多个API命令。The command collection module 1801 is configured to receive a command queue of a current frame input, where the command queue includes a plurality of API commands.
命令转换模块1802,用于将该多个API命令转换为多个绘制命令,每个该绘制命令都携带外包矩形信息、执行内容、绘制模式与绘制区域信息,该绘制模式包括覆盖模式、混合模式或等待模式。The command conversion module 1802 is configured to convert the plurality of API commands into a plurality of drawing commands, each of the drawing commands carrying outsourcing rectangle information, execution content, drawing mode, and drawing area information, where the drawing mode includes an overlay mode and a mixed mode. Or wait mode.
命令拆分模块1803,用于根据外包矩形信息与绘制区域信息,将该多个 绘制命令中的每一个不规则绘制命令拆分成至少一个第一类绘制命令和至少一个第二类绘制命令。其中,该第一类绘制命令的绘制区域为该不规则绘制命令对应的绘制区域内的矩形,该至少一个第二类绘制命令的绘制区域为该不规则绘制命令对应的绘制区域去掉该至少一个第一类绘制命令的绘制区域后剩余的边角区域,该至少一个第一类绘制命令的绘制模式与该不规则绘制命令的绘制模式相同,该至少一个第二类绘制命令的绘制模式为等待模式。The command splitting module 1803 is configured to, according to the outsourcing rectangle information and the drawing area information, the plurality of Each of the irregular drawing commands in the drawing command is split into at least one first type drawing command and at least one second type drawing command. The drawing area of the first type of drawing command is a rectangle in the drawing area corresponding to the irregular drawing command, and the drawing area of the at least one second type drawing command is the drawing area corresponding to the irregular drawing command, and the at least one is removed. a drawing area remaining after the drawing area of the first type drawing command, the drawing mode of the at least one first type drawing command is the same as the drawing mode of the irregular drawing command, and the drawing mode of the at least one second type drawing command is waiting mode.
命令分组模块1804,用于根据外包矩形信息和绘制区域信息,将该多个绘制命令中的规则绘制命令,以及该多个绘制命令中的不规则绘制命令经拆分后的该第一类绘制命令和该第二类绘制命令,分组成多个绘制命令集,使得属于不同绘制命令集的绘制命令互不相交。The command grouping module 1804 is configured to: according to the outsourcing rectangle information and the drawing area information, the rule drawing command of the plurality of drawing commands, and the first drawing of the irregular drawing command of the plurality of drawing commands after the splitting The command and the second type of drawing command are grouped into a plurality of drawing command sets such that drawing commands belonging to different drawing command sets do not intersect each other.
相交检测模块1805,用于根据外包矩形信息和绘制区域信息,对该多个绘制命令集分别进行相交检测,使得该多个绘制命令集中每一个绘制命令集内绘制命令互不相交。The intersection detecting module 1805 is configured to perform intersection detection on the plurality of drawing command sets according to the outsourcing rectangle information and the drawing area information, so that the drawing commands in each drawing command set in the plurality of drawing command sets do not intersect each other.
命令合并模块1806,用于根据执行内容、绘制模式和绘制区域信息,对经过相交检测的该多个绘制命令集分别进行绘制命令合并。The command merging module 1806 is configured to separately perform drawing command merging on the plurality of drawing command sets that have undergone intersection detection according to the execution content, the drawing mode, and the drawing area information.
执行模块1807,用于执行每个绘制命令集经合并后的绘制命令。The execution module 1807 is configured to execute the merged drawing command for each drawing command set.
本发明实施例中,图形处理装置1800通过将当前帧的命令队列中的多个API命令转换为多个绘制命令,再将多个绘制命令中的不规则绘制命令按绘制区域拆分成规则绘制命令和不规则绘制命令,并将拆分前的规则绘制命令及拆分后的规则绘制命令和不规则绘制命令分组为多个互不相交的绘制命令集,再对每个绘制命令集分别进行相交检测和命令合并,由于将绘制命令分组成多个绘制命令集再进行相交检测能够大大减少相交检测的时间,并且由于将原始不规则绘制命令拆分成规则绘制命令和不规则绘制命令,拆分后的规则绘制命令在经过相交检测后得到若干个新的规则绘制命令,该若干个新的规则绘制命令中有可能会有一个或多个在命令合并操作中被合并,能够在一定程度上增加消除过度绘制的效果,从而能够提高图形处理的性能。In the embodiment of the present invention, the graphics processing apparatus 1800 converts multiple API commands in the command queue of the current frame into multiple drawing commands, and then divides the irregular drawing commands of the multiple drawing commands into rules according to the drawing area. The command and the irregular drawing command, and the rule drawing command before the splitting and the split rule drawing command and the irregular drawing command are grouped into a plurality of mutually dissimilar drawing command sets, and then each drawing command set is separately performed. Intersection detection and command merging, since the drawing commands are grouped into multiple drawing command sets and then intersected detection can greatly reduce the time of intersection detection, and since the original irregular drawing command is split into a rule drawing command and an irregular drawing command, The divided rule drawing command obtains several new rule drawing commands after the intersection detection, and one or more of the several new rule drawing commands may be merged in the command combining operation, which can be to some extent Increase the effect of eliminating over-draw, which can improve the performance of graphics processing.
可选地,作为一个实施例,该命令拆分模块1803具体用于:Optionally, as an embodiment, the command splitting module 1803 is specifically configured to:
根据该不规则绘制命令的外包矩形信息与绘制区域信息,获取该不规则绘制命令的最大内接矩形信息。And obtaining the maximum inscribed rectangle information of the irregular drawing command according to the outsourcing rectangle information and the drawing area information of the irregular drawing command.
利用该不规则绘制命令的外包矩形信息与最大内接矩形信息,将该不规 则绘制命令拆分成一个该第一类绘制命令和至少一个该第二类绘制命令,其中,该第一类绘制命令对应的区域为该不规则绘制命令对应的最大内接矩形,该至少一个第二类绘制命令对应的绘制区域为该不规则绘制命令对应的绘制区域除该最大内接矩形外的边角区域。Using the outsourcing rectangle information of the irregular drawing command and the maximum inscribed rectangle information, the irregularity is The drawing command is split into a first type drawing command and at least one second type drawing command, wherein the area corresponding to the first type drawing command is a maximum inscribed rectangle corresponding to the irregular drawing command, the at least one The drawing area corresponding to the second type of drawing command is a corner area of the drawing area corresponding to the irregular drawing command except the maximum inscribed rectangle.
本发明实施例中,图形处理装置1800通过将绘制区域的形状为的三角形、旋转矩形或椭圆形的原始不规则命令按最大内接矩形拆分成一个规则绘制命令和若干个新的不规则绘制命令,拆分后的规则绘制命令在经过相交检测后得到若干个新的规则绘制命令,该若干个新的规则绘制命令中有可能会有一个或多个在命令合并操作中被合并,从而能够在一定程度上增加消除过度绘制的效果。In the embodiment of the present invention, the graphics processing apparatus 1800 splits the original irregular command of the triangle, the rotation rectangle, or the ellipse with the shape of the drawing area into a rule drawing command and several new irregular drawing according to the maximum inscribed rectangle. The command, the split rule drawing command obtains a number of new rule drawing commands after the intersection detection, and one or more of the new rule drawing commands may be merged in the command merge operation, thereby enabling To some extent, the effect of eliminating over-drawing is increased.
可选地,作为另一个实施例,该命令拆分模块1803具体用于:Optionally, as another embodiment, the command splitting module 1803 is specifically configured to:
当该不规则绘制命令对应的绘制区域为不规则多边形时,将该不规则多边形的绘制区域切分成多个三角形的绘制区域,并根据该不规则多边形的切分方法将该不规则绘制命令拆分成多个第三类绘制命令,该多个第三类绘制命令与该多个三角形的绘制区域之间是一一对应关系。When the drawing area corresponding to the irregular drawing command is an irregular polygon, the drawing area of the irregular polygon is divided into a drawing area of a plurality of triangles, and the irregular drawing command is split according to the segmentation method of the irregular polygon. The method is divided into a plurality of third class drawing commands, and the plurality of third class drawing commands have a one-to-one correspondence with the drawing regions of the plurality of triangles.
针对每个第三类绘制命令,根据该第三类绘制命令的外包矩形信息与绘制区域信息,获取该第三类绘制命令的最大内接矩形信息。For each third type drawing command, the maximum inscribed rectangle information of the third type drawing command is obtained according to the outsourcing rectangle information and the drawing area information of the third type drawing command.
利用该第三类绘制命令的外包矩形信息与最大内接矩形信息,将该第三类绘制命令拆分成一个该第一类绘制命令和至少一个该第二类绘制命令,其中,该第一类绘制命令对应的区域为该第三类绘制命令对应的最大内接矩形,该至少一个第二类绘制命令对应的绘制区域为该第三类绘制命令对应的绘制区域除该最大内接矩形外的边角区域。Using the outsourcing rectangle information and the maximum inscribed rectangle information of the third class drawing command, splitting the third class drawing command into one first class drawing command and at least one second class drawing command, wherein the first The area corresponding to the class drawing command is the largest inscribed rectangle corresponding to the third type drawing command, and the drawing area corresponding to the at least one second type drawing command is the drawing area corresponding to the third type drawing command except the maximum inscribed rectangle. Corner area.
本发明实施例中,图形处理装置1800通过将不规则多边形拆分成多个三角形,再针对每个三角形拆分成一个最大内接矩形和三个边角区域,并根据拆分后的区域将原始绘制命令拆分成多个规则绘制命令和多个新的不规则绘制命令,拆分后的规则绘制命令在经过相交检测后得到若干个新的规则绘制命令,该若干个新的规则绘制命令中有可能会有一个或多个在命令合并操作中被合并,从而能够在一定程度上增加消除过度绘制的效果。In the embodiment of the present invention, the graphics processing apparatus 1800 splits the irregular polygon into a plurality of triangles, and then splits each triangle into a maximum inscribed rectangle and three corner regions, and according to the split region, The original drawing command is split into a plurality of rule drawing commands and a plurality of new irregular drawing commands, and the split rule drawing commands obtain a plurality of new rule drawing commands after the intersection detection, and the plurality of new rule drawing commands It is possible that one or more of them will be merged in the command merge operation, so that the effect of eliminating over-drawing can be increased to some extent.
可选地,命令分组模块1804具体用于通过采用R+树算法,根据外包矩形信息和绘制区域信息,将该多个绘制命令中的规则绘制命令,以及该多个绘制命令中的不规则绘制命令经拆分后的该第一类绘制命令和该第二类绘 制命令,分组成多个绘制命令集,使得属于不同绘制命令集的绘制命令互不相交。Optionally, the command grouping module 1804 is specifically configured to: according to the outsourcing rectangle information and the drawing area information, draw a command in the plurality of drawing commands, and an irregular drawing command in the plurality of drawing commands by adopting an R+ tree algorithm. The first type of drawing command and the second type of drawing after splitting Commands are grouped into multiple drawing command sets so that drawing commands belonging to different drawing command sets do not intersect each other.
本发明实施例中,图形处理装置1800通过采用R+树算法,能够快速地进行绘制命令分组,并使得分组后的每一个绘制命令集控制在一定的规模,从而减少相交检测的时间复杂度,极大程度上提高了图形处理装置的图形处理效率。In the embodiment of the present invention, the graphics processing apparatus 1800 can quickly perform drawing command grouping by using the R+ tree algorithm, and control each drawing command set after grouping to a certain scale, thereby reducing the time complexity of the intersection detection. The graphics processing efficiency of the graphics processing device is greatly improved.
此外,图形处理装置1800还可执行图17的方法,并实现图形处理装置在图17所示实施例中的功能,本发明实施例在此不再赘述。In addition, the graphics processing device 1800 can also perform the method of FIG. 17 and implement the functions of the graphics processing device in the embodiment shown in FIG.
在上述图形处理装置的多个实施例中,应当理解的是,在一种实现方式下,命令收集模块可以是由通信接口来实现,命令拆分模块、命令分组模块、相交检测模块、命令合并模块、执行模块可以是可以由处理器执行存储器中的程序或指令来实现的(换言之,即由处理器以及与所述处理器耦合的存储器中的特殊指令相互配合来实现);在另一种实现方式下,命令收集模块、命令拆分模块、命令分组模块、相交检测模块、命令合并模块和执行模块也可以分别通过专用集成电路(Application Specific Integrated Circuit,ASIC)来实现,具体实现方式参见现有技术,这里不再赘述;本发明包括但不限于前述实现方式,应当理解的是,只要按照本发明的思想实现的方案,都落入本发明实施例所保护的范围。In various embodiments of the above graphics processing apparatus, it should be understood that, in one implementation, the command collection module may be implemented by a communication interface, a command splitting module, a command grouping module, an intersection detecting module, and a command merge. The module, the execution module may be implemented by a processor executing a program or instruction in a memory (in other words, by a processor and a special instruction in a memory coupled to the processor); in another In the implementation mode, the command collection module, the command splitting module, the command grouping module, the intersection detecting module, the command combining module, and the executing module can also be implemented by an Application Specific Integrated Circuit (ASIC), and the specific implementation manner is as follows. The present invention is not limited to the foregoing embodiments; the present invention includes, but is not limited to, the foregoing implementations, and it should be understood that the solutions that are implemented according to the inventive concept are within the scope of the embodiments of the present invention.
本发明实施例图形处理装置的一种具体应用方法如图19所示。图19是本发明实施例的图形处理的具体流程示意图。在图19中,应用程序是一个面向用户的产品,需要具备图形处理能力的实体支撑运行。具体地,该应用程序可以是网络游戏、CAD制图工具等等。图形处理装置1800可以对应于图19所示的图形引擎、处理器驱动和处理器的软硬件结合的实现方式(应当理解的是:这里的图形引擎和处理器驱动可以理解为内存中存放的程序或指令)。具体的,应用程序输出的绘制命令经过图形引擎处理后得到一系列新的绘制命令,图形引擎将处理后的一系列新的绘制命令通过处理器驱动发给对应的处理器(例如图形引擎将处理后的一系列新的绘制命令通过数字信号处理(Digital Signal Processing,DSP)驱动(Driver)发给DSP,或通过CPU驱动发给CPU,或通过GPU驱动发给GPU),然后由处理器(例如DSP、CPU或GPU)执行,将最终的渲染结果输出到显示设备(例如图20中的显示单元)中。 A specific application method of the graphics processing apparatus in the embodiment of the present invention is shown in FIG. FIG. 19 is a schematic diagram of a specific process of graphics processing according to an embodiment of the present invention. In Figure 19, the application is a user-oriented product that requires physical support for graphics processing. Specifically, the application can be a web game, a CAD drawing tool, or the like. The graphics processing device 1800 can correspond to the implementation of the combination of software and hardware of the graphics engine, the processor driver and the processor shown in FIG. 19 (it should be understood that the graphics engine and the processor driver herein can be understood as programs stored in the memory). Or instruction). Specifically, the drawing command output by the application is processed by the graphics engine to obtain a series of new drawing commands, and the graphics engine sends the processed series of new drawing commands to the corresponding processor through the processor driver (for example, the graphics engine will process After a series of new drawing commands are sent to the DSP by Digital Signal Processing (DSP) driver, or sent to the CPU through the CPU driver, or sent to the GPU through the GPU driver, and then by the processor (for example) The DSP, CPU or GPU executes, and the final rendering result is output to a display device (such as the display unit in Fig. 20).
下面结合图20对图形处理装置的一种示例的实现方式进行介绍,为了便于描述,如下实施例的图形处理装置统称为计算机系统:An exemplary implementation of the graphics processing apparatus will now be described with reference to FIG. 20. For ease of description, the graphics processing apparatus of the following embodiments are collectively referred to as a computer system:
图20是本发明实施例计算机系统2000的结构示意图。本发明的一个实施例如图20所示,计算机系统2000可包括处理器2002、存储器2004、通信接口2001和显示接口2003。FIG. 20 is a schematic structural diagram of a computer system 2000 according to an embodiment of the present invention. One embodiment of the present invention, as shown in FIG. 20, computer system 2000 can include a processor 2002, a memory 2004, a communication interface 2001, and a display interface 2003.
处理器2002、存储器2004、通信接口2001和显示接口2003通过通信架构2006互相连接。其中,该通信架构2006可以是总线或网络等。具体地,当通信架构2006为总线时,所述总线可以是ISA总线、PCI总线或EISA总线等。所述总线可以分为地址总线、数据总线、控制总线等。当通信架构2006为网络时,该网络可以是有线网络,例如光纤网络、电话线路等,或无线网络例如小区连接、射频连接或其它通信通道。The processor 2002, the memory 2004, the communication interface 2001, and the display interface 2003 are interconnected by a communication architecture 2006. The communication architecture 2006 can be a bus or a network. Specifically, when the communication architecture 2006 is a bus, the bus may be an ISA bus, a PCI bus, or an EISA bus. The bus can be divided into an address bus, a data bus, a control bus, and the like. When the communication infrastructure 2006 is a network, the network may be a wired network, such as a fiber optic network, a telephone line, etc., or a wireless network such as a cell connection, a radio frequency connection, or other communication channel.
显示接口2003可以连接到显示单元2005。显示单元2005包括显示器(例如,触摸屏、LCD、CRT、全息成像(Holographic)或者投影(Projector)等)。显示接口2003用于将计算机系统2000的显示数据输出到显示单元2005,通过显示单元2005显示。具体地,存储器2003中还可包括帧缓冲区,计算机系统2000在帧缓冲区进行处理显示数据,处理完毕后通过显示接口2003将帧缓冲区的数据输出到显示单元2005。该显示单元2005可用于显示由用户输入的信息或提供给用户的信息以及图形处理装置所在的设备(例如,移动终端、计算机、智能机顶盒、智能一体机,等等)中的各种菜单界面。该显示单元2005可包括显示面板,可选的,可以采用LCD(Liquid Crystal Display,液晶显示器)或OLED(Organic Light-Emitting Diode,有机发光二极管)等形式来配置显示面板。可选地,该显示单元2005还可包括触控面板,该触控面板覆盖在该显示面板上,形成触摸显示屏。The display interface 2003 can be connected to the display unit 2005. The display unit 2005 includes a display (eg, a touch screen, an LCD, a CRT, a Holographic or Projector, etc.). The display interface 2003 is for outputting display data of the computer system 2000 to the display unit 2005, and is displayed by the display unit 2005. Specifically, the memory 2003 may further include a frame buffer, and the computer system 2000 processes the display data in the frame buffer, and outputs the data of the frame buffer to the display unit 2005 through the display interface 2003 after the processing. The display unit 2005 can be used to display information input by the user or information provided to the user and various menu interfaces in the device (eg, mobile terminal, computer, smart set top box, smart integrated machine, etc.) in which the graphics processing device is located. The display unit 2005 may include a display panel. Alternatively, the display panel may be configured in the form of an LCD (Liquid Crystal Display) or an OLED (Organic Light-Emitting Diode). Optionally, the display unit 2005 further includes a touch panel, and the touch panel is overlaid on the display panel to form a touch display screen.
通信接口2001,用于实现计算机系统2000与计算机系统2000外部的设备之间的通信。通信接口2001可将计算机系统2000的数据转换为信号2007,经由通信路径2008发出,或接收来自通信路径2008的信号2007并转换为数据。具体地,该通信接口2001可以是调制解调器、网络接口(例如,以太网接口)、通信端口、PCMCIA扩展槽、PCMCIA扩展卡等等。信号2007可以是光信号、电信号或其它形式的信号。通信路径2008,可以是光纤网络、电话线路、小区连接、射频连接或其它通信通道。The communication interface 2001 is for implementing communication between the computer system 2000 and devices external to the computer system 2000. Communication interface 2001 may convert data from computer system 2000 to signal 2007, via communication path 2008, or receive signal 2007 from communication path 2008 and convert to data. In particular, the communication interface 2001 can be a modem, a network interface (eg, an Ethernet interface), a communication port, a PCMCIA expansion slot, a PCMCIA expansion card, and the like. Signal 2007 can be an optical signal, an electrical signal, or other form of signal. The communication path 2008 can be a fiber optic network, a telephone line, a cell connection, a radio frequency connection, or other communication channel.
存储器2004,用于存放程序。具体地,程序可以包括程序代码,所述程 序代码包括计算机操作指令。存储器2004可以包括只读存储器和随机存取存储器,并向处理器2002提供指令和数据。存储器2004可能包含高速RAM存储器,也可能还包括非易失性存储器(non-volatile memory),例如至少一个磁盘存储器。The memory 2004 is used to store programs. Specifically, the program may include program code, the process The sequence code includes computer operating instructions. Memory 2004 can include read only memory and random access memory and provides instructions and data to processor 2002. The memory 2004 may include a high speed RAM memory and may also include a non-volatile memory such as at least one disk memory.
处理器2002,执行存储器2004所存放的程序,并具体用于执行以下操作:The processor 2002 executes the program stored in the memory 2004, and is specifically configured to perform the following operations:
接收当前帧输入的命令队列,该命令队列包括多个应用程序编程接口API命令;Receiving a command queue of a current frame input, the command queue including a plurality of application programming interface API commands;
将该多个API命令转换为多个绘制命令,每个该绘制命令都携带外包矩形信息、执行内容、绘制模式与绘制区域信息,该绘制模式包括覆盖模式、混合模式或等待模式;Converting the plurality of API commands into a plurality of drawing commands, each of the drawing commands carrying outsourcing rectangle information, execution content, drawing mode, and drawing area information, the drawing mode including an overlay mode, a mixed mode, or a waiting mode;
根据外包矩形信息与绘制区域信息,将该多个绘制命令中的每一个不规则绘制命令拆分成至少一个第一类绘制命令和至少一个第二类绘制命令,其中,该第一类绘制命令的绘制区域为该不规则绘制命令对应的绘制区域内的矩形,该至少一个第二类绘制命令的绘制区域为该不规则绘制命令对应的绘制区域去掉该至少一个第一类绘制命令的绘制区域后剩余的边角区域,该至少一个第一类绘制命令的绘制模式与该不规则绘制命令的绘制模式相同,该至少一个第二类绘制命令的绘制模式为等待模式;Decoding, according to the outsourcing rectangle information and the drawing area information, each of the plurality of drawing commands into at least one first class drawing command and at least one second class drawing command, wherein the first class drawing command The drawing area is a rectangle in the drawing area corresponding to the irregular drawing command, and the drawing area of the at least one second type drawing command is a drawing area corresponding to the irregular drawing command, and the drawing area of the at least one first type drawing command is removed. a remaining corner area, a drawing mode of the at least one first type drawing command is the same as a drawing mode of the irregular drawing command, and a drawing mode of the at least one second type drawing command is a waiting mode;
根据外包矩形信息和绘制区域信息,将该多个绘制命令中的规则绘制命令,以及该多个绘制命令中的不规则绘制命令经拆分后的该第一类绘制命令和该第二类绘制命令,分组成多个绘制命令集,使得属于不同绘制命令集的绘制命令互不相交;And according to the outsourcing rectangle information and the drawing area information, the rule drawing command of the plurality of drawing commands, and the first type drawing command and the second class drawing after the irregular drawing drawing command of the plurality of drawing commands are split Commands are grouped into multiple drawing command sets so that drawing commands belonging to different drawing command sets do not intersect each other;
根据外包矩形信息和绘制区域信息,对该多个绘制命令集分别进行相交检测,使得该多个绘制命令集中每一个绘制命令集内绘制命令互不相交;Performing intersection detection on the plurality of drawing command sets according to the outsourcing rectangle information and the drawing area information, so that the drawing commands in each drawing command set in the plurality of drawing command sets do not intersect each other;
根据执行内容、绘制模式和绘制区域信息,对经过相交检测的该多个绘制命令集分别进行绘制命令合并;Performing drawing command combining on the plurality of drawing command sets subjected to intersection detection according to the execution content, the drawing mode, and the drawing area information;
执行每个绘制命令集经合并后的绘制命令。Perform a merged draw command for each draw command set.
上述如本发明图17中任一实施例揭示的图形处理装置执行的方法可以应用于处理器2002中,或者由处理器2002实现。本发明实施例中,计算机系统2000可包括一个或多个处理器2002。处理器2002可能是一种集成电路芯片,具有信号的处理能力。在实现过程中,上述方法的各步骤可以通过处 理器2002中的硬件的集成逻辑电路或者软件形式的指令完成。上述的处理器2002可以是通用处理器,包括中央处理器(Central Processing Unit,简称CPU)、网络处理器(Network Processor,简称NP)等;还可以是数字信号处理器(DSP)、专用集成电路(ASIC)、现成可编程门阵列(FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件,或者是专用处理器,例如图形处理器(Graphic Processing Unit,简称PPU)。处理器2002可以实现或者执行本发明实施例中的公开的各方法、步骤及逻辑框图。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。结合本发明实施例所公开的方法的步骤可以直接体现为硬件译码处理器执行完成,或者用译码处理器中的硬件及软件模块组合执行完成。软件模块可以位于随机存储器,闪存、只读存储器,可编程只读存储器或者电可擦写可编程存储器、寄存器等本领域成熟的存储介质中。该存储介质位于存储器2003,处理器2002读取存储器2004中的信息,结合其硬件完成上述方法的步骤。The method performed by the graphics processing apparatus disclosed in any of the embodiments of FIG. 17 of the present invention may be applied to the processor 2002 or implemented by the processor 2002. In an embodiment of the invention, computer system 2000 may include one or more processors 2002. Processor 2002 may be an integrated circuit chip with signal processing capabilities. In the implementation process, the steps of the above method can be adopted The integrated logic circuit of the hardware in the processor 2002 or the instruction in the form of software is completed. The processor 2002 may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP Processor, etc.), or a digital signal processor (DSP), an application specific integrated circuit. (ASIC), off-the-shelf programmable gate array (FPGA) or other programmable logic device, discrete gate or transistor logic device, discrete hardware component, or dedicated processor, such as a Graphic Processing Unit (PPU). The processor 2002 can implement or perform the various methods, steps, and logic blocks disclosed in the embodiments of the present invention. The general purpose processor may be a microprocessor or the processor or any conventional processor or the like. The steps of the method disclosed in the embodiments of the present invention may be directly implemented by the hardware decoding processor, or may be performed by a combination of hardware and software modules in the decoding processor. The software module can be located in a conventional storage medium such as random access memory, flash memory, read only memory, programmable read only memory or electrically erasable programmable memory, registers, and the like. The storage medium is located in the memory 2003, and the processor 2002 reads the information in the memory 2004 and performs the steps of the above method in combination with its hardware.
本发明实施例中,计算机系统2000通过将当前帧的命令队列中的多个API命令转换为多个绘制命令,再将多个绘制命令中的不规则绘制命令按绘制区域拆分成规则绘制命令和不规则绘制命令,并将拆分前的规则绘制命令及拆分后的规则绘制命令和不规则绘制命令分组为多个互不相交的绘制命令集,再对每个绘制命令集分别进行相交检测和命令合并,由于将绘制命令分组成多个绘制命令集再进行相交检测能够大大减少相交检测的时间,并且由于将原始不规则绘制命令拆分成规则绘制命令和不规则绘制命令,拆分后的规则绘制命令在经过相交检测后得到若干个新的规则绘制命令,该若干个新的规则绘制命令中有可能会有一个或多个在命令合并操作中被合并,能够在一定程度上增加消除过度绘制的效果,从而能够提高图形处理的性能。In the embodiment of the present invention, the computer system 2000 converts multiple API commands in the command queue of the current frame into multiple drawing commands, and then splits the irregular drawing commands of the multiple drawing commands into rule drawing commands according to the drawing area. And irregularly drawing commands, and grouping the rule drawing commands before splitting and the split rule drawing commands and irregular drawing commands into a plurality of mutually disjoint drawing command sets, and then respectively intersecting each drawing command set Detection and command merging, since dividing the drawing command into multiple drawing command sets and performing intersection detection can greatly reduce the time of intersection detection, and splitting the original irregular drawing command into a rule drawing command and an irregular drawing command, splitting After the rule drawing command, after the intersection detection, several new rule drawing commands are obtained, and one or more of the new rule drawing commands may be merged in the command combining operation, which can be increased to some extent. Eliminate the effects of over-drawing, which can improve the performance of graphics processing.
可选地,作为一个实施例,在用于根据外包矩形信息与绘制区域信息,将该多个绘制命令中的每一个不规则绘制命令拆分成至少一个第一类绘制命令和至少一个第二类绘制命令的过程中,处理器2002具体用于:Optionally, as an embodiment, in the method according to the outsourcing rectangle information and the drawing area information, splitting each of the plurality of drawing commands into at least one first type drawing command and at least one second In the process of class drawing commands, the processor 2002 is specifically used to:
根据该不规则绘制命令的外包矩形信息与绘制区域信息,获取该不规则绘制命令的最大内接矩形信息;Obtaining a maximum inscribed rectangle information of the irregular drawing command according to the outsourcing rectangle information and the drawing area information of the irregular drawing command;
利用该不规则绘制命令的外包矩形信息与最大内接矩形信息,将该不规则绘制命令拆分成一个该第一类绘制命令和至少一个该第二类绘制命令,其 中,该第一类绘制命令对应的区域为该不规则绘制命令对应的最大内接矩形,该至少一个第二类绘制命令对应的绘制区域为该不规则绘制命令对应的绘制区域除该最大内接矩形外的边角区域。Using the outsourcing rectangle information and the maximum inscribed rectangle information of the irregular drawing command, splitting the irregular drawing command into one first type drawing command and at least one second type drawing command, The area corresponding to the first type of drawing command is the largest inscribed rectangle corresponding to the irregular drawing command, and the drawing area corresponding to the at least one second type drawing command is the drawing area corresponding to the irregular drawing command except the maximum Connect the corner area outside the rectangle.
本发明实施例中,计算机系统2000通过将绘制区域的形状为的三角形、旋转矩形或椭圆形的原始不规则命令按最大内接矩形拆分成一个规则绘制命令和若干个新的不规则绘制命令,拆分后的规则绘制命令在经过相交检测后得到若干个新的规则绘制命令,该若干个新的规则绘制命令中有可能会有一个或多个在命令合并操作中被合并,从而能够在一定程度上增加消除过度绘制的效果。In the embodiment of the present invention, the computer system 2000 divides the original irregular command of the triangle, the rotation rectangle or the ellipse with the shape of the drawing area into a rule drawing command and several new irregular drawing commands according to the maximum inscribed rectangle. The split rule drawing command obtains a number of new rule drawing commands after the intersection detection, and one or more of the new rule drawing commands may be merged in the command combining operation, thereby being able to To some extent, the effect of eliminating excessive drawing is increased.
可选地,作为另一个实施例,在用于根据外包矩形信息与绘制区域信息,将该多个绘制命令中的每一个不规则绘制命令拆分成至少一个第一类绘制命令和至少一个第二类绘制命令的过程中,处理器2002具体用于:Optionally, as another embodiment, in the method for splitting each of the plurality of drawing commands into at least one first type drawing command and at least one according to the outsourcing rectangle information and the drawing area information. In the process of drawing a command of the second class, the processor 2002 is specifically used to:
当该不规则绘制命令对应的绘制区域为不规则多边形时,将该不规则多边形的绘制区域切分成多个三角形的绘制区域,并根据该不规则多边形的切分方法将该不规则绘制命令拆分成多个第三类绘制命令,该多个第三类绘制命令与该多个三角形的绘制区域之间是一一对应关系;When the drawing area corresponding to the irregular drawing command is an irregular polygon, the drawing area of the irregular polygon is divided into a drawing area of a plurality of triangles, and the irregular drawing command is split according to the segmentation method of the irregular polygon. Dividing into a plurality of third class drawing commands, the plurality of third class drawing commands and the drawing regions of the plurality of triangles have a one-to-one correspondence relationship;
针对每个第三类绘制命令,根据该第三类绘制命令的外包矩形信息与绘制区域信息,获取该第三类绘制命令的最大内接矩形信息;And for each third type drawing command, obtaining the maximum inscribed rectangle information of the third type drawing command according to the outsourcing rectangle information and the drawing area information of the third type drawing command;
利用该第三类绘制命令的外包矩形信息与最大内接矩形信息,将该第三类绘制命令拆分成一个该第一类绘制命令和至少一个该第二类绘制命令,其中,该第一类绘制命令对应的区域为该第三类绘制命令对应的最大内接矩形,该至少一个第二类绘制命令对应的绘制区域为该第三类绘制命令对应的绘制区域除该最大内接矩形外的边角区域。Using the outsourcing rectangle information and the maximum inscribed rectangle information of the third class drawing command, splitting the third class drawing command into one first class drawing command and at least one second class drawing command, wherein the first The area corresponding to the class drawing command is the largest inscribed rectangle corresponding to the third type drawing command, and the drawing area corresponding to the at least one second type drawing command is the drawing area corresponding to the third type drawing command except the maximum inscribed rectangle. Corner area.
本发明实施例中,计算机系统2000通过将绘制区域的形状为的三角形、旋转矩形或椭圆形的原始不规则命令按最大内接矩形拆分成一个规则绘制命令和若干个新的不规则绘制命令,拆分后的规则绘制命令在经过相交检测后得到若干个新的规则绘制命令,该若干个新的规则绘制命令中有可能会有一个或多个在命令合并操作中被合并,从而能够在一定程度上增加消除过度绘制的效果。In the embodiment of the present invention, the computer system 2000 divides the original irregular command of the triangle, the rotation rectangle or the ellipse with the shape of the drawing area into a rule drawing command and several new irregular drawing commands according to the maximum inscribed rectangle. The split rule drawing command obtains a number of new rule drawing commands after the intersection detection, and one or more of the new rule drawing commands may be merged in the command combining operation, thereby being able to To some extent, the effect of eliminating excessive drawing is increased.
可选地,处理器2002具体用于:通过采用R+树算法,根据外包矩形信息和绘制区域信息,将该多个绘制命令中的规则绘制命令,以及该多个绘制 命令中的不规则绘制命令经拆分后的该第一类绘制命令和该第二类绘制命令,分组成多个绘制命令集,使得属于不同绘制命令集的绘制命令互不相交。Optionally, the processor 2002 is specifically configured to: according to the outsourcing rectangle information and the drawing area information, draw a command in the plurality of drawing commands, and the multiple drawing by adopting an R+tree algorithm The first type drawing command and the second type drawing command after the splitting of the irregular drawing command in the command are grouped into a plurality of drawing command sets, so that drawing commands belonging to different drawing command sets do not intersect each other.
本发明实施例中,计算机系统2000通过将不规则多边形拆分成多个三角形,再针对每个三角形拆分成一个最大内接矩形和三个边角区域,并根据拆分后的区域将原始绘制命令拆分成多个规则绘制命令和多个新的不规则绘制命令,拆分后的规则绘制命令在经过相交检测后得到若干个新的规则绘制命令,该若干个新的规则绘制命令中有可能会有一个或多个在命令合并操作中被合并,从而能够在一定程度上增加消除过度绘制的效果。In the embodiment of the present invention, the computer system 2000 splits the irregular polygon into a plurality of triangles, and then splits each triangle into a maximum inscribed rectangle and three corner regions, and according to the split region, the original The drawing command is split into a plurality of rule drawing commands and a plurality of new irregular drawing commands, and the split rule drawing commands obtain a plurality of new rule drawing commands after the intersection detection, and the plurality of new rule drawing commands are It is possible that one or more of them will be merged in the command merge operation, thereby increasing the effect of eliminating over-drawing to some extent.
此外,计算机系统2000还可执行图17的方法,并实现图形处理装置在图17所示实施例中的功能,本发明实施例在此不再赘述。In addition, the computer system 2000 can also perform the method of FIG. 17 and implement the functions of the graphics processing apparatus in the embodiment shown in FIG.
图21是本发明实施例图形显示系统2100的结构示意图。如图21所示,图形显示系统2100可包括图形处理装置2101和图形显示装置2102。其中,FIG. 21 is a schematic structural diagram of a graphic display system 2100 according to an embodiment of the present invention. As shown in FIG. 21, the graphic display system 2100 can include a graphics processing device 2101 and a graphics display device 2102. among them,
图形处理装置2101可以是图14的实施例中所示的图形处理装置1400。The graphics processing device 2101 may be the graphics processing device 1400 shown in the embodiment of FIG.
图形显示装置2102,与该图形处理装置2101具有通信连接,用于显示该图形处理装置执行完经合并后的绘制命令所得到的图形。The graphic display device 2102 has a communication connection with the graphic processing device 2101 for displaying a graphic obtained by the graphic processing device executing the merged drawing command.
本发明实施例中,图形显示系统2100通过将当前帧的命令队列中的不规则绘制命令按绘制区域拆分成规则绘制命令和不规则绘制命令,并将拆分前的规则绘制命令及拆分后的规则绘制命令和不规则绘制命令分组为多个互不相交的绘制命令集,再对每个绘制命令集分别进行相交检测和命令合并,由于将绘制命令分组成多个绘制命令集再进行相交检测能够大大减少相交检测的时间,并且由于将原始不规则绘制命令拆分成规则绘制命令和不规则绘制命令,拆分后的规则绘制命令在经过相交检测后得到若干个新的规则绘制命令,该若干个新的规则绘制命令中有可能会有一个或多个在命令合并操作中被合并,能够在一定程度上增加消除过度绘制的效果,从而能够提高图形处理的性能。In the embodiment of the present invention, the graphic display system 2100 splits the irregular drawing command in the command queue of the current frame into a rule drawing command and an irregular drawing command according to the drawing area, and draws the command and splits the rule before the splitting. The following rule drawing command and irregular drawing command are grouped into a plurality of mutually dissimilar drawing command sets, and then each drawing command set is respectively subjected to intersection detection and command merging, and the drawing commands are grouped into a plurality of drawing command sets. Intersection detection can greatly reduce the time of intersection detection, and since the original irregular drawing command is split into a rule drawing command and an irregular drawing command, the split rule drawing command obtains several new rule drawing commands after the intersection detection. One or more of the several new rule drawing commands may be merged in the command merge operation, which can increase the effect of eliminating over-drawing to a certain extent, thereby improving the performance of graphics processing.
图22是本发明实施例图形显示系统2200的结构示意图。如图22所示,图形显示系统2200可包括图形处理装置2201和图形显示装置2202。其中,FIG. 22 is a schematic structural diagram of a graphic display system 2200 according to an embodiment of the present invention. As shown in FIG. 22, the graphic display system 2200 can include a graphics processing device 2201 and a graphics display device 2202. among them,
图形处理装置2201可以是图18的实施例中所示的图形处理装置1800。The graphics processing device 2201 may be the graphics processing device 1800 shown in the embodiment of FIG.
图形显示装置2202,与该图形处理装置2201具有通信连接,用于显示该图形处理装置执行完经合并后的绘制命令所得到的图形。The graphic display device 2202 has a communication connection with the graphic processing device 2201 for displaying a graphic obtained by the graphic processing device executing the merged drawing command.
本发明实施例中,图形显示系统2200通过将当前帧的命令队列中的多 个API命令转换为多个绘制命令,再将多个绘制命令中的不规则绘制命令按绘制区域拆分成规则绘制命令和不规则绘制命令,并将拆分前的规则绘制命令及拆分后的规则绘制命令和不规则绘制命令分组为多个互不相交的绘制命令集,再对每个绘制命令集分别进行相交检测和命令合并,由于将绘制命令分组成多个绘制命令集再进行相交检测能够大大减少相交检测的时间,并且由于将原始不规则绘制命令拆分成规则绘制命令和不规则绘制命令,拆分后的规则绘制命令在经过相交检测后得到若干个新的规则绘制命令,该若干个新的规则绘制命令中有可能会有一个或多个在命令合并操作中被合并,能够在一定程度上增加消除过度绘制的效果,从而能够提高图形处理的性能。In the embodiment of the present invention, the graphic display system 2200 passes the command queue of the current frame. The API commands are converted into multiple drawing commands, and the irregular drawing commands of the plurality of drawing commands are divided into the rule drawing command and the irregular drawing command according to the drawing area, and the rules before the splitting are drawn and the commands are split. The rule drawing command and the irregular drawing command are grouped into a plurality of mutually dissimilar drawing command sets, and then each drawing command set is respectively subjected to intersection detection and command merging, and the drawing commands are grouped into a plurality of drawing command sets and then intersected. The detection can greatly reduce the time of intersection detection, and since the original irregular drawing command is split into the rule drawing command and the irregular drawing command, the split rule drawing command obtains several new rule drawing commands after the intersection detection. One or more of the several new rule drawing commands may be merged in the command merging operation, which can increase the effect of eliminating over-drawing to a certain extent, thereby improving the performance of graphics processing.
图23是本发明实施例图形显示系统2300的结构示意图。如图23所示,图形显示系统2300可包括计算机系统2301和图形显示装置2302。其中,FIG. 23 is a schematic structural diagram of a graphic display system 2300 according to an embodiment of the present invention. As shown in FIG. 23, graphics display system 2300 can include computer system 2301 and graphics display device 2302. among them,
计算机系统2301可以是图16的实施例中所示的计算机系统1600。Computer system 2301 can be computer system 1600 shown in the embodiment of FIG.
图形显示装置2302,与该计算机系统2301具有通信连接,用于显示该计算机系统执行完经合并后的绘制命令所得到的图形。The graphic display device 2302 has a communication connection with the computer system 2301 for displaying a graphic obtained by the computer system executing the merged drawing command.
本发明实施例中,图形显示系统2300通过将当前帧的命令队列中的不规则绘制命令按绘制区域拆分成规则绘制命令和不规则绘制命令,并将拆分前的规则绘制命令及拆分后的规则绘制命令和不规则绘制命令分组为多个互不相交的绘制命令集,再对每个绘制命令集分别进行相交检测和命令合并,由于将绘制命令分组成多个绘制命令集再进行相交检测能够大大减少相交检测的时间,并且由于将原始不规则绘制命令拆分成规则绘制命令和不规则绘制命令,拆分后的规则绘制命令在经过相交检测后得到若干个新的规则绘制命令,该若干个新的规则绘制命令中有可能会有一个或多个在命令合并操作中被合并,能够在一定程度上增加消除过度绘制的效果,从而能够提高图形处理的性能。In the embodiment of the present invention, the graphic display system 2300 splits the irregular drawing command in the command queue of the current frame into a rule drawing command and an irregular drawing command according to the drawing area, and draws the command and splits the rule before the splitting. The following rule drawing command and irregular drawing command are grouped into a plurality of mutually dissimilar drawing command sets, and then each drawing command set is respectively subjected to intersection detection and command merging, and the drawing commands are grouped into a plurality of drawing command sets. Intersection detection can greatly reduce the time of intersection detection, and since the original irregular drawing command is split into a rule drawing command and an irregular drawing command, the split rule drawing command obtains several new rule drawing commands after the intersection detection. One or more of the several new rule drawing commands may be merged in the command merge operation, which can increase the effect of eliminating over-drawing to a certain extent, thereby improving the performance of graphics processing.
图24是本发明实施例图形显示系统2400的结构示意图。如图24所示,图形显示系统2400可包括计算机系统2401和图形显示装置2402。其中,FIG. 24 is a schematic structural diagram of a graphic display system 2400 according to an embodiment of the present invention. As shown in FIG. 24, graphics display system 2400 can include computer system 2401 and graphics display device 2402. among them,
计算机系统2401可以是图20的实施例中所示的计算机系统2000。Computer system 2401 may be computer system 2000 as shown in the embodiment of FIG.
图形显示装置2402,与该计算机系统2401具有通信连接,用于显示该计算机系统执行完经合并后的绘制命令所得到的图形。The graphic display device 2402 has a communication connection with the computer system 2401 for displaying a graphic obtained by the computer system executing the merged drawing command.
本发明实施例中,图形显示系统2400通过将当前帧的命令队列中的多个API命令转换为多个绘制命令,再将多个绘制命令中的不规则绘制命令按 绘制区域拆分成规则绘制命令和不规则绘制命令,并将拆分前的规则绘制命令及拆分后的规则绘制命令和不规则绘制命令分组为多个互不相交的绘制命令集,再对每个绘制命令集分别进行相交检测和命令合并,由于将绘制命令分组成多个绘制命令集再进行相交检测能够大大减少相交检测的时间,并且由于将原始不规则绘制命令拆分成规则绘制命令和不规则绘制命令,拆分后的规则绘制命令在经过相交检测后得到若干个新的规则绘制命令,该若干个新的规则绘制命令中有可能会有一个或多个在命令合并操作中被合并,能够在一定程度上增加消除过度绘制的效果,从而能够提高图形处理的性能。In the embodiment of the present invention, the graphic display system 2400 converts multiple API commands in the command queue of the current frame into multiple drawing commands, and then presses the irregular drawing commands of the plurality of drawing commands. The drawing area is divided into a rule drawing command and an irregular drawing command, and the rule drawing command before splitting and the split rule drawing command and the irregular drawing command are grouped into a plurality of mutually disjoint drawing command sets, and then Each drawing command set performs intersection detection and command merging separately. Since the drawing commands are grouped into multiple drawing command sets and then intersected detection, the time of intersection detection can be greatly reduced, and the original irregular drawing command is split into rule drawing commands. And the irregular drawing command, the split rule drawing command obtains a number of new rule drawing commands after the intersection detection, and one or more of the several new rule drawing commands may be one or more in the command combining operation. Merging can increase the effect of eliminating over-drawing to a certain extent, thereby improving the performance of graphics processing.
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本发明的范围。Those of ordinary skill in the art will appreciate that the elements and algorithm steps of the various examples described in connection with the embodiments disclosed herein can be implemented in electronic hardware or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the solution. A person skilled in the art can use different methods for implementing the described functions for each particular application, but such implementation should not be considered to be beyond the scope of the present invention.
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统、装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。A person skilled in the art can clearly understand that for the convenience and brevity of the description, the specific working process of the system, the device and the unit described above can refer to the corresponding process in the foregoing method embodiment, and details are not described herein again.
在本申请所提供的几个实施例中,应该理解到,所揭露的系统、装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided by the present application, it should be understood that the disclosed systems, devices, and methods may be implemented in other manners. For example, the device embodiments described above are merely illustrative. For example, the division of the unit is only a logical function division. In actual implementation, there may be another division manner, for example, multiple units or components may be combined or Can be integrated into another system, or some features can be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, device or unit, and may be in an electrical, mechanical or other form.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of the embodiment.
另外,在本发明各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
所述功能如果以软件功能单元的形式实现并作为独立的产品销售或使 用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等,具体例如是计算机设备中的处理器)执行本发明各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质。The function is implemented in the form of a software functional unit and sold or made as a standalone product When used, it can be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention, which is essential or contributes to the prior art, or a part of the technical solution, may be embodied in the form of a software product, which is stored in a storage medium, including The instructions are used to cause a computer device (which may be a personal computer, server, or network device, etc., specifically, for example, a processor in a computer device) to perform all or part of the steps of the methods described in various embodiments of the present invention. The foregoing storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, and the like. .
以上所述,仅为本发明的具体实施方式,但本发明的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本发明揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本发明的保护范围之内。因此,本发明的保护范围应所述以权利要求的保护范围为准。 The above is only a specific embodiment of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art can easily think of changes or substitutions within the technical scope of the present invention. It should be covered by the scope of the present invention. Therefore, the scope of the invention should be determined by the scope of the claims.

Claims (14)

  1. 一种图形处理方法,其特征在于,包括:A graphics processing method, comprising:
    接收当前帧输入的命令队列,所述命令队列包括多个绘制命令,每个所述绘制命令都携带外包矩形信息、执行内容、绘制模式与绘制区域信息,所述绘制模式包括覆盖模式、混合模式或等待模式;Receiving a command queue of the current frame input, the command queue includes a plurality of drawing commands, each of the drawing commands carrying outsourcing rectangle information, execution content, drawing mode and drawing area information, and the drawing mode includes an overlay mode and a mixed mode Or waiting mode;
    根据外包矩形信息与绘制区域信息,将所述多个绘制命令中的每一个不规则绘制命令拆分成至少一个第一类绘制命令和至少一个第二类绘制命令,其中,所述第一类绘制命令的绘制区域为所述不规则绘制命令对应的绘制区域内的矩形,所述至少一个第二类绘制命令的绘制区域为所述不规则绘制命令对应的绘制区域去掉所述至少一个第一类绘制命令的绘制区域后剩余的边角区域,所述至少一个第一类绘制命令的绘制模式与所述不规则绘制命令的绘制模式相同,所述至少一个第二类绘制命令的绘制模式为等待模式;Decoding, according to the outsourcing rectangle information and the drawing area information, each of the plurality of drawing commands into at least one first class drawing command and at least one second class drawing command, wherein the first class a drawing area of the drawing command is a rectangle in the drawing area corresponding to the irregular drawing command, and a drawing area of the at least one second type drawing command is the drawing area corresponding to the irregular drawing command, and the at least one first is removed a corner area remaining after the drawing area of the drawing command, the drawing mode of the at least one first type drawing command is the same as the drawing mode of the irregular drawing command, and the drawing mode of the at least one second type drawing command is Waiting mode
    根据外包矩形信息和绘制区域信息,将所述多个绘制命令中的规则绘制命令,以及所述多个绘制命令中的不规则绘制命令经拆分后的所述第一类绘制命令和所述第二类绘制命令,分组成多个绘制命令集,使得属于不同绘制命令集的绘制命令互不相交;And dividing the rule drawing command of the plurality of drawing commands, and the first type drawing command after splitting the irregular drawing command of the plurality of drawing commands according to the outsourcing rectangle information and the drawing area information The second type of drawing commands are grouped into a plurality of drawing command sets, so that drawing commands belonging to different drawing command sets do not intersect each other;
    根据外包矩形信息和绘制区域信息,对所述多个绘制命令集分别进行相交检测,使得所述多个绘制命令集中每一个绘制命令集内绘制命令互不相交;Performing intersection detection on the plurality of drawing command sets according to the outsourcing rectangle information and the drawing area information, so that the drawing commands in each drawing command set in the plurality of drawing command sets do not intersect each other;
    根据执行内容、绘制模式和绘制区域信息,对经过相交检测的所述多个绘制命令集分别进行绘制命令合并;And performing, according to the execution content, the drawing mode, and the drawing area information, the drawing command combination of the plurality of drawing command sets that have undergone the intersection detection;
    执行每个绘制命令集经合并后的绘制命令。Perform a merged draw command for each draw command set.
  2. 如权利要求1所述的方法,其特征在于,所述根据所述外包矩形信息与所述绘制区域信息,将所述多个绘制命令中的每一个不规则绘制命令拆分成至少一个第一类绘制命令和至少一个第二类绘制命令包括:The method according to claim 1, wherein said splitting each of said plurality of drawing commands into at least one first according to said outsourcing rectangle information and said drawing area information The class drawing command and the at least one second class drawing command include:
    根据所述不规则绘制命令的外包矩形信息与绘制区域信息,获取所述不规则绘制命令的最大内接矩形信息;Obtaining, according to the outsourcing rectangle information and the drawing area information of the irregular drawing command, the maximum inscribed rectangle information of the irregular drawing command;
    利用所述不规则绘制命令的外包矩形信息与最大内接矩形信息,将所述不规则绘制命令拆分成一个所述第一类绘制命令和至少一个所述第二类绘制命令,其中,所述第一类绘制命令对应的区域为所述不规则绘制命令对应的最大内接矩形,所述至少一个第二类绘制命令对应的绘制区域为所述不规 则绘制命令对应的绘制区域除所述最大内接矩形外的边角区域。Using the outsourcing rectangle information and the maximum inscribed rectangle information of the irregular drawing command, splitting the irregular drawing command into one of the first class drawing command and at least one of the second class drawing commands, wherein An area corresponding to the first type of drawing command is a maximum inscribed rectangle corresponding to the irregular drawing command, and a drawing area corresponding to the at least one second type drawing command is the irregularity Then, the drawing area corresponding to the drawing command has a corner area other than the maximum inscribed rectangle.
  3. 如权利要求1所述的方法,其特征在于,所述根据所述外包矩形信息与所述绘制区域信息,将所述多个绘制命令中的每一个不规则绘制命令拆分成至少一个第一类绘制命令和至少一个第二类绘制命令包括:The method according to claim 1, wherein said splitting each of said plurality of drawing commands into at least one first according to said outsourcing rectangle information and said drawing area information The class drawing command and the at least one second class drawing command include:
    当所述不规则绘制命令对应的绘制区域为不规则多边形时,将所述不规则多边形的绘制区域切分成多个三角形的绘制区域,并根据所述不规则多边形的切分方法将所述不规则绘制命令拆分成多个第三类绘制命令,所述多个第三类绘制命令与所述多个三角形的绘制区域之间是一一对应关系;When the drawing area corresponding to the irregular drawing command is an irregular polygon, the drawing area of the irregular polygon is divided into a drawing area of a plurality of triangles, and according to the segmentation method of the irregular polygon, the The rule drawing command is split into a plurality of third class drawing commands, and the plurality of third class drawing commands are in a one-to-one correspondence with the drawing regions of the plurality of triangles;
    针对每个第三类绘制命令,根据所述第三类绘制命令的外包矩形信息与绘制区域信息,获取所述第三类绘制命令的最大内接矩形信息;Obtaining a maximum inscribed rectangle information of the third type of drawing command according to the outsourcing rectangle information and the drawing area information of the third type drawing command for each third type drawing command;
    利用所述第三类绘制命令的外包矩形信息与最大内接矩形信息,将所述第三类绘制命令拆分成一个所述第一类绘制命令和至少一个所述第二类绘制命令,其中,所述第一类绘制命令对应的区域为所述第三类绘制命令对应的最大内接矩形,所述至少一个第二类绘制命令对应的绘制区域为所述第三类绘制命令对应的绘制区域除所述最大内接矩形外的边角区域。Using the outsourcing rectangle information and the maximum inscribed rectangle information of the third class drawing command, splitting the third class drawing command into one of the first class drawing command and at least one of the second class drawing commands, wherein The area corresponding to the first type of drawing command is a maximum inscribed rectangle corresponding to the third type of drawing command, and the drawing area corresponding to the at least one second type of drawing command is a drawing corresponding to the third type of drawing command. The area of the corner except the maximum inscribed rectangle.
  4. 一种图形处理方法,其特征在于,包括:A graphics processing method, comprising:
    接收当前帧输入的命令队列,所述命令队列包括多个应用程序编程接口API命令;Receiving a command queue of a current frame input, the command queue including a plurality of application programming interface API commands;
    将所述多个API命令转换为多个绘制命令,每个所述绘制命令都携带外包矩形信息、执行内容、绘制模式与绘制区域信息,所述绘制模式包括覆盖模式、混合模式或等待模式;Converting the plurality of API commands into a plurality of drawing commands, each of the drawing commands carrying outsourcing rectangle information, execution content, drawing mode, and drawing area information, the drawing mode including an overlay mode, a mixed mode, or a waiting mode;
    根据外包矩形信息与绘制区域信息,将所述多个绘制命令中的每一个不规则绘制命令拆分成至少一个第一类绘制命令和至少一个第二类绘制命令,其中,所述第一类绘制命令的绘制区域为所述不规则绘制命令对应的绘制区域内的矩形,所述至少一个第二类绘制命令的绘制区域为所述不规则绘制命令对应的绘制区域去掉所述至少一个第一类绘制命令的绘制区域后剩余的边角区域,所述至少一个第一类绘制命令的绘制模式与所述不规则绘制命令的绘制模式相同,所述至少一个第二类绘制命令的绘制模式为等待模式;Decoding, according to the outsourcing rectangle information and the drawing area information, each of the plurality of drawing commands into at least one first class drawing command and at least one second class drawing command, wherein the first class a drawing area of the drawing command is a rectangle in the drawing area corresponding to the irregular drawing command, and a drawing area of the at least one second type drawing command is the drawing area corresponding to the irregular drawing command, and the at least one first is removed a corner area remaining after the drawing area of the drawing command, the drawing mode of the at least one first type drawing command is the same as the drawing mode of the irregular drawing command, and the drawing mode of the at least one second type drawing command is Waiting mode
    根据外包矩形信息和绘制区域信息,将所述多个绘制命令中的规则绘制命令,以及所述多个绘制命令中的不规则绘制命令经拆分后的所述第一类绘制命令和所述第二类绘制命令,分组成多个绘制命令集,使得属于不同绘制 命令集的绘制命令互不相交;And dividing the rule drawing command of the plurality of drawing commands, and the first type drawing command after splitting the irregular drawing command of the plurality of drawing commands according to the outsourcing rectangle information and the drawing area information The second type of drawing commands are grouped into multiple drawing command sets, so that they belong to different drawing The command commands of the command set do not intersect each other;
    根据外包矩形信息和绘制区域信息,对所述多个绘制命令集分别进行相交检测,使得所述多个绘制命令集中每一个绘制命令集内绘制命令互不相交;Performing intersection detection on the plurality of drawing command sets according to the outsourcing rectangle information and the drawing area information, so that the drawing commands in each drawing command set in the plurality of drawing command sets do not intersect each other;
    根据执行内容、绘制模式和绘制区域信息,对经过相交检测的所述多个绘制命令集分别进行绘制命令合并;And performing, according to the execution content, the drawing mode, and the drawing area information, the drawing command combination of the plurality of drawing command sets that have undergone the intersection detection;
    执行每个绘制命令集经合并后的绘制命令。Perform a merged draw command for each draw command set.
  5. 如权利要求4所述的方法,其特征在于,所述根据所述外包矩形信息与所述绘制区域信息,将所述多个绘制命令中的每一个不规则绘制命令拆分成至少一个第一类绘制命令和至少一个第二类绘制命令包括:The method according to claim 4, wherein said splitting each of said plurality of drawing commands into at least one first according to said outsourcing rectangle information and said drawing area information The class drawing command and the at least one second class drawing command include:
    根据所述不规则绘制命令的外包矩形信息与绘制区域信息,获取所述不规则绘制命令的最大内接矩形信息;Obtaining, according to the outsourcing rectangle information and the drawing area information of the irregular drawing command, the maximum inscribed rectangle information of the irregular drawing command;
    利用所述不规则绘制命令的外包矩形信息与最大内接矩形信息,将所述不规则绘制命令拆分成一个所述第一类绘制命令和至少一个所述第二类绘制命令,其中,所述第一类绘制命令对应的区域为所述不规则绘制命令对应的最大内接矩形,所述至少一个第二类绘制命令对应的绘制区域为所述不规则绘制命令对应的绘制区域除所述最大内接矩形外的边角区域。Using the outsourcing rectangle information and the maximum inscribed rectangle information of the irregular drawing command, splitting the irregular drawing command into one of the first class drawing command and at least one of the second class drawing commands, wherein An area corresponding to the first type of drawing command is a maximum inscribed rectangle corresponding to the irregular drawing command, and a drawing area corresponding to the at least one second type drawing command is a drawing area corresponding to the irregular drawing command. The maximum inscribed corner area outside the rectangle.
  6. 如权利要求4所述的方法,其特征在于,所述根据所述外包矩形信息与所述绘制区域信息,将所述多个绘制命令中的每一个不规则绘制命令拆分成至少一个第一类绘制命令和至少一个第二类绘制命令包括:The method according to claim 4, wherein said splitting each of said plurality of drawing commands into at least one first according to said outsourcing rectangle information and said drawing area information The class drawing command and the at least one second class drawing command include:
    当所述不规则绘制命令对应的绘制区域为不规则多边形时,将所述不规则多边形的绘制区域切分成多个三角形的绘制区域,并根据所述不规则多边形的切分方法将所述不规则绘制命令拆分成多个第三类绘制命令,所述多个第三类绘制命令与所述多个三角形的绘制区域之间是一一对应关系;When the drawing area corresponding to the irregular drawing command is an irregular polygon, the drawing area of the irregular polygon is divided into a drawing area of a plurality of triangles, and according to the segmentation method of the irregular polygon, the The rule drawing command is split into a plurality of third class drawing commands, and the plurality of third class drawing commands are in a one-to-one correspondence with the drawing regions of the plurality of triangles;
    针对每个第三类绘制命令,根据所述第三类绘制命令的外包矩形信息与绘制区域信息,获取所述第三类绘制命令的最大内接矩形信息;Obtaining a maximum inscribed rectangle information of the third type of drawing command according to the outsourcing rectangle information and the drawing area information of the third type drawing command for each third type drawing command;
    利用所述第三类绘制命令的外包矩形信息与最大内接矩形信息,将所述第三类绘制命令拆分成一个所述第一类绘制命令和至少一个所述第二类绘制命令,其中,所述第一类绘制命令对应的区域为所述第三类绘制命令对应的最大内接矩形,所述至少一个第二类绘制命令对应的绘制区域为所述第三类绘制命令对应的绘制区域除所述最大内接矩形外的边角区域。Using the outsourcing rectangle information and the maximum inscribed rectangle information of the third class drawing command, splitting the third class drawing command into one of the first class drawing command and at least one of the second class drawing commands, wherein The area corresponding to the first type of drawing command is a maximum inscribed rectangle corresponding to the third type of drawing command, and the drawing area corresponding to the at least one second type of drawing command is a drawing corresponding to the third type of drawing command. The area of the corner except the maximum inscribed rectangle.
  7. 一种图形处理装置,其特征在于,包括: A graphics processing device, comprising:
    命令收集模块,用于接收当前帧输入的命令队列,所述命令队列包括多个绘制命令,每个所述绘制命令都携带外包矩形信息、执行内容、绘制模式与绘制区域信息,所述绘制模式包括覆盖模式、混合模式或等待模式;a command collection module, configured to receive a command queue of a current frame input, where the command queue includes a plurality of drawing commands, each of the drawing commands carrying outsourcing rectangle information, execution content, drawing mode, and drawing area information, and the drawing mode Including overlay mode, mixed mode or standby mode;
    命令拆分模块,用于根据外包矩形信息与绘制区域信息,将所述多个绘制命令中的每一个不规则绘制命令拆分成至少一个第一类绘制命令和至少一个第二类绘制命令,其中,所述第一类绘制命令的绘制区域为所述不规则绘制命令对应的绘制区域内的矩形,所述至少一个第二类绘制命令的绘制区域为所述不规则绘制命令对应的绘制区域去掉所述至少一个第一类绘制命令的绘制区域后剩余的边角区域,所述至少一个第一类绘制命令的绘制模式与所述不规则绘制命令的绘制模式相同,所述至少一个第二类绘制命令的绘制模式为等待模式;a command splitting module, configured to split each of the plurality of drawing commands into at least one first type drawing command and at least one second type drawing command according to the outsourcing rectangle information and the drawing area information, The drawing area of the first type of drawing command is a rectangle in the drawing area corresponding to the irregular drawing command, and the drawing area of the at least one second type drawing command is a drawing area corresponding to the irregular drawing command. Removing a corner area remaining after the drawing area of the at least one first type drawing command, the drawing mode of the at least one first type drawing command is the same as the drawing mode of the irregular drawing command, the at least one second The drawing mode of the class drawing command is the waiting mode;
    命令分组模块,用于根据外包矩形信息和绘制区域信息,将所述多个绘制命令中的规则绘制命令,以及所述多个绘制命令中的不规则绘制命令经拆分后的所述第一类绘制命令和所述第二类绘制命令,分组成多个绘制命令集,使得属于不同绘制命令集的绘制命令互不相交;a command grouping module, configured to, according to the outsourcing rectangle information and the drawing area information, the rule drawing command of the plurality of drawing commands, and the first drawing of the plurality of drawing commands by the irregular drawing command The class drawing command and the second class drawing command are grouped into a plurality of drawing command sets, so that drawing commands belonging to different drawing command sets do not intersect each other;
    相交检测模块,用于根据外包矩形信息和绘制区域信息,对所述多个绘制命令集分别进行相交检测,使得所述多个绘制命令集中每一个绘制命令集内绘制命令互不相交;An intersection detecting module, configured to perform intersection detection on the plurality of drawing command sets according to the outsourcing rectangle information and the drawing area information, so that the drawing commands in each drawing command set in the plurality of drawing command sets do not intersect each other;
    命令合并模块,用于根据执行内容、绘制模式和绘制区域信息,对经过相交检测的所述多个绘制命令集分别进行绘制命令合并;a command merging module, configured to respectively perform drawing command merging on the plurality of drawing command sets that have undergone intersection detection according to execution content, drawing mode, and drawing area information;
    执行模块,用于执行每个绘制命令集经合并后的绘制命令。An execution module for executing the merged draw command for each draw command set.
  8. 如权利要求7所述的图形处理装置,其特征在于,所述命令拆分模块具体用于:The graphics processing device of claim 7, wherein the command splitting module is specifically configured to:
    根据所述不规则绘制命令的外包矩形信息与绘制区域信息,获取所述不规则绘制命令的最大内接矩形信息;Obtaining, according to the outsourcing rectangle information and the drawing area information of the irregular drawing command, the maximum inscribed rectangle information of the irregular drawing command;
    利用所述不规则绘制命令的外包矩形信息与最大内接矩形信息,将所述不规则绘制命令拆分成一个所述第一类绘制命令和至少一个所述第二类绘制命令,其中,所述第一类绘制命令对应的区域为所述不规则绘制命令对应的最大内接矩形,所述至少一个第二类绘制命令对应的绘制区域为所述不规则绘制命令对应的绘制区域除所述最大内接矩形外的边角区域。Using the outsourcing rectangle information and the maximum inscribed rectangle information of the irregular drawing command, splitting the irregular drawing command into one of the first class drawing command and at least one of the second class drawing commands, wherein An area corresponding to the first type of drawing command is a maximum inscribed rectangle corresponding to the irregular drawing command, and a drawing area corresponding to the at least one second type drawing command is a drawing area corresponding to the irregular drawing command. The maximum inscribed corner area outside the rectangle.
  9. 如权利要求7所述的图形处理装置,其特征在于,所述命令拆分模 块具体用于:A graphics processing apparatus according to claim 7, wherein said command splitting mode The block is specifically used to:
    当所述不规则绘制命令对应的绘制区域为不规则多边形时,将所述不规则多边形的绘制区域切分成多个三角形的绘制区域,并根据所述不规则多边形的切分方法将所述不规则绘制命令拆分成多个第三类绘制命令,所述多个第三类绘制命令与所述多个三角形的绘制区域之间是一一对应关系;When the drawing area corresponding to the irregular drawing command is an irregular polygon, the drawing area of the irregular polygon is divided into a drawing area of a plurality of triangles, and according to the segmentation method of the irregular polygon, the The rule drawing command is split into a plurality of third class drawing commands, and the plurality of third class drawing commands are in a one-to-one correspondence with the drawing regions of the plurality of triangles;
    针对每个第三类绘制命令,根据所述第三类绘制命令的外包矩形信息与绘制区域信息,获取所述第三类绘制命令的最大内接矩形信息;Obtaining a maximum inscribed rectangle information of the third type of drawing command according to the outsourcing rectangle information and the drawing area information of the third type drawing command for each third type drawing command;
    利用所述第三类绘制命令的外包矩形信息与最大内接矩形信息,将所述第三类绘制命令拆分成一个所述第一类绘制命令和至少一个所述第二类绘制命令,其中,所述第一类绘制命令对应的区域为所述第三类绘制命令对应的最大内接矩形,所述至少一个第二类绘制命令对应的绘制区域为所述第三类绘制命令对应的绘制区域除所述最大内接矩形外的边角区域。Using the outsourcing rectangle information and the maximum inscribed rectangle information of the third class drawing command, splitting the third class drawing command into one of the first class drawing command and at least one of the second class drawing commands, wherein The area corresponding to the first type of drawing command is a maximum inscribed rectangle corresponding to the third type of drawing command, and the drawing area corresponding to the at least one second type of drawing command is a drawing corresponding to the third type of drawing command. The area of the corner except the maximum inscribed rectangle.
  10. 一种图形处理装置,其特征在于,包括:A graphics processing device, comprising:
    命令收集模块,用于接收当前帧输入的命令队列,所述命令队列包括多个应用程序编程接口API命令;a command collection module, configured to receive a command queue of a current frame input, where the command queue includes a plurality of application programming interface API commands;
    命令转换模块,用于将所述多个API命令转换为多个绘制命令,每个所述绘制命令都携带外包矩形信息、执行内容、绘制模式与绘制区域信息,所述绘制模式包括覆盖模式、混合模式或等待模式;a command conversion module, configured to convert the plurality of API commands into a plurality of drawing commands, each of the drawing commands carrying outsourcing rectangle information, execution content, drawing mode, and drawing area information, where the drawing mode includes an overlay mode, Mixed mode or standby mode;
    命令拆分模块,用于根据外包矩形信息与绘制区域信息,将所述多个绘制命令中的每一个不规则绘制命令拆分成至少一个第一类绘制命令和至少一个第二类绘制命令,其中,所述第一类绘制命令的绘制区域为所述不规则绘制命令对应的绘制区域内的矩形,所述至少一个第二类绘制命令的绘制区域为所述不规则绘制命令对应的绘制区域去掉所述至少一个第一类绘制命令的绘制区域后剩余的边角区域,所述至少一个第一类绘制命令的绘制模式与所述不规则绘制命令的绘制模式相同,所述至少一个第二类绘制命令的绘制模式为等待模式;a command splitting module, configured to split each of the plurality of drawing commands into at least one first type drawing command and at least one second type drawing command according to the outsourcing rectangle information and the drawing area information, The drawing area of the first type of drawing command is a rectangle in the drawing area corresponding to the irregular drawing command, and the drawing area of the at least one second type drawing command is a drawing area corresponding to the irregular drawing command. Removing a corner area remaining after the drawing area of the at least one first type drawing command, the drawing mode of the at least one first type drawing command is the same as the drawing mode of the irregular drawing command, the at least one second The drawing mode of the class drawing command is the waiting mode;
    命令分组模块,用于根据外包矩形信息和绘制区域信息,将所述多个绘制命令中的规则绘制命令,以及所述多个绘制命令中的不规则绘制命令经拆分后的所述第一类绘制命令和所述第二类绘制命令,分组成多个绘制命令集,使得属于不同绘制命令集的绘制命令互不相交;a command grouping module, configured to, according to the outsourcing rectangle information and the drawing area information, the rule drawing command of the plurality of drawing commands, and the first drawing of the plurality of drawing commands by the irregular drawing command The class drawing command and the second class drawing command are grouped into a plurality of drawing command sets, so that drawing commands belonging to different drawing command sets do not intersect each other;
    相交检测模块,用于根据外包矩形信息和绘制区域信息,对所述多个绘 制命令集分别进行相交检测,使得所述多个绘制命令集中每一个绘制命令集内绘制命令互不相交;An intersection detecting module, configured to map the plurality of pieces according to the outsourcing rectangle information and the drawing area information The command set respectively performs intersection detection, so that the drawing commands in each of the plurality of drawing command sets do not intersect each other;
    命令合并模块,用于根据执行内容、绘制模式和绘制区域信息,对经过相交检测的所述多个绘制命令集分别进行绘制命令合并;a command merging module, configured to respectively perform drawing command merging on the plurality of drawing command sets that have undergone intersection detection according to execution content, drawing mode, and drawing area information;
    执行模块,用于执行每个绘制命令集经合并后的绘制命令。An execution module for executing the merged draw command for each draw command set.
  11. 如权利要求10所述的图形处理装置,其特征在于,所述命令拆分模块具体用于:The graphics processing device of claim 10, wherein the command splitting module is specifically configured to:
    根据所述不规则绘制命令的外包矩形信息与绘制区域信息,获取所述不规则绘制命令的最大内接矩形信息;Obtaining, according to the outsourcing rectangle information and the drawing area information of the irregular drawing command, the maximum inscribed rectangle information of the irregular drawing command;
    利用所述不规则绘制命令的外包矩形信息与最大内接矩形信息,将所述不规则绘制命令拆分成一个所述第一类绘制命令和至少一个所述第二类绘制命令,其中,所述第一类绘制命令对应的区域为所述不规则绘制命令对应的最大内接矩形,所述至少一个第二类绘制命令对应的绘制区域为所述不规则绘制命令对应的绘制区域除所述最大内接矩形外的边角区域。Using the outsourcing rectangle information and the maximum inscribed rectangle information of the irregular drawing command, splitting the irregular drawing command into one of the first class drawing command and at least one of the second class drawing commands, wherein An area corresponding to the first type of drawing command is a maximum inscribed rectangle corresponding to the irregular drawing command, and a drawing area corresponding to the at least one second type drawing command is a drawing area corresponding to the irregular drawing command. The maximum inscribed corner area outside the rectangle.
  12. 如权利要求10所述的图形处理装置,其特征在于,所述命令分组模块具体用于:The graphics processing device of claim 10, wherein the command grouping module is specifically configured to:
    当所述不规则绘制命令对应的绘制区域为不规则多边形时,将所述不规则多边形的绘制区域切分成多个三角形的绘制区域,并根据所述不规则多边形的切分方法将所述不规则绘制命令拆分成多个第三类绘制命令,所述多个第三类绘制命令与所述多个三角形的绘制区域之间是一一对应关系;When the drawing area corresponding to the irregular drawing command is an irregular polygon, the drawing area of the irregular polygon is divided into a drawing area of a plurality of triangles, and according to the segmentation method of the irregular polygon, the The rule drawing command is split into a plurality of third class drawing commands, and the plurality of third class drawing commands are in a one-to-one correspondence with the drawing regions of the plurality of triangles;
    针对每个第三类绘制命令,根据所述第三类绘制命令的外包矩形信息与绘制区域信息,获取所述第三类绘制命令的最大内接矩形信息;Obtaining a maximum inscribed rectangle information of the third type of drawing command according to the outsourcing rectangle information and the drawing area information of the third type drawing command for each third type drawing command;
    利用所述第三类绘制命令的外包矩形信息与最大内接矩形信息,将所述第三类绘制命令拆分成一个所述第一类绘制命令和至少一个所述第二类绘制命令,其中,所述第一类绘制命令对应的区域为所述第三类绘制命令对应的最大内接矩形,所述至少一个第二类绘制命令对应的绘制区域为所述第三类绘制命令对应的绘制区域除所述最大内接矩形外的边角区域。Using the outsourcing rectangle information and the maximum inscribed rectangle information of the third class drawing command, splitting the third class drawing command into one of the first class drawing command and at least one of the second class drawing commands, wherein The area corresponding to the first type of drawing command is a maximum inscribed rectangle corresponding to the third type of drawing command, and the drawing area corresponding to the at least one second type of drawing command is a drawing corresponding to the third type of drawing command. The area of the corner except the maximum inscribed rectangle.
  13. 一种图形显示系统,其特征在于,包括: A graphic display system, comprising:
    如权利要求7至9任一项所述的图形处理装置,以及A graphics processing apparatus according to any one of claims 7 to 9, and
    图形显示装置,与所述图形处理装置具有通信连接,用于显示所述图形处理装置执行完经合并后的绘制命令所得到的图形。The graphic display device has a communication connection with the graphic processing device for displaying a graphic obtained by the graphic processing device executing the merged drawing command.
  14. 一种图形显示系统,其特征在于,包括:A graphic display system, comprising:
    如权利要求10至12任一项所述的图形处理装置,以及A graphics processing apparatus according to any one of claims 10 to 12, and
    图形显示装置,与所述图形处理装置具有通信连接,用于显示所述图形处理装置执行完经合并后的绘制命令所得到的图形。 The graphic display device has a communication connection with the graphic processing device for displaying a graphic obtained by the graphic processing device executing the merged drawing command.
PCT/CN2015/094969 2015-04-02 2015-11-19 Graphic processing method, device and system WO2016155329A1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
EP15887283.8A EP3267391B1 (en) 2015-04-02 2015-11-19 Graphic processing method, device and system
US15/719,073 US10198785B2 (en) 2015-04-02 2017-09-28 Graphics processing method, apparatus, and system

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201510154809.4 2015-04-02
CN201510154809.4A CN104809684B (en) 2015-04-02 2015-04-02 Graphic processing method, apparatus and system

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US15/719,073 Continuation US10198785B2 (en) 2015-04-02 2017-09-28 Graphics processing method, apparatus, and system

Publications (1)

Publication Number Publication Date
WO2016155329A1 true WO2016155329A1 (en) 2016-10-06

Family

ID=53694489

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2015/094969 WO2016155329A1 (en) 2015-04-02 2015-11-19 Graphic processing method, device and system

Country Status (4)

Country Link
US (1) US10198785B2 (en)
EP (1) EP3267391B1 (en)
CN (1) CN104809684B (en)
WO (1) WO2016155329A1 (en)

Families Citing this family (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104809684B (en) * 2015-04-02 2018-03-27 华为技术有限公司 Graphic processing method, apparatus and system
KR20180029178A (en) * 2016-09-09 2018-03-20 삼성디스플레이 주식회사 Electronic device
CN107833227B (en) * 2017-10-31 2021-11-26 苏州乐米信息科技股份有限公司 Drawing method and system for circular cutting area
US10818067B1 (en) * 2019-05-31 2020-10-27 Texas Instruments Incorporated GPU assist using DSP pre-processor system and method
CN111462278B (en) * 2020-03-17 2022-10-25 稿定(厦门)科技有限公司 Depth-based material sequencing rendering method, medium, equipment and device
CN111913816A (en) * 2020-07-14 2020-11-10 长沙景嘉微电子股份有限公司 Implementation method, device, terminal and medium for clusters in GPGPU (general purpose graphics processing unit)
CN112053622B (en) * 2020-09-16 2021-04-13 中国测绘科学研究院 Multi-ring polygon self-intersection mode recognition and processing method
CN113012260B (en) * 2021-02-09 2023-04-28 福建天泉教育科技有限公司 Method and terminal for erasing crossing area under Canvas
CN115049755A (en) * 2021-03-09 2022-09-13 京东方科技集团股份有限公司 Picture generation method, device, equipment and storage medium
CN113495663B (en) * 2021-07-05 2022-03-11 北京华大九天科技股份有限公司 Method and device for drawing rectangular layout, storage medium and electronic equipment

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1773494A (en) * 2005-10-20 2006-05-17 北京航空航天大学 Pattern drawing platform-oriented scene graph optimizational designing method
CN101499172A (en) * 2009-03-06 2009-08-05 深圳华为通信技术有限公司 ActiveX drafting method and device
US20090244628A1 (en) * 2008-03-31 2009-10-01 Brother Kogyo Kabushiki Kaisha Image generating device, image generating method and printing device
US20100322527A1 (en) * 2009-06-17 2010-12-23 Canon Kabushiki Kaisha Method of encoding and decoding a graphics path sequence into a layered scheme
CN103677828A (en) * 2013-12-10 2014-03-26 华为技术有限公司 Coverage drawing method, drawing engine and terminal equipment
CN104809684A (en) * 2015-04-02 2015-07-29 华为技术有限公司 Graphic processing method, device and system

Family Cites Families (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0628126A (en) * 1992-07-09 1994-02-04 Canon Inc Method and device for information processing
JP3845045B2 (en) * 2002-07-23 2006-11-15 株式会社リコー Image processing apparatus, image processing method, image forming apparatus, printing apparatus, and host PC
GB0228973D0 (en) * 2002-12-12 2003-01-15 Univ Aston System and method for coding and retrieval of a CAD drawing from a database
JP2005135415A (en) * 2003-10-28 2005-05-26 Samsung Electronics Co Ltd Graphic decoder including command based graphic output accelerating function, graphic output accelerating method therefor, and image reproducing apparatus
US8379019B2 (en) 2007-12-26 2013-02-19 Advanced Micro Devices, Inc. Fast triangle reordering for vertex locality and reduced overdraw
US8739028B2 (en) * 2009-05-22 2014-05-27 Cabin Creek, Llc Methods for producing user-configurable accented presentations
CN101702244B (en) 2009-11-10 2012-04-25 南京大学 Parallel drawing load balancing method for free division of drawing area
US8830246B2 (en) 2011-11-30 2014-09-09 Qualcomm Incorporated Switching between direct rendering and binning in graphics processing
CN102736898B (en) 2012-05-08 2015-04-22 国家测绘局卫星测绘应用中心 Method and device suitable for drawing vector data of multi-core CPU (central process unit) parallelly
US8994750B2 (en) * 2012-06-11 2015-03-31 2236008 Ontario Inc. Cell-based composited windowing system
CN103164839B (en) * 2013-03-07 2019-06-21 华为技术有限公司 A kind of drawing practice, device and terminal
US9779533B2 (en) * 2014-01-27 2017-10-03 Nvidia Corporation Hierarchical tiled caching

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1773494A (en) * 2005-10-20 2006-05-17 北京航空航天大学 Pattern drawing platform-oriented scene graph optimizational designing method
US20090244628A1 (en) * 2008-03-31 2009-10-01 Brother Kogyo Kabushiki Kaisha Image generating device, image generating method and printing device
CN101499172A (en) * 2009-03-06 2009-08-05 深圳华为通信技术有限公司 ActiveX drafting method and device
US20100322527A1 (en) * 2009-06-17 2010-12-23 Canon Kabushiki Kaisha Method of encoding and decoding a graphics path sequence into a layered scheme
CN103677828A (en) * 2013-12-10 2014-03-26 华为技术有限公司 Coverage drawing method, drawing engine and terminal equipment
CN104809684A (en) * 2015-04-02 2015-07-29 华为技术有限公司 Graphic processing method, device and system

Also Published As

Publication number Publication date
US10198785B2 (en) 2019-02-05
EP3267391A1 (en) 2018-01-10
EP3267391B1 (en) 2019-09-18
EP3267391A4 (en) 2018-03-14
CN104809684A (en) 2015-07-29
US20180018751A1 (en) 2018-01-18
CN104809684B (en) 2018-03-27

Similar Documents

Publication Publication Date Title
WO2016155329A1 (en) Graphic processing method, device and system
US11344806B2 (en) Method for rendering game, and method, apparatus and device for generating game resource file
WO2018099299A1 (en) Graphic data processing method, device and system
US9881418B2 (en) Identifying features in polygonal meshes
US11790480B2 (en) Tiling a primitive in a graphics processing system by edge-specific testing of a subset of tiles in a rendering space
US10186068B2 (en) Method, apparatus and system for rendering an image
CN112529995B (en) Image rendering calculation method and device, storage medium and terminal
CN115147579B (en) Block rendering mode graphic processing method and system for expanding block boundary
EP3086289B1 (en) Tiling a primitive in a graphics processing system
US20230033319A1 (en) Method, apparatus and device for processing shadow texture, computer-readable storage medium, and program product
CN111862204A (en) Method for extracting visual feature points of image and related device
US9646221B2 (en) Image recognition apparatus and storage medium
CN103310409A (en) Quick triangle partitioning method of Tile-based rendering architecture central processing unit (CPU)
WO2023173728A1 (en) Graphic rendering method and apparatus, and storage medium
US20210103852A1 (en) Resource based workload allocation for machine learning workloads
US20230222732A1 (en) Method for processing three-dimensional data and device
EP4343679A1 (en) Image processing method and apparatus, and readable storage medium
CN116309974B (en) Animation scene rendering method, system, electronic equipment and medium
CN110647574B (en) Social network data display method, terminal device and storage medium
CN110838165B (en) SVG-based graphics rendering method and device
CN113448667A (en) Method and device for generating display relation graph
CN114037713A (en) Cross-screen tripwire drawing method and device, electronic equipment and storage medium
CN114429512A (en) Fusion display method and device for BIM and live-action three-dimensional model of coal preparation plant
CN111813484A (en) Full-screen multiple anti-aliasing method and device for 2D desktop and graphics processor
CN117203661A (en) Image processing apparatus and method

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 15887283

Country of ref document: EP

Kind code of ref document: A1

REEP Request for entry into the european phase

Ref document number: 2015887283

Country of ref document: EP

NENP Non-entry into the national phase

Ref country code: DE