CN114265528A - Linux-based cursor drawing method, device and medium - Google Patents
Linux-based cursor drawing method, device and medium Download PDFInfo
- Publication number
- CN114265528A CN114265528A CN202111574807.2A CN202111574807A CN114265528A CN 114265528 A CN114265528 A CN 114265528A CN 202111574807 A CN202111574807 A CN 202111574807A CN 114265528 A CN114265528 A CN 114265528A
- Authority
- CN
- China
- Prior art keywords
- cursor
- layer
- linux
- binding
- information
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 64
- 102100029968 Calreticulin Human genes 0.000 claims abstract 7
- 101100326671 Homo sapiens CALR gene Proteins 0.000 claims abstract 7
- 238000004590 computer program Methods 0.000 claims description 12
- 230000003139 buffering effect Effects 0.000 claims description 10
- 238000009877 rendering Methods 0.000 claims description 9
- 230000008569 process Effects 0.000 description 9
- 238000012545 processing Methods 0.000 description 9
- 238000010586 diagram Methods 0.000 description 8
- 230000006872 improvement Effects 0.000 description 4
- 230000009471 action Effects 0.000 description 3
- 230000008859 change Effects 0.000 description 3
- 238000013473 artificial intelligence Methods 0.000 description 2
- 238000004891 communication Methods 0.000 description 2
- 230000000694 effects Effects 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 241000473256 Erythrolamprus cursor Species 0.000 description 1
- 238000004364 calculation method Methods 0.000 description 1
- 238000010276 construction Methods 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000006870 function Effects 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- 238000010801 machine learning Methods 0.000 description 1
- 230000005055 memory storage Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000000750 progressive effect Effects 0.000 description 1
- 230000001052 transient effect Effects 0.000 description 1
Images
Landscapes
- User Interface Of Digital Computer (AREA)
Abstract
The application discloses a method, a device and a medium for drawing a cursor based on Linux, relates to the field of computers, and is mainly applied to cloud game scenes. The method comprises the steps of determining the type of a cursor by receiving cursor information sent by a host, wherein the cursor information comprises the shape of the cursor and the position of the cursor; drawing a cursor to a frame buffer, 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; and superposing the layer to the main layer, and binding the main layer with the CRTC for the CRTC to output and display 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 the user is difficult to judge the position of the mouse and operate.
Description
Technical Field
The present application relates to the field of computers, and in particular, to a method, an apparatus, and a medium for drawing a cursor based on Linux.
Background
With the development of audio and video encoding and decoding technology and the construction of 5G networks, cloud game and cloud computer services are rapidly developed. The cloud game system comprises a host computer end and a client end, wherein a game runs at the host computer end, the picture, the audio and the keyboard and mouse information of the host computer end are sent to the client end, the picture of the host computer end is displayed and updated at the client end in real time, the audio and the keyboard and mouse operation of the client end are sent to the host computer end, real-time interaction is formed, and the operation experience like a local environment is achieved.
The host end of the cloud game is generally a Windows system, and the client end can be an operating system such as Windows, Linux, android and IOS. The technical scheme of the application at different clients is different. For the Linux operating system, a Direct Rendering Manager (DRM) is a mainstream graphics display framework. The method can uniformly manage a Graphics Processing Unit (GPU) and a Graphics display driver, is convenient for maintaining a software framework, does not consider an application scene of a cloud game, has different compatibility and cannot be directly used, and needs corresponding technical method for pertinence improvement.
Therefore, for the client of the Linux system, the local cursor cannot be directly obtained, so that the cursor cannot be displayed, and the user cannot easily judge the position of the mouse and perform operation.
In view of the above problems, it is an urgent need to solve by those skilled in the art to design a Linux-based cursor drawing method capable of displaying a client cursor.
Disclosure of Invention
The application aims to provide a Linux-based cursor drawing method, a Linux-based cursor drawing device and a Linux-based cursor drawing medium, which can display a cursor of a client.
In order to solve the technical problem, the present application provides a Linux-based cursor drawing method, including:
receiving cursor information sent by a host computer end to determine the type of the cursor, wherein the cursor information comprises the shape of the cursor and the position of the cursor;
drawing the cursor to a frame buffer;
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;
superposing the layer to a main layer;
and binding the main image layer with the CRTC to be used for the CRTC to output and display the content on the main image layer.
Preferably, before receiving the cursor information sent by the host, the method further includes:
acquiring mouse information of a mouse; the mouse information comprises movement information and click information of the mouse;
and sending the mouse information to the host end so that the host end can determine and return the cursor information according to the mouse information.
Preferably, the determining the type of the cursor comprises:
judging whether the color of the cursor is a single color or not;
if so, determining that the cursor is a monochromatic cursor;
if not, determining that the cursor is a multicolor cursor.
Preferably, the buffering and binding the frame where the cursor is located to the corresponding layer according to the type of the cursor includes:
when the cursor is determined to be a monochromatic cursor, buffering and binding a frame where the monochromatic cursor is located to the cursor layer;
and when the cursor is determined to be a multi-color cursor, buffering and binding the frame where the multi-color cursor is located to the superposition layer.
Preferably, after the drawing the cursor to the layer, the method further includes:
judging whether the cursor is completely displayed in the layer or not;
if so, setting the offset of the position of the cursor on the frame buffer, offsetting the layer according to the opposite number of the offset, and entering the step of superposing the layer to a main layer.
Preferably, after the binding the main layer and the CRTC, the method further includes:
and returning to the step of receiving the cursor information sent by the host end according to a preset time period.
In order to solve the above technical problem, the present application provides a Linux-based cursor drawing device, including:
the receiving module is used for receiving cursor information sent by the host end so as to determine the type of the cursor, wherein the cursor information comprises the shape of the cursor and the position of the cursor;
a first drawing module for drawing the cursor to a frame buffer;
the first binding module is used for binding the frame buffer where the cursor is located to the corresponding layer according to the type of the cursor;
the second drawing module is used for drawing the cursor to the image layer;
the superposition module is used for superposing the layer to the main layer;
and the second binding module is used for binding the main image layer with the CRTC, so that the CRTC outputs and displays the content on the main image layer.
In order to solve the above technical problem, the present application provides a Linux-based cursor drawing device, including:
a memory for storing a computer program;
and the processor is used for realizing the steps of the Linux-based cursor drawing method when the computer program is executed.
In order to solve the above technical problem, the present application provides a computer-readable storage medium, where a computer program is stored, and the computer program, when executed by a processor, implements the steps of the Linux-based cursor drawing method described above.
According to the Linux-based cursor drawing method, the type of a cursor is determined by receiving cursor information sent by a host computer, wherein the cursor information comprises the shape of the cursor and the position of the cursor; drawing a cursor to a frame buffer, 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; and superposing the layer to the main layer, and binding the main layer with the CRTC for the CRTC to output and display 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 the user is difficult to judge the position of the mouse and operate.
In addition, the application also provides a cursor drawing device and a computer readable storage medium based on Linux, and the effect is the same as the effect.
Drawings
In order to more clearly illustrate the embodiments of the present application, the drawings needed for the embodiments will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings can be obtained by those skilled in the art without inventive effort.
Fig. 1 is a flowchart of a Linux-based cursor drawing method according to an embodiment of the present application;
fig. 2 is a flowchart of another Linux-based cursor rendering method according to an embodiment of the present application;
fig. 3 is a schematic diagram of a cursor position in a frame buffer according to an embodiment of the present disclosure;
fig. 4 is a schematic diagram of a superimposed plane and a cursor position thereof according to an embodiment of the present disclosure;
fig. 5 is a schematic structural diagram of a Linux-based cursor drawing device according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of another Linux-based cursor drawing device according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all the embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments in the present application without any creative effort belong to the protection scope of the present application.
The core of the application is to provide a Linux-based cursor drawing method, device and medium, which can display a client cursor.
In order that those skilled in the art will better understand the disclosure, the following detailed description will be given with reference to the accompanying drawings.
Fig. 1 is a flowchart of a Linux-based cursor drawing method according to an embodiment of the present application. The use scene of the Linux-based cursor drawing method is not limited and depends on the specific implementation situation. As a preferred embodiment, the Linux-based cursor drawing method in the present application is mainly applied to a cloud game, and is based on a cursor drawing context of a Linux-based client. As shown in fig. 1, the method comprises:
s10: and receiving cursor information sent by the host computer end to determine the type of the cursor, wherein the cursor information comprises the shape of the cursor and the position of the cursor.
S11: drawing the cursor to the frame buffer.
S12: and 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.
S13: and superposing the layer to the main layer.
S14: and binding the main layer with the CRTC for the CRTC to output and display the content on the main layer.
The host end of the cloud game is generally a Windows system, and the client end can be an operating system such as Windows, Linux, android and IOS. The technical scheme of the application at different clients is different. For the Linux operating system, DRM is a mainstream graphics display framework. The method can uniformly manage the GPU and the graphic display driver, is convenient to maintain a software framework, does not consider the application scene of the cloud game, cannot be directly used due to insufficient compatibility, and needs corresponding technical method for pertinence improvement. In addition, for the client of the Linux system, the local cursor cannot be directly acquired and displayed, and it is difficult for the user to determine the position of the mouse and perform an operation, so in this embodiment, in order to implement the cursor drawing at the Linux client, cursor information sent by the host is first received, where the cursor information includes the shape of the cursor and the position of the cursor. In this embodiment, the manner of obtaining the cursor information from the host is not limited, and is determined according to the implementation condition.
It can be understood that, in the cloud game, the client receives and displays the screen content transmitted by the host. In this embodiment, the client also needs to receive the cursor information from the host to draw the cursor. The specific content of the cursor information is not limited, and depends on the specific implementation. However, at least the shape and position of the cursor need to be included, so that the client can accurately draw the cursor shape at the correct position. The type of the cursor can be determined based on the obtained cursor information. After obtaining the cursor information, the client draws the cursor information on a frame buffer; frame buffer, i.e. Framebuffer, is an interface provided by the Linux system for the display device, and allows the upper layer application program to directly perform read-write operation on the display buffer area in the graphics mode. And then, according to the type of the cursor, the frame buffer where the cursor is located is bound to the corresponding layer, and the cursor is drawn to the layer.
It is understood that the cursor can be classified into different categories according to the color of the cursor and the shape of the cursor. The color of the cursor can change according to the change of the background picture, and the shape of the cursor can also change along with the movement of the cursor to a special position; the specific classification of the cursor in this embodiment is not limited, and is determined according to the specific implementation. In addition, the frame buffer where the cursor is located is bound to the corresponding layer according to the type of the cursor, where the layers corresponding to the cursor are the cursor layer and the superimposed layer respectively. Cursor layer, i.e. cursor plane; the superposed layer is the overlay plane. In this embodiment, the corresponding relationship between the cursor and the two image layers is not limited, and is determined according to a specific implementation situation. And after the cursor is bound with the corresponding layer, drawing the cursor on the layer.
In a specific implementation, after a layer on which a cursor pattern is drawn is obtained, the layer needs to be superimposed with a main layer, where the main layer is a primary plane and has picture content transmitted by a host to a client. And the content picture with the cursor is obtained by superposing the layer with the cursor pattern on the main layer. And then the main layer is bound with a Cathode Ray Tube Controller (CRTC), and the CRTC outputs and displays the content on the main layer. The CRTC is used to read the pixel data of the buffer and generate a video mode signal, which is encoded by an encoder and transmitted to a physical display device via a connection medium for display. The specific method for outputting and displaying the content of the main layer by the CRTC is not limited in this embodiment, and is determined according to a specific implementation situation.
In this embodiment, the type of the cursor is determined by receiving cursor information sent by the host, where the cursor information includes a shape of the cursor and a position of the cursor; drawing a cursor to a frame buffer, 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; and superposing the layer to the main layer, and binding the main layer with the CRTC for the CRTC to output and display 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 the user is difficult to judge the position of the mouse and operate.
Fig. 2 is a flowchart of another Linux-based cursor drawing method according to an embodiment of the present application. In order to enable the host to obtain accurate cursor information and send the cursor information to the client for the client to draw, as shown in fig. 2, before step S10, the method further includes:
s15: acquiring mouse information of a mouse; the mouse information includes movement information and click information of the mouse.
S16: and sending the mouse information to the host end so that the host end can determine and return the cursor information according to the mouse information.
It can be understood that in the actual operation process of the cloud game, the user's intervention on the shape and position of the cursor is completed by moving the mouse connected with the client. Therefore, before the client draws the cursor, the client is required to send the relevant information of the mouse to the host side. In step S15, the client first obtains mouse information of the mouse, where the mouse information includes movement information and click information of the mouse, where the movement information of the mouse enables the host to know a position of the cursor, and the click information of the mouse enables the host to know changes of a shape and a color when the mouse is clicked, and neither of the two information is available. The mouse information may further include other reference information, such as the operating time of the mouse, the number of times of clicking the mouse, and the like, and in this embodiment, the mouse information only needs to include mouse movement information and mouse click information related to the drawing of the cursor, and whether the mouse information includes other information is not limited, and is determined according to a specific implementation situation.
It can be understood that, after receiving the mouse information, the host computer acts the mouse movement information and the mouse click information in the mouse information on the cloud game process, displays the shape and the position of the cursor in the picture, then captures the shape and the position of the cursor through a display card screen capturing technology, such as NVFBC or Windows system function, and sends the cursor information to the client. In this embodiment, the screen capture mode is not limited, and only the shape and the position of the cursor need to be sent to the client, which is determined according to the specific implementation situation.
In the embodiment, the client sends the movement information and the click information of the mouse to the host, the host obtains accurate cursor information and sends the cursor information to the client, and the client receives and draws the cursor according to the cursor information, so that the mouse is very accurate and reliable.
On the basis of the above-described embodiment:
as a preferred embodiment, determining the category of the cursor includes:
judging whether the color of the cursor is a single color or not;
if so, determining the cursor as a monochromatic cursor;
if not, determining that the cursor is a multicolor cursor.
It is understood that, in the above embodiment, in order to be able to display different kinds of cursors, different cursors need to be bound on corresponding layers. Before that, it is necessary to determine the type of the cursor. In the present embodiment, the cursor is divided into two categories. The first type is that the cursor has a fixed color and shape, including the shape of an arrow, a palm, etc., which is called a multi-color cursor; the second type is a mask cursor, which is a cursor whose color changes with the color of the background of the picture, for example, the cursor appears white on a black background, the cursor appears black on a white background, and only one color appears at the same time, which is called a monochrome cursor. When the type of the cursor is determined, the client firstly detects the color of the cursor and judges whether the color of the cursor is a single color, namely only one color; if so, determining the cursor to be a monochromatic cursor, and if not, determining the cursor to be a multi-color cursor. In this embodiment, the specific method for determining the color of the cursor is not limited, and is determined according to the specific implementation situation.
In this embodiment, the cursor is divided into two types by determining whether the color of the cursor is a single color, and the two types of layers correspond to each other, which facilitates the binding of the cursor pattern and the layer and the drawing of the cursor.
On the basis of the above embodiments;
as a preferred embodiment, the binding, according to the type of the cursor, the frame buffer where the cursor is located to the corresponding layer includes:
when the cursor is determined to be a monochromatic cursor, binding the frame buffer where the monochromatic cursor is located to the cursor layer;
and when the cursor is determined to be a multicolor cursor, buffering and binding the frame where the multicolor cursor is located to the superposed layer.
It is to be understood that, in the above-described embodiments, the cursor is classified into a multicolor cursor and a monochrome cursor. Meanwhile, the corresponding relation between the cursor and the two layers is not limited, and is determined according to specific implementation conditions. In this embodiment, as a preferred embodiment, a monochromatic cursor corresponds to the cursor layer, and a multicolor cursor corresponds to the superimposed layer. In specific implementation, when the cursor is determined to be a monochromatic cursor, a frame where the monochromatic cursor is located is bound to a cursor layer in a buffering mode and used for subsequent drawing, and the frame is bound with a main layer and displayed; and when the cursor is determined to be the multicolor cursor, buffering and binding the frame where the multicolor cursor is located to the superposed layer for subsequent drawing, and binding and displaying with the main layer. And if only one cursor type is determined, performing null processing on the layer corresponding to the other cursor type.
In the embodiment, when the cursor is determined to be a monochromatic cursor, the frame where the monochromatic cursor is located is buffered and bound to the cursor layer; and when the cursor is determined to be a multicolor cursor, buffering and binding the frame where the multicolor cursor is located to the superposed layer. And different types of cursors are bound with different types of layers, so that the cursors can be conveniently displayed.
As shown in fig. 2, in order to make the cursor drawn on the superimposed layer be completely displayed at the edge, after drawing the cursor to the layer, the method further includes:
s17: judging whether the cursor is completely displayed in the layer; if yes, the process proceeds to step S18.
S18: the shift amount of the position of the cursor on the frame buffer is set, the layer is shifted in accordance with the inverse number of the shift amount, and the process proceeds to step S13.
It can be understood that, because the cursor may move to the boundary of the client page during operation, and in both the cursor layer and the overlay layer, the overlay layer does not support the boundary graphic display, in order to make the cursor fully displayed, the boundary of the cursor needs to be processed to ensure that it is always displayed on the screen.
Fig. 3 is a schematic diagram of a cursor position in a frame buffer according to an embodiment of the present disclosure. The top left vertex of the cursor drawn on the frame buffer is noted as (cursor _ x, cursor _ y) to represent the position of the cursor.
Fig. 4 is a schematic diagram of a superimposed plane and a cursor position thereof according to an embodiment of the present application. As shown in FIG. 4, the length and width of the superimposed planar rectangle are denoted as H and W, the length and width of the cursor graphic are denoted as crtc _ W and crtc _ H, and the distance from the vertex at the upper left corner of the cursor graphic to the boundary of the rectangle is denoted as crtc _ x and crtc _ y. For step S17, it is first necessary to determine whether the cursor is completely 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 completely displayed on the overlay plane and cannot be submitted to the CRTC. The process proceeds to step S18, and an offset is first set to the cursor pattern on the frame buffer. The vertex at the upper left corner of the cursor graph after the deviation is marked as (cursor _ x-W, cursor _ y-H), W and H are variables obtained by calculating the position on the superimposed plane, wherein W is crtc _ W + crtc _ x-W, and H is crtc _ H + crtc _ y-H. And then binding the shifted cursor graph with the superimposed plane, shifting the superimposed plane (-w, -h) when the cursor graph is submitted to the CRTC, and ensuring the complete display of the cursor at the edge.
In this embodiment, an offset is set for a cursor position on the frame buffer, and the layer is offset according to an inverse number of the offset, so that the cursor drawn on the layer is completely displayed at the edge, and then the layer is bound with the main layer, so that the cursor is completely displayed on the image.
As shown in fig. 2, in order to enable real-time display of the cursor, after step S14, the method further includes:
returning to step S10 according to the preset time period.
It is understood that the step of drawing or displaying the cursor in the above embodiments is only a cursor at one time. In the actual use of the cloud game, the position of the mouse is constantly changed, and the shape corresponding to the position of the cursor in the client is changed. Therefore, in order to display the cursor on the client in real time, after the step S14, the process returns to the step S10 according to the preset time period, i.e., the cursor is drawn again within the preset time after one complete cursor drawing.
It should be noted that, the specific size of the preset time period is not limited in this embodiment, and it can be understood that the shorter the time period is, the closer the drawing of the cursor on the client is to real time, which depends on the specific implementation situation.
In the embodiment, after the main layer and the CRTC are bound, the step of returning and receiving the cursor information sent by the host end according to the preset time is realized, and the real-time drawing and displaying of the cursor at the client end are realized.
In the above embodiments, the Linux-based cursor drawing method is described in detail, and the present application also provides embodiments corresponding to the Linux-based cursor drawing device. It should be noted that the present application describes the embodiments of the apparatus portion from two perspectives, one is based on the functional module, and the other is based on the hardware structure.
Fig. 5 is a schematic structural diagram of a Linux-based cursor drawing device according to an embodiment of the present application, where the Linux-based cursor drawing device includes:
the receiving module 10 is configured to receive cursor information sent by a host to determine a type of a cursor, where the cursor information includes a shape of the cursor and a position of the cursor.
The first drawing module 11 is configured to draw a cursor to the frame buffer.
The first binding module 12 is configured to bind, according to the type of the cursor, the frame buffer where the cursor is located to the corresponding layer.
And the second drawing module 13 is configured to draw a cursor to the map layer.
And the superposition module 14 is used for superposing the layer to the main layer.
And a second binding module 15, configured to bind the main layer with the CRTC, so that the CRTC outputs and displays the content on the main layer.
Since the embodiments of the apparatus portion and the method portion correspond to each other, please refer to the description of the embodiments of the method portion for the embodiments of the apparatus portion, which is not repeated here.
Fig. 6 is a schematic structural diagram of another Linux-based cursor drawing device according to an embodiment of the present application, and as shown in fig. 6, the Linux-based cursor drawing device includes:
a memory 20 for storing a computer program.
A processor 21 for implementing the steps of the method for Linux based cursor rendering as mentioned in the above embodiments when executing the computer program.
The Linux-based cursor drawing device provided by the embodiment may include, but is not limited to, a smart phone, a tablet computer, a notebook computer, a desktop computer, or the like.
The processor 21 may include one or more processing cores, such as a 4-core processor, an 8-core processor, and the like. The processor 21 may be implemented in at least one hardware form of a DSP (Digital Signal Processing), an FPGA (Field-Programmable Gate Array), and a PLA (Programmable Logic Array). The processor 21 may also include a main processor and a coprocessor, where the main processor is a processor for Processing data in an awake state, and is also called a Central Processing Unit (CPU); a coprocessor is a low power processor for processing data in a 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 required to be displayed on the display screen. In some embodiments, the processor 21 may further include an AI (Artificial Intelligence) processor for processing a calculation operation related to machine learning.
The memory 20 may include one or more computer-readable storage media, which may be non-transitory. Memory 20 may also include high speed random access memory, as well as non-volatile memory, such as one or more magnetic disk storage devices, flash memory storage devices. In this embodiment, the memory 20 is at least used for storing the following computer program 201, wherein after being loaded and executed by the processor 21, the computer program can implement the relevant steps of the Linux-based cursor drawing method disclosed in any one of the foregoing embodiments. In addition, the resources stored in the memory 20 may also include an operating system 202, data 203, and the like, and the storage manner may be a transient storage manner or a permanent storage manner. Operating system 202 may include, among others, Windows, Unix, Linux, and the like. Data 203 may include, but is not limited to, data involved in Linux-based cursor rendering methods.
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.
Those skilled in the art will appreciate that the configuration shown in FIG. 6 does not constitute a limitation of Linux-based cursor drawing devices, and may include more or fewer components than those shown.
Finally, the application also provides a corresponding embodiment of the computer readable storage medium. The computer-readable storage medium has stored thereon a computer program which, when being executed by a processor, carries out the steps as set forth in the above-mentioned method embodiments.
It is to be understood that if the method in the above embodiments is implemented in the form of software functional units and sold or used as a stand-alone product, it can be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the present application may be embodied in the form of a software product, which is stored in a storage medium and executes all or part of the steps of the methods described in the embodiments of the present application, or all or part of the technical solutions. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
The method, the device and the medium for drawing the cursor based on Linux provided by the present application are described in detail above. The embodiments are described in a progressive manner in the specification, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other. The device disclosed by the embodiment corresponds to the method disclosed by the embodiment, so that the description is simple, and the relevant points can be referred to the method part for description. It should be noted that, for those skilled in the art, it is possible to make several improvements and modifications to the present application without departing from the principle of the present application, and such improvements and modifications also fall within the scope of the claims of the present application.
It is further noted that, in the present specification, relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
Claims (9)
1. A cursor drawing method based on Linux is characterized by comprising the following steps:
receiving cursor information sent by a host computer end to determine the type of the cursor, wherein the cursor information comprises the shape of the cursor and the position of the cursor;
drawing the cursor to a frame buffer;
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;
superposing the layer to a main layer;
and binding the main image layer with the CRTC to be used for the CRTC to output and display the content on the main image layer.
2. The Linux-based cursor drawing method of claim 1, wherein before receiving the cursor information sent by the host, the method further comprises:
acquiring mouse information of a mouse; the mouse information comprises movement information and click information of the mouse;
and sending the mouse information to the host end so that the host end can determine and return the cursor information according to the mouse information.
3. The Linux-based cursor rendering method of claim 1, wherein the determining the type of the cursor comprises:
judging whether the color of the cursor is a single color or not;
if so, determining that the cursor is a monochromatic cursor;
if not, determining that the cursor is a multicolor cursor.
4. The Linux-based cursor drawing method of claim 3, wherein the buffering and binding the frame where the cursor is located to the corresponding layer according to the type of the cursor comprises:
when the cursor is determined to be a monochromatic cursor, buffering and binding a frame where the monochromatic cursor is located to the cursor layer;
and when the cursor is determined to be a multi-color cursor, buffering and binding the frame where the multi-color cursor is located to the superposition layer.
5. The Linux-based cursor drawing method of claim 4, further comprising, after drawing the cursor to the layer:
judging whether the cursor is completely displayed in the layer or not;
if so, setting the offset of the position of the cursor on the frame buffer, offsetting the layer according to the opposite number of the offset, and entering the step of superposing the layer to a main layer.
6. A Linux-based cursor rendering method as in any one of claims 1-5, further comprising, after the binding the primary layer with the CRTC:
and returning to the step of receiving the cursor information sent by the host end according to a preset time period.
7. A Linux-based cursor drawing device, comprising:
the receiving module is used for receiving cursor information sent by the host end so as to determine the type of the cursor, wherein the cursor information comprises the shape of the cursor and the position of the cursor;
a first drawing module for drawing the cursor to a frame buffer;
the first binding module is used for binding the frame buffer where the cursor is located to the corresponding layer according to the type of the cursor;
the second drawing module is used for drawing the cursor to the image layer;
the superposition module is used for superposing the layer to the main layer;
and the second binding module is used for binding the main image layer with the CRTC, so that the CRTC outputs and displays the content on the main image layer.
8. A Linux-based cursor drawing device, comprising:
a memory for storing a computer program;
a processor for implementing the steps of the Linux based cursor rendering method of any one of claims 1 to 6 when executing the computer program.
9. A computer-readable storage medium, characterized in that the computer-readable storage medium has stored thereon a computer program which, when being executed by a processor, carries out the steps of the Linux-based cursor rendering method as defined in any one of claims 1 to 6.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111574807.2A CN114265528A (en) | 2021-12-21 | 2021-12-21 | Linux-based cursor drawing method, device and medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111574807.2A CN114265528A (en) | 2021-12-21 | 2021-12-21 | Linux-based cursor drawing method, device and medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN114265528A true CN114265528A (en) | 2022-04-01 |
Family
ID=80828418
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202111574807.2A Pending CN114265528A (en) | 2021-12-21 | 2021-12-21 | Linux-based cursor drawing method, device and medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114265528A (en) |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20140002361A1 (en) * | 2012-06-28 | 2014-01-02 | Lee E. Ballard | Systems and methods for remote mouse pointer management |
CN104471526A (en) * | 2012-07-16 | 2015-03-25 | 微软公司 | Implementing previously rendered frame buffer information in a customized gui display |
CN113082703A (en) * | 2021-04-23 | 2021-07-09 | 杭州雾联科技有限公司 | Cursor display method, device and medium |
CN113741744A (en) * | 2021-02-04 | 2021-12-03 | 上海达龙信息科技有限公司 | Cursor display method, device, medium and electronic equipment based on remote desktop |
-
2021
- 2021-12-21 CN CN202111574807.2A patent/CN114265528A/en active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20140002361A1 (en) * | 2012-06-28 | 2014-01-02 | Lee E. Ballard | Systems and methods for remote mouse pointer management |
CN104471526A (en) * | 2012-07-16 | 2015-03-25 | 微软公司 | Implementing previously rendered frame buffer information in a customized gui display |
CN113741744A (en) * | 2021-02-04 | 2021-12-03 | 上海达龙信息科技有限公司 | Cursor display method, device, medium and electronic equipment based on remote desktop |
CN113082703A (en) * | 2021-04-23 | 2021-07-09 | 杭州雾联科技有限公司 | Cursor display method, device and medium |
Non-Patent Citations (2)
Title |
---|
ILIJA HADˇ ZI´ C ETAL.: "Building Media-Rich Cloud Services from Network-Attached I/O Devices", 2016 IEEE 4TH INTERNATIONAL CONFERENCE ON FUTURE INTERNET OF THINGS AND CLOUD, 26 September 2016 (2016-09-26), pages 41 - 49 * |
佚名: "LInux DRM Developer Guide && Linux GPU Driver Developer’s Guide", Retrieved from the Internet <URL:https://blog.csdn.net/eydwyz/article/details/105729403> * |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110458918B (en) | Method and device for outputting information | |
CN110058685B (en) | Virtual object display method and device, electronic equipment and computer-readable storage medium | |
CN109636885B (en) | Sequential frame animation production method and system for H5 page | |
CN111752557A (en) | Display method and device | |
CN112100795B (en) | Computer aided design drawing comparison method and device | |
US20190325562A1 (en) | Window rendering method and terminal | |
US11561637B2 (en) | Method and device of drawing handwriting track, electronic apparatus, medium, and program product | |
CN111459501A (en) | SVG-based Web configuration picture storage and display system, method and medium | |
CN107203434A (en) | A kind of texture shared method, device and computer-readable recording medium | |
CN115439609B (en) | Three-dimensional model rendering method, system, equipment and medium based on map service | |
WO2023197762A1 (en) | Image rendering method and apparatus, electronic device, computer-readable storage medium, and computer program product | |
JP2023533108A (en) | Method, apparatus, device and storage medium for generating road labels | |
WO2024037556A1 (en) | Image processing method and apparatus, and device and storage medium | |
CN110782504B (en) | Method, apparatus, computer-readable storage medium and device for simulating writing trace | |
US10403040B2 (en) | Vector graphics rendering techniques | |
CN114049403A (en) | Multi-angle three-dimensional face reconstruction method and device and storage medium | |
CN107621951B (en) | View level optimization method and device | |
US10542176B2 (en) | Enhancing graph visualization with supplemental data | |
CN109710122B (en) | Method and device for displaying information | |
CN110825989B (en) | Picture display method and device, electronic equipment and readable medium | |
CN114265528A (en) | Linux-based cursor drawing method, device and medium | |
CN115391692A (en) | Video processing method and device | |
US11017505B2 (en) | System and method for applying antialiasing to images | |
CN113888684A (en) | Method and apparatus for graphics rendering and computer storage medium | |
CN114489910A (en) | Video conference data display method, device, equipment and medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |