Efficiency optimization method based on Glamor acceleration

By establishing a whitelist of application names and dynamically managing drawing data, selecting the appropriate drawing method (Glamor or software drawing) to improve efficiency, it solves the problem of Glamor's high resource consumption during simple 2D operations, and achieves efficient and low-latency graphics rendering.

CN119963397AActive Publication Date: 2025-05-09WUHAN LINGJIU MICROELECTRONICS CO LTD
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202510026872.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-08
Publication Date
2025-05-09
Estimated Expiration
2045-01-08

AI Technical Summary

Technical Problem

When Glamor handles simple 2D operations, it needs to allocate additional video memory and memory, resulting in greater resource consumption and affects efficiency.

Method used

By establishing a whitelist of application names, select the drawing method according to the application name and resource characteristics, and perform Glamor drawing for applications that meet the conditions. Otherwise, software drawing is used to dynamically manage the drawing data to reduce duplicate operations.

Benefits of technology

It improves drawing efficiency, shortens response time, avoids the overhead of Glamor drawing, improves the performance and user experience of the system, and adapts to the needs of modern applications for high-performance graphics processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119963397A_ABST
    Figure CN119963397A_ABST
Patent Text Reader

Abstract

The invention discloses an efficiency optimization method based on Glamor acceleration, which relates to the technical field of computer graphics, determines a drawing mode of an application by constructing an application name white list, and adopts Glamor drawing for applications which do not accord with the application name white list so as to make full use of the acceleration capability of a GPU (Graphics Processing Unit). For applications conforming to the application name white list, a drawing mode is judged through application resources, whether software drawing is adopted or not is comprehensively evaluated through a preset threshold value, meanwhile, a Glamor data storage area is constructed by the system, dynamic management of drawing data is achieved, and the storage area is used for storing historical drawing data and conducting retrieval and comparison in subsequent drawing requests; through a drawing mode selection mechanism of the application name white list, an application resource judgment mechanism and a drawing data dynamic management mechanism, efficient drawing processing is achieved in a complex drawing request, the overall graphic rendering performance is improved, and meanwhile effective utilization of system resources is ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of computer graphics, and in particular to an efficiency optimization method based on Glamor acceleration. Background Art

[0002] 2D graphics acceleration is an important area in computer graphics processing, mainly to improve the efficiency and performance of 2D graphics rendering. With the widespread application of graphical user interfaces and the popularity of multimedia content, the demand for graphics processing speed and quality continues to increase, and 2D graphics acceleration technology has emerged;

[0003] In Linux systems, EXA and Glamor are two common 2D graphics acceleration frameworks. EXA optimizes graphics operations by providing acceleration primitives, while Glamor uses OpenGL to accelerate 2D graphics operations and implements hardware acceleration through a unified OpenGL interface. The application of these technologies has significantly improved the performance and user experience of modern graphical interfaces.

[0004] EXA and Glamor are two 2D graphics acceleration architectures, each with its own advantages and disadvantages. EXA is more traditional and focuses on optimizing specific 2D operations, while Glamor uses OpenGL to provide more general and powerful acceleration capabilities. However, for simple 2D operations such as text drawing and small graphic filling, Glamor needs to allocate additional video memory and memory to store buffers, textures, and perform OpenGL operations, which consumes more resources. Therefore, it is of great practical significance to develop an efficiency optimization method based on Glamor acceleration. Summary of the invention

[0005] The purpose of the present invention is to provide an efficiency optimization method based on Glamor acceleration to solve the shortcomings of the background technology.

[0006] In order to achieve the above object, the present invention provides the following technical solution: an efficiency optimization method based on Glamor acceleration, comprising:

[0007] Create an application name whitelist. When the system receives a drawing request, it obtains the name of the application that issued the drawing request and selects a drawing method based on the application name whitelist.

[0008] When the application name matches the application name whitelist, the application resources are judged to obtain the drawing method;

[0009] Perform Glamor drawing operations on applications that meet the requirements of Glamor drawing and dynamically manage drawing data;

[0010] Perform software drawing operations on applications that meet software drawing requirements.

[0011] In a preferred embodiment, the steps of establishing an application name whitelist and obtaining the application name that issues the drawing request and selecting a drawing method by comparing the application name whitelist when the system receives a drawing request are as follows:

[0012] Create a whitelist of application names;

[0013] When the system receives a drawing request, it obtains drawing request information, and obtains the name of the application that issued the request based on the drawing request information;

