General implementation method and system for geometric special effect in Wayland environment

By providing a general implementation method in the Wayland environment, unified management and rendering of geometric effects, the problems of repeated construction and insufficient performance caused by independent implementation of special effects in the existing technology are solved, and more efficient and scalable special effects development is achieved.

CN120107443AActive Publication Date: 2025-06-06KYLIN CORP

Patent Information

Application Number
CN202510578951.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-07
Publication Date
2025-06-06
Estimated Expiration
2045-05-07

AI Technical Summary

Technical Problem

Geometric effects in the existing Wayland environment are implemented independently, resulting in repeated construction of elements, repeated operations, poor scalability and insufficient performance.

Method used

Provides a general implementation method for geometric special effects in Wayland environment, and realizes unified management and rendering of geometric special effects by creating a general configuration structure, geometric transformed transform structure, animation curves, thumbnails and registration of general interfaces.

Benefits of technology

It realizes integrated development of geometric special effects, reduces repetitive operations, improves scalability and performance, and improves special effects development efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120107443A_ABST
    Figure CN120107443A_ABST
Patent Text Reader

Abstract

The invention discloses a general implementation method and system for a geometric special effect in a Wayland environment, and the method comprises the steps: creating a structural body, registering an interface for the current geometric special effect, and filling and configuring parameters in the structural body; a transform structural body is created; creating an animation curve; generating a thumbnail; the current geometric special effect is attached to a node used for representing the display content in the Wayland environment; starting a pre-stage trigger hook function in the current geometric special effect registration interface, starting timing through the hook function, and resetting parameters according to the parameter state in the configuration structure body of the current geometric special effect; and executing rendering and submitting of the geometric special effect until timeout. The objective of the invention is to solve the problems of repeated element construction, many repeated operations, poor expandability and insufficient performance between geometric special effects caused by independent implementation of geometric special effects in a Wayland environment in the prior art.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of desktop rendering under Linux system, and in particular to a general implementation method and system of geometric special effects under Wayland environment. Background Art

[0002] Wayland is an open source project that aims to create a new display server architecture under Linux. The goal of Wayland is to replace X and provide a simple, efficient, lightweight display server architecture that meets the requirements of modern desktops. An important feature of modern desktops is window synthesis. Wayland communicates directly with applications and video hardware through the compositor and forwards events to them. In this process, the application renders graphics into the application's buffer, and then the compositor, or display server, synthesizes these graphics and displays them on the screen (that is, the application's window).

[0003] Currently, the zoom effects, drawer effects, fade-in and fade-out effects, etc. in the Wayland environment involve changes in the three elements of alpha (transparency), position, and angle. Each effect is implemented separately, and there is no linkage between the effects. Therefore, how to provide a universal implementation of geometric effects in the Wayland environment to reduce the repetitive operations of geometric effects development in the Wayland environment and improve scalability and performance has become a key technical issue that needs to be solved urgently. Summary of the invention

[0004] Technical problem to be solved by the present invention: In view of the above-mentioned problems in the prior art, a general implementation method and system for geometric special effects in a Wayland environment are provided. The present invention aims to solve the problems of repeated construction of elements, multiple repeated operations, poor scalability and insufficient performance among various geometric special effects caused by the independent implementation of geometric special effects in the existing Wayland environment.

[0005] In order to solve the above technical problems, the technical solution adopted by the present invention is: A general method for implementing geometric effects in a Wayland environment comprises the following steps: S1, create a general configuration structure to store the information of the current geometric effect, register a general interface for the current geometric effect and specify the corresponding hook function. The implementation of the hook function corresponding to different geometric effects is different. Fill the parameters in the general configuration structure according to the properties of the current geometric effect. The properties of the geometric effect include the effect priority. S2, create a transform structure to describe the geometric transformation of the current geometric effect; S3, creating the animation curve of the current geometric effect; S4, generating a thumbnail required by the current geometric effect; S5, attaching the current geometric effect to the node used to represent the display content in the Wayland environment; S6, based on the effect priority, calling the general interface registered for the current geometric effect to complete the rendering output of the current geometric effect and reclaiming resources after the rendering is completed.

[0006] Optionally, the universal interfaces registered in step S1 include: a pre-stage interface frame_render_pre, a window boundary interface entity_bounding_box, a node rendering interface node_render, a push damage area interface node_push_damage, a post-processing interface frame_render_post, and a special effect destruction interface entity_destroy; step S6 includes: S6.1, based on the special effect priority triggering registered pre-stage interface frame_render_pre, start timing through the hook function corresponding to the pre-stage interface frame_render_pre, and adjust and reset parameters according to the parameter status in the configuration structure of the current geometric special effect; S6.2, calculate the real-time position, real-time transparency and damage area according to the animation curve and push them as the damage area that needs to be re-rendered, and obtain the effect size of the node used to represent the display content in the current geometric effect attached to the Wayland environment through the hook function corresponding to the registered window boundary interface entity_bounding_box; S6.3, rendering the thumbnail to the real-time position through the registered node rendering interface node_render, performing geometric transformation along the animation curve through the transform structure and rendering it to the calculated real-time position; S6.4, pushes the damage area to the parent node through the registered push damage area interface node_push_damage and corrects the damage area through the post-processing interface frame_render_post, and the hook function of the pre-stage interface frame_render_pre detects whether the timing time has timed out. If the timing time has timed out, the current geometric special effect is ended, and the resources of the current geometric special effect are recovered through the registered special effect destruction interface entity_destroy.

[0007] Optionally, the current geometric special effect is a maximum-minimum scaling special effect, and the maximum-minimum scaling special effect is maximization, maximum-restore, minimization or minimum-restore of the application window. The above-mentioned maximum-minimum scaling special effect is the window scaling change process formed after the initial application window is superimposed with the size scaling special effect. Step S1 includes: S1.1A, registering a hook function for updating parameters of the maximum-minimum scaling special effect and a hook function for calculating the rendering position; S1.2A, creating an entity structure of the maximum-minimum scaling special effect, which defines a data structure to store configuration information of the maximum-minimum scaling special effect; S1.3A, setting the special effect curve of the maximum-minimum scaling special effect and calculating the position; S1.4A, filling the parameters in the configuration structure according to the properties of the maximum-minimum scaling special effect.

[0008] Optionally, the current geometric special effect is a fade-in or fade-out special effect of the application window, and the above special effect is the process of changing the transparency and position of the window after superimposing the special effects of transparency change and position change on the initial application window; step S1 includes: S1.1B, registering a hook function for updating parameters of the fade-in and fade-out special effect and a hook function for calculating the rendering position; S1.2B, creating an entity structure of the fade-in and fade-out special effect, which defines a data structure to store configuration information of the fade-in and fade-out special effect; S1.3B, setting the transparency change curve and position change curve of the fade-in and fade-out special effect; S1.4B, setting the start time, the special effect duration period, the start and end transparencies, calculating the start and end positions, and filling the parameters in the configuration structure according to the properties of the fade-in and fade-out special effect.

[0009] Optionally, the current geometric special effect is a drawer special effect of the application window, and the above special effect is the changing process of window translation motion and transparency adjustment formed after the initial application window is superimposed with translation motion and transparency special effects; step S1 includes: S1.1C, registering a hook function for updating drawer special effect parameters and a hook function for calculating rendering position; S1.2C, creating an entity structure of the drawer special effect, which defines a data structure to store configuration information of the drawer special effect operation; S1.3C, setting the transparency curve and position curve of the drawer special effect; S1.4C, filling in the parameters in the configuration structure according to the properties of the drawer special effect.

[0010] Optionally, the real-time position calculated and rendered in step S6 refers to a position calculated according to the special effect time by animator_value function.

[0011] Optionally, the expression of the transform structure created in step S2 for describing the geometric transformation of the current geometric effect is: struct transform_effect { Struct effect effect; const struct transform_effect_interface impl; struct effect_manager manager; struct wlr_renderer renderer; bool is_opengl_renderer; struct wl_listener enable; struct wl_listener disable; struct wl_listener destroy; void user_data; int priority; }; Among them, struct effect effect is a pointer to the special effect structure effect, which is the base class of the special effect interface in the Wayland environment; const struct transform_effect_interface impl is a pointer to a transform_effect_interface structure, which defines the specific implementation interface of the transformation effect. The impl pointer is used to specify the corresponding dynamic algorithm; struct effect_manager manager is a pointer to an effect_manager structure, which is responsible for creating, destroying and managing the life cycle of special effects; struct wlr_renderer renderer is a pointer to a wlr_renderer structure, where the wlr_renderer structure is a renderer interface of Wayland and the rendering backend of the renderer; bool is_opengl_renderer is a Boolean value, indicating whether the current renderer supports the OpenGL backend; struct wl_listener enable is a wl_listener structure, which is used to listen for enable events. When the transform effect is enabled, the wl_listener structure will trigger a callback function to notify the transform_effect structure to perform corresponding initialization or update operations; struct wl_listener disable is a wl_listener structure, which is used to listen for disable events. When the transform effect is disabled, the wl_listener structure will trigger a callback function to notify the transform_effect structure to perform corresponding cleanup or update operations; struct wl_listener destroy is a wl_listener structure, which is used to listen for destroy events. When the transform effect is destroyed, the wl_listener structure will trigger a callback function to notify transform_effect to release resources or perform other necessary cleanup operations; void user_data is a pointer to user-defined data, which is used for users to store custom data related to transformation effects; int priority is the special effect priority.

[0012] In addition, this embodiment also provides a general implementation system of geometric special effects in the Wayland environment, including a microprocessor and a memory connected to each other, and the microprocessor is programmed or configured to execute the general implementation method of geometric special effects in the Wayland environment.

[0013] In addition, this embodiment also provides a computer-readable storage medium, in which a computer program or instruction is stored. The computer program or instruction is programmed or configured to execute a general implementation method of geometric special effects in the Wayland environment through a processor.

