Layer synthesis method, electronic equipment and chip system

By switching the layer synthesis mode in electronic devices and cache the layer image of the target application, the problem of blackening of the application interface is solved, the layer synthesis efficiency and user experience are improved, and the interface is stable.

CN119271079AActive Publication Date: 2025-01-07HONOR DEVICE CO LTD
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202410201293.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-02-22
Publication Date
2025-01-07
Estimated Expiration
2044-02-22

AI Technical Summary

Technical Problem

When electronic devices respond to user operations, the application interface is prone to flash black, resulting in poor user experience.

Method used

By switching layer synthesis mode in electronic devices, switching from hardware synthesizer HWC to graphics processor GPU, cache layer images of target applications, and perform layer synthesis in GPU synthesis mode, avoiding the use of black maps for synthesis, thus Prevent application interface from flashing black.

Benefits of technology

It effectively avoids the application interface flashing black during the display process, improves the layer synthesis efficiency and user experience, and uses the GPU's parallel computing power and efficient graphics processing capabilities to ensure the stability of layer synthesis.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119271079A_ABST
    Figure CN119271079A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a layer synthesis method, electronic equipment and a chip system, and is suitable for the technical field of computers, and the method comprises the steps that the electronic equipment responds to a first operation, switches a layer synthesis mode from a first synthesis mode to a second synthesis mode, and stores a first layer image of a target application into a target cache; under the condition of the second synthesis mode, a first animation effect of the target application is displayed, the first animation effect comprises a first image frame, and a to-be-analyzed layer image in the dynamic effect layer data corresponding to the first image frame is a black image. The first image frame is obtained by performing layer synthesis on each layer required to be synthesized by the GPU based on the first layer image and the layer attribute in the target cache. According to the embodiment of the invention, the problem that the application interface flashes black in the process of being displayed can be effectively solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a layer synthesis method, electronic equipment and chip system. Background Art

[0002] With the development of electronic technology, more and more electronic devices such as mobile phones and tablet computers have image display functions. The display interface displayed by the electronic device is usually synthesized from multiple layers, for example, it can be synthesized from a status bar layer and an application interface layer. Among them, the status bar layer may include multiple status icons, such as a status icon for indicating the network status, a status icon for indicating the device connection status, a status icon for indicating the battery status, a status icon for indicating the time, and so on.

[0003] In actual applications, it is found that during the operation of the application, due to the instability of the application software itself or the incompatibility of the application software with the system of the electronic device, the application interface may flash black during the display process, resulting in a poor user experience. Summary of the invention

[0004] In view of this, the embodiments of the present application provide a layer synthesis method, an electronic device and a chip system, which can effectively solve the problem of the application interface flashing black during the display process.

[0005] In a first aspect, an embodiment of the present application provides a layer synthesis method, which is applied to an electronic device.

[0006] First, in response to a first operation by a user, the electronic device can switch the layer synthesis mode from the first synthesis mode to the second synthesis mode, and store the first layer image of the target application into the target cache. The first layer image is the layer image of the layer corresponding to the target application at the moment before the first operation starts to be executed. The first synthesis mode is performed by at least the hardware synthesizer HWC to perform layer synthesis, and the second synthesis mode is performed by the graphics processor GPU to perform layer synthesis. The first operation is usually used to trigger the electronic device to display the first animation effect of the target application.

[0007] Afterwards, the electronic device can display the first animation effect of the target application in the second synthesis mode. In the process of the electronic device displaying the first animation effect, the first animation effect may include a first image frame, the image of the layer to be analyzed in the animation layer data corresponding to the first image frame is a black image, and the first image frame is obtained by the GPU performing layer synthesis on each layer to be synthesized based on the first layer image and the layer attributes in the target cache. Among them, the animation layer data is the layer data of the target application at any time between the first moment and the second moment, and the animation layer data includes layer attributes and the layer image to be analyzed. Among them, the above-mentioned first moment is the moment when the electronic device detects that the above-mentioned first operation begins to act on the electronic screen. The above-mentioned second moment is the moment when the electronic device ends displaying the first animation effect.

[0008] The electronic screen is a screen of an electronic device. The target application is an application running in the foreground.

[0009] The first operation is an operation that may cause the application interface to flash black. The first animation effect is an animation effect corresponding to the first operation. The application interface flashing black usually means that the application interface layer is displayed normally in a certain frame, and the subsequent one or more frames are black, and then it is displayed normally again. For example, the layer of the application interface is displayed normally in the Nth frame, the N+1th frame is black, and the N+2th frame is displayed normally again.

[0010] Among them, there may be one or more layers corresponding to the target application, and the embodiment of the present application does not limit the number of layers corresponding to the target application.

[0011] The layer attributes are used to describe the distribution characteristics of the layer on the display interface. The layer attributes may include but are not limited to the position, size, level, and transparency of the layer in the display interface.

[0012] Among them, the first synthesis mode can also be called the regular synthesis mode. The second synthesis mode can also be called the GPU synthesis mode. In the GPU synthesis mode, the GPU performs layer synthesis. In the regular synthesis mode, at least the HWC performs layer synthesis. It should be pointed out that the regular synthesis mode is usually the layer synthesis method used in the prior art. In the regular synthesis mode, layer synthesis can be performed with reference to the existing synthesis method, which will not be described in detail here.

[0013] In practice, the layer data of the application interface is usually updated in real time, for example, 60 times per second. That is to say, while the target application is running in the foreground, the target application can write the layer data of each layer into the corresponding cache queue in real time. For each layer, there is a corresponding cache queue. The electronic device (specifically, SurfaceFlinger in the electronic device) can obtain the layer data of each layer from the cache queue, including the layer data of the layer corresponding to the target application and the layer data of other layers. As an example, the other layer may be the layer corresponding to the status bar. For ease of description, the layer corresponding to the status bar may also be referred to as the status bar layer. In the second synthesis mode, the electronic device can pass the obtained layer data of each layer to the GPU in the electronic device through SurfaceFlinger, and the GPU performs layer synthesis. At this time, the image synthesized by the GPU (or display interface) can be used for display on the electronic screen of the electronic device.

[0014] In the embodiment of the present application, since the electronic device usually flashes black when responding to the first operation, the electronic device caches the first layer image of the target application, that is, the layer image generated before the first operation, in the target cache when the first operation is detected. In this way, in the second synthesis mode where the GPU performs layer synthesis, when the target application to be analyzed image acquired in real time is a black image, the GPU in the electronic device can use the cached first layer image for layer synthesis, that is, it can avoid using the black image for layer synthesis, which helps to effectively avoid the application interface flashing black during the display process. In addition, when the electronic device detects the first operation, the layer synthesis mode is switched to the second synthesis mode, so that only the GPU performs synthesis on each layer. Since the GPU has a very strong parallel computing capability and a high efficiency in processing data such as graphics and images, the GPU performs layer synthesis, which can ensure the efficiency of layer synthesis. Among them, the above-mentioned target application to be analyzed image acquired in real time is the layer image in the dynamic effect layer data corresponding to the target application acquired in real time.

[0015] Optionally, the target cache is usually a GPU cache. Caching the first layer image in the GPU can enable the GPU to quickly obtain the first layer image and perform layer synthesis when the GPU performs layer synthesis, which helps to further improve the efficiency of the GPU in performing layer synthesis.

[0016] Optionally, in some application scenarios, in GPU synthesis mode, the electronic device can also pass the layer data of each layer corresponding to the target application to the GPU through SurfaceFlinger, and pass other layer data to the HWC. The GPU performs synthesis on each layer of the target application, and then the HWC continues to synthesize the image synthesized by the GPU with other layers, thereby synthesizing a display interface for display on the electronic screen.

[0017] In some optional embodiments of the present application, SurfaceFlinger in the electronic device may send operation indication information to the GPU in response to the first operation, wherein the operation indication information is used to indicate that the electronic device has detected a side-slide gesture operation in the first operation stage.

[0018] Optionally, the operation instruction information may be a first label whose corresponding value is a first value.

[0019] The first tag is used to indicate whether the electronic device detects a side-slide gesture operation in the first operation stage. The value of the first tag may include a first value and a second value. The first value indicates that the electronic device detects that the side-slide gesture operation is in the first operation stage. The second value may indicate that the electronic device detects that the side-slide gesture operation is not in the first operation stage.

[0020] In a first possible implementation manner of the first aspect, the first operation may be a side-slide gesture operation. When the first operation is a side-slide gesture operation, the first animation effect is an exit animation effect.

[0021] The side-slide gesture operation is used to exit the target application.

[0022] In practice, in response to the sliding gesture operation, the electronic device may display an exit animation effect.

[0023] Among them, the exit animation effect (also known as the application exit animation effect) is the animation effect when exiting the target application.

[0024] The above-mentioned exit animation effect may include the first image frame. The first image frame is obtained by performing layer synthesis based on the first layer image, and the layer image to be analyzed in the animation layer data corresponding to the first image frame is a black image.

[0025] Optionally, the above-mentioned exit animation effect may further include a second image frame, wherein the second image frame is synthesized based on the image of the layer to be analyzed in the animation layer data. That is, the image of the layer to be analyzed in the animation layer data is not a black image.

