WO2014134912A1 - 一种绘图方法、装置及终端 - Google Patents

一种绘图方法、装置及终端 Download PDF

Info

Publication number
WO2014134912A1
WO2014134912A1 PCT/CN2013/084148 CN2013084148W WO2014134912A1 WO 2014134912 A1 WO2014134912 A1 WO 2014134912A1 CN 2013084148 W CN2013084148 W CN 2013084148W WO 2014134912 A1 WO2014134912 A1 WO 2014134912A1
Authority
WO
WIPO (PCT)
Prior art keywords
drawing command
cpu
gpu
time
current frame
Prior art date
Application number
PCT/CN2013/084148
Other languages
English (en)
French (fr)
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 KR1020147012010A priority Critical patent/KR101623415B1/ko
Priority to EP13844577.0A priority patent/EP2793185B1/en
Priority to JP2015503752A priority patent/JP5963940B2/ja
Priority to US14/331,642 priority patent/US9430810B2/en
Publication of WO2014134912A1 publication Critical patent/WO2014134912A1/zh

Links

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/30Arrangements for executing machine instructions, e.g. instruction decode
    • G06F9/38Concurrent instruction execution, e.g. pipeline or look ahead
    • G06F9/3867Concurrent instruction execution, e.g. pipeline or look ahead using instruction pipelines
    • 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/30Arrangements for executing machine instructions, e.g. instruction decode
    • G06F9/38Concurrent instruction execution, e.g. pipeline or look ahead
    • G06F9/3877Concurrent instruction execution, e.g. pipeline or look ahead using a slave processor, e.g. coprocessor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T15/003D [Three Dimensional] image rendering
    • G06T15/005General purpose rendering architectures
    • GPHYSICS
    • G09EDUCATION; CRYPTOGRAPHY; DISPLAY; ADVERTISING; SEALS
    • G09GARRANGEMENTS OR CIRCUITS FOR CONTROL OF INDICATING DEVICES USING STATIC MEANS TO PRESENT VARIABLE INFORMATION
    • G09G5/00Control arrangements or circuits for visual indicators common to cathode-ray tube indicators and other visual indicators
    • G09G5/36Control arrangements or circuits for visual indicators common to cathode-ray tube indicators and other visual indicators characterised by the display of a graphic pattern, e.g. using an all-points-addressable [APA] memory
    • G09G5/363Graphics controllers