[0014] In addition, this embodiment also provides a computer program product, including a computer program or instructions, which are programmed or configured to execute the general implementation method of geometric special effects in the Wayland environment through a processor.

[0015] Compared with the prior art, the present invention can mainly achieve the following beneficial effects: 1. The present invention breaks through the paradigm of traditional independent development of special effects, constructs a unified special effects framework, and realizes the integrated realization of geometric special effects such as maximize / minimize zoom, fade in and fade out, drawer special effects, etc. 2. The present invention establishes a parametric configuration model, and defines special effect properties (such as animation curves, duration, etc.) through standardized interfaces, which improves the efficiency of new special effect development by 70%. 3. The present invention can adjust GPU / CPU calculation and rendering according to the priority of special effects. 4. By constructing a unified special effects framework, the present invention can create cross-special effect state reuse, eliminate repeated initialization overhead, and reduce peak memory usage. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] Figure 1 Schematic diagram of the basic flow of the method of the embodiment of the present invention.

[0017] Figure 2 Schematic diagram of the process of step S6 in the embodiment of the present invention.

[0018] Figure 3 Schematic diagram of the initialization and filling parameter flow of the maximize-minimize zoom effect in an embodiment of the present invention.

[0019] Figure 4 The figure is a flow chart of initializing and filling parameters of the fade-in and fade-out special effects in an embodiment of the present invention.

[0020] Figure 5 This is a schematic diagram of the initialization and filling parameter flow of the drawer special effect in an embodiment of the present invention. DETAILED DESCRIPTION

[0021] In order to enable those skilled in the art to better understand the technical solution of the present invention, the technical solution of the present invention will be further described in detail below in conjunction with the accompanying drawings in the embodiments of the present invention.

[0022] like Figure 1 As shown, the general implementation method of geometric special effects in the Wayland environment of this embodiment includes the following steps: S1, create a general configuration structure to store the information of the current geometric effect, register a general interface for the current geometric effect and specify the corresponding hook function. The implementation of the hook function corresponding to different geometric effects is different. Fill in the parameters in the general configuration structure according to the properties of the current geometric effect. The properties of the geometric effect include the priority of the effect. The interface registered for the current geometric effect is mainly used to render and correct the damaged area (damage) that needs to be re-rendered. When filling the parameters in the configuration structure (options) according to the properties of the current geometric effect, different geometric effects can initialize the variables in the configuration structure according to their own properties. Some special effects only change the position information, such as the drawer special effect, and some special effects need to change the position and transparency (alpha) at the same time, such as the fade-in and fade-out special effect; S2, create a transform structure to describe the geometric transformation of the current geometric effect; S3, creating the animation curve of the current geometric effect; S4, generating a thumbnail required by the current geometric effect; S5, attaching the current geometric effect to the node used to represent the display content in the Wayland environment; S6, based on the effect priority, calling the general interface registered for the current geometric effect to complete the rendering output of the current geometric effect and reclaiming resources after the rendering is completed.

[0023] In step S1 of this embodiment, the configuration structure (options) includes struct animation_type_grouptype, curve type. struct animation_data start, end. The start and end positions of the special effect. int64_tstart_time; the time when the special effect starts. int duration (the duration of the special effect). Some special effects only change the position information, such as the drawer special effect, and some special effects need to change the position and alpha at the same time, such as the fade-in and fade-out special effect. The expression of the transform structure created in step S2 of this embodiment to describe the geometric transformation of the current geometric special effect is: struct transform_effect { Struct effect effect; const struct transform_effect_interface impl; struct effect_manager manager; struct wlr_renderer renderer; bool is_opengl_renderer; struct wl_listener enable; struct wl_listener disable; struct wl_listener destroy; void user_data; int priority; }; Among them, struct effect effect is a pointer to the special effect structure effect, which is the base class of the special effect interface in the Wayland environment; const struct transform_effect_interface impl is a pointer to a transform_effect_interface structure, which defines the specific implementation interface of the transformation effect. The impl pointer is used to specify the corresponding dynamic algorithm; struct effect_manager manager is a pointer to an effect_manager structure, which is responsible for creating, destroying and managing the life cycle of special effects; struct wlr_renderer renderer is a pointer to a wlr_renderer structure, where the wlr_renderer structure is a renderer interface of Wayland and the rendering backend of the renderer; bool is_opengl_renderer is a Boolean value, indicating whether the current renderer supports the OpenGL backend; struct wl_listener enable is a wl_listener structure, which is used to listen for enable events. When the transform effect is enabled, the wl_listener structure will trigger a callback function to notify the transform_effect structure to perform corresponding initialization or update operations; struct wl_listener disable is a wl_listener structure, which is used to listen for disable events. When the transform effect is disabled, the wl_listener structure will trigger a callback function to notify the transform_effect structure to perform corresponding cleanup or update operations; struct wl_listener destroy is a wl_listener structure, which is used to listen for destroy events. When the transform effect is destroyed, the wl_listener structure will trigger a callback function to notify transform_effect to release resources or perform other necessary cleanup operations; void user_data is a pointer to user-defined data, which is used for users to store customized data related to transformation effects; int priority is the special effect priority. For example, if the priority value is 5, it means creating a transform structure with a special effect priority of 5. The common interfaces registered in step S1 include: pre-stage interface frame_render_pre, window boundary interface entity_bounding_box, node rendering interface node_render, push damage area interface node_push_damage, post-processing interface frame_render_post and special effect destruction interface entity_destroy.