[0014] Compare the application name with the application name whitelist. If the application name is in the application name whitelist, determine the drawing method through the application resources.

[0015] If the application name is not in the whitelist, Glamor drawing is performed directly.

[0016] In a preferred embodiment, when the application name matches the application name whitelist, the step of determining the application resource to obtain the drawing mode is:

[0017] First, define the preset thresholds including preset width and height thresholds, preset fill type, preset usage type, and preset color depth threshold;

[0018] The application resources are judged based on the preset threshold and the drawing method is selected.

[0019] In a preferred embodiment, the step of determining the application resource based on the preset threshold and selecting the drawing method is as follows:

[0020] Obtain application resources through drawing request information, including drawing image width and height, fill type, usage type, and color depth;

[0021] When the width and height of the drawn image are lower than the preset width and height threshold, software drawing is performed; if higher, the fill type is determined;

[0022] When the fill type meets the preset fill type threshold, software drawing is performed. If not, the usage type is judged.

[0023] When the usage type meets the preset usage type, software drawing is performed. If it does not meet the requirements, color depth judgment is performed.

[0024] When the color depth is lower than the preset color depth threshold, software rendering is performed; if higher, Glamor rendering is performed.

[0025] In a preferred embodiment, the steps of performing Glamor drawing operation on the application satisfying Glamor drawing and dynamically managing the drawing data are as follows:

[0026] Build a Glamor data storage area to store historical Glamor drawing data;

[0027] Select the Glamor drawing process by retrieving the Glamor data store.

[0028] In a preferred embodiment, the step of selecting the Glamor rendering process by searching the Glamor data storage area is:

[0029] Upon receiving the Glamor drawing request message, retrieving the Glamor data storage area;

[0030] If the Glamor data storage area contains historical Glamor drawing data, data comparison is performed;

[0031] If the Glamor drawing request information is the same as the historical Glamor drawing data, the historical Glamor drawing data is directly used to perform the Glamor drawing operation;

[0032] If they are not the same, create a Pixmap and allocate memory;

[0033] Receive Glamor drawing requests and convert them into OpenGL commands;

[0034] Bind the Pixmap texture based on the Glamor drawing request information, perform drawing operations through OpenGL instructions, and save the drawing data in the Glamor data storage area;

[0035] Image processing and compositing using OpenGL shaders.

[0036] In a preferred embodiment, the step of performing software drawing operation on the application that meets the requirements of software drawing is:

[0037] Receive software drawing request and obtain software drawing request information;

[0038] Encapsulate software drawing request information into image objects that can be operated by pixman;

[0039] Call pixman to perform 2D drawing operations on the image object;

[0040] After completing the 2D drawing operation, release the pixman image and system allocated resources.

[0041] In the above technical solution, the technical effects and advantages provided by the present invention are:

[0042] 1. The present invention effectively improves the drawing efficiency by constructing an application name whitelist and a drawing method selection mechanism based on the application name whitelist. By judging whether the requesting application is in the whitelist and combining the preset threshold, fill type and other resource characteristics to select the drawing method, the system is more accurate in processing drawing requests within a certain range. Glamor drawing is performed for qualified applications, and the parallel processing capability of the GPU is utilized to significantly shorten the drawing response time. For requests that do not meet the Glamor drawing conditions, software drawing is directly used to avoid the Glamor drawing overhead. Based on this, whether through dynamic management and real-time judgment, or through the optimization of the judgment mechanism, the drawing speed and efficiency of the technical solution have been effectively improved, which meets the needs of modern applications for high-performance graphics processing and improves the user experience.

[0043] 2. The present invention demonstrates flexible resource management capabilities by defining a dynamic management mechanism for Glamor drawing data and judging the current resource status in real time, constructing a Glamor data storage area for storing historical drawing data, and performing data comparison in subsequent drawing requests, which can effectively reduce repeated drawing operations. When the received drawing request is consistent with the historical data, the system can directly call the existing data for rendering, which not only improves performance but also saves memory and computing resources. If the data is different, the system will allocate corresponding memory according to the latest request and draw. This flexible resource management can ensure that the system still maintains a high response efficiency under high load conditions, which helps to improve the stability and durability of the entire system and meet the efficient and low-latency rendering requirements of different applications. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present invention. For ordinary technicians in this field, other drawings can also be obtained based on these drawings.

[0045] Figure 1 The figure is a flow chart of the method of the present invention. DETAILED DESCRIPTION

