A cursor drawing method, device and medium based on Linux

By receiving the host -side cursor information and drawing a cursor on the Linux client, the problem that the Linux system cloud game client cannot display the cursor client, and realize the effect of accurately judging the position of the mouse and operating.

CN114265528BActive Publication Date: 2025-01-28HANGZHOU WULIAN TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111574807.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-21
Publication Date
2025-01-28
Estimated Expiration
2041-12-21

AI Technical Summary

Technical Problem

The cloud gaming client of Linux system cannot directly obtain the local cursor, resulting in the inability to display the cursor, making it difficult for users to judge the mouse position and operate.

Method used

By receiving the cursor information sent by the host side, the type of cursor is determined, and the cursor is drawn in frame buffer. The frame buffer to the corresponding layer according to the type of cursor, and superimposed the layer to the main layer, and eventually binds the main layer to the CRTC to the output.

Benefits of technology

The display of the client cursor of the Linux system is implemented, which solves the problem that the user is difficult to judge the position of the mouse and operates.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114265528B_ABST
    Figure CN114265528B_ABST
Patent Text Reader

Abstract

The present application discloses a cursor drawing method, device and medium based on Linux, which relates to the computer field and is mainly used in cloud game scenarios. The cursor type is determined by receiving cursor information sent by the host end, wherein the cursor information includes the shape of the cursor and the position of the cursor; the cursor is drawn to the frame buffer, and the frame buffer where the cursor is located is bound to the corresponding layer according to the type of the cursor, and the cursor is drawn to the layer; the layer is superimposed on the main layer, and the main layer is bound to the CRTC, so that the CRTC outputs and displays the content on the main layer, thereby realizing the display of the mouse cursor of the client of the Linux system and solving the problem that it is difficult for users to determine the mouse position and operate.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the computer field, and in particular to a cursor drawing method, device and medium based on Linux. Background Art

[0002] With the development of audio and video codec technology and 5G network construction, cloud gaming and cloud computer services have developed rapidly. The cloud gaming system includes a host and a client. The game runs on the host. By sending the host's picture, audio, keyboard and mouse information to the client, the client displays and updates the host's picture in real time, and sends the client's audio, keyboard and mouse operations to the host, forming real-time interaction and achieving an operating experience similar to that of a local environment.

[0003] Among them, the host side of cloud games is generally Windows system, and the client side can be Windows, Linux, Android, IOS and other operating systems. Different technical solutions are used in different clients. For the Linux operating system, Direct Rendering Manager (DRM) is a mainstream graphics display framework. It can uniformly manage the graphics processing unit (GPU) and graphics display driver, making it easy to maintain the software architecture, but it does not take into account the application scenario of cloud games. Due to different compatibility, it cannot be used directly, and corresponding technical methods need to be improved in a targeted manner.

[0004] Therefore, for the Linux system client, it is impossible to directly obtain the local cursor, and thus the cursor cannot be displayed, making it difficult for the user to determine the mouse position and perform operations.

[0005] In view of the above problems, designing a cursor drawing method based on Linux that can display the client cursor is an issue that needs to be urgently solved by technical personnel in this field. Summary of the invention

[0006] The purpose of this application is to provide a cursor drawing method, device and medium based on Linux, which can display the cursor of the client.

[0007] In order to solve the above technical problems, the present application provides a cursor drawing method based on Linux, comprising:

[0008] Receiving cursor information sent by the host end to determine the type of the cursor, wherein the cursor information includes the shape of the cursor and the position of the cursor;

[0009] Drawing the cursor to a frame buffer;

[0010] Binding the frame buffer where the cursor is located to a corresponding layer according to the type of the cursor, and drawing the cursor to the layer;

[0011] Overlaying the layer onto the main layer;

[0012] The main layer is bound to the CRTC so that the CRTC outputs and displays the content on the main layer.

[0013] Preferably, before receiving the cursor information sent by the host end, the method further includes:

[0014] Acquire mouse information of a mouse; wherein the mouse information includes movement information and click information of the mouse;

[0015] The mouse information is sent to the host end, so that the host end determines and returns the cursor information according to the mouse information.

[0016] Preferably, the determining the type of the cursor comprises:

[0017] Determine whether the color of the cursor is monochrome;

[0018] If so, determining that the cursor is a monochrome cursor;

[0019] If not, it is determined that the cursor is a multi-color cursor.

[0020] Preferably, binding the frame buffer where the cursor is located to the corresponding layer according to the type of the cursor comprises:

[0021] When it is determined that the cursor is a monochrome cursor, binding the frame buffer where the monochrome cursor is located to the cursor layer;

[0022] When it is determined that the cursor is a multi-color cursor, the frame buffer where the multi-color cursor is located is bound to the overlay layer.

[0023] Preferably, after drawing the cursor to the layer, the method further includes:

[0024] Determine whether the cursor is fully displayed in the layer;

[0025] If so, set the offset of the cursor position on the frame buffer, offset the layer according to the inverse of the offset, and enter the step of superimposing the layer on the main layer.

[0026] Preferably, it is characterized in that, after binding the main layer with CRTC, it also includes:

[0027] Return to the step of receiving cursor information sent by the host end according to a preset time period.

[0028] In order to solve the above technical problems, the present application provides a cursor drawing device based on Linux, comprising:

[0029] A receiving module, used for receiving cursor information sent by a host end to determine the type of the cursor, wherein the cursor information includes the shape of the cursor and the position of the cursor;

[0030] A first drawing module, used for drawing the cursor to a frame buffer;

[0031] A first binding module, used for binding the frame buffer where the cursor is located to a corresponding layer according to the type of the cursor;

[0032] A second drawing module, used for drawing the cursor to the layer;

[0033] An overlay module, used for overlaying the layer onto the main layer;

[0034] The second binding module is used to bind the main layer to the CRTC, so that the CRTC outputs and displays the content on the main layer.

[0035] In order to solve the above technical problems, the present application provides a cursor drawing device based on Linux, comprising:

[0036] Memory for storing computer programs;

[0037] A processor is used to implement the steps of the above-mentioned Linux-based cursor drawing method when executing the computer program.

[0038] In order to solve the above technical problem, the present application also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the above-mentioned Linux-based cursor drawing method are implemented.

[0039] The cursor drawing method based on Linux provided by the present application determines the type of cursor by receiving cursor information sent by the host side, wherein the cursor information includes the shape of the cursor and the position of the cursor; draws the cursor to the frame buffer, and binds the frame buffer where the cursor is located to the corresponding layer according to the type of the cursor, and draws the cursor to the layer; superimposes the layer to the main layer, binds the main layer to the CRTC, so that the CRTC outputs and displays the content on the main layer, realizes the display of the mouse cursor of the client of the Linux system, and solves the problem that it is difficult for users to determine the mouse position and perform operations.

[0040] In addition, the present application also provides a cursor drawing device and a computer-readable storage medium based on Linux, with the same effects as above. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] In order to more clearly illustrate the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0042] Figure 1 A flowchart of a cursor drawing method based on Linux provided in an embodiment of the present application;

[0043] Figure 2 A flowchart of another cursor drawing method based on Linux provided in an embodiment of the present application;

[0044] Figure 3 A schematic diagram of a cursor position in a frame buffer provided in an embodiment of the present application;

[0045] Figure 4 A schematic diagram of a superimposed plane and a cursor position thereof provided in an embodiment of the present application;

[0046] Figure 5 A schematic diagram of the structure of a cursor drawing device based on Linux provided in an embodiment of the present application;

[0047] Figure 6 A schematic structural diagram of another Linux-based cursor drawing device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0048] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0049] The core of this application is to provide a cursor drawing method, device and medium based on Linux, which can display the client cursor.