[0024] In step S3 of this embodiment, the animation curve created refers to an irregular curve of position change or transparency change during the special effect process, similar to a parabola. If only the position needs to be changed during the special effect process, a position change curve is created. If the transparency is changed during the special effect process, a transparency change curve needs to be created. The final position, angle, and transparency of the curve are set, and the position, transparency, and angle of the special effect change according to the curve.

[0025] In step S4 of this embodiment, the thumbnail is generated according to the node used to represent the displayed content. Different thumbnails are generated when the node used to represent the displayed content is different.

[0026] In step S5 of this embodiment, the current geometric special effect is added to the node for representing the display content in the Wayland environment. The current geometric special effect can be added to the node for representing the display content in the Wayland environment through the ky_scene_node_add_effect function.

[0027] After completing the initialization of all variables in the transform structure, step S1 has registered the following general interfaces, including: pre-stage interface frame_render_pre, window boundary interface entity_bounding_box, node rendering interface node_render, push damage area interface node_push_damage, post-processing interface frame_render_post and special effect destruction interface entity_destroy. Different special effects register different hook functions for the above interfaces, among which the pre-stage interface frame_render_pre is equivalent to pre-processing, which is the stage of intervening in the damage area and can be used to change the damage area; the post-processing interface frame_render_post is a post-rendering processing interface, which is also used to correct the damage area. The pre-stage interface frame_render_pre is called before rendering, and the post-processing interface frame_render_post is called after rendering; pushing the damage area (node_push_damage) refers to pushing the area that needs to be redrawn, and each node pushes the damage area to the parent node; the node rendering interface node_render refers to rendering, rendering the texture and pasting it to the location where it should be pasted. During the rendering process, the hook function transform_effect_frame_pre of the pre-stage interface frame_render_pre will be called. At this stage, the timing of the special effect will start, and the update and adjustment of the configuration structure parameters will be made. If the parameters are updated, the curves and parameters will be reset.

[0028] In this embodiment, the real-time position calculated by rendering in step S6 refers to the position calculated by the animator_value function according to the special effect time. According to the curve and time, the real-time position of the rendering is calculated, and the re-rendered damaged area (damage, the area needs to be redrawn) is pushed to the parent node through the node_push_damage interface. The parent node refers to the node father. A window can be understood as a node. A desktop scene tree is like a tree trunk, and the tree trunk has many branches. The branches can be considered as nodes. There is a parent-child relationship between nodes, and there are brother nodes. Figure 2 As shown, step S6 of this embodiment includes: S6.1, based on the special effect priority triggering registered pre-stage interface frame_render_pre, start timing through the hook function corresponding to the pre-stage interface frame_render_pre, and adjust and reset parameters according to the parameter status in the configuration structure of the current geometric special effect; S6.2, calculate the real-time position, real-time transparency and damage area according to the animation curve and push them as the damage area that needs to be re-rendered, and obtain the effect size of the node used to represent the display content in the current geometric effect attached to the Wayland environment through the hook function corresponding to the registered window boundary interface entity_bounding_box; S6.3, rendering the thumbnail to the real-time position through the registered node rendering interface node_render, performing geometric transformation along the animation curve through the transform structure and rendering it to the calculated real-time position; S6.4, pushes the damage area to the parent node through the registered push damage area interface node_push_damage and corrects the damage area through the post-processing interface frame_render_post, and the hook function of the pre-stage interface frame_render_pre detects whether the timing time has timed out. If the timing time has timed out, the current geometric special effect is ended, and the resources of the current geometric special effect are recovered through the registered special effect destruction interface entity_destroy.