Definitions

  • the present invention relates to computer technology, and in particular, to a drawing method, apparatus, and terminal. Background technique
  • the 2D (Two Dimensions, 2D) graphics library is the core library of the computer operating system.
  • the performance of each drawing interface directly affects the timeliness of the system's response to the user interface (User Interface).
  • 2D is drawn by CPU (Central Processing Unit) and GPU (Graphic Processing Unit). From the performance point of view, the CPU mode is suitable for small single scene drawing, and the GPU mode is suitable for large scenes. Drawing.
  • the so-called scene in 2D drawing refers to the operational complexity (such as geometric transformation) involved in the drawing process and the size of the area. If the drawing of a small scene adopts GPU drawing mode or the large scene adopts CPU drawing mode, the performance will be greatly reduced, which directly affects the UI performance of the system.
  • Embodiments of the present invention provide a drawing method, apparatus, and terminal for improving the display performance of a computer system to some extent.
  • an embodiment of the present invention provides a drawing method, the method comprising: receiving a drawing command set of a current frame, where the drawing command set includes one or more drawing commands and parameters of the drawing command; One or more drawing commands in the drawing command set of the frame and the drawing
  • the parameter of the command determines the CPU CPU drawing time of the current frame and the graphics processor GPU drawing time; if the CPU drawing time is less than the GPU drawing time, the CPU is used to draw the current frame, if If the GPU drawing time is less than the CPU drawing time, the GPU is used to draw the current frame.
  • Time including: traversing each drawing command in the drawing command set of the current frame and parameters of the drawing command; querying according to the parameters of each drawing command and the drawing command in a preset performance table, CPU drawing time and GPU drawing time corresponding to each of the drawing command and the parameter of the drawing command; accumulating the CPU drawing time of each drawing command in the drawing command set of the current frame to obtain a CPU drawing of the current frame Time; accumulating the GPU drawing time of each drawing command in the drawing command set of the current frame to obtain the GPU drawing time of the current frame.
  • the second implementation manner if the CPU drawing time corresponding to the drawing command and the drawing command parameter is not found in the preset performance table, GPU drawing time, calculating CPU drawing time and GPU drawing time corresponding to parameters of the drawing command and the drawing command according to the drawing command and parameters of the drawing command; calculating the calculated CPU drawing time and The GPU drawing time, and parameters of the drawing command and the drawing command are stored in the preset performance table.
  • the calculating, according to the drawing command and the parameter of the drawing command, a CPU drawing corresponding to the drawing command and the parameter of the drawing command Time and GPU drawing time comprising: drawing, by the CPU and the GPU, an image object corresponding to the drawing command and the parameter of the drawing command according to the drawing command and the parameter of the drawing command; Recording, by the CPU and the GPU, the time used by the CPU and the GPU to draw the image object in the process of drawing the image object corresponding to the drawing command and the parameter of the drawing command, where Recorded CPU drawing
  • the time taken by the image object corresponding to the drawing command and the parameter of the drawing command is a CPU drawing time corresponding to the drawing command and the parameter of the drawing command, and the GPU drawing of the recording
  • the time used by the image object corresponding to the drawing command and the parameter of the drawing command is a GPU drawing time corresponding to the drawing command and the parameter of the drawing command.
  • the method further includes: Using the CPU to draw the current frame, the CPU drawing result of the current frame is saved in the bitmap image, and if the current frame is drawn by using the GPU, the GPU rendering result of the current frame is saved in the texture image; Display the result of the drawing saved in the bitmap image or the texture image onto the screen.
  • an embodiment of the present invention provides a drawing apparatus, where the apparatus includes a receiving module, configured to receive a drawing command set of a current frame, where the drawing command set includes one or more drawing commands and parameters of the drawing command; a determining module, configured to determine, according to one or more drawing commands in the drawing command set of the current frame received by the receiving module and parameters of the drawing command, a CPU CPU drawing time of the current frame and a graphics processor GPU drawing a drawing decision module, configured to: when the CPU drawing time is less than the GPU drawing time in the CPU drawing time and the GPU drawing time of the current frame determined by the determining module, use the CPU to perform the current frame Drawing, if the GPU drawing time is less than the CPU drawing time, the GPU is used to draw the current frame.
  • the determining module is specifically configured to: traverse each drawing command in the drawing command set of the current frame and parameters of the drawing command; according to each drawing command And the parameter of the drawing command is queried in the preset performance table, and the CPU drawing time and the GPU drawing time corresponding to the parameters of each drawing command and the drawing command are obtained; and the drawing command of the current frame is concentrated.
  • the CPU drawing time of each drawing command is accumulated to obtain the CPU drawing time of the current frame; the drawing command of the current frame is concentrated in each drawing command.
  • the GPU drawing time is accumulated to get the GPU drawing time of the current frame.
  • the device further includes: a calculating module, configured to: if the determining module does not query the Calculating CPU drawing time and GPU drawing time corresponding to the drawing command and the parameter of the drawing command, and calculating a CPU drawing time corresponding to the drawing command and the parameter of the drawing command according to the drawing command and the parameter of the drawing command And a GPU drawing time; an update module, configured to store the CPU drawing time and the GPU drawing time calculated by the calculating module, and parameters of the drawing command and the drawing command to the preset performance In the table.
  • a calculating module configured to: if the determining module does not query the Calculating CPU drawing time and GPU drawing time corresponding to the drawing command and the parameter of the drawing command, and calculating a CPU drawing time corresponding to the drawing command and the parameter of the drawing command according to the drawing command and the parameter of the drawing command And a GPU drawing time
  • an update module configured to store the CPU drawing time and the GPU drawing time calculated by the calculating module, and parameters of the drawing command and the drawing command to the preset performance In the table.
  • the calculating module is specifically configured to: if the determining module does not query the drawing command in the preset performance table The CPU drawing time and the GPU drawing time corresponding to the parameters of the drawing command are respectively drawn and the drawing command and the drawing command by using the CPU and the GPU according to the drawing command and the parameter of the drawing command.
  • An image object corresponding to the parameter recording, by the CPU and the GPU, the image object corresponding to the drawing command and the parameter of the drawing command, respectively, recording the image by the CPU and the GPU
  • the time used by the object wherein the time that the CPU of the record draws the image object corresponding to the drawing command and the parameter of the drawing command is a parameter with the drawing command and the drawing command
  • Corresponding CPU drawing time the recorded GPU drawing the image object corresponding to the drawing command and the drawing command parameter
  • the apparatus further includes: saving a module, configured to save the CPU frame drawing result of the current frame in the bitmap image if the current frame is drawn by using the CPU, and save the GPU drawing result of the current frame if the current frame is drawn by using the GPU In the texture image; a display module, configured to display the drawing result saved in the bitmap image or the texture image onto the screen.
  • the embodiment of the present invention further provides a terminal device, where the terminal device includes a central processing unit CPU, a graphics processing unit GPU, and a device screen, and the central processing unit CPU and the graphics processing unit GPU are connected to the device screen.
  • the CPU is configured to: receive a drawing command set of a current frame, where the drawing command set includes one or more drawing commands and parameters of the drawing command; one or more pieces according to the drawing command set of the current frame
  • the drawing command and the parameter of the drawing command determine a CPU drawing time and a GPU drawing time of the current frame; if the CPU drawing time is less than the GPU drawing time, drawing the current frame, if the GPU drawing The time is less than the CPU drawing time, and the current frame is drawn by the GPU; the GPU is configured to: draw the current frame; and the device screen is used to display the CPU or the GPU pair The result of drawing the current frame.
  • the CPU is specifically configured to: traverse each drawing command in the drawing command set of the current frame and parameters of the drawing command; according to each drawing command and The parameters of the drawing command are queried in a preset performance table, and the CPU drawing time and the GPU drawing time corresponding to the parameters of each drawing command and the drawing command are obtained; The CPU drawing time of one drawing command is accumulated to obtain the CPU drawing time of the current frame; the GPU drawing time of each drawing command in the drawing command set of the current frame is accumulated to obtain the GPU drawing time of the current frame.
  • the CPU is further configured to: if a drawing command in the drawing command set and a parameter of the drawing command are in the preset
  • the CPU drawing time and the GPU drawing time corresponding to the drawing command and the parameter of the drawing command are not found in the performance table, and the drawing command and the drawing command are calculated according to the drawing command and the parameter of the drawing command.
  • the CPU drawing time and the GPU drawing time corresponding to the parameters of the drawing command; storing the calculated CPU drawing time and GPU drawing time, and the drawing command and the parameter of the drawing command are stored in the preset performance table .
  • the drawing method, the device, and the terminal receive the drawing command set of the current frame, where the drawing command set includes one or more drawing commands and the drawing command.
  • a parameter determining a CPU drawing time and a GPU drawing time of the current frame according to the drawing command set of the current frame, and if the CPU drawing time is less than the GPU drawing time, using a CPU to draw a current frame, if If the GPU drawing time is less than the CPU drawing time, the GPU is used to draw the current frame, and the drawing time corresponding to the CPU/GPU mode is dynamically determined to adopt a drawing mode with a shorter drawing time, thereby reducing the drawing of each frame to some extent. Time, which in turn increases the display speed of the system and improves display performance.
  • FIG. 1 is a schematic diagram of a logical structure of a conventional terminal
  • FIG. 2a is a schematic flowchart of a method for drawing a method according to an embodiment of the present invention
  • FIG. 2b is a schematic flowchart of another method for drawing a method according to an embodiment of the present invention
  • FIG. 3b is a schematic flowchart of a method for drawing a further method according to an embodiment of the present invention
  • FIG. 4a is a schematic structural diagram of a drawing device according to an embodiment of the present invention
  • FIG. 4 is a schematic structural diagram of another drawing device according to an embodiment of the present invention
  • FIG. 4 is a schematic structural diagram of still another drawing device according to an embodiment of the present invention
  • FIG. 5 is a schematic diagram of a terminal device according to an embodiment of the present invention. Schematic;
  • FIG. 6 is a schematic structural diagram of another terminal device according to an embodiment of the present invention.
  • FIG. 2 is a schematic flowchart of a method for drawing a method according to an embodiment of the present invention.
  • the drawing method provided by the embodiment of the present invention may be applied to a computer system, where the computer system may be located on a physical host, or The distribution is on multiple physical hosts.
  • the computer system can be located on one or more computers, laptops, handheld devices (e.g., cell phones, PADs, etc.), servers, and the like.
  • the logical structure of the terminal applied by the drawing method provided by the embodiment of the present invention is described by using FIG. 1 as an example.
  • the terminal can be specifically a smart phone.
  • the hardware layer includes a CPU and a GPU, and of course, may also include a memory, an input/output device, a network interface, etc., and an operating system Android and some applications are run on the hardware layer.
  • the 2D graphics library engine is the core part of the operating system, including Skia for CPU drawing and OpenGL (Open Graphics Library) for GPU drawing.
  • the terminal also includes a display driver for the display driver layer; SurfaceFlinger for displaying the composite layer Display framework, including view, widget and canvas; and application layer, the application layer includes the main interface Home, contact book Contacts, browser Browser, etc. common in the Android operating system.
  • the CPU drawing or the GPU drawing can be dynamically selected according to the drawing command set of the current frame, thereby providing the drawing performance of the system.
  • the drawing method provided by the embodiment of the present invention includes:
  • S101 Receive a drawing command set of a current frame, where the drawing command set includes one or more drawing commands and parameters of the drawing command.
  • the drawing command may include a linear gradient, a picture gradient, and the corresponding parameter may include a region size, a coordinate, a gradient color, and the like; the drawing command may further include drawing a square or a circle or a line or a curve, and the corresponding parameter may include drawing Start and end coordinates, line type, line thickness, line color, and more. It should be understood by those skilled in the art that the above is only an example.
  • the drawing command in the embodiment of the present invention may also include any drawing command that may be used in any computer system, and the corresponding parameters may also be based on actual parameter requirements. Flexible determination, embodiment of the present invention This is not limited.
  • S102 Determine a CPU drawing time and a GPU drawing time of the current frame according to one or more drawing commands in the drawing command set of the current frame and parameters of the drawing command.
  • the CPU drawing time is a time required by the CPU to execute the drawing command set of the current frame
  • the GPU drawing time is a time required by the GPU to execute the drawing command set of the current frame.
  • the CPU drawing time is less than the GPU drawing time, and the difference between the GPU drawing time and the CPU drawing time is greater than a certain threshold value.
  • the CPU drawing time is T CPU
  • the GPU drawing time is T GPU
  • TGPU-TCPU k where ⁇ >0.
  • the GPU drawing time is less than the CPU drawing time, and the difference between the CPU drawing time and the GPU drawing time is greater than a certain threshold value k 2 .
  • 13 ⁇ 4 and 13 ⁇ 4 can be set to a specific value, or they can be set to a range of values. 13 ⁇ 4 and 13 ⁇ 4 can be set to the same or different.
  • k 3 [-2, 2] or [ -3 , 4 ] can be set, then the current description
  • the frame is similar to the performance of the GPU, and the drawing can be selected according to the actual situation of the current system.
  • the drawing method provided by the embodiment of the present invention can be applied to the 2D graphics library engine layer, in which the API (Application Program Interface) provided by Skia is dynamically determined according to the CPU drawing time and the GPU drawing time. ) to achieve CPU drawing, or tune GPU drawing is implemented using the API interface provided by openGL.
  • API Application Program Interface
  • the embodiment of the present invention further includes:
  • Bitmap and Texture are two different rendering channels provided by the operating system. Bitmap corresponds to a piece of memory, and the access mode is progressive image by frame; if it is GPU mode, all drawing commands will save the drawing content in Texture after execution, Texture is also a piece of memory, access mode is accessed by block (Tile).
  • the display composition layer supports multitasking, which can display UI forms of multiple applications at a time, and the same application may create multiple forms. After all the forms have been drawn, the system finally displays a collection of all the forms that are currently displayable. After the synthesis is completed, the display driver of the display driver layer is called to copy the result to the frame buffer (FrameBuffer); the display driver, such as the LCD (Liquid Crystal Display) driver of the terminal, displays the contents of the frame buffer on the screen. .
  • the display driver of the display driver layer is called to copy the result to the frame buffer (FrameBuffer); the display driver, such as the LCD (Liquid Crystal Display) driver of the terminal, displays the contents of the frame buffer on the screen.
  • the drawing method receives the drawing command set of the current frame, where the drawing command set includes one or more drawing commands and parameters of the drawing command, and is determined according to the drawing command set of the current frame.
  • the CPU drawing time of the current frame and the GPU drawing time If the CPU drawing time is less than the GPU drawing time, the CPU is used to draw the current frame, and if the GPU drawing time is less than the CPU drawing time, the current drawing is used.
  • the GPU draws the current frame, and dynamically determines the drawing mode with a shorter drawing time according to the drawing time corresponding to the CPU/GPU mode, thereby reducing the drawing time of each frame to a certain extent, thereby improving the display speed of the system and improving the display performance. . In the UI interaction process, the user experience can be greatly improved.
  • FIG. 3 is a schematic flowchart of a method for drawing according to another embodiment of the present invention.
  • the method may be applied to a computer system, where the computer system may be located on a physical host, or may be located in multiple physical entities. On the host. Specifically, it can be applied to the terminal as shown in FIG. 1.
  • the method includes:
  • S1022 Query the preset performance table according to each drawing command and the parameter of the drawing command, and obtain a CPU drawing time and a GPU drawing time corresponding to the parameters of each drawing command and the drawing command.
  • the embodiment of the present invention further includes S103 and S104 of the foregoing embodiment. Further, the steps S105, S106, and S107 of the foregoing embodiment may also be included, and details are not described herein again.
  • the drawing method receives the drawing command set of the current frame, where the drawing command set includes one or more drawing commands and parameters of the drawing command, and is determined according to the drawing command set of the current frame.
  • the CPU drawing time of the current frame and the GPU drawing time If the CPU drawing time is less than the GPU drawing time, the CPU is used to draw the current frame, and if the GPU drawing time is less than the CPU drawing time, the current drawing is used.
  • the GPU draws the current frame, and dynamically determines the drawing mode with a shorter drawing time according to the drawing time corresponding to the CPU/GPU mode, thereby reducing the drawing time of each frame to a certain extent, thereby improving the system display. Show speed and improve display performance.
  • the user experience can be greatly improved.
  • the user experience can be greatly improved.
  • the method includes:
  • the default performance representation is as follows:
  • the linear transformation and the image gradient are two drawing commands, which correspond to the drawing parameters, that is, the area size.
  • the area size in Table 1 is 100*100 pixels.
  • the required GPU and CPU rendering are required.
  • the time decibel is 108ms and 80ms.
  • Table 1 is only an example form, and the drawing commands are only examples.
  • the parameters of the drawing command in the performance table may also have two or more parameters. If the drawing parameters of the same drawing command are different, there will usually be a separate record in the performance table. If the drawing command and the parameter of the drawing command are queried in the preset performance table,
  • step S204 The GPU drawing time and the CPU drawing time are passed to step S204, otherwise, the process goes to step S205.
  • the calculation process is started;
  • the drawing command and the parameter of the drawing command are input to the calculation process;
  • the calculation process simultaneously calculates the CPU drawing time and the GPU drawing time corresponding to the drawing command and the parameter of the drawing command.
  • the calculation method is as follows: using the CPU and the GPU to respectively draw an image object corresponding to the drawing command and the parameter of the drawing command according to the drawing command and the parameter of the drawing command; Recording, by the CPU and the GPU, the time used by the CPU and the GPU to draw the image object in the process of drawing the image object corresponding to the drawing command and the parameter of the drawing command, wherein the recorded time And the time that the CPU uses the image object corresponding to the drawing command and the drawing command to use the CPU drawing time corresponding to the drawing command and the drawing command parameter, and the recorded GPU
  • the time taken to draw the image object corresponding to the drawing command and the parameter of the drawing command is the GPU drawing time corresponding to the drawing command and the parameter of the drawing command.
  • the method further includes:
  • the CPU drawing time and the GPU drawing time obtained by the calculation may be added to the preset performance table, so that the next time there is a drawing command with the same drawing command and parameters, the query may be directly The preset performance table is obtained.
  • the method of the foregoing embodiment of the present invention can perform CPU drawing and GPU drawing selection, and further, save and display the drawing result.
  • specific steps refer to the foregoing embodiment, and details are not described herein again.
  • the drawing method receives the drawing command set of the current frame, where the drawing command set includes one or more drawing commands and parameters of the drawing command, and is determined according to the drawing command set of the current frame.
  • the CPU drawing time of the current frame and the GPU drawing time If the CPU drawing time is less than the GPU drawing time, the CPU is used to draw the current frame, and if the GPU drawing time is less than the CPU drawing time, the current drawing is used.
  • the GPU draws the current frame, and dynamically determines the drawing mode with a shorter drawing time according to the drawing time corresponding to the CPU/GPU mode, thereby reducing the drawing time of each frame to a certain extent, thereby improving the display speed of the system and improving the display performance. . In the UI interaction process, the user experience can be greatly improved.
  • FIG. 4a a schematic diagram of a logical structure of a drawing device 10 according to an embodiment of the present invention is shown.
  • the drawing device 10 provided by the embodiment of the present invention may correspond to the 2D graphics library engine layer of the terminal system as shown in FIG. As shown in Figure 4a, the device includes:
  • the receiving module 11 is configured to receive a drawing command set of a current frame, where the drawing command set includes one or more drawing commands and parameters of the drawing command.
  • the drawing command may include a linear gradient, a picture gradient, and the corresponding parameter may include a region size, a coordinate, a gradient color, and the like; the drawing command may further include drawing a square or a circle or a line or a curve, etc., and corresponding parameters may include drawing Start and end coordinates, line type, line thickness, line color, and more. It should be understood by those skilled in the art that the above is only an example.
  • the drawing command in the embodiment of the present invention may also include any drawing command that may be used in any computer system, and the corresponding parameters may also be based on actual parameter requirements. Flexible determination, implementation of the present invention This example is not limited.
  • a determining module 12 configured to determine a CPU drawing time and a GPU drawing time of the current frame according to a drawing command in the drawing command set of the current frame and a parameter of the drawing command received by the receiving module 11;
  • the drawing decision module 13 is configured to use the CPU to draw the current frame if the CPU drawing time is less than the GPU drawing time in the CPU drawing time and the GPU drawing time of the current frame determined by the determining module If the GPU drawing time is less than the CPU drawing time, the GPU is used to draw the current frame.
  • the drawing decision module 13 selects to call the CPU or GPU to draw the current frame according to the comparison result of the drawing time.
  • the calling method can be the API provided by the graphics libraries skia and openGL in the example of Figure 1.
  • the CPU and the GPU in Fig. 4b are two processors provided by the hardware layer of the terminal device in which the drawing device provided by the embodiment of the present invention is located.
  • the drawing device 10 may further include:
  • the saving module 14 is configured to save the CPU drawing result of the current frame in the Bitmap if the current frame is drawn by using the CPU, and save the GPU drawing result of the current frame if the GPU is used to draw the current frame.
  • Texture
  • the display module 15 is configured to display the drawing result saved in the Bitmap or Texture onto the screen. Taking FIG. 1 as an example, the display module 15 can call the SurfaceFlinger displaying the composite layer to perform image synthesis. After the synthesis is completed, the display driver is called to copy the composite result to the frame buffer framebuffer, and then the display buffer displays the content of the frame buffer. on the screen.
  • the drawing apparatus receives the drawing command set of the current frame, where the drawing command set includes one or more drawing commands and parameters of the drawing command, and is determined according to the drawing command set of the current frame.
  • the CPU drawing time of the current frame and the GPU drawing time If the CPU drawing time is less than the GPU drawing time, the CPU is used to draw the current frame, and if the GPU drawing time is less than the CPU drawing time, the current drawing is used.
  • the GPU draws the current frame, and realizes that the drawing time is dynamically determined according to the drawing time corresponding to the CPU/GPU mode.
  • the drawing method reduces the drawing time of each frame to a certain extent, thereby improving the display speed of the system and improving the display performance. In the UI interaction process, the user experience can be greatly improved.
  • the various embodiments in the present specification are described in a progressive manner, and the same similar parts between the various embodiments may be referred to each other, and each embodiment focuses on different embodiments from other embodiments.
  • the device embodiment since it is substantially similar to the method embodiment, it is described in a relatively simple manner, and the relevant portions can be referred to the description of the method embodiment.
  • the specific implementation method of the determining module 12 can refer to the method for obtaining the CPU drawing time and the GPU drawing time as described in the foregoing embodiments.
  • the performance table (such as Table 1) existing in the acquisition method is also stored as a part of the apparatus of the present invention, and can be stored on the magnetic disk, and the power is not lost, so that the terminal is turned on and off a plurality of times, and the previously accumulated drawing data is still present.
  • FIG. 5 is a schematic structural diagram of a terminal device 20 according to an embodiment of the present invention.
  • the terminal 20 includes a CPU 21, a GPU 22, and a device screen 23, and the CPU 21 and the GPU 22 are connected to the device screen 23, wherein:
  • the CPU 21 is configured to receive a drawing command set of a current frame, where the drawing command set includes one or more drawing commands and parameters of the drawing command; one or more drawing commands according to the drawing command set of the current frame and the Determining, by the parameter of the drawing command, the CPU drawing time and the GPU drawing time of the current frame; if the CPU drawing time is less than the GPU drawing time, drawing the current frame, if the GPU drawing time is less than the CPU Drawing time, the current frame is drawn by the GPU 22;
  • the CPU 21 is configured to: traverse each drawing command in the drawing command set of the current frame and parameters of the drawing command; according to the parameters of each drawing command and the drawing command in a preset performance table Querying, obtaining a CPU drawing time and a GPU drawing time corresponding to each of the drawing commands and the parameters of the drawing command; collecting each of the current frame drawing commands
  • the CPU drawing time of the drawing command is accumulated to obtain the CPU drawing time of the current frame
  • the GPU drawing time of each drawing command in the drawing command set of the current frame is accumulated to obtain the GPU drawing time of the current frame.
  • the CPU 21 is further configured to: if the CPU drawing time and the GPU drawing time corresponding to the drawing command and the drawing command parameter are not found in the preset performance table, according to the drawing command and the drawing
  • the parameter of the command calculates a CPU drawing time and a GPU drawing time corresponding to the drawing command and the parameter of the drawing command; the CPU drawing time and the GPU drawing time to be calculated, and the drawing command and the drawing command
  • the parameters are stored in the preset performance table.
  • the calculation method may be as follows: according to the drawing command and the parameter of the drawing command, respectively drawing an image object corresponding to the drawing command and the parameter of the drawing command by the CPU and the GPU; drawing on the CPU and the GPU Recording, in the process of the image object corresponding to the drawing command and the parameter of the drawing command, the time used by the CPU and the GPU to draw the image object, wherein the CPU of the record draws the
  • the time used by the image object corresponding to the drawing command and the parameter of the drawing command is a CPU drawing time corresponding to the drawing command and the parameter of the drawing command, and the recorded GPU draws the same
  • the time used by the image object corresponding to the drawing command and the parameter of the drawing command is the GPU drawing time corresponding to the drawing command and the parameter of the drawing command.
  • the CPU 21 is further configured to: if the CPU uses the CPU to draw the current frame, save the CPU rendering result of the current frame in the bitmap image, and if the GPU is used to draw the current frame, the current frame is The GPU drawing result is saved in the texture image; the drawing result saved in the bitmap image or the texture image is displayed on the device screen.
  • the GPU is configured to: draw the current frame; and the device screen 23 is configured to display a rendering result of the current frame by the CPU 21 or the GPU 22. Specifically, it is used to display the bitmap image or the rendering result saved in the texture image.
  • the terminal device receives the drawing command set of the current frame by using the terminal device.
  • the drawing command set includes one or more drawing commands and parameters of the drawing command, and determines a CPU drawing time and a GPU drawing time of the current frame according to the drawing command set of the current frame, if the CPU drawing time is less than
  • the GPU draws time, and uses the CPU to draw the current frame. If the GPU drawing time is less than the CPU drawing time, the GPU is used to draw the current frame, and the mapping time corresponding to the CPU/GPU mode is dynamically determined.
  • the drawing method with shorter drawing time reduces the drawing time of each frame to a certain extent, thereby improving the display speed of the system and improving the display performance. In the UI interaction process, the user experience can be greatly improved.
  • FIG. 6 is a schematic structural diagram of another terminal device 30 according to an embodiment of the present invention.
  • the terminal device 30 includes a CPU 31, a GPU 32, a memory 33, a display screen 34, and a bus 35.
  • the CPU 31, the GPU 32, the memory 33, and the display screen 34 are connected by a bus 35.
  • the memory 33 can be implemented as one or more of a computer floppy disk, a USB flash drive, a mobile hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk. .
  • Memory 33 stores the following elements, executable modules or data structures, or a subset thereof, or their extended set:
  • the application 331 includes various applications, such as Home, Contacts, Browser, etc. shown in FIG. 1, for implementing various application services.
  • the operating system 332 includes various system programs, such as the display framework shown in Figure 1, the 2D graphics library engine, the display composition layer, and the like, for implementing various basic services and processing hardware-based tasks.
  • the CPU performs the following operations by calling a program stored in the memory 33 (the program can be stored in the operating system 332):
  • the drawing command set includes one or more drawing commands and parameters of the drawing command; determining a center of the current frame according to the drawing command set of the current frame a processor CPU drawing time and a graphics processor GPU drawing time; if the CPU drawing time is less than the GPU drawing time, using the CPU 31 to draw the current frame, if the GPU drawing time is less than the CPU drawing time, The current frame is then rendered using GPU 32.
  • the drawing command set of the current frame may be from the operating system 332 itself or from the application 331.
  • the CPU 31 traverses each of the drawing commands in the drawing command set of the current frame and the parameters of the drawing command; and queries the preset performance table according to the parameters of the drawing command and the drawing command. a CPU drawing time and a GPU drawing time corresponding to each of the drawing command and the parameter of the drawing command; accumulating the CPU drawing time of each drawing command in the drawing command set of the current frame to obtain a CPU drawing time of the current frame; The GPU drawing time of each drawing command in the drawing command set of the current frame is accumulated to obtain the GPU drawing time of the current frame.
  • the parameter of the drawing command calculates a CPU drawing time and a GPU drawing time corresponding thereto, specifically, starts a calculation process; and inputs the drawing command and the parameter of the drawing command to the calculation process; the calculation process simultaneously calculates and The CPU drawing time and the GPU drawing time corresponding to the drawing command and the parameter of the drawing command; storing the obtained CPU drawing time and GPU drawing time, and storing the drawing command and the parameter of the drawing command to the Pre-defined performance table.
  • the specific calculation method may be as follows: according to the drawing command and the parameter of the drawing command, respectively drawing an image object corresponding to the drawing command and the parameter of the drawing command by the CPU and the GPU; in the CPU and the GPU Recording, in the process of drawing the image object corresponding to the drawing command and the parameter of the drawing command, the time used by the CPU and the GPU to draw the image object, wherein the CPU of the record draws the The time taken by the image object corresponding to the drawing command and the parameter of the drawing command is a CPU drawing time corresponding to the drawing command and the drawing command, and the recorded GPU draws the The time used by the image object corresponding to the drawing command and the parameter of the drawing command is The GPU drawing time corresponding to the drawing command and the parameter of the drawing command.
  • the preset performance table may be stored in the memory 33.
  • the preset performance table is stored in a memory that is not lost when power is lost.
  • memory 33 includes a RAM and a disk, wherein a predetermined performance table can be stored on the disk.
  • the CPU 31 is further configured to: if the current frame is drawn by using the CPU, save the CPU drawing result of the current frame in the bitmap image, and if the GPU is used to draw the current frame, the GPU of the current frame is used.
  • the drawing result is saved in the texture image; the drawing result saved in the bitmap image or the texture image is displayed on the screen.
  • the GPU 32 is used for graphics rendering; the CPU 31 is also used for graphics rendering.
  • the display screen 34 is used to output graphics drawn by the CPU 31 or the GPU 32.
  • the display screen 34 can be a touch screen at the same time.
  • the terminal device may further include an input device 36, and the user may input a frame drawing command by using the input device 36.
  • the frame drawing command may also be from an operating system or an application.
  • the input device 35 can be implemented as a touch screen, a mouse, a keyboard, or the like. It can also include communication interfaces, voice input/output devices (such as microphones/speakers), sensors, and more.
  • the application set in the mobile terminal may also include GPS (Global Positioning System), video, music, games, browsers, and the like.
  • each module is connected via a bus 35, which may be an ISA (Industry)
  • the bus may be one or more physical lines, and when it is a plurality of physical lines, it may be divided into an address bus, a data bus, a control bus, and the like.
  • the modules provided by the embodiments of the present invention may also be connected without a bus, and the communication connection may be directly established according to the signal transmission relationship.
  • the module division of the program stored in the memory 33 may refer to the module division manner of the foregoing embodiment, or another module division manner may be adopted.
  • the drawing method, the device, and the terminal receive the drawing command set of the current frame, where the drawing command set includes one or more drawing commands and parameters of the drawing command, according to the current frame.
  • the drawing command set determines a CPU drawing time and a GPU drawing time of the current frame. If the CPU drawing time is less than the GPU drawing time, the CPU is used to draw the current frame, if the GPU drawing time is less than the CPU drawing Time, the GPU is used to draw the current frame, and the drawing time corresponding to the CPU/GPU mode is dynamically determined to adopt a drawing mode with a shorter drawing time, thereby reducing the drawing time of each frame to a certain extent, thereby improving the display speed of the system. , improve display performance. In the UI interaction process, the user experience can be greatly improved.
  • the device embodiments described above are merely illustrative, wherein 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, ie may be located One place, or it can be distributed to multiple network elements. Some or all of the modules may be selected according to actual needs to achieve the objectives of the embodiment.
  • the connection relationship between the modules indicates that there is a communication connection between them, and specifically may be implemented as one or more communication buses or signal lines.
  • the drawing device can be implemented by means of software plus necessary general hardware, and of course, the dedicated hardware can also include an ASIC. , dedicated CPU, dedicated memory, dedicated components, etc. to achieve.
  • functions performed by a computer program can be easily implemented with the corresponding hardware, and the specific hardware structure used to implement the same function can also be various.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Computer Graphics (AREA)
  • Computer Hardware Design (AREA)
  • Controls And Circuits For Display Device (AREA)
  • Image Generation (AREA)
  • Image Processing (AREA)