[0050] In order to enable those skilled in the art to better understand the present application, the present application is further described in detail below in conjunction with the accompanying drawings and specific implementation methods.

[0051] Figure 1A flowchart of a cursor drawing method based on Linux provided in an embodiment of the present application. There is no limitation on the usage scenario of the cursor drawing method based on Linux, which depends on the specific implementation. As a preferred embodiment, the cursor drawing method based on Linux in the present application is mainly used in cloud games, based on the cursor drawing scenario of Linux client. Figure 1 As shown, the method includes:

[0052] S10: receiving cursor information sent by the host end to determine the type of the cursor, wherein the cursor information includes the shape of the cursor and the position of the cursor.

[0053] S11: Draw the cursor to the frame buffer.

[0054] S12: Binding the frame buffer where the cursor is located to the corresponding layer according to the type of the cursor, and drawing the cursor to the layer.

[0055] S13: Overlay layer onto main layer.

[0056] S14: Bind the main layer to the CRTC so that the CRTC outputs and displays the content on the main layer.

[0057] The host side of cloud games is generally a Windows system, and the client side can be Windows, Linux, Android, IOS and other operating systems. Different technical solutions are used on different clients. For the Linux operating system, DRM is a mainstream graphics display framework. It can uniformly manage the GPU and graphics display driver, which is convenient for maintaining the software architecture, but it does not take into account the application scenario of cloud games. Due to its insufficient compatibility, it cannot be used directly, and corresponding technical methods are required for targeted improvements. In addition, for the client side of the Linux system, it is impossible to directly obtain and display the local cursor, and it is difficult for the user to determine the mouse position and operate. Therefore, in this embodiment, in order to realize the cursor drawing on the Linux client, the cursor information sent by the host side is first received. The cursor information includes the shape of the cursor and the position of the cursor. Among them, in this embodiment, there is no restriction on the way the host side obtains the cursor information, which depends on the implementation situation.

[0058] It is understandable that in cloud games, the client receives and displays the screen content transmitted by the host. In this embodiment, the client also needs to receive cursor information from the host before it can draw the cursor. There is no restriction on the specific content of the cursor information, which depends on the specific implementation. However, at least the shape and position of the cursor must be included to ensure that the client can accurately draw the cursor shape in the correct position. The type of cursor can be determined based on the cursor information obtained. After obtaining the cursor information, the client draws the cursor information on the frame buffer; the frame buffer, or Framebuffer, is an interface provided by the Linux system for display devices, allowing upper-level applications to directly read and write to the display buffer in graphics mode. Then, according to the type of cursor, the frame buffer where the cursor is located is bound to the corresponding layer, and the cursor is drawn to the layer.

[0059] It is understandable that the cursor can be divided into different types according to the color of the cursor and the shape of the cursor. The color of the cursor will change according to the change of the background image, and the shape of the cursor will also change as the cursor moves to a special position; in this embodiment, there is no restriction on the specific classification of the cursor, which depends on the specific implementation situation. In addition, the frame buffer where the cursor is located is bound to the corresponding layer according to the type of cursor, and the layers corresponding to the cursor here are the cursor layer and the overlay layer. The cursor layer is the cursor plane; the overlay layer is the overlay plane. In this embodiment, there is no restriction on the correspondence between the cursor and the two layers, which depends on the specific implementation situation. After binding the cursor to the corresponding layer, the cursor is drawn on the layer.

[0060] In a specific implementation, after obtaining a layer with a cursor pattern drawn on it, it is necessary to superimpose the layer with the main layer. The main layer is the primary plane, which has the screen content transmitted from the host to the client. By superimposing the layer with the cursor pattern on the main layer, the content screen with the cursor is obtained. The main layer is then bound to the cathode ray tube controller (Cathode Ray Tube Controller, CRTC), and the CRTC outputs and displays the content on the main layer. The function of the CRTC is to read the pixel data in the buffer and generate a video mode signal, encode the signal through the encoder, and transmit it to the physical display device through the connecting medium for display. The specific method of CRTC outputting and displaying the content of the main layer is not limited in this embodiment and depends on the specific implementation situation.

