Display method and related equipment
By directly converting the data to be rendered into texture data in the graphics processor GPU and rendering it into the video memory of the display window, the low display frame rate problem caused by multiple memory copies in the prior art is solved, and a smoother picture display is achieved.
Patent Information
- Application Number
- CN202411522514.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-28
- Publication Date
- 2025-03-28
AI Technical Summary
The prior art requires multiple memory copies in user terminal devices, resulting in low display frame rate, and may cause problems such as unsmooth or lag.
By obtaining the data to be rendered in the graphics processor GPU and converting it into texture data, it is directly rendered into the video memory of the target display window, avoiding the process of copying the data to be rendered to the off-screen buffer of the CPU and copying from the CPU to the GPU.
It effectively avoids time consumption caused by data copying, improves the display frame rate, and avoids the situation of unsmooth or lag in the picture.
Smart Images

Figure CN119718238A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of computer technology, and in particular, to a display method and related equipment. Background Art
[0002] With the development of Internet technology, more and more large websites and applications are emerging. When users log in to cloud applications through terminal devices, the image data or video data of the server application is encoded and sent to the user's terminal device through the network. The terminal device decodes and renders the encoded video data or image data to be rendered, and finally displays it on the display device.
[0003] Since the encoded data to be rendered currently sent by the server cannot be accurately displayed in a specific display window, during the decoding and rendering process of the user's terminal device through the graphics processing unit (GPU), it is usually necessary to create an off-screen buffer located in the CPU memory of the user's terminal device's central processing unit (CPU) to store the GPU-decoded data to be rendered.
[0004] However, in the above method, the user's terminal device needs to copy the data to be rendered after being decoded by the GPU to the off-screen buffer in the CPU. During the GPU rendering process, the decoded data to be rendered in the off-screen buffer in the CPU is obtained again through memory copying, and the data to be displayed is obtained after rendering. These copy operations will take a lot of time, resulting in a low display frame rate. Summary of the invention
[0005] The embodiments of the present application provide a display method and related devices, which can avoid multiple memory copies and improve the display frame rate.
[0006] In a first aspect, a display method is provided, which is applied to a graphics processor (GPU) in an electronic device, and includes: obtaining data to be rendered; obtaining texture data corresponding to the data to be rendered; and rendering the texture data to a video memory corresponding to a target display window.
[0007] As can be seen from the above, in the above method, the GPU can directly convert the acquired data to be rendered into texture data, and directly render the texture data corresponding to the data to be rendered into the video memory corresponding to the target display window for display. There is no need to reversely copy the data to be rendered to the CPU's off-screen buffer, and it also avoids the GPU obtaining the data to be rendered from the CPU's off-screen buffer during the rendering process, which can effectively avoid the time consumption caused by data copying, thereby avoiding the occurrence of unsmooth images or even freezes, and can effectively improve the display frame rate.
[0008] In a possible implementation, the texture data includes first texture data and second texture data; the first texture data indicates that the data to be rendered is texture data corresponding to image data; the second texture data indicates that the data to be rendered is texture data corresponding to video data.
[0009] From the above, it can be seen that according to the data type of the data to be rendered, the GPU converts the data to be rendered into different types of texture data, namely first texture data and second texture data, which can improve the efficiency of rendering the texture data to the video memory corresponding to the target display window, thereby improving the display frame rate.
[0010] In one possible implementation, texture data corresponding to the pixel is determined based on a mapping relationship between texture coordinates of the pixel in the target display window and texture coordinates of the texture data; and the texture data corresponding to the pixel is rendered to a video memory corresponding to the target display window.
[0011] From the above, it can be seen that by determining the texture data corresponding to the pixel point based on the mapping relationship between the texture coordinates of the pixel point in the target display window and the texture coordinates of the texture data, the texture data can be accurately mapped to the corresponding display window, avoiding the creation of an off-screen buffer in the CPU, thereby reducing the time consumption caused by data copying and effectively improving the display frame rate.
[0012] In one possible implementation, when the target window includes an image display window and a video display window, and the data to be rendered includes image data and video data; the texture data corresponding to the pixel point is determined based on a mapping relationship between the coordinates of the pixel point in the target display window and the texture coordinates of the texture data, including: judging whether the pixel point belongs to the video display window based on the texture coordinates of the pixel point in the target display window, the coordinates of the video display window, and the coordinates of the video display area in the video data.
[0013] From the above, it can be seen that before determining the texture data corresponding to the pixel point based on the mapping relationship between the coordinates of the pixel point in the target display window and the texture coordinates of the texture data, the display window where the pixel point is located is first determined based on the texture coordinates of the pixel point, so that the type of texture data corresponding to the pixel point can be determined, which can improve the rendering accuracy and thus improve the display frame rate.
[0014] In a possible implementation, if it is determined that the pixel point belongs to the video display window, the texture data corresponding to the pixel point is determined according to a mapping relationship between the texture coordinates of the pixel point in the target display window and the texture coordinates of the second texture data.
[0015] If it is determined that the pixel point does not belong to the video display window, the texture data corresponding to the pixel point is determined according to a mapping relationship between the coordinates of the pixel point in the target display window and the texture coordinates of the first texture data.
[0016] As can be seen from the above, during the rendering process, texture data is obtained from the corresponding texture type data according to the display window where the pixel is to be located, thereby determining the texture data corresponding to the pixel point, which can improve the rendering accuracy and thus improve the display frame rate.
[0017] In a possible implementation, obtaining texture data corresponding to the data to be rendered includes: calling a texture function to obtain the texture data corresponding to the data to be rendered; the texture function represents a function for rendering graphic data in OpenGL.
[0018] As can be seen from the above, by calling the texture function and obtaining the texture data corresponding to the data to be rendered, the data to be rendered can be converted into texture data, so that the data to be rendered can be directly sent to the display to obtain the data to be displayed. Therefore, multiple copies of the data to be rendered between the CPU and the GPU are avoided, and the unsmoothness or even freeze of the picture due to time consumption is effectively avoided, which can effectively improve the display frame rate.
[0019] In a possible implementation manner, when the data to be rendered includes encoded data to be rendered, obtaining the data to be rendered includes: receiving the data to be decoded copied by a central processing unit CPU.
[0020] In a second aspect, a display device is provided. An embodiment of the present application may divide the functional modules of the display device according to the method provided in the first aspect above. For example, each functional module may be divided corresponding to each function, or two or more functions may be inherited in one processing module. Exemplarily, an embodiment of the present application may divide the display device into an acquisition module, a processing module, and a rendering module according to the function. The description of the possible technical solutions and beneficial effects executed by each of the functional modules divided above can refer to the technical solutions provided by the first aspect above or its corresponding possible implementation method, which will not be repeated here.
[0021] In a third aspect, an embodiment of the present application provides an electronic device, which includes a processor and a memory for storing processor executable instructions; the processor includes the graphics processor GPU; the processor is configured to execute instructions so that the electronic device performs the above-mentioned display method.
[0022] In a fourth aspect, an embodiment of the present application provides a computer program product or a computer program, the computer program product or the computer program including computer instructions, the computer instructions being stored in a computer-readable storage medium. A processor of a computing node reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computing node executes the display method provided in various optional implementations of the above aspects.
[0023] In a fifth aspect, an embodiment of the present application provides a computer-readable storage medium, in which at least one computer program is stored, and the computer program is loaded and executed by a processor to implement the display method as described above.
[0024] For the specific description of the second to fifth aspects and their various implementations in the embodiments of the present application, reference can be made to the detailed description in the first aspect and its various implementations; and for the beneficial effects of the second to fifth aspects and their various implementations, reference can be made to the analysis of the beneficial effects in the various implementations of the first aspect, which will not be repeated here.
[0025] These and other aspects of the embodiments of the present application will be more clearly understood in the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] Figure 1 A schematic diagram of a scenario for accessing a cloud application provided by related technologies is shown;
[0027] Figure 2 A schematic diagram of a display architecture 001 provided by the related art is shown;
[0028] Figure 3 A schematic diagram of the structure of an electronic device 200 provided in an embodiment of the present application is shown;
[0029] Figure 4 A schematic diagram of a flow chart of a display method provided in an embodiment of the present application is shown;
[0030] Figure 5 A schematic diagram of a target display window provided in an embodiment of the present application is shown;
[0031] Figure 6 A schematic diagram of another target display window provided in an embodiment of the present application is shown;
[0032] Figure 7 A schematic diagram of a shader algorithm model provided in an embodiment of the present application is shown;
[0033] Figure 8 A schematic diagram of a display architecture 002 provided in an embodiment of the present application is shown;
[0034] Fig. 9 A schematic diagram showing the structure of a display device 800 provided in an embodiment of the present application is shown. DETAILED DESCRIPTION
[0035] The technical solutions in the embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application. Among them, in the description of the present application, unless otherwise specified, " / " indicates that the objects associated before and after are in an "or" relationship, for example, A / B can represent A or B; "and / or" in the present application is only a kind of association relationship describing the associated objects, indicating that there can be three relationships, for example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural. And, in the description of the present application, unless otherwise specified, "multiple" refers to two or more than two. "At least one of the following" or its similar expressions refers to any combination of these items, including any combination of single items or plural items. For example, at least one of a, b, or c can represent: a, b, c, ab, ac, bc, or abc, where a, b, c can be single or multiple. In addition, in order to clearly describe the technical solutions of the embodiments of the present application, in the embodiments of the present application, words such as "first" and "second" are used to distinguish the same or similar items with basically the same functions and effects.
[0036] Those skilled in the art will appreciate that words such as "first" and "second" do not limit the quantity and execution order, and words such as "first" and "second" do not necessarily limit the difference. At the same time, in some embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a concrete way for easy understanding.
[0037] In addition, the device architecture and business scenarios described in the embodiments of the present application are intended to more clearly illustrate the technical solutions of the embodiments of the present application, and do not constitute a limitation on the technical solutions provided in the embodiments of the present application. A person of ordinary skill in the art can appreciate that with the evolution of the device architecture and the emergence of new business scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.
[0038] First, the application scenarios of the embodiments of the present application are exemplarily introduced.
[0039] Figure 1 FIG. 1 shows a schematic diagram of a scenario for accessing a cloud application provided by a related technology. Figure 1As shown, the server 100 is connected to the electronic device 200 via a network. A cloud application is running in the server 100, and the user logs in and accesses the cloud application through the electronic device 200, and obtains data services provided by the cloud application through the network.
[0040] The server 100 may be a standard general-purpose server, and specifically may be a blade server, a high-density server, a rack server, or a high-performance server.
[0041] The electronic device 200 may include a mobile phone, a smart watch, a tablet computer, a foldable electronic device, a desktop computer, a laptop computer, a handheld computer, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook, a cellular phone, a personal digital assistant (PDA), an augmented reality (AR) device, a virtual reality (VR) device, an artificial intelligence (AI) device, a wearable device, an in-vehicle device, and other electronic devices with communication capabilities. The embodiment of the present application does not impose any special restrictions on the specific type of the electronic device 200.
[0042] Exemplarily, the electronic device 200 can obtain the encoded data to be rendered from the server 100 through the network, and the data to be rendered includes video data or image data. The electronic device 200 decodes and renders the encoded data to be rendered, converts the data to be rendered into data to be displayed, and displays it.
[0043] When a user logs in to a cloud application through an electronic device 200, the server 100 encodes the data to be rendered and sends it to the electronic device 200. In the process where the electronic device 200 processes the data to be rendered through a graphics processing unit (GPU) to obtain data to be displayed, and sends the data to be displayed to a display driver chip, the central processing unit (CPU) of the electronic device is usually required to create an off-screen buffer in the CPU memory for storing the data to be rendered after being decoded by the GPU.
[0044] Figure 2 A schematic diagram of a display architecture 001 provided by the related art is shown, and the display architecture 001 is applied to Figure 1 The electronic device 200 in FIG. Figure 2As shown, the display architecture 001 includes a GPU 110 and a CPU 120. The GPU 110 is used to decode the encoded data to be rendered and send the data to be displayed to the video memory 160. The CPU 120 is used to receive the encoded data to be rendered through the network. The data to be rendered includes video data and image data.
[0045] First, the CPU 120 receives the encoded video data and image data through the network, and copies the encoded video data to the GPU 110 by means of memory copy. Secondly, the GPU 110 decodes the encoded video data through the decoder 130, and copies the decoded video data to the video buffer 150 in the CPU 120, so that the off-screen buffer 140 in the CPU 120 obtains the decoded video data. The CPU 120 decodes the encoded image data through decoding software, and writes the decoded image data into the off-screen buffer 140. For example, the CPU 120 can perform soft decoding on the encoded image data through a palette decoder Palette Decoder or a JPEG decoder to obtain decoded image data.
[0046] Finally, the GPU 110 obtains the decoded video data and image data from the off-screen buffer 140 in the CPU 120 by means of memory copy, and renders the decoded video data and image data to obtain the video data and image data to be displayed, and writes the video data and image data to be displayed into the video memory 160. Thus, the display driver chip can obtain the video data and image data to be displayed in the video memory 160, and finally display the video data and image data in the corresponding video display window and image display window in the display screen.
[0047] However, in the above method, when the GPU 110 renders the data to be rendered to the video memory 160, the GPU 110 needs to copy and obtain the data to be rendered from the off-screen buffer 140 of the CPU 120. At the same time, if the GPU 110 hardware decoding is used for the encoded data to be rendered, before the GPU 110 renders, the decoded data to be rendered by the GPU 110 needs to be reversely copied to the off-screen buffer 140 of the CPU 120. At the same time, during the rendering process of the GPU 110, the GPU 110 needs to copy and obtain the data to be rendered from the off-screen buffer 140 of the CPU 120. These two data copying processes will consume a lot of time, resulting in the inability to process more data to be rendered in a short time, and it is easy to cause the picture to be not smooth or even stuck, thereby resulting in a low display frame rate.
[0048] In view of this, an embodiment of the present application provides a display method, which is applied to a graphics processor GPU in an electronic device, and the method includes the GPU obtaining data to be rendered, and obtaining texture data corresponding to the data to be rendered according to the data to be rendered. The GPU renders the texture data to a target display window according to the texture data corresponding to the data to be rendered obtained.
[0049] In some embodiments, the GPU obtains data to be rendered. The data to be rendered includes encoded data to be rendered or decoded data to be rendered. If GPU hardware decoding is used, the GPU obtains the encoded data to be rendered from the CPU, and decodes it through a decoder to obtain the data to be rendered. If CPU soft decoding is used, the CPU decodes the encoded data to be rendered through decoding software; the GPU obtains the decoded data to be rendered from the CPU. The CPU obtains the encoded data with rendering through the network. The GPU can obtain the decoded data to be rendered from the CPU. Based on the acquired data to be rendered, the GPU calls the program interface to obtain the texture data corresponding to the data to be rendered. The texture data is a kind of graphic data that describes the appearance characteristics. Based on the texture data corresponding to the data to be rendered, the GPU renders the texture data to the video memory corresponding to the target display window to obtain the data to be displayed, and finally displays the data to be displayed in the display window on the display screen.
[0050] In the above method, the GPU can obtain the texture data corresponding to the data to be rendered based on the acquired data to be rendered; and render the texture data to the video memory corresponding to the target display window. That is to say, the GPU converts the acquired data to be rendered into texture data, determines the data to be displayed based on the texture data, and stores the data to be displayed in the video memory corresponding to the target display window. Therefore, it can be understood that in the rendering stage, if the GPU hardware decoding method is adopted, the GPU decodes the acquired encoded data to be rendered, and directly converts the decoded data to be rendered into texture data, without copying the decoded data to be rendered to the CPU. The reverse copying of data is avoided. In the GPU rendering stage, the GPU directly renders the texture data to the video memory corresponding to the target display window. There is no need for the GPU to obtain the decoded data to be rendered from the CPU and render it. It can be seen that the method provided by the present application can avoid multiple memory copies, avoid the GPU rendering process will consume more time, the emergence of unsmooth pictures, thereby improving the display frame rate.
[0051] Secondly, the system architecture of the embodiment of the present application is exemplarily introduced.
[0052] The display method provided in the embodiment of the present application can be applied to the electronic device 200. For example, Figure 3A schematic diagram of the structure of an electronic device 200 provided in an embodiment of the present application is shown. Figure 3 As shown, the electronic device 200 includes a processor 210 , a memory 220 , a multimedia component 230 and a display driver chip 240 .
[0053] Among them, the processor 210 is the control center of the electronic device 200, which uses different interfaces and lines to connect various parts of the entire device, and realizes various functions of the electronic device 200 by running or executing applications stored in the memory 220, and calling various data in the memory 220. The processor 210 generally includes one or more processing units. In an embodiment of the present application, the processor 210 may include a graphics processor GPU 110 and a central processing unit CPU 120. Among them, the GPU 110 is used to obtain data to be rendered, and obtains texture data corresponding to the data to be rendered according to the data to be rendered. The GPU 110 renders the texture data to the video memory corresponding to the target display window.
[0054] Optionally, the processor 210 may also include an application processor (AP), a modem processor, an image signal processor (ISP), a controller, a video playback codec, a digital signal processor (DSP), a baseband processor and / or a neural-network processing unit (NPU), etc.
[0055] The memory 220 includes an internal memory and an external memory. The internal memory may be a memory and is integrated with the processor 210. The memory 220 is used to store data, software programs, and various software modules, and mainly includes a program storage area and a data storage area. Among them, the program storage area can store an operating system and at least one application required to implement a functional module; the data storage area can store various data created according to the use status of the electronic device 200, such as audio data, display data, or table data. The memory 220 may also include a high-speed random access memory or a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.
[0056] The multimedia component 230 includes a display screen and audio and video. The display screen may be a touch panel, and the touch panel includes one or more touch sensors for receiving a user input signal, and the input signal may be a trigger operation such as sliding, touching or clicking on the display screen by the user. The display screen is also used to receive and display data to be displayed. In addition, when the electronic device is in a video playback mode, the audio and video may support the electronic device to play a video.
[0057] The display driver chip 240 is mainly used to convert the data to be displayed into electrical signals to ensure that the image indicated by the data to be displayed can be clearly and accurately presented on the display screen. Specifically, it can be a display driver chip (display driver IC, DDIC), an integrated circuit chip specially used to control and drive the display panel.
[0058] The power supply 250 is used to provide power to various components of the electronic device. The power supply 250 may include a power management system, one or more power supplies, or other components associated with generating, managing, and distributing power in the electronic device.
[0059] It should be noted that the system architecture and application scenarios described in the embodiments of the present application are intended to more clearly illustrate the technical solutions of the embodiments of the present application, and do not constitute a limitation on the technical solutions provided in the embodiments of the present application. Ordinary technicians in this field can know that with the evolution of the system architecture and the emergence of new business scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.
[0060] For ease of understanding, the display method provided by the present application is exemplarily introduced below in conjunction with the accompanying drawings. The display method is applicable to Figure 3 Electronic equipment shown.
[0061] Figure 4 FIG. 1 is a flow chart of a display method provided by an embodiment of the present application. Figure 4 As shown, the display method is applied to a graphics processor GPU, and includes the following steps:
[0062] S101, a graphics processor GPU obtains data to be rendered.
[0063] The data to be rendered includes video data or image data.
[0064] In a possible implementation, when the data to be rendered is encoded data to be rendered, the GPU receives the data to be rendered copied by the central processing unit CPU.
[0065] For example, the electronic device sends an access request to the server, the server responds to the access request of the electronic device and determines the data to be rendered of the electronic device, encodes the data to be rendered, and sends the encoded data to the electronic device through the network. The electronic device receives the encoded data to be displayed through the CPU, copies the encoded data to be rendered to the GPU, so that the GPU obtains the encoded data to be rendered. Among them, the access request represents a request instruction for the electronic device to obtain the data to be rendered.
[0066] In another possible implementation, the data to be rendered obtained by the GPU is decoded data to be rendered, wherein the decoded data to be rendered is decoded by the CPU.
[0067] For example, the electronic device server responds to the access request of the electronic device and determines the data to be rendered of the electronic device, encodes the data to be rendered, and sends the encoded data to the electronic device through the network. The electronic device receives the encoded data to be displayed through the CPU, and the CPU decodes the encoded data to be displayed through software decoding. Among them, the CPU soft decoding method or the decoding software used is related to the received encoded data to be rendered. For example, the CPU can soft-decode the encoded data to be rendered through a palette decoder Palette Decoder or a JPEG decoder. After the CPU obtains the decoded data to be rendered, the GPU obtains the data to be rendered after the CPU decoding process through memory copy.
[0068] S102, a graphics processor GPU obtains texture data corresponding to the data to be rendered.
[0069] The texture data includes first texture data and second texture data; the first texture data indicates that the data to be rendered is texture data corresponding to the image data; the second texture data indicates that the data to be rendered is texture data corresponding to the video data.
[0070] In one possible implementation, the GPU calls a texture function to obtain texture data corresponding to the data to be rendered.
[0071] The texture function refers to a function for rendering graphics data in OpenGL.
[0072] Exemplarily, when the data to be rendered is encoded data to be rendered, the GPU decodes the acquired encoded data to be rendered. According to the decoded data to be rendered, the GPU can call a graphics API to convert the acquired data to be rendered into texture data.
[0073] For example, if the data to be rendered is image data, the GPU creates a first texture object in the video memory. Among them, the texture object is a data structure used to store image data in the GPU. For example, the GPU calls the API interface of OpenGL, and uses the glGenTextures function in the OpenGL environment to generate the first texture object. In this process, it also includes configuring the properties of the texture, including pixel format, texture type (including two-dimensional texture or three-dimensional texture), etc. For example, the pixel format of the texture data is set to the same as the pixel format of the image data (RGBA format). Set the texture type of the texture data to a two-dimensional texture. The GPU calls the API interface of OpenGL, and uses the GL-TEXTURE-2D function in the OpenGL environment to load the decoded image data into the first texture object. After the image data is loaded, the first texture object contains the image data, forming the first texture data.
[0074] If the data to be rendered is video data, the GPU calls the OpenGL API interface, uses the glGenTextures function to create a second texture object in the video memory, and sets the texture type of the texture data to a three-dimensional texture. The GPU calls the OpenGL API interface and uses the GL-TEXTURE-EXTERNAL-OES function to load the decoded video data into the second texture object. After the video data is loaded, the second texture object contains the corresponding image data in the video data, forming the second texture data.
[0075] Optionally, if the data to be rendered includes image data and video data, the GPU obtains the decoded image data from the CPU by means of memory copy. The decoded image data is obtained by the CPU decoding the encoded image data by means of soft decoding. The GPU calls the API interface of OpenGL based on the decoded image data to convert the acquired image data into first texture data. The GPU decodes the acquired encoded video data. Based on the decoded video data, the GPU can call the API interface of OpenGL to convert the acquired video data into second texture data.
[0076] As can be seen from the above, due to the reusability of texture data and the one-to-one mapping relationship between the texture data and the data to be rendered, the GPU converts the data to be rendered into the first texture data or the second texture data according to the data type, so that the GPU can further operate on the texture data and improve the rendering performance of the GPU.
[0077] S103, the graphics processor GPU renders the texture data to the video memory corresponding to the target display window.
[0078] In one possible implementation, the GPU determines the texture data corresponding to the pixel based on the mapping relationship between the texture coordinates of the pixel in the target display window and the texture coordinates of the texture data; and renders the texture data corresponding to the pixel to the video memory corresponding to the target display window.
[0079] That is, when the GPU renders the texture data to the video memory corresponding to the target display window, the GPU determines the texture data corresponding to the pixel point according to the mapping relationship between the texture coordinates of the pixel point in the target display window and the texture coordinates in the texture data. Specifically, the pixel coordinates of the pixel point in the target display window are converted into texture coordinates, and the texture data is addressed according to the texture coordinates to determine the texture data corresponding to the pixel point.
[0080] Exemplarily, if the target pixel is the pixel currently being rendered by the GPU; first, the GPU obtains the texture coordinates of the target pixel. The texture coordinates can be obtained by converting the pixel coordinates of the target pixel through a formula. Secondly, the GPU samples from the texture data based on the mapping relationship between the texture coordinates of the target pixel and the texture coordinates in the target display window and the texture coordinates of the texture data, and obtains the texture data corresponding to the target pixel in the texture data, thereby determining the texture data of the target pixel. Specifically, it can be the RGB value of the pixel. Finally, the GPU renders the texture data corresponding to the target pixel to the video memory corresponding to the target display window.
[0081] For example, if the target display window is a video display window and the video display area is larger than the video display window, the texture coordinates of the pixels in the target display window need to be converted into texture coordinates corresponding to the origin at the upper left corner of the video display area.
[0082] Figure 5 FIG. 1 is a schematic diagram of a target display window provided by an embodiment of the present application. Figure 5 As shown, the display screen 300 includes a target display window 320 .
[0083] Among them, the coordinates of the display screen 300 are (0, 0, Ws, Hs); the coordinates of the target display window 310 based on the upper left corner of the display screen 300 as the origin are (Xw, Yw, Ww, Hw); the coordinates of the video display area 310 based on the upper left corner of the display screen 300 as the origin are (Xv, Yv, Wv, Hv). Specifically, for any pixel point located in the target display window 320, the texture coordinates are (X, Y), according to the following basic formula of texture coordinates:
[0084] U=px / ingX
[0085] V=py / ingY
[0086] Where imgX represents the width of the image, and imgY represents the height of the image. The pixel coordinates of any pixel in the image are (px, py). Then, the texture coordinates corresponding to the pixel are (U, V).
[0087] It can be obtained that the pixel coordinates of the pixel point based on the upper left corner of the display screen 300 as the origin are (X*Ww+Xw, Y*Hw+Yw); again according to the basic formula for converting pixel coordinates into texture data, it can be obtained that the texture coordinates corresponding to the pixel point on the display screen 300 are [(X*Ww+Xw) / Ws, (Y*Hw+Yw) / Hs]. At the same time, the pixel coordinates of the pixel point with texture coordinates (X, Y) based on the upper left corner of the video display area 310 as the origin are (X*Ww+Xw-Xv, Y*Hw+Yw-Yv); at this time, the texture coordinates corresponding to the pixel point in the video display area 310 are [(X*Ww+Xw-Xv) / Wv, (Y*Hw+Yw-Yv) / Hv]. The GPU addresses the texture data according to the texture coordinates [(X*Ww+Xw-Xv) / Wv, (Y*Hw+Yw-Yv) / Hv], determines the texture data corresponding to the pixel point with texture coordinates (X, Y), and renders the texture data corresponding to the pixel point to the video memory corresponding to the target display window 320.
[0088] It should be noted that if the target display window is an image display window and the image display area is larger than the video display window, the texture coordinates of the pixel points in the target display window need to be converted into coordinates based on the upper left corner of the image display area as the origin. The method is the same as the above method and will not be repeated here.
[0089] In a possible implementation, when the target window includes an image display window and a video display window, and the data to be rendered includes image data and video data, if it is determined that the pixel point belongs to the video display window, the GPU determines the texture data corresponding to the pixel point based on the mapping relationship between the coordinates of the pixel point in the target display window and the texture coordinates of the second texture data. If it is determined that the pixel point does not belong to the video display window, the GPU determines the texture data corresponding to the pixel point based on the mapping relationship between the texture coordinates of the pixel point in the target display window and the texture coordinates of the first texture data.
[0090] That is to say, when the target window includes an image display window and a video display window, and the data to be rendered includes image data and video data, the GPU obtains the decoded image data from the CPU by means of memory copy. The GPU calls the API interface of OpenGL according to the decoded image data to convert the obtained image data into the first texture data. The GPU decodes the obtained encoded video data. According to the decoded video data, the GPU can call the API interface of OpenGL to convert the obtained video data into the second texture data. Among them, the decoded image data is obtained by the CPU decoding the encoded image data by means of soft decoding.
[0091] Therefore, if the GPU determines that the pixel point in the target display window belongs to the video display window, the GPU addresses the second texture data according to the texture coordinates of the pixel point and the mapping relationship between the texture coordinates of the pixel point in the target display window and the texture coordinates of the second texture data, and determines the texture data corresponding to the pixel point. If the GPU determines that the pixel point in the target display window does not belong to the video display window, the GPU addresses the first texture data according to the texture coordinates of the pixel point and the mapping relationship between the texture coordinates of the pixel point in the target display window and the texture coordinates of the first texture data, and determines the texture data corresponding to the pixel point.
[0092] In another possible implementation, when the target window includes an image display window and a video display window, and the data to be rendered includes image data and video data; the texture data corresponding to the pixel point is determined based on a mapping relationship between the coordinates of the pixel point in the target display window and the texture coordinates of the texture data, including: judging whether the pixel point belongs to the video display window based on the texture coordinates of the pixel point in the target display window, the coordinates of the video display window, and the coordinates of the video display area in the video data.
[0093] Exemplarily, if the target display window includes a video display window and an image display window, and the data to be rendered includes video data and image data, before determining the texture data corresponding to the pixel in the target display window, it is necessary to determine whether the pixel in the target display window belongs to the video display window.
[0094] for example, Figure 6 FIG. 2 shows a schematic diagram of another target display window provided by an embodiment of the present application. Figure 6 As shown, the display screen 300 includes a target display window 320. The target display window 320 is a display window in a non-full screen video mode, including a video display window 320-1 and an image display window 320-2.
[0095] Among them, the coordinates of the display screen 300 are (0, 0, Ws, Hs); the coordinates of the video display window 320-1 based on the upper left corner of the display screen 300 as the origin are (Xw, Yw, Ww, Hw); the coordinates of the video display area 310 based on the upper left corner of the display screen as the origin are (Xv, Yv, Wv, Hv).
[0096] According to the coordinates of the display screen 300 being (0, 0, Ws, Hs), the coordinates of the video display window 320-1 based on the upper left corner of the display screen 300 being (Xw, Yw, Ww, Hw), and the coordinates of the video display area 310 based on the upper left corner of the display screen 300 being (Xv, Yv, Wv, Hv), it is possible to determine the coordinates (W1, W2, H1, H2) of the video display window 320-1 based on the upper left corner of the video display area 310 being the origin. Specifically, for any pixel point with texture coordinates (X, Y) in the target display window 320, according to the basic formula for converting pixel coordinates into texture coordinates, the pixel coordinates of the pixel point based on the upper left corner of the display screen 300 being the origin are (X*Ww+Xw, Y*Hw+Yw). According to the basic formula for converting coordinate points into texture coordinates, the texture coordinates corresponding to the pixel point with texture coordinates (X, Y) in the display screen 300 are [(X*Ww+Xw) / Ws, (Y*Hw+Yw) / Hs]. At the same time, the pixel point with texture coordinates (X, Y) based on the upper left corner of the video display area 310 as the origin is (X*Ww+Xw-Xv, Y*Hw+Yw-Yv); at this time, the texture coordinates of the pixel point in the video display area 310 are [(X*Ww+Xw-Xv) / Wv, (Y*Hw+Yw-Yv) / Hv]. Since the effective address range of texture coordinates is usually between [0, 1], according to the texture coordinates (X, Y) of the pixel point in the target display window 320, and the texture coordinates of the pixel point with texture coordinates (X, Y) in the video display area 310, the following four inequalities can be obtained:
[0097] 0<=X<=1; Inequality 1
[0098] 0<=(X*Ww+Xw-Xv)<=1; Inequality 2
[0099] 0<=Y<=1; Inequality 3
[0100] 0<=(Y*Hw+Yw-Yv) / Hv<=1; Inequality 4
[0101] By combining the above inequalities 1 and 2, and inequalities 3 and 4, we can get the following inequality relations:
[0102] (Xv-Xw) / Ww<=X<=(Xv+Wv-Xw) / Ww; inequality relationship 1
[0103] (Yv-Yw) / Hw<=Y<=(Yv+Hv-Yw) / Hw; inequality relationship 2
[0104] Since the pixel point with coordinates (X, Y) is any pixel point in the target display window 320, it can be determined that the video display window 320-1 is based on the coordinates (W1, W2, H1, H2) with the upper left corner of the video display area 310 as the origin, W1 = (Xv-Xw) / Ww; W2 = (Xv+Wv-Xw) / Ww; H1 = (Yv-Yw) / Hw; H2 = (Yv+Hv-Yw) / Hw.
[0105] Therefore, it can be determined that the pixel points corresponding to the coordinates satisfying the inequality relationship 1 and the inequality relationship 2 in the target display window 320 are the pixel points located in the video display window 320-1. The above method for determining whether the pixel point in the target display window belongs to the video display window 320-1 can be implemented by the following shader algorithm:
[0106] if(codrd.x>=W1&&coord.x<w2&&coord.y> =h1&&coord.y <h2)
[0107] val.rgba=texture2D(texOES,coord*Vec2(Ww / Wv,Hw / Hv)+Vec2((Xw-Xv) / Wv,(Yw-Yv) / Hv)).rgba
[0108] else
[0109] val.rgba=texture2D(tex2D,coord*Vec2(Ww / Ws,Hw / Hs)+Vec2(Xw / Ws,Yw / Hs)).rgba
[0110] Among them, tex2D is the first texture data; texOES is the second texture data.
[0111] According to the above method, by judging the relationship between the texture coordinates of the pixel points of the target display window 320 and the coordinates of the video display window 320-1 based on the upper left corner of the display screen 300 as the origin, it is possible to determine whether the pixel points in the target display window 320 belong to the video display window 320-1. Taking the coordinates of the pixel points in the target display window 320 as (X, Y) as an example, if X is greater than or equal to W1 and less than W2; at the same time, Y is greater than or equal to H1 and less than H2, it can be determined that the pixel point with the coordinates (X, Y) is located in the video display area.
[0112] Figure 7 A schematic diagram of a shader algorithm model provided in an embodiment of the present application is shown. Figure 7 As shown, the target display window 320 includes a video display window 320-1 and an image display window 320-2. The GPU calls the API interface of OpenGL according to the decoded image data, converts the acquired image data into the first texture data, and stores it in the first texture object. The decoded image data is obtained by the CPU decoding the encoded image data by soft decoding. The GPU performs GPU hard decoding on the encoded video data, and calls the API interface of OpenGL according to the decoded video data, converts the acquired video data into the second texture data, and stores it in the second texture object.
[0113] For pixel 01 in target display window 320, GPU can determine that pixel 01 is located in image display window 320-2 according to the texture coordinates of pixel 01, the coordinates of video display window 320-1, and the coordinates of video display area 310, and according to the above algorithm. Therefore, during the rendering process, GPU samples in the first texture object according to the texture coordinates of pixel 01 to determine the first texture data corresponding to the texture coordinates of pixel 01.
[0114] For pixel 02 in target display window 320, GPU can determine that pixel 02 is located in video display window 320-1 according to the texture coordinates of pixel 02, the coordinates of video display window 320-1, and the coordinates of video display area 310, and according to the above algorithm. Therefore, during the rendering process, GPU samples in the second texture object according to the texture coordinates of pixel 02 to determine the second texture data corresponding to the texture coordinates of pixel 02.
[0115] Optionally, the GPU sends the texture data in the video memory to the display driver chip; the display driver chip is connected to the display screen; the display driver chip sends the texture data to be displayed to the display screen, the display screen receives the texture data to be displayed and displays the texture data to be displayed, completing the display of the data to be rendered.
[0116] Figure 8 A schematic diagram of a display architecture 002 provided in an embodiment of the present application is shown. The display architecture 002 is applied to Figure 3 Electronic equipment in. Figure 8 As shown, the display architecture 001 includes a GPU 110 and a CPU 120. The GPU 110 is used to decode the encoded data to be rendered and send the data to be displayed to the video memory 160. The CPU 120 is used to receive the encoded data to be rendered through the network. The data to be rendered includes video data and image data.
[0117] First, the CPU 120 receives the encoded video data and image data through the network, and copies the encoded video data to the GPU 110 by means of memory copy. Secondly, the GPU 110 decodes the encoded video data through the decoder 130, and converts the decoded video data into the second texture data by calling the API interface of OpenGL. The CPU 120 decodes the encoded image data through decoding software. For example, the CPU 120 can soft-decode the encoded image data through the palette decoder Palette Decoder or the JPEG decoder to obtain the decoded image data. The CPU 120 enables the GPU 110 to obtain the decoded image data by means of memory copy. The GPU 110 converts the acquired image data into the first texture data by calling the API interface of OpenGL.
[0118] Finally, GPU 110 renders the texture data to the video memory corresponding to the target display window through the shader algorithm, which may be the video display window 320-1 or the image display window 320-2. The method for determining whether the pixel point in the target display window is located in the video display window 320-1 is similar to Figure 7 Optionally, the display driver chip can obtain the video data and image data to be displayed in the video memory 160, and finally display the video data and image data in the corresponding video display window 320-1 or image display window 320-2 in the display screen.
[0119] In summary, an embodiment of the present application provides a display method, which is applied to a graphics processor GPU in an electronic device, and the method includes: the GPU obtains data to be rendered, and obtains texture data corresponding to the data to be rendered according to the data to be rendered. The GPU renders the texture data to the target display window according to the texture data corresponding to the acquired data to be rendered. In the above method, the GPU can convert the acquired data to be rendered into corresponding texture data; and render the texture data to the video memory corresponding to the target display window. That is to say, the GPU determines the texture data according to the acquired data to be rendered. Thus, the data to be displayed is determined according to the texture data, and the data to be displayed is stored in the video memory corresponding to the target display window. Therefore, it can be understood that in the rendering stage, if the GPU hardware decoding method is adopted, the GPU decodes the acquired encoded data to be rendered, and directly converts the decoded data to be rendered into texture data, without copying the decoded data to be rendered to the CPU. The reverse copy of data is avoided. In the GPU rendering stage, the GPU directly renders the texture data to the video memory corresponding to the target display window. There is no need for the GPU to obtain the decoded data to be rendered from the CPU and render it. It can be seen that the method provided in this application can avoid multiple memory copies, avoid consuming a lot of time during GPU rendering, and avoid the appearance of unsmooth pictures, thereby improving the display frame rate.
[0120] The above mainly introduces the scheme of the embodiment of the present application from the perspective of the method. It is understandable that in order to realize the functions in the above-mentioned display method, the display device includes at least one of the hardware structure and software modules corresponding to the execution of each function. It should be easily appreciated by those skilled in the art that, in combination with the units and algorithm steps of each example described in the embodiments disclosed herein, the embodiments of the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the embodiments of the present application.
[0121] The embodiment of the present application can divide the functional units of the display device according to the above method example. For example, each functional unit can be divided according to each function, or two or more functions can be integrated into one processing unit. The above integrated unit can be implemented in the form of hardware or in the form of software functional units. It should be noted that the division of units in the embodiment of the present application is schematic and is only a logical functional division. There may be other division methods in actual implementation.
[0122] For example, Fig. 9FIG. 8 is a schematic diagram showing the structure of a display device 800 provided in an embodiment of the present application. Fig. 9 As shown, the display device 800 can be applied to Figure 3 In the electronic device 200 shown, the display device 800 includes:
[0123] The acquisition module 801 is used to obtain data to be rendered;
[0124] Processing module 802, used to obtain texture data corresponding to the data to be rendered;
[0125] The rendering module 803 is used to render the texture data to the video memory corresponding to the target display window.
[0126] In a possible implementation, the acquisition module 801 is further used to call a texture function to obtain texture data corresponding to the data to be rendered; the texture function represents a function for rendering graphic data in OpenGL.
[0127] In a possible implementation, the acquisition module 801 is further configured to receive the encoded data to be rendered copied by the central processing unit CPU.
[0128] In one possible implementation, the processing module 802 is further used to determine whether the pixel point belongs to the video display window based on the texture coordinates of the pixel point in the target display window, the coordinates of the video display window, and the coordinates of the video display area in the video data.
[0129] In one possible implementation, the processing module 802 is further used to determine the texture data corresponding to the pixel point based on a mapping relationship between the texture coordinates of the pixel point in the target display window and the texture coordinates of the second texture data if it is determined that the pixel point belongs to the video display window; and to determine the texture data corresponding to the pixel point based on a mapping relationship between the texture coordinates of the pixel point in the target display window and the texture coordinates of the first texture data if it is determined that the pixel point does not belong to the video display window.
[0130] In one possible implementation, the rendering module 803 is also used to determine the texture data corresponding to the pixel point based on the mapping relationship between the texture coordinates of the pixel point in the target display window and the texture coordinates of the texture data; and render the texture data corresponding to the pixel point to the video memory corresponding to the target display window.
[0131] Among them, the acquisition module 801, the processing module 802 and the rendering module 803 can all be implemented by software, or can be implemented by hardware. Exemplarily, the acquisition module 801 is taken as an example to introduce the implementation of the acquisition module 801. Similarly, the implementation of the processing module 802 and the rendering module 803 can refer to the implementation of the acquisition module 801.
[0132] The acquisition module 801 is taken as an example of a software functional unit, and the acquisition module 801 may include code running on a computing instance. Among them, the computing instance may include at least one of a physical host (computing device), a virtual machine, and a container. Further, the above-mentioned computing instance may be one or more. For example, the acquisition module 801 may include code running on multiple hosts / virtual machines / containers. It should be noted that the multiple hosts / virtual machines / containers used to run the code may be distributed in the same region (region) or in different regions. Furthermore, the multiple hosts / virtual machines / containers used to run the code may be distributed in the same availability zone (AZ) or in different AZs, each AZ including a data center or multiple data centers with similar geographical locations. Among them, usually a region may include multiple AZs.
[0133] Similarly, multiple hosts / virtual machines / containers used to run the code can be distributed in the same virtual private cloud (VPC) or in multiple VPCs. Usually, a VPC is set up in a region. For cross-region communication between two VPCs in the same region and between VPCs in different regions, a communication gateway needs to be set up in each VPC to achieve interconnection between VPCs through the communication gateway.
[0134] The acquisition module 801 is taken as an example of a hardware functional unit, and the acquisition module 801 may include at least one computing device, such as a server, etc. Alternatively, the acquisition module 801 may also be a device implemented by an application-specific integrated circuit (ASIC) or a programmable logic device (PLD), etc. The PLD may be a complex programmable logical device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof.
[0135] The multiple computing devices included in the acquisition module 801 can be distributed in the same region or in different regions. The multiple computing devices included in the acquisition module 801 can be distributed in the same AZ or in different AZs. Similarly, the multiple computing devices included in the acquisition module 801 can be distributed in the same VPC or in multiple VPCs. The multiple computing devices can be any combination of computing devices such as servers, ASICs, PLDs, CPLDs, FPGAs, and GALs.
[0136] It should be noted that, in other embodiments, the acquisition module 801 can be used to execute any step in the display method, the processing module 802 and the rendering module 803 can be used to execute any step in the display method, and the steps that the acquisition module 801, the processing module 802 and the rendering module 803 are responsible for implementing can be specified as needed. The acquisition module 801, the processing module 802 and the rendering module 803 respectively implement different steps in the display method to achieve all the functions of the display device 800.
[0137] The embodiment of the present application also provides a computer-readable storage medium, in which instructions are stored. When the computer-readable storage medium is run on a computer, the computer executes the operations of any one implementation scheme and various feasible implementation schemes corresponding to the display method.
[0138] The embodiment of the present application also provides a computer program product including instructions, which, when executed on a computer, enables the computer to execute operations corresponding to any one implementation scheme and various feasible implementation schemes of the display method.
[0139] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction 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 technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0140] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0141] An embodiment of the present application also provides a chip system, including: a processor, the processor is coupled to a memory, the memory is used to store programs or instructions, when the program or instructions are executed by the processor, the chip system implements the method in any of the above method embodiments.
[0142] Optionally, the processor in the chip system may be one or more. The processor may be implemented by hardware or by software. When implemented by hardware, the processor may be a logic circuit, an integrated circuit, etc. When implemented by software, the processor may be a general-purpose processor implemented by reading software code stored in a memory.
[0143] Optionally, the memory in the chip system may also be one or more. The memory may be integrated with the processor or may be separately arranged with the processor, which is not limited in the embodiments of the present application. Exemplarily, the memory may be a non-transient processor, such as a read-only memory ROM, which may be integrated with the processor on the same chip or may be arranged on different chips respectively. The embodiments of the present application do not specifically limit the type of memory and the arrangement of the memory and the processor.
[0144] Exemplarily, the chip system can be a field programmable gate array (FPGA), an application specific integrated circuit (ASIC), a system on chip (SoC), a central processor unit (CPU), a network processor (NP), a digital signal processor (DSP), a microcontroller unit (MCU), a programmable logic device (PLD) or other integrated chips.
[0145] The electronic device, computer storage medium or computer program product provided in this application is used to execute the corresponding method provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding method provided above and will not be repeated here.
[0146] Through the description of the above implementation methods, technical personnel in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.
[0147] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of modules or units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0148] The units described as separate components may or may not be physically separated, and the components shown as units may be one physical unit or multiple physical units, which may be located in one place or distributed in multiple different places. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0149] In addition, each functional unit in each embodiment of the present application 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 above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0150] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium, including several instructions to enable a device (which can be a single-chip microcomputer, chip, etc.) or a processor (processor) to perform all or part of the steps of the various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program code.
[0151] The above contents are only specific implementation methods of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions within the technical scope disclosed in the present application shall be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.
Claims
1. A display method, characterized in that: The method is applied to a graphics processor (GPU) in an electronic device, and the method comprises: Get the data to be rendered; Obtaining texture data corresponding to the data to be rendered; The texture data is rendered to a video memory corresponding to the target display window.
2. The display method according to claim 1, characterized in that: The texture data includes first texture data and second texture data; the first texture data indicates that the data to be rendered is texture data corresponding to image data; the second texture data indicates that the data to be rendered is texture data corresponding to video data.
3. The display method according to claim 2, characterized in that: The rendering of the texture data to a video memory corresponding to the target display window includes: Determining the texture data corresponding to the pixel point according to a mapping relationship between the texture coordinates of the pixel point in the target display window and the texture coordinates of the texture data; The texture data corresponding to the pixel point is rendered to the video memory corresponding to the target display window.
4. The display method according to claim 3, characterized in that: In a case where the target window includes an image display window and a video display window, and the data to be rendered includes the image data and the video data; determining the texture data corresponding to the pixel point according to a mapping relationship between the coordinates of the pixel point in the target display window and the texture coordinates of the texture data includes: Whether the pixel point belongs to the video display window is determined according to the texture coordinates of the pixel point in the target display window, the coordinates of the video display window, and the coordinates of the video display area in the video data.
5. The method according to claim 4, characterized in that The method further comprises: If it is determined that the pixel point belongs to the video display window, determining the texture data corresponding to the pixel point according to a mapping relationship between the texture coordinates of the pixel point in the target display window and the texture coordinates of the second texture data; If it is determined that the pixel point does not belong to the video display window, the texture data corresponding to the pixel point is determined according to a mapping relationship between the texture coordinates of the pixel point in the target display window and the texture coordinates of the first texture data.
6. The display method according to any one of claims 1 to 5, characterized in that: The obtaining of texture data corresponding to the data to be rendered includes: A texture function is called to obtain texture data corresponding to the data to be rendered; the texture function represents a function for rendering graphic data in OpenGL.
7. The display method according to any one of claims 1 to 6, characterized in that: In a case where the data to be rendered includes encoded data to be rendered, the step of obtaining the data to be rendered includes: The encoded data to be rendered is received and copied by a central processing unit (CPU).
8. A display device, characterized in that: The device comprises: The acquisition module is used to obtain the data to be rendered; A processing module, used for obtaining texture data corresponding to the data to be rendered; The rendering module is used to render the texture data to the video memory corresponding to the target display window.
9. An electronic device, characterized in that: The electronic device comprises: a processor and a memory for storing instructions executable by the processor; the processor comprises a graphics processor GPU; The processor is configured to execute the instruction so that the electronic device performs the display method according to any one of claims 1 to 7.
10. A computer program product, characterized in that The computer program product comprises instructions, and when the instructions are executed by an electronic device, the electronic device executes the display method according to any one of claims 1 to 7.
11. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes computer program instructions. When the computer program instructions are executed by an electronic device, the electronic device executes the display method according to any one of claims 1 to 7.
Citation Information
Cited By
Xwindow graph display method and device, electronic equipment and medium
CN120234085A