[0046] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0047] Example 1, please refer to Figure 1 As shown, the efficiency optimization method based on Glamor acceleration described in this embodiment includes:

[0048] S1. Establish an application name whitelist. When the system receives a drawing request, obtain the application name that issues the drawing request and select a drawing method by comparing it with the application name whitelist.

[0049] S2. When the application name matches the application name whitelist, the application resources are judged to obtain the drawing method;

[0050] S3, performing Glamor drawing operations on applications that meet the requirements of Glamor drawing and dynamically managing drawing data;

[0051] S4, performing software drawing operation on the application that meets the requirements of software drawing;

[0052] As described in the above steps S1-S4, 2D graphics acceleration is an important field in computer graphics processing, mainly to improve the efficiency and performance of 2D graphics rendering. With the widespread application of graphical user interfaces and the popularity of multimedia content, the demand for graphics processing speed and quality continues to increase, and 2D graphics acceleration technology has emerged; in Linux systems, EXA and Glamor are two common 2D graphics acceleration frameworks. EXA optimizes graphics operations by providing acceleration primitives, while Glamor uses OpenGL to accelerate 2D graphics operations and implements hardware acceleration through a unified OpenGL interface. The application of these technologies has significantly improved the performance and user experience of modern graphical interfaces; EXA and Glamor or as two 2D graphics acceleration architectures, each has its own advantages and disadvantages. EXA is more traditional and focuses on the optimization of specific 2D operations, while Glamor uses OpenGL to provide more general and powerful acceleration capabilities. However, for simple 2D operations such as text drawing and small graphic filling, Glamor needs to allocate additional video memory and memory to store buffers, textures and perform OpenGL operations, which consumes more resources. The present invention effectively improves the drawing efficiency by constructing an application name whitelist and a drawing method selection mechanism based on the application name whitelist. By judging whether the requesting application is in the whitelist and combining the preset threshold, filling type and other resource characteristics to select the drawing method, the system can be more accurate in processing drawing requests within a certain range. For applications that meet the conditions, Glamor drawing is performed, and the parallel processing capability of the GPU is utilized to significantly shorten the drawing response time. For requests that do not meet the Glamor drawing conditions, software drawing is directly used to avoid the Glamor drawing overhead. Based on this, whether through dynamic management and real-time judgment or through optimization of the judgment mechanism, the drawing speed and efficiency of the technical solution have been effectively improved, adapting to the needs of modern applications for high-performance graphics processing and improving user experience; at the same time, a dynamic management mechanism for Glamor drawing data and real-time judgment of the current resource status are defined, showing flexible resource management capabilities, and building a Glamor data storage area for storing historical drawing data. Data comparison is performed in subsequent drawing requests, which can effectively reduce repeated drawing operations. When the received drawing request is consistent with the historical data, the system can directly call the existing data for rendering, which not only improves performance, but also saves memory and computing resources. If the data is different, the system will allocate the corresponding memory according to the latest request and draw. This flexible resource management can ensure that the system still maintains a high response efficiency under high load conditions, which helps to improve the stability and durability of the entire system and meet the efficient and low-latency rendering requirements of different applications.

[0053] In one embodiment, the step S1 of establishing an application name whitelist and obtaining the application name that issues the drawing request and selecting a drawing method by comparing the application name whitelist when the system receives a drawing request includes:

[0054] S11. Create a whitelist of application names;

[0055] S12, when the system receives a drawing request, obtaining drawing request information, and obtaining the name of the application that issued the request based on the drawing request information;

[0056] S13, comparing the application name with the application name whitelist, if the application name is in the application name whitelist, determining and obtaining the drawing mode through application resources;

[0057] S14. If the application name is not in the whitelist, Glamor drawing is performed directly;

[0058] As described in the above steps S11-S14, a simple text file format or database structure is used to store the application names, for example, a CSV file or JSON format can be used, where each line or each entry represents a permitted application name, and commonly used graphic applications are collected, including but not limited to the following applications: xrandr, xsetroot, GIMP, Inkscape, LibreOfficeDraw, Firefox, Chromium, Evince, Okular, xterm, gnome-terminal, etc. When the system starts, the whitelist file is read and loaded into memory for fast query The system receives drawing requests from various applications through IPC, socket or other communication protocols, extracts key information from the drawing request, including the application name, detailed information of the drawing content such as image size, fill type, etc., compares the obtained application name with the application name whitelist previously loaded into the memory, and can use a hash table or other efficient data structure to speed up the search process. If the application name is not in the application name whitelist, Glamor drawing is directly adopted. If the application name is in the application name whitelist, other resource information is further extracted from the request, such as the requested image width, height, fill type, usage type, etc., in preparation for the next resource judgment.