[0061] In this embodiment, the cursor information sent by the host is received to determine the type of the cursor, wherein the cursor information includes the shape of the cursor and the position of the cursor; the cursor is drawn to the frame buffer, and the frame buffer where the cursor is located is bound to the corresponding layer according to the type of the cursor, and the cursor is drawn to the layer; the layer is superimposed on the main layer, and the main layer is bound to the CRTC so that the CRTC outputs and displays the content on the main layer, thereby realizing the display of the mouse cursor of the client of the Linux system and solving the problem that it is difficult for users to determine the mouse position and perform operations.

[0062] Figure 2 A flowchart of another cursor drawing method based on Linux provided in an embodiment of the present application. In order to enable the host end to obtain accurate cursor information and send the cursor information to the client end for the client end to draw, as Figure 2 As shown, before step S10, it also includes:

[0063] S15: Obtain mouse information of the mouse; wherein the mouse information includes movement information and click information of the mouse.

[0064] S16: Sending the mouse information to the host side, so that the host side determines and returns the cursor information according to the mouse information.

[0065] It is understandable that in the actual operation of cloud games, the user's intervention in the shape and position of the cursor is completed by moving the mouse connected to the client. Therefore, before the client draws the cursor, the client needs to send the relevant information of the mouse to the host. In step S15, the client first obtains the mouse information of the mouse, and the mouse information includes the movement information and click information of the mouse, wherein the movement information of the mouse enables the host to know the position of the cursor, and the click information of the mouse enables the host to know the changes in shape and color when the mouse is clicked, and both types of information are indispensable. The mouse information may also include other reference information, such as the working time of the mouse, the number of clicks of the mouse, etc. In this embodiment, the mouse information is only required to include the mouse movement information and mouse click information related to the cursor drawing, and there is no restriction on whether other information is included, depending on the specific implementation.

[0066] It is understandable that after receiving the mouse information, the host side will apply the mouse movement information and mouse click information in the mouse information to the process of the cloud game, and display the shape and position of the cursor in the screen, and then use the graphics card screen capture technology, such as NVFBC or Windows system function to capture the shape and position of the cursor, and send the cursor information to the client. In this embodiment, there is no restriction on the screen capture method, only the shape and position of the cursor need to be sent to the client, depending on the specific implementation.

[0067] In this embodiment, the client sends the mouse movement information and click information to the host, the host obtains accurate cursor information and sends the cursor information to the client, the client receives and draws the cursor according to the cursor information, which is very accurate and reliable.

[0068] Based on the above embodiments:

[0069] As a preferred embodiment, determining the type of cursor includes:

[0070] Determine whether the cursor color is monochrome;

[0071] If so, determine that the cursor is a monochrome cursor;

[0072] If not, determine that the cursor is a multi-color cursor.

[0073] It is understandable that in the above embodiment, in order to display different types of cursors, different cursors need to be bound to corresponding layers. Prior to this, the type of cursor needs to be determined. In this embodiment, cursors are divided into two categories. The first category is a cursor with a fixed color and shape, including shapes such as arrows and palms, which is called a multi-color cursor; the second category is a mask cursor, which is a cursor whose color changes with the background color of the screen, for example, the cursor appears white on a black background, and black on a white background. Only one color will appear at the same time, which is called a monochrome cursor. When determining the type of cursor, the client first detects the cursor color to determine whether the cursor color is monochrome, that is, only one color; if so, the cursor is determined to be a monochrome cursor, if not, the cursor is determined to be a multi-color cursor. In this embodiment, there is no restriction on the specific method for determining the cursor color, which depends on the specific implementation situation.

[0074] In this embodiment, the cursor is divided into two types by judging whether the color of the cursor is monochrome, corresponding to the above two layers, so as to facilitate the binding of the cursor pattern and the layer, and the drawing of the cursor.