[0026] It can be understood that if, from the time when the electronic device detects the first operation and starts to execute it until the electronic device finishes displaying the animation effect corresponding to the first operation, the layer images to be analyzed in the animation layer data obtained by the electronic device at each moment are not black images, then the exit animation effect displayed by the electronic device may not include the above-mentioned first image frame.

[0027] The side-slide gesture operation (or side-slide exit operation) is usually an operation of sliding from one side of the left or right side of the electronic device to the other side to exit the target application. For example, it can be an operation of sliding from the right side to the left side of the mobile phone.

[0028] It can be understood that the first operation may also be other operations that may cause the application interface to flash black, and this embodiment does not specifically limit the first operation.

[0029] In a second possible implementation of the first aspect, the electronic device switches the layer synthesis mode from the first synthesis mode to the second synthesis mode in response to the user's first operation, and stores the first layer image of the target application into the target cache. This can be: the electronic device switches the layer synthesis mode from the first synthesis mode to the second synthesis mode in response to the side-slide gesture operation in the first operation stage, and stores the first layer image of the target application into the target cache.

[0030] The first operation stage is a stage from the first moment to the third moment.

[0031] The first moment is the moment when the electronic device detects that the first operation begins to act on the electronic screen.

[0032] The third moment is the moment when the electronic device detects that the first operation stops acting on the electronic screen.

[0033] In an embodiment of the present application, since the first operation usually requires a process from the start to the end of execution, that is, it takes a period of time, such as 0.1 seconds, to execute a complete first operation. And since the layer data of the application interface is usually updated in real time and quickly, for example, 60 times per second. In the process of updating the layer data of the application interface, if the application program has poor compatibility with the function corresponding to the first operation, the application interface may flash black before the first operation is completed, that is, before the operation gesture of the first operation leaves the electronic screen. Therefore, when the electronic device detects a side-slide gesture operation in the first operation stage, it switches the layer synthesis mode to a second synthesis mode in which the GPU performs layer synthesis, and caches the first layer image of the target application, which can avoid the situation where the application interface flashes black before the operation gesture leaves the electronic screen, and can also avoid the situation where the application interface flashes black after the operation gesture leaves the electronic screen, which helps to further improve the user experience.

[0034] In a third possible implementation of the first aspect, the electronic device may display an exit animation effect in response to a side-slide gesture operation, and the specific response process may be: the electronic device displays an exit animation effect in response to the side-slide gesture operation in the second operation stage.

[0035] The second operation stage is the stage from the third moment to the second moment.

[0036] The third moment is the moment when the electronic device detects that the first operation stops acting on the electronic screen.

[0037] The second moment is the moment when the electronic device ends displaying the first animation effect.

[0038] In practice, when the electronic device displays the exit animation effect, if the layer image to be analyzed in the acquired animation layer data is black, the electronic device can switch the first layer image in the target cache to the acquired layer image to be analyzed.

[0039] In the embodiment of the present application, since the target application is executing the exit animation effect, the application interface is scaled first, then the application interface and the application icon are scaled together, and finally the application icon is scaled, that is, during the process of the target application executing the exit animation effect, the layer images of each layer corresponding to the target application may change in real time. During the process of the target application executing the exit animation effect, the electronic device promptly uses the latest layer image to update the first layer image (or cached layer image) cached in the target cache when the layer image to be analyzed is not a black image. That is, the electronic device can cache the latest layer image, which helps to ensure the accuracy of layer synthesis using the cached layer image, that is, it can ensure that the display interface obtained by layer synthesis using the cached layer image is more consistent with the changes between the display interface at the previous moment, which helps to further improve the user experience.

[0040] In a fourth possible implementation of the first aspect, before the electronic device instructs the GPU in the electronic device to perform layer synthesis on the required layers based on the first layer image and the layer properties in the target cache, the electronic device may also perform a black image judgment on the layer image to be analyzed based on pixel data of each pixel point in the layer image to be analyzed.

[0041] In an embodiment of the present application, before each layer synthesis is performed, a black image judgment is performed on the real-time layer image to be analyzed, which can avoid using a black image to perform layer synthesis, and help to effectively avoid the application interface flashing black during the display process.

[0042] In a fifth possible implementation of the first aspect, the target cache is a GPU cache. In an electronic device, a GPU is usually used to perform black image determination on the image of the layer to be analyzed.

[0043] Specifically, the process of GPU judging whether the image in the layer to be analyzed is black is as follows:

[0044] First, the GPU reduces the image of the layer to be analyzed to a preset size to obtain the target analysis layer image. In practice, the preset size is usually very small.

[0045] Then, the GPU determines a normalized pixel value of the target analysis layer image, wherein the normalized pixel value is a ratio of an average pixel value to a maximum pixel value of the target analysis layer image.

[0046] Afterwards, the GPU determines that the image of the layer to be analyzed is a black image when the normalized pixel value is less than a preset normalized pixel threshold.

[0047] Finally, when the normalized pixel value is greater than or equal to the normalized pixel threshold, it is determined that the image of the layer to be analyzed is not a black image.

[0048] In the embodiment of the present application, since the data volume of the image layer to be analyzed is usually very large, that is, the amount of calculation required to judge whether the image layer to be analyzed is black is very large, and since the GPU has flexible and efficient graphics image data processing capabilities, the GPU can judge whether the image layer to be analyzed is black, which can ensure the efficiency and accuracy of black image judgment, thereby ensuring the efficiency and accuracy of layer synthesis. In addition, the GPU first reduces the image layer to be analyzed to a relatively small size, and then analyzes the pixel data of each pixel in the small-sized target analysis layer image, and determines whether the target analysis layer image is a black image, thereby determining whether the image layer to be analyzed is a black image, which can greatly reduce the amount of data processing, thereby further improving the efficiency of black image judgment.

[0049] In a sixth possible implementation manner of the first aspect, the electronic device may also promptly switch the layer synthesis mode from the second synthesis mode to the first synthesis mode after finishing displaying the first animation effect.

[0050] In an embodiment of the present application, ending the display of the first animation effect indicates that the electronic device has completed the response to the first operation. At this time, the electronic device can switch the layer synthesis mode from the second synthesis mode (also called the GPU synthesis mode) back to the first synthesis mode (also called the normal synthesis mode). In the normal synthesis mode, the GPU and HWC collaborate to perform layer synthesis, which can reduce the data processing capacity of the GPU. Since the GPU can perform layer synthesis and can also be used to complete other graphics processing tasks, the GPU and HWC collaborate to perform layer synthesis, which can reduce the data processing capacity of the GPU, thereby improving the overall data processing efficiency of the electronic device.

[0051] In a seventh possible implementation manner of the first aspect, the electronic device may also release the target cache in a timely manner after finishing displaying the first animation effect.

[0052] In the embodiment of the present application, timely releasing the target cache can improve the utilization of storage resources. In addition, when the target cache is a GPU cache, it helps to improve the utilization of storage resources in the GPU.

[0053] In an eighth possible implementation of the first aspect, the first animation effect also includes a second image frame, the layer image to be analyzed in the animation layer data corresponding to the second image frame is not a black image, and the second image frame is obtained by the GPU performing layer synthesis on each layer to be synthesized based on the layer image to be analyzed and the layer properties.

[0054] In an embodiment of the present application, in the second synthesis mode in which layer synthesis is performed by the GPU, when the image of the layer to be analyzed of the target application acquired in real time is not a black image, the GPU in the electronic device can use the image of the layer to be analyzed acquired in real time to perform layer synthesis, thereby ensuring the accuracy of the layer synthesis.

[0055] It can be understood that if, from the time when the electronic device detects the start of the first operation to the time when the electronic device finishes displaying the animation effect corresponding to the first operation, the layer images to be analyzed in the animation layer data obtained by the electronic device at each moment are not black images, then the first animation effect displayed by the electronic device may not include the first image frame.

[0056] In a second aspect, an embodiment of the present application provides an electronic device, the electronic device comprising a memory and a processor, the memory storing a computer program executable on the processor, and the processor implementing any method of the first aspect when executing the computer program.

[0057] In a third aspect, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, it implements any method as described in the first aspect above.

[0058] In a fourth aspect, an embodiment of the present application provides a chip system, the chip system includes a processor, the processor is coupled to a memory, and the processor executes a computer program stored in the memory to implement any method of the first aspect. The chip system can be a single chip, or a chip module composed of multiple chips.

[0059] In a fifth aspect, an embodiment of the present application provides a computer program product. When the computer program product is run on an electronic device, the electronic device executes any one of the methods of the first aspect above.

[0060] It can be understood that the beneficial effects of the second to fifth aspects mentioned above can be found in the relevant description of the first aspect mentioned above, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0061] Figure 1 A schematic diagram of a display interface of a mobile phone provided in an embodiment of the present application;

[0062] Figure 2 A schematic diagram of the effect of an application interface displayed in a display interface of a mobile phone provided in an embodiment of the present application flashing black;

[0063] Figure 3 A schematic diagram of the animation effect when exiting an application provided in an embodiment of the present application;

[0064] Figure 4AA schematic diagram showing the effect of the application interface provided in the embodiment of the present application flashing black in the first operation stage;

[0065] Figure 4B A schematic diagram of the effect of the application interface provided in the embodiment of the present application flashing black in the second operation stage;