[0059] In one embodiment, when the application name matches the application name whitelist, step S2 of determining the application resource to obtain the drawing mode includes:

[0060] S21, first define preset thresholds including preset width and height thresholds, preset fill type, preset usage type, and preset color depth threshold;

[0061] S22, judging the application resources based on a preset threshold and selecting a drawing method;

[0062] As described in the above steps S21-S22, a standard width and height threshold is determined to determine whether the image of the drawing request is suitable for software drawing. For example, the width and height thresholds can be set to 32 pixels. The threshold should be adjusted according to the actual application scenario and test to ensure the best performance under different device configurations. A list of fill types that support software drawing is defined, such as FillTiled, FillStippled, or FillOpaqueStippled, and these three types are more efficient when using software drawing. Request types suitable for software drawing are listed, such as GLAMOR_CREATE_PIXMAP_CPU, CREATE_PIXMAP_USAGE_GLYPH_PICTURE, and CREATE_PIXMAP_USAGE_SHARED, and these three types are more efficient when using software drawing. An acceptable color depth threshold is specified. If the color depth is less than or equal to this threshold, software drawing is selected. The threshold should be adjusted according to the actual application scenario and test.

[0063] In one embodiment, the step S22 of determining the application resource based on a preset threshold and selecting a drawing method includes:

[0064] S221, obtaining application resources including drawing image width and height, fill type, usage type and color depth through drawing request information;

[0065] S222, when the width and height of the drawn image are lower than the preset width and height threshold, software drawing is performed; if higher, the fill type is determined;

[0066] S223, when the fill type meets the preset fill type threshold, software drawing is performed, if not, usage type determination is performed;

[0067] S224, when the usage type meets the preset usage type, software drawing is performed, if not, color depth determination is performed;

[0068] S225, when the color depth is lower than the preset color depth threshold, software rendering is performed; if higher, Glamor rendering is performed;

[0069] As described in the above steps S221-S225, the system extracts drawing request information from the received drawing request, which usually includes but is not limited to the width of the drawing image, in pixels, the height of the drawing image, in pixels, the definition of the current fill type such as fill color, pattern, etc., the usage type of the current request such as Glamor related creation, sharing, etc. and the color depth of the drawing image, usually in bits, indicating the number of bits per pixel, and then uses the conditional judgment to test the width and height of the image. If the image width and height are both less than or equal to the preset threshold, software drawing is selected. If any dimension exceeds the preset value, it goes to the next judgment step to check the fill type and check whether the fill type of the current request meets the preset conditions. If the fill type meets the conditions of software drawing, the CPU is occupied for drawing to avoid the additional overhead of using Glamor. If it does not meet the conditions, the system will proceed to the next step. The usage type judgment is to determine whether the usage type in the request meets the preset conditions. If the usage type meets the conditions, software drawing is selected. Otherwise, the color depth is continued to be checked to ensure the quality and performance of the drawing. It is determined whether the color depth in the request is lower than the preset depth threshold. If the color depth is less than or equal to the preset threshold, software drawing is selected to improve performance and reduce resource consumption. If the color depth is higher, Glamor drawing is switched to hand over the drawing task to the GPU for processing to achieve higher rendering quality. Based on this, through the careful design of the above steps, the system can flexibly determine which drawing method to use according to the characteristics of different application resources and the preset thresholds. This condition-based selection mechanism ensures efficient decision-making in various drawing requests, so that the system can flexibly adapt to different application requirements on the basis of ensuring performance, thereby achieving the best user experience.

[0070] In one embodiment, the step S3 of performing Glamor rendering operation on the application meeting the Glamor rendering requirement and dynamically managing the rendering data includes:

[0071] S31, constructing a Glamor data storage area for storing historical Glamor drawing data;

[0072] S32, selecting a Glamor rendering process by searching the Glamor data storage area;