[0075] On the basis of the above embodiments;

[0076] As a preferred embodiment, binding the frame buffer where the cursor is located to the corresponding layer according to the type of the cursor includes:

[0077] When it is determined that the cursor is a monochrome cursor, the frame buffer where the monochrome cursor is located is bound to the cursor layer;

[0078] When it is determined that the cursor is a multi-color cursor, the frame buffer where the multi-color cursor is located is bound to the overlay layer.

[0079] It is understandable that in the above embodiment, the cursor is divided into a multi-color cursor and a monochrome cursor. At the same time, there is no restriction on the correspondence between the cursor and the two layers, which depends on the specific implementation. In this embodiment, as a preferred embodiment, the monochrome cursor corresponds to the cursor layer, and the multi-color cursor corresponds to the overlay layer. In the specific implementation, when it is determined that the cursor is a monochrome cursor, the frame buffer where the monochrome cursor is located is bound to the cursor layer for subsequent drawing and binding with the main layer and display; when it is determined that the cursor is a multi-color cursor, the frame buffer where the multi-color cursor is located is bound to the overlay layer for subsequent drawing and binding with the main layer and display. If it is determined that there is only one type of cursor, the layer corresponding to the other cursor type is blanked.

[0080] In this embodiment, when the cursor is determined to be a monochrome cursor, the frame buffer where the monochrome cursor is located is bound to the cursor layer; when the cursor is determined to be a multi-color cursor, the frame buffer where the multi-color cursor is located is bound to the overlay layer. Different types of cursors are bound to different types of layers to facilitate cursor display.

[0081] like Figure 2 As shown, in order to make the cursor drawn on the overlay layer fully displayed at the edge, after drawing the cursor to the layer, it also includes:

[0082] S17: Determine whether the cursor is fully displayed in the layer; if so, proceed to step S18.

[0083] S18: Set the offset of the cursor position on the frame buffer, offset the layer according to the opposite number of the offset, and enter step S13.

[0084] It is understandable that since the cursor may move to the boundary of the client page during operation, and of the two layers, the cursor layer and the overlay layer, the overlay layer does not support boundary graphic display, in order to fully display the cursor, the cursor boundary needs to be processed to ensure that it is always displayed on the screen.

[0085] Figure 3 A schematic diagram of a cursor position in a frame buffer provided by an embodiment of the present application. The upper left vertex of the cursor drawn on the frame buffer is recorded as (cursor_x, cursor_y) to indicate the position of the cursor.

[0086] Figure 4 A schematic diagram of a superimposed plane and its cursor position provided in an embodiment of the present application. Figure 4As shown, the length and width of the overlay plane rectangle are recorded as H and W, the length and width of the cursor graphic are recorded as crtc_w and crtc_h, and the distance between the upper left corner vertex of the cursor graphic and the rectangle boundary is recorded as crtc_x and crtc_y. For step S17, it is first necessary to determine whether the cursor is fully displayed in the layer. Specifically, when crtc_h+crtc_y>H or crtc_w+crtc_x>W, it is determined that the cursor graphic cannot be fully displayed on the overlay plane and cannot be submitted to CRTC. Therefore, step S18 is entered, and the offset of the cursor graphic on the frame buffer is first set. The upper left corner vertex of the offset cursor graphic is recorded as (cursor_x-w, cursor_y-h), w and h are variables calculated from the position on the overlay plane, where w=crtc_w+crtc_x-W, h=crtc_h+crtc_y-H. Then, the offset cursor graphic is bound to the overlay plane, and then the overlay plane is offset (-w, -h) when submitted to CRTC to ensure that the cursor is fully displayed at the edge.

[0087] In this embodiment, an offset is set for the cursor position on the frame buffer, and the layer is offset according to the opposite number of the offset so that the cursor drawn on the layer is fully displayed at the edge, and then the layer is bound to the main layer so that the cursor is fully displayed on the image.