[0029] In one embodiment, the current geometric special effect is a maximum-minimum scaling special effect (collectively referred to as scale special effect), and the maximum-minimum scaling special effect is the maximization, maximization restoration, minimization or minimization restoration of the application window. The above-mentioned maximum-minimum scaling special effect is the change process of window scaling formed after the initial application window is superimposed with the special effect of size scaling. The scale special effect is a geometric special effect of two key frames (head frame and tail frame) of the application window, wherein the head frame is the initial application window and the tail frame is the application window finally displayed after scaling. The scale special effect forms an animation special effect of the application window by adding special effect animation frames of maximization, maximization restoration, minimization or minimization restoration between the head frame and the tail frame. Before applying the scale special effect, when the user maximizes or minimizes the application window through the mouse or shortcut, the human eye can only see two key frames (head frame and tail frame). The whole process is very fast, which makes people feel very abrupt and has a poor experience. In order to improve the user experience, the scale special effect is added here to visualize the maximization, maximization restoration, minimization or minimization restoration process, and the visual effect is better. Add a zoom effect entity to the node corresponding to the application window, set the position animation curve, the duration of the effect, calculate the start and final display positions according to the design document provided by the interface, intervene in the rendering synthesis of the node through the interface of the effect framework, and then finally realize the zoom effect by calculating, modifying the damage area or replacing the rendering. Figure 3As shown, step S1 of this embodiment includes: step S1 includes: S1.1A, registering a hook function for updating parameters of the maximum and minimum zoom special effect and a hook function for calculating the rendering position; S1.2A, creating an entity structure of the maximum and minimum zoom special effect, which defines a data structure to store the configuration information of the maximum and minimum zoom special effect; S1.3A, setting the special effect curve of the maximum and minimum zoom special effect and calculating the position; S1.4A, filling the parameters in the configuration structure according to the properties of the maximum and minimum zoom special effect. The four operations of maximization, maximization restoration, minimization and minimization restoration of the maximum and minimum special effect all start by setting the corresponding animation curve, setting the special effect duration, and calculating the start position and end position. Depending on the operation, the corresponding parameters are different. Taking the maximization special effect as an example, according to whether the window has shadow status data (ssd), the shadow area is calculated, and the start position and end position of maximization are calculated. Set the transparency to 1.0 at the beginning and end, and the special effect duration is 300ms. The setting and calculation of the above initial values ​​are calculated separately when maximizing the special effect. The tranform framework is designed to solve a series of special effects involving changes in the three elements of position, angle, and transparency. For example, fade-in and fade-out special effects and drawer special effects also share the transform structure, so there is no need to write a set of interfaces for each special effect. The transform structure can be understood as the extraction of the common interface. In the maximized special effect, a transform structure will be created. This structure is used to describe the maximized special effect and contains all the information of the maximized special effect, such as the current position, thumbnail information, curves, nodes, and other information. Create an animation curve based on the previously filled curve method. Get the thumbnail. At this time, you get the maximized thumbnail. Based on the image, make changes and maximize the special effect to implement its own transform interface. Transform will register the public interface of the maximized special effect interface to the special effect framework. This flowchart is the scale special effect creating a structure and filling the configuration structure options. The hook function registered by the scale special effect will be called in the pre-stage interface frame_render_pre of the special effect framework to update the configuration structure parameters and calculate the coordinate position of the final rendering.

[0030] In another embodiment, the current geometric special effect is a fade-in or fade-out special effect (fade special effect) of the application window, and the above special effect is the process of changing the transparency (i.e., alpha value) and position of the window formed by superimposing the transparency change and position change special effects on the initial application window. The fade special effect can also be understood as a geometric special effect based on two key frames (head frame and tail frame) of the application window, wherein the head frame is the initial application window, and the tail frame is the application window after fading in or out. The fade special effect is an animation special effect of the application window formed by adding a fade-in or fade-out transition special effect animation frame between the head frame and the tail frame. In the absence of the fade special effect, when the user opens the application, the menu bar pops up with the right mouse button, and the text prompt box appears immediately when the mouse triggers the opposite operation, and disappears immediately when the application is closed or the like. The user experience is very poor. In order to improve the experience, after adding the fade-in and fade-out special effects, the user can see the process of the application appearing and disappearing when performing the above operations. Add a fade-in and fade-out special effect entity to the corresponding application window or node. According to the user interface design document, you can set the position change animation curve, special effect duration, transparency change animation curve, calculate the starting position, final display position, starting and final transparency. According to the characteristics of the fade-in and fade-out special effect, register the special effect interface to be implemented in the special effect framework, and finally realize the special effect by modifying the damage area, modifying the rendering, etc. The fade-in and fade-out special effect mainly applies to window opening, closing, tooltips, and the appearance and disappearance of the right-click menu bar. The process and algorithm are almost the same. Start by creating a fade special effect. According to the requirements of the design document, set the transparency change curve and position change curve of the fade special effect, and calculate the starting and ending coordinate positions. Set the start time and duration of the fade special effect. According to the characteristics of the fade special effect, register two hook functions of transform_effect_interface, namely update_transform_options and destroy. In the prehook stage of the special effect framework, the update_transform_options function will be called to update the configuration parameters according to the real-time status. Then, create a transform structure corresponding to the fade effect through the public interface of transform and connect it to the transform framework. Figure 4As shown, step S1 of this embodiment includes: S1.1B, registering a hook function for updating parameters of the fade-in and fade-out special effect and a hook function for calculating the rendering position; S1.2B, creating an entity structure of the fade-in and fade-out special effect, which defines a data structure to store the configuration information of the fade-in and fade-out special effect; S1.3B, setting the transparency change curve and position change curve of the fade-in and fade-out special effect; S1.4B, setting the start time, the special effect duration period, the start and end transparency, calculating the start and end positions, and filling the parameters in the configuration structure according to the properties of the fade-in and fade-out special effect.