[0066] Figure 5A A schematic diagram of the structure of an electronic device provided in an embodiment of the present application;

[0067] Figure 5B A flowchart of a layer synthesis method provided in an embodiment of the present application;

[0068] Figure 5C A flowchart of a GPU providing an embodiment of the present application for determining a black image of an image of a layer to be analyzed;

[0069] Figure 6 A schematic diagram of the structure of another electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0070] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.

[0071] The following are some concepts that may be involved in the embodiments of the present application:

[0072] (1) Multiple: Unless otherwise specified, in the embodiments of the present application, multiple refers to two or more.

[0073] (2) Surface: In the embodiments of the present application, the display interface displayed by the electronic device is usually synthesized from multiple surfaces.

[0074] See also Figure 1 , Figure 1 It is a schematic diagram of a display interface of a mobile phone provided in an embodiment of the present application.

[0075] like Figure 1 As shown in the figure on the left side of the figure, the display interface of the mobile phone can be synthesized by the layer corresponding to the status bar 101 and the layer corresponding to the application interface 102. Among them, the status bar 101 is used to indicate the status of the mobile phone. The status bar 101 usually includes multiple status icons.

[0076] like Figure 1As shown in the figure on the right side of the figure, the status bar 101 may include status icons for indicating network status, device connection status, battery status, time, etc. The application interface 102 may be an interface of a "settings" application (an application specifically used to perform system setting functions).

[0077] It is understandable that a mobile phone is only an example of an electronic device, and the electronic device may also be other devices, for example, the electronic device may also be a tablet. In addition, the display interface of the electronic device may also be composed of other layers. Figure 1 Take this as an example to illustrate.

[0078] Combination Figure 1 Each layer in the display interface has its position, size, and content to be displayed on the screen. During the running of the application, the position, size, and content of the layer corresponding to the application on the screen may be different at different times.

[0079] Each layer has corresponding layer properties and layer images. The layer image is the content that the layer needs to display on the screen. The layer image can be an image obtained by drawing and rendering the layer. The layer properties are used to describe the distribution characteristics of the layer on the display interface. The layer properties may include the position, size, level and other information of the corresponding layer. The layer properties are used to indicate the position, size, level, transparency and other information of the layer in the display interface. The level is used to indicate the vertical order of the layers in the screen plane.

[0080] (3) Graphics Processing Unit (GPU): In the embodiments of the present application, the GPU is a general-purpose image processing device that can be used to synthesize layers and can also be used to complete other graphics processing tasks.

[0081] (4) Hardware Composer (HWC): In the embodiment of the present application, the HWC is a dedicated image processing device, and the HWC can be used to synthesize layers.

[0082] In practice, at least one of a GPU and a HWC may be used to synthesize the layers.

[0083] (5) Layer management module (SurfaceFlinger): In the embodiment of the present application, SurfaceFlinger is a system service, which is mainly used to implement functions such as layer creation, control, and management.

[0084] In practice, an application can send a layer creation request to SurfaceFlinger after startup. After receiving the layer creation request from the application, SurfaceFlinger can create a corresponding layer for the application. In practice, an application can correspond to one layer or multiple layers.

[0085] In addition, SurfaceFlinger can also allocate a corresponding buffer queue (BufferQueue) for the created layer, and the buffer queue can be used to store layer data of the layer, wherein the layer data can include layer properties and layer images.

[0086] In practice, an application can draw and render the content to be displayed in a layer through a canvas (Canvas) or an open graphics library (Open Graphics Library, OpenGL), and transfer the rendered layer image to the corresponding cache queue, and also transfer the layer properties of the layer to the cache queue. SurfaceFlinger can obtain the layer data of the corresponding layer from the cache queue corresponding to each layer, and then combine the layer data of each layer to synthesize each layer through the GPU and / or HWC. Among them, synthesizing multiple layers usually refers to synthesizing the layer images of multiple layers into one image based on the layer properties of each layer.

[0087] (6) Application interface flashes black: In the embodiments of the present application, the application interface flashes black, which usually means that the application interface layer is displayed normally in a certain frame, and then one or more frames thereafter are black, and then it is displayed normally again. For example, the application interface layer is displayed normally in the Nth frame, is black in the N+1th frame, and is displayed normally again in the N+2th frame.

[0088] (7) Window Manager Service (WMS): In the embodiments of the present application, the WMS service is usually used to start, add or delete windows, etc. Among them, one window corresponds to one layer. The layer is used to draw the content to be displayed, and the window is used to display the content of the layer.

[0089] The WMS service can allocate windows for application layers and send window parameters, such as window position and window size, to the application to instruct the application to draw and render the layers.

[0090] In practice, the WMS service can also respond to touch operations on the electronic screen and send the operation information of the touch operation to the application. In this way, the application can draw and render the application interface layer according to the touch operation.

[0091] The touch operation may be an operation triggered by a user's finger, knuckle, etc., or an operation triggered by a stylus pen.

[0092] (8) Target application: In the embodiments of the present application, the target application is usually an application running in the foreground. The target application is often an application software that is unstable or does not match the system of the electronic device.

[0093] With the development of electronic technology, more and more electronic devices such as mobile phones and tablets have image display functions. The display interface of electronic devices is usually synthesized by multiple layers, such as Figure 1 The display interface can be synthesized by the status bar layer 101 and the application interface layer 102 .

[0094] In an electronic device, modules related to layer synthesis may include but are not limited to: SurfaceFlinger, GPU, and HWC.

[0095] In practice, SurfaceFlinger can maintain a cache queue for each layer. Figure 1 , a cache queue may be maintained for the layer corresponding to the status bar 101 , and a cache queue may also be maintained for the layer corresponding to the application interface 102 .

[0096] When the target application is running in the foreground, the target application can write the layer data of each layer to the corresponding cache queue in real time. SurfaceFlinger can obtain the layer data of each layer from the cache queue, including the layer data of the layer corresponding to the target application and the layer data of other layers. Afterwards, SurfaceFlinger can combine the obtained layer data of each layer and instruct the GPU and / or HWC to synthesize each layer based on the layer properties of each layer.

[0097] In actual applications, it is found that during the operation of the application, due to reasons such as the instability of the application software itself or the incompatibility of the application software with the system of the electronic device, for example, the messenger application is prone to instability when running on the Android system, and the application interface is prone to flashing black during the display process, resulting in a poor user experience. Among them, the application interface flashing black usually means that the application interface layer is displayed normally in a certain frame, and the subsequent frame or frames are black, and then it is displayed normally again. For example, the layer of the application interface is displayed normally in the Nth frame, the N+1th frame is black, and the N+2th frame is displayed normally again.

[0098] Figure 2 The figure shows a schematic diagram of an effect in which the application interface displayed in the display interface of a mobile phone flashes black. Figure 2As shown in (a) of FIG. 1 , the application interface 202 on the icon interface 201 is displayed normally. Figure 2 As shown in (b) of FIG. 1 , the application interface 202 on the icon interface 201 changes from a normal display to a black image. Figure 2 As shown in (c) , the application interface 202 on the icon interface 201 changes from a black image back to a normal display.

[0099] It should be pointed out that when the layers of the application interface are displayed as black images, it usually means that the application did not draw the corresponding layers at the corresponding time, resulting in the black images being placed in the corresponding cache queues. In this way, SurfaceFlinger obtains layer data from each cache queue and instructs the GPU and / or HWC to synthesize each layer, and the application interface in the resulting display interface is black.

[0100] In practice, in order to achieve visual continuity of interface switching, electronic devices usually respond to user operations and switch interfaces by displaying animation effects, so that coherent connections between different interfaces can be achieved. As an example, an electronic device can exit a target application running in the foreground by displaying an exit animation effect. Among them, the exit animation effect generally refers to the animation effect when exiting an application. In some embodiments, the exit animation effect is also called an application exit animation effect.

[0101] The following uses the application exit animation effect as an example to illustrate the scenario of electronic devices displaying animation effects. Among them, the application exit animation effect is the animation effect displayed by the electronic device in response to an exit operation, such as a side-swipe exit operation or an upward swipe exit operation.

[0102] In practice, the electronic device can respond to the user's side-swipe gesture (also called side-swipe gesture operation or side-swipe exit operation) or upward swipe gesture (also called upward swipe gesture operation or upward swipe exit operation) to exit the target application currently running in the foreground. That is, exit the target application from the application interface to the desktop interface.

[0103] Among them, the side-slide exit operation is usually an operation of sliding from one side of the left or right side of the electronic device to the other side to exit the target application. For example, it can be an operation of sliding from the right side of the mobile phone to the left side. The upward swipe exit operation is usually an operation of sliding from the bottom end to the top end of the electronic device to exit the target application. In practice, the side-slide exit operation usually acts on the application interface displayed in full screen.

[0104] Figure 3 This is a schematic diagram of the animation effect when exiting the "Settings" application provided in the embodiment of the present application. It should be understood that Figure 3 The description is just taking the "Settings" app as an example.

[0105] like Figure 3 As shown, the application exit animation may include the following three parts: the first part is the application interface zoom part, for example, from Figure 3 (a) in the equation changes to Figure 3 (b) in the second part, the application interface and application icon are scaled together, for example, from Figure 3 (c) in the equation changes to Figure 3 (d) in the third part, the application icon scaling part, for example, from Figure 3 (d) in the equation changes to Figure 3 (e) in .