Abstract

本发明实施例涉及计算机技术。本发明实施例提供一种绘图方法、装置以及终端,通过接收当前帧的绘图命令集,根据所述当前帧的绘图命令集确定所述当前帧的CPU绘图时间和GPU绘图时间,若所述CPU绘图时间小于所述GPU绘图时间,则使用CPU对所述当前帧进行绘制;若所述CPU绘图时间大于所述GPU绘图时间,则使用GPU对所述当前帧进行绘制,实现根据CPU和GPU对应的绘图时间动态决定采用哪一种绘图方式,从而一定程度上减少每一帧的绘图时间,进而提高系统的显示速度,提升显示性能。

Description

一种绘图方法、 装置及终端
技术领域
本发明涉及计算机技术, 尤其涉及一种绘图方法、 装置及终端。 背景技术
2D ( Two Dimensions, 二维) 图形库作为计算机操作系统的核心库, 它 所提供的各个绘图接口的性能直接影响系统对用户 UI ( User Interface, 用户 界面 )操作响应的及时性。 目前 2D绘制有 CPU ( Central Processing Unit, 中 央处理器)和 GPU ( Graphic Processing Unit, 图形处理器) 两种方式, 从性 能的角度来讲, CPU方式适合筒单小场景绘图, GPU方式适合大场景绘图。 所谓 2D绘图中的场景, 是指绘图过程中涉及的操作复杂度(如几何变换) 以及区域的大小。 若小场景的绘图采用 GPU绘图方式或者大场景采用 CPU 绘图方式, 性能都会大打折扣, 直接影响系统的 UI性能。 还有一种实现方式 是由绘制帧所属的应用程序决定, 开发者可以在应用程序中设置是否采用 GPU方式绘制。 若设置为 GPU绘制方式, 则系统会采用 GPU方式绘制该应 用程序的每一帧内容; 否则采用 CPU方式绘制。 但是, 采用应用程序配置的 方式, 由于开发者对所开发的应用程序是采用 GPU绘制还是 CPU绘制哪个 更优也是未知的, 所以该方式也必然会导致某些复杂内容的帧最终采用了 CPU方式绘制或者筒单的帧采用 GPU方式, 从而 2D绘图性能也同样偏低。 发明内容
本发明实施例提供一种绘图方法、 装置及终端, 用以一定程度上提高计 算机系统的显示性能。
第一方面, 本发明实施例提供一种绘图方法, 该方法包括: 接收当前 帧的绘图命令集, 所述绘图命令集包含一条或多条绘图命令及所述绘图命令 的参数; 根据所述当前帧的绘图命令集中的一条或多条绘图命令及所述绘图 命令的参数确定所述当前帧的中央处理器 CPU绘图时间和图形处理器 GPU 绘图时间; 若所述 CPU绘图时间小于所述 GPU绘图时间, 则使用 CPU对所 述当前帧进行绘制, 若所述 GPU绘图时间小于所述 CPU绘图时间, 则使用 GPU对所述当前帧进行绘制。
结合第一方面, 在第一种实现方式下, 所述根据所述当前帧的绘图命 令集中的一条或多条绘图命令及所述绘图命令的参数确定所述当前帧的 CPU 绘图时间和 GPU绘图时间, 包括; 遍历所述当前帧的绘图命令集中的每一条 绘图命令及该条绘图命令的参数; 根据所述每一条绘图命令及所述绘图命令 的参数在预设的性能表中查询 , 得到与所述每一条绘图命令及所述绘图命令 的参数对应的 CPU绘图时间和 GPU绘图时间; 将所述当前帧的绘图命令集 中每一条绘图命令的 CPU绘图时间累加得到所述当前帧的 CPU绘图时间; 将所述当前帧的绘图命令集中每一条绘图命令的 GPU绘图时间累加得到所 述当前帧的 GPU绘图时间。
结合第一方面的第一种实现方式, 在第二种实现方式下, 若在所述预 设的性能表中查询不到与所述绘图命令及所述绘图命令的参数对应的 CPU绘 图时间和 GPU绘图时间,则根据所述绘图命令及所述绘图命令的参数计算与 所述绘图命令及所述绘图命令的参数对应的 CPU绘图时间和 GPU绘图时间; 将计算得到的所述 CPU绘图时间和所述 GPU绘图时间, 以及所述绘图命令 及所述绘图命令的参数存储到所述预设的性能表中。
结合第一方面的第二种实现方式, 在第三种实现方式下, 所述根据所述 绘图命令及所述绘图命令的参数计算与所述绘图命令及所述绘图命令的参数 对应的 CPU绘图时间和 GPU绘图时间, 包括: 根据所述绘图命令与所述绘 图命令的参数, 使用所述 CPU和所述 GPU分别绘制与所述绘图命令及所述 绘图命令的参数对应的图像对象; 在所述 CPU和所述 GPU绘制所述与所述 绘图命令及所述绘图命令的参数对应的图像对象的过程中分别记录所述 CPU 和所述 GPU绘制所述图像对象所使用的时间, 其中所述记录的所述 CPU绘 制所述与所述绘图命令及所述绘图命令的参数对应的图像对象所使用的时间 为与所述绘图命令及所述绘图命令的参数对应的 CPU绘图时间,所述记录的 所述 GPU绘制所述与所述绘图命令及所述绘图命令的参数对应的图像对象 所使用的时间为与所述绘图命令及所述绘图命令的参数对应的 GPU绘图时 间。
结合第一方面、 第一方面的第一种实现方式、 第一方面的第二种实现方 式或第一方面的第三种实现方式, 在第四种实现方式下, 所述方法还包括: 若使用 CPU对所述当前帧进行绘制, 则将当前帧的 CPU绘制结果保存在位 图图像中, 若使用 GPU对所述当前帧进行绘制, 则将当前帧的 GPU绘制结 果保存在纹理图像中; 将所述位图图像或纹理图像中保存的绘制结果显示到 屏幕上。
第二方面, 本发明实施例提供一种绘图装置, 该装置包括接收模块, 用 于接收当前帧的绘图命令集, 所述绘图命令集包含一条或多条绘图命令及所 述绘图命令的参数; 确定模块, 用于根据所述接收模块接收的当前帧的绘图 命令集中的一条或多条绘图命令及所述绘图命令的参数确定所述当前帧的中 央处理器 CPU绘图时间和图形处理器 GPU绘图时间; 绘制决策模块, 用于 若所述确定模块确定的所述当前帧的 CPU绘图时间和 GPU绘图时间中, 所 述 CPU绘图时间小于所述 GPU绘图时间, 则使用 CPU对所述当前帧进行绘 制, 若所述 GPU绘图时间小于所述 CPU绘图时间, 则使用 GPU对所述当前 帧进行绘制。
结合第二方面, 在第一种实现方式下, 所述确定模块具体用于: 遍历 所述当前帧的绘图命令集中的每一条绘图命令及该条绘图命令的参数; 根据 所述每一条绘图命令及该条绘图命令的参数在预设的性能表中查询 , 得到与 所述每一条绘图命令及该条绘图命令的参数对应的 CPU绘图时间和 GPU绘 图时间;将所述当前帧的绘图命令集中每一条绘图命令的 CPU绘图时间累加 得到当前帧的 CPU绘图时间;将所述当前帧的绘图命令集中每一条绘图命令 的 GPU绘图时间累加得到当前帧的 GPU绘图时间。
结合第二方面的第一种实现方式, 在第二种实现方式下, 所述装置还 包括: 计算模块, 用于若所述确定模块在所述预设的性能表中查询不到与所 述绘图命令及所述绘图命令的参数对应的 CPU绘图时间和 GPU绘图时间, 则根据该条绘图命令及所述绘图命令的参数计算与所述绘图命令及所述绘图 命令的参数对应的 CPU绘图时间和 GPU绘图时间; 更新模块, 用于将所述 计算模块计算得到的所述 CPU绘图时间和所述 GPU绘图时间, 以及所述绘 图命令及所述绘图命令的参数存储到所述预设的性能表中。
结合第二方面的第二种实现方式, 在第三种实现方式下, 所述计算模 块具体用于: 若所述确定模块在所述预设的性能表中查询不到与所述绘图命 令及所述绘图命令的参数对应的 CPU绘图时间和 GPU绘图时间, 则根据所 述绘图命令与所述绘图命令的参数, 使用所述 CPU和所述 GPU分别绘制与 所述绘图命令及所述绘图命令的参数对应的图像对象; 在所述 CPU和所述 GPU绘制所述与所述绘图命令及所述绘图命令的参数对应的图像对象的过程 中分别记录所述 CPU和所述 GPU绘制所述图像对象所使用的时间, 其中所 述记录的所述 CPU绘制所述与所述绘图命令及所述绘图命令的参数对应的图 像对象所使用的时间为与所述绘图命令及所述绘图命令的参数对应的 CPU绘 图时间,所述记录的所述 GPU绘制所述与所述绘图命令及所述绘图命令的参 数对应的图像对象所使用的时间为与所述绘图命令及所述绘图命令的参数对 应的 GPU绘图时间。
结合第二方面、 第二方面的第一种实现方式、 第二方面的第二种实现方 式或第二方面的第三种实现方式, 在第四种实现方式下, 所述装置还包括: 保存模块, 用于若使用 CPU对所述当前帧进行绘制, 则将当前帧的 CPU绘 制结果保存在位图图像中, 若使用 GPU对所述当前帧进行绘制, 则将当前帧 的 GPU绘制结果保存在纹理图像中; 显示模块, 用于将所述位图图像或纹理 图像中保存的绘制结果显示到屏幕上。 第三方面, 本发明实施例还提供一种终端设备, 该终端设备包括中央处 理器 CPU、 图形处理器 GPU和设备屏幕, 所述中央处理器 CPU、 图形处理 器 GPU与所述设备屏幕相连, 其中: 所述 CPU用于: 接收当前帧的绘图命 令集, 所述绘图命令集包含一条或多条绘图命令及所述绘图命令的参数; 根 据所述当前帧的绘图命令集中的一条或多条绘图命令及所述绘图命令的参数 确定所述当前帧的 CPU绘图时间和 GPU绘图时间; 若所述 CPU绘图时间小 于所述 GPU绘图时间, 则对所述当前帧进行绘制, 若所述 GPU绘图时间小 于所述 CPU绘图时间, 则由所述 GPU对所述当前帧进行绘制; 所述 GPU用 于: 对所述当前帧进行绘制; 所述设备屏幕用于显示所述 CPU或所述 GPU 对所述当前帧的绘制结果。
结合第三方面, 在第一种实现方式下, 所述 CPU具体用于: 遍历所述当 前帧的绘图命令集中的每一条绘图命令及该条绘图命令的参数; 根据所述每 一条绘图命令及所述绘图命令的参数在预设的性能表中查询, 得到与所述每 一条绘图命令及所述绘图命令的参数对应的 CPU绘图时间和 GPU绘图时间; 将所述当前帧的绘图命令集中每一条绘图命令的 CPU绘图时间累加得到当前 帧的 CPU绘图时间; 将所述当前帧的绘图命令集中每一条绘图命令的 GPU 绘图时间累加得到当前帧的 GPU绘图时间。
结合第三方面的第一种实现方式下, 在第二种实现方式下, 所述 CPU还 用于: 若所述绘图命令集中的一条绘图命令及该条绘图命令的参数在所述预 设的性能表中查询不到与所述绘图命令及所述绘图命令的参数对应的 CPU绘 图时间和 GPU绘图时间,则根据所述绘图命令及所述绘图命令的参数计算与 所述绘图命令及所述绘图命令的参数对应的 CPU绘图时间和 GPU绘图时间; 将计算得到的所述 CPU绘图时间和 GPU绘图时间, 以及该条绘图命令及该 条绘图命令的参数存储到所述预设的性能表中。
可见, 本发明实施例提供的绘图方法、 装置以及终端, 通过接收当前帧 的绘图命令集, 所述绘图命令集包含一条或多条绘图命令及所述绘图命令的 参数,根据所述当前帧的绘图命令集确定所述当前帧的 CPU绘图时间和 GPU 绘图时间,若所述 CPU绘图时间小于所述 GPU绘图时间,则使用 CPU对当 前帧进行绘制, 若所述 GPU 绘图时间小于所述 CPU 绘图时间, 则使用 GPU对当前帧进行绘制, 实现根据 CPU/GPU方式对应的绘图时间动态决 定采用绘图时间较短的绘图方式, 从而一定程度上减少每一帧的绘图时 间, 进而提高系统的显示速度, 提升显示性能。 附图说明
为了更清楚地说明本发明实施例或现有技术中的技术方案, 下面将对 实施例或现有技术描述中所需要使用的附图作筒单地介绍, 显而易见地, 下面描述中的附图仅仅是本发明的一些实施例, 对于本领域普通技术人员 来讲, 在不付出创造性劳动的前提下, 还可以根据这些附图获得其他的附 图。
图 1为现有的一种终端的逻辑结构示意图;
图 2a为本发明实施例提供的一种绘图方法的方法流程示意图; 图 2 b为本发明实施例提供的另一种绘图方法的方法流程示意图; 图 3 a为本发明实施例提供的再一种绘图方法的方法流程示意图; 图 3 b为本发明实施例提供的再一种绘图方法的方法流程示意图; 图 4 a为本发明实施例提供的一种绘图装置的结构示意图;
图 4b为本发明实施例提供的另一种绘图装置的结构示意图; 图 4c为本发明实施例提供的再一种绘图装置的结构示意图; 图 5为本发明实施例提供的一种终端设备的结构示意图;
图 6为本发明实施例提供的另一种终端设备的结构示意图。
具体实施方式
下面将结合本发明实施例中的附图, 对本发明实施例中的技术方案进行 清楚、 完整地描述, 显然, 所描述的实施例仅仅是本发明一部分实施例, 而 不是全部的实施例。 基于本发明中的实施例, 本领域普通技术人员在没有作 出创造性劳动前提下所获得的所有其他实施例, 都属于本发明保护的范围。
请参阅附图 2a,为本发明实施例提供的一种绘图方法的方法流程示意图, 本发明实施例提供的绘图方法可以应用于计算机系统中, 该计算机系统可以 位于一台物理主机上, 也可以分布位于多台物理主机上。 具体地, 该计算机 系统可以位于一台或多台计算机、 便携式电脑、 手持设备(例如手机, PAD 等)、 服务器等类型的终端上。
以图 1为例介绍本发明实施例提供的绘图方法应用的终端的逻辑结构。 该终端具体可以为一智能手机。 如图所示,硬件层包括 CPU和 GPU, 当然还 可以包括存储器、 输入 /输出设备、 网络接口等, 在硬件层之上运行有操作系 统 Android以及一些应用程序。 2D图形库引擎是操作系统的核心部分, 包括 实现 CPU绘图的 Skia和实现 GPU绘图的 openGL(Open Graphics Library);除 此之外, 该终端还包括显示驱动层的显示驱动器; 显示合成层 的 SurfaceFlinger; 显示框架, 包括 view、 widget以及 canvas; 以及应用层, 该 应用层包括 Android操作系统常见的主界面 Home、 联系簿 Contacts, 浏览器 Browser等。 在此终端中, 采用本发明实施例提供的绘图方法, 可以根据当前 帧的绘图命令集动态选取 CPU绘图或 GPU绘图,从而提供系统的绘图性能。
如图 2a所示, 本发明实施例提供的绘图方法包括:
S101、 接收当前帧的绘图命令集, 所述绘图命令集包含一条或多条绘图 命令及所述绘图命令的参数。
所述绘图命令可以包括线性渐变、 图片渐变, 对应的参数可以包括区域 大小、 坐标、 渐变颜色等; 所述绘图命令还可以包括绘制方形或圆形或直线 或曲线, 对应的参数可以包括绘制的起始坐标和结束坐标、 线条类型、 线条 粗细、 线条颜色等。 本领域技术人员应当理解, 以上仅是举例, 本发明实施 例所述的绘图命令还可以包括任意一种计算机系统中会使用的任意一种绘图 命令, 其对应的参数也可以根据实际的参数需求来灵活确定, 本发明实施例 对此并不作限定。
5102、 根据所述当前帧的绘图命令集中的一条或多条绘图命令及所述绘 图命令的参数确定所述当前帧的 CPU绘图时间和 GPU绘图时间。
所述 CPU绘图时间为 CPU执行完所述当前帧的绘图命令集需要的时间; 所述 GPU绘图时间为 GPU执行完所述当前帧的绘图命令集需要的时间。
5103、 若所述 CPU绘图时间小于所述 GPU绘图时间, 则使用 CPU对所 述当前帧进行绘制。
具体地, CPU绘图时间小于所述 GPU绘图时间可以实现为: 所述 GPU 绘图时间与所述 CPU绘图时间的差值大于一定的阈值 1¾。 例如 CPU绘图时 间为 TCPU, GPU绘图时间为 TGPU, 则 TGPU-TCPU , k 其中, ^>0。
5104、 若所述 GPU绘图时间小于所述 CPU绘图时间, 则使用 GPU对所 述当前帧进行绘制。
具体地, GPU绘图时间小于所述 CPU绘图时间可以实现为: 所述 CPU 绘图时间与所述 GPU绘图时间的差值大于一定的阈值 k2。 例如 CPU绘图时 间为 TCPU, GPU绘图时间为 TGPU, 则 TCPU -TGPU = t2, t2> k2, 其中, t2>0。
值得注意的是, 1¾和1¾可以分分别设置为一个具体的数值, 也可以分别 设置为一个数值范围。 1¾和1¾可以设置为相同, 也可以设置为不同。
需说明的是, 若当前帧的 CPU绘图时间和 GPU绘图时间相等; 或者, 当前帧的 CPU绘图时间和 GPU绘图时间的差值的绝对值不超过某一特定阈 值 k3 , 例如可以设置 k3=2; 或者, 当前帧的 CPU绘图时间和 GPU绘图时间 的差值不属于某一特定区间 k3, 例如可以设置 k3=[-2,2]或 [-3,4] , 那么说明当 前帧采用 CPU绘制和采用 GPU绘制的性能相近, 那么可以根据当前系统的 实际情况选择采取哪一种绘图, 本发明实施例对此不作限定。
以图 1为例, 本发明实施例提供的绘图方法可以应用于 2D图形库引擎 层,在该层中根据 CPU绘图时间和 GPU绘图时间动态决定调用 Skia提供的 API ( Application Program Interface, 应用程序接口)实现 CPU绘图, 或调 用 openGL提供的 API接口实现 GPU绘图。
进一步的, 如图 2b所示, 本发明实施例还包括:
S105、 若对当前帧采用 CPU进行绘制, 则将当前帧的 CPU绘制结果保 存在位图图像 ( Bitmap ) 中。
S106、 若对当前帧采用 GPU进行绘制, 则将当前帧的 GPU绘制结果保 存在纹理图像 ( Texture ) 中。
Bitmap和 Texture是操作系统提供的两种不同的渲染通道。 Bitmap对应 一块内存, 访问方式为逐行逐像数; 若为 GPU方式, 则所有的绘图命令执 行后会将绘图内容保存在 Texture中, Texture也是对应一块内存, 访问方式 按块 (Tile)访问。
S107、 将 Bitmap或 Texture保存的绘制结果显示到屏幕上。
以图 1 为例, 显示合成层支持多任务, 一次可显示多个应用程序的 UI 窗体, 且同一个应用程序也可能创建多个窗体。 在所有窗体绘制完成后, 系 统最终显示结果是当前可显示的所有窗体的一个集合。 合成完成后, 调用显 示驱动层的显示驱动器将结果拷贝到帧緩沖区 (FrameBuffer ); 显示驱动器, 例如终端的 LCD ( Liquid Crystal Display, 液晶显示 )驱动, 会将帧緩沖区的 内容显示在屏幕上。
可见, 本发明实施例提供的绘图方法, 通过接收当前帧的绘图命令集, 所述绘图命令集包含一条或多条绘图命令及所述绘图命令的参数, 根据所述 当前帧的绘图命令集确定所述当前帧的 CPU绘图时间和 GPU绘图时间, 若 所述 CPU绘图时间小于所述 GPU绘图时间,则使用 CPU对当前帧进行绘制, 若所述 GPU绘图时间小于所述 CPU绘图时间,则使用 GPU对当前帧进行绘 制, 实现根据 CPU/GPU方式对应的绘图时间动态决定采用绘图时间较短 的绘图方式, 从而一定程度上减少每一帧的绘图时间, 进而提高系统的显 示速度, 提升显示性能。 在 UI交互过程中, 可以极大地提升用户体验。
进一步的, 通过选择采用 Bitmap或 Texture的保存方式, 实现根据不同 的绘图方式, 选择不同的渲染通道显示的方法, 更加有效地提升了系统的显 示性能。
请参阅附图 3a, 为本发明实施例提供的另一种绘图方法的方法流程示意 图, 该方法可以应用于计算机系统中, 该计算机系统可以位于一台物理主机 上, 也可以分布位于多台物理主机上。 具体地, 可以应用于如图 1所示的终 端。 该方法包括:
S101、 接收当前帧的绘图命令集, 所述绘图命令集中包含多条绘图命令 及与这些绘图命令分别对应的绘图参数。
S1021、 遍历每一条绘图命令及该条绘图命令的参数。
S1022、根据每一条绘图命令及该条绘图命令的参数在预设的性能表中查 询,得到与所述每一条绘图命令及该条绘图命令的参数对应的 CPU绘图时间 和 GPU绘图时间。
需说明的是, 在本发明实施例中, 同样的绘图命令不同的参数, 其 CPU 绘图时间或 GPU绘图时间也可能不相同。
S1023、 将所述当前帧的绘图命令集中每一条绘图命令的 CPU绘图时间 累加得到当前帧的 CPU绘图时间;将所述当前帧的绘图命令集中每一条绘图 命令的 GPU绘图时间累加得到当前帧的 GPU绘图时间。
当然, 本发明实施例还包括前述实施例的 S103和 S104, 进一步的, 也 可以包括前述实施例的步骤 S105、 S106、 S107, 在此不再赘述。
可见, 本发明实施例提供的绘图方法, 通过接收当前帧的绘图命令集, 所述绘图命令集包含一条或多条绘图命令及所述绘图命令的参数, 根据所述 当前帧的绘图命令集确定所述当前帧的 CPU绘图时间和 GPU绘图时间, 若 所述 CPU绘图时间小于所述 GPU绘图时间,则使用 CPU对当前帧进行绘制, 若所述 GPU绘图时间小于所述 CPU绘图时间,则使用 GPU对当前帧进行绘 制, 实现根据 CPU/GPU方式对应的绘图时间动态决定采用绘图时间较短 的绘图方式, 从而一定程度上减少每一帧的绘图时间, 进而提高系统的显 示速度, 提升显示性能。 在 UI交互过程中, 可以极大地提升用户体验。 在 UI交互过程中, 可以极大地提升用户体验。
下面通过一个具体实施例描述本发明提供的绘图方法中获得当前帧 的 CPU绘图时间和 CPU绘图时间的一种具体实现。
如图 3b所示, 该方法包括:
5201、 接收当前帧的绘图命令集, 所述绘图命令集中包含多条绘图命令 及与这些绘图命令分别对应的绘图参数。
5202、 遍历每一条绘图命令及该条绘图命令的参数。
5203、 在预设的性能表中查询 CPU绘图时间和 GPU绘图时间。
预设的性能表示例如下:
表 1 性能表
Figure imgf000013_0001
如表 1所示, 线性变换和图片渐变是两个绘图命令, 这两个绘图命令分 别对应绘图参数即区域大小。 根据绘图命令和区域大小可以确定一条绘图命 令的 GPU渲染时间和 CPU渲染时间 (以 ms计算 ), 例如表 1中区域大小为 100*100像素,绘图操作是图片渐变时,需要的 GPU和 CPU渲染时间分贝为 108ms和 80ms。
需说明的是, 表 1仅是示例形式, 其中的绘图命令也仅是举例说明。 在 本发明的其它一些实施例中, 性能表中绘图命令的参数也可以有两个或两个 以上。 相同绘图命令的绘图参数若不相同通常在性能表中会有各自的记录。 若在预设的性能表中查询到该条绘图命令及该条绘图命令的参数对应的
GPU绘图时间和 CPU绘图时间, 则转到步骤 S204 , 否则转到步骤 S205。
S204、获得与该条绘图命令及该条会命令的参数对应的 CPU绘图时间和 GPU绘图时间。
S205、 计算该条绘图命令及该条会命令的参数对应的 CPU绘图时间 和 GPU绘图时间。
具体地, 若所述绘图命令集中的一条绘图命令及该条绘图命令的参数在 所述预设的性能表中查询不到与之对应的 CPU绘图时间和 GPU绘图时间, 则启动计算进程;将该条绘图命令及该条绘图命令的参数传入所述计算进程; 由该计算进程同时计算与该条绘图命令及该条绘图命令的参数对应的 CPU绘 图时间和 GPU绘图时间。
可选的, 计算方法如下: 根据所述绘图命令与所述绘图命令的参数, 使 用所述 CPU和所述 GPU分别绘制与所述绘图命令及所述绘图命令的参数对 应的图像对象; 在所述 CPU和所述 GPU绘制所述与所述绘图命令及所述绘 图命令的参数对应的图像对象的过程中分别记录所述 CPU和所述 GPU绘制 所述图像对象所使用的时间,其中记录的所述 CPU绘制所述与所述绘图命令 及所述绘图命令的参数对应的图像对象所使用的时间为与所述绘图命令及所 述绘图命令的参数对应的 CPU绘图时间, 记录的所述 GPU绘制所述与所述 绘图命令及所述绘图命令的参数对应的图像对象所使用的时间为与所述绘图 命令及所述绘图命令的参数对应的 GPU绘图时间。
进一步地, 为了实现对性能表的及时更新, 所述方法还包括:
S206、 可以将此次计算获得的 CPU绘图时间和 GPU绘图时间增添到所 述预设的性能表中 ,这样下一次再有与此次绘图命令及参数相同的绘图命令 时就可以直接通过查询所述预设的性能表获得。
无论是通过查表还是计算的方式获得该条绘图命令及其参数对应的 CPU 绘图时间和 GPU绘图时间后, 判断绘图命令集的遍历是否结束, 若结束, 则 继续步骤 S207; 若没有结束, 则返回步骤 S202继续遍历下一条绘图命令。
S207、将所述当前帧的绘图命令集中每一条绘图命令的 CPU绘图时间累 加获得当前帧的 CPU绘图时间;将所述当前帧的绘图命令集中每一条绘图命 令的 GPU绘图时间累加获得当前帧的 GPU绘图时间。
获得当前帧的 CPU绘图时间和 GPU绘图时间之后, 根据本发明前述实 施例的方法可以进行 CPU绘制和 GPU绘制的选择, 进一步地, 再执行绘制 结果的保存和显示。 具体步骤可参考前述实施例, 在此不再赘述。
可见, 本发明实施例提供的绘图方法, 通过接收当前帧的绘图命令集, 所述绘图命令集包含一条或多条绘图命令及所述绘图命令的参数, 根据所述 当前帧的绘图命令集确定所述当前帧的 CPU绘图时间和 GPU绘图时间, 若 所述 CPU绘图时间小于所述 GPU绘图时间,则使用 CPU对当前帧进行绘制, 若所述 GPU绘图时间小于所述 CPU绘图时间,则使用 GPU对当前帧进行绘 制, 实现根据 CPU/GPU方式对应的绘图时间动态决定采用绘图时间较短 的绘图方式, 从而一定程度上减少每一帧的绘图时间, 进而提高系统的显 示速度, 提升显示性能。 在 UI交互过程中, 可以极大地提升用户体验。
请参阅图 4a, 为本发明实施例提供的一种绘图装置 10的逻辑结构示意 图。 本发明实施例提供的绘图装置 10可以对应于如图 1 所示的终端系统的 2D图形库引擎层。 如图 4a所示, 该装置包括:
接收模块 11 , 用于接收当前帧的绘图命令集, 所述绘图命令集包含一条 或多条绘图命令及所述绘图命令的参数。
所述绘图命令可以包括线性渐变、 图片渐变, 对应的参数可以包括区域 大小、 坐标、 渐变颜色等; 所述绘图命令还可以包括绘制方形或圆形或直线 或曲线等, 对应的参数可以包括绘制的起始坐标和结束坐标、 线条类型、 线 条粗细、 线条颜色等。 本领域技术人员应当理解, 以上仅是举例, 本发明实 施例所述的绘图命令还可以包括任意一种计算机系统中会使用的任意一种绘 图命令, 其对应的参数也可以根据实际的参数需求来灵活确定, 本发明实施 例对此并不作限定。
确定模块 12, 用于根据接收模块 11接收的所述当前帧的绘图命令集中 的绘图命令及所述绘图命令的参数确定所述当前帧的 CPU绘图时间和 GPU 绘图时间;
绘制决策模块 13,用于若所述确定模块确定的所述当前帧的 CPU绘图时 间和 GPU绘图时间中, 所述 CPU绘图时间小于所述 GPU绘图时间, 则使用 CPU对所述当前帧进行绘制,若所述 GPU绘图时间小于所述 CPU绘图时间, 则使用 GPU对所述当前帧进行绘制。
参考图 4b,绘制决策模块 13根据绘图时间的比较结果选择调用 CPU或 GPU进行当前帧的绘制。 调用方式可以是通过图 1 示例中的图形库 skia和 openGL提供的 API。 图 4b中的 CPU和 GPU是该本发明实施例提供的绘图 装置所位于的终端设备的硬件层提供的两个处理器。
进一步地, 如图 4c所示, 该绘图装置 10还可以包括:
保存模块 14, 用于若使用 CPU对所述当前帧进行绘制, 则将当前帧的 CPU绘制结果保存在 Bitmap中, 若使用 GPU对所述当前帧进行绘制, 则将 当前帧的 GPU绘制结果保存在 Texture中;
显示模块 15,用于将 Bitmap或 Texture中保存的绘制结果显示到屏幕上。 以图 1为例, 显示模块 15可以调用显示合成层的 SurfaceFlinger进行图 像的合成, 合成完成后, 在调用显示驱动器将合成结果拷贝到帧緩沖区 framebuffer, 然后由显示驱动器将帧緩沖区的内容显示在屏幕上。
可见, 本发明实施例提供的绘图装置, 通过接收当前帧的绘图命令集, 所述绘图命令集包含一条或多条绘图命令及所述绘图命令的参数, 根据所述 当前帧的绘图命令集确定所述当前帧的 CPU绘图时间和 GPU绘图时间, 若 所述 CPU绘图时间小于所述 GPU绘图时间,则使用 CPU对当前帧进行绘制, 若所述 GPU绘图时间小于所述 CPU绘图时间,则使用 GPU对当前帧进行绘 制, 实现根据 CPU/GPU方式对应的绘图时间动态决定采用绘图时间较短 的绘图方式, 从而一定程度上减少每一帧的绘图时间, 进而提高系统的显 示速度, 提升显示性能。 在 UI交互过程中, 可以极大地提升用户体验。
进一步的, 通过选择采用 Bitmap或 Texture的保存方式, 实现根据不同 的绘图方式, 选择不同的渲染通道显示的方法, 更加有效地提升了系统的显 示性能。
需说明的是, 本说明书中的各个实施例均采用递进的方式描述, 各个实 施例之间相同相似的部分互相参见即可, 每个实施例重点说明的都是与其他 实施例的不同之处。 尤其, 对于装置实施例而言, 由于其基本相似于方法实 施例, 所以描述得比较筒单, 相关之处参见方法实施例的部分说明即可。 例 如, 确定模块 12的具体实现方法可以参考前述实施例所述的获取 CPU绘图 时间和 GPU绘图时间的方法。 在该获取方法中存在的性能表(如表 1 ) 即也 作为本发明装置的一部分, 可以存储在磁盘上, 掉电不丢失的, 这样终端多 次开关机, 之前积累的绘图数据还在。
请参阅图 5, 为本发明实施例提供的一种终端设备 20的结构示意图。 如 图 5所示,该终端 20包括 CPU21、 GPU22以及设备屏幕 23 , CPU21和 GPU22 与设备屏幕 23相连, 其中:
CPU21用于接收当前帧的绘图命令集, 所述绘图命令集包含一条或多条 绘图命令及所述绘图命令的参数; 根据所述当前帧的绘图命令集中的一条或 多条绘图命令及所述绘图命令的参数确定所述当前帧的 CPU 绘图时间和 GPU绘图时间; 若所述 CPU绘图时间小于所述 GPU绘图时间, 则对所述当 前帧进行绘制, 若所述 GPU绘图时间小于所述 CPU绘图时间, 则由 GPU22 对所述当前帧进行绘制;
具体的, CPU21用于: 遍历所述当前帧的绘图命令集中的每一条绘图命 令及该条绘图命令的参数; 根据所述每一条绘图命令及该条绘图命令的参数 在预设的性能表中查询, 得到与所述每一条绘图命令及该条绘图命令的参数 对应的 CPU绘图时间和 GPU绘图时间; 将所述当前帧的绘图命令集中每一 条绘图命令的 CPU绘图时间累加得到当前帧的 CPU绘图时间; 将所述当前 帧的绘图命令集中每一条绘图命令的 GPU绘图时间累加得到当前帧的 GPU 绘图时间。
CPU21还用于: 若在所述预设的性能表中查询不到与所述绘图命令及所 述绘图命令的参数对应的 CPU绘图时间和 GPU绘图时间, 则根据所述绘图 命令及所述绘图命令的参数计算与所述绘图命令及所述绘图命令的参数对应 的 CPU绘图时间和 GPU绘图时间;将计算得到的所述 CPU绘图时间和 GPU 绘图时间, 以及该条绘图命令及该条绘图命令的参数存储到所述预设的性能 表中。
计算方法可以如下: 根据所述绘图命令与所述绘图命令的参数, 通过所 述 CPU和 GPU分别绘制与所述绘图命令及所述绘图命令的参数对应的图像 对象; 在所述 CPU和 GPU绘制所述与所述绘图命令及所述绘图命令的参数 对应的图像对象的过程中分别记录所述 CPU和 GPU绘制所述图像对象所使 用的时间,其中所述记录的所述 CPU绘制所述与所述绘图命令及所述绘图命 令的参数对应的图像对象所使用的时间为与所述绘图命令及所述绘图命令的 参数对应的 CPU绘图时间, 所述记录的所述 GPU绘制所述与所述绘图命令 及所述绘图命令的参数对应的图像对象所使用的时间为与所述绘图命令及所 述绘图命令的参数对应的 GPU绘图时间。
进一步的, CPU21还用于: 若使用 CPU对所述当前帧进行绘制, 则将当 前帧的 CPU绘制结果保存在位图图像中, 若使用 GPU对所述当前帧进行绘 制, 则将当前帧的 GPU绘制结果保存在纹理图像中; 将所述位图图像或纹理 图像中保存的绘制结果显示到设备屏幕上。
所述 GPU用于: 对所述当前帧进行绘制; 设备屏幕 23用于显示 CPU21 或 GPU22对所述当前帧的绘制结果。 具体的, 用于显示所述位图图像或所述 纹理图像中保存的绘制结果。
可见, 本发明实施例提供的终端设备, 通过接收当前帧的绘图命令集, 所述绘图命令集包含一条或多条绘图命令及所述绘图命令的参数, 根据所述 当前帧的绘图命令集确定所述当前帧的 CPU绘图时间和 GPU绘图时间, 若 所述 CPU绘图时间小于所述 GPU绘图时间,则使用 CPU对当前帧进行绘制, 若所述 GPU绘图时间小于所述 CPU绘图时间,则使用 GPU对当前帧进行绘 制, 实现根据 CPU/GPU方式对应的绘图时间动态决定采用绘图时间较短 的绘图方式, 从而一定程度上减少每一帧的绘图时间, 进而提高系统的显 示速度, 提升显示性能。 在 UI交互过程中, 可以极大地提升用户体验。
进一步的, 通过选择采用 Bitmap或 Texture的保存方式, 实现根据不同 的绘图方式, 选择不同的渲染通道显示的方法, 更加有效地提升了系统的显 示性能。
请参阅图 6, 为本发明实施例提供的另一种终端设备 30的结构示意图。 如图 6所示, 该终端设备 30包括 CPU31、 GPU32、 存储器 33、 显示屏 34以 及总线 35。 CPU31、 GPU32、 存储器 33、 显示屏 34通过总线 35连接。
存储器 33可以实现为计算机的软盘、 U盘、移动硬盘、只读存储器( ROM, Read-Only Memory )、 随机存取存储器(RAM, Random Access Memory ), 磁 碟或者光盘等的一种或多种。
存储器 33存储了如下的元素, 可执行模块或者数据结构, 或者它们的子 集, 或者它们的扩展集:
应用程序 331 包括各种应用程序, 例如图 1 所示的 Home、 Contacts, Browser等, 用于实现各种应用业务。
操作系统 332包括各种系统程序, 例如图 1所示的显示框架、 2D图形库 引擎、 显示合成层等, 用于实现各种基础业务以及处理基于硬件的任务。
在本发明实施例中, CPU通过调用存储器 33中存储的程序(该程序可以 存储在操作系统 332中 ) , 执行如下操作:
接收当前帧的绘图命令集, 所述绘图命令集包含一条或多条绘图命令及 所述绘图命令的参数; 根据所述当前帧的绘图命令集确定所述当前帧的中央 处理器 CPU绘图时间和图形处理器 GPU绘图时间; 若所述 CPU绘图时间小 于所述 GPU绘图时间, 则使用 CPU31对所述当前帧进行绘制, 若所述 GPU 绘图时间小于所述 CPU绘图时间, 则使用 GPU32对所述当前帧进行绘制。 其中, 所述当前帧的绘图命令集可能来自于操作系统 332本身, 也可能来自 于应用程序 331。
具体地, CPU31遍历所述当前帧的绘图命令集中的每一条绘图命令及该 条绘图命令的参数; 根据所述每一条绘图命令及该条绘图命令的参数在预设 的性能表中查询, 获得与所述每一条绘图命令及该条绘图命令的参数对应的 CPU绘图时间和 GPU绘图时间; 将所述当前帧的绘图命令集中每一条绘图 命令的 CPU绘图时间累加获得当前帧的 CPU绘图时间; 将所述当前帧的绘 图命令集中每一条绘图命令的 GPU绘图时间累加获得当前帧的 GPU绘图时 间。 若所述绘图命令集中的一条绘图命令及该条绘图命令的参数在所述预设 的性能表中查询不到与之对应的 CPU绘图时间和 GPU绘图时间, 则根据该 条绘图命令及该条绘图命令的参数计算与之对应的 CPU绘图时间和 GPU绘 图时间, 具体地, 启动计算进程; 将该条绘图命令及该条绘图命令的参数传 入所述计算进程; 由该计算进程同时计算与该条绘图命令及该条绘图命令的 参数对应的 CPU绘图时间和 GPU绘图时间; 将计算获得的所述 CPU绘图时 间和 GPU绘图时间, 以及该条绘图命令及该条绘图命令的参数存储到所述预 设的性能表中。 具体计算方法可以如下: 根据所述绘图命令与所述绘图命令 的参数, 通过所述 CPU和 GPU分别绘制与所述绘图命令及所述绘图命令的 参数对应的图像对象; 在所述 CPU和 GPU绘制所述与所述绘图命令及所述 绘图命令的参数对应的图像对象的过程中分别记录所述 CPU和 GPU绘制所 述图像对象所使用的时间,其中所述记录的所述 CPU绘制所述与所述绘图命 令及所述绘图命令的参数对应的图像对象所使用的时间为与所述绘图命令及 所述绘图命令的^ t对应的 CPU绘图时间, 所述记录的所述 GPU绘制所述 与所述绘图命令及所述绘图命令的参数对应的图像对象所使用的时间为与所 述绘图命令及所述绘图命令的参数对应的 GPU绘图时间。
其中, 预设的性能表可以存储在存储器 33中。 优选地, 预设的性能表存 储在掉电不丢失的存储器中。 在一些实现方式下, 存储器 33包括 RAM和磁 盘, 其中预设的性能表可以存储在磁盘中。
进一步的, CPU31还用于若使用 CPU对所述当前帧进行绘制, 则将当前 帧的 CPU绘制结果保存在位图图像中,若使用 GPU对所述当前帧进行绘制, 则将当前帧的 GPU绘制结果保存在纹理图像中;将所述位图图像或纹理图像 中保存的绘制结果显示到屏幕上。
GPU32用于进行图形绘制; CPU31还用于进行图形绘制。
显示屏 34用于输出 CPU31或 GPU32绘制的图形。 显示屏 34可以同时 为触摸屏。
进一步的, 本发明实施例提供的终端设备还可以包括输入设备 36, 用户 可以使用输入设备 36输入帧绘制命令, 在其它一些实施例中, 帧绘制命令也 可以来自于操作系统或应用程序。 输入设备 35可以实现为触摸屏、 鼠标、 键 盘等。 那么还可以包括通信接口、 声音输入 /输出设备(例如话筒 /扬声器)、 传感器 等。该手机终端中设置的应用程序还可以包括 GPS( Global Positioning System, 全球定位系统)、 视频、 音乐、 游戏、 浏览器等。
另外,如图 6所示各个模块通过总线 35连接,该总线可以是 ISA( Industry
Standard Architecture, 工业标准体系结构 )总线、 PCI ( Peripheral Component, 夕卜部设备互连 )总线或 EISA ( Extended Industry Standard Architecture, 扩展 工业标准体系结构) 总线等。 所述总线可以是一条或多条物理线路, 当是多 条物理线路时可以分为地址总线、 数据总线、 控制总线等。 在本发明其它一 些实现方式中,本发明实施例提供的各个模块也可以不通过总线的方式连接, 而根据信号传递关系直接建立通信连接。 需说明的是,存储器 33中存储的程序的模块划分可以参考前述实施例的 模块划分方式, 也可以采用另外的模块划分方式。
可见, 本发明实施例提供的绘图方法、 装置以及终端, 通过接收当前帧 的绘图命令集, 所述绘图命令集包含一条或多条绘图命令及所述绘图命令的 参数,根据所述当前帧的绘图命令集确定所述当前帧的 CPU绘图时间和 GPU 绘图时间, 若所述 CPU绘图时间小于所述 GPU绘图时间, 则使用 CPU对当 前帧进行绘制, 若所述 GPU绘图时间小于所述 CPU绘图时间, 则使用 GPU 对当前帧进行绘制, 实现根据 CPU/GPU方式对应的绘图时间动态决定采用 绘图时间较短的绘图方式, 从而一定程度上减少每一帧的绘图时间, 进而提 高系统的显示速度, 提升显示性能。 在 UI交互过程中, 可以极大地提升用户 体验。
进一步的, 通过选择采用位图图像或纹理图像的保存方式, 实现根据不 同的绘图方式, 选择不同的渲染通道显示, 更加有效地提升了系统的显示性 能。
以上所描述的装置实施例仅仅是示意性的, 其中所述作为分离部件说明 的单元可以是或者也可以不是物理上分开的, 作为单元显示的部件可以是或 者也可以不是物理单元, 即可以位于一个地方, 或者也可以分布到多个网络 单元上。 可以根据实际的需要选择其中的部分或者全部模块来实现本实施例 方案的目的。 另外, 本发明提供的装置实施例附图中, 模块之间的连接关系 表示它们之间具有通信连接,具体可以实现为一条或多条通信总线或信号线。 本领域普通技术人员在不付出创造性劳动的情况下, 即可以理解并实施。
通过以上的实施方式的描述, 所属领域的技术人员可以清楚地了解到本 发明实施例所述的绘图装置可借助软件加必需的通用硬件的方式来实现, 当 然也可以通过专用硬件包括专用集成电路、 专用 CPU、 专用存储器、 专用元 器件等来实现。 一般情况下, 凡由计算机程序完成的功能都可以很容易地用 相应的硬件来实现, 而且, 用来实现同一功能的具体硬件结构也可以是多种 多样的, 例如模拟电路、 数字电路或专用电路等。
以上所述, 仅为本发明的具体实施方式, 但本发明的保护范围并不局限 于此, 任何熟悉本技术领域的技术人员在本发明揭露的技术范围内, 可轻易 想到变化或替换, 都应涵盖在本发明的保护范围之内。 因此, 本发明的保护 范围应以所述权利要求的保护范围为准。