[0088] like Figure 2 As shown, in order to enable the cursor to be displayed in real time, after step S14, the following steps are further included:

[0089] Return to step S10 according to the preset time period.

[0090] It is understandable that the step of drawing and displaying the cursor in the above embodiment is only a cursor at a moment. In the actual use of cloud games, the position of the mouse is constantly changing, and the shape of the corresponding cursor position in the client will also change accordingly. Therefore, in order to display the cursor on the client in real time, after step S14, return to step S10 according to the preset time period, that is, after a complete cursor drawing, the cursor is drawn again within the preset time.

[0091] It should be noted that this embodiment does not limit the specific size of the preset time period. It can be understood that the shorter the time period, the closer the drawing of the cursor on the client is to real time, which depends on the specific implementation situation.

[0092] In this embodiment, after the main layer is bound to the CRTC, the step of returning to receive the cursor information sent by the host end according to the preset time is implemented to achieve real-time drawing and display of the cursor on the client end.

[0093] In the above embodiments, a cursor drawing method based on Linux is described in detail, and the present application also provides an embodiment corresponding to a cursor drawing device based on Linux. It should be noted that the present application describes the embodiments of the device part from two perspectives, one is based on the perspective of functional modules, and the other is based on the perspective of hardware structure.

[0094] Figure 5 A schematic diagram of a cursor drawing device based on Linux provided in an embodiment of the present application, wherein the cursor drawing device based on Linux includes:

[0095] The receiving module 10 is used to receive cursor information sent by the host to determine the type of the cursor, wherein the cursor information includes the shape of the cursor and the position of the cursor.

[0096] The first drawing module 11 is used for drawing a cursor to a frame buffer.

[0097] The first binding module 12 is used to bind the frame buffer where the cursor is located to the corresponding layer according to the type of the cursor.

[0098] The second drawing module 13 is used to draw a cursor on the layer.

[0099] The overlay module 14 is used to overlay the layer onto the main layer.

[0100] The second binding module 15 is used to bind the main layer to the CRTC, so that the CRTC can output and display the content on the main layer.

[0101] Since the embodiments of the apparatus part correspond to the embodiments of the method part, please refer to the description of the embodiments of the method part for the embodiments of the apparatus part, which will not be repeated here.

[0102] Figure 6 A schematic diagram of the structure of another cursor drawing device based on Linux provided in an embodiment of the present application is shown in FIG. Figure 6 As shown, the cursor drawing device based on Linux includes:

[0103] The memory 20 is used to store computer programs.

[0104] The processor 21 is used to implement the steps of the Linux-based cursor drawing method mentioned in the above embodiment when executing a computer program.

[0105] The Linux-based cursor drawing device provided in this embodiment may include but is not limited to a smart phone, a tablet computer, a laptop computer, or a desktop computer.

[0106] Among them, the processor 21 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 21 can be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). The processor 21 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a CPU (Central Processing Unit); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 21 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 21 may also include an AI (Artificial Intelligence) processor, which is used to process computing operations related to machine learning.

[0107] The memory 20 may include one or more computer-readable storage media, which may be non-transitory. The memory 20 may also include a high-speed random access memory, and a non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In this embodiment, the memory 20 is at least used to store the following computer program 201, wherein, after the computer program is loaded and executed by the processor 21, it can implement the relevant steps of the cursor drawing method based on Linux disclosed in any of the aforementioned embodiments. In addition, the resources stored in the memory 20 may also include an operating system 202 and data 203, etc., and the storage method may be temporary storage or permanent storage. Among them, the operating system 202 may include Windows, Unix, Linux, etc. Data 203 may include but is not limited to data related to the cursor drawing method based on Linux.

[0108] In some embodiments, the Linux-based cursor drawing device may further include a display screen 22 , an input / output interface 23 , a communication interface 24 , a power supply 25 , and a communication bus 26 .