[0106] Combination Figure 3 In (a), the mobile phone can respond to the user's side sliding gesture of sliding from the right edge to the left on the application interface of the "settings" application, and enter the application exit animation. During the process of exiting the "settings" application, the application interface 301 begins to shrink.

[0107] Combination Figure 3 In (b), the application interface 301 is reduced from full-screen display to non-full-screen display.

[0108] Combination Figure 3 In (c), the mobile phone further reduces the application interface 301 of the "Settings" application from a non-full screen display to an overlapping display of the application interface 301 and the application icon 302.

[0109] Here, the electronic device may display the application icon 302 in a layer below the application interface 301, the transparency of the application interface 301 is higher than the transparency of the application icon 302, and the application icon 302 is visible through the application interface 301. It is understandable that in some application scenarios, the electronic device may also display the application icon 302 in a layer above the application interface 301, in which case the transparency of the application interface 301 is lower than the transparency of the application icon 302, and the application interface 301 is visible through the application icon 302.

[0110] Understandably, Figure 3 The intersection of the image and text between the application interface 301 and the application icon 302 shown in (c) is only to indicate that the upper one is transparent, and does not actually occur.

[0111] Combination Figure 3 In (d), the mobile phone displays the "Settings" application from the application interface 301 and the application icon 302 in an overlapping manner, and further reduces the display to only the application icon 302 in an enlarged manner.

[0112] Combination Figure 3 In (e), the mobile phone can reduce the application icon 302 to a normal size for display.

[0113] Combination Figure 3 (a) to Figure 3 As can be seen from (e) in the figure, when an application is exited, the mobile phone exits from the application interface to the icon interface (also called the desktop interface), and by gradually shrinking the application interface toward the application icon position of the application, a coherent connection between the interfaces when the application is exited is achieved.

[0114] It should be noted that when the electronic device displays any image frame in the animation effect, the application interface may appear black. Figure 3 That is, when the mobile phone displays the application exit animation, Figure 3 (a) to Figure 3 At any stage in (e), the application interface may flash black.

[0115] It is also found in actual applications that the electronic device usually flashes black when the application interface is responding to the first operation. Since the first operation usually requires a process from the beginning to the end, that is, it takes a period of time to perform a complete first operation. For the sake of ease of description, the time from the beginning of the first operation to the end of the first operation can be recorded as the operation duration. In practice, the operation duration is usually very short, for example, 1 second.

[0116] Because the layer data of the application interface is usually updated in real time, for example, 60 times per second. The update cycle of the layer data of the application interface is usually shorter than the above operation duration. In the process of updating the layer data of the application interface, if the application has poor compatibility with the functions corresponding to certain operations, such as the side-slide exit function, the application interface may flash black before the first operation is completed.

[0117] That is to say, in electronic devices, the application interface may flash black in the following two situations.

[0118] In case 1, the first operation is executed and the operation gesture has not left the electronic screen, and the application interface flashes black.

[0119] In situation 2, the operation gesture of the first operation has left the electronic screen and the animation effect corresponding to the first operation has not yet finished displaying, and the application interface flashes black.

[0120] In an embodiment of the present application, for the sake of convenience of description, the stage in which the first operation is executed and the operation gesture has not yet left the electronic screen can be recorded as the first operation stage, and the stage in which the operation gesture of the first operation has left the electronic screen and the animation effect corresponding to the first operation has not yet ended can be recorded as the second operation stage.

[0121] In the present application, the first operation stage can also be described as a stage from the first moment to the third moment. The second operation stage can also be described as a stage from the third moment to the second moment. The first moment is the moment when the electronic device detects that the first operation starts to act on the electronic screen. The second moment is the moment when the electronic device ends displaying the first animation effect. The third moment is the moment when the electronic device detects that the first operation stops acting on the electronic screen.

[0122] Combine the following Figure 4A and Figure 4B , taking the first operation as the side-slide exit operation (or side-slide gesture operation) as an example, a schematic diagram of the effect of the application interface flashing black at different operation stages is described. Among them, the side-slide gesture operation is used to trigger the electronic device to display the application exit effect (or exit animation effect). In the embodiment of the present application, the above-mentioned first operation refers to an operation that may cause the application interface to flash black. It can be understood that the first operation may also include other operations that may cause the application interface to flash black, and this embodiment does not specifically limit the first operation.

[0123] Figure 4A This is a schematic diagram of the effect of the application interface provided in an embodiment of the present application flashing black in the first operation stage.

[0124] Figure 4B A schematic diagram of the effect of the application interface provided in an embodiment of the present application flashing black in the second operation stage.

[0125] like Figure 4A As shown in (a), the mobile phone detects that a side-slide gesture operation has just been performed. At this time, the user's finger acts on the right side of the mobile phone, and the application interface 301 is displayed normally.

[0126] like Figure 4A As shown in (b) in the figure, the mobile phone detects that the user's finger is still on the mobile phone screen and has not left, and the user's finger slides from right to left, and the application interface 301 is displayed as a black picture.

[0127] like Figure 4A As shown in (c) in the figure, the mobile phone detects that the user's finger is still on the mobile phone screen and has not left, and the user's finger continues to slide from right to left, and the application interface 301 returns to normal display.

[0128] Combination Figure 4A (a) to Figure 4A As can be seen from (c) in FIG. 1 , the application interface may appear black when the first operation is executed and the operation gesture of the first operation has not left the electronic screen. That is, the application interface may appear black when the first operation is in the first operation stage.

[0129] Understandably, from Figure 4A (a) to Figure 4A (c) in the figure takes a very short time, for example, 0.1 second.

[0130] like Figure 4B As shown in (a), the mobile phone detects that the side sliding gesture operation is completed. At this time, the user's finger has just left the mobile phone screen, and the application interface 301 is displayed normally. It can be understood that Figure 4B The operation gesture shown in (a) is located outside the mobile phone, which is only used to indicate that the operation gesture has left the mobile phone screen, and is not a limitation on the specific location of the operation gesture.

[0131] like Figure 4B As shown in (b), the mobile phone responds to the side-slide gesture operation, displays the exit animation effect, and the application interface 301 is reduced from full-screen display to non-full-screen display, and the application interface 301 is displayed normally.

[0132] like Figure 4B As shown in (c), when the mobile phone is displaying the exit animation effect, the displayed application interface 301 turns black.

[0133] like Figure 4B As shown in (d), the mobile phone enlarges the application icon 302 during the process of displaying the exit animation effect, and the display is normal.

[0134] like Figure 4B As shown in (e), during the process of displaying the exit animation effect, the mobile phone shrinks the application icon 302 to a normal size and displays it normally.

[0135] Combination Figure 4B (a) to Figure 4B As can be seen from (e) in FIG. 1 , the application interface may appear black when the operation gesture of the first operation leaves the electronic screen and when the animation effect corresponding to the first operation ends. That is, the application interface may appear black when the first operation is in the second operation stage.

[0136] Figure 4A and Figure 4B The black image is shown only as an example. It is understandable that when the mobile phone is in the first operation stage, the application interface may be a black image in any image frame of the first animation effect displayed. When the mobile phone is in the second operation stage, the application interface may also be a black image in any image frame of the first animation effect displayed.

[0137] In view of the above technical problems existing in the related art, in order to effectively solve the problem that the application interface flashes black when the electronic device responds to the first operation, in an embodiment of the present application, first, the electronic device can switch the layer synthesis mode from the first synthesis mode to the second synthesis mode in response to the user's first operation, and store the first layer image of the target application in the target cache. Among them, the first layer image is the layer image of the layer corresponding to the target application at the moment before the first operation starts to be executed. The above first synthesis mode is at least performed by the hardware synthesizer HWC to perform layer synthesis, and the above second synthesis mode is performed by the graphics processor GPU to perform layer synthesis. The above first operation is usually used to trigger the electronic device to display the first animation effect of the target application. Afterwards, the electronic device can display the first animation effect of the target application in the case of the second synthesis mode. In the process of the electronic device displaying the first animation effect, the first animation effect may include a first image frame, the image of the layer to be analyzed in the animation layer data corresponding to the first image frame is a black image, and the first image frame is obtained by the GPU performing layer synthesis on each layer to be synthesized based on the first layer image and the layer attributes in the target cache. The animation layer data is the layer data of the target application at any time between the first moment and the second moment, and the animation layer data includes layer attributes and the layer image to be analyzed. The first moment is the moment when the electronic device detects that the first operation begins to act on the electronic screen. The second moment is the moment when the electronic device ends displaying the first animation effect.

[0138] The embodiments of the present application have at least the following beneficial effects:

[0139] 1. In the embodiment of the present application, since the application interface of the electronic device usually flashes black when responding to the first operation, the electronic device caches the first layer image of the target application, that is, the layer image generated before the first operation, in the target cache when detecting the first operation. In this way, in the second synthesis mode in which the GPU performs layer synthesis, when the layer image to be analyzed of the target application acquired in real time is a black image, the GPU in the electronic device can use the cached first layer image for layer synthesis, that is, it can avoid using the black image for layer synthesis, which helps to effectively avoid the application interface flashing black during the display process.