Claims

权 利 要 求 书
1、 一种绘图方法, 其特征在于, 所述方法包括:
接收当前帧的绘图命令集, 所述绘图命令集包含一条或多条绘图命令及 所述绘图命令的^!史;
根据所述当前帧的绘图命令集中的一条或多条绘图命令及所述绘图命令 的参数确定所述当前帧的中央处理器 CPU绘图时间和图形处理器 GPU绘图 时间;
若所述 CPU绘图时间小于所述 GPU绘图时间, 则使用 CPU对所述当前 帧进行绘制, 若所述 GPU绘图时间小于所述 CPU绘图时间, 则使用 GPU对 所述当前帧进行绘制。
2、 根据权利要求 1所述的方法, 其特征在于, 所述根据所述当前帧的绘 图命令集中的一条或多条绘图命令及所述绘图命令的参数确定所述当前帧的 CPU绘图时间和 GPU绘图时间, 包括;
遍历所述当前帧的绘图命令集中的每一条绘图命令及该条绘图命令的参 数;
根据所述每一条绘图命令及所述绘图命令的参数在预设的性能表中查 询,得到与所述每一条绘图命令及所述绘图命令的参数对应的 CPU绘图时间 和 GPU绘图时间;
将所述当前帧的绘图命令集中每一条绘图命令的 CPU绘图时间累加得到 所述当前帧的 CPU绘图时间;将所述当前帧的绘图命令集中每一条绘图命令 的 GPU绘图时间累加得到所述当前帧的 GPU绘图时间。
3、 根据权利要求 2所述的方法, 其特征在于, 所述方法还包括: 若在所述预设的性能表中查询不到与所述绘图命令及所述绘图命令的参 数对应的 CPU绘图时间和 GPU绘图时间, 则根据所述绘图命令及所述绘图 命令的参数计算与所述绘图命令及所述绘图命令的参数对应的 CPU绘图时间 和 GPU绘图时间; 将计算得到的所述 CPU绘图时间和所述 GPU绘图时间, 以及所述绘图 命令及所述绘图命令的参数存储到所述预设的性能表中。
4、 根据权利要求 3所述的方法, 其特征在于, 所述根据所述绘图命令及 所述绘图命令的^ t计算与所述绘图命令及所述绘图命令的参数对应的 CPU 绘图时间和 GPU绘图时间, 包括:
根据所述绘图命令与所述绘图命令的参数, 使用所述 CPU和所述 GPU 分别绘制与所述绘图命令及所述绘图命令的参数对应的图像对象;
在所述 CPU和所述 GPU绘制所述与所述绘图命令及所述绘图命令的参 数对应的图像对象的过程中分别记录所述 CPU和所述 GPU绘制所述图像对 象所使用的时间,其中所述记录的所述 CPU绘制所述与所述绘图命令及所述 绘图命令的参数对应的图像对象所使用的时间为与所述绘图命令及所述绘图 命令的参数对应的 CPU绘图时间, 所述记录的所述 GPU绘制所述与所述绘 图命令及所述绘图命令的参数对应的图像对象所使用的时间为与所述绘图命 令及所述绘图命令的参数对应的 GPU绘图时间。
5、根据权利要求 1-4任一项所述的方法,其特征在于,所述方法还包括: 若使用 CPU对所述当前帧进行绘制, 则将当前帧的 CPU绘制结果保存 在位图图像中, 若使用 GPU对所述当前帧进行绘制, 则将当前帧的 GPU绘 制结果保存在纹理图像中;
将所述位图图像或纹理图像中保存的绘制结果显示到屏幕上。
6、 一种绘图装置, 其特征在于, 所述装置包括:
接收模块, 用于接收当前帧的绘图命令集, 所述绘图命令集包含一条或 多条绘图命令及所述绘图命令的参数;
确定模块, 用于根据所述接收模块接收的当前帧的绘图命令集中的一条 或多条绘图命令及所述绘图命令的参数确定所述当前帧的中央处理器 CPU绘 图时间和图形处理器 GPU绘图时间;
绘制决策模块,用于若所述确定模块确定的所述当前帧的 CPU绘图时间 和 GPU绘图时间中, 所述 CPU绘图时间小于所述 GPU绘图时间, 则使用 CPU对所述当前帧进行绘制,若所述 GPU绘图时间小于所述 CPU绘图时间, 则使用 GPU对所述当前帧进行绘制。
7、 根据权利要求 6所述的装置, 其特征在于, 所述确定模块具体用于: 遍历所述当前帧的绘图命令集中的每一条绘图命令及该条绘图命令的参 数;
根据所述每一条绘图命令及该条绘图命令的参数在预设的性能表中查 询,得到与所述每一条绘图命令及该条绘图命令的参数对应的 CPU绘图时间 和 GPU绘图时间;
将所述当前帧的绘图命令集中每一条绘图命令的 CPU绘图时间累加得到 当前帧的 CPU绘图时间; 将所述当前帧的绘图命令集中每一条绘图命令的 GPU绘图时间累加得到当前帧的 GPU绘图时间。
8、 根据权利要求 7所述的装置, 其特征在于, 所述装置还包括: 计算模块, 用于若所述确定模块在所述预设的性能表中查询不到与所述绘 图命令及所述绘图命令的参数对应的 CPU绘图时间和 GPU绘图时间, 则根 据该条绘图命令及所述绘图命令的参数计算与所述绘图命令及所述绘图命令 的参数对应的 CPU绘图时间和 GPU绘图时间;
更新模块, 用于将所述计算模块计算得到的所述 CPU 绘图时间和所述 GPU绘图时间, 以及所述绘图命令及所述绘图命令的参数存储到所述预设的 性能表中。
9、 根据权利要求 8所述的装置, 其特征在于, 所述计算模块具体用于: 若所述确定模块在所述预设的性能表中查询不到与所述绘图命令及所述绘图 命令的参数对应的 CPU绘图时间和 GPU绘图时间, 则根据所述绘图命令与 所述绘图命令的参数, 使用所述 CPU和所述 GPU分别绘制与所述绘图命令 及所述绘图命令的参数对应的图像对象; 在所述 CPU和所述 GPU绘制所述 与所述绘图命令及所述绘图命令的参数对应的图像对象的过程中分别记录所 述 CPU和所述 GPU绘制所述图像对象所使用的时间, 其中所述记录的所述 CPU绘制所述与所述绘图命令及所述绘图命令的参数对应的图像对象所使用 的时间为与所述绘图命令及所述绘图命令的参数对应的 CPU绘图时间,所述 记录的所述 GPU绘制所述与所述绘图命令及所述绘图命令的参数对应的图 像对象所使用的时间为与所述绘图命令及所述绘图命令的参数对应的 GPU 绘图时间。
10、 根据权利要求 6-9任一项所述的装置, 其特征在于, 所述装置还包 括:
保存模块,用于若使用 CPU对所述当前帧进行绘制,则将当前帧的 CPU 绘制结果保存在位图图像中, 若使用 GPU对所述当前帧进行绘制, 则将当前 帧的 GPU绘制结果保存在纹理图像中;
显示模块, 用于将所述位图图像或纹理图像中保存的绘制结果显示到屏 幕上。
11、一种终端设备,其特征在于, 包括中央处理器 CPU、图形处理器 GPU 和设备屏幕, 所述中央处理器 CPU、 图形处理器 GPU与所述设备屏幕相连, 其中:
所述 CPU用于: 接收当前帧的绘图命令集, 所述绘图命令集包含一条或 多条绘图命令及所述绘图命令的参数; 根据所述当前帧的绘图命令集中的一 条或多条绘图命令及所述绘图命令的参数确定所述当前帧的 CPU绘图时间和 GPU绘图时间; 若所述 CPU绘图时间小于所述 GPU绘图时间, 则对所述当 前帧进行绘制,若所述 GPU绘图时间小于所述 CPU绘图时间,则由所述 GPU 对所述当前帧进行绘制;
所述 GPU用于: 对所述当前帧进行绘制;
所述设备屏幕用于显示所述 CPU或所述 GPU对所述当前帧的绘制结果。
12、 根据权利要求 11所述的终端, 其特征在于, 所述 CPU具体用于: 遍历所述当前帧的绘图命令集中的每一条绘图命令及该条绘图命令的参数; 根据所述每一条绘图命令及所述绘图命令的参数在预设的性能表中查询, 得 到与所述每一条绘图命令及所述绘图命令的参数对应的 CPU 绘图时间和 GPU绘图时间; 将所述当前帧的绘图命令集中每一条绘图命令的 CPU绘图 时间累加得到当前帧的 CPU绘图时间;将所述当前帧的绘图命令集中每一条 绘图命令的 GPU绘图时间累加得到当前帧的 GPU绘图时间。
13、 根据权利要求 12所述的终端, 其特征在于, 所述 CPU还用于: 若 所述绘图命令集中的一条绘图命令及该条绘图命令的参数在所述预设的性能 表中查询不到与所述绘图命令及所述绘图命令的参数对应的 CPU绘图时间和 GPU绘图时间, 则根据所述绘图命令及所述绘图命令的参数计算与所述绘图 命令及所述绘图命令的参数对应的 CPU绘图时间和 GPU绘图时间; 将计算得 到的所述 CPU绘图时间和 GPU绘图时间, 以及该条绘图命令及该条绘图命令 的参数存储到所述预设的性能表中。
PCT/CN2013/084148 2013-03-07 2013-09-25 一种绘图方法、装置及终端 WO2014134912A1 (zh)