[0109] Those skilled in the art will understand that Figure 6 The structure shown in the figure does not constitute a limitation on the cursor drawing device based on Linux, and may include more or less components than those shown in the figure.

[0110] Finally, the present application also provides an embodiment corresponding to a computer-readable storage medium. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps recorded in the above method embodiment are implemented.

[0111] It is understandable that if the method in the above embodiment is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium to execute all or part of the steps of the method described in each embodiment 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.

[0112] The above is a detailed introduction to a cursor drawing method, device and medium based on Linux provided by the present application. The various embodiments in the specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same and similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part description. It should be pointed out that for ordinary technicians in this technical field, without departing from the principles of the present application, several improvements and modifications can be made to the present application, and these improvements and modifications also fall within the scope of protection of the claims of the present application.

[0113] It should also be noted that, in this specification, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "comprise", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the statement "comprises a ..." does not exclude the presence of other identical elements in the process, method, article or device including the element.

Claims

1. A cursor drawing method based on Linux, characterized in that: include: Receive cursor information sent by the host to determine whether the cursor color is monochrome; If so, determining that the cursor is a monochrome cursor; If not, determining that the cursor is a multi-color cursor, wherein the cursor information includes a shape of the cursor and a position of the cursor; Drawing the cursor to a frame buffer; When it is determined that the cursor is a monochrome cursor, binding the frame buffer where the monochrome cursor is located to the cursor layer; When it is determined that the cursor is a multi-color cursor, the frame buffer where the multi-color cursor is located is bound to an overlay layer, and the cursor is drawn to the layer; Overlaying the layer onto the main layer; The main layer is bound to the CRTC so that the CRTC outputs and displays the content on the main layer.

2. The cursor drawing method based on Linux according to claim 1, characterized in that: Before receiving the cursor information sent by the host end, the method further includes: Acquire mouse information of a mouse; wherein the mouse information includes movement information and click information of the mouse; The mouse information is sent to the host end, so that the host end determines and returns the cursor information according to the mouse information.

3. The cursor drawing method based on Linux according to claim 1, characterized in that: After drawing the cursor to the layer, the method further includes: Determine whether the cursor is fully displayed in the layer; If so, set the offset of the cursor position on the frame buffer, offset the layer according to the inverse of the offset, and enter the step of superimposing the layer on the main layer.

4. The cursor drawing method based on Linux according to any one of claims 1 to 3, characterized in that: After binding the main layer with CRTC, the method further includes: Return to the step of receiving cursor information sent by the host end according to a preset time period.

5. A cursor drawing device based on Linux, characterized in that: include: A receiving module, used for receiving cursor information sent by the host end to determine whether the color of the cursor is monochrome; if so, determining that the cursor is a monochrome cursor; if not, determining that the cursor is a multi-color cursor, wherein the cursor information includes the shape of the cursor and the position of the cursor; A first drawing module, used for drawing the cursor to a frame buffer; A first binding module is used to bind the frame buffer where the monochrome cursor is located to the cursor layer when it is determined that the cursor is a monochrome cursor; and to bind the frame buffer where the multi-color cursor is located to an overlay layer when it is determined that the cursor is a multi-color cursor; A second drawing module, used for drawing the cursor to the layer; An overlay module, used for overlaying the layer onto the main layer; The second binding module is used to bind the main layer to the CRTC, so that the CRTC outputs and displays the content on the main layer.

6. A cursor drawing device based on Linux, characterized in that: include: Memory for storing computer programs; A processor, configured to implement the steps of the Linux-based cursor drawing method as described in any one of claims 1 to 4 when executing the computer program.

7. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the cursor drawing method based on Linux as claimed in any one of claims 1 to 4 are implemented.

Citation Information

Patent Citations

  • Implementing previously rendered frame buffer information in a customized gui display

    CN104471526A

  • Cursor display method and device and medium

    CN113082703A