[0140] 2. When the electronic device detects the first operation, it switches the layer synthesis mode to the second synthesis mode, so that only the GPU performs synthesis on each layer. Since the GPU has very strong parallel computing capabilities and is highly efficient in processing data such as graphics and images, the GPU performs layer synthesis to ensure the efficiency of layer synthesis.

[0141] The following describes the usage scenarios of the embodiments of the present application:

[0142] The embodiments of the present application may be applicable to a scenario where an application interface displayed on an electronic device flashes black when a user performs a touch operation on the electronic device.

[0143] The layer synthesis method provided in the embodiment of the present application can be applied to electronic devices, and the electronic devices can be electronic devices such as terminals or servers. The terminals can be mobile phones, tablet computers, wearable devices, vehicle-mounted devices, augmented reality (AR) / virtual reality (VR) devices, laptop computers, ultra-mobile personal computers (UMPC), netbooks, personal digital assistants (PDA) and other terminals, and the wearable devices can be smart watches or smart bracelets, etc., which are not limited in the embodiments of the present application.

[0144] Figure 5A A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Figure 5A ,The system of an electronic device may include an application layer, a framework layer, a kernel layer and a hardware layer.

[0145] like Figure 5A As shown, the application layer may include a drawing and rendering module and a series of applications. As an example, the application layer may include applications such as camera, gallery, calendar, map, navigation, Bluetooth, etc. The application in the application layer may call the drawing and rendering module to draw and render the layer corresponding to the application. As an example, the drawing and rendering module may be Canvas. The application layer is also called the application layer.

[0146] The framework layer provides an application programming interface (API) and a programming framework for the application programs in the application layer. The framework layer includes some predefined functions. The framework layer is also called the application framework layer, and can also be called the system service framework layer.

[0147] like Figure 5A As shown, the framework layer may include an input system, a WMS service, and SurfaceFlinger, etc. Among them, the input system is used to obtain touch information acting on the electronic screen. The touch information can be information triggered by the user's fingers, knuckles, etc., or information triggered by a stylus.

[0148] The WMS service can distribute the touch information obtained by the input system to the application. The application in the application layer can call the drawing and rendering module to draw and render the layer corresponding to the application based on the touch information, such as the touch starting point, touch end point, touch type, etc. The WMS service can also send indication information to SurfaceFlinger based on the touch information obtained by the input system. For example, when the touch information indicates that a side-slide exit operation is detected in the first operation stage, the WMS service can send operation indication information to SurfaceFlinger, wherein the operation indication information is used to indicate that a side-slide exit operation is detected in the first operation stage.

[0149] SurfaceFlinger can create corresponding layers for applications in the application layer. During the running of applications in the application layer, SurfaceFlinger can also obtain the layers rendered by the applications in the application layer and synthesize the obtained layers. For example, SurfaceFlinger can synthesize the obtained layers through the GPU and / or HWC.

[0150] The kernel layer is the layer between hardware and software. The kernel layer includes at least the central processing unit (CPU) driver, GPU driver, HWC driver, touch driver, display driver, sensor driver, etc.

[0151] The CPU driver is used to drive the CPU; the GPU driver is used to drive the GPU; the HWC driver is used to drive the HWC; the touch driver is used to drive the touch panel; the display driver is used to drive the display panel; and the sensor driver is used to drive the sensor.

[0152] In other embodiments, the system of the electronic device may further include a system library layer, which is located between the framework layer and the kernel layer, and is not limited here. The system library may include multiple functional modules. For example, the system library may include a surface manager, a media library, a three-dimensional graphics engine (e.g., OpenGLES), and a 2D graphics engine. Among them, the surface manager is used to manage the display subsystem and provides a fusion of 2D and 3D layers for multiple applications. The media library supports playback and recording of a variety of commonly used audio and video formats, as well as static graphics files, etc. The three-dimensional graphics engine is used to implement three-dimensional graphics drawing, image rendering, synthesis, and layer processing, etc. The 2D graphics engine is a drawing engine for 2D drawing.

[0153] The hardware layer includes physical devices such as CPU, GPU, HWC, touch panel, display panel, and sensors.

[0154] The touch panel includes: a touch sensor and a touch integrated circuit (IC) chip, and the display panel may include: a display screen and a display IC chip. In one embodiment, the touch IC chip and the display IC chip may be integrated into one or independently set. The display screen may include, but is not limited to, a liquid crystal display (LCD), a light emitting diode (LED) display screen, etc., and the embodiments of the present application are not limited to this. It can be understood that the electronic screen described in the embodiments of the present application may include: a touch panel and a display panel.

[0155] The sensors may include: a pressure sensor, a gyroscope sensor, an acceleration sensor, a distance sensor, a proximity light sensor, a fingerprint sensor, etc. The functions of each sensor are not described in detail in the embodiments of the present application.

[0156] Based on the above Figure 5A The system framework of the electronic device shown in the figure is described in detail below with reference to the interactive flow diagram, taking the first operation as a side-slide exit operation as an example. Figure 5A The electronic device shown is a specific interaction process between various structures in the system of the electronic device during the process of implementing the layer synthesis method of the present application.

[0157] It should be pointed out that the software in the framework layer interacts with the corresponding hardware in the hardware layer through the hardware driver in the kernel layer. For example, SurfaceFlinger interacts with the GPU through the GPU driver, SurfaceFlinger interacts with the HWC through the HWC driver, and so on.

[0158] By further taking an example, SurfaceFlinger sending the operation instruction information to the GPU means that SurfaceFlinger sends the operation instruction information to the GPU through the GPU driver.

[0159] Figure 5B is a flowchart of a layer synthesis method provided in an embodiment of the present application, which is applied to the above Figure 5A In the electronic device shown.

[0160] S501, SurfaceFlinger responds to a slide-out operation in a first operation phase, switches a layer synthesis mode of a target application to a GPU synthesis mode, and caches a first layer image of a layer corresponding to the target application in a GPU.

[0161] The GPU synthesis mode is also called the second synthesis mode.

[0162] Here, the first layer image cached in the GPU may also be referred to as a cache layer image.

