Window animation processing method and electronic equipment
Patent Information
- Application Number
- CN202380077449.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2023-04-14
- Filing Date
- 2023-12-06
- Publication Date
- 2025-06-13
AI Technical Summary
In the existing technology, window animations in electronic devices are prone to frame loss problems, resulting in incoherent animations and affecting the user's visual experience and human-computer interaction efficiency.
By adopting a window animation processing method in electronic devices, animation parameters are sent to the graphics synthesizer after the operation is detected, and each image frame is synthesized independently, reducing the interaction between the program and the graphics synthesizer, ensuring the smoothness of the animation, and when necessary Adjust the refresh rate to match the animation frame rate.
It effectively reduces the probability of losing frames in window animations, improves animation coherence and human-computer interaction efficiency, and ensures smooth user experience.
Smart Images

Figure CN120153353A_ABST
Abstract
Description
Window animation processing method and electronic device
[0001] This application claims priority to the Chinese patent application filed with the State Intellectual Property Office on April 14, 2023, with application number 202310430743.1 and invention name “A Window Animation Processing Method and Electronic Device”, the entire contents of which are incorporated by reference into this application. Technical Field
[0002] The present application relates to the field of terminal technology, and in particular to a window animation processing method and an electronic device. Background Art
[0003] Whether the content displayed on an electronic device is visually coherent is a key indicator of the efficiency of human-computer interaction. In some scenarios, electronic devices often use window animations to connect the transitions between different interfaces, thus ensuring visual coherence during the interface transition process.
[0004] In related technologies, the implementation process of window animation is prone to frame loss, which causes the window animation to be visually incoherent to the user.
[0005] Summary of the Invention
[0006] In view of this, the present application provides a window animation processing method and an electronic device, which reduces the probability of frame loss in window animation, ensures the continuity of displayed window animation, and improves the human-computer interaction efficiency of the electronic device.
[0007] To achieve the above objectives, the embodiments of the present application adopt the following technical solutions:
[0008] In a first aspect, an embodiment of the present application provides a window animation processing method, which is applied to an electronic device. The method includes: after detecting a first operation, a first program in the electronic device sends first data to a graphics synthesizer, the first data includes multiple sets of animation parameters for synthesizing a first animation, the first animation includes multiple image frames, and the first operation is detected by the first program and is used to trigger the display of the first animation; after the graphics synthesizer receives the first data, the display screen of the electronic device displays the image frames of the first animation in sequence.
[0009] Exemplarily, the first operation may be an operation that can trigger the display of the first animation. For example, the first operation may be an operation that indicates an interface switch. It is understandable that during the interface switch process, animation effects are often used to connect the interface switches to ensure the visual continuity of the interface switch process for the user.
[0010] As another example, the first operation may also be an operation of instructing to display the first animation. For example, the first operation may also be an operation of directly instructing to play a window animation sample.
[0011] Alternatively, the first program may be a software module that detects the first operation and determines that the first animation needs to be displayed, such as an application or a window manager. After the first program detects the first operation, the first program may send data to the image synthesizer, that is, send multiple sets of animation parameters for synthesizing the first animation.
[0012] It can be understood that before each image frame is displayed, the graphics synthesizer needs to process the drawn display content according to the animation parameters to obtain the corresponding image frame.
[0013] In the above embodiment, before synthesizing the first animation, the graphics synthesizer can independently synthesize each image frame in the first animation through a data exchange with the first program (that is, obtaining the first data from the first program). In other words, during the synthesis of the first animation, the graphics synthesizer does not need to repeatedly exchange data with the first program. In the image frame synthesis link, decoupling from the first program is achieved. In other words, after the first program sends the first data to the graphics synthesizer, even if the first program is abnormal or busy, it will not cause the first animation to lose frames.
[0014] In some embodiments, the first data includes r groups of animation parameters, each group of animation parameters is used to synthesize one image frame of the first animation, where r is a positive integer.
[0015] Exemplarily, r is greater than 1 and less than the total number of frames i of the first animation. In this way, the first program can send the first data to the graphics synthesizer in multiple times. After sending the first data to the graphics synthesizer for the first time, the first program continues to determine the multiple sets of animation parameters that need to be sent to the graphics synthesizer next time. The animation parameters carried by the first data sent each time may be different. For example, in the process of calculating the animation parameters, the first program encounters problems such as being busy, and the first data sent may include a small amount of animation parameters. In the process of calculating the animation parameters, if the first program is relatively idle, the first data sent may include relatively more animation parameters. In this way, the impact of the first program on the subsequent synthesis of the first animation can also be reduced.
[0016] In another exemplary embodiment, r is equal to the total number of frames i of the first animation. In this way, the first program only needs to send the first data to the graphics synthesizer, and can be decoupled from the graphics synthesizer during the synthesis process of the first animation, thereby avoiding the influence of the first program on the synthesis process of the first animation.
[0017] In some embodiments, before the first program sends the first data to the graphics synthesizer, the method also includes: the first program determines the first frame number of the first animation; the first program determines multiple sets of animation parameters of the first data, the number of the multiple sets of animation parameters is the same as the first frame number, and one set of animation parameters is used to synthesize one frame of the image frame in the first animation.
[0018] In the above embodiment, the total number of frames of the first animation (i.e., the first frame number) is predetermined before the first animation is actually displayed. Then, all animation parameters of the first animation are determined simultaneously based on the animation effect. In this manner, the first program no longer relies on the position and size of the actual displayed image frame to calculate the animation parameters of the next image frame, paving the way for the decoupling of the first program and the graphics synthesizer during the subsequent synthesis of the first animation.
[0019] In some embodiments, before determining the first number of frames of the first animation, the method also includes: a first program determines a first refresh rate, where the first refresh rate is a predicted refresh rate of the display screen during the playback of the first animation; the above-mentioned determination of the first number of frames of the first animation includes: the first program determines that the first number of frames is equal to the product of the first refresh rate and the playback duration of the first animation.
[0020] It is understandable that the refresh rate of the display screen may be different in different operating scenarios. In the above embodiment, by predicting the refresh rate of the display screen during the display of the first animation, it is ensured that the animation frame rate of the first animation is consistent with the refresh rate of the display screen, so that the optimal first frame number can be obtained. Of course, the first frame number is a key parameter for determining all animation parameters of the first animation. Determining the optimal first frame number can ensure the smoothness of the first animation without increasing the display length of the first animation.
[0021] In some embodiments, while the electronic device sequentially displays each image frame corresponding to the first animation, the refresh rate of the display screen of the electronic device is fixed at the first refresh rate.
[0022] It is understandable that even if the display refresh rate during the playback of the first animation is accurately predicted, some unpredictable factors may occur during the actual playback of the first animation, causing the refresh rate to change. In order to ensure the actual playback effect of the first animation, the display refresh rate can be fixed at the first refresh rate during the playback of the first animation.
[0023] In some embodiments, the first data includes first animation parameters, second animation parameters, and third animation parameters arranged in sequence. After the graphics synthesizer receives the first data, the method further includes: the graphics synthesizer receives a first vertical synchronization signal; the graphics synthesizer processes the drawn first content according to the first animation parameters in response to the first vertical synchronization signal to obtain a first image frame of the first animation; the graphics synthesizer receives a second vertical synchronization signal, where the second vertical synchronization signal is a next frame of vertical synchronization signal received by the graphics synthesizer after the first vertical synchronization signal; when the first time interval is equal to the first duration, the graphics synthesizer processes the drawn second content according to the second animation parameters in response to the second vertical synchronization signal to obtain a second image frame of the first animation, wherein the first time interval is the time interval between receiving the first vertical synchronization signal and the second vertical synchronization signal, and the first duration is a fixed duration used to indicate the sending frequency of the vertical synchronization signal; the electronic device sequentially displays the image frames of the first animation, and further includes: After obtaining the first image frame, the first image frame is displayed; after obtaining the second image frame, the second image frame is displayed; when the first time interval is greater than the first duration, the graphic synthesizer responds to the second vertical synchronization signal and processes the drawn third content according to the third animation parameters to obtain the third image frame of the first animation; the electronic device displays the image frames of the first animation in sequence, including: after obtaining the first image frame, the first image frame is displayed; after obtaining the third image frame, the second image frame is skipped and the third image frame is directly displayed.
[0024] The first image frame, the second image frame, and the third image frame corresponding to the first animation parameter, the second animation parameter, and the third animation parameter are image frames that need to be displayed in sequence in the first animation.
[0025] It is understandable that during the operation of the graphics synthesizer, anomalies or busyness may inevitably occur. In the above embodiment, the graphics synthesizer can decide whether to adopt a frame dropping method based on the time interval between receiving two adjacent frames of synchronization signals and the actual time interval between sending the synchronization signals, to ensure that the synthesis progress of the first animation is not affected.
[0026] For example, the first time interval is equal to the first duration (the actual time interval for sending the synchronization signal). After synthesizing the first image frame, the second image frame is synthesized in sequence. In this way, the electronic device can also display the second image frame after displaying the first image frame. For another example, the first time interval is greater than the first duration. After synthesizing the first image frame, the second image frame is skipped and the third image frame is directly synthesized. Correspondingly, the electronic device also skips displaying the second image frame and directly displays the third image frame. In this way, by reducing the time for synthesizing and displaying the second image frame, the total display duration of the first animation is ensured to be unaffected, and the impact of the display of the first animation when the graphic synthesizer is abnormal or busy is reduced.
[0027] In some embodiments, the synthesis of the image frames of the first animation requires not only the animation parameters but also the drawn display content. If the display content of the first animation remains unchanged, the first program can complete the drawing of the display content and store it at the first address before sending the first data. The first address and the first data are then sent to the graphics synthesizer. In this way, when synthesizing the image frames, the graphics synthesizer only needs to obtain the drawn display content from the first address and combine it with the first data to complete the synthesis of the first animation.
[0028] When the display content of the first animation changes, the first program can draw the changed display content in real time and store it at the second address. The second address is then sent to the graphics synthesizer. The graphics synthesizer can then retrieve the drawn display content from the second address and combine it with the first data to synthesize subsequent image frames. In this way, the displayed first animation can be an animation with variable display content.
[0029] In some embodiments, while the display screen of the electronic device sequentially displays the image frames of the first animation, the method further includes: in response to a second operation of the user, the display screen of the electronic device cancels the display of the first animation, and the second operation is an operation that triggers the cancellation of the display of the first animation; the display screen of the electronic device displays a preconfigured end image frame.
[0030] In the above embodiment, the electronic device can also quickly cancel the first animation.
[0031] In some embodiments, before the electronic device displays a preconfigured ending image frame, the method further includes: the first program sending second data to the graphics synthesizer, where the second data is an animation parameter for synthesizing the ending image frame.
[0032] In some embodiments, while the display screen of the electronic device sequentially displays the image frames of the first animation, the method further includes: after detecting a second operation of the user, the display screen of the electronic device cancels the display of the first animation, and the second operation is an operation that triggers the cancellation of the display of the first animation; the display screen of the electronic device displays a second animation, wherein, before canceling the display of the first animation, when the first image frame, the second image frame and the third image frame in the first animation have been displayed in sequence, the second animation includes the third image frame, the second image frame and the first image frame that need to be displayed in sequence.
[0033] In the above embodiment, the process of canceling the first animation is also visually coherent to the user, thereby improving the efficiency of human-computer interaction.
[0034] In some embodiments, before the display screen of the electronic device displays the second animation, the method further includes: the graphics synthesizer receives third data from the first program, and the third data includes multiple sets of animation parameters for synthesizing the second animation.
[0035] In some embodiments, the third data also includes verification parameters, which are the same as at least one set of animation parameters in the first data. Before the display screen of the electronic device cancels the display of the first animation, the method also includes: the graphics synthesizer determines that a fourth image frame has been synthesized, and the fourth image frame is an image frame synthesized according to the fourth animation parameters in the first data, and the fourth animation parameters include animation parameters that are the same as the verification parameters.
[0036] In the above embodiment, the connection process between the first animation and the second animation is smoother.
[0037] In some embodiments, the animation parameter includes one of a parameter indicating a display position, a parameter indicating a display size, and a parameter indicating a display outline, or a combination thereof.
[0038] In some embodiments, the method also includes: after detecting the third operation, the second program of the electronic device sends fourth data to the graphics synthesizer, and the fourth data is animation parameters for synthesizing a fifth image frame; after the graphics synthesizer receives the fourth data from the second program, the display screen of the electronic device displays the fifth image frame; the second program of the electronic device sends fifth data to the graphics synthesizer, and the fifth data is animation parameters for synthesizing a sixth image frame; after the graphics synthesizer receives the fifth data from the second program, the display screen of the electronic device displays the sixth image frame; wherein the fifth image frame and the sixth image frame are two image frames in the third animation, and the third operation is an operation detected by the second program and used to trigger the display of the third animation.
[0039] In the above embodiment, different programs can select different animation synthesis methods according to their own business rules to achieve compatibility of different animation synthesis.
[0040] In some embodiments, the second program is a program that meets the first preset condition, and the first program is a program that meets the second preset condition; wherein, the first preset condition includes one or more of the following: the second program belongs to the preconfigured first program list, the type of the third animation indicated by the second program belongs to the first animation type list, and the tasks to be executed corresponding to the second program are less than the first number.
[0041] The second preset condition includes one or more of the following: the first program belongs to a preconfigured second program list, the type of the first animation indicated for display by the first program belongs to a second animation type list, the number of tasks to be executed corresponding to the first program is greater than a second number, and the first number is less than a second data.
[0042] In a second aspect, an embodiment of the present application provides an electronic device, which includes one or more processors and a memory; the memory is coupled to the processor, and the memory is used to store computer program code, and the computer program code includes computer instructions. When one or more processors execute the computer instructions, the one or more processors are used to execute the method in the above-mentioned first aspect and its possible embodiments.
[0043] In a third aspect, an embodiment of the present application provides a computer storage medium, comprising computer instructions. When the computer instructions are executed on an electronic device, the electronic device executes the method in the above-mentioned first aspect and its possible embodiments.
[0044] In a fourth aspect, the present application provides a computer program product. When the computer program product is run on the above-mentioned electronic device, the electronic device executes the method in the above-mentioned first aspect and its possible embodiments.
[0045] It can be understood that the electronic devices, computer storage media and computer program products provided in the above aspects are all applied to the corresponding methods provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding methods provided above and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] FIG1 is a schematic structural diagram of an electronic device provided in an embodiment of the present application;
[0047] FIG2 is a schematic diagram of the software structure of an electronic device provided in an embodiment of the present application;
[0048] FIG3 is an example diagram of data interaction between multiple layers of a software structure during the implementation of window animation in an embodiment of the present application;
[0049] FIG4 is an example diagram of attribute parameters provided in an embodiment of the present application;
[0050] FIG5 is an example diagram of a display process of an animation window provided in an embodiment of the present application;
[0051] FIG6 is one of the execution sequence diagrams of a window animation processing method;
[0052] FIG7 is a second execution sequence diagram of a window animation processing method;
[0053] FIG8 is a flowchart of a window animation processing method provided by an embodiment of the present application;
[0054] FIG9 is one of the execution timing diagrams of the method shown in FIG8 ;
[0055] FIG10 is a second timing diagram of the execution of the method shown in FIG8 ;
[0056] FIG11 is a diagram illustrating an example of a display process of canceling a window animation according to an embodiment of the present application;
[0057] FIG12 is a timing diagram of executing the cancel window animation shown in FIG11;
[0058] FIG13 is the first part of an example diagram of a display process of canceling a window animation according to a second embodiment of the present application;
[0059] FIG14 is a timing diagram of executing the cancel window animation shown in FIG13;
[0060] FIG15 is an example diagram of a set of attribute parameters of a continuous animation provided by an embodiment of the present application;
[0061] FIG16 is the second part of an example diagram of a display process of canceling a window animation according to a second embodiment of the present application;
[0062] FIG17 is a timing diagram of executing the cancel window animation shown in FIG16 according to an embodiment of the present application;
[0063] FIG18 is a diagram illustrating an engineering implementation example of different window animation implementation methods provided in an embodiment of the present application;
[0064] FIG19 is an example diagram of an embodiment of the present application providing a method for implementing compatible window animations of different types. DETAILED DESCRIPTION
[0065] The technical solutions in the embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application. In the description of the present application, unless otherwise specified, "at least one" means one or more, and "a plurality of" means two or more than two. In addition, in order to facilitate the clear description of the technical solutions in the embodiments of the present application, in the embodiments of the present application, words such as "first" and "second" are used to distinguish between identical or similar items with substantially the same functions and effects. Those skilled in the art will understand that words such as "first" and "second" do not limit the quantity and execution order, and words such as "first" and "second" do not necessarily limit them to be different.
[0066] Window animation is a visual effect commonly used in the operation of electronic devices, and can be used to connect the changes in the display content of electronic devices.
[0067] Exemplarily, the aforementioned change in display content can be a switch in the application interface displayed by the electronic device. For example, while the main interface is displayed, in response to a user instruction to run application 1 in the foreground, the main interface switches to display application interface 1 provided by application 1. In this example, the electronic device can utilize window animation to facilitate the switch between application interfaces of different applications.
[0068] For another example, while application interface 1 is being displayed, in response to a user instruction to switch to displaying application interface 2, the display switches from application interface 1 to application interface 2. Application interface 2 is also an application interface provided by application 1. In this example, the electronic device can use window animation to facilitate switching between application interfaces of the same application.
[0069] In addition, there are various types of window animations available. For example, there's a zooming animation, where the animation frame grows larger or smaller frame by frame. Another example is a panning animation, where the animation frame size remains unchanged but the display position moves horizontally.
[0070] It can be seen that through window animation, electronic devices can ensure the visual continuity of application interface changes for users and improve the efficiency of human-computer interaction.
[0071] However, in the actual application of window animation, the duration of the window animation needs to be short. Once the window animation is not smooth, the presentation duration of the window animation is extended, which has a very obvious visual impact on the user.
[0072] To address the aforementioned issues, embodiments of the present application provide a window animation processing method that can be applied to electronic devices including display screens (e.g., touch screens). This method can reduce the probability of issues such as freezes and interruptions during the display of window animations, thereby improving the user's visual experience.
[0073] For example, the electronic device in the embodiments of the present application may be a mobile phone, a tablet computer, a smart watch, a desktop computer, a laptop computer, a handheld computer, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook, as well as a cellular phone, a personal digital assistant (PDA), an augmented reality (AR) device, a virtual reality (VR) device, and other devices including a display screen. The embodiments of the present application do not impose any special restrictions on the specific form of the electronic device.
[0074] Please refer to Figure 1, which is a schematic diagram of the structure of an electronic device 100 provided in an embodiment of the present application. As shown in Figure 1, the electronic device 100 may include: a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display 194, and a subscriber identification module (SIM) card interface 195, etc.
[0075] Among them, the above-mentioned sensor module 180 may include sensors such as pressure sensor, gyroscope sensor, air pressure sensor, magnetic sensor, acceleration sensor, distance sensor, proximity light sensor, fingerprint sensor, temperature sensor, touch sensor, ambient light sensor and bone conduction sensor.
[0076] It should be understood that the structure illustrated in this embodiment does not constitute a specific limitation on the electronic device 100. In other embodiments, the electronic device 100 may include more or fewer components than shown, or may combine or separate certain components, or arrange the components differently. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0077] The processor 110 may include one or more processing units. For example, the processor 110 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU). The different processing units may be independent devices or integrated into one or more processors.
[0078] The controller may be the nerve center and command center of the electronic device 100. The controller may generate an operation control signal according to the instruction operation code and the timing signal to complete the control of fetching and executing instructions.
[0079] Processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in processor 110 is a cache memory. This memory can store instructions or data that have just been used or are being recycled by processor 110. If processor 110 needs to use the same instruction or data again, it can directly access the memory. This avoids duplicate accesses, reduces processor 110 latency, and thus improves system efficiency.
[0080] In some embodiments, the processor 110 may include one or more interfaces. The interfaces may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface.
[0081] It is understood that the interface connection relationship between the modules illustrated in this embodiment is merely an illustrative illustration and does not constitute a structural limitation on the electronic device 100. In other embodiments, the electronic device 100 may also adopt different interface connection methods from the above embodiments, or a combination of multiple interface connection methods.
[0082] Electronic device 100 implements display functionality through a GPU, display screen 194, and an application processor. A GPU is a microprocessor for image processing that connects display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. Processor 110 may include one or more GPUs that execute program instructions to generate or modify display information.
[0083] Display screen 194 is used to display images, videos, etc. Display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a MiniLED, a MicroLED, a Micro-oLed, or a quantum dot light-emitting diode (QLED).
[0084] The electronic device 100 can implement a shooting function through an ISP, a camera 193, a video codec, a GPU, a display screen 194, and an application processor.
[0085] The ISP is used to process data fed back by camera 193. For example, when taking a photo, the shutter is opened, and light is transmitted through the lens to the camera's photosensitive element (image sensor). The light signal is converted into an electrical signal, which is then transmitted to the ISP for processing and converted into an image visible to the naked eye. The ISP can also perform algorithmic optimization on image noise, brightness, and skin color. The ISP can also optimize parameters such as exposure and color temperature of the captured scene. In some embodiments, the ISP can be set in camera 193.
[0086] The camera 193 is used to capture still images or videos. The object generates an optical image through the lens and projects it onto the photosensitive element. The photosensitive element can be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the light signal into an electrical signal, and then passes the electrical signal to the ISP for conversion into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV or other format. In some embodiments, the electronic device 100 may include N cameras 193, where N is a positive integer greater than 1.
[0087] The digital signal processor is used to process digital signals. In addition to processing digital image signals, it can also process other digital signals. For example, when the electronic device 100 selects a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy.
[0088] Video codecs are used to compress or decompress digital video. Electronic device 100 may support one or more video codecs. This allows electronic device 100 to play or record videos in various encoding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, and MPEG4.
[0089] The NPU is a neural network (NN) computing processor. Drawing on the structure of biological neural networks, such as the transmission patterns between neurons in the human brain, it rapidly processes input information and can continuously self-learn. The NPU can enable intelligent cognitive applications in electronic device 100, such as image recognition, face recognition, speech recognition, and text comprehension.
[0090] Figure 2 is a block diagram of the software structure of the electronic device 100 provided in an embodiment of the present application. The layered architecture can divide the software into several layers, each with a clear role and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the electronic device may include an application layer (abbreviated as application layer), an application framework layer (framework), system libraries (libraries), Android TM Runtime (Android Runtime), service layer (services), hardware abstract layer (HAL) layer, etc.
[0091] Exemplarily, the application layer may include a series of application programs.
[0092] For example, the above application layer may include system-level applications such as SystemUI and Launcher.
[0093] Among them, SystemUI is an application that provides users with system-level information display and interaction services. It is mainly used to implement status bar information display (such as battery, wifi signal, 3G / 4G icon display, etc.), notification panel (such as system messages, third-party application messages), recent taskbar display panel (such as displaying recently used applications), etc.
[0094] Launcher is an application that provides desktop services to users. It is mainly used to display application icons of various applications, receive user operations on application icons, respond to user operations on application icons, run corresponding applications, display multi-tasking interface, etc.
[0095] For another example, the application layer may include application-level applications such as camera applications, gallery applications, and messaging applications. These application-level applications may include applications installed simultaneously when the operating system is installed, or third-party applications downloaded from the application store in response to user operations.
[0096] In addition, in addition to the applications shown in FIG. 2 , the application layer may also include applications not shown in FIG. 2 , such as custom applications, which are not specifically limited in the embodiments of the present application.
[0097] As another example, the application framework layer may provide an application programming interface (API) and a programming framework to the applications in the application layer. The application framework layer includes some predefined functions.
[0098] As shown in Figure 2, the application framework layer may include an activity manager, a window manager, an input event management service, content providers, an installation package manager, a telephony manager, a power manager, a view system, etc., and the embodiments of the present application do not impose any restrictions on this.
[0099] The window manager carries data and attributes related to the "interface" and is used to manage the state associated with the "interface," specifically the graphical user interface (GUI) resources used on the electronic device's display screen. For example, it manages window programs and event dispatching. Managing window programs involves orderly outputting display requests to the physical display screen or other display device, with the assistance of the application server and the window manager. Event dispatching involves dispatching user events from the keyboard, physical buttons, touch screen, mouse, trackball, etc., to the corresponding controls or windows. The window manager can also obtain the display screen size, determine whether a status bar is present, lock the screen, take screenshots, and manage the display mode of application windows, including the coordinate size and display hierarchy of the window. This includes creating and destroying windows, showing and hiding windows, window layout, focus management, and input method and wallpaper management.
[0100] The content provider is used to store and retrieve data and make it accessible to applications. This data can include video, images, audio, incoming and outgoing calls, browsing history and bookmarks, phone books, and more. The view system can be used to build the application's display interface. Each display interface can be composed of one or more controls. Generally speaking, controls can include icons, buttons, menus, tabs, text boxes, dialog boxes, status bars, navigation bars, widgets, and other interface elements.
[0101] The activity manager is responsible for managing activities, starting, switching, and scheduling components in the system, as well as managing and scheduling applications.
[0102] In the embodiment of the present application, the above-mentioned application framework layer may further include a frame rate management module. Of course, in other possible embodiments, the frame rate management module may also be in the service layer, which is not specifically limited in the embodiment of the present application.
[0103] For example, the system library provides basic rendering, communication, data management, and application runtime capabilities. The system library may include multiple functional modules, such as the Java Native Interface (JNI) and the Graphical User Interface (GUI).
[0104] The GUI is an independent software module used to assist other software modules in communicating with the surface flinger (SF) of the service layer.
[0105] The JNI is a programming framework that allows Java programs in a Java virtual machine to call native applications and / or libraries, and can also be called by other programs.
[0106] Of course, in addition to the GUI and JNI shown in Figure 2, the system library can also include modules not shown in Figure 2, such as a three-dimensional graphics processing library (e.g., OpenGL ES), SQLite, WebKit, a 2D vector graphics processing function library (Skia), etc.
[0107] As another example, the Android runtime includes a core library and a virtual machine. The Android runtime is responsible for scheduling and management of the Android system.
[0108] The core library consists of two parts: one is the function that needs to be called by the Java language, and the other is the Android core library.
[0109] The application layer and application framework layer run in a virtual machine. The virtual machine executes Java files in the application layer and application framework layer as binary files. The virtual machine manages object lifecycles, stack management, thread management, security and exception management, and garbage collection.
[0110] For example, the service layer can provide basic services of the native layer, such as graphics, video, audio, etc. The service layer can include a surface flinger (SF). The SF is a special service for processing graphic data and synthesizing the processed graphic data into the corresponding layer. In addition,
[0111] SF can also send a layer with graphics drawn on it to the display screen, instructing the display screen to render the layer in the interface.
[0112] As another example, the HAL layer can encapsulate the drivers for various hardware modules (e.g., cameras, sensors, and displays) and provide a calling interface to the application framework layer, shielding the implementation details of the low-level hardware. As shown in Figure 2, the HAL layer can include display, which is one of the interfaces for calling the display driver and can be used to implement the display function. Other software modules (e.g., SF) can control the display content by calling display.
[0113] In some embodiments, during the operation of the electronic device, an application (such as Launcher, third-party application, etc.) can decide whether to create a window animation based on the actual business scenario. After deciding to create a window animation, the creation and display of the window animation are controlled. For example, Launcher detects that the user clicks on the application icon and determines that a window animation needs to be created. Then, Launcher instructs the display screen to display the above animation frames corresponding to the window animation through the window manager, JNI, GUI, SF and display. The specific implementation process can be referred to the description in the subsequent embodiments, which will not be repeated here.
[0114] In other embodiments, during operation of the electronic device, the window manager may also decide whether to create a window animation based on the actual business scenario. After deciding to create a window animation, the window manager may control the creation and display of the window animation. For example, the window manager may instruct the display screen to display the animation frame corresponding to the window animation through JNI, GUI, SF, and display.
[0115] In the following embodiments, the scenario where the Launcher decides to create a window animation is mainly used as an example.
[0116] As shown in Figure 3, when the electronic device displays the main interface, the launcher detects that the user clicks on application icon 1 in the main interface. The launcher can call the corresponding interface of the window manager and use the window manager to create a window animation. For example, the launcher can call the window manager through the software development kit (SDK) in the application framework layer.
[0117] Exemplarily, creating a window animation includes: creating a corresponding window; then, determining display content to be controlled by the window. The window is an abstract object that is invisible to the user. The display content is the image content of the animation frame mentioned in the aforementioned embodiment, which becomes visible to the user after the animation frame is rendered to the display screen.
[0118] It is understandable that the above display content can be a static image frame or a dynamic video stream, depending on the specific scene. In addition, the display content controlled by the window is different in different scenes.
[0119] For example, when it is detected that the user clicks application icon 1, application 1 corresponding to application icon 1 is not running, and the display content corresponding to the determined window may be the application startup interface or the application main interface of application 1.
[0120] For another example, when it is detected that the user clicks application icon 1, the application 1 corresponding to application icon 1 is running in the background, and the display content corresponding to the determined window can be the last frame of the application interface displayed on the display screen before application 1 runs in the background.
[0121] For another example, the display interface includes a small window that is playing a live broadcast. When a user clicks on the small window, it is determined that the display content corresponding to the window may be a live video stream.
[0122] Alternatively, the window can control the displayed content by calculating attribute parameters corresponding to the displayed content and instructing the SF to synthesize an animation frame containing the displayed content according to the attribute parameters. The attribute parameters may indicate the display position, display shape, and display angle of the animation frame on the display screen.
[0123] For example, the attribute parameters may include information such as the display position, display size, and display shape of the animation frame on the display screen. In this way, the window can control the display form (size, position, shape, etc.) of the displayed content on the display screen. In subsequent embodiments, the attribute parameters corresponding to the displayed content may also be referred to as the attribute parameters of the animation frame.
[0124] Taking Figure 4 as an example, the display content corresponding to animation frame 401 is the gallery application interface. The corresponding vertical coordinate, horizontal coordinate, corner radius, window height, and window width of animation frame 401 in display interface 402 are all attribute parameters corresponding to animation frame 401. It is understandable that the above attribute parameters can be parameters determined by the window before displaying animation frame 401.
[0125] After the window manager calculates the attribute parameters corresponding to a frame of animation, it can send the attribute parameters to SF through JNI and GUI.
[0126] For example, the window manager can send the attribute parameters corresponding to a frame of animation to the Launcher, and then the Launcher calls JNI to send the attribute parameters to the SF through the GUI. For another example, the window manager can directly call JNI to send the attribute parameters to the SF through the GUI.
[0127] After receiving the attribute parameters, the SF can process the corresponding display content according to the attribute parameters to obtain animation frames, and then composite the animation frames into the corresponding layers. Then, by calling display, the SF instructs the display screen to render the layer containing the animation frames. In this way, the animation frames corresponding to the window animation can be displayed on the display screen of the electronic device, such as animation frame 401 in Figure 4.
[0128] It is understood that window animations can be dynamic, meaning that the animation frames displayed on the display screen vary at different times. For example, a panning window animation might display frames at different positions on the display screen at different times. Another example is a zooming window animation, where the size and position of the animation frames on the display screen vary at different times.
[0129] In some embodiments, Figure 5 illustrates the process of an electronic device normally displaying a window animation. As shown in Figure 5, the main interface 501 displayed by the electronic device includes an application icon 502 corresponding to a gallery application. At time T0, the user clicks on the display area of the application icon 502 on the display screen, that is, clicks on the gallery icon. Correspondingly, the electronic device can create and display a corresponding window animation in response to the user's click on the application icon 502. For example, between time T1 and time T2, an animation frame 503 of a first size is displayed on the main interface 501, which can also be referred to as displaying the first frame of animation. Between time T2 and time T3, an animation frame 504 of a second size is displayed on the main interface 501, which can also be referred to as displaying the second frame of animation. Between time T3 and time T4, an animation frame 505 of a third size is displayed on the main interface 501, which can also be referred to as displaying the third frame of animation. After time Ti, the animation frame 506 is displayed full screen, which can also be referred to as displaying the i-th frame of animation.
[0130] The value of i is the same as the total number of frames of the window animation, and the total number of frames of the window animation can be determined by the refresh rate of the display screen and the duration of the window animation.
[0131] For example, each time the display screen is refreshed, the animation frame is updated once. The refresh rate of the display screen is 60 Hz, the duration of the window animation is 1 second, and the total number of frames of the window animation can be determined to be 60 frames.
[0132] In addition, the duration of the above-mentioned window animation can be a pre-configured fixed value, or it can be the startup duration of the gallery application, and the embodiment of the present application does not make any specific limitation on this.
[0133] In addition, the size of the displayed animation frame varies at different times. For example, in Figure 5, the size of the displayed animation frame gradually increases over time until it is displayed full screen. In actual applications, the time interval between two adjacent moments is small. In this way, during the period between time T0 and Ti, the electronic device can ensure the visual continuity of the interface changes to the user.
[0134] During the period between T0 and Ti, the process of displaying animation frames (e.g., animation frame 503, animation frame 504, animation frame 505, ..., animation frame 506) on the display screen can be referred to as playing (or displaying) window animation. Continuing with the example of the window animation played in FIG5 , as shown in FIG6 , at time T0, the Launcher detects the user's selection of application icon 502. Then, in response to the user's selection of application icon 502, the Launcher sends a startup notification to the SF. For example, in conjunction with the software architecture example diagram shown in FIG3 , the Launcher can call JNI to send the startup notification to the SF through the GUI. In this way, the SF can periodically send a vertical synchronization (VSYNC) signal to the Launcher, instructing the Launcher to create the window animation and determine the attribute parameters of each animation frame. Furthermore, the VSYNC signal periodically sent by the SF to the Launcher can be a VSYNC signal periodically sent to the Launcher by the VSYNC manager in the SF.
[0135] In subsequent embodiments, the VSYNC signal sent by the SF to the Launcher may be referred to as VSYNC signal 1. In the embodiment of the present application, the manner in which the SF sends the VSYNC signal 1 to the Launcher is not specifically limited, and specific details may be referred to related technologies.
[0136] For example, when the Launcher receives the first frame VSYNC signal 1, the Launcher may create a window corresponding to the window animation through the window manager.
[0137] Then, when receiving the VSYNC signal 1 of the second frame, the Launcher can draw the display content of the first animation frame through the window manager and determine the corresponding attribute parameter 1.
[0138] After determining the attribute parameter 1 of the first frame of animation, the Launcher can send the display content of the drawn first frame of animation and attribute parameter 1 to the SF. For example, through JNI, the GUI's Binder interface is called to package the drawn first frame of animation and attribute parameter 1, and then submit it to the SF through the setTransaction interface.
[0139] In this way, the SF can process the display content drawn by the Launcher in combination with attribute parameter 1 to obtain the first frame of animation, also known as the first frame of animation. Furthermore, the SF can instruct the display to render the first frame of animation by calling display. In this way, the electronic device can begin displaying the first frame of animation at time T1.
[0140] Upon receiving the third frame VSYNC signal 1, the Launcher can similarly draw the display content of the second frame of animation and determine the corresponding attribute parameter 2. The attribute parameter 2 can be determined by predicting the display progress of the window animation at the next moment (e.g., predicting that the second size of animation frame will need to be displayed at the next moment, or predicting that the animation frame will need to be displayed at the display position 2 at the next moment) based on the current display progress of the window animation (e.g., the animation frame of the first size has been displayed, or the animation frame has been displayed at the display position 1). In this way, the attribute parameter 2 is determined.
[0141] Then, the display content of the second frame of animation and attribute parameter 2 are sent to the SF. In this way, the SF can process the display content of the second frame drawn by the Launcher based on attribute parameter 2, obtain the second frame of animation, and instruct the display screen to render the second frame of animation. In this way, the electronic device can start displaying the second frame of animation at time T2.
[0142] In the above embodiment, the electronic device calculates the attribute parameters of the next frame of animation after processing each frame of animation, until the SF can send the (i+1)th frame VSYNC signal 1 to the Launcher to trigger the processing of the i-th frame of animation and end the window animation.
[0143] As shown in FIG6 , in the time dimension, between T1 and T2, the display screen displays the first frame of animation; between T2 and T3, the display screen displays the second frame of animation; and between T3 and Ti, the display screen displays the third to i-1th frames of animation in sequence, where the value of i in the scenario shown in FIG6 is greater than 4. After Ti, the electronic device displays the i-th frame of animation.
[0144] In the above embodiment, during the window animation process, the Launcher must repeatedly call the application framework layer and repeatedly use the Binder before the display screen displays each animation frame. In the above embodiment, some steps to implement window animation are stable and fully predictable. These steps require the cooperation of two or more modules. Under heavy load, the coupling between modules is not conducive to the animation completing according to the predetermined behavior.
[0145] Furthermore, during the operation of an electronic device, any process, whether the Launcher, Binder, SF, or Window Manager, may experience high load, overlapping services, or difficulty in resource scheduling. These issues are collectively referred to as "busy" in subsequent embodiments. During the display of window animations, if any of the Launcher, Binder, SF, or Window Manager processes become busy, this may cause frame drops in the window animation.
[0146] FIG7 shows a scenario in which the Launcher process is abnormal or busy during the process of implementing window animation according to the method shown in FIG6 . As shown in FIG7 , after the Launcher receives the VSYNC signal 1 of the second frame, the attribute parameter 1 of the first frame animation cannot be determined in time, or cannot be sent to the SF in time, because the process of the Launcher, the window manager or the Binder is busy. At the same time, the SF is unable to send the VSYNC signal 1 of the third frame to the Launcher. In this way, the time point T5 at which the electronic device displays the first frame animation will be later than T1, resulting in a problem of window animation freeze. In addition, the electronic device will skip displaying the second frame animation and directly display the third frame animation of the window animation, making the window animation visually incoherent to the user, affecting the user's experience.
[0147] Another window animation processing method is provided in an embodiment of the present application. As shown in FIG8 , the window animation processing method may include the following steps:
[0148] S101, Launcher detects operation 1.
[0149] The operation 1 may be an operation that can trigger the display of a window animation, and the Launcher is the initiator of creating the window animation.
[0150] Of course, Launcher is only an example of a window animation initiator. During the operation of an electronic device, the initiator of the window animation can also be other applications in the application layer, or a window manager. In addition, the operations 1 corresponding to different initiators may be different. For example, the operation 1 corresponding to the Launcher may be an operation in which the user clicks on an application icon. For another example, the operation 1 corresponding to the window manager may be an operation in which the user clicks on a network address indicating a third-party application. For another example, the operation 1 corresponding to a third-party application may be an operation in which the user clicks on a reduced window provided by the third-party application, etc. Of course, the same initiator may also correspond to multiple types of operations 1. For example, the operation 1 corresponding to the Launcher may also include the user launching an application through the multitasking interface, the user sliding through different multitasking windows in the multitasking interface, etc. For example, the operation 1 corresponding to the third-party application may also include the user instructing to switch between different application interfaces. In the subsequent embodiments, the implementation details of the embodiments of the present application are explained mainly by taking the Launcher as the initiator of the window animation and detecting the operation 1 in which the user clicks on the application icon as an example.
[0151] S102, Launcher calls JNI to instruct GUI to send a startup notification 1 to SF.
[0152] In some embodiments, in response to Operation 1, the Launcher can invoke a Binder process via the JNI or GUI to send a Startup Notification 1 to the SF. For specific implementation details, please refer to the relevant art and will not be repeated here. Furthermore, Startup Notification 1 can instruct the SF to send a VSYNC signal, namely, VSYNC Signal 1, to the Launcher. In this way, VSYNC Signal 1 can instruct the Launcher to determine the attribute parameters of all animation frames and draw the corresponding display content. For specific implementation details, please refer to the description in subsequent embodiments.
[0153] S103, SF sends VSYNC signal 1 to Launcher.
[0154] In some embodiments, the SF may also send a VSYNC signal 1 to the Launcher via a Binder process, JNI, GUI, etc. In some embodiments, only one frame of the VSYNC signal 1 may be sent. In this way, when the Launcher receives the VSYNC signal 1, the process proceeds to S104.
[0155] Of course, in other embodiments, the SF may also periodically send multiple frames of VSYNC signal 1. In the case where the SF periodically sends multiple frames of VSYNC signal 1, when the Launcher receives the first frame of VSYNC signal 1, the process enters S104.
[0156] S104 , Launcher instructs the frame rate management module to predict the corresponding animation frame rate.
[0157] The animation frame rate may indicate the number of animation frames displayed per second on the display screen. In some embodiments, the frame rate of the window animation is the same as the refresh rate of the display screen. Thus, the frame rate management module may predict the refresh rate of the display screen during the window animation playback period and then use the predicted refresh rate as the animation frame rate.
[0158] S105 , the frame rate management module predicts the animation frame rate as frame rate parameter 1.
[0159] In some embodiments, the frame rate management module can identify the current operating scenario of the electronic device, such as clicking an application icon, switching between the foreground and background states of an application, or switching between application interfaces within an application. Then, based on the learned correspondence between different operating scenarios and refresh rates, the frame rate management module predicts the refresh rate of the display during the window animation playback period.
[0160] For example, in the scenario of clicking an application icon, the refresh rate of the display screen corresponds to frame rate parameter 1. Thus, when the frame rate management module determines that operation 1 is clicking an application icon, it can predict that the animation frame rate is frame rate parameter 1.
[0161] S106: The frame rate management module sends frame rate parameter 1 to the Launcher.
[0162] S107, the Launcher sends a frame rate parameter 1 to the window manager.
[0163] S108 , after the window manager obtains the frame rate parameter 1 , it determines the total number of frames of the window animation.
[0164] In some embodiments, the window manager can determine the total number of animation frames included in the window animation, that is, the total number of frames of the window animation, based on the frame rate parameter 1 and the playback duration of the window animation. For example, the product of the frame rate parameter 1 and the playback duration of the window animation can be used as the total number of frames.
[0165] In addition, the play duration of the window animation created by different initiators can be different. In different operation scenarios, the play duration of the window animation required to be played can also be different, and the embodiments of the present application do not specifically limit this. The correspondence between different initiators, different operation scenarios and different window animation durations can be pre-configured in the electronic device.
[0166] Thus, in some embodiments, the window manager may determine the corresponding playing duration of the window animation according to the initiator of the window animation and the current running scenario.
[0167] S109 , the window manager determines the attribute parameters corresponding to each frame of the animation in sequence according to the total number of frames, and obtains an attribute parameter set 1 .
[0168] In some embodiments, the window manager can determine the matching animation rules based on the operation scenario. It is understandable that the animation rules can indicate the animation effect of the window animation. In addition, different operation scenarios correspond to different animation rules. Of course, the animation rules corresponding to different operation scenarios can be pre-configured. Exemplarily, the above animation rules include the attribute parameters of the last frame of animation. The above animation rules also include the change rules of the attribute parameters corresponding to the animation frames between the initial animation frame and the last animation frame.
[0169] In this way, the window manager can determine the difference in attribute parameters between two adjacent animation frames based on the above animation rules and the total number of frames, such as the difference in display size, display position, etc.
[0170] For example, the display content drawn by the Launcher can be called the initial animation frame. The size of the initial animation frame is (100, 100). The window width and height of the last frame of animation are (0, 0). The window width and height of the animation frame between the initial animation frame and the last frame of animation change linearly. When the initial animation frame is not displayed, it is determined that the animation frames that need to be displayed in the window animation are 10 frames. The window manager can determine that the difference in window width between two adjacent frames of animation is ζ1=(A i -A1) / F sum =-10, the window height difference is γ1=(B i -B1) / F sum =-10, where A i Refers to the window width of the last animation frame, B i Refers to the window height of the last animation frame, A1 refers to the window width of the initial animation frame, B1 refers to the window height of the initial animation frame, F sum Refers to the total number of frames.
[0171] Then, the attribute parameters of each animation frame are calculated according to the display size difference and display position difference between two adjacent animation frames.
[0172] For example, according to the window width difference, combined with the formula: A m =ζ1*F m +A1, determines the window width of the mth frame animation. m Refers to the window width of the mth frame animation, and the value of m can be any positive integer between 1 and i. ζ1 can indicate the difference in window width between two adjacent frames of animation. m is the frame number of the mth frame, for example, F m The value of is equal to m. A1 refers to the initial animation frame window width.
[0173] For example, according to the window height difference, combined with the formula: B m =γ1*F m +B1, determine the window height of the mth frame animation. m Refers to the window height of the mth frame animation, and the value of m can be any positive integer between 1 and i. γ1 can indicate the difference in window height between two adjacent frames of animation. m is the frame number of the mth frame, for example, F m The value of is equal to m. B1 refers to the initial animation frame window width.
[0174] Continuing with the previous example, according to the above animation rules, the display size of the first frame of animation can be determined to be (90,90), the display size of the second frame of animation is (80,80), the display size of the third frame of animation is (70,70), the display size of the fourth frame of animation is (60,60), the display size of the fifth frame of animation is (50,50), the display size of the sixth frame of animation is (40,40), the display size of the seventh frame of animation is (30,30), the display size of the eighth frame of animation is (20,20), the display size of the ninth frame of animation is (10,10), and the display size of the tenth frame of animation (the last frame of animation) is (0,0). In other words, according to the above animation rules, the window animation determined is an animation effect from large to small.
[0175] The above is only an example. In the embodiments of the present application, other methods can also be used to calculate the attribute information of each frame of animation. After determining the attribute parameters of each frame of the window animation, the attribute parameters of all animation frames are used as a set of attribute parameter sets, that is, attribute parameter set 1. In addition, each attribute parameter in attribute parameter set 1 corresponds to a frame number, and the frame number is used to establish a correspondence between the attribute parameters in attribute parameter set 1 and the animation frames in the window animation.
[0176] In addition, the method in the above example can also be used to determine the display position in the attribute parameters. For example, the animation rule is configured with the display position of the first frame of animation, the display position of the last frame of animation, and the displacement trajectory of the animation frame on the display screen. In this way, the display position of each frame of animation can be determined based on the display position of the first frame of animation, the display position of the last frame of animation, combined with the displacement trajectory of the animation frame on the display screen and the total number of frames.
[0177] S110: The window manager sends attribute parameter set 1 to the Launcher.
[0178] In some embodiments, the Launcher may also call the application framework layer to draw the display content of each frame of animation.
[0179] S111, Launcher sends attribute parameter set 1 and the first address to SF.
[0180] The first address may indicate that both the Launcher and the SF can access the storage space, and the Launcher may store the display content of the drawn first frame of animation in the storage space indicated by the first address.
[0181] In some embodiments, the Launcher can call JNI and GUI to instruct the Binder process to send the attribute parameter set 1 and the first address to the SF. In other embodiments, the window manager can be instructed to directly send the attribute parameter set 1 and the first address to the SF. The specific implementation method is not specifically limited.
[0182] S112 , the Launcher instructs the frame rate management module to maintain the refresh rate at frame rate parameter 1.
[0183] In some embodiments, the frame rate management module can also control the refresh rate of the display screen. After sending attribute parameter set 1 to SF, the frame rate management module is instructed to maintain the refresh rate of the display screen at frame rate parameter 1. In this way, the smoothness of the window animation can be guaranteed during the window animation display.
[0184] S113, SF stores attribute parameter set 1.
[0185] There is no necessary order between S113 and S112, and this application does not impose any specific limitation on this. In some embodiments, the SF may store the attribute parameter set 1 in a storage space accessible to the SF.
[0186] S114, SF combines the attribute parameter set 1, determines the animation frame by frame and synthesizes it into the corresponding layer.
[0187] Figure 9 illustrates the process by which the SF independently synthesizes each animation frame after receiving attribute parameter set 1. As shown in Figure 9, after storing attribute parameter set 1, the SF main process can send a start notification 2 to the VSYNC manager. The VSYNC manager is a submodule within the SF that generates VSYNC signals.
[0188] In some embodiments, after receiving the start notification 2, the VSYNC manager may periodically generate a VSYNC signal 2 and send it to the SF main process. Each frame of the VSYNC signal 2 may instruct the SF main process to determine an animation frame and composite it into the corresponding layer.
[0189] In subsequent embodiments, the thread of the VSYNC manager may send the VSYNC signal 2 to the main process of the SF, which is referred to as the VSYNC manager sending the VSYNC signal 2 to the SF.
[0190] As shown in Figure 9, after the VSYNC manager receives the start notification 2, the VSYNC manager sends the first frame VSYNC signal 2 to the SF. The SF main process can then obtain the drawn display content from the first address. Then, the attribute parameter with frame number 1 (i.e., attribute parameter 1) is obtained from attribute parameter set 1. In this way, the SF can determine the first frame of animation based on the obtained display content and attribute parameter 1. For example, attribute parameter 1 is used to process the corresponding display content to obtain the corresponding animation frame.
[0191] The above-mentioned processing of the display content using attribute parameter 1 may include: using the display size in the attribute parameter to enlarge or reduce the corresponding display content. Or, according to the display appearance in the attribute parameter, change the edge shape of the display content, etc. Then, synthesize the first frame of animation to the corresponding layer. For example, according to the display position in attribute parameter 1, determine the position of the animation frame in the corresponding layer, and then synthesize the animation frame to the layer. In this way, after the layer is rendered to the display screen, the actual display position of the animation frame matches the display position in attribute parameter 1. Of course, the specific implementation details can refer to the working principle of SF in the relevant technology, which will not be repeated here.
[0192] After the VSYNC manager receives the start notification 2, when the VSYNC manager sends the second frame VSYNC signal 2 to the SF, the SF main process can obtain the attribute parameter with frame number 2 (i.e., attribute parameter 2) from the attribute parameter set 1, and use the attribute parameter 2 to process the corresponding display content to determine the second frame of animation. For example, the attribute parameter 2 is used to process the corresponding display content to obtain the corresponding animation frame. Then, the second frame of animation is composited into the corresponding layer.
[0193] After the VSYNC manager receives the start notification 2 and sends the third frame VSYNC signal 2 to the SF, the SF main process can obtain the attribute parameters of frame number 3 (i.e., attribute parameters 3) from the attribute parameter set 1, and use attribute parameters 3 to process the corresponding display content to determine the third frame of animation. Then, the third frame of animation is composited into the corresponding layer.
[0194] After the VSYNC manager receives the start notification 2 and sends the i-th frame VSYNC signal 2 to SF, the main process of SF can obtain the attribute parameters of frame number i (i.e., attribute parameter i) from attribute parameter set 1, and use attribute parameter i to process the corresponding display content to determine the i-th frame animation. Then, the i-th frame animation is composited into the corresponding layer. It can be understood that the above i refers to the total number of frames of the window animation.
[0195] It can be understood that in the attribute parameter set 1, the frame number of each attribute parameter can indicate the order in which SF obtains each attribute parameter from the attribute parameter set 1, and the order between animation frames that can be determined using the attribute parameter set 1.
[0196] In the case where the display content of the animation frame of the window animation is fixed, the display content corresponding to each attribute parameter is the display content drawn in the first address.
[0197] In the case where the display content of the animation frame of the window animation changes, for example, the display content of the nth frame animation is different from the display content of the n-1th frame animation, the Launcher can draw the display content of the nth frame animation and store it to the second address. Among them, the above n can indicate the frame number of the animation frame whose content changes, such as called the change number, and the above n can be any positive integer greater than 1 and not greater than i. The second address can indicate another storage space accessible to both the Launcher and SF, and the second address is used to store the changed display content. Exemplarily, one change number corresponds to one second address. After drawing the display content corresponding to the nth frame animation, the Launcher sends the frame number (that is, n) and the second address corresponding to the nth frame animation to the SF. In this way, in the scenario where SF obtains the attribute parameter n from the attribute parameter set 1, SF needs to first obtain the drawn display content from the second address as the display content corresponding to the attribute parameter n, and process it.
[0198] In addition, in the case where there is only one change sequence number, the display content corresponding to the attribute parameter with a frame sequence number greater than n may also be the display content in the second address.
[0199] In the case of multiple change sequence numbers, for example, including change sequence number 1 and change sequence number 2, change sequence number 1 is smaller than change sequence number 2, the second address corresponding to change sequence number 1 can be referred to as second address 1, and the second address corresponding to change sequence number 2 can be referred to as second address 2. If the frame sequence number of the attribute parameter is not smaller than change sequence number 1 and smaller than change sequence number 2, it is determined that the display content corresponding to the attribute parameter is the display content stored at second address 1. If the frame sequence number of the attribute parameter is not smaller than change sequence number 2, it is determined that the display content corresponding to the attribute parameter is the display content stored at second address 2.
[0200] In addition, the VSYNC manager can also generate VSYNC signal 1. When the VSYNC manager also periodically generates VSYNC signal 1, SF will also periodically send VSYNC signal 1 to Launcher. In the scenario where SF periodically sends VSYNC signal 1 to Launcher, similar to the aforementioned embodiment, starting from receiving the second frame of VSYNC signal 1, Launcher triggers the calculation of attribute parameters of one animation frame each time it receives a frame of VSYNC signal 1. For details, please refer to the steps executed by the Launcher after receiving the second frame of VSYNC signal 1 in Figure 6.
[0201] Of course, unlike the aforementioned embodiment, in the embodiment of the present application, through S109 to S111, SF has obtained the attribute parameters of all animation frames. In this way, the Launcher responds to VSYNC signal 1, and the attribute parameters of the single-frame animation calculated by the Launcher do not need to be sent to SF. In addition, in the scenario where the display content remains unchanged, the frequency of interaction between SF and Launcher can be significantly reduced, or even eliminated, making the decoupling between different modules more complete and avoiding the busy process of Launcher affecting the display of window animation.
[0202] In other embodiments, when the VSYNC manager also periodically generates the VSYNC signal 1, the Launcher does not respond to the VSYNC signal 1 starting from receiving the second frame of the VSYNC signal 1. This embodiment of the present application is not limited to this.
[0203] S115, each time SF synthesizes a frame of animation, it calls display to instruct the display screen to display the animation frame.
[0204] S116, the display screen displays the animation frame.
[0205] In some embodiments, each time a frame of animation is synthesized by SF, the frame of animation (ie, the layer containing the frame of animation) can be sent to the display screen via display, so that the display screen can display the frame of animation.
[0206] As shown in Figure 9, after the first frame of animation is composited into the corresponding layer, the SF can send the first frame of animation to the display screen through the display. The display screen renders the received animation frame to the screen. In this way, the electronic device can display the first frame of animation.
[0207] After compositing the second frame of animation onto the corresponding layer, the SF can send the second frame of animation to the display via the display. The display renders the received animation frame to the screen. After the display refreshes, it no longer displays the first frame of animation and instead displays the second frame of animation. Thus, the electronic device can display the second frame of animation.
[0208] After compositing the third frame of animation onto the corresponding layer, the SF can send the third frame of animation to the display via the display. The display renders the received animation frame to the screen. After the display refreshes, it no longer displays the second frame of animation and instead displays the third frame of animation. Thus, the electronic device can display the third frame of animation.
[0209] Similarly, after the i-th frame of animation is composited into the corresponding layer, the SF can send the i-th frame of animation to the display screen through the display. The display screen renders the received animation frame to the screen. In this way, the electronic device can display the i-th frame of animation.
[0210] It is understood that i is the total number of frames of the window animation. In the above example, i can be a value not less than 4. When i is greater than 4, after displaying the third frame of animation and before displaying the i-th frame of animation, the display screen can also respond to SF and display other animations synthesized by it, such as the fourth frame of animation. Of course, in other examples, i can also be a value greater than 1.
[0211] In this way, while SF synthesizes the animation frames frame by frame, the display screen also displays the corresponding animation frames frame by frame, and the display screen can also show the animation effects of the window animation. In addition, the synthesis process of each frame of animation does not require frequent interaction with the Launcher and application framework layer processes, nor does it need to frequently occupy the Binder process. After the attribute parameter set 1 of the window animation is sent to SF, even if the Launcher, application framework layer process or Binder process encounters problems such as busyness, it will not affect the display of the window animation, reducing the possibility of window animation frame loss.
[0212] S117 , after instructing the display screen to display the last frame of animation, SF clears attribute parameter set 1 .
[0213] S118, SF sends an end notification to Launcher.
[0214] The end notification is used to indicate that the display of the window animation has been completed. In some embodiments, the SF can also feed back the end notification to the initiator of the window animation, such as Launcher, through the Binder process, GUI, or JNI.
[0215] S119, Launcher instructs the frame rate management module to cancel the fixed refresh rate.
[0216] In this way, the frame rate management module can restore the display refresh rate according to the actual operating scenario, dynamically adjusting the display refresh rate while taking into account both energy consumption and the display effect of the display.
[0217] In some embodiments, the main animation server (SF) process may be busy during the operation of an electronic device. If the SF main process is busy, instructing the SF to synthesize the wth frame of animation will result in a longer synthesis time. Furthermore, during this period, the SF main process may not properly receive the w+1th frame VSYNC signal 2, which is sent by the VSYNC manager after receiving the start notification 2. w can be any positive integer less than i.
[0218] Figure 10 shows a scenario where the SF is abnormal or busy during the process of synthesizing window animations according to the method described in Figure 9. As shown in Figure 10, taking w as 2 as an example, if the synthesis time of the second frame of animation is long, the electronic device will take longer to display the first frame of animation, and will also display the second frame of animation later than expected.
[0219] In the embodiment of the present application, each time the SF receives the VSYNC signal 2, it can record the system time when the VSYNC signal 2 is received, also known as the synchronization time point.
[0220] Then, the currently received VSYNC signal 2 is compared with the synchronization time point of the VSYNC signal 2 of the previous adjacent frame.
[0221] If the time difference between the currently received VSYNC signal 2 and the previous VSYNC signal 2 is equal to duration t, the next attribute parameter is obtained from attribute parameter set 1, and the corresponding animation frame is determined. For example, if the frame number of the most recently obtained attribute parameter is k, the above "obtaining the next attribute parameter from attribute parameter set 1" can be to obtain the attribute parameter corresponding to the frame number k+1 from attribute parameter set 1. The duration t is the time interval between the VSYNC manager sending VSYNC signal 2, and the above duration t can be a fixed value. The above k can be any integer value between 1 and i.
[0222] If the time difference between the currently received VSYNC signal 2 and the VSYNC signal 2 of the previous frame is greater than the duration t, a multiple of the time difference and the duration t is determined, for example, the multiple is a. In this way, the attribute parameters to be obtained in response to the currently received VSYNC signal 2 can be determined based on the multiple "a" and the attribute parameters most recently obtained from attribute parameter set 1.
[0223] For example, SF may first determine the frame number of the attribute parameter most recently obtained from attribute parameter set 1, e.g., frame number k. Then, it may determine that the frame number of the attribute parameter to be obtained this time is equal to the sum of k and the aforementioned multiple (i.e., a). Finally, based on the frame number of the attribute parameter to be obtained this time, the corresponding attribute parameter is obtained from attribute parameter set 1.
[0224] As shown in Figure 10, the SF main process cannot properly receive the third frame VSYNC signal 2 issued by the VSYNC manager, but can properly receive the fourth frame VSYNC signal 2 issued by the VSYNC manager. Therefore, when receiving the fourth frame VSYNC signal 2 issued by the VSYNC manager, the previous VSYNC signal 2 for SF is the second frame VSYNC signal 2 issued by the VSYNC manager. Clearly, the time difference between receiving the second and fourth frame VSYNC signals 2 is greater than duration t. SF can determine that the multiple of this time difference and duration t is 2. Based on the frame number 2 of the most recently acquired attribute parameter and the determined multiple of 2, SF can determine that in response to the currently received VSYNC signal 2, i.e., the fourth frame VSYNC signal 2 issued by the VSYNC manager, it must obtain the attribute parameter with frame number 4 from attribute parameter set 1, e.g., attribute parameter 4. Attribute parameter 4 is then used to process the corresponding display content, obtaining the fourth frame animation and instructing the display to display it.
[0225] In this way, if the first frame of animation is displayed for too long and the second frame is displayed too late, the electronic device can skip displaying the third frame of animation and directly display the fourth frame of animation after displaying the second frame of animation. This process can avoid increasing the total display time of the window animation and reduce the impact on the user experience.
[0226] In some embodiments, while an electronic device is displaying a window animation, it may receive a user instruction to interrupt the animation. For example, after the user instructs to run a gallery application in the foreground, while the window animation corresponding to the gallery application is being displayed, the user instructs to cancel the gallery application in the foreground. In this case, the electronic device may cancel the window animation.
[0227] Figure 11 shows that during the display of the window animation, in response to the operation of canceling the window animation, the window animation is canceled using a first method. The first method makes the cancellation process of the window animation more efficient.
[0228] As shown in Figure 11, the main interface 1101 displayed by the electronic device includes an application icon 502 corresponding to the gallery application. At time T0, the user clicks the display area of application icon 502 on the display screen, that is, clicks the gallery icon. Correspondingly, the electronic device can create and display a corresponding window animation in response to the user's click on application icon 502.
[0229] For example, between time T1 and time T2, an animation frame 1102 of the first size is displayed on the main interface 1101, which can also be called the first frame animation. After time T2, an animation frame 1103 of the second size is displayed on the main interface 1101, which can also be called the second frame animation. At time T6 after time T2, that is, during the period when the window animation is being displayed, the electronic device receives an operation from the user indicating to cancel the launch of the gallery application, such as a swipe up operation, and can also determine that an operation indicating to cancel the window animation is detected. At time T7, the end animation frame is displayed.
[0230] In some embodiments, the electronic device may respond to an operation indicating cancellation of the window animation and resume displaying the main interface 1101 or display other pre-designated interfaces.
[0231] As an implementation, after S113, the main process of the SF sends a start notification 2 to the VSYNC manager. Afterwards, the VSYNC manager may periodically send a VSYNC signal 2 to the main process of the SF in response to the start notification 2.
[0232] FIG. 12 is an implementation process of canceling the window animation shown in FIG. 11 .
[0233] As shown in Figure 12, after SF sends a startup notification 2 to the VSYNC manager, when SF receives the first frame of VSYNC signal 2 from the VSYNC manager, it determines attribute parameter 1 from attribute parameter set 1, and then uses attribute parameter 1 to process the display content in the first address to obtain the first frame of animation and synthesize it into the corresponding layer. After the first frame of animation is synthesized into the corresponding layer, SF can send the first frame of animation to the display screen through display, instructing the display screen to render the received animation frame to the screen. In this way, after time T1, the display screen of the electronic device can display the first frame of animation.
[0234] After SF sends the start notification 2 to the VSYNC manager, when SF receives the VSYNC signal 2 of the second frame from the VSYNC manager, it determines the attribute parameter 2 from the attribute parameter set 1. Then, the attribute parameter 2 is combined with the corresponding display content to obtain the second frame of animation and synthesize it into the corresponding layer. After the second frame of animation is synthesized into the corresponding layer, SF can send the second frame of animation to the display screen through display, instructing the display screen to render the received animation frame to the screen. In this way, after time T2, the display screen of the electronic device can display the second frame of animation.
[0235] As shown in Figure 12, at time T6 after time T2, the Launcher detects an operation instructing to cancel the window animation. Before time T6, the SF main process has not received the third frame VSYNC signal 2 from the VSYNC manager. In this scenario, the Launcher can generate a cancellation notification 1, which carries attribute parameter x. Attribute parameter x can be any attribute parameter in attribute parameter set 1, or an attribute parameter that does not belong to attribute parameter set 1.
[0236] For example, the Launcher can determine the corresponding attribute parameter x based on the end animation pre-configured in the animation rule (i.e., the animation frame to be displayed when the window animation is interrupted). For example, the attribute parameter x can be the attribute parameter corresponding to the last frame of animation, or the attribute frame of the first frame of animation. For another example, the attribute parameter x can be a parameter indicating that no animation should be displayed.
[0237] After SF receives the cancellation notification 1, if SF receives the VSYNC signal 2 again, SF can clear the attribute parameter set 1, and then process the corresponding display content according to the attribute parameter x in the cancellation notification 1 to obtain the corresponding end animation.
[0238] In other embodiments, the attribute parameter set 1 may be cleared immediately after receiving the cancellation notification 1. In this way, after the SF receives the VSYNC signal 2 again, the corresponding display content is processed according to the attribute parameter x in the cancellation notification 1 to obtain the corresponding end animation.
[0239] Taking the display size (0,0) indicated in the attribute parameter x as an example, as shown in FIG11 , after detecting the operation of instructing to cancel the window animation at time T6 , the electronic device can restore the display of the main interface 1101 at time T7 .
[0240] In other embodiments, the above-mentioned time T6 may also be earlier than the time T2, but later than the time point when the SF receives the second frame VSYNC signal 2.
[0241] In other embodiments, if time T6 is later than time T2 and also later than the time when the SF receives the third frame of VSYNC signal 2, the SF may first process the corresponding display content according to attribute parameter 3 to obtain the third animation frame. After obtaining the third animation frame, attribute parameter set 1 is cleared. In this way, after receiving the fourth frame of VSYNC signal 2, the SF processes the corresponding display content according to attribute parameter x in cancel notification 1 to obtain the end animation.
[0242] In other embodiments, when the electronic device detects an operation indicating cancellation of a window animation, it may further display a continuous animation so that the cancellation process of the window animation is visually coherent to the user.
[0243] Figures 13 and 16 illustrate a second process for canceling a window animation. Figure 13 illustrates a scenario where an operation to cancel a window animation is received during the display of the window animation. Figure 16 illustrates a scenario where the continuous animation is connected to the window animation after the operation to cancel the window animation is detected.
[0244] Compared with the method of canceling the window animation shown in FIG11 , the second method of canceling the window animation shown in FIG13 and FIG16 can make the animation cancellation process more visually coherent.
[0245] As shown in Figure 13, the electronic device displays a main interface 1301 containing an application icon 502 corresponding to the Gallery application. At time T0, the user clicks the display area of application icon 502 on the display screen, i.e., clicks the Gallery icon. Accordingly, the electronic device can create and display a corresponding window animation in response to the user's click on application icon 502.
[0246] Thus, between time T1 and time T2, an animation frame 1302 of a first size is displayed on the main interface 1301, which can also be referred to as displaying the first frame of animation. Between time T2 and time T8, an animation frame 1303 of a second size is displayed on the main interface 1301, which can also be referred to as displaying the second frame of animation. At time T6 between time T2 and time T8, that is, while displaying the second frame of animation, the electronic device receives an operation from the user indicating cancellation of launching the gallery application, such as a swipe up operation, and can determine that an operation indicating cancellation of the window animation has been detected.
[0247] In addition, in some embodiments, the electronic device can generate a follow-up animation in response to an operation indicating cancellation of a window animation. Then, after detecting the operation indicating cancellation of a window animation, the electronic device can display the follow-up animation instead of the original window animation. The follow-up animation can connect the screen displaying the window animation with the screen displaying the window animation, making the process of canceling the window animation visually coherent.
[0248] As shown in Figure 13, after time T6, the electronic device can also display at least one frame of the original window animation. For example, between time T8 and time T9, an animation frame 1304 of a third size is displayed on the main interface 1301, that is, the third frame of the window animation is displayed, and preparations for displaying the subsequent animation are awaited, such as generating the connection parameters. After time T9, an animation frame 1305 of a fourth size is displayed on the main interface 1301, that is, the fourth frame of the window animation is displayed, and preparations for displaying the subsequent animation are awaited, such as generating the connection parameters. The fourth size is larger than the third size. Afterwards, the subsequent animation is displayed, which can improve the discontinuity between the window animation and the subsequent animation caused by the poor connection time point.
[0249] FIG14 shows the interaction sequence between SF and other software modules in the window animation display scenario shown in FIG13 .
[0250] As shown in FIG14 , as an implementation, after S113 , the main process of SF sends a start notification 2 to the VSYNC manager. Thereafter, the VSYNC manager may periodically send a VSYNC signal 2 to the main process of SF in response to the start notification 2 .
[0251] As shown in Figure 14, when the SF receives the VSYNC signal 2 of the first frame from the VSYNC manager, it determines attribute parameter 1 from attribute parameter set 1. Then, it uses attribute parameter 1 to process the corresponding display content to obtain the first frame of animation and synthesize it into the corresponding layer. After the first frame of animation is synthesized into the corresponding layer, the SF can send the first frame of animation to the display screen through display, instructing the display screen to render the received animation frame to the screen. In this way, after time T1, the display screen of the electronic device can display the first frame of animation.
[0252] When SF receives VSYNC signal 2 from the VSYNC manager for the second frame, it determines attribute parameter 2 from attribute parameter set 1, then uses attribute parameter 2 to process the corresponding display content to obtain the second frame of animation, and synthesizes it into the corresponding layer. After the second frame of animation is synthesized into the corresponding layer, SF can send the second frame of animation to the display screen via display, instructing the display screen to render the received animation frame to the screen. In this way, after time T2, the display screen of the electronic device can display the second frame of animation.
[0253] As shown in Figure 14, at time T6 after time T2, the Launcher detects an operation instructing to cancel the window animation. In this scenario, the Launcher can generate a cancellation notification 2 and send it to the SF. In response to the cancellation notification 2, the SF sends a response message to the Launcher. The response message carries the frame number of the animation frame most recently synthesized by the SF, which is called the target sequence number. For example, as shown in Figure 14, the SF has completed the synthesis of the animation frame of the second frame, and the frame number carried in the response message is 2. In this way, the response message can indicate that the animation frame most recently synthesized by the SF is the second frame.
[0254] Afterwards, the Launcher can generate attribute parameter set 2 corresponding to the continuous animation according to the target sequence number. Attribute parameter set 2 includes at least one frame of attribute parameters for verification, such as verification parameters, and multiple frames of attribute parameters for processing display content, such as continuous parameters.
[0255] For example, the Launcher may use at least one frame sequence number arranged after the target sequence number as a verification sequence number, and then obtain the attribute parameter indicated by the verification sequence number in the attribute parameter set 1 as the verification parameter.
[0256] If there is only one check sequence number, the frame number preceding the check sequence number is determined as the starting frame number of the continuous animation. If there are multiple check sequence numbers, and the multiple check sequence numbers are consecutive, the frame number preceding the largest check sequence number is determined as the starting frame number of the continuous animation.
[0257] After determining the starting frame number, the Launcher retrieves the attribute parameter corresponding to the starting frame number from attribute parameter set 1 as the first connection parameter. It then uses the other attribute parameters in attribute parameter set 1 with frame numbers less than the starting frame number as connection parameters. This completes the Launcher's acquisition of attribute parameter set 2.
[0258] In addition, each connection parameter in attribute parameter set 2 also corresponds to a processing sequence number. This processing sequence number indicates the order in which the SF obtains the attribute parameter from attribute parameter set 2. The smaller the processing sequence number, the earlier it can be obtained from attribute parameter set 2. Among them, the processing sequence number corresponding to the starting frame sequence is the smallest. For other connection parameters, the larger the corresponding frame sequence number in attribute parameter set 1, the smaller the processing sequence number in attribute parameter set 2.
[0259] For example, as shown in FIG14 , when the target sequence number is 2, 3 and 4 are determined as the check sequence numbers. Thus, as shown in FIG15 , the check parameters corresponding to attribute parameter set 2 include attribute parameters 3 and 4 in attribute parameter set 1. In addition, 4 is the largest check sequence number, and 3 can be determined as the initial frame sequence number. Thus, among the connection parameters corresponding to attribute parameter set 2, the first connection parameter is attribute parameter 3 in attribute parameter set 1. In addition, the connection parameters corresponding to attribute parameter set 2 can also include attribute parameter 2 and attribute parameter 1. In attribute parameter set 2, the processing sequence number of attribute parameter 3 is 1, the processing sequence number of attribute parameter 2 is 2, and the processing sequence number of attribute parameter 1 is 3.
[0260] As shown in Figure 14, after generating attribute parameter set 2, the Launcher can send attribute parameter set 2 to the SF. Of course, while the Launcher generates attribute parameter set 2, the SF continues to process the corresponding display data according to attribute parameter set 1. For example, before the SF stores attribute parameter set 2, the SF has received VSYNC signal 2 of the third frame and, in response to VSYNC signal 2, retrieved attribute parameter 3 from attribute parameter set 1.
[0261] After the Launcher stores attribute set parameter 2, it first checks whether the frame number (e.g., number b) of the attribute parameter most recently obtained from attribute parameter set 1 is greater than the frame number corresponding to the verification parameter (e.g., number c). If number b is greater than the number c of all verification parameters, the SF clears attribute parameter set 1. Afterwards, upon receiving VSYNC signal 2, it can process the display content based on the subsequent parameters in attribute parameter set 2 and synthesize the corresponding subsequent animation.
[0262] If sequence number b is not greater than sequence number c of at least one verification parameter, the SF then checks whether sequence number b+1 is greater than the sequence numbers c corresponding to all verification parameters. If sequence number b+1 is greater than the sequence numbers c of all verification parameters, the SF clears attribute parameter set 1. Subsequently, upon receiving VSYNC signal 2, the SF processes the display content based on the splicing parameters in attribute parameter set 2 and synthesizes the corresponding splicing animation.
[0263] If the sequence number b+1 is not greater than the sequence number c of at least one verification parameter, SF receives VSYNC signal 2 and can continue to obtain attribute parameter b+1 from attribute parameter set 1, process the corresponding display content, and obtain the b+1th frame animation.
[0264] Then, repeatedly check whether the frame number (such as sequence number b+1) of the attribute parameter most recently obtained by SF from attribute parameter set 1 is greater than the frame number corresponding to the verification parameter (such as sequence number c), and repeatedly determine whether to continue to obtain attribute parameters from attribute parameter set 1 when receiving VSYNC signal 2, and whether to clear attribute parameter set 1, etc.
[0265] As shown in FIG14 , the time point when SF stores the attribute parameter set 2 is before time T8 . Before storing the attribute parameter set 2 , SF has obtained the attribute parameter 3 from the attribute parameter set 1 .
[0266] In this scenario, the most recent attribute parameter obtained from attribute parameter set 1 is attribute parameter 3. It can be understood that the frame number of attribute parameter 3 is 3. This frame number "3" is not greater than the frame number corresponding to the verification parameters (attribute parameter 3 and attribute parameter 4), and the frame number "4" is also not greater than the frame number of the verification parameter (attribute parameter 4). Thus, after receiving the fourth frame of VSYNC signal 2, the SF obtains attribute parameter 4 indicated by frame number "4" from attribute parameter set 1. Then, using attribute parameter 4, it processes the corresponding display content to obtain the fourth frame of animation.
[0267] In this way, the attribute parameter most recently obtained from attribute parameter set 1 becomes attribute parameter 4. The frame number "4" of attribute parameter 4 is also not greater than the frame number corresponding to the verification parameter (attribute parameter 4), but the frame number "5" is greater than the frame numbers of the verification parameters (attribute parameter 3 and attribute parameter 4). In this way, SF can clear attribute parameter set 1, and when receiving the fifth VSYNC signal 2, obtain the continuation parameter from attribute parameter set 2, and process the corresponding display content to obtain the continuation animation.
[0268] FIG. 16 shows the connection process between displaying the window animation and displaying the subsequent animation during the process of canceling the window animation.
[0269] In some embodiments, as shown in FIG16 , before time T10, the electronic device displays the fourth frame of the window animation. From time T10 to time T11, a third-sized continuous animation 1501 is displayed, which can also be referred to as displaying the first frame of continuous animation. From time T11 to time T12, a second-sized continuous animation 1502 is displayed, which can also be referred to as displaying the second frame of continuous animation. After time T12, a first-sized continuous animation 1503 is displayed, which can also be referred to as displaying the third frame of continuous animation.
[0270] FIG17 shows the interaction sequence between SF and other software modules in the window animation display scenario shown in FIG16 .
[0271] As shown in Figure 17, when the fifth VSYNC signal 2 is received, the continuation parameter indicated by the processing sequence number "1" (that is, attribute parameter 3) is obtained from the attribute parameter set 2, and then the corresponding display content is processed using attribute parameter 3 to obtain the first frame of the continuation animation, and the display screen is instructed to display it at time T10.
[0272] When the 7th VSYNC signal 2 is received, the continuation parameter indicated by the processing sequence number "2" (that is, attribute parameter 2) is obtained from the attribute parameter set 2, and then the corresponding display content is processed using attribute parameter 2 to obtain the 2nd frame continuation animation, and the display screen is instructed to display it at time T11.
[0273] When the 8th VSYNC signal 2 is received, the continuation parameter (that is, attribute parameter 1) indicated by the processing sequence number "3" is obtained from the attribute parameter set 2. Then, the corresponding display content is processed using the attribute parameter 1 to obtain the 3rd frame of the continuation animation, and the display screen is instructed to display it at time T12. Afterwards, SF also sends an end notification to the Launcher, and the Launcher can clear the attribute parameter set 2 in response to the end notification. In addition, SF can also clear the stored attribute parameter set 2. In this way, even if the window animation is canceled, the process of canceling the window animation can be guaranteed to be visually consistent for the user.
[0274] In the above embodiments, a variety of window animation implementation schemes are enumerated, among which the window animation implementation method shown in FIG6 can be referred to as a native animation implementation method. The window animation implementation methods shown in FIG8 to FIG14 can be referred to as a sinking animation implementation method. In some embodiments, the initiator of the window animation (such as an application or a window manager) can decide whether to enable the native animation implementation method or the sinking animation implementation method according to preconfigured business rules.
[0275] When the application decides to use native animation to realize window animation, the data structure 1 can be called and the window animation can be realized according to the instructions of the data structure 1, such as the native animation process in Figure 18. The above data structure 1 can be as follows:
[0276] Wherein, Animation Object may indicate a data structure. The above-mentioned Animation_type_enum refers to the type of window animation corresponding to the data structure, such as the animation type of zooming in on animation frames frame by frame, the animation type of zooming out on animation frames frame by frame, or the animation type of parallel moving animation frames.
[0277] Animation_data indicates the attribute parameters sent by the application to the SF. In the data structure 1, it is stipulated that one frame of Animation_data carries the attribute parameters corresponding to a single animation frame.
[0278] Cancel(){…} indicates the steps to be performed to cancel the window animation. Cancel(cancelData){…} indicates the data to be sent to SF after canceling the window animation, for example, the attribute parameters of ending the animation, or the continuation parameters of the continuation animation.
[0279] It is understandable that the model structure of the data structure 1 shown in the above embodiment is only a model structure that may be enabled in the actual engineering implementation process, that is, it is only an example. In the embodiment of this application, the specific details of the model structure of the data structure 1 are not specifically limited.
[0280] In addition, the data structure 1 may include multiple data structures, and different data structures 1 may correspond to different types of window animations.
[0281] In the case where the application decides to use the sinking animation implementation method to realize window animation, data structure 2 can be called, and the window animation can be realized under the instruction of data structure 2, such as the sinking animation process in Figure 18. The above data structure 2 is similar to data structure 1. The difference between the two is that data structure 2 stipulates that Animation_data instructs the application to send an attribute parameter set to SF, such as the attribute parameter set 1 mentioned in the above embodiment. In addition, Cancel(cancelData){….} in the above data structure 2, in addition to being the attribute parameter that ends the animation, can also be an attribute parameter set composed of multiple subsequent parameters, such as the attribute parameter set 2 mentioned in the above embodiment.
[0282] In some embodiments, as shown in FIG19 , after receiving an operation that can trigger the display of a window animation, an application process in an electronic device can determine whether the application process meets preset conditions. If the first preset condition is met, a native animation implementation method (for implementation details, see FIG6 ) is used to display the window animation. If the second preset condition is met, a sinking animation implementation method (for implementation details, see FIG9 ) is used to display the window animation.
[0283] The first precondition may be met by satisfying one or more of the following conditions:
[0284] (1) The application process belongs to a pre-configured first program whitelist. It is understandable that all processes belonging to the first program whitelist need to use the native animation implementation method. The first program whitelist can be configured and updated by the developer.
[0285] (2) The application process identifies the window animation type to be enabled, which belongs to the first animation type whitelist. It can be understood that the window animation types belonging to the first animation type whitelist need to use the native animation implementation method. The first animation type whitelist can be configured and updated by the developer.
[0286] (3) The frequency of interaction between the application process and other processes per unit time is lower than a first threshold. The first threshold is a preset empirical value. When the interaction frequency is lower than the first threshold, it can be indicated that the application process is in an idle state. In the embodiment of the present application, the first threshold for determining whether an application process is idle can be determined through actual testing.
[0287] (4) The number of tasks to be executed in the task queue of the application process is less than the second threshold.
[0288] In addition, if the frequency of interaction between the application process and other processes per unit time is lower than a first threshold and the number of tasks to be executed is lower than a second threshold, both of these can indicate that the current load of the application process is relatively light and suitable for enabling the native animation implementation method. It is understood that other conditions that can indicate that the current load of the application process is relatively light can also serve as the first preset condition. In other embodiments, if the software code corresponding to the application process directly calls data structure 1, it can also be considered that the first preset condition is satisfied.
[0289] In addition, the second precondition may be met by satisfying one or more of the following:
[0290] (1) The application process belongs to the pre-configured second program whitelist. It can be understood that all processes belonging to the second program whitelist need to adopt the sinking animation implementation method. The second program whitelist can be configured and updated by the developer.
[0291] (2) The application process identifies the window animation type to be enabled, which belongs to the second animation type whitelist. It can be understood that the window animation types belonging to the second animation type whitelist need to adopt the sinking animation implementation method. The second animation type whitelist can be configured and updated by the developer.
[0292] (3) The frequency of interaction between the application process and other software modules per unit time is not less than a third threshold. The third threshold is greater than the first threshold, and the third threshold is a preset empirical value. If the interaction frequency is not less than the third threshold, it can be indicated that the application process is busy. In the embodiment of the present application, the third threshold that can be used to determine whether the application process is busy can be determined through actual testing.
[0293] (4) The number of tasks to be executed in the task queue of the application process is greater than a fourth threshold. The fourth threshold is greater than the second threshold.
[0294] In addition, if the frequency of interactions between the application process and other software modules per unit time is no less than a third threshold and the number of pending tasks is greater than a fourth threshold, both of these conditions indicate that the application process is currently heavily loaded and is suitable for enabling the sinking animation implementation method. It is understood that other conditions that can indicate that the application process is currently heavily loaded can also serve as the second preset condition.
[0295] In other embodiments, if the software code corresponding to the application process directly calls the data structure 2, it can also be considered to meet the second preset condition. In addition, if the first preset condition is not met, it can also be considered to meet the second preset condition.
[0296] In some possible embodiments, after the application process detects an operation that triggers the display of a window animation, the electronic device can also use an artificial intelligence model to predict whether the application process will be busy during the display of the window animation. For example, the artificial intelligence model can learn the historical operation data of the application process and identify the probability of the application process being busy or other problems after receiving an operation that triggers the window animation in different operation scenarios. When the identified probability is greater than a specified probability threshold, the sinking animation implementation method is selected. When the identified probability is not greater than a specified probability threshold, the native animation implementation method is selected.
[0297] An embodiment of the present application further provides an electronic device, which may include: a memory and one or more processors. The memory and processor are coupled. The memory is used to store computer program code, which includes computer instructions. When the processor executes the computer instructions, the electronic device can perform the steps performed by the mobile phone in the above embodiment. Of course, the electronic device includes but is not limited to the above memory and one or more processors.
[0298] In some embodiments, the electronic device includes software modules such as a first program and a graphics synthesizer. In addition, the electronic device may also include hardware modules such as a display.
[0299] During the operation of the electronic device, the first program detects a first operation (such as the aforementioned operation 1), and the first program sends first data (i.e., attribute parameter set 1) to the graphics synthesizer. The first data includes r groups of animation parameters (such as the attribute parameters 1 to attribute parameters i mentioned in the aforementioned embodiment) for synthesizing the first animation (window animation). The first animation may include multiple image frames (such as the animation frames mentioned in the aforementioned embodiment). The value corresponding to r can be equal to the total number of frames i of the first animation. In other embodiments, the value corresponding to r can also be less than the total number of frames i and greater than 1.
[0300] In this way, after the graphics synthesizer receives the first data, it can independently synthesize each image frame in the first animation and instruct the display screen to sequentially display the image frames of the first animation. This can improve the high degree of coupling between the graphics synthesizer and the first program during the display of the first animation, and to a certain extent, reduce the probability of frame loss, freezes, and other problems during the playback of the first animation.
[0301] In some embodiments, before the first program sends the first data to the graphics synthesizer once, the first program determines a first frame number of the first animation.
[0302] For example, as in the aforementioned embodiment, the frame rate management module predicts the refresh rate of the display screen during the playback of the first animation, that is, the first refresh rate. Then, the product of the first refresh rate and the playback duration of the first animation is determined as the first frame number.
[0303] The first program can then determine multiple sets of animation parameters for the first data, where the number of sets of animation parameters equals the number of the first frames, and one set of animation parameters is used to synthesize one image frame in the first animation. The process of determining animation parameters can be referenced in the aforementioned embodiment, where attribute parameters 1 through i are determined in conjunction with animation rules, and will not be further elaborated here.
[0304] In some embodiments, while the electronic device sequentially displays each image frame corresponding to the first animation, the refresh rate of the electronic device is fixed at the first refresh rate.
[0305] In some embodiments, the first data includes a first animation parameter, a second animation parameter, and a third animation parameter that are sequentially arranged. It is understandable that the animation parameters in the first data have an arrangement attribute. For example, the animation parameters all correspond to frame numbers, and the frame numbers are arranged from small to large. For another example, the first data can itself be a first-in-first-out data stack. The first program can first determine the animation parameters of the first image frame in the first animation, and finally determine the animation parameters of the last image frame in the first animation. Then, each time a set of animation parameters is determined, it is written into the first data. In this way, the animation parameters in the first data are all in order.
[0306] After the graphics synthesizer receives the first data, the graphics synthesizer receives a first vertical synchronization signal. In response to the first vertical synchronization signal (VSYNC signal 2), the graphics synthesizer processes the drawn first content according to the first animation parameter to obtain a first image frame of the first animation.
[0307] The graphic synthesizer receives a second vertical synchronization signal, wherein the second vertical synchronization signal is another VSYNC signal 2, which is the next frame VSYNC signal 2 received by the graphic synthesizer after the first vertical synchronization signal. The above-mentioned VSYNC signal 2 may be a synchronization signal issued by the VSYNC manager at different time points. The graphic synthesizer cannot completely miss every frame of VSYNC signal 2 issued by the VSYNC manager. In some scenarios, the reception time interval (such as the first time interval) between two adjacent frames of VSYNC signal 2 actually received by the graphic synthesizer may not be equal to the sending time interval (such as the first duration) of the VSYNC signal 2. In addition, the first duration is a fixed duration, which is used to indicate the sending frequency of the vertical synchronization signal.
[0308] When the first time interval is equal to the first duration, the graphics synthesizer processes the drawn second content according to the second animation parameters in response to the second vertical synchronization signal to obtain a second image frame of the first animation. The electronic device sequentially displays the image frames of the first animation, further comprising: displaying the first image frame after obtaining the first image frame; and displaying the second image frame after obtaining the second image frame. That is, the electronic device can display the first image frame and the second image frame sequentially while displaying the first animation.
[0309] When the first time interval is greater than the first duration, the graphics synthesizer processes the drawn third content according to the third animation parameters in response to the second vertical synchronization signal to obtain a third image frame of the first animation. The electronic device sequentially displays the image frames of the first animation, including: displaying the first image frame after obtaining the first image frame; and directly displaying the third image frame after obtaining the third image frame. In this way, when displaying the first animation, the electronic device skips displaying the second image frame and directly displays the third image frame. This ensures that the playback duration of the first animation is not affected by other factors.
[0310] In some embodiments, while the display screen of the electronic device sequentially displays the image frames of the first animation, the electronic device may cancel the display of the first animation in response to a second operation of the user, where the second operation (such as the swipe up operation in Figure 11) triggers the operation of canceling the display of the first animation; the electronic device displays a preconfigured ending image frame (i.e., the ending animation).
[0311] In some embodiments, before the electronic device displays a preconfigured ending image frame, the first program sends second data (eg, cancellation notification 1) to the graphics synthesizer, where the second data is animation parameters for synthesizing the ending image frame.
[0312] In some embodiments, while the display screen of the electronic device displays the image frames of the first animation in sequence, after detecting a second operation of the user (such as the swipe up operation in Figure 13), the electronic device cancels the display of the first animation, and the second operation is an operation that triggers the cancellation of the display of the first animation; the electronic device displays the second animation (that is, the subsequent animation), wherein before canceling the display of the first animation, when the first image frame, the second image frame and the third image frame in the first animation have been displayed in sequence, the second animation includes the third image frame, the second image frame and the first image frame that need to be displayed in sequence.
[0313] In some embodiments, before the electronic device displays the second animation, the graphics synthesizer of the electronic device receives third data (property parameter set 2) from the first program, where the third data includes multiple sets of animation parameters for synthesizing the second animation.
[0314] In some embodiments, the third data also includes verification parameters, which are the same as at least one set of animation parameters in the first data. Before the electronic device cancels the display of the first animation, the graphics synthesizer determines that a fourth image frame (such as animation frame 1305 in Figure 16) has been synthesized. The fourth image frame is an image frame synthesized according to the fourth animation parameters in the first data, and the fourth animation parameters include animation parameters that are the same as the verification parameters.
[0315] In some embodiments, the animation parameter includes one of a parameter indicating a display position, a parameter indicating a display size, and a parameter indicating a display outline, or a combination thereof.
[0316] In some embodiments, after the second program detects the third operation, the second program sends fourth data (e.g., attribute parameter 1) to the graphics synthesizer, where the fourth data is animation parameters used to synthesize the fifth image frame (animation frame 1). After the graphics synthesizer receives the fourth data from the second program, the display screen of the electronic device displays the fifth image frame.
[0317] In some embodiments, the second program sends fifth data (e.g., attribute parameter 2) to the graphics synthesizer, where the fifth data is an animation parameter used to synthesize a sixth image frame (animation frame 2). After the graphics synthesizer receives the fifth data from the second program, the display screen of the electronic device displays the sixth image frame.
[0318] The fifth image frame and the sixth image frame are two image frames in a third animation (eg, the window animation shown in FIG5 ), and the third operation is an operation detected by the second program and used to trigger the display of the third animation.
[0319] In some embodiments, the second program is a program that satisfies a first preset condition, and the first program is a program that satisfies a second preset condition.
[0320] Among them, the first preset condition includes one or more of the following: the second program belongs to the preconfigured first program list (i.e., the first program whitelist), the type of the third animation indicated by the second program belongs to the first animation type list (i.e., the first animation type whitelist), and the tasks to be executed corresponding to the second program are less than the first number (second threshold).
[0321] The second preset condition includes one or more of the following: the first program belongs to a preconfigured second program list (i.e., a second program whitelist), the type of the first animation indicated for display by the first program belongs to a second animation type list (i.e., a second animation type whitelist), the number of tasks to be executed corresponding to the first program is greater than a second number (a fourth threshold value), and the first number is less than the second data.
[0322] The present application also provides a chip system that can be applied to the electronic device in the aforementioned embodiment. The chip system includes at least one processor and at least one interface circuit. The processor can be the processor in the aforementioned electronic device. The processor and the interface circuit can be interconnected via a line. The processor can receive and execute computer instructions from the memory of the aforementioned electronic device via the interface circuit. When the computer instructions are executed by the processor, the electronic device can execute the various steps performed by the mobile phone in the aforementioned embodiment. Of course, the chip system can also include other discrete components, which are not specifically limited in the present application.
[0323] In some embodiments, through the description of the above embodiments, those skilled in the art can clearly understand that for the convenience and brevity of description, only the division of the above functional modules is used as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. The specific working process of the system, device and unit described above can refer to the corresponding process in the aforementioned method embodiment and will not be repeated here.
[0324] The functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.
[0325] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as flash memory, mobile hard disk, read-only memory, random access memory, magnetic disk or optical disk.
[0326] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any changes or substitutions within the technical scope disclosed in the present invention should be included in the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be based on the scope of protection of the claims.
Claims
1. A window animation processing method, characterized in that: Applied to electronic equipment, the method comprises: After detecting a first operation, a first program in the electronic device sends first data to a graphics synthesizer, the first data comprising a plurality of sets of animation parameters for synthesizing a first animation, the first animation comprising a plurality of image frames, the first operation being detected by the first program and used to trigger display of the first animation; After the graphic synthesizer receives the first data, the display screen of the electronic device displays the image frames of the first animation in sequence.
2. The method according to claim 1, characterized in that Before the first program sends the first data to the graphic synthesizer once, the method further includes: The first program determines a first frame number of the first animation; The first program determines a plurality of groups of animation parameters of the first data, the number of the plurality of groups of animation parameters is the same as the first number of frames, and a group of the animation parameters is used to synthesize one image frame in the first animation.
3. The method according to claim 2, characterized in that Before the electronic device determines the first frame number of the first animation, the method further includes: The first program determines a first refresh rate, where the first refresh rate is a predicted refresh rate of the display screen during the playing of the first animation; The first program determines a first frame number of the first animation, including: determining that the first frame number is equal to the product of the first refresh rate and the playback duration of the first animation.
4. The method according to any one of claims 1 to 3, characterized in that: While the electronic device sequentially displays each image frame corresponding to the first animation, the refresh rate of the display screen of the electronic device is fixed at the first refresh rate.
5. The method according to claim 1, characterized in that The first data includes a first animation parameter, a second animation parameter, and a third animation parameter which are arranged in sequence. After the graphic synthesizer receives the first data, the method further includes: The graphics synthesizer receives a first vertical synchronization signal; The graphics synthesizer processes the drawn first content according to the first animation parameter in response to the first vertical synchronization signal to obtain a first image frame of the first animation; The graphic synthesizer receives a second vertical synchronization signal, where the second vertical synchronization signal is a vertical synchronization signal of a next frame received by the graphic synthesizer after the first vertical synchronization signal; In the case where the first time interval is equal to the first duration, the graphic synthesizer processes the drawn second content according to the second animation parameter in response to the second vertical synchronization signal to obtain a second image frame of the first animation, wherein the first time interval is the time interval between receiving the first vertical synchronization signal and the second vertical synchronization signal, and the first duration is a fixed duration, which is used to indicate the sending frequency of the vertical synchronization signal; the electronic device sequentially displays the image frames of the first animation, further comprising: after obtaining the first image frame, displaying the first image frame; after obtaining the second image frame, displaying the second image frame; When the first time interval is greater than the first duration, the graphic synthesizer responds to the second vertical synchronization signal and processes the drawn third content according to the third animation parameters to obtain the third image frame of the first animation; the electronic device displays the image frames of the first animation in sequence, including: after obtaining the first image frame, displaying the first image frame; after obtaining the third image frame, skipping the second image frame and directly displaying the third image frame.
6. The method according to claim 1, characterized in that During the period when the display screen of the electronic device sequentially displays the image frames of the first animation, the method further includes: In response to a second operation of the user, the display screen of the electronic device cancels display of the first animation, where the second operation is an operation that triggers cancellation of display of the first animation; The display screen of the electronic device displays a preconfigured ending image frame.
7. The method according to claim 6, characterized in that Before the electronic device displays a preconfigured ending image frame, the method further includes: The first program sends second data to the graphics synthesizer, where the second data is animation parameters used to synthesize the end image frame.
8. The method according to claim 1, characterized in that During the period when the display screen of the electronic device sequentially displays the image frames of the first animation, the method further includes: After detecting a second operation of the user, the display screen of the electronic device cancels display of the first animation, where the second operation is an operation that triggers canceling display of the first animation; The display screen of the electronic device displays a second animation, wherein before canceling the display of the first animation, when the first image frame, the second image frame and the third image frame in the first animation have been displayed in sequence, the second animation includes the third image frame, the second image frame and the first image frame that need to be displayed in sequence.
9. The method according to claim 8, characterized in that Before the display screen of the electronic device displays the second animation, the method further includes: The graphic synthesizer of the electronic device receives third data from the first program, and the third data includes a plurality of sets of animation parameters for synthesizing the second animation.
10. The method according to claim 9, characterized in that The third data further includes a verification parameter, and the verification parameter is the same as at least one set of animation parameters in the first data. Before the display screen of the electronic device cancels displaying the first animation, the method further includes: The graphic synthesizer determines that a fourth image frame has been synthesized, the fourth image frame being an image frame synthesized according to fourth animation parameters in the first data, the fourth animation parameters including animation parameters that are the same as the verification parameters.
11. The method according to any one of claims 1 to 10, characterized in that: Each set of the animation parameters includes one of a parameter indicating a display position, a parameter indicating a display size, and a parameter indicating a display outline, or a combination thereof.
12. The method according to any one of claims 1 to 11, characterized in that: The method further comprises: After detecting the third operation, the second program of the electronic device sends fourth data to the graphic synthesizer, wherein the fourth data is an animation parameter for synthesizing a fifth image frame; After the graphic synthesizer receives the fourth data from the second program, the display screen of the electronic device displays the fifth image frame; The second program of the electronic device sends fifth data to the graphic synthesizer, wherein the fifth data is an animation parameter for synthesizing a sixth image frame; After the graphic synthesizer receives the fifth data from the second program, the display screen of the electronic device displays a sixth image frame; The fifth image frame and the sixth image frame are two image frames in the third animation, and the third operation is an operation detected by the second program and used to trigger the display of the third animation.
13. The method according to claim 12, characterized in that The second program is a program that satisfies a first preset condition, and the first program is a program that satisfies a second preset condition; The first preset condition includes one or more of the following: the second program belongs to a preconfigured first program the first animation type list, the second program indicates that the type of the third animation displayed belongs to the first animation type list, and the tasks to be executed corresponding to the second program are less than the first number; The second preset condition includes one or more of the following: the first program belongs to a preconfigured second program list, the type of the first animation indicated by the first program belongs to a second animation type list, the number of tasks to be executed corresponding to the first program is greater than a second number, and the first number is less than a second data.
14. An electronic device, characterized in that: The electronic device includes one or more processors and a memory; the memory is coupled to the processor, the memory is used to store computer program code, the computer program code includes computer instructions, and when the one or more processors execute the computer instructions, the one or more processors are used to execute the method as described in any one of claims 1-13.
15. A computer storage medium, characterized in that The method comprises computer instructions, which, when executed on an electronic device, cause the electronic device to execute the method as claimed in any one of claims 1 to 13.