[0031] In another embodiment, the current geometric special effect is a drawer special effect (slide special effect) of the application window, and the above special effect is the window translation motion and the change process of transparency adjustment formed after the special effects of translation motion and transparency are superimposed on the initial application window. The slide special effect can also be understood as a geometric special effect based on two key frames (head frame and tail frame) of the application window, where the head frame is the initial application window, and the tail frame is the application window after opening or closing. The drawer special effect (slide special effect) adds the special effect animation frame of window translation motion and transparency adjustment to the head frame and finally transitions to the tail frame. According to the design requirements, some applications are required to slide out from a certain position of the taskbar, and they also slide and disappear when they disappear, similar to the process of pulling a drawer and closing a drawer. For example, the start menu requires a drawer effect. This special effect can vividly show the process of opening the application in front of the user, improving the user's perception and experience. Add the drawer special effect entity to the corresponding node, set the position change animation curve of the drawer special effect and the duration of the special effect according to the design document, calculate the sliding start position and the sliding final position, register the special effect interface to be implemented in the special effect framework according to the characteristics of the drawer special effect, and finally realize the drawer special effect by adjusting the damaged area and rendering. Figure 5As shown, step S1 of this embodiment includes: S1.1C, registering a hook function for updating parameters of drawer special effects and a hook function for calculating rendering positions; S1.2C, creating an entity structure of drawer special effects, which defines a data structure to store configuration information of drawer special effects operations; S1.3C, setting the transparency curve and position curve of the drawer special effects; S1.4C, filling the parameters in the configuration structure according to the properties of the drawer special effects. The direct perception of the drawer special effect is that a smooth sliding effect will be generated when opening and closing the application. At present, the common scenario is that when clicking the start menu from the taskbar and clicking the shortcut operation, there will be a drawer effect. Where to slide out and where to retract is closely related to the position of the taskbar. Currently, the taskbar supports four positions at the bottom, top, left and right of the desktop. First, obtain the slide structure related data (mainly the sliding direction and deviation) according to the surface position, and then create the slide entity special effect structure, and calculate the start position and end position according to the sliding direction and deviation. Register the update_transform_options and get_render_src_box hook functions according to the characteristics of the drawer special effect. These two functions are mainly used to update the options parameter and calculate the value of src (source). Create the transform of the drawer special effect through the transform public interface and connect it to the transform framework.

[0032] In summary, in order to solve the problem of repeated construction of three elements based on transparency, position and angle, such as maximizing and minimizing zooming special effects, fading in and out special effects, and drawer special effects, reduce redundant operations and codes, and improve performance, the general implementation of geometric special effects in the Wayland environment of this embodiment is mainly divided into two parts: the first part is the external specific special effects (such as zooming special effects, fading in and out special effects, and drawer special effects) filling configuration structure, which describes the geometric parameters of the special effects, such as time, transparency, position information, nodes, etc. Then the external specific implementation of each interface function. The second part is the internal, transform public framework part. This part mainly creates the transform_effect structure and transform structure for each special effect. The transform_effect structure mainly includes public general interfaces, etc. The tranform structure mainly includes texture, buffer, animation curve related information, nodes, etc. It mainly includes the following functions: ① Create a transform_effect structure for each type of geometric special effect, and register the interface to the special effect framework (the concept of the special effect framework is different from that of the transform framework. Transform is mainly for geometric special effects, while the special effect framework is for all special effects); ② External specific special effects fill in various parameters of the configuration structure (time, transparency, position and angle) according to the design document; ③ The transform framework creates a transform structure and initializes some parameters according to the configuration structure passed in. ④ Create an animation curve according to the configuration structure, and the operation of the special effect process changes according to the trend of the animation curve; ⑤ Create a thumbnail according to the configuration, and the subsequent rendering of the special effect is based on the thumbnail; ⑥ Add external specific special effects to the configured node through a function; ⑦ Since the interface has been registered in the special effect framework, the pre-stage function of the special effect framework is called during the rendering process, and the special effect time starts to count. At this stage, various function pointers will be called, and finally the options parameter will be adjusted. According to the adjustment of the parameters, the position, transparency, angle and animation curve of the special effect will be reset. ⑧ Calculate the real-time position information and push the damaged area (damage) to the parent node; ⑨ According to the previous options parameters and thumbnail information, through the transform_effect_node_render function, paste the thumbnail to the calculated position to render the texture; ⑩ When the special effect time is up, end the rendering and the special effect. Using the method of this embodiment, it is only necessary to extract the common parts of special effects such as maximizing and minimizing zooming special effects, fading in and out special effects, and drawer special effects based on the three elements of alpha, position, and angle to form a common transform framework. Special effects only need to fill in the transparency, position information, angle and other variable parameters and some specific interfaces according to the properties of the special effects to complete the implementation of the special effects, without worrying about other things.Compared with the prior art, the advantages of the method of this embodiment are: 1. This embodiment breaks through the paradigm of independent development of traditional special effects, builds a unified special effects framework, and realizes the integrated realization of geometric special effects such as maximize / minimize zoom, fade in and fade out, drawer special effects, etc. 2. This embodiment establishes a parametric configuration model, and defines special effect properties (such as animation curves, duration, etc.) through standardized interfaces, which improves the efficiency of new special effects development by 70%. 3. This embodiment can adjust GPU / CPU calculation and rendering according to the priority of special effects. 4. By building a unified special effects framework, this embodiment can create cross-special effects state reuse, eliminate repeated initialization overhead, and reduce peak memory usage.