[0163] In the embodiment of the present application, Figure 5A , when the electronic device detects an exit gesture (such as Figure 3 When the side-slide gesture operation (or side-slide exit operation) starts to execute, the input system can obtain the touch information acting on the electronic screen and send the touch information to the WMS service. The WMS service can send indication information to SurfaceFlinger based on the touch information obtained by the input system. For example, when the touch information indicates that the side-slide exit operation in the first operation stage is detected, the WMS service can send operation indication information to SurfaceFlinger, wherein the operation indication information is used to indicate that the side-slide exit operation in the first operation stage is detected.

[0164] Optionally, the operation instruction information may be a first label whose corresponding value is a first value.

[0165] Among them, the first tag is used to indicate whether the electronic device detects a side-sliding exit operation in the first operation stage. The value of the first tag may include a first value and a second value. Among them, the first value indicates that the electronic device detects that the side-sliding exit operation is in the first operation stage. The second value may indicate that the electronic device detects that the side-sliding exit operation is not in the first operation stage. It can be understood that when the value of the first tag is the second value, it may indicate that the electronic device detects that the side-sliding exit operation is in the second operation stage, and it may also indicate that the electronic device has finished displaying the application exit animation.

[0166] In practice, the input system in the electronic device can preliminarily determine the purpose of the first operation or the type of the first operation by analyzing the touch starting point. For example, when the first operation is a slide-to-exit operation, the touch starting point is usually the side edge of the electronic device, such as the left edge or the right edge.

[0167] It is understandable that when the electronic device detects that the slide-out operation is in the first operation stage, it usually means that the slide-out operation has been started and the operation gesture has not left the electronic screen. As an example, the operation gesture from acting on the electronic screen to leaving the electronic screen can be considered as a first operation being completely executed.

[0168] It is understandable that the operation gesture leaves the electronic screen when the user's finger leaves the electronic screen and does not continue to act on the electronic screen within a preset time interval, such as 0.5 seconds. The embodiment of the present application does not specifically limit how the electronic device determines whether the operation gesture of the first operation leaves the electronic screen.

[0169] In practice, the electronic device may determine that a slide-out operation in the first operation stage is detected when the first operation acting on the side edge of the electronic device is just detected. When the electronic device detects the slide-out operation in the first operation stage, the WMS service in the electronic device may send operation indication information to SurfaceFlinger.

[0170] In practice, the layer synthesis mode may include a GPU synthesis mode (also referred to as a second synthesis mode) and a regular synthesis mode (also referred to as a first synthesis mode). The GPU synthesis mode is used to indicate that only the GPU performs layer synthesis. That is, when synthesizing each layer of the target application, only the GPU is used for synthesis. In the regular synthesis mode, at least the HWC performs layer synthesis.

[0171] It should be pointed out that the conventional synthesis mode is usually a layer synthesis method used in the prior art. In the conventional synthesis mode, layer synthesis can be performed with reference to the existing synthesis method, which will not be described in detail here.

[0172] In some application scenarios, in GPU synthesis mode, SurfaceFlinger obtains the layer data of each layer in real time, and sends all the obtained layer data of each layer to the GPU, which performs synthesis on all layers. At this time, the image (or display interface) synthesized by the GPU can be used for display on the electronic screen of the electronic device.

[0173] In other application scenarios, in GPU synthesis mode, SurfaceFlinger can also pass the layer data of each layer corresponding to the target application to the GPU, and pass other layer data to the HWC. The GPU performs synthesis on each layer of the target application, and then the HWC continues to synthesize the GPU-synthesized image with other layers to obtain a display interface for display on an electronic screen.

[0174] It should be pointed out that SurfaceFlinger caches the first layer image that has been obtained, that is, the layer image generated before the first operation, in the GPU cache. In this way, in GPU synthesis mode, when the layer image to be analyzed obtained by the GPU in real time is a black image, the GPU can use the cached first layer image (or cached layer image) for layer synthesis, that is, it can avoid using a black image for layer synthesis, which helps to effectively avoid the application interface flashing black during the display process.

[0175] S502, SurfaceFlinger sends the operation instruction information to the GPU.

[0176] Here, SurfaceFlinger sends the operation instruction information to the GPU in a timely manner, and the GPU can enter the state of cooperating with the GPU synthesis mode as soon as possible.

[0177] It can be understood that SurfaceFlinger and GPU interact with each other, which usually refers to SurfaceFlinger interacting with GPU through GPU driver. For example, SurfaceFlinger sends operation instruction information to GPU, which means that SurfaceFlinger sends operation instruction information to GPU through GPU driver.

[0178] S503, SurfaceFlinger obtains the layer data of each layer in real time in the GPU synthesis mode, and sends the layer data to the GPU.

[0179] The layer data includes layer images and layer attributes. For the convenience of description, the layer image of the layer corresponding to the target application is referred to as the layer image to be analyzed.

[0180] In the embodiment of the present application, SurfaceFlinger can obtain the layer data of each layer to be synthesized in real time in the case of GPU synthesis mode, wherein the layers to be synthesized may include layers corresponding to the target application and other layers. It can be understood that the above-mentioned other layers are layers other than the layers corresponding to the target application. As an example, other layers may include a status bar layer.

[0181] In practice, in GPU compositing mode, each layer corresponding to the target application is only composited by the GPU.

[0182] Optionally, SurfaceFlinger can send all the acquired layer data to the GPU, and the GPU performs synthesis of all the layers. At this time, the image (or display interface) synthesized by the GPU can be used for display on the electronic screen of the electronic device.

[0183] Optionally, SurfaceFlinger can also send only the layer data of each layer corresponding to the target application to the GPU, and the GPU performs synthesis on each layer corresponding to the target application. It can be understood that when only the GPU performs synthesis on each layer corresponding to the target application, other layers and layers synthesized by the GPU need to be further synthesized by the HWC.

[0184] S504, the GPU performs black image determination on the received layer image to be analyzed.

[0185] In an embodiment of the present application, before the GPU performs layer synthesis on each layer corresponding to the target application, it is necessary to first perform a black image judgment on the layer image to be analyzed in the layer to avoid using a black image for layer synthesis, thereby avoiding the application interface from flashing black during the display process.

[0186] As an example, the GPU can read the pixel value of each pixel in the layer image to be analyzed, then calculate the pixel mean of all pixels, and finally compare the pixel mean with the preset pixel threshold. If the calculated pixel mean is greater than the preset pixel threshold, it means that the layer image to be analyzed is not a black image. If the calculated pixel mean is less than or equal to the preset pixel threshold, it means that the layer image to be analyzed is a black image. The above-mentioned preset pixel threshold is usually a pre-set pixel value. In practice, the preset pixel threshold is usually small.

[0187] As another example, after calculating the pixel mean of the image layer to be analyzed, the GPU may divide the pixel mean by the maximum value that may appear in the image layer to be analyzed to obtain a quotient. In practice, the maximum value that may appear in the image layer to be analyzed is usually 255. It is understandable that the GPU may also divide the pixel mean by another value greater than the maximum value to obtain a quotient.

[0188] Finally, the GPU can compare the quotient value with a preset quotient threshold. If the quotient value is greater than or equal to the quotient threshold, it means that the image of the layer to be analyzed is not a black image. If the quotient value is less than the quotient threshold, it means that the image of the layer to be analyzed is a black image. The quotient threshold is a preset value, which is usually greater than 0 and less than 1. In practice, the quotient threshold is usually small, for example, it can be 0.1.

[0189] It should be pointed out that since the data volume of the image of the layer to be analyzed is usually very large, that is, the amount of calculation required for black image judgment on the image of the layer to be analyzed is very large, and since the GPU has flexible and efficient graphics image data processing capabilities, the GPU performs black image judgment on the image of the layer to be analyzed, which can ensure the efficiency and accuracy of black image judgment, thereby ensuring the efficiency and accuracy of layer synthesis.

[0190] Considering that an image usually includes a large number of pixels, directly obtaining the pixel values ​​of all pixels in the layer image to be analyzed and calculating the pixel values ​​of all pixels may consume a lot of computing resources and easily reduce the overall data processing efficiency of the electronic device. Therefore, in the embodiment of the present application, the GPU can first reduce the layer image to be analyzed to a certain set size, such as 30×40, and then perform black image analysis based on the pixel values ​​of each pixel in the reduced layer image to be analyzed, which can significantly reduce the amount of calculation.

[0191] Further references Figure 5C , Figure 5C A flowchart of a GPU performing black image judgment on an image of a layer to be analyzed provided in an embodiment of the present application. Figure 5C In the process, the GPU can perform black image determination on the image of the layer to be analyzed by executing the following operations S5041 to S5045. Figure 5C In the process, the GPU may first reduce the size of the image of the layer to be analyzed, and indirectly determine whether the image of the layer to be analyzed is a black image by determining whether the image after the size reduction is a black image.

[0192] S5041, the GPU reduces the image of the layer to be analyzed to a preset size to obtain the target analysis layer image.

[0193] The target analysis layer image is an image obtained by reducing the image of the to-be-analyzed layer.

[0194] The preset size is usually a pre-set size, for example, 20×10. In practice, the preset size is usually smaller.

[0195] Optionally, the GPU can reduce the image of the layer to be analyzed to the above preset size by calling the drawImageRect function in Canvas. The drawImageRect function is a function in Canvas, which is used to draw an image on the canvas. Specifically, if the original image is larger than the canvas size, the original image will be reduced and drawn on the canvas. If the original image is smaller than the canvas size, the original image will be enlarged and drawn on the canvas.

[0196] S5042, the GPU extracts the pixel data of each pixel in the target analysis layer image to obtain the pixel value of each pixel.

[0197] In practice, pixel data is usually color data. The color data may be red, green, and blue (RGB) data, which includes the color values ​​of the following three channels: R value, G value, and B value. For each pixel point, the GPU may determine the average of the three color values ​​of R value, G value, and B value as the pixel value of the pixel point.

[0198] Optionally, the GPU can extract the color data of each pixel in the target analysis layer image by calling the readPixels function in Canvas, where the readPixels function is a function in Canvas and is used to read pixel data from the canvas.

[0199] S5043, the GPU calculates the average pixel value of the target analysis layer image.

[0200] Here, the GPU may divide the sum of the pixel values ​​of all the pixels in the target analysis layer image by the total number of pixels in the target analysis layer image to calculate the average pixel value of the target analysis layer image.

[0201] S5044, the GPU normalizes the average pixel value to obtain a normalized pixel value.

[0202] The normalized pixel value is usually a value obtained by dividing the average pixel value obtained in S5033 by the maximum pixel value in the target analysis layer image. The normalized pixel value is usually greater than 0 and less than 1.

[0203] S5045: The GPU determines whether the image of the layer to be analyzed is a black image based on the normalized pixel value.

[0204] In practice, the GPU can use the above normalized pixel value to compare with the preset normalized pixel threshold, and combine the comparison result to determine whether the target analysis layer image is a black image, thereby determining whether the image of the layer to be analyzed is a black image. For example, if the normalized pixel value is greater than or equal to the normalized pixel threshold, it means that the image of the layer to be analyzed is not a black image, and if the normalized pixel value is less than the normalized pixel threshold, it means that the image of the layer to be analyzed is a black image.

[0205] The normalized pixel threshold is usually a preset value. The normalized pixel threshold is greater than 0 and less than 1.

[0206] Since the color data of each pixel in the black image is usually (0, 0, 0), that is, the R value, G value, and B value are usually 0. Therefore, the normalized pixel threshold is usually close to 0, for example, it can be 0.1.

[0207] It can be understood that when the target application has multiple layers, for the layer image to be analyzed corresponding to each layer, the GPU can perform black image judgment on the layer image to be analyzed by executing the above-mentioned operations S5041-S5045.

[0208] In the embodiment of the present application, when the GPU performs black image judgment on the target analysis layer image, the target analysis layer image is first reduced to a relatively small size, and then the pixel data of each pixel point in the small-sized target analysis layer image is analyzed to determine whether the target analysis layer image is a black image. In this way, the amount of data processing can be greatly reduced, thereby further improving the efficiency of black image judgment.

[0209] S505: GPU performs layer synthesis based on the black image judgment result.

[0210] The black image judgment result is used to indicate whether the image layer to be analyzed is a black image. As an example, the black image judgment result can be "1", which is used to indicate that the image layer to be analyzed is a black image, or "not-black", which is used to indicate that the image layer to be analyzed is not a black image. It can be understood that the embodiment of the present application does not specifically limit the implementation form of the black image judgment result.

[0211] Optionally, when the black image determination result indicates that the layer image to be analyzed is a black image, the GPU may use the cached layer image pre-cached in the GPU and other layers to be displayed, such as the status bar layer, to perform layer synthesis. The other layers are layers to be displayed other than the layers corresponding to the target application.

[0212] Optionally, when the black image determination result indicates that the image of the layer to be analyzed is not a black image, the GPU may perform layer synthesis using the image of the layer to be analyzed and other layers to be displayed.

[0213] It can be understood that the GPU can synthesize the layer images of each layer according to the layer properties of each layer.

[0214] For further example, when there is one layer corresponding to the target application, which is layer 1, and there are two other layers, which are layer 2 and layer 3, before performing layer synthesis, the GPU can first determine whether the layer image 1 to be analyzed corresponding to layer 1 is a black image; then, the GPU can perform layer synthesis in combination with the black image judgment result of the layer image 1 to be analyzed. Specifically, if the layer image 1 to be analyzed is a black image, the GPU can use the cached layer image already cached in the GPU, the layer image corresponding to layer 2, the layer image corresponding to layer 3, and the layer attributes of each layer to perform synthesis on the three layers. If the layer image 1 to be analyzed is not a black image, the GPU can use the layer image 1 to be analyzed corresponding to layer 1, the layer image corresponding to layer 2, the layer image corresponding to layer 3, and the layer attributes corresponding to each layer to perform synthesis on the three layers.

[0215] In an embodiment of the present application, when the image of the layer to be analyzed obtained by the GPU in real time is not a black image, the GPU uses the obtained image of the layer to be analyzed to perform layer synthesis; when the image of the layer to be analyzed obtained by the GPU in real time is a black image, the GPU uses the pre-cached cached layer image to perform layer synthesis, which can avoid the application interface flashing black during the display process while ensuring the accuracy of layer synthesis.

[0216] In some optional implementations of the embodiments of the present application, when the black image judgment result indicates that the layer image to be analyzed is not a black image, the GPU can switch the above-mentioned cached layer image to the layer image to be analyzed. For example, the cached layer image that has been cached in the GPU can be deleted first, and then the layer image to be analyzed can be cached in the GPU as a new cached layer image. In this way, on the one hand, when the layer image to be analyzed is a black image at the next moment, the cached layer image can be used for layer synthesis to avoid the electronic device flashing black during the display process. On the other hand, the GPU can cache the latest layer image, which helps to ensure the accuracy of layer synthesis using the cached layer image, that is, it can ensure that the display interface obtained by layer synthesis using the cached layer image is more consistent with the change between the display interface at the previous moment, which helps to further improve the user experience.

[0217] Optionally, when the electronic device detects that the first operation is a slide-out operation, Figure 3 , because the content of the application interface usually does not change when the slide-out operation is in the first operation stage, that is, when the slide-out operation is in the first operation stage, it is usually not necessary to replace and update the cache layer image cached in the GPU. In this way, the computing resources consumed by updating the GPU cache can be saved, thereby further improving the data processing efficiency of the electronic device.

[0218] S506, SurfaceFlinger responds to the slide-out operation in the second operation stage and sends animation start indication information to the GPU.

[0219] The animation start indication information is used to instruct the target application to start executing the application exit animation. The target application starts executing the application exit animation, that is, the electronic device starts to display the application exit animation.

[0220] The second operation stage is the stage where the electronic device detects that the operation gesture of the first operation has left the electronic screen and has not yet finished displaying the animation effect corresponding to the first operation. The application exit animation refers to the animation effect when the target application exits. The side-swipe exit operation is in the second operation stage, which usually means that the side-swipe exit operation has ended, that is, the target application needs to execute the application exit animation.

[0221] In the embodiments of the present application, Figure 5A , when the electronic device detects an exit gesture (such as Figure 3When the side-slide gesture operation (or side-slide exit operation) ends, the input system in the electronic device can determine that the side-slide exit operation ends by analyzing the touch information. As an example, if the touch information indicates that the electronic device detects that the operation gesture of the first operation is from acting on the electronic screen to leaving the electronic screen, it is considered that the first operation is completed, that is, the exit gesture ends.

[0222] In practice, the electronic device may determine that a slide-out operation in the second operation stage is detected when the slide-out operation is just detected to be completed. When the electronic device detects the slide-out operation in the second operation stage, the WMS service in the electronic device may send the above-mentioned motion effect activation indication information to SurfaceFlinger. SurfaceFlinger may send the above-mentioned motion effect activation indication information to the GPU when the above-mentioned motion effect activation indication information is received.

[0223] In some optional implementations, the GPU may actively switch the value of the first tag to the second value upon receiving the motion effect activation indication information.

[0224] In some other optional implementations, SurfaceFlinger can send a first tag whose corresponding value is a second value to the GPU while sending the animation start indication information to the GPU, so as to trigger the GPU to switch the value of the first tag to the second value.

[0225] S507, when the target application is executing the application exit animation, the GPU continues to perform black image determination on the received layer image to be analyzed, and performs layer synthesis based on the black image determination result.

[0226] It can be understood that the process of the target application executing the application exit animation is also the process of the electronic device displaying the application exit animation.

[0227] Here, when the target application is executing the application exit animation, the GPU can perform black image judgment on the layer image to be analyzed received in real time by executing the above S504-S505 operations, and perform layer synthesis based on the black image judgment result, which will not be elaborated here.

[0228] S508, when the target application is executing the application exit animation, if the layer image to be analyzed is a black image, the GPU switches the cached layer image in the GPU cache to the received layer image to be analyzed.

[0229] In the embodiment of the present application, since the target application is executing the application exit animation, the application interface is scaled first, then the application interface and the application icon are scaled together, and finally the application icon is scaled, that is, during the process of the target application executing the application exit animation, the layer images of each layer corresponding to the target application may change in real time. During the process of the target application executing the application exit animation, if the layer image to be analyzed is not a black image, the GPU promptly updates the layer image (or cached layer image) in the GPU cache, that is, the GPU can cache the latest layer image, which helps to ensure the accuracy of layer synthesis using the cached layer image, that is, it can ensure that the display interface obtained by layer synthesis using the cached layer image is more consistent with the changes between the display interface at the previous moment, which helps to further improve the user experience.

[0230] S509, when the target application finishes executing the application exit animation, SurfaceFlinger switches the layer synthesis mode to the normal synthesis mode.

[0231] It can be understood that the above-mentioned target application ends executing the application exit animation, which means that the electronic device ends displaying the application exit animation.

[0232] The conventional synthesis mode at least includes HWC performing layer synthesis. It should be noted that the conventional synthesis mode is usually a layer synthesis method used in the prior art. In the conventional synthesis mode, layer synthesis can be performed with reference to the existing synthesis method, which will not be described in detail here.

[0233] In practice, when the target application finishes executing the application exit animation, the process managing the application operation usually sends information indicating that the target application has completed exiting to the WMS service. After receiving the information indicating that the target application has completed exiting, the WMS service can send animation end indication information to SurfaceFlinger.

[0234] The end-of-action indication information is used to indicate that the target application has ended the execution of the application exit action. It is understandable that the embodiment of the present application does not limit the implementation form of the end-of-action indication information. As an example, the end-of-action indication information may be "finished".

[0235] In an embodiment of the present application, when SurfaceFlinger receives the motion effect end indication information, the GPU synthesis mode can be switched to the normal synthesis mode.

[0236] In the normal synthesis mode, the GPU and HWC can jointly synthesize the layers corresponding to the target application. For example, if the target application corresponds to three layers, namely layer 1, layer 2 and layer 3, in addition to the three layers corresponding to the target application, there are two layers, such as layer 4 and layer 5, which need to be synthesized. At this time, the GPU can synthesize layer 1, layer 2 and layer 4 to obtain a preliminary synthesized layer; then, the GPU sends the preliminary synthesized layer to the HWC, and the HWC further synthesizes layer 3, layer 5 and the above preliminary synthesized layer synthesized by the GPU to obtain the final synthesized layer. It can be understood that the final synthesized layer can be processed by hardware display and pushed to the electronic screen for display.

[0237] It is understandable that in the conventional synthesis mode, layer synthesis can be performed with reference to the existing synthesis method, and this embodiment does not specifically limit the layer synthesis process in the conventional synthesis mode.

[0238] In an embodiment of the present application, the target application finishes executing the application exit animation, that is, the electronic device finishes displaying the application exit animation, indicating that the electronic device has completed the response to the slide exit operation. At this time, SurfaceFlinger can switch the layer synthesis mode from the second synthesis mode (also called GPU synthesis mode) back to the first synthesis mode (also called normal synthesis mode). In normal synthesis mode, the GPU and HWC collaborate to perform layer synthesis, which can reduce the data processing capacity of the GPU. Since the GPU can perform layer synthesis and can also be used to complete other graphics processing tasks, the GPU and HWC collaborate to perform layer synthesis, which can reduce the data processing capacity of the GPU, thereby improving the overall data processing efficiency of the electronic device.

[0239] S510, SurfaceFlinger sends animation end indication information to the GPU.

[0240] Here, when SurfaceFlinger receives the motion effect end indication information, it can send the motion effect end indication information to the GPU to prompt the GPU to end the application exit motion effect for the target application.

[0241] In some optional implementations of the present application, the animation start indication information may be a second tag corresponding to a third value, and the animation end indication information may be a second tag corresponding to a fourth value.

[0242] The second tag is used to indicate whether the target application starts or stops executing the application exit animation. The value of the second tag may include a third value and a fourth value. The third value indicates that the target application starts executing the application exit animation. The fourth value is used to indicate that the target application ends executing the application exit animation.

[0243] S511, the GPU releases the GPU cache used to cache the layer image.

[0244] Here, the GPU can delete the cached layer image for the target application and release the storage space used to cache the cached layer image. The GPU timely releases the GPU cache used to cache the layer image, which helps to improve the utilization of storage resources in the GPU.

[0245] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0246] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, wholes, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or combinations thereof.

[0247] It should also be understood that the term “and / or” used in the specification and appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.

[0248] As used in the specification and appended claims of this application, the term "if" can be interpreted as "when" or "uponce" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" can be interpreted as meaning "uponce it is determined" or "in response to determining" or "uponce [described condition or event] is detected" or "in response to detecting [described condition or event]", depending on the context.

[0249] In addition, in the description of the present specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish descriptions, and cannot be interpreted as indicating or suggesting relative importance. It should also be understood that although the terms "first", "second", etc. are used to describe various elements in some embodiments of the present application in the text, these elements should not be limited by these terms. These terms are only used to distinguish an element from another element. For example, the first state code can be named as the second state code, and similarly, the second state code can be named as the first state code, without departing from the scope of the various described embodiments. The first state code and the second state code are both state codes, but they are not the same state code.

[0250] References to "one embodiment" or "some embodiments" etc. described in the specification of this application mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.

[0251] Figure 6 It is a schematic diagram of the structure of an electronic device provided in one embodiment of the present application.

[0252] The electronic device may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a sensor module 180, a camera 193, a display screen 194, and a SIM card interface 195, etc.

[0253] Among them, the sensor module 180 may include a four-in-one (accelerometer, angular velocity meter, gyroscope, compass) motion sensor, pressure sensor, touch sensor, temperature sensor, light sensor, proximity light sensor, 3D structured light sensor, etc. Different sensors are used to sense different signals, so that the processor 110 performs calculations and processing according to different sensing signals to realize different functions of the electronic device. For example, the four-in-one motion sensor can be used to determine the motion posture and orientation information of the electronic device; the light sensor is used to sense the ambient light brightness.

[0254] The processor 110 may include one or more processing units, for example: the processor 110 may include an application processor (application processor, AP), a modem processor, a GPU, a HWC, an image signal processor (image signal processor, ISP), a controller, a memory, a video codec, a digital signal processor (digital signal processor, DSP), a baseband processor, and / or a neural network processor (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. 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.

[0255] The processor 110 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may store instructions or data that the processor 110 has just used or cyclically used. If the processor 110 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.

[0256] The processor 110 can run the layer synthesis method provided in the embodiment of the present application to create a schedule quickly and accurately, thereby improving the user experience. The processor 110 can include different devices. For example, when a CPU and a GPU are integrated, the CPU and the GPU can cooperate to execute the layer synthesis method provided in the embodiment of the present application. For example, part of the algorithm in the layer synthesis method is executed by the CPU, and another part of the algorithm is executed by the GPU to obtain faster processing efficiency.

[0257] It should be understood that the illustrated electronic device is only an example, and the electronic device may have more or fewer components than shown in the figure, may combine two or more components, or may have a different component configuration. The various components shown in the figure 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.

[0258] The software system of the electronic device may adopt a layered architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture. The embodiment of the present application takes the Android system of the layered architecture as an example to exemplify the software structure of the electronic device.

[0259] In addition, those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units in each embodiment of the present application can be integrated into a processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units.

[0260] The embodiment of the present application further provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments can be implemented.

[0261] An embodiment of the present application provides a computer program product. When the computer program product runs on an electronic device, the electronic device can implement the steps in the above-mentioned method embodiments when executing the computer program product.

[0262] An embodiment of the present application also provides a chip system, which includes a processor, the processor is coupled to a memory, and the processor executes a computer program stored in the memory to implement the steps in the above-mentioned method embodiments.

[0263] If the integrated module / unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. Computer-readable storage media may include: any entity or device capable of carrying computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium, etc.

[0264] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0265] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0266] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0267] The above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.