Priority Applications (4)

Application Number Priority Date Filing Date Title
KR1020147012010A KR101623415B1 (ko) 2013-03-07 2013-09-25 드로잉 방법, 장치, 및 단말
EP13844577.0A EP2793185B1 (en) 2013-03-07 2013-09-25 Plotting method, device and terminal
JP2015503752A JP5963940B2 (ja) 2013-03-07 2013-09-25 描画の方法、装置、および端末
US14/331,642 US9430810B2 (en) 2013-03-07 2014-07-15 Drawing method, apparatus, and terminal

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201310072936.0A CN103164839B (zh) 2013-03-07 2013-03-07 一种绘图方法、装置及终端
CN201310072936.0 2013-03-07

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US14/331,642 Continuation US9430810B2 (en) 2013-03-07 2014-07-15 Drawing method, apparatus, and terminal

Publications (1)

Publication Number Publication Date
WO2014134912A1 true WO2014134912A1 (zh) 2014-09-12

Family

ID=48587898

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2013/084148 WO2014134912A1 (zh) 2013-03-07 2013-09-25 一种绘图方法、装置及终端

Country Status (7)

Country Link
US (1) US9430810B2 (zh)
EP (1) EP2793185B1 (zh)
JP (1) JP5963940B2 (zh)
KR (1) KR101623415B1 (zh)
CN (1) CN103164839B (zh)
TW (1) TWI604409B (zh)
WO (1) WO2014134912A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150091922A1 (en) * 2013-10-01 2015-04-02 International Business Machines Corporation Diagnosing Graphics Display Problems