[0033] In addition, this embodiment also provides a general implementation system of geometric special effects in the Wayland environment, including a microprocessor and a memory connected to each other, and the microprocessor is programmed or configured to execute the general implementation method of geometric special effects in the Wayland environment. This embodiment also provides a computer-readable storage medium, which stores a computer program or instruction, and the computer program or instruction is programmed or configured to execute the general implementation method of geometric special effects in the Wayland environment through a processor. This embodiment also provides a computer program product, including a computer program or instruction, which is programmed or configured to execute the general implementation method of geometric special effects in the Wayland environment through a processor.

[0034] Those skilled in the art should understand that the technical solution provided by the present invention may be in the form of a method, a system, or a computer program product. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-readable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes. The present invention is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present invention. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the functions in the process. Figure 1 A process or multiple processes and / or boxes Figure 1These computer program instructions can also be stored in a computer-readable memory that can guide a computer or other programmable data processing device to work in a specific way, so that the instructions stored in the computer-readable memory produce a product including an instruction device, which implements the functions specified in the process. Figure 1 A process or multiple processes and / or boxes Figure 1 These computer program instructions can also be loaded onto a computer or other programmable data processing device, so that a series of operation steps are executed on the computer or other programmable device to produce a computer-implemented process, so that the instructions executed on the computer or other programmable device provide for implementing the process in the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0035] The above is only a preferred embodiment of the present invention, and the protection scope of the present invention is not limited to the above embodiments. All technical solutions under the concept of the present invention belong to the protection scope of the present invention. It should be pointed out that for ordinary technicians in this technical field, some improvements and modifications without departing from the principle of the present invention should also be regarded as the protection scope of the present invention.

Claims

1. A general method for implementing geometric effects in a Wayland environment, characterized in that: The steps include: S1, create a general configuration structure to store the information of the current geometric effect, register a general interface for the current geometric effect and specify the corresponding hook function. The implementation of the hook function corresponding to different geometric effects is different. Fill the parameters in the general configuration structure according to the properties of the current geometric effect. The properties of the geometric effect include the effect priority. S2, create a transform structure to describe the geometric transformation of the current geometric effect; S3, creating the animation curve of the current geometric effect; S4, generating a thumbnail required by the current geometric effect; S5, attaching the current geometric effect to the node used to represent the display content in the Wayland environment; S6, based on the effect priority, calling the general interface registered for the current geometric effect to complete the rendering output of the current geometric effect and reclaiming resources after the rendering is completed.

2. The general method for implementing geometric special effects in the Wayland environment according to claim 1, characterized in that: The common interfaces registered in step S1 include: pre-stage interface frame_render_pre, window boundary interface entity_bounding_box, node rendering interface node_render, push damage area interface node_push_damage, post-processing interface frame_render_post and special effect destruction interface entity_destroy; step S6 includes: S6.1, based on the special effect priority triggering registered pre-stage interface frame_render_pre, start timing through the hook function corresponding to the pre-stage interface frame_render_pre, and adjust and reset parameters according to the parameter status in the configuration structure of the current geometric special effect; S6.2, calculate the real-time position, real-time transparency and damage area according to the animation curve and push them as the damage area that needs to be re-rendered, and obtain the effect size of the node used to represent the display content in the current geometric effect attached to the Wayland environment through the hook function corresponding to the registered window boundary interface entity_bounding_box; S6.3, rendering the thumbnail to the real-time position through the registered node rendering interface node_render, performing geometric transformation along the animation curve through the transform structure and rendering it to the calculated real-time position; S6.4, pushes the damage area to the parent node through the registered push damage area interface node_push_damage and corrects the damage area through the post-processing interface frame_render_post, and the hook function of the pre-stage interface frame_render_pre detects whether the timing time has timed out. If the timing time has timed out, the current geometric special effect is ended, and the resources of the current geometric special effect are recovered through the registered special effect destruction interface entity_destroy.

3. The general method for implementing geometric special effects in the Wayland environment according to claim 1, characterized in that: The current geometric special effect is the maximum-minimum scaling special effect, and the maximum-minimum scaling special effect is the maximization, maximum-restore, minimization or minimum-restore of the application window. The above-mentioned maximum-minimum scaling special effect is the window scaling change process formed after the initial application window is superimposed with the size scaling special effect. Step S1 includes: S1.1A, registering the hook function for updating the parameters of the maximum-minimum scaling special effect and the hook function for calculating the rendering position; S1.2A, creating an entity structure of the maximum-minimum scaling special effect, which defines a data structure to store the configuration information of the maximum-minimum scaling special effect; S1.3A, setting the special effect curve of the maximum-minimum scaling special effect and calculating the position; S1.4A, filling the parameters in the configuration structure according to the properties of the maximum-minimum scaling special effect.