[0073] As described in the above steps S31-S32, define the structure and type of the data storage area, and select an appropriate data structure such as a hash table, mapping or database system to store historical Glamor drawing data. The data structure should be selected according to the access frequency and data volume of the application to optimize the search and storage performance. At the same time, each historical Glamor drawing data should contain key drawing information, including the application name: indicating which application the drawing request comes from, the parameters of the drawing request: such as the width and height of the image, the fill type and the usage type, etc., the drawing data: save the texture or buffer data generated by the drawing operation, and the timestamp: record the time of the drawing request for subsequent management and cleaning. When the system starts, instantiate the Glamor data storage area, and read possible previous drawing data for initialization. Implement a periodic saving mechanism to persist the drawing data to the disk or database to prevent data from being lost when the system crashes or restarts. At the same time, design a dynamic management strategy to regularly clean up expired or no longer used drawing data, such as using an LRU algorithm to decide which objects to delete to maintain the efficiency of the storage area, and select the Glamor drawing process based on the data in the Glamor data storage area.

[0074] In one embodiment, the step S32 of selecting the Glamor rendering process by searching the Glamor data storage area includes:

[0075] S321, when receiving Glamor drawing request information, searching Glamor data storage area;

[0076] S322, if the Glamor data storage area contains historical Glamor drawing data, then perform data comparison;

[0077] S323, if the Glamor drawing request information is the same as the historical Glamor drawing data, directly use the historical Glamor drawing data to perform the Glamor drawing operation;

[0078] S324, if they are not the same, create a Pixmap and allocate memory;

[0079] S325, receiving a Glamor drawing request and converting it into an OpenGL command;

[0080] S326, binding the Pixmap texture based on the Glamor drawing request information, performing drawing operations through OpenGL instructions, and saving the drawing data in the Glamor data storage area;

[0081] S327, image processing and synthesis using OpenGL shaders;

[0082] As described in the above steps S321-S327, the system receives Glamor drawing requests from applications in real time through an internal message queue or IPC mechanism. The request should contain all parameters required for drawing, such as application name, image specifications, fill type, and color depth. After receiving the request, the system quickly accesses the Glamor data storage area, and searches for the corresponding historical drawing data through the application name and drawing parameters in the request. The system checks whether the Glamor data storage area contains historical drawing data. If there is no historical data, there is no need to compare, and the system directly turns to the step of creating new data. If the historical data exists, the system extracts the corresponding parameters such as image size, fill type, usage type, and color depth and compares them with the relevant parameters of the drawing request. If the data of the drawing request is exactly the same as the historical Glamor data in the storage area, the historical drawing data is directly used for Glamor drawing operations to avoid repeated processing. At the same time, the display content is updated to ensure that the user sees the immediate rendering results. If the historical data is different from the current drawing request, the system creates a new Pixmap object, allocates an appropriate amount of memory through system calls to meet the image specifications defined in the drawing request, and converts the received Glamor drawing request into commands that OpenGL can understand, such as setting the canvas, primitive type, fill status and other related OpenGL states, binding the newly created Pixmap to the texture in the current OpenGL context, using the incoming drawing request information to draw the image, executing the OpenGL drawing command, performing specific drawing operations through the OpenGL command, and displaying the results to the screen. After the drawing is completed, the data of this execution result must be saved to the Glamor data storage area for use in the next same request. Then, OpenGL's shader is used to perform additional image processing and synthesis operations, such as color conversion, texture mapping, post-effects, etc., which can flexibly respond to different special effect requirements. Complex effects can be achieved by setting appropriate shader programs and executing steps such as set uniforms. Finally, ensure that the processed image is correctly rendered in the user interface, and finally output the result to enhance the user's application experience.

[0083] In one embodiment, the step S4 of performing software drawing operation on the application meeting the software drawing requirement includes:

[0084] S41, receiving a software drawing request and obtaining software drawing request information;

[0085] S42, encapsulating the software drawing request information into an image object operable by pixman;

[0086] S43, calling pixman to perform 2D drawing operations on the image object;

[0087] S44, after completing the 2D drawing operation, releasing the pixman image and system allocated resources;

[0088] As described in the above steps S41-S44, the software drawing request information including the image width, height, fill color, image format and drawing type is obtained, and then a new Pixman image object is created using the API of the Pixman library to provide a basic structure for subsequent drawing operations. At the same time, the relevant properties of the Pixman image object are set according to the fill color and type in the request. After the setting is completed, the Pixman API is called to perform 2D drawing operations on the created image object. According to the drawing type used, such as Solid, Tiled, etc., the corresponding Pixman drawing operation method is called. According to the drawing result, the image data in the Pixman image object is updated to achieve the desired visual effect. When the 2D drawing operation is completed, necessary cleanup work is performed. The Pixman image object and related allocated resources are released to prevent memory leaks. If memory is allocated for other operations during the drawing process, ensure that it is also released accordingly. Finally, the drawing completion information is returned to the original requesting application to inform it that the drawing operation has been successfully completed, and the image data can be passed back to the application, or the application display content can be updated to ensure that the user can see the final effect.