Families Citing this family (19)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103164839B (zh) * 2013-03-07 2019-06-21 华为技术有限公司 一种绘图方法、装置及终端
CN104331858B (zh) * 2014-11-24 2018-02-16 厦门美图之家科技有限公司 一种同时利用cpu和gpu进行图像处理的加速方法
US20160188279A1 (en) * 2014-12-27 2016-06-30 Intel Corporation Mode-switch protocol and mechanism for hybrid wireless display system with screencasting and native graphics throwing
CN105808342B (zh) * 2014-12-30 2019-12-13 中国电信股份有限公司 用于分配客户请求的方法、判断装置和系统
CN104809684B (zh) 2015-04-02 2018-03-27 华为技术有限公司 图形处理方法、装置及系统
CN105049609B (zh) * 2015-06-29 2019-05-03 惠州Tcl移动通信有限公司 一种优化游戏画面的方法及系统
CN105279253B (zh) * 2015-10-13 2018-12-14 上海联彤网络通讯技术有限公司 提升网页画布渲染速度的系统及方法
CN107153528A (zh) * 2016-03-02 2017-09-12 阿里巴巴集团控股有限公司 混合模型列表项重用的方法及设备
JP6658136B2 (ja) * 2016-03-14 2020-03-04 コニカミノルタ株式会社 描画処理装置、画像処理装置、描画処理方法及び描画処理プログラム
CN107203463B (zh) * 2016-03-16 2021-10-08 斑马智行网络(香港)有限公司 界面测试的方法、界面绘制方法及装置
CN106502667B (zh) * 2016-10-18 2019-09-03 广州视睿电子科技有限公司 一种渲染方法及装置
CN108269223B (zh) * 2017-01-04 2021-08-31 腾讯科技(深圳)有限公司 一种网页图形绘制方法及终端
WO2018143502A1 (ko) * 2017-02-06 2018-08-09 (주)볼트마이크로 데이터 포맷 변환 방법
CN108337465B (zh) * 2017-02-09 2021-05-14 腾讯科技(深圳)有限公司 视频处理方法和装置
CN108920412B (zh) * 2018-06-20 2020-12-29 中国科学院计算技术研究所 针对异构计算机体系结构的算法自动调优方法
US11474824B1 (en) 2020-05-08 2022-10-18 Corel Corporation Performance benchmarking-based selection of processor for generating graphic primitives
CN112346935A (zh) * 2020-11-12 2021-02-09 腾讯科技(北京)有限公司 渲染耗时的获取、显示方法、性能监控方法、装置及设备
KR20220129337A (ko) 2021-03-16 2022-09-23 주식회사 심률 아이드로우 서비스장치 및 그 장치의 구동방법
CN115297359A (zh) * 2022-07-29 2022-11-04 北京字跳网络技术有限公司 多媒体数据传输方法、装置、电子设备及存储介质

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101354780A (zh) * 2007-07-26 2009-01-28 Lg电子株式会社 图形数据处理设备和方法
CN101706741A (zh) * 2009-12-11 2010-05-12 中国人民解放军国防科学技术大学 一种基于负载平衡的cpu和gpu两级动态任务划分方法
US20120159090A1 (en) * 2010-12-16 2012-06-21 Microsoft Corporation Scalable multimedia computer system architecture with qos guarantees
CN102521050A (zh) * 2011-12-02 2012-06-27 曙光信息产业(北京)有限公司 一种面向cpu和gpu的混合调度方法
CN103164839A (zh) * 2013-03-07 2013-06-19 华为技术有限公司 一种绘图方法、装置及终端