Claims

1. A layer synthesis method, characterized in that: Applied to electronic equipment, the method comprises: In response to a first operation of the user, the layer synthesis mode is switched from the first synthesis mode to the second synthesis mode, and a first layer image of the target application is stored in a target cache, wherein the first layer image is a layer image of a layer corresponding to the target application at a moment before the first operation starts to be executed, the first synthesis mode is at least performed by a hardware synthesizer HWC to perform layer synthesis, and the second synthesis mode is performed by a graphics processor GPU to perform layer synthesis; In the case of the second synthesis mode, the first animation effect of the target application is displayed, the first animation effect includes a first image frame, the layer image to be analyzed in the animation layer data corresponding to the first image frame is a black image, wherein the animation layer data is the layer data of the target application at any moment between the first moment and the second moment, the animation layer data includes layer properties and the layer image to be analyzed, the first image frame is obtained by the GPU performing layer synthesis on each layer to be synthesized based on the first layer image and the layer properties in the target cache, the first moment is the moment when the electronic device detects that the first operation starts to act on the electronic screen, and the second moment is the moment when the electronic device ends displaying the first animation effect.

2. The layer synthesis method according to claim 1, characterized in that: The first operation is a side-slide gesture operation, and the side-slide gesture operation is used to exit the target application; the first animation effect is an exit animation effect.