[0089] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. An efficiency optimization method based on Glamor acceleration, characterized in that: Create an application name whitelist. When the system receives a drawing request, it obtains the name of the application that issued the drawing request and selects a drawing method based on the application name whitelist. When the application name matches the application name whitelist, the application resources are judged to obtain the drawing method; Perform Glamor drawing operations on applications that meet the requirements of Glamor drawing and dynamically manage drawing data; Perform software drawing operations on applications that meet software drawing requirements.

2. The efficiency optimization method based on Glamor acceleration according to claim 1, characterized in that: The steps of establishing an application name whitelist and obtaining the application name that issues the drawing request and selecting a drawing method by comparing the application name whitelist when the system receives a drawing request are as follows: Create a whitelist of application names; When the system receives a drawing request, it obtains drawing request information, and obtains the name of the application that issued the request based on the drawing request information; Compare the application name with the application name whitelist. If the application name is in the application name whitelist, determine the drawing method through the application resources. If the application name is not in the whitelist, Glamor drawing is performed directly.

3. The efficiency optimization method based on Glamor acceleration according to claim 1, characterized in that: When the application name matches the application name whitelist, the steps of determining the application resources and obtaining the drawing method are as follows: First, define the preset thresholds including preset width and height thresholds, preset fill type, preset usage type, and preset color depth threshold; The application resources are judged based on the preset threshold and the drawing method is selected.

4. The efficiency optimization method based on Glamor acceleration according to claim 3, characterized in that: The step of determining the application resources based on the preset threshold and selecting the drawing method is as follows: Obtain application resources through drawing request information, including drawing image width and height, fill type, usage type, and color depth; When the width and height of the drawn image are lower than the preset width and height threshold, software drawing is performed; if higher, the fill type is determined; When the fill type meets the preset fill type threshold, software drawing is performed. If not, the usage type is judged. When the usage type meets the preset usage type, software drawing is performed. If it does not meet the requirements, color depth judgment is performed. When the color depth is lower than the preset color depth threshold, software rendering is performed; if higher, Glamor rendering is performed.

5. The efficiency optimization method based on Glamor acceleration according to claim 1, characterized in that: The steps of performing Glamor drawing operation on the application that meets the Glamor drawing requirements and dynamically managing the drawing data are as follows: Build a Glamor data storage area to store historical Glamor drawing data; Select the Glamor drawing process by retrieving the Glamor data store.

6. The efficiency optimization method based on Glamor acceleration according to claim 5, characterized in that: The steps of selecting the Glamor drawing process by retrieving the Glamor data storage area are: Upon receiving the Glamor drawing request message, retrieving the Glamor data storage area; If the Glamor data storage area contains historical Glamor drawing data, data comparison is performed; If the Glamor drawing request information is the same as the historical Glamor drawing data, the historical Glamor drawing data is directly used to perform the Glamor drawing operation; If they are not the same, create a Pixmap and allocate memory; Receive Glamor drawing requests and convert them into OpenGL commands; Bind the Pixmap texture based on the Glamor drawing request information, perform drawing operations through OpenGL instructions, and save the drawing data in the Glamor data storage area; Image processing and compositing using OpenGL shaders.

7. The efficiency optimization method based on Glamor acceleration according to claim 1, characterized in that: The steps of performing software drawing operation on the application that meets the requirements of software drawing are as follows: Receive software drawing request and obtain software drawing request information; Encapsulate software drawing request information into image objects that can be operated by pixman; Call pixman to perform 2D drawing operations on the image object; After completing the 2D drawing operation, release the pixman image and system allocated resources.

Citation Information

Patent Citations

  • System for providing transparent access to hardware graphic layers

    CA2516881A1

  • Android display system software drawing and hardware drawing dynamic switching method

    CN104731653A

  • GLES image rendering method and device, storage medium and computer equipment

    CN112200712A

  • Rendering operation method and system based on OpenGL instruction

    CN113256779A

  • Rendering task processing method and device

    CN115237599A