Family Cites Families (22)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3639108B2 (ja) 1998-03-31 2005-04-20 株式会社ソニー・コンピュータエンタテインメント 描画装置および描画方法、並びに提供媒体
JP4071422B2 (ja) * 2000-06-28 2008-04-02 株式会社東芝 モーションブラー画像描画方法及び描画装置
CN1204494C (zh) * 2003-04-03 2005-06-01 浙江大学 计算机集群并行绘制系统中基于时空变换的负载平衡设计方法
US7671862B1 (en) * 2004-05-03 2010-03-02 Microsoft Corporation Systems and methods for providing an enhanced graphics pipeline
US7558428B2 (en) * 2004-09-13 2009-07-07 Microsoft Corporation Accelerated video encoding using a graphics processing unit
CN101091175B (zh) * 2004-09-16 2012-03-14 辉达公司 负载均衡
CN1298049C (zh) * 2005-03-08 2007-01-31 北京中星微电子有限公司 一种图形引擎芯片及其应用方法
JP2007105917A (ja) * 2005-10-11 2007-04-26 Canon Inc プリンタ装置
US8108844B2 (en) * 2006-06-20 2012-01-31 Google Inc. Systems and methods for dynamically choosing a processing element for a compute kernel
EP2128824A1 (en) 2007-02-28 2009-12-02 Panasonic Corporation Graphics plotting device and graphics plotting method
US8286196B2 (en) 2007-05-03 2012-10-09 Apple Inc. Parallel runtime execution on multiple processors
US7843462B2 (en) * 2007-09-07 2010-11-30 Seiko Epson Corporation System and method for displaying a digital video sequence modified to compensate for perceived blur
US8922565B2 (en) * 2007-11-30 2014-12-30 Qualcomm Incorporated System and method for using a secondary processor in a graphics system
US8130232B2 (en) * 2008-06-17 2012-03-06 Nuvoton Technology Corporation Drawing control method, drawing control apparatus, and drawing control system for embedded system
GB2462860B (en) 2008-08-22 2012-05-16 Advanced Risc Mach Ltd Apparatus and method for communicating between a central processing unit and a graphics processing unit
US8669990B2 (en) 2009-12-31 2014-03-11 Intel Corporation Sharing resources between a CPU and GPU
JP2012003619A (ja) 2010-06-18 2012-01-05 Sony Corp 情報処理装置、情報処理装置の制御方法、およびプログラム
US8681162B2 (en) 2010-10-15 2014-03-25 Via Technologies, Inc. Systems and methods for video processing
WO2012141677A1 (en) * 2011-04-11 2012-10-18 Hewlett-Packard Development Company, L.P. Performing a task in a system having different types of hardware resources
KR101845328B1 (ko) * 2011-08-22 2018-04-04 삼성전자 주식회사 단말 및 그 단말에서 어플리케이션 수행 방법
CN102810133B (zh) * 2012-05-15 2015-08-12 北京像素软件科技股份有限公司 网络游戏中的射线查询方法和场景服务器
CN102945560B (zh) * 2012-08-21 2015-05-06 浙江大学 一种并行的可编程运动特效绘制方法

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101354780A (zh) * 2007-07-26 2009-01-28 Lg电子株式会社 图形数据处理设备和方法
CN101706741A (zh) * 2009-12-11 2010-05-12 中国人民解放军国防科学技术大学 一种基于负载平衡的cpu和gpu两级动态任务划分方法
US20120159090A1 (en) * 2010-12-16 2012-06-21 Microsoft Corporation Scalable multimedia computer system architecture with qos guarantees
CN102521050A (zh) * 2011-12-02 2012-06-27 曙光信息产业(北京)有限公司 一种面向cpu和gpu的混合调度方法
CN103164839A (zh) * 2013-03-07 2013-06-19 华为技术有限公司 一种绘图方法、装置及终端

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150091922A1 (en) * 2013-10-01 2015-04-02 International Business Machines Corporation Diagnosing Graphics Display Problems
US9373153B2 (en) * 2013-10-01 2016-06-21 Globalfoundries Inc. Diagnosing graphics display problems

Also Published As

Publication number Publication date
JP5963940B2 (ja) 2016-08-03
EP2793185A1 (en) 2014-10-22
EP2793185B1 (en) 2018-04-11
EP2793185A4 (en) 2015-03-04
CN103164839B (zh) 2019-06-21
US9430810B2 (en) 2016-08-30
KR20140133807A (ko) 2014-11-20
JP2015520881A (ja) 2015-07-23
CN103164839A (zh) 2013-06-19
KR101623415B1 (ko) 2016-05-23
TW201435798A (zh) 2014-09-16
TWI604409B (zh) 2017-11-01
US20140327686A1 (en) 2014-11-06

Similar Documents

Publication Publication Date Title
TWI604409B (zh) 繪圖方法、裝置及終端機
US8842133B2 (en) Buffers for display acceleration
US8289333B2 (en) Multi-context graphics processing
JP7157177B2 (ja) ビデオ取得方法、装置、端末および媒体
WO2016124122A1 (zh) 一种手持式电子设备图片缩放及播放内容切换的方法及装置
CN116320394A (zh) 用于视频编码和解码的自适应传递函数
US9665247B2 (en) Method and device for applying a new skin to a display environment
US20220139017A1 (en) Layer composition method, electronic device, and storage medium
JP2014533382A (ja) グラフィックス処理ユニットにおけるレンダリングモード選択
WO2018000372A1 (zh) 画面显示的方法和终端
WO2021008427A1 (zh) 图像合成方法、装置、电子设备及存储介质
WO2017202175A1 (zh) 一种视频压缩方法、装置及电子设备
AU2014201249B2 (en) Method for controlling display function and an electronic device thereof
WO2018176734A1 (zh) 一种数据处理方法及终端
JP2021506196A (ja) ビデオ処理方法、装置、端末および媒体
CN108693948B (zh) 帧率调整方法、装置、终端设备及存储介质
WO2023083064A1 (zh) 视频处理方法、装置、电子设备及可读存储介质
CN108712556B (zh) 帧率调整方法、装置、终端设备及存储介质
CN110659024A (zh) 图形资源转换方法、装置、电子设备及存储介质
WO2018201993A1 (zh) 图像绘制方法、终端及存储介质
EP2530640A1 (en) Image copying method and device
WO2022161199A1 (zh) 图像编辑方法及设备
WO2020238276A1 (zh) 一种视图控件的滑动控制方法、装置、设备和存储介质
WO2023274125A1 (zh) 一种指令处理方法及其相关设备

Legal Events

Date Code Title Description
ENP Entry into the national phase

Ref document number: 20147012010

Country of ref document: KR

Kind code of ref document: A

ENP Entry into the national phase

Ref document number: 2015503752

Country of ref document: JP

Kind code of ref document: A

NENP Non-entry into the national phase

Ref country code: DE