3. The layer synthesis method according to claim 2, characterized in that: The step of switching the layer composition mode from the first composition mode to the second composition mode in response to the first operation of the user, and storing the first layer image of the target application into the target cache includes: In response to the side-slide gesture operation in the first operation stage, the layer synthesis mode is switched from the first synthesis mode to the second synthesis mode, and the first layer image of the target application is stored in the target cache, wherein the first operation stage is the stage from the first moment to the third moment, and the third moment is the moment when the electronic device detects that the first operation stops acting on the electronic screen.

4. The layer synthesis method according to claim 2, characterized in that: The displaying the first animation effect of the target application includes: In response to the sliding gesture operation in the second operation stage, displaying the exit animation effect, wherein the second operation stage is a stage from the third moment to the second moment; Wherein, in the process of displaying the exit animation effect, when the layer image to be analyzed in the acquired animation layer data is a black image, the first layer image in the target cache is switched to the acquired layer image to be analyzed.

5. The layer synthesis method according to any one of claims 1 to 4, characterized in that: Before the GPU performs layer synthesis on each layer to be synthesized based on the first layer image and the layer attributes in the target cache, the method further includes: Based on the pixel data of each pixel point in the layer image to be analyzed, a black image determination is performed on the layer image to be analyzed.

6. The layer synthesis method according to claim 5, characterized in that: The target cache is a GPU cache, and the black image determination on the to-be-analyzed layer image is performed by the GPU, and the GPU determines the black image on the to-be-analyzed layer image, including: Reducing the image of the layer to be analyzed to a preset size to obtain a target analysis layer image; Determine a normalized pixel value of the target analysis layer image, wherein the normalized pixel value is a ratio of an average pixel value to a maximum pixel value of the target analysis layer image; When the normalized pixel value is less than a preset normalized pixel threshold, determining that the image of the layer to be analyzed is a black image; When the normalized pixel value is greater than or equal to the normalized pixel threshold, it is determined that the layer image to be analyzed is not a black image.

7. The layer synthesis method according to any one of claims 1 to 6, characterized in that: After the first animation effect is displayed, the method further includes: The layer composition mode is switched from the second composition mode to the first composition mode.

8. The layer synthesis method according to any one of claims 1 to 7, characterized in that: After the first animation effect is displayed, the method further includes: Release the target buffer.

9. The layer synthesis method according to any one of claims 1 to 8, characterized in that: The first animation effect also includes a second image frame. The image of the layer to be analyzed in the animation layer data corresponding to the second image frame is not a black image. The second image frame is obtained by the GPU performing layer synthesis on each layer to be synthesized based on the image of the layer to be analyzed and the layer properties.

10. An electronic device, characterized in that: The electronic device includes a memory and a processor, wherein the memory stores a computer program that can be run on the processor, and when the processor executes the computer program, the layer synthesis method according to any one of claims 1 to 9 is implemented.

11. A chip system, characterized in that: The chip system includes a processor, which is coupled to a memory. The processor executes a computer program stored in the memory to implement the layer synthesis method as described in any one of claims 1 to 9.

Citation Information

Patent Citations

  • Display device and blank screen detection method

    CN114302131A

  • Display system flash black processing method and device and computer readable storage medium

    CN115981763A

  • Display screen control method, electronic equipment, storage medium and chip

    CN116504177A

  • Image display method and electronic equipment

    CN117135257A

  • Object displaying method, terminal device, and computer storage medium

    US20190212900A1