Dynamic effect display method and electronic equipment
By transferring motion effect calculation to the Surface Flinger process, the method addresses motion effect freezes and jitters in electronic devices, ensuring smooth display and improved user experience.
Patent Information
- Application Number
- CN202310798033.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-30
- Publication Date
- 2024-12-31
AI Technical Summary
Existing electronic devices experience motion effect freezes, frame loss, and jitter during multiple application operations due to frequent cross-process communications in traditional motion effect display processes, particularly when overloaded.
Transfer the motion effect calculation capability to the Surface Flinger process, reducing cross-process communications by having the System Server or application process send motion effect information to Surface Flinger, which completes the calculations, ensuring smooth motion effect display.
This approach reduces system load and avoids motion effect freezes, frame loss, and jitter, enhancing user experience by maintaining smooth motion effect display.
Smart Images

Figure CN119225992A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of electronic equipment, and in particular to a motion effect display method and electronic equipment. Background Art
[0002] In order to enrich the picture and attract the user's vision, the electronic device can display motion effects during operation. For example, the electronic device can display window motion effects when the user opens or closes the window, minimizes or adjusts the window, and operates the floating window. For another example, when the electronic device jumps from one page to another page according to the user's operation, or jumps from the user interface (UI) of one application to the user interface of another application, a transition motion effect can be displayed.
[0003] In order to enrich and facilitate the lives of users, software developers have developed a variety of applications (APPs). In addition, as the functions of applications become more and more powerful, their volume will also increase. Based on this, when electronic devices run multiple applications, overload scenarios will often occur, which will further cause problems such as motion freeze, frame loss, and jitter in electronic devices. Summary of the invention
[0004] The present application provides a motion effect display method and an electronic device, which are used to ensure the smoothness of the motion effect display of the electronic device, avoid the problems of motion effect freeze, frame loss, and jitter, and improve the user experience.
[0005] In a first aspect, an embodiment of the present application provides a method for displaying a dynamic effect. The method can be applied to an electronic device, and the method includes the following steps:
[0006] A first process receives motion effect information from a second process, where the motion effect information is used to indicate at least one motion effect operation in the motion effect; then, the first process displays the motion effect according to the motion effect information, specifically including: the first process calculates display data of the at least one motion effect operation at different times according to the motion effect information; and calculates image frame data corresponding to different times according to the display data of the at least one motion effect operation at different times; the first process synthesizes and displays image frames corresponding to different times according to the image frame data corresponding to different times to display the motion effect; wherein, the first process is a process that runs the image plane engine Surface Flinger of the electronic device, and the second process is a process that runs the system service System Server or application of the electronic device.
[0007] Through this method, the motion effect calculation capability of the electronic device is transferred to the Surface Flinger process, which can significantly reduce the number of cross-process communications during the motion effect display process. For example, the System Server process or the application process can send the motion effect information to the Surface Flinger process through one cross-process communication to complete the motion effect display. Since the SurfaceFlinger process is a resident process at the bottom layer of the electronic device, compared with the traditional solution, this solution can avoid the SystemServer process or the application process from executing the motion effect calculation process. The Surface Flinger process completes the calculation process in the motion effect, which can reduce the system load of the electronic device, and can ensure the smoothness of the motion effect display of the electronic device, avoid the problems of motion effect freeze, frame loss, and jitter, and improve the user experience.
[0008] Optionally, the second process may send the animation information to the first process via an inter-process communication method (eg, an IPC method, a binder method, etc.).
[0009] Optionally, in the process of displaying the motion effect by the first process, after the first process calculates the display data of at least one motion effect operation at a moment, it calculates the image frame data corresponding to the moment based on the display data, and then synthesizes and displays the image frame corresponding to the moment. In this way, the first process can calculate the image frame data corresponding to different moments in sequence, and finally display the image frames in the motion effect in sequence.
[0010] In a possible design, each time the first process receives an image refresh signal, it calculates the display data of the at least one operation at the current moment according to the motion effect information, so that the first process can subsequently calculate the image frame data corresponding to the current moment based on the display data of the at least one operation at the current moment, and then synthesize and display the image frame corresponding to the current moment. Exemplarily, the image refresh signal can be a Vsync signal.
[0011] Through this design, the Surface Flinger process of the electronic device can complete the calculation process in the process of displaying the dynamic effect, which can avoid the System Server process or the application process from executing the calculation process, thereby reducing the system load of the electronic device and avoiding the process of transmitting the image frame data in the dynamic effect across processes multiple times.
[0012] In a possible design, the motion effect information includes relevant data of the at least one motion effect operation; the relevant data of any motion effect operation includes at least one of the following: the type of the motion effect operation, the start time of the motion effect operation, the duration of the motion effect operation, the offset time of the motion effect operation, the differentiator information of the motion effect operation, or the callback information of the motion effect operation; based on this, the first process can calculate the display data of the at least one motion effect operation at the current moment according to the relevant data of the at least one motion effect operation contained in the motion effect information each time after receiving the image refresh signal.
[0013] Optionally, the second process may serialize the motion effect information and then transmit the serialized motion effect information to the first process. Based on this, the first process may first perform a deserialization analysis on the serialized motion effect information before displaying the motion effect to obtain the original motion effect information.
[0014] In a possible design, when the first process displays the motion effect, the first process can synthesize and display the image frames corresponding to different moments on the layer corresponding to the system server or application according to the image frame data corresponding to different moments. With this design, the motion effect can be bound to the layer corresponding to the system server or application, so that the motion effect can be accurately displayed.
[0015] In a possible design, when the first process receives the animation stop instruction from the second process, the first process stops displaying the animation, that is, the first process stops calculating the display data of the at least one animation operation at different times. Optionally, the first process can delete the animation information after stopping displaying the animation.
[0016] In one possible design, when the first process receives an animation interruption instruction from the second process, the first process interrupts displaying the animation, that is, the first process interrupts calculating display data of at least one animation operation at different times; when the first process receives an animation restart instruction from the second process, the first process continues to display the animation, that is, the first process continues to calculate display data of at least one animation operation at different times.
[0017] Through the above design, the second process can send instructions through cross-process communication to achieve state management of the animation.
[0018] In a possible design, when the second process displays the motion effect, the second process does not calculate the display data of the at least one motion effect operation based on the motion effect information, and the second process does not send image frame data to the first process.
[0019] This design can avoid the second process from executing the motion effect calculation process during the motion effect display process, and can also significantly reduce the number of cross-process communications during the motion effect display process.
[0020] In a second aspect, an embodiment of the present application provides an electronic device, comprising a unit for executing each step of the method provided in the first aspect above. Optionally, the electronic device comprises a display screen and a processing unit; wherein the display screen is used to display a user interface; and the processing unit is used to execute the method provided in the first aspect. Optionally, the electronic device may also include a communication unit. The communication unit is used to receive and send data.
[0021] For example, the module or unit running the Surface Flinger process in the electronic device includes: a SurfaceFlinger main module and a motion effect management module. The motion effect management module is used to: receive motion effect information from the System Server process or the application process, wherein the motion effect information is used to indicate at least one motion effect operation in the motion effect; calculate the display data of the at least one motion effect operation at different times according to the motion effect information; and calculate the image frame data corresponding to different times according to the display data of the at least one motion effect operation at different times;
[0022] The Surface Flinger main module is used to synthesize and display image frames corresponding to different moments according to image frame data corresponding to different moments, so as to display the motion effect.
[0023] In a third aspect, an embodiment of the present application provides an electronic device, the electronic device comprising a display screen, at least one processor and a memory; the at least one processor is coupled to the memory, and the at least one processor is used to read a computer program stored in the memory to execute the method provided in the first aspect. The computer program code comprises computer instructions.
[0024] In a fourth aspect, an embodiment of the present application provides a chip, comprising a processor and a memory, wherein the processor is coupled to the memory, and the processor is used to call a computer program stored in the memory during runtime to implement the method provided in the first aspect above.
[0025] In a fifth aspect, an embodiment of the present application provides a computer storage medium, which stores a computer program. When the computer program is run on an electronic device, the computer executes the method provided in the first aspect.
[0026] In a sixth aspect, an embodiment of the present application provides a computer program product, which includes a computer program; when the computer program is run on a computer, the computer executes the method provided in the first aspect.
[0027] The technical effects that can be achieved in any of the second to sixth aspects mentioned above can refer to the description of the technical effects that can be achieved by any possible design in the first aspect mentioned above, and the repetitions will not be discussed here. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] Figure 1 This is a schematic diagram of a traditional motion effect display solution;
[0029] Figure 2 A structural diagram of an electronic device provided in an embodiment of the present application;
[0030] Figure 3 A schematic diagram of a layered architecture of a display system provided in an embodiment of the present application;
[0031] Figure 4 A schematic diagram of a layered architecture of another display system provided in an embodiment of the present application;
[0032] Figure 5 A structural diagram of serialized dynamic effect information provided in an embodiment of the present application;
[0033] Figure 6 A flowchart of a method for displaying dynamic effects provided in an embodiment of the present application;
[0034] Fig. 7A A flowchart of a dynamic effect display example provided in an embodiment of the present application;
[0035] Figure 7B A flowchart of a dynamic effect display example provided in an embodiment of the present application;
[0036] Figure 7C A schematic diagram of a transition effect provided in an embodiment of the present application;
[0037] Figure 8 A schematic diagram comparing a traditional dynamic effect display solution and a dynamic effect display method provided in an embodiment of the present application;
[0038] Fig. 9 A structural diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0039] The present application provides a motion effect display method and electronic device, which are used to ensure the smoothness of the motion effect display of the electronic device, avoid the problems of motion effect freeze, frame loss, and jitter, and improve the user experience. Among them, the method and the electronic device are based on the same technical concept. Since the principles of the method and the electronic device to solve the problem are similar, the implementation of the electronic device and the method can refer to each other, and the repeated parts will not be repeated.
[0040] Some terms in this application are explained below to facilitate understanding by those skilled in the art.
[0041] 1) Electronic equipment refers to equipment or devices with a display screen that can perform image processing and image display functions. Generally, electronic equipment has a display screen.
[0042] For example, the electronic device in the present application may be a personal computer (PC), a laptop, a computer, a netbook, a tablet computer, a car computer, a smart phone, a smart wearable device (such as a smart watch, a smart bracelet, smart glasses, etc.), etc. Of course, the electronic device may also be various portable devices, car terminal devices, personal digital assistants (PDA), smart home devices (such as smart TVs, etc.), and other smart devices. The present application does not limit the specific form of the electronic device.
[0043] The electronic device can realize its functions through the operating system installed and provide services to the user. For example, the electronic device can be equipped with, but not limited to, Or other operating systems.
[0044] 2) Animation is the animation process of dynamic changes in the user interface displayed on the display screen of the electronic device. In order to enhance the interactive experience between the user interface and the user, make the screen richer and achieve better visual effects, the electronic device can display animation during operation. These animations can include but are not limited to window animations, transition animations, etc. The following is a brief description of these two animations.
[0045] Window animations are animations that occur when a user operates a window on an electronic device. Optionally, when a user opens, closes, or minimizes a window, or when a user adjusts the window size, or when a user operates a floating window (or a small window, or a window in a split screen), the electronic device can display corresponding window animations. For example, when a user closes a floating window displayed on a smartphone, the floating window can fly out and disappear. For another example, when a user restores a floating window displayed on a smartphone to a normal window, the floating window can slowly grow until it becomes the size of a normal window.
[0046] Transition effects are the effects produced when the user operates the user interface of an electronic device and a transition occurs. Optionally, when an electronic device jumps from one page within an application to another page, or jumps from one application to another application, the electronic device can display a transition effect. For example, after a user opens the settings application on a smartphone and selects a mobile network from the homepage, the smartphone jumps from the homepage of the settings application (i.e., the first-level page) to the second-level page of the mobile network. For another example, a user opens the photo album application on a smartphone, selects a photo, clicks the share button and selects application, the smartphone then switches from the photo app's user interface to The app's sharing UI.
[0047] 3) Process and thread.
[0048] A process is a program with certain independent functions running on a certain data set. A process is an independent unit for resource allocation and scheduling in the operating system. For example, when each APP is running, the electronic device will start the process corresponding to the APP, such as process, In addition, the electronic device will also run corresponding processes for the services provided by the operating system, for example, the process running the system service (System Server) (hereinafter referred to as the System Server process) and the process running the image plane engine (Surface Flinger) (hereinafter referred to as the Surface Flinger process).
[0049] A thread is an entity in a process and is the basic unit for scheduling and dispatching by the central processing unit (CPU). It is a basic unit that is smaller than a process and can run independently. A thread itself basically does not have system resources, but only has resources that are essential for operation (such as program counters, registers, and stacks) and an independent execution sequence. However, it can share all the resources owned by the process with other threads belonging to the same process, and can also share data with other threads in the same process.
[0050] The main difference between processes and threads is that they are different ways of managing operating system resources. A process has an independent address space. If a process crashes, it will not affect other processes in protected mode. A thread is just a different execution path in a process. A thread has its own stack and local variables, but no independent address space. If a thread dies, the entire process crashes.
[0051] In short, a program has at least one process, and a process can contain one or more threads. The thread division scale is smaller than the process. A process has an independent memory unit during execution, while multiple threads in the same process need to share memory.
[0052] It should be noted that different processes can communicate with each other, that is, cross-process communication. Currently, cross-process communication methods include but are not limited to: inter-process communication (IPC), binder, etc.
[0053] 4) Surface Flinger is an independent service provided by the operating system of the electronic device. It mainly implements the functions of establishing, controlling and managing the surface, and finally synthesizes the image that needs to be displayed on the display screen, so that the electronic device can display the user interface in real time. As a resident service at the bottom of the electronic device, Surface Flinger needs to be in working state continuously during the operation of the electronic device. Therefore, the operating system of the electronic device needs to give priority to allocating resources to it (or the Surface Flinger process) to ensure that Surface Flinger is always ready for image synthesis.
[0054] The following is a brief explanation of the relevant concepts involved in Surface Flinger.
[0055] Surface, generally corresponds to Window. Window is concerned with hierarchy and layout, and is a class defined from the designer's perspective. Surface, on the other hand, is triggered from the implementation perspective and is a class that engineers care about and consider. It should be noted that some Surfaces are not related to Window, but are directly created by the program. For example, Surface View is used to display video content with hardware output.
[0056] Layer is the basic operation unit for Surface Flinger to perform image synthesis. Layer is created inside Surface Flinger when an application or system service requests to create a surface. Therefore, one surface corresponds to one layer.
[0057] In summary, an application or system server can create at least one surface. Each surface corresponds to a layer on the Surface Flinger side.
[0058] 5) Applications are used to be installed in electronic devices and can provide services to users after running. Applications can also be called application programs or application software.
[0059] The application may be developed by the manufacturer of the electronic device, or by the supplier of the operating system of the electronic device, or by a third-party application manufacturer, and this application does not limit this.
[0060] For example, the applications may include: call applications, camera applications, text messaging applications, chat applications, video applications, music applications, electronic map applications, social applications, etc.
[0061] It should be understood that in the embodiments of the present application, "at least one" refers to one or more, and "plurality" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural. The character " / " generally indicates that the associated objects before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can represent: a, b, c, a and b, a and c, b and c, or a, b and c, where a, b, c can be single or multiple.
[0062] In the embodiments of the present application, descriptions such as "when...", "in the case of...", "if" and "if" all mean that the electronic device will make corresponding processing under certain objective circumstances. It does not limit the time, nor does it require the electronic device to make a judgment when implementing it, nor does it mean that there are other limitations.
[0063] It should be noted that in this application, "used for indication" can include being used for direct indication and being used for indirect indication. When describing that a certain information is used to indicate A, it can include that the information directly indicates A or indirectly indicates A, but it does not mean that the information must carry A. Taking the first information used to indicate the first content as an example, the first information can include the first content, and can also include a part of the first content or an identifier or index of the first content, and can also include an algorithm for determining the first content, a calculation parameter, etc. This application does not limit the method of "indication".
[0064] In the present application, "including / comprising A" may be equivalent to "including / comprising A information". A information is used to indicate A.
[0065] In addition, it should be understood that, in the description of this application, words such as "first" and "second" are only used for the purpose of distinguishing the description, and cannot be understood as indicating or implying relative importance, nor can they be understood as indicating or implying an order.
[0066] Currently, in the traditional dynamic effect display solution, see Figure 1 As shown, the System Server process or application process in the electronic device is responsible for defining the motion effect, and sequentially calculates the image frame data in the motion effect that needs to be displayed. Afterwards, the System Server process or application process sends the image frame data calculated each time to the Surface Flinger process through cross-process communication. The Surface Flinger process synthesizes the image based on the received image frame data and displays the image on the display. The System Server process or application process in the electronic device, and the Surface Flinger process cyclically execute the above-mentioned process of calculating the image frame data and synthesizing and displaying the image, and finally realizes the motion effect display process of the electronic device.
[0067] Through the description of the above-mentioned traditional motion effect display scheme, it can be known that the calculation process of the image frame data in the motion effect display process and the synthesis display process are separated and completed by different processes. Therefore, the number of cross-process communications in this process is frequent. Once the process that needs to display the motion effect (such as the System Server process or the application process) or a thread involved in the motion effect display in the process is not scheduled in time (such as the electronic device overload scenario), it may cause unstable processing delays. Furthermore, there are also unstable factors in the delay of cross-process communication. In summary, the motion effects displayed by electronic devices will have problems such as freezes, frame drops, and jitters, resulting in poor smoothness of the motion effect display of electronic devices.
[0068] Furthermore, as the functions of applications become more and more powerful, their volume will also increase significantly. Scenarios where electronic devices are overloaded or overloaded when running multiple applications at the same time will also occur, which will also increase the probability of the above problems occurring in electronic devices. Therefore, how to ensure the smoothness of the dynamic display of electronic devices and avoid problems such as dynamic freezes, frame drops, and jitters is a problem that technicians in this field need to consider.
[0069] Based on this, the present application provides a method for displaying motion effects and an electronic device. In this method, the process running SystemServer or an application (referred to as System Server process or application process for short) defines the motion effect information and sends it to the process running Surface Flinger (referred to as Surface Flinger process for short). The Surface Flinger process displays the motion effect based on the received motion effect information. Through this solution, it can be seen that the motion effect calculation capability of the electronic device is sunk to the SurfaceFlinger process, which can significantly reduce the number of cross-process communications during the motion effect display process. Since the Surface Flinger process is a resident process at the bottom layer of the electronic device, compared with the traditional solution, this solution can avoid the System Server process or the application process from executing the motion effect calculation process. The Surface Flinger process completes the calculation process in the motion effect, which can reduce the system load of the electronic device, and can ensure the smoothness of the motion effect display of the electronic device, avoid the problems of motion effect freeze, frame loss, and jitter, and improve the user experience.
[0070] The solution provided in the embodiments of the present application is described in detail below with reference to the accompanying drawings.
[0071] The dynamic effect display method provided in the embodiment of the present application is applicable to Figure 2 The electronic device shown below Figure 2 , the structure of the electronic device provided in the embodiments of the present application is introduced.
[0072] like Figure 2 As shown, the electronic device 200 may include: a processor 210, an external memory interface 220, an internal memory 221, a USB interface 230, a charging management module 240, a power management module 241, a battery 242, an antenna 1, an antenna 2, a mobile communication module 250, a wireless communication module 260, an audio module 270, a speaker 270A, a receiver 270B, a microphone 270C, an earphone interface 270D, a sensor module 280, a button 290, a motor 291, an indicator 292, a camera 293, a display screen 294, and a SIM card interface 295, etc.
[0073] Understandably, Figure 2 The electronic device 200 shown is only an example and does not constitute a limitation on the electronic device. The electronic device may have more Figure 2 More or fewer components may be shown, two or more components may be combined, or there may be a different configuration of components. Figure 2 The various components shown in the drawings may be implemented in hardware, software, or a combination of hardware and software, including one or more signal processing and / or application specific integrated circuits.
[0074] The processor 210 may include one or more processing units, for example: the processor 210 may include a central processing unit (CPU), 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), etc. Among them, different processing units can be independent devices or integrated in one or more processors. Among them, the controller can be the nerve center and command center of the electronic device 200. The controller can generate an operation control signal according to the instruction opcode and the timing signal to complete the control of fetching and executing instructions.
[0075] A memory may also be provided in the processor 210 for storing instructions and data. In some embodiments, the memory in the processor 210 is a cache memory. The memory may store instructions or data that the processor 210 has just used or cyclically used. If the processor 210 needs to use the instruction or data again, it may be directly called from the memory. By providing the memory, the number of times the processor 210 accesses data to the internal memory 221 may be reduced, the waiting time of the processor 210 may be reduced, and thus the efficiency of the system may be improved.
[0076] The dynamic effect display method provided in the embodiment of the present application can be controlled by the processor 210 or completed by calling other components, such as calling the software program of the embodiment of the present application stored in the internal memory 221 to control cross-process communication and control the display screen to display the user interface.
[0077] The display screen 294 is used to display images, videos, etc. The display screen 294 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 or an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-oLed, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the electronic device 200 may include 1 or N display screens 294, where N is a positive integer greater than 1. The display screen 294 can be used to display information input by a user or information provided to a user and various graphical user interfaces (GUIs). For example, the display screen 294 can display windows, photos, videos, web pages, or files, etc. In addition, it can be understood that in some embodiments, the status bar may also include a Bluetooth icon, a Wi-Fi icon, an external device icon, etc. In some embodiments, when the processor 210 detects a touch operation of a user's finger (or a stylus, etc.) on an application icon, in response to the touch operation, the user interface corresponding to the application icon is opened and displayed on the display screen 294. In some embodiments, when the processor 210 detects a click operation of an external input device (such as a mouse, keyboard, etc.) of the electronic device 200 on an application icon, in response to the click operation, a corresponding control operation is performed on the application.
[0078] In the embodiment of the present application, the display screen 294 can be an integrated flexible display screen, or a spliced display screen consisting of two rigid screens and a flexible screen located between the two rigid screens. When the processor 210 runs the motion effect display method provided in the embodiment of the present application, the processor 210 can control the display screen 294 to display the motion effect.
[0079] The camera 293 is used to capture still images or videos. Optionally, the electronic device 200 may include 1 to N cameras 293. For example, the camera 293 may include a front camera or a rear camera, or a camera 293 may be used as both a front camera and a rear camera. Typically, the camera 293 may include a photosensitive element such as a lens group and an image sensor. Among them, the lens group includes a plurality of lenses (convex lenses or concave lenses) for collecting light signals reflected by the object to be photographed, and transmitting the collected light signals to the image sensor. The image sensor generates an original image of the object to be photographed based on the light signal.
[0080] The internal memory 221 can be used to store computer executable program codes, which include instructions. The processor 210 executes various functional applications and data processing of the electronic device 200 by running the instructions stored in the internal memory 221. The internal memory 221 may include a program storage area and a data storage area. The program storage area may store an operating system, a program code of at least one application, etc. The operating system may include, but is not limited to, The data storage area can store data created during the use of the electronic device 200 .
[0081] The internal memory 221 may also store one or more computer programs for executing the dynamic effect display method provided in the embodiment of the present application. The one or more computer programs are stored in the internal memory 221 and configured to be executed by one or more processors 210. The one or more computer programs include instructions, which may be used to execute the various steps in the following embodiments.
[0082] In addition, the internal memory 221 may include a high-speed random access memory and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc.
[0083] The sensor module 280 may include a fingerprint sensor, a touch sensor, a pressure sensor, a magnetic sensor, an ambient light sensor, an air pressure sensor, a bone conduction sensor, and the like.
[0084] Touch sensor, also known as "touch panel". The touch sensor can be set on the display screen 294. The touch sensor is used to detect touch operations acting on or near it. The touch sensor can pass the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through the display screen 294. In other embodiments, the touch sensor can also be set on the surface of the electronic device 200, which is different from the position of the display screen 294.
[0085] The wireless communication function of the electronic device 200 can be implemented through the antenna 1, the antenna 2, the mobile communication module 250, the wireless communication module 260, the modem processor and the baseband processor.
[0086] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in the electronic device 200 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve the utilization of the antennas. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In some other embodiments, the antenna can be used in combination with a tuning switch.
[0087] The mobile communication module 250 can provide solutions for wireless communications including 2G / 3G / 4G / 5G, etc., applied to the electronic device 200. The mobile communication module 250 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 250 can receive electromagnetic waves from the antenna 1, and filter, amplify, and process the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 250 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna 1. In some embodiments, at least some of the functional modules of the mobile communication module 250 can be set in the processor 210. In some embodiments, at least some of the functional modules of the mobile communication module 250 can be set in the same device as at least some of the modules of the processor 210.
[0088] The modem processor may include a modulator and a demodulator. Among them, the modulator is used to modulate the low-frequency baseband signal to be sent into a medium-high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After the low-frequency baseband signal is processed by the baseband processor, it is passed to the application processor. The application processor outputs a sound signal through an audio device (not limited to a speaker 270A, a receiver 270B, etc.), or displays an image or video through a display screen 294. In some embodiments, the modem processor may be an independent device. In other embodiments, the modem processor may be independent of the processor 210 and be set in the same device as the mobile communication module 250 or other functional modules.
[0089] The wireless communication module 260 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., which are applied to the electronic device 200. The wireless communication module 260 can be one or more devices integrating at least one communication processing module. The wireless communication module 260 receives electromagnetic waves via the antenna 2, modulates the frequency of the electromagnetic wave signal and performs filtering, and sends the processed signal to the processor 210. The wireless communication module 260 can also receive the signal to be sent from the processor 210, modulate the frequency of it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.
[0090] In addition, the electronic device 200 can implement audio functions through the audio module 270, the speaker 270A, the receiver 270B, the microphone 270C, the headphone interface 270D, and the application processor. For example, music playback, recording, etc. The electronic device 200 can receive the key 290 input and generate key signal input related to the user settings and function control of the electronic device 200. The electronic device 200 can generate a vibration prompt using the motor 291. The indicator 292 in the electronic device 200 can be an indicator light, which can be used to indicate the charging status, power changes, and can also be used to indicate messages, missed calls, notifications, etc. The SIM card interface 295 in the electronic device 200 is used to connect the SIM card. The SIM card can be inserted into the SIM card interface 295, or pulled out from the SIM card interface 295, to achieve contact and separation with the electronic device 200.
[0091] The display system of the electronic device provided in the embodiment of the present application can adopt a layered architecture. That is, the display system of the electronic device can be divided into multiple layers, and each layer has a clear role and division of labor. The layers communicate with each other through corresponding software interfaces. Figure 3 , which illustrates the display architecture of an electronic device.
[0092] like Figure 3 As shown, the display system of the electronic device can be divided into four layers, from top to bottom, namely, the application layer, the System Server layer, the Surface Flinger layer, and the hardware abstraction layer (HAL).
[0093] The application layer is the top layer of the operating system, including native applications of the operating system and third-party applications, such as camera, desktop, system user interface (systemUI) gallery, settings, Music, videos, messages and more.
[0094] The System Server layer is an important part of the operating system of electronic devices. The System Server process is an important process in the operating system. The main services of the system reside in it, such as the Window Manager Server (WMS), Activity Manager Service (AMS), and Package Manager Service (PackageManagerServer). The System Server is responsible for starting various services of the system.
[0095] Surface Flinger layer provides Surface Flinger service. Surface Flinger is an independent service provided by the operating system of the electronic device. It is a resident service at the bottom layer of the electronic device. During the operation of the electronic device, the Surface Flinger process needs to run continuously. The operating system of the electronic device will give priority to allocating resources to it to ensure that the Surface Flinger process can perform image synthesis at any time and ensure the normal display function of the electronic device.
[0096] HAL is an interface layer between the operating system kernel and the hardware circuit of an electronic device. Its purpose is to abstract the hardware. Figure 3 As shown in FIG. 1 , HAL includes a hardware composer (HWC). The hardware composer is mainly responsible for image synthesis and image display.
[0097] During the startup of an application in the application layer or a system server in the system server layer, you can request to create at least one Surface. Surface Flinger will create a corresponding layer for each Surface to bind the application or system server to the layer so that the user interface of the application or system server corresponding to the layer can be displayed on each layer.
[0098] based on Figure 3The layered architecture of the display system shown in the figure, in the traditional dynamic effect display solution, the System Server process or the application process can define the dynamic effect according to the display requirements during operation, and calculate the image frame data in sequence; then the System Server process or the application process sends the image frame data calculated each time to the Surface Flinger process through cross-process communication. Based on the received image frame data, the Surface Flinger process synthesizes the image in the layer (Layer) corresponding to the System Server or application, and finally synthesizes and displays the image through the HWC in the HAL. The System Server process or the application process in the electronic device, and the Surface Flinger process cyclically execute the above-mentioned process of calculating the image frame data and synthesizing and displaying the image, and finally realize the dynamic effect display process of the electronic device.
[0099] Through the above analysis of traditional motion effect display solutions, it can be seen that due to the separation of the calculation process and the synthesis display process of the image frame data, cross-process communications occur frequently. Due to factors such as unstable processing delays of the System Server process or the application process and unstable delays of cross-process communications, the motion effects displayed on electronic devices are more likely to be stuck, lost frames, jitter, and other problems, and ultimately the motion effect display smoothness of the electronic device may be poor.
[0100] In order to ensure the smoothness of the dynamic display of electronic devices and avoid problems such as dynamic effect freeze, frame loss, and jitter, based on Figure 3 The layered architecture of the display system shown in FIG. 1 is another display system architecture provided in the embodiment of the present application. Figure 4 shown.
[0101] like Figure 4 As shown, the application in the application layer may include a remote animation module, and the remote animation module is used to define animations and generate animation information during the running process of the application.
[0102] System Server includes SurfaceAnimRunner, which is used to define animations and generate animation information during the operation of System Server. System Server also includes AnimationAdaptor, which is mainly responsible for adapting various animations defined by applications or System Server, realizing animation state management and transparent transmission of animation information.
[0103] Surface Flinger includes at least an image synthesis module and a motion effect management module.
[0104] The animation management module is responsible for animation status management, animation basic capabilities, layer capability docking and other functions. Figure 4 As shown in , the dynamic effect management module can start, stop, interrupt or restart the dynamic effect according to the instruction from the dynamic effect adapter, and can also control the parallel display of multiple dynamic effects. The dynamic effect management module can also analyze, process and calculate the dynamic effect information from the dynamic effect adapter to determine the type, attribute, object of action, differencer, callback information, etc. of at least one dynamic effect operation in the dynamic effect to be displayed, so as to calculate the image frame data at the current moment according to the above content. As shown in the figure, the type of dynamic effect operation may include but is not limited to processing operations on layers such as displacement, cropping, scaling, rounded corners, rotation, shadow, transparency, blur, etc. The attributes of the dynamic effect operation may include display parameters and operation target parameters of the dynamic effect operation. Exemplarily, the display parameters of the dynamic effect operation may include but are not limited to at least one of the following: the start time, duration, offset time, etc. of the dynamic effect operation. The operation target parameters of the dynamic effect operation are adaptively set according to the type of dynamic effect operation, for example, the target position or target offset value of the displacement, the target size of the cropping, the target ratio of the scaling, the target angle of the rotation, the target value of the transparency, etc.
[0105] Optionally, the motion effect management module can also perform processing corresponding to the motion effect operation type on the layer (Layer), such as displacement, scaling, rotation, etc.
[0106] The image synthesis module is responsible for the traditional image synthesis function of Surface Flinger, and is used to synthesize images in the System Server or the corresponding layer of the application based on the image frame data calculated by the motion effect management module.
[0107] It should be noted that, as an example, this embodiment does not limit the names of the functional modules in each layer, and each functional module may have other names. For example, since the animation management module can bring an extreme animation visual experience to the user of the electronic device, the animation management module may also be called the extreme animation core (EACore) module.
[0108] based on Figure 4 The structure of the display system shown in the figure, the embodiment of the present application also provides a dynamic effect display method, which will be described in detail below. Figure 4 The flow of this method is described.
[0109] S401: In one embodiment, when the application process is running, the remote animation module in the application process can generate animation information, and can send the animation information to the animation adapter in the System Server process through cross-process communication. Optionally, the remote animation module can send an animation start instruction carrying the animation information to the animation adapter. In another embodiment, when the System Server process is running, the plane animation runner in the System Server process can generate animation information and send the animation information to the animation adapter.
[0110] The motion effect information is used to indicate the motion effect display content. For example, the motion effect information can be used to indicate at least one motion effect operation in the motion effect to be displayed.
[0111] S402: The animation adapter in the System Server process sends the animation information to the Surface Flinger process through cross-process communication. Optionally, the animation adapter can send an animation start instruction carrying the animation information.
[0112] Optionally, the animation adapter can directly send the animation information to the animation management module in the Surface Flinger process, such as Figure 4 As shown in S402 in the above, the animation information can also be sent to other modules in the Surface Flinger process, and the other modules forward the animation information to the animation management module. The embodiment of the present application does not limit the specific implementation method of the animation adapter sending the animation information to the Surface Flinger process through cross-process communication.
[0113] S403: After receiving the motion effect information (or the motion effect start instruction), the motion effect management module starts displaying the motion effect; calculates the image frame data according to the motion effect information; and sends the calculated image frame data to the image synthesis module in the same process.
[0114] S404: The image synthesis module performs image synthesis based on the received image frame to obtain an image frame, and calls the hardware synthesizer of the HAL to display the image frame. The image synthesis module can perform image synthesis on the layer (Layer) corresponding to the System Server or application, and bind the animation to the layer (Layer) corresponding to the System Server or application.
[0115] The Surface Flinger process can call the motion effect management module and the image synthesis module to calculate the image frame data corresponding to the current moment after each image refresh signal (such as the vertical synchronization (Vsync) signal) is received, and synthesize and display the image frame corresponding to the current moment based on the image frame data. The above process is repeated to realize the display of motion effects.
[0116] In one implementation, the animation information may include relevant data of at least one animation operation. The relevant data of any animation operation may include at least one of the following: the type of the animation operation, the start time of the animation operation, the duration of the animation operation, the offset time of the animation operation, the differentiator information of the animation operation, or the callback information of the animation operation.
[0117] The motion effect management module can realize the functions of motion effect basic capability management and layer capability docking management based on the content contained in the motion effect information.
[0118] It should be noted that after the above-mentioned process of starting the animation effect, the remote animation effect module or the plane animation effect runner can also send animation stop instructions, animation interrupt instructions or animation restart instructions to the animation effect management module through the cross-process communication of the animation effect adapter, so that the animation effect management module can implement the animation status management function according to the instructions of the upper layer.
[0119] Optionally, in the above process, when the remote animation module, the surface animation runner or the animation adapter sends the animation information, it can serialize the animation information to improve the transmission efficiency of the animation information. Based on this, after receiving the serialized animation information, the animation management module can first deserialize and parse it to obtain the original animation information; or after other modules in the Surface Flinger process receive the serialized animation information from the animation adapter, they can first deserialize and parse it to obtain the original animation information, and then send the original animation information to the animation management module in the same process.
[0120] For example, Figure 5 As shown, the serialized animation information (i.e., animation set) may include: the size of the animation set (Size, i.e., the animation to be displayed includes several animation operations), and the relevant data of at least one serialized animation operation. Taking the relevant data of animation operation 1 as an example, the relevant data of animation operation 1 may include, but is not limited to, parameters such as the type of animation operation 1 (Type), the start time of animation operation 1 (StartTime), the duration of animation operation 1 (duration), the offset time of animation operation 1 (Offset), the values of the above parameters (factors), and the interpolator information of animation operation 1. Figure 5As shown, the differentiator information of the motion effect operation 1 includes: whether the motion effect operation 1 has a differentiator, if there is a differentiator, the type of the differentiator, and the values of each parameter in the differentiator information.
[0121] It should also be noted that the image synthesis module and the motion effect management module in the Surface Flinger process can be located in the same thread of the Surface Flinger process or in different threads, and this application does not limit this.
[0122] pass Figure 4 The illustrated embodiment provides a hierarchical structure of a display system and a method for displaying motion effects. The SystemServer process or the application process can define motion effect information and send it to the Surface Flinger process. The SurfaceFlinger process displays the motion effect based on the received motion effect information. It can be seen from this solution that the motion effect calculation capability of the electronic device is transferred to the Surface Flinger process, which can significantly reduce the number of cross-process communications during the motion effect display process. For example, in the process shown in S401-S404, the System Server process or the application process can send the motion effect information to the Surface Flinger process through one cross-process communication to complete the motion effect display. Since the Surface Flinger process is a resident process at the bottom layer of the electronic device, compared with the traditional solution, the Surface Flinger process of this solution completes the calculation process in the motion effect, which can reduce the system load of the electronic device, and can ensure the smoothness of the motion effect display of the electronic device, avoid the problems of motion effect freeze, frame loss, and jitter, and improve the user experience.
[0123] Based on the same technical concept, in order to ensure the smoothness of the dynamic effect display of the electronic device and avoid the problems of dynamic effect freeze, frame loss, and jitter, the embodiment of the present application provides a dynamic effect display method. Figure 6 The flowchart shown illustrates the method provided in the embodiment of the present application.
[0124] Among them, the first process involved in the embodiment of the present application is the process of running the Surface Flinger of the electronic device, that is, the Surface Flinger process; the second process is the process of running the system service System Server or application of the electronic device, that is, the System Server process or the application process.
[0125] S601: During the running process, the second process can define the animation and generate animation information according to the display requirements. The second process can send the animation information to the first process through cross-process communication. The first process receives the animation information from the second process. The animation information is used to indicate the animation display content, for example, the animation information is used to indicate at least one animation operation in the animation to be displayed.
[0126] Optionally, in an actual application scenario, the second process may generate the animation information based on, but not limited to, at least one of the software design of the system service System Server or the application, the operation performed by the user, and the running status of the system service System Server or the application.
[0127] Exemplarily, the second process may send the animation information to the first process through, but not limited to, cross-process communication methods such as IPC and binder.
[0128] Optionally, in S601, the second process may send motion effect information and a motion effect start instruction to the first process, or the second process may send a motion effect start instruction carrying the motion effect information to the first process, so that the first process may start displaying the motion effect according to the motion effect start instruction.
[0129] S602: The first process calculates display data of at least one motion effect operation at different times according to the motion effect information; and calculates image frame data corresponding to different times according to the display data of at least one motion effect operation at different times.
[0130] In one embodiment, after receiving the image refresh signal each time, the first process calculates the display data of the at least one animation operation at the current moment according to the animation information, so that the first process can subsequently calculate the image frame data corresponding to the current moment based on the display data of the at least one operation at the current moment, and then synthesize and display the image frame corresponding to the current moment. Exemplarily, the image refresh signal can be a hardware signal sent by hardware in the HAL, such as a Vsync signal.
[0131] Optionally, the animation information may include relevant data of the at least one animation operation. The relevant data of any animation operation includes at least one of the following: the type of the animation operation, the start time of the animation operation, the duration of the animation operation, the offset time of the animation operation, the differencer information of the animation operation, or the callback information of the animation operation.
[0132] Based on this, the first process can calculate the display data of the at least one motion effect operation at the current moment according to the relevant data of the at least one motion effect operation included in the motion effect information each time the image refresh signal is received.
[0133] Optionally, when sending the animation information, the second process may serialize the animation information, such as Figure 5 As shown, before executing S602, the first process needs to perform a deserialization analysis on the serialized dynamic effect information to obtain the original dynamic effect information.
[0134] S603: The first process synthesizes and displays image frames corresponding to different moments according to the image frame data corresponding to different moments to display motion effects.
[0135] In the embodiment of the present application, after the first process obtains the image frame data corresponding to a moment, it can synthesize and display the image frame corresponding to the moment according to the image frame data corresponding to the moment, so that the first process loops through S602-S603 to achieve the display of dynamic effects. Taking the first moment as an example, in one embodiment, after the first process calculates and obtains the image frame data corresponding to the first moment, it can synthesize and display the image frame corresponding to the first moment according to the image frame data corresponding to the first moment.
[0136] It should also be noted that when the first process executes S603, the first process can synthesize and display the image frame corresponding to each moment on the layer corresponding to the System Server or application according to the image frame data corresponding to each moment. In this way, the first process can bind the animation to the layer corresponding to the System Server or application.
[0137] It should be noted that in the process of the first process displaying the animation through S602-S603, the second process does not calculate the display data of the at least one animation operation at different times according to the animation information (nor does it calculate the image frame data corresponding to different times), and does not send the image frame data to the first process.
[0138] Optionally, after S603, the second process may also send instructions to the first process through cross-process communication to implement state management of the animation effect, as shown in the following implementations:
[0139] Implementation method 1: The second process sends an animation stop instruction to the first process; when the first process receives the animation stop instruction from the second process, the first process stops displaying the animation, that is, the first process stops executing S602-S603. Optionally, after stopping displaying the animation, the first process can also delete the animation information received through S601.
[0140] Implementation method 2: The second process sends an animation interruption instruction to the first process; when the first process receives the animation interruption instruction from the second process, the first process interrupts the display of the animation, that is, the first process interrupts the execution of S602-S603. The second process can also send an animation restart instruction to the first process; when the first process receives the animation restart instruction from the second process, the first process can continue to display the animation, that is, the first process continues to execute S602-S603.
[0141] An embodiment of the present application provides a method for displaying motion effects. In this method, a System Server process or an application process can define motion effect information and send it to a Surface Flinger process. The Surface Flinger process displays the motion effect based on the received motion effect information. Through this solution, it can be seen that the motion effect calculation capability of the electronic device is sunk to the Surface Flinger process, which can significantly reduce the number of cross-process communications during the motion effect display process. For example, in the above process, the System Server process or the application process can send the motion effect information to the Surface Flinger process through one cross-process communication to complete the motion effect display. Since the Surface Flinger process is a resident process at the bottom layer of the electronic device, therefore, compared with the traditional solution, the Surface Flinger process of this solution completes the calculation process in the motion effect, which can reduce the system load of the electronic device, and can ensure the smoothness of the motion effect display of the electronic device, avoid the problems of motion effect freeze, frame loss, and jitter, and improve the user experience.
[0142] Based on the dynamic effect display method provided in the above embodiment, the present application also provides a dynamic effect display example. This example is described below in conjunction with the accompanying drawings.
[0143] like Fig. 7A As shown in the figure, the System Server process can send the animation information to the SurfaceFlinger process through the following process:
[0144] S701: When the System Server process needs to display transition animation during operation, a start animation instruction can be sent to the window animation rule unit (WinAnimSpec) through the plane animation runner (SurfaceAnimRunner).
[0145] S702: After receiving the instruction to start the animation, the window animation rule unit (WinAnimSpec) obtains the animation information according to the set window animation rule.
[0146] Optionally, the window animation rule unit (WinAnimSpec) can serialize the obtained animations. For the specific process, please refer to Figure 4 or Figure 6 The description in the illustrated embodiment will not be repeated here.
[0147] S703: The window animation rule unit (WinAnimSpec) transmits the animation information to the animation adapter (AnimationAdaptor) through the surface control unit (SurfaceControl) and the surface computing client (SurfaceComposerClient).
[0148] S704: The animation adapter (AnimationAdaptor) transmits the animation information to the Surface Flinger process through the binder method.
[0149] based on Figure 7B The functional module division method in the Surface Flinger process shown, optionally, the Surface Flinger main module in the Surface Flinger process can receive the motion effect information through S704, and can send the motion effect information to the motion effect manager in the motion effect management module, and the motion effect manager will perform subsequent calculation and processing; or the motion effect manager in the Surface Flinger process can directly receive the motion effect information from the motion effect adapter in the System Server process through S704.
[0150] Afterwards, if Figure 7B As shown, the Surface Flinger process can display animations through the following process:
[0151] S705: The Surface Flinger main module in the Surface Flinger process receives a Vsync signal from the hardware.
[0152] The Surface Flinger main module is responsible for the main functions of Surface Flinger, including synthesizing display image frames. For example, the Surface Flinger main module and the layer state unit can be included in Figure 4 The image synthesis module of the Surface Flinger layer in the display system architecture shown.
[0153] S706: The Surface Flinger main module sends an image frame data request to the motion effect manager in the motion effect management module to request the motion effect manager to return the image frame data corresponding to the current moment.
[0154] S707: The animation manager retrieves all layers (Layer) in the current Surface Flinger, and determines the layer (Layer) that needs to display the animation, that is, the animation manager can determine at least one layer (Layer) bound to at least one received animation information. This example is explained by taking the layer (Layer) that needs to display the animation as the layer (Layer) corresponding to the System Server - Layer 1 as an example. The animation manager determines the animation operation that Layer 1 needs to display (that is, at least one animation operation included in the animation information) based on the received animation information. This example is explained by taking the animation information including animation operation 1 as an example.
[0155] S708: The animation manager obtains the display calculation result of the animation operation 1 at the current moment from the display calculation unit of the animation operation 1.
[0156] Among them, the display calculation unit of the dynamic effect operation 1 can calculate the display calculation result of the dynamic effect operation 1 at the current moment according to the data other than the differentiator information and the callback information in the relevant data of the dynamic effect operation 1 in the dynamic effect information.
[0157] S709: The animation manager obtains the differentiator calculation result of the animation operation 1 at the current moment from the differentiator calculation unit of the animation operation 1.
[0158] Among them, the differentiator calculation unit of the dynamic effect operation 1 can calculate the differentiator calculation result of the dynamic effect operation 1 at the current moment according to the differentiator information in the relevant data of the dynamic effect operation 1 in the dynamic effect information.
[0159] S710: The display data of the animation operation 1 at the current moment includes: the display calculation result of the animation operation 1 at the current moment obtained through S708, and the difference calculation result of the animation operation 1 at the current moment obtained through S709. The animation manager can calculate the image frame data corresponding to Layer1 at the current moment based on the display data of the animation operation 1 at the current moment, and return the image frame data corresponding to Layer1 at the current moment to the Surface Flinger main module.
[0160] S711: The Surface Flinger main module may call the layer state unit to set the layer state of Layer 1 according to the image frame data corresponding to Layer 1 at the current moment. That is, the Surface Flinger main module synthesizes and displays the current corresponding image frame on layer Layer 1 according to the image frame data corresponding to Layer 1 at the current moment.
[0161] Since the Vsync signal is sent according to the Vsync cycle, the Surface Flinger process can execute the above process in a loop according to the Vsync cycle, such as Figure 7B As shown, the display of the System Server transition effect is completed.
[0162] It should be noted that Fig. 7A and Figure 7B The process shown is an example and does not constitute any limitation on the method provided in this application. Each unit or module in the above process can call related functions, classes, functional bodies, etc. to complete the implementation of related steps. In addition, the above process does not constitute any limitation on the division of each unit or module in the System Server process or Surface Flinger. According to the functional logic division, a unit or module can also be divided into multiple sub-units, or multiple units or modules can be coupled in one unit or module.
[0163] Through Fig. 7A and Figure 7B After the process shown, the electronic device can display the System Server transition effect, such as Figure 7C As shown: the homepage of the Settings app is gradually covered by the secondary mobile network page that flies out from the right.
[0164] Figure 8 A comparison chart of the traditional solution and the solution provided in the present application is provided, wherein the solid black line represents cross-process communication, and the dotted black line represents intra-process communication. In the traditional motion effect display solution, the System Server process needs to continuously refresh the software, and calculate each image frame data in the motion effect frame by frame, and send each calculated image frame data to the SurfaceFlinger process in turn; the Surface Flinger process then synthesizes and displays each image frame frame by frame based on the physical refresh signal. With the motion effect solution provided in the present application, the System Server process only needs to send the defined motion effect information to the SurfaceFlinger process; the Surface Flinger main module in the Surface Flinger process instructs the motion effect management module to calculate each image frame data in the motion effect frame by frame according to the physical refresh signal; the Surface Flinger main module synthesizes and displays each image frame frame by frame based on the received image frame data. As shown Figure 8 As shown, compared with the traditional solution, the number of cross-process communications in the present application solution is reduced from n to 1, and the number of software refreshes of the System Server process is also reduced from n to 1. Since the SurfaceFlinger process is a resident process at the bottom of the electronic device, it is obvious that compared with the traditional solution, the Surface Flinger process in the present solution completes the calculation process in the animation, which can reduce the system load of the electronic device and ensure the smoothness of the animation display of the electronic device, avoid the problems of animation freeze, frame loss, and jitter, and improve the user experience.
[0165] It should also be noted that each step involved in the above embodiments can be performed by an electronic device, or by a chip, processor, or chip system in the device, and the embodiments of the present application do not limit them. In addition, the specific implementation methods or examples in the above embodiments do not limit the solutions provided in the embodiments of the present application.
[0166] It should be noted that in the above embodiments, some steps can be selected for implementation, and the order of the steps in the diagram can be adjusted for implementation, and this application does not limit this. It should be understood that executing some steps in the diagram, adjusting the order of the steps, or combining them for specific implementation all fall within the scope of protection of this application.
[0167] It should be noted that the "steps" in the embodiments of the present application are only for illustration, and are a method of expression used to better understand the embodiments, and do not constitute a substantial limitation on the execution of the scheme of the present application. For example, the "steps" can also be understood as "features". In addition, the steps do not constitute any limitation on the execution order of the scheme of the present application. Any changes in the order of steps, step merging, or step splitting made on this basis that do not affect the implementation of the overall scheme, and the resulting new technical solutions are also within the scope of the disclosure of the present application.
[0168] Based on the same concept, the present application also provides an electronic device. Fig. 9 As shown, the electronic device includes one or more processors 901, a memory 902, a transceiver 903 and a display screen 904. For example, the above-mentioned components can be connected via one or more communication buses. Among them, the one or more computer programs are stored in the above-mentioned memory 902 and are configured to be executed by the processor 901. The one or more computer programs include instructions, and the above-mentioned instructions can be used to enable the electronic device to perform each step of the method in the above-mentioned embodiments.
[0169] Exemplarily, the processor 901 may be Figure 2 The processor 210 shown. The memory 902 may be specifically Figure 2 The internal memory 221 shown and / or the external memory connected to the electronic device. The transceiver 903 can be Figure 2 The mobile communication module 250 and / or the wireless communication module 260 shown. The display screen 904 can be specifically Figure 2 The display screen 294 is shown, and the embodiment of the present application does not impose any limitation on this.
[0170] Based on the same concept, an embodiment of the present application also provides an electronic device, which includes a unit for executing each step of the method provided in the above embodiment. Optionally, the electronic device may include a display screen and a processing unit. Optionally, the electronic device may also include a communication unit. The display screen is used to display an interface; the communication unit is used to receive and send data; and the processing unit is used to execute the method provided in the above embodiment.
[0171] For another example, the modules or units running the Surface Flinger process in the electronic device include: the Surface Flinger main module and the motion effect management module. The main functions of each module are as follows:
[0172] The motion effect management module is used to: receive motion effect information from a System Server process or an application process, wherein the motion effect information is used to indicate at least one motion effect operation in the motion effect; calculate display data of the at least one motion effect operation at different times according to the motion effect information; and calculate image frame data corresponding to different times according to the display data of the at least one motion effect operation at different times;
[0173] The Surface Flinger main module is used to synthesize and display image frames corresponding to different moments according to image frame data corresponding to different moments, so as to display the motion effect.
[0174] For the specific functions of the above modules, please refer to the above embodiments and will not be repeated here.
[0175] Based on the above embodiments, the embodiments of the present application further provide a computer program product, which includes a computer program; when the computer program runs on a computer, the computer executes the method provided in the above embodiments.
[0176] Based on the above embodiments, the embodiments of the present application further provide a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a computer, the computer executes the method provided in the above embodiments.
[0177] Optionally, the above-mentioned computer may include, but is not limited to, electronic devices.
[0178] The storage medium may be any available medium that can be accessed by a computer. For example, but not limited to, a computer-readable medium may include RAM, ROM, EEPROM, CD-ROM or other optical disk storage, magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer.
[0179] Based on the above embodiments, the embodiments of the present application further provide a chip, the chip is used to read the computer program stored in the memory, and implement the method provided in the above embodiments. Optionally, the chip may include a processor and a memory, the processor is coupled to the memory, and is used to read the computer program stored in the memory, and implement the method provided in the above embodiments.
[0180] Based on the above embodiments, the embodiments of the present application provide a chip system, which includes a processor for supporting a computer device to implement the functions involved in the electronic device in the above embodiments. In a possible design, the chip system also includes a memory, which is used to store the necessary programs and data for the computer device. The chip system can be composed of a chip, or it can include a chip and other discrete devices.
[0181] In summary, the embodiments of the present application provide a method for displaying motion effects and an electronic device. In this method, the process running System Server or an application (referred to as System Server process or application process for short) defines the motion effect information and sends it to the process running Surface Flinger (referred to as Surface Flinger process for short). The Surface Flinger process displays the motion effect based on the received motion effect information. Through this solution, it can be seen that the motion effect computing capability of the electronic device is sunk to the Surface Flinger process, which can significantly reduce the number of cross-process communications during the motion effect display process. Since the SurfaceFlinger process is a resident process at the bottom layer of the electronic device, therefore, compared with the traditional solution, the Surface Flinger process of this solution completes the calculation process in the motion effect, which can reduce the system load of the electronic device, and can ensure the smoothness of the motion effect display of the electronic device, avoid the problems of motion effect freeze, frame loss, and jitter, and improve the user experience.
[0182] As used in the above embodiments, the term "when..." or "after..." may be interpreted to mean "if..." or "after..." or "in response to determining..." or "in response to detecting...", depending on the context. Similarly, the phrase "upon determining..." or "if (the stated condition or event) is detected" may be interpreted to mean "if determining..." or "in response to determining..." or "upon detecting (the stated condition or event)" or "in response to detecting (the stated condition or event)", depending on the context.
[0183] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented by software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present invention is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk Solid State Disk (SSD)), etc. In the absence of conflict, the solutions of the above embodiments can be used in combination.
[0184] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0185] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0186] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0187] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable device. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0188] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.
Claims
1. A method for displaying a dynamic effect, characterized in that: include: The first process receives the motion effect information from the second process; wherein the first process is a process running the image plane engine Surface Flinger of the electronic device, and the second process is a process running the system service SystemServer or application of the electronic device; the motion effect information is used to indicate at least one motion effect operation in the motion effect; The first process calculates display data of the at least one motion effect operation at different times according to the motion effect information; and calculates image frame data corresponding to different times according to the display data of the at least one motion effect operation at different times; The first process synthesizes and displays image frames corresponding to different moments according to the image frame data corresponding to different moments, so as to display the motion effect.
2. The method according to claim 1, characterized in that The first process calculates display data of the at least one dynamic effect operation at different times according to the dynamic effect information, including: Each time the first process receives an image refresh signal, it calculates display data of the at least one motion effect operation at the current moment according to the motion effect information.
3. The method according to claim 2, characterized in that The image refresh signal is a vertical synchronization Vsync signal.
4. The method according to any one of claims 1 to 3, characterized in that: The motion effect information includes relevant data of the at least one motion effect operation; The relevant data of any animation operation includes at least one of the following: the type of the animation operation, the start time of the animation operation, the duration of the animation operation, the offset time of the animation operation, the differentiator information of the animation operation, or the callback information of the animation operation.
5. The method according to any one of claims 1 to 4, characterized in that: The first process synthesizes and displays image frames corresponding to different moments according to image frame data corresponding to different moments, including: The first process synthesizes and displays image frames corresponding to different moments on a layer corresponding to the System Server or the application according to the image frame data corresponding to different moments.
6. The method according to any one of claims 1 to 5, characterized in that: During the process of the first process displaying the motion effect, the second process does not calculate the display data of the at least one motion effect operation according to the motion effect information, and the second process does not send the image frame data to the first process.
7. The method according to any one of claims 1 to 6, characterized in that: The method further comprises: When the first process receives the motion effect stop instruction from the second process, the first process stops calculating the display data of the at least one motion effect operation at different times to stop displaying the motion effect.
8. The method according to any one of claims 1 to 7, characterized in that: The method further comprises: When the first process receives the motion effect interruption instruction from the second process, the first process interrupts the calculation of the display data of the at least one motion effect operation at different times to interrupt the display of the motion effect; When the first process receives the animation restart instruction from the second process, the first process continues to calculate the display data of the at least one animation operation at different times to continue to display the animation.
9. An electronic device, characterized in that: The electronic device includes a display screen, a memory and one or more processors; The memory is used to store computer program codes, and the computer program codes include computer instructions; when the computer instructions are executed by the one or more processors, the electronic device executes the method according to any one of claims 1 to 8.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed on a computer, the computer is enabled to execute the method according to any one of claims 1 to 8.
11. A computer program product, characterized in that The computer program product comprises a computer program or instructions, and when the computer program or instructions are executed on a computer, the computer is caused to execute the method according to any one of claims 1 to 8.
12. A chip, characterized in that: It comprises a processor and a memory; the processor is coupled to the memory, and the processor is used to call a computer program stored in the memory during operation to implement the method according to any one of claims 1 to 8.
Citation Information
Cited By
Animation effect display method and electronic device
EP4647917A1