4. The general method for implementing geometric special effects in the Wayland environment according to claim 1, characterized in that: The current geometric special effect is a fade-in or fade-out special effect of the application window. The above special effect is the process of changing the transparency and position of the window after superimposing the special effects of transparency change and position change on the initial application window; step S1 includes: S1.1B, registering a hook function for updating parameters of the fade-in and fade-out special effect and a hook function for calculating the rendering position; S1.2B, creating an entity structure of the fade-in and fade-out special effect, which defines a data structure to store the configuration information of the fade-in and fade-out special effect; S1.3B, setting the transparency change curve and position change curve of the fade-in and fade-out special effect; S1.4B, setting the start time, the special effect duration period, the start and end transparencies, calculating the start and end positions, and filling the parameters in the configuration structure according to the properties of the fade-in and fade-out special effect.

5. The general method for implementing geometric special effects in the Wayland environment according to claim 1, characterized in that: The current geometric special effect is the drawer special effect of the application window. The above special effect is the change process of window translation motion and transparency adjustment formed after superimposing the special effects of translation motion and transparency on the initial application window; step S1 includes: S1.1C, registering the hook function for updating the drawer special effect parameters and the hook function for calculating the rendering position; S1.2C, creating an entity structure of the drawer special effect, which defines a data structure to store the configuration information of the drawer special effect operation; S1.3C, setting the transparency curve and position curve of the drawer special effect; S1.4C, filling the parameters in the configuration structure according to the properties of the drawer special effect.

6. The general method for implementing geometric special effects in the Wayland environment according to claim 2, characterized in that: The real-time position calculated in step S6.2 refers to the position calculated by the animator_value function according to the special effect time.

7. The general method for implementing geometric special effects in the Wayland environment according to claim 1, characterized in that: The expression of the transform structure created in step S2 to describe the geometric transformation of the current geometric effect is: struct transform_effect { struct effect effect; const struct transform_effect_interface impl; struct effect_manager manager; struct wlr_renderer renderer; bool is_opengl_renderer; struct wl_listener enable; struct wl_listener disable; struct wl_listener destroy; void user_data; int priority; }; Among them, struct effect effect is a pointer to the special effect structure effect, which is the base class of the special effect interface in the Wayland environment; const struct transform_effect_interface impl is a pointer to a transform_effect_interface structure, which defines the specific implementation interface of the transformation effect. The impl pointer is used to specify the corresponding dynamic algorithm; struct effect_manager manager is a pointer to an effect_manager structure, which is responsible for creating, destroying and managing the life cycle of special effects; struct wlr_renderer renderer is a pointer to a wlr_renderer structure, where the wlr_renderer structure is a renderer interface of Wayland and the rendering backend of the renderer; bool is_opengl_renderer is a Boolean value, indicating whether the current renderer supports the OpenGL backend; struct wl_listener enable is a wl_listener structure, which is used to listen for enable events. When the transform effect is enabled, the wl_listener structure will trigger a callback function to notify the transform_effect structure to perform corresponding initialization or update operations; struct wl_listener disable is a wl_listener structure, which is used to listen for disable events. When the transform effect is disabled, the wl_listener structure will trigger a callback function to notify the transform_effect structure to perform corresponding cleanup or update operations; struct wl_listener destroy is a wl_listener structure, which is used to listen for destroy events. When the transform effect is destroyed, the wl_listener structure will trigger a callback function to notify transform_effect to release resources or perform other necessary cleanup operations; void user_data is a pointer to user-defined data, which is used for users to store custom data related to transformation effects; int priority is the special effect priority.

8. A general implementation system for geometric special effects in a Wayland environment, comprising a microprocessor and a memory connected to each other, characterized in that: The microprocessor is programmed or configured to execute the general implementation method of geometric effects in the Wayland environment as described in any one of claims 1 to 7.

9. A computer-readable storage medium having a computer program or instruction stored therein, characterized in that: The computer program or instruction is programmed or configured to execute, through a processor, the general method for implementing geometric special effects in a Wayland environment as recited in any one of claims 1 to 7.

10. A computer program product comprising a computer program or instructions, characterized in that The computer program or instruction is programmed or configured to execute, through a processor, the general method for implementing geometric special effects in a Wayland environment as recited in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Wlots-based synthetic rendering implementation method

    CN115686727A

  • Wayland synthesizer

    CN115809047A

  • Method for implementing special effect of fillet with shadow in wayland environment

    CN118537424A

  • Working area thumbnail implementation method in wayland environment

    CN118672710A

Cited By

  • Wayland synthesizer, window adjustment method and device in wayland environment based on window proxy, storage medium and program product

    CN121501231A