Image display method and related device
By flexibly adjusting the rendering frame rate of focused and non-focused applications in electronic devices, the system load and power consumption problems caused by useless rendering in multi-window displays are solved, achieving more efficient resource utilization and user experience.
Patent Information
- Application Number
- PCT/CN2024/088577
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2024-04-18
- Publication Date
- 2025-10-23
AI Technical Summary
In complex scenarios, how can we ensure user experience while reducing system power consumption, especially when displaying multiple windows? The high rendering frame rate of non-focused applications leads to unnecessary rendering, which increases system load and power consumption.
Electronic devices use a rendering frame rate equal to the current screen refresh rate to render the screen of the focused application, and a rendering frame rate lower than the current screen refresh rate to render the screen of the non-focused application. The rendering frame rate is flexibly adjusted through the VSync software timer to avoid unnecessary rendering.
It reduces system load and power consumption, and improves user experience, especially when focusing on interactive applications, as resources are better focused on interactive applications and unnecessary rendering of non-focused applications is reduced.
Smart Images

Figure CN2024088577_23102025_PF_FP_ABST
Abstract
Description
Image display method and related device TECHNICAL FIELD
[0001] The present application relates to the technical field of terminal, and in particular, to an image display method and related device. BACKGROUND
[0002] With the increase of terminal device (may also be referred to as electronic device) categories and the increase of screen size thereof, in order to improve the interaction efficiency of users, device manufacturers provide many display schemes in complex scenarios, such as: multi-window, split screen, parallel view, floating window, etc. Based on these display schemes in complex scenarios, the terminal device can display multiple windows of one application to the user at the same time, or can display different windows of multiple applications to the user at the same time. At the same time, the screen refresh rate (may also be referred to as system refresh rate, or simply referred to as refresh rate) specification of the mobile terminal device is also constantly improving. High refresh rate can provide users with better sliding interaction experience in complex scenarios. In complex scenarios, the terminal device generally displays multiple windows of multiple applications, but the focus of the user's operation at the same time is usually only one window of one application.
[0003] How to ensure user experience and reduce system power consumption in complex scenarios is a problem to be solved at present.
[0004] SUMMARY
[0005] The present application provides an image display method and related device. According to the method, in the case that the electronic device displays multiple windows of multiple applications at the same time, for the focus application and the application in the fling state, the electronic device can use the rendering frame rate equal to the current screen refresh rate to draw and render the picture thereof, and for the non-focus application in the non-fling state, the electronic device can use the rendering frame rate lower than the current screen refresh rate to draw and render the picture thereof. This method can avoid useless rendering caused by the use of higher rendering frame rate by the non-focus application, thereby reducing system load and power consumption.
[0006] In a first aspect, the present application provides an image display method. The method can be applied to an electronic device including a display screen. According to the method, the electronic device can render a picture of a first application at a first frame rate to obtain a first picture, render a picture of a second application at a second frame rate to obtain a second picture, and perform synthesis processing on the first picture and the second picture to obtain a first image, and then display the first image on the display screen at a first refresh rate. Wherein the first application is an application in a fling state or a focus application, and the second application is a non-focus application in a non-fling state (or a non-focus application not in a fling state). The first refresh rate is greater than a first threshold, the first frame rate is equal to the first refresh rate, and the second frame rate is less than the first refresh rate.
[0007] In the scheme provided in this application, the electronic device can set different rendering frame rates for different applications, and synthesize the application pictures drawn and rendered at the different rendering frame rates, and then display the synthesized pictures on the display screen, so that flexible adjustment of the application rendering frame rate can be realized. Especially in the case where the screen refresh rate is high (for example, greater than a first threshold value), the electronic device can set a rendering frame rate lower than the screen refresh rate for some applications, thereby reducing the system load and power consumption caused by rendering.
[0008] In some embodiments of the application, the first application can belong to the A-class application mentioned below, and the second application can belong to the B-class application mentioned below. In this case, the electronic device only needs to display the windows (or pictures) of the two applications, that is, N mentioned below is equal to 2, and u = 1 and s = 1.
[0009] In some embodiments of the application, the first application can be a reading application as shown in FIG. 7A, and the second application can be a video application as shown in FIG. 7A. In this case, the first picture can be the picture of window 2a, and the second picture can be the picture of window 1a, and the first image can be an image synthesized by the picture of window 1a and the picture of window 2a as shown in FIG. 7A.
[0010] In some embodiments of the application, the first frame rate can be r mentioned below, and the second frame rate can be Ri mentioned below. In a possible implementation, i = 1, indicating that the electronic device currently needs to display only the second application of the B-class application corresponding to the window.
[0011] In some embodiments of the application, the first threshold value can be a first refresh rate threshold value mentioned below.
[0012] It can be understood that the first refresh rate is the screen refresh rate adopted by the electronic device in displaying the first image on the display screen.
[0013] It can be understood that the first application and the second application are applications that request an APP-VSync signal.
[0014] It can be understood that in the process in which the electronic device displays the first image on the display screen at the first refresh rate, the first image can change, that is, the picture (that is, the first picture) of the first application included in the first image can change, and the picture (that is, the second picture) of the second application included in the first image can also change.
[0015] With reference to the first aspect, in a possible implementation manner, the method further can comprise: the electronic device can generate a VSync signal based on the first timer every first timing duration, and generate a second VSync signal every Y first VSync signals. Wherein, the first timing duration is the inverse of the first refresh rate, and Y is an integer greater than 1. The electronic device renders the picture of the first application at the first frame rate, specifically can comprise: the electronic device can render the picture of the first application based on the first VSync signal. The electronic device renders the picture of the second application at the second frame rate, specifically can comprise: the electronic device renders the picture of the second application based on the second VSync signal.
[0016] In the scheme provided in the present application, the electronic device can render the picture of the first application and the picture of the second application based on the VSync software timer triggering the generation of the VSync signal, that is, one original timer of the electronic device is responsible for the delivery of the APP-VSync signals of multiple applications, without the need to additionally add other timers to trigger the electronic device to render the picture of the first application and the picture of the second application, and naturally, there is no need to synchronize and calibrate multiple timers, which is more convenient and has lower power consumption.
[0017] In some embodiments of the present application, the first VSync signal can be the VSync signal (hardware VSync signal or software VSync signal) mentioned below, and the second VSync signal can be the APP-VSync signal mentioned below.
[0018] In some embodiments of the present application, the first timer can be the VSync software timer mentioned below, and the first timing duration can be understood as the VSync period.
[0019] In some embodiments of the present application, the first application renders its picture once every time it receives a first VSync signal. Similarly, the second application renders its picture once every time it receives a second VSync signal.
[0020] In some embodiments of the present application, the electronic device can generate an App-VSync signal based on the first timer every x VSync periods (or z VSync periods), and send the App-VSync signal to the second application.
[0021] In some embodiments of the present application, the first refresh rate is Y times the second frame rate.
[0022] With reference to the first aspect, in a possible implementation manner, the method further can comprise: the electronic device can generate the first VSync signal based on a first timer every first timing duration, and generate the second VSync signal based on a second timer every second timing duration. The first timing duration is the reciprocal of the first refresh rate. The electronic device renders the picture of the first application at the first frame rate, specifically can comprise: the electronic device can render the picture of the first application based on the first VSync signal. The electronic device renders the picture of the second application at the second frame rate, specifically can comprise: the electronic device can render the picture of the second application based on the second VSync signal. The second timing duration is the reciprocal of the second frame rate.
[0023] In the scheme provided in the present application, the electronic device can render the picture of the first application based on the VSync software timer that triggers the generation of the VSync signal, and create another timer to render the picture of the second application. That is, the electronic device can distribute the App-VSync signal to the first application and the second application based on the two timers respectively, without considering whether there is a multiple relationship between the rendering frame rate of the application and the first frame rate. Through this method, the electronic device can more flexibly adjust the rendering frame rate of the application, and does not have to be limited to that the rendering frame rate of the application must be an integer multiple of the screen refresh rate.
[0024] In some embodiments of the present application, the second timing duration can be understood as the timing duration defined by the second timer mentioned below. It can be understood that the second timing duration can be an integer multiple of the first timing duration, or can not be an integer multiple of the first timing duration. The specific value thereof can be set according to actual needs, and the present application does not limit this.
[0025] With reference to the first aspect, in a possible implementation manner, the first refresh rate is a first multiple of the second frame rate, and the first multiple is greater than an integer.
[0026] In the scheme provided in the present application, in the case where the first refresh rate is an integer multiple of the second frame rate, the electronic device can use the original timer (for example, the VSync software timer) to implement the distribution of the App-VSync signal to the first application and the second application. Compared with the signal distribution manner using multiple timers, this manner is more convenient, does not need to synchronize and calibrate multiple timers, and has lower power consumption.
[0027] In some embodiments of the present application, the first multiple can be equal to Y.
[0028] With reference to the first aspect, in a possible implementation manner, the first refresh rate is not an integer multiple of the second frame rate.
[0029] In the scheme provided in the present application, the electronic device sets the second frame rate without being limited to that the rendering frame rate of the application must be an integral multiple of the screen refresh rate. This method can further improve the flexibility of adjusting the rendering frame rate. For example, in the case of a first refresh rate of 120Hz, the electronic device can set the second frame rate to 90Hz, without being limited to 20Hz, 30Hz, 40Hz, and 60Hz, etc.
[0030] In combination with the first aspect, in a possible implementation, before rendering the picture of the first application at the first frame rate, the method can further include: in response to the first VSync signal, the electronic device can obtain the focus application (or the current focus application), the interaction state of the first application, and the interaction state of the second application, and determine the first frame rate and the second frame rate based on the focus application, the interaction state of the first application, and the interaction state of the second application. The interaction state includes a fling state and a non-fling state.
[0031] In the scheme provided in the present application, the electronic device can implement different rendering frame rates for different applications. In particular, for the application with user interaction, the electronic device can use a high rendering frame rate, and for the application without user interaction, the electronic device can use a low rendering frame rate, thereby avoiding useless rendering caused by using a high rendering frame rate for the application without user interaction, and reducing system load and power consumption.
[0032] In combination with the first aspect, in a possible implementation, the first application can be the focus application that is not in the fling state. After the electronic device displays the first image on the display screen at the first refresh rate, the method can further include: in response to a user operation on the picture (for example, the second picture) of the second application in the first image, the electronic device can update the focus application from the first application to the second application; and the electronic device can also set the screen refresh rate to the second refresh rate. The second refresh rate can be the highest refresh rate corresponding to the second application.
[0033] In the scheme provided in the present application, in the case where the user triggers the change of the focus application, the electronic device can reset the screen refresh rate, and specifically, can set the screen refresh rate to the highest target refresh rate corresponding to the focus application, that is, the electronic device can set the current screen refresh rate based on the target refresh rate corresponding to the application with which the user has the interaction operation, so as to better focus the rendering resources on the application with which the user has the interaction, thereby improving the user experience.
[0034] In some embodiments of the present application, the highest refresh rate corresponding to the application can be the upper limit of the target refresh rate range mentioned below, that is, the highest target refresh rate, and the lowest refresh rate corresponding to the application can be the lower limit of the target refresh rate range mentioned below, that is, the lowest target refresh rate.
[0035] With reference to the first aspect, in a possible implementation manner, after the electronic device sets the screen refresh rate to the second refresh rate, the method can further include: in a case where the second refresh rate is greater than the first threshold, the electronic device can render a picture of the first application at a third frame rate to obtain a third picture, and render a picture of the second application at a fourth frame rate to obtain a fourth picture, and perform synthesis processing on the third picture and the fourth picture to obtain a second image, and then display the second image on the display screen at the second refresh rate. The third frame rate is less than the second refresh rate, and the fourth frame rate is equal to the second refresh rate.
[0036] In the scheme provided in the present application, in a case where the focus application changes, the electronic device can set the current screen refresh rate based on the highest target refresh rate corresponding to the focus application. Further, the electronic device can determine whether the current screen refresh rate is at a higher level (for example, whether the current screen refresh rate is greater than the first threshold). In a case where the current screen refresh rate is high (or the highest target refresh rate corresponding to the focus application is high), the electronic device can reduce the rendering frame rate of part of the applications to reduce useless rendering.
[0037] Similarly, in a case where the second refresh rate is greater than the first threshold, during the process in which the electronic device displays the second image on the display screen at the second refresh rate, the second image can change, that is, the picture of the first application (that is, the third picture) included in the second image can change, and the picture of the second application (that is, the fourth picture) included in the second image can also change.
[0038] In some embodiments of the present application, after each generation of a VSync signal, in response to the generated VSync signal, the electronic device can determine whether the current screen refresh rate is greater than the first threshold. In a case where the current screen refresh rate is greater than the first threshold, the electronic device can set the rendering frame rate of the first application and the rendering frame rate of the second application based on the interaction state of the first application, the interaction state of the second application, and the focus application.
[0039] With reference to the first aspect, in a possible implementation manner, after the electronic device sets the screen refresh rate to the second refresh rate, the method can further include: in a case where the second refresh rate is less than or equal to the first threshold, the electronic device can render a picture of the first application at a fourth frame rate to obtain a fifth picture, and render a picture of the second application at the fourth frame rate to obtain a fourth picture, and perform synthesis processing on the fifth picture and the fourth picture to obtain a third image. That is, in a case where the second refresh rate is less than or equal to the first threshold, the electronic device can render the picture of the first application and the picture of the second application at the fourth frame rate, and perform synthesis processing on the picture of the first application and the picture of the second application rendered at the fourth frame rate to obtain the third image. After the electronic device obtains the third image, the electronic device can also display the third image on the display screen at the second refresh rate.
[0040] In the scheme provided in the present application, in the case where the focus application changes, the electronic device can set the current screen refresh rate based on the highest target refresh rate corresponding to the focus application. Further, the electronic device can determine whether the current screen refresh rate is at a higher level (for example, whether the current screen refresh rate is greater than the first threshold value). In the case where the current screen refresh rate is not at a higher level, the electronic device can directly render the first application and the second application based on the current screen refresh rate, that is, issue an APP-VSync signal to the first application and the second application based on the screen refresh rate. Through this method, the electronic device does not necessarily reduce the rendering frame rate of the application based on the screen refresh rate in any case. For a scene where the screen refresh rate is not high, the electronic device can not additionally adjust the rendering frame rate of the application, so that the rendering frame rate of the application is equal to the screen refresh rate, which can simplify the process and reduce power consumption to a certain extent.
[0041] Similarly, in the case where the second refresh rate is less than or equal to the first threshold value, during the process in which the electronic device displays the third image on the display screen at the second refresh rate, the third image can change, that is, the picture (that is, the fifth picture) of the first application included in the third image can change, and the picture (that is, the sixth picture) of the second application included in the third image can also change.
[0042] In combination with the first aspect, in a possible implementation manner, after the electronic device sets the screen refresh rate to the second refresh rate, the method can further include: if no user operation for the picture displayed on the display screen is detected within a preset time length, setting the screen refresh rate to a third refresh rate. The third refresh rate is less than the second refresh rate, and the third refresh rate is greater than or equal to the lowest refresh rate corresponding to the second application.
[0043] In the scheme provided in the present application, after the focus application changes, if no corresponding user operation is detected within a period of time, the electronic device can reduce the screen refresh rate, without having to maintain it at a higher level, thereby reducing power consumption.
[0044] It can be understood that the preset time length can be set according to actual needs, and the present application does not make a specific limitation in this regard.
[0045] In the second aspect, the present application provides an electronic device, which includes a display screen, one or more memories, and one or more processors; the display screen is coupled with the one or more memories and the one or more processors, the display screen is used to display a picture after drawing, rendering and compositing, the memory is used to store computer program code, the computer program code includes computer instructions, and the one or more processors invoke the computer instructions to enable the electronic device to perform the method described in the first aspect or any one of the implementation manners of the first aspect.
[0046] In a third aspect, the present application provides a computer storage medium. The computer storage medium includes computer instructions, which, when executed on an electronic device, cause the electronic device to perform the method described in the first aspect or any possible implementation of the first aspect.
[0047] In a fourth aspect, the present application provides a chip. The chip can be applied to an electronic device. The chip includes one or more processors configured to invoke computer instructions to cause the electronic device to perform the method described in the first aspect or any possible implementation of the first aspect.
[0048] In some embodiments of the present application, the chip system can be an application processor (AP) or a system on chip (SoC) including an AP. The method described in the first aspect or any possible implementation of the first aspect can be implemented by an AP. The method described in the second aspect or any possible implementation of the second aspect can be implemented by an AP.
[0049] In yet some embodiments of the present application, the chip system can include an AP and another module. The other module can be a modem (also referred to as a baseband processor).
[0050] In a fifth aspect, the present application provides a computer program product including instructions. When the computer program product is executed on an electronic device, the electronic device performs the method described in the first aspect or any possible implementation of the first aspect.
[0051] It can be understood that the electronic device provided in the second aspect, the computer storage medium provided in the third aspect, the chip provided in the fourth aspect, and the computer program product provided in the fifth aspect are all used to perform the method described in the first aspect or any possible implementation of the first aspect. Therefore, the beneficial effects that can be achieved by the above-mentioned aspects can refer to the beneficial effects of any possible implementation of the first aspect, which will not be described herein again. BRIEF DESCRIPTION OF DRAWINGS
[0052] FIG. 1 is a schematic diagram of a user interface provided by an embodiment of the present application;
[0053] FIG. 2 is a schematic diagram of another user interface provided by an embodiment of the present application;
[0054] FIG. 3 is a schematic diagram of a rendering process provided by an embodiment of the present application;
[0055] FIG. 4 is a schematic diagram of a VSync signal distribution provided by an embodiment of the present application;
[0056] FIG. 5 is a flowchart of an image display method according to an embodiment of the present application;
[0057] FIGS. 6A-6C are schematic diagrams of triggering a fling state according to an embodiment of the present application;
[0058] FIGS. 7A-7C are schematic diagrams of another set of user interfaces according to an embodiment of the present application;
[0059] FIGS. 7D-7E are schematic diagrams of a change of a window sliding state according to an embodiment of the present application;
[0060] FIG. 8A is a flowchart of another image display method according to an embodiment of the present application;
[0061] FIG. 8B is a flowchart of another image display method according to an embodiment of the present application;
[0062] FIG. 9A is a schematic diagram of another VSync signal distribution according to an embodiment of the present application;
[0063] FIG. 9B is a schematic diagram of another VSync signal distribution according to an embodiment of the present application;
[0064] FIG. 10 is a schematic diagram of a software structure of an electronic device according to an embodiment of the present application;
[0065] FIGS. 11A and 11B are flowcharts of another image display method according to an embodiment of the present application;
[0066] FIG. 12 is a schematic diagram of a hardware structure of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0067] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the accompanying drawings in the embodiments of the present application. In the description of the embodiments of the present application, unless otherwise specified, " / " means "or", for example, A / B can mean A or B; "and / or" in the text only means a description of a connection relationship of the associated objects, which means that there can be three relationships, for example, A and / or B, which means that there are three cases of A alone, A and B together, and B alone. In addition, in the description of the embodiments of the present application, "multiple" means two or more than two.
[0068] It should be understood that the terms "first", "second" and the like in the description and in the claims of the present application and the drawings refer to different objects and not to a particular order. Furthermore, the terms "comprises", "comprising", "has", "having", "includes", "including", and the like are to be construed open- ended, allowing for instances where there are equivalents. For example, a process, method, object, or device that comprises several steps or elements is not limited to those listed, but can include additional steps or elements not expressly listed or inherent to such process, method, object, or device.
[0069] It should be understood that the term "user interface" in the description and claims of the present application and the drawings is a medium interface for interaction and information exchange between an application or operating system and a user. The commonly used form of user interface is a graphic user interface (GUI), which refers to a user interface related to computer operation displayed in a graphical manner. It can be an icon, window, control, etc. interface element displayed in the display screen of an electronic device, wherein the control can include an icon, button, menu, tab, text box, dialog box, status bar, navigation bar, widget, etc. visual interface element.
[0070] Reference to "an embodiment" in this application means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the application. The occurrence of the phrase in various places in the specification does not necessarily all refer to the same embodiment, nor does it necessarily exclude other embodiments or alternative embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.
[0071] According to the foregoing, in a composite scenario, the electronic device can display multiple windows of multiple applications, and can also display multiple windows of one application. It can be understood that the window of an application displays the user interface of the application. Based on the refresh rate control strategy of the electronic device, the application running on the electronic device can be preset with a target refresh rate interval, such as [60, 60], [60, 120], etc. In the case where the electronic device displays only one window of an application, the electronic device can refresh the picture displayed on the electronic device based on the target refresh rate interval set by the application (which can be referred to as the target refresh rate interval corresponding to the application). In the scenario where multiple applications are running simultaneously, the target refresh rate intervals of different applications can be the same or different, and in this case, the electronic device can refresh the picture displayed on the electronic device based on the target refresh rate interval of one of the applications. That is, the refresh rate strategy adopted by the system as a whole of the electronic device (for example, the refresh rate strategy adopted when user interaction occurs) is to set the screen refresh rate based on the target refresh rate interval.
[0072] In a composite scenario where the electronic device displays multiple windows of multiple applications, a user can interact with one window of one application at the same time, and refresh the multiple windows of multiple applications displayed by the electronic device according to a target refresh rate interval corresponding to the application with which the user interacts. Once the upper limit of the target refresh rate interval corresponding to the application with which the user interacts is high, the system load and power consumption will greatly increase, affecting the stability of long-term operation of the system.
[0073] For ease of description, the application with which the user interacts is referred to as the focus application, the window of the application with which the user interacts is referred to as the focus window, and the application with which the user does not interact is referred to as the non-focus application.
[0074] In the above composite scenario, the screen refresh rate (i.e., the system refresh rate) of the electronic device can be set based on the target refresh rate interval corresponding to the focus application. Specifically, in the case where the user has an interactive operation on the electronic device, the screen refresh rate of the electronic device can be maintained at the upper limit of the target refresh rate interval corresponding to the focus application (e.g., 90Hz or 120Hz), and in the case where the user stops interacting (e.g., the user lifts the hand after swiping on the display screen of the electronic device), the screen refresh rate of the electronic device can fall back to the lower limit of the target refresh rate interval corresponding to the focus application (e.g., 60Hz or lower frequency). It can be understood that during the falling back process, the screen refresh rate of the electronic device can be set to a value lower than the upper limit of the target refresh rate interval and higher than the lower limit of the target refresh rate interval. The upper limit of the target refresh rate interval can also be referred to as the highest target refresh rate, and the lower limit of the target refresh rate interval can also be referred to as the lowest target refresh rate.
[0075] The refresh strategy in the above composite scenario is exemplarily introduced below based on Table 1.
[0076] Table 1
[0077] As shown in Table 1, the electronic device can display the user interface of application 1 and the user interface of application 2 at the same time, and detect a user operation acting on the user interface of application 2. That is, application 2 is the focus application, and application 1 is the non-focus application.
[0078] In a possible implementation, as shown in Table 1, the electronic device originally sets the upper limit of the target refresh rate range for application 1 (i.e., the highest target refresh rate corresponding to application 1) to 60 Hz, and originally sets the upper limit of the target refresh rate range for application 2 (i.e., the highest target refresh rate corresponding to application 2) to 120 Hz. In this case, after the electronic device detects the user operation on the user interface of application 2, the electronic device can refresh the displayed screen (including the user interface of application 1 and the user interface of application 2) at the highest target refresh rate corresponding to the focus application (i.e., application 2), that is, 120 Hz. It can be understood that the highest target refresh rate corresponding to application 1 is only 60 Hz, and if the electronic device refreshes the user interface of application 1 at 120 Hz, the refresh frequency will be higher than expected (i.e., the actual refresh frequency will be greater than the highest target refresh rate), and application 1 is a non-focus application, and using a high refresh rate will cause useless rendering and increase additional system load. It can be understood that the refresh frequency mentioned here and the rendering refresh frequency mentioned in Table 1 can be understood as the rendering frame rate mentioned below, that is, the frequency of drawing and rendering a screen (or a frame of image) by an application.
[0079] In another possible implementation, as shown in Table 1, the electronic device originally sets the upper limit of the target refresh rate range for application 1 and application 2 to 60 Hz, that is, the highest target refresh rate corresponding to application 1 and application 2 is 60 Hz. In this case, after the electronic device detects the user operation on the user interface of application 2, the electronic device can refresh the displayed screen (including the user interface of application 1 and the user interface of application 2) at the highest target refresh rate corresponding to application 2, that is, 60 Hz. It can be understood that the highest target refresh rate corresponding to application 1 is 60 Hz, and the electronic device refreshes the user interface of application 1 at 60 Hz, which meets the expectation and does not increase additional system load.
[0080] In another possible implementation, as shown in Table 1, the electronic device originally sets the upper limit of the target refresh rate range for application 1 and application 2 to 120 Hz, that is, the highest target refresh rate corresponding to application 1 and application 2 is 120 Hz. In this case, after the electronic device detects the user operation on the user interface of application 2, the electronic device can refresh the displayed screen (including the user interface of application 1 and the user interface of application 2) at the highest target refresh rate corresponding to the focus application (i.e., application 2), that is, 120 Hz. It can be understood that although the highest target refresh rate corresponding to application 1 is also 120 Hz, application 1 is a non-focus application, and using a high refresh rate will cause useless rendering and increase additional system load.
[0081] In yet another possible implementation, as shown in Table 1, the electronic device originally sets the upper limit of the target refresh rate interval for application 1 and application 2 as 120 Hz and 60 Hz respectively, that is, the highest target refresh rate corresponding to application 1 is 120 Hz, and the highest target refresh rate corresponding to application 2 is 60 Hz. In this case, after the electronic device detects the user operation acting on the user interface of application 2, it can refresh the displayed screen (including the user interface of application 1 and the user interface of application 2) according to the highest target refresh rate corresponding to the focus application (that is, application 2), that is, 60 Hz. It can be understood that the highest target refresh rate corresponding to application 1 is 120 Hz, and application 1 is a non-focus application, and the electronic device uses 60 Hz to refresh the user interface of application 1 will not cause useless rendering, and naturally will not increase the additional system load.
[0082] It can be understood that the electronic device will refresh the user interface of the focus application and the user interface of the non-focus application according to the target refresh rate interval corresponding to the focus application. In the case where the highest target refresh rate corresponding to the focus application is high, the above-mentioned refreshing manner can cause the refresh frequency of the non-focus application to be higher than expected, and cause useless rendering, so as to increase the system load.
[0083] For example, as shown in FIG. 1, the display screen of the electronic device can display window 1a and window 2a. Among them, the user interface of a video application is displayed in window 1a, and the user interface of a reading application is displayed in window 2a. The highest target refresh rate corresponding to the video application is 60 Hz, and the highest target refresh rate corresponding to the reading application is 120 Hz. The electronic device can detect the user operation (for example, the click operation) acting on window 2a, and in response to the user operation, the electronic device can determine that window 2a is the focus window, and the reading application is the focus application. Further, the electronic device can use the highest target refresh rate corresponding to the reading application to refresh the entire screen displayed on the display screen (including the screen displayed in window 1a and the screen displayed in window 2a). However, the highest target refresh rate corresponding to the video application is only 60 Hz, and if the electronic device refreshes the user interface of the video application at 120 Hz, the refresh frequency will be higher than expected (that is, the actual refresh frequency will be greater than the highest target refresh rate), and the video application is a non-focus application, and using a high refresh rate will cause useless rendering and increase the additional system load.
[0084] For example, as shown in FIG. 2, the display screen of the electronic device can display a window 3a, a window 3b, and a window 2a. The window 3a and the window 3b display a user interface of a shopping application, and the window 2a displays a user interface of a reading application. The highest target refresh rate of the shopping application and the reading application is 120 Hz. The electronic device can detect a user operation (for example, a click operation) acting on the window 2a, and in response to the user operation, the electronic device can determine that the window 2a is a focus window, and the reading application is a focus application. Further, the electronic device can use the highest target refresh rate corresponding to the reading application to refresh the entire picture displayed on the display screen (including the pictures displayed in the window 3a, the window 3b, and the window 2a). However, the shopping application is a non-focus application, and using a high refresh rate will cause useless rendering and increase additional system load.
[0085] Based on the above, the embodiments of the present application provide an image display method and related equipment. According to the method, in the case that the electronic device displays multiple windows of multiple applications at the same time, for the focus application and the application in the fling state, the electronic device can use the current screen refresh rate as the rendering frame rate for drawing and rendering, and for the non-focus application in the non-fling state, the electronic device can use a rendering frame rate lower than the current screen refresh rate for drawing and rendering. This method can avoid useless rendering caused by the high rendering frame rate of the non-focus application, thereby reducing system load and power consumption.
[0086] The present application relates to a rendering mechanism. In order to facilitate understanding, the rendering mechanism (also referred to as VSync mechanism) will be briefly introduced first.
[0087] The graphics rendering pipeline involves an application (which can be referred to as an application for short), a surface flinger, and a display screen (which can also be referred to as a screen). The surface flinger can also be referred to as a surface compositor. For a frame of picture, the application first needs to draw and render it, and then the surface flinger needs to perform merging rendering on it and put it into a frame buffer, and finally send it to the display screen for display.
[0088] The graphics rendering pipeline (including the drawing and rendering work of the application, the merging work of the surface flinger, and the display work of the display screen) is driven by a vertical synchronization (VSync) signal as a whole. The electronic device can generate the VSync signal according to a fixed period, which can be referred to as a VSync period.
[0089] In some embodiments of the present application, for the same frame, when the first VSync period arrives (or the first VSync signal is generated), the application starts to perform UI rendering, when the second VSync period arrives (or the second VSync signal is generated), the SurfaceFlinge can perform layer composition, when the third VSync period arrives (or the third VSync signal is generated), the display obtains the completed composition data and displays it on the display to present to the user. For example, as shown in FIG. 3, when the first VSync period arrives, the application can complete the first frame of UI rendering, when the second VSync period arrives, the SurfaceFlinge can complete the first frame of layer composition, the application can complete the second frame of UI rendering, when the third VSync period arrives, the display can complete the first frame of display, the SurfaceFlinge can complete the second frame of layer composition, the application can complete the third frame of UI rendering, when the fourth VSync period arrives, the display can complete the second frame of display, the SurfaceFlinge can complete the third frame of layer composition, the application can complete the fourth frame of UI rendering, when the fifth VSync period arrives, the display can complete the third frame of display, the SurfaceFlinge can complete the fourth frame of layer composition, the application can complete the fifth frame of UI rendering.
[0090] As shown in FIG. 4, there are two ways to generate VSync signals: generated by hardware (for example, hardware modules related to hardware compositor) and simulated by software (for example, VSyncThread). It can be understood that the hardware or software can generate VSync signals at a fixed period, which can be referred to as VSync period. It can be understood that the VSync signal generated by hardware can be referred to as hardware VSync signal, and the VSync signal generated by software can be referred to as software VSync signal. In some embodiments of the present application, the VSync period is determined by the screen refresh rate. For example, the screen refresh rate can be 60Hz, and the VSync period can be the inverse of the screen refresh rate, that is, 16.67 milliseconds (ms).
[0091] In some embodiments of the present application, the VSync signal generated by hardware (also referred to as HW-VSync signal) can be a pulse signal. In some embodiments of the present application, the software simulates to generate VSync signal, which can specifically include: the electronic device samples the VSync signal generated by hardware and creates a model, and then outputs the VSync signal.
[0092] In some embodiments of the present application, the VSync signal generated by the hardware can be a hardware VSync event received by a hardware composer (HWC). It can be understood that a hardware VSync event callback can be registered in the HWC, and the vsync function of the HWC is called when the hardware VSync event arrives. After the HWC receives the hardware VSync event, the hardware VSync event is added to the VSync event sample of DispSync by SurfaceFlinger, and when the DispSync sampling is completed, the hardware VSync event is stopped, and the VSync event is generated by software according to the calculation result of the sample, that is, the VSync signal is generated. It can be understood that when there is an error in the period of the software generated VSync signal, the electronic device needs to generate the VSync event by hardware again, and the hardware VSync event sample is collected again.
[0093] As shown in FIG. 4, the electronic device can generate or simulate the VSync signal (such as the hardware VSync signal / software VSync signal shown in FIG. 4) by hardware, and virtualize the VSync signal into the App-VSync signal (also referred to as VSync-app signal) and SF-VSync signal (also referred to as VSync-sf signal) by the VSync signal virtualization thread (for example, DispSyncThread). The electronic device can receive the APP-VSync signal and the SF-VSync signal by two event threads (EventThread) respectively. For the convenience of understanding and description, the event thread receiving the APP-VSync signal is recorded as EventThread (APP) in the present application, and the event thread receiving the SF-VSync signal is recorded as EventThread (SF). As shown in FIG. 4, after the EventThread (APP) receives the APP-VSync signal, the corresponding application can be woken up, and the application is driven to perform UI rendering. Specifically, the UI thread of the application is woken up to perform the work of UI rendering (including input event processing, animation, drawing, etc.). After the EventThread (SF) receives the SF-VSync signal, the SurfaceFlinger can be woken up, and the SurfaceFlinger is driven to perform layer merging.
[0094] Next, an image display method provided by an embodiment of the present application is introduced.
[0095] Please refer to FIG. 5, which is a flow chart of an image display method provided by an embodiment of the present application. The rendering frame rate adjustment method can be applied to an electronic device, including but not limited to the following steps:
[0096] S101: In a case where the current screen refresh rate is greater than the first refresh rate threshold, set the rendering frame rate of the N applications based on the interaction state of the focus application and the N applications.
[0097] In a case where the current screen refresh rate is greater than the first refresh rate threshold, the electronic device can set the rendering frame rate of the N applications based on the interaction state of the focus application and the N applications, the N applications being the N applications that have been started by the electronic device. In some embodiments of the present application, the N applications are the applications that request the APP-VSync signal from the electronic device, specifically, the applications that request the APP-VSync signal from the event thread (as shown in FIG. 4). It can be understood that the present application does not limit the order in which the electronic device starts the N applications. N is an integer greater than 1. For example, N can be 2. For another example, N can be 3.
[0098] In some embodiments of the present application, the electronic device sets the rendering frame rate of the N applications based on the interaction state of the focus application and the N applications, specifically, which can include: the electronic device keeps the rendering frame rate of the focus application or the application in the fling state in the N applications the same as the current screen refresh rate, and sets the rendering frame rate of the non-focus application not in the fling state in the N applications less than the current screen refresh rate.
[0099] In some embodiments of the present application, in response to the generated VSync signal, the electronic device can determine whether the current screen refresh rate is greater than the first refresh rate threshold, and in a case where the current screen refresh rate is greater than the first refresh rate threshold, set the rendering frame rate of the N applications based on the interaction state of the focus application and the N applications.
[0100] In some embodiments of the present application, the electronic device generates the VSync signal, specifically, which can include: the electronic device generates the VSync signal through hardware, or the electronic device simulates the generation of the VSync signal through software (synchronized with the hardware generation of the VSync signal).
[0101] In some embodiments of the present application, after the electronic device generates the VSync signal each time, in response to the generated VSync signal, the electronic device can determine whether the current screen refresh rate is greater than the first refresh rate threshold, and in a case where the current screen refresh rate is greater than the first refresh rate threshold, set the rendering frame rate of the N applications based on the interaction state of the focus application and the N applications.
[0102] According to the foregoing, after generating the VSync signal each time, specifically, it can be understood that each time a VSync cycle comes.
[0103] In some embodiments of the present application, the VSync period is the inverse of the screen refresh rate (or system refresh rate). For example, the screen refresh rate of the electronic device can be 120Hz, and accordingly, the VSync period can be 1 / 120s, i.e., 8.3ms (retaining one decimal place).
[0104] It can be understood that the size of the screen refresh rate that the electronic device can support is mainly determined by the display screen itself specifications of the electronic device (e.g., the bandwidth, resolution, refresh rate, etc. of the display screen).
[0105] In some embodiments of the present application, the screen refresh rate of the electronic device is a fixed value. For example, the screen refresh rate of the electronic device is fixed at 60Hz.
[0106] In yet some embodiments of the present application, the electronic device can support multiple screen refresh rate specifications, i.e., the screen refresh rate of the electronic device can change. For example, the electronic device supports a screen refresh rate of 120Hz (i.e., the display screen refreshes the picture 120 times per second) and a screen refresh rate of 60Hz (i.e., the display screen refreshes the picture 60 times per second). In this case, the electronic device can automatically adjust the screen refresh rate according to the current use scenario, or the user can trigger the electronic device to adjust the screen refresh rate. For example, the system refresh rate of the electronic device is set to 60Hz by default, and the user can trigger the electronic device to adjust the system refresh rate to 120Hz.
[0107] It can be understood that in the case where the electronic device supports multiple screen refresh rates, the initial screen refresh rate used by the electronic device can be set according to actual needs. For example, the initial screen refresh rate set in the electronic device can be 60Hz.
[0108] It can be understood that the present application does not limit the specific value of one or more screen refresh rates supported by the electronic device.
[0109] In some embodiments of the present application, the electronic device can be provided with a VSync software timer, and the VSync signal is controlled through the VSync software timer. It can be understood that the timing duration defined by the VSync software timer is a VSync period. Specifically, when the timing duration of the VSync software timer reaches the timing duration defined by it (i.e., a VSync period), the electronic device generates a VSync signal. Further, as shown in FIG. 4, the electronic device can generate App-VSync signals and SF-VSync signals based on the generated VSync signals, and distribute the App-VSync signals and the SF-VSync signals.
[0110] It should be noted that, in the case that the screen refresh rate currently used by the electronic device (i.e., the current screen refresh rate) changes, the VSync period also changes accordingly, and the timing duration defined by the VSync software timer also changes accordingly.
[0111] In a possible implementation, the timing duration of the VSync software timer can be stopped and cleared each time it reaches the defined timing duration (i.e., one VSync period), and then restarted until the timing duration reaches the defined timing duration again, and then stopped and cleared again, and then restarted, and so on.
[0112] In some embodiments of the present application, the electronic device can record the focus application, so that the electronic device can check the record to determine the current focus application. For example, the electronic device can record the package name of the focus application. Specifically, the electronic device can detect a user operation acting on the display screen, and in response to the user operation, the electronic device can update and record the focus application and / or the focus window based on the specific position of the user operation on the display screen. In a possible implementation, in response to a touch operation of a user acting on the display screen displaying N windows of applications, the electronic device can determine the window in which the user touch position is located as the focus window, and based on the correspondence between the windows and the applications, determine the application corresponding to the focus window as the focus application.
[0113] For example, as shown in FIG. 1, the electronic device displays window 1a and window 2a on the display screen, and window 1a is a window corresponding to a video application, and the user interface of the video application is displayed in window 1a, and window 2a is a window corresponding to a reading application, and the user interface of the reading application is displayed in window 2a. The electronic device can detect a user operation of clicking window 2a (or a user operation of clicking the user interface in window 2a), and after detecting the click operation, the electronic device can update the focus window to window 2a, and update the focus application to the application corresponding to window 2a, i.e., the reading application.
[0114] In some embodiments of the present application, the electronic device can set the screen refresh rate based on the target refresh rate interval corresponding to the focus application. Specifically, after detecting a user operation, the electronic device can determine whether the focus application changes. If the focus application does not change, the electronic device can set the screen refresh rate based on the target refresh rate interval corresponding to the focus application (i.e., the focus application that does not change), and if the focus application changes, the electronic device can set the screen refresh rate based on the target refresh rate interval corresponding to the changed focus application.
[0115] In a possible implementation, in a case where the user operation is detected and it is determined that the focus application does not change, the electronic device can set the screen refresh rate to the highest target refresh rate corresponding to the focus application, and after the user operation stops, the electronic device can reduce the screen refresh rate in the target refresh rate interval corresponding to the focus application, that is, set the screen refresh rate to be less than the highest target refresh rate corresponding to the focus application, and not less than the lowest target refresh rate corresponding to the focus application. For example, after the user operation stops, the electronic device can set the screen refresh rate to the lowest target refresh rate corresponding to the focus application.
[0116] In a possible implementation, in a case where the user operation is detected and it is determined that the focus application changes, the electronic device can set the screen refresh rate to the highest target refresh rate corresponding to the changed focus application, and after the user operation stops, the electronic device can reduce the screen refresh rate in the target refresh rate interval corresponding to the changed focus application, that is, set the screen refresh rate to be less than the highest target refresh rate corresponding to the changed focus application, and the set screen refresh rate is not less than the lowest target refresh rate corresponding to the changed focus application. For example, after the user operation stops, the electronic device can set the screen refresh rate to the lowest target refresh rate corresponding to the changed focus application.
[0117] In some embodiments of the present application, the electronic device stores a corresponding relationship between one or more applications and target refresh rate intervals. It can be understood that the target refresh rate intervals corresponding to multiple applications in the electronic device can be completely the same, partially the same, or completely different, which is not limited in the present application.
[0118] It can be understood that the target refresh rate interval corresponding to an application can be set according to actual needs, which is not limited in the present application. It should be noted that the refresh rates contained in the target refresh rate interval corresponding to an application are the screen refresh rates supported by the electronic device. Specifically, the electronic device can select a refresh rate supported by the electronic device to set the screen refresh rate in the target refresh rate interval corresponding to the application, rather than every value in the target refresh rate interval corresponding to the application can be set as the screen refresh rate. For example, the screen refresh rates supported by the electronic device include 144Hz, 120Hz, 90Hz, 60Hz, 40Hz and 30Hz, in which case the upper limit and the lower limit of the target refresh rate interval corresponding to each application in the electronic device can be selected from the above refresh rates, and cannot be other screen refresh rates not supported by the electronic device, for example, the target refresh rate interval corresponding to an application in the electronic device can be [60, 90], but cannot be [20, 110].
[0119] In some embodiments of the present application, the corresponding target refresh rate interval of an application is pre-set before the application is shipped, and the corresponding target refresh rate interval of the application can change (e.g., the upper limit of the target refresh rate interval is increased) after the application is upgraded or the system is upgraded, but the upper limit and the lower limit of the changed target refresh rate interval are also the screen refresh rates supported by the electronic device. For example, the screen refresh rates supported by the electronic device include 120Hz and 60Hz, and the highest target refresh rate corresponding to application 1 before the upgrade is 60Hz, and the highest target refresh rate corresponding to application 1 after the upgrade is changed to 120Hz.
[0120] In some embodiments of the present application, for an application downloaded after the electronic device is shipped, the electronic device can set the corresponding target refresh rate interval of the application based on the application type and its own running needs. Of course, the electronic device needs to set the corresponding target refresh rate interval of the application within the range of the screen refresh rates it supports.
[0121] In some embodiments of the present application, a part of the applications carry the related information of the corresponding target refresh rate interval of the applications, and the electronic device can obtain the related information of the corresponding target refresh rate interval of the applications and determine the corresponding target refresh rate interval of the applications during the process of downloading, installing and starting the part of the applications.
[0122] In some embodiments of the present application, the user can change the corresponding target refresh rate interval of the application by himself. Of course, the user needs to set the corresponding target refresh rate interval of the application within the range of the screen refresh rates supported by the electronic device.
[0123] In some embodiments of the present application, for the applications (e.g., reading applications, social media and shopping applications, etc.) provided with the up and down sliding interface, the electronic device can set the upper limit (i.e., the highest target refresh rate) of the corresponding target refresh rate interval of the applications to be higher, for example, the upper limit of the corresponding target refresh rate interval of the applications can be set to the highest screen refresh rate (e.g., 144Hz).
[0124] In some embodiments of the present application, the electronic device can record the interaction state of each application that has been started. Similar to the above recording of the focus application, the electronic device can update and record the interaction state of each application based on the user operation acting on the display screen. In some embodiments of the present application, the interaction state of an application can include a non-fling state and a fling state. Fling refers to the automatic sliding of the user interface of an application displayed on the display screen after the user slides the user interface of the application on the display screen and lifts the hand (at this time, the user does not touch the user interface of the application), specifically, the user interface continues to scroll in the direction of the finger sliding until it stops. The fling operation is triggered from the moment the finger leaves the display screen and ends when the scrolling stops. The non-fling state refers to other states except the fling state. For example, the user interface of the application is not sliding.
[0125] The fling state will be described below in detail in conjunction with FIGS. 6A-6C.
[0126] As shown in FIGS. 6A-6C, the electronic device displays two windows (i.e., window w1 and window w2) on the display screen, and the two windows correspond to one application respectively. It should be noted that FIGS. 6A-6C are only an example provided by the present application, and the electronic device can also display more windows of more applications on the display screen, which is not limited in the present application.
[0127] FIGS. 6A-6C represent the process of triggering fling by sliding the finger on the display screen. Specifically, as shown in (1) of FIG. 6A, the user's finger falls on the display screen (the initial touch on the display screen in this sliding process), and when the user's finger falls on the display screen, the icon 1 in the window w2 is at position 1. Further, as shown in (2) of FIG. 6B, after the user's finger falls on the display screen, the user can slide upwards on the display screen (the finger sliding upwards track has been shown in FIGS. 6A and 6B), and during the sliding process, the user interface displayed by the window w2 slides upwards along with the sliding of the finger, and accordingly, the position of the icon 1 in the user interface displayed by the window w2 changes from position 1 to position 2 (the position change of the icon 1 during the sliding process has been shown in FIG. 6B). Further, as shown in (3) of FIG. 6B, after the user's finger slides a distance on the display screen, the user lifts the hand (i.e., the user's finger leaves the display screen), and at this time, the icon 1 in the window w2 is at position 2. Further, as shown in (4) of FIG. 6C, after the user lifts the hand, the fling is triggered in the case that the sliding speed is greater than the speed threshold, and the user interface in the window w2 continues to slide upwards (automatically slides upwards). During the automatic sliding upwards of the user interface in the window w2, the position of the icon 1 changes from position 2 to position 3. When the icon 1 is at position 3, the user interface in the window w2 stops sliding.
[0128] As shown in FIG. 7A, the electronic device can display a window 1a corresponding to a video application and a window 2a corresponding to a reading application on the display screen. The electronic device can detect an upward swipe operation on the window 2a. In response to the upward swipe operation, the user interface in the window 2a can swipe upward along with the user's finger. It can be understood that the upward swipe operation shown in FIG. 7A can include the operation of the finger falling on the display screen shown in FIG. 6A and the operation of the finger swiping upward on the display screen shown in FIG. 6B. After the electronic device detects the upward swipe operation on the window 2a, the electronic device can detect a lift-off operation on the window 2a. As shown in FIG. 7B, after the electronic device detects the lift-off operation on the window 2a, the user interface in the window 2a can continue to swipe upward. At this time, the swipe is automatic swipe of the user interface in the window 2a, rather than swipe of the user interface driven by the user's finger. As shown in FIG. 7B, during the automatic upward swipe of the user interface in the window 2a, the user can click a video 1 control in the window 1a. In response to the click operation, the electronic device can display the content shown in FIG. 7C on the display screen. As shown in FIG. 7C, the electronic device can display the window 1a, a window 1b, and the window 2a on the display screen. Like the window 1a, the window 1b is also a window corresponding to the video application. At this time, the user interface in the window 2a is different from the user interface in the window 2a shown in FIG. 7B. This means that during the process in which the focus application changes from the reading application to the video application, the user interface in the window 2a is still swiping upward and is not affected by the user's click on the video 1 control (for example, the swipe does not stop because of the user's click on the video 1 control). Moreover, as shown in FIG. 7C, the user interface in the window 2a can continue to swipe upward.
[0129] For example, FIGS. 7D and 7E show specific changes of the user interface in the window 2a during the process that the user's finger slides up in the window 2a and triggers a fling. As shown in (1) of FIG. 7D, the user's finger lands on the display and slides up on the display, and in response to the user operation, the user interface in the window 2a of the electronic device slides up along with the sliding of the finger. During the sliding, the window 2a of the electronic device can display the user interface as shown in (1) and (2) of FIG. 7D. It can be understood that, as shown in (1)-(3) of FIG. 7D, during the process that the user's finger slides up on the display, the user interface in the window 2a also changes accordingly. As shown in (1) of FIG. 7E, the user's finger can be lifted after sliding up on the display for a distance, and in response to the user operation, the user interface in the window 2a of the electronic device can continue to slide up automatically, and during the automatic sliding, the window 2a of the electronic device can display the user interface as shown in (2) of FIG. 7E. As shown in (3) of FIG. 7E, the user interface in the window 2a of the electronic device can stop sliding up after sliding up for a distance.
[0130] In some embodiments of the present application, the sliding speed can be the speed of the user's finger sliding on the display, and specifically can be the sliding speed in a certain direction.
[0131] It can be understood that the speed threshold value can be set according to actual needs, and the present application does not make any limitation in this regard.
[0132] It can be understood that after the electronic device detects the user's operation of touching the display, the electronic device can generate a corresponding touch event. The touch event can include the following three types of events: a landing event (for example, MotionEvent.ACTION_DOWN), a moving event (for example, MotionEvent.ACTION_MOVE), and a leaving event (for example, MotionEvent.ACTION_UP). It can be understood that a complete operation of touching the display starts with a landing event, and in the middle, there can be no or one or more moving events, and finally ends with a leaving event. For example, during the process that the user clicks the display with the finger, the landing of the user's finger on the display triggers the electronic device to generate a landing event, and the leaving of the user's finger from the display triggers the electronic device to generate a leaving event. For another example, during the process that the user slides on the display with the finger, the landing of the user's finger on the display triggers the electronic device to generate a landing event, the sliding of the user's finger on the display after landing on the display triggers the electronic device to generate multiple moving events, and the leaving of the user's finger from the display triggers the electronic device to generate a leaving event. It can be understood that the fling is an action that occurs after the user's finger leaves the display (i.e., the finger is completely lifted).
[0133] In some embodiments of the present application, a user's finger is dropped on the display screen, in response to the user operation, the electronic device generates a drop event, and updates the focus window.
[0134] In some embodiments of the present application, after a user's finger is swiped on the display screen and then lifted, in response to the user operation, the electronic device can perform a fling operation in the case that the swiping speed is greater than a speed threshold. In a possible implementation, the electronic device can calculate the current swiping speed by calling the computeCurrentVelocity() method. In a possible implementation, the electronic device can determine the swiping distance based on the coordinates of the drop event and the leave event, and determine the swiping duration (which can be specifically the duration between the generation of the drop event and the generation of the leave event), and then calculate the swiping speed based on the swiping distance and the swiping duration.
[0135] It can be understood that after each VSync signal is generated (or each VSync period arrives), the electronic device can determine whether the current screen refresh rate adjustment is greater than a first refresh rate threshold. In the case that the current screen refresh rate is greater than the first refresh rate threshold, for each of the N applications corresponding to the window displayed by the electronic device on the display screen, the electronic device can determine whether it is a focus application and whether its interaction state is a fling state. Specifically, for the focus application or the application in the fling state in the N applications, the electronic device can keep the rendering frame rate of the application to be the same as the current screen refresh rate. However, for the non-focus application in the non-fling state (i.e., not in the fling state) in the N applications, the electronic device can set (or adjust) the rendering frame rate of the application to be a rendering frame rate less than the current screen refresh rate.
[0136] It can be understood that the first refresh rate threshold can be set according to actual needs, and the present application does not limit this. For example, the first refresh rate threshold can be 60 Hz.
[0137] For the convenience of understanding and description, the present application refers to the focus application or the application in the fling state in the N applications corresponding to the window displayed by the electronic device on the display screen as an A-class application, and refers to the non-focus application not in the fling state in the N applications as a B-class application.
[0138] According to the above, in some embodiments of the present application, after each VSync signal is generated, in the case that the current screen refresh rate is greater than the first refresh rate threshold, for the A-class application in the N applications, the electronic device can determine the rendering frame rate of the application to be the current screen refresh rate, and for the B-class application in the N applications, the electronic device can determine the rendering frame rate of the application to be less than the current screen refresh rate.
[0139] For the convenience of understanding and description, the number of the A-class applications among the N applications corresponding to the window displayed on the display screen of the electronic device is denoted as u, and the number of the B-class applications among the N applications is denoted as s. That is, u applications among the N applications are in the fling state or are the focus application, and s non-focus applications among the N applications are not in the fling state. It can be understood that u + s = N.
[0140] For the convenience of understanding and description, the current screen refresh rate is denoted as r, and the set rendering frame rate corresponding to the B-class applications is denoted as Ri. It can be understood that i is an integer not greater than s. That is, the set rendering frame rate corresponding to the B-class applications among the N applications corresponding to the window displayed on the display screen of the electronic device is {R1, …, Ri, …, Rs}. Among them, R1 to Rs are the set rendering frame rates corresponding to the s B-class applications among the N applications, respectively.
[0141] In some embodiments of the present application, after each generation of a VSync signal, in the case where the current screen refresh rate is greater than the first refresh rate threshold, the electronic device can maintain the rendering frame rate of the A-class applications among the N applications corresponding to the window displayed on the display screen as the current screen refresh rate. That is, the set rendering frame rate of the u A-class applications among the N applications is r.
[0142] It can be understood that the specific value of r can be set according to actual needs, and the present application does not make any limitation thereon. For example, r can be 120Hz. In some embodiments of the present application, the specific value of r is related to application requirements and types.
[0143] In some embodiments of the present application, after each generation of a VSync signal, in the case where the current screen refresh rate is greater than the first refresh rate threshold, the electronic device can set the rendering frame rate of the B-class applications among the N applications corresponding to the window displayed on the display screen to a rendering frame rate less than the current screen refresh rate. That is, Ri is less than r.
[0144] In some embodiments of the present application, the set rendering frame rate of the B-class applications among the N applications can be the lower limit of the target refresh rate interval corresponding thereto, that is, the minimum target refresh rate.
[0145] In some embodiments of the present application, the set rendering frame rate of the B-class applications among the N applications is not less than threshold 1, that is, Ri is not less than threshold 1. It can be understood that threshold 1 can be set according to actual needs, and the present application does not make any limitation thereon. For example, threshold 1 can be 30Hz.
[0146] In some embodiments of the present application, when each VSync period arrives, in the case that the current screen refresh rate is greater than the first refresh rate threshold, for the B-type applications among the N applications corresponding to the window displayed by the electronic device on the display screen, in the case that r is greater than threshold 2, the electronic device can set the rendering frame rate of the B-type applications to be less than r, i.e., Ri is less than r, while in the case that r is less than or equal to threshold 2, the electronic device can set the rendering frame rate of the B-type applications to be less than or equal to r, i.e., Ri is less than or equal to r.
[0147] In some embodiments of the present application, in the case that s is greater than 1, the rendering frame rate (i.e., the adjusted rendering frame rate) set for each of the s B-type applications among the N applications can be the same or different. That is, in the case that i is different, Ri can remain unchanged or change.
[0148] For example, the electronic device can display the windows of application 1, application 2, application 3 and application 4 on the display screen, and the screen refresh rate of the electronic device is 60 Hz. Among them, application 1 is the focus application, application 2 is in the fling state, and application 3 and application 4 are neither the focus application nor in the fling state, and the highest target refresh rate corresponding to application 1 is 120 Hz. When the VSync period of the electronic device arrives, the electronic device can set the screen refresh rate to 120 Hz, i.e., the screen refresh rate changes from 60 Hz to 120 Hz, keep the rendering frame rate of application 1 and application 2 at 120 Hz, and set the rendering frame rate of application 3 and application 4 to 60 Hz.
[0149] For example, the electronic device can display the windows of application 1, application 2, application 3 and application 4 on the display screen, and the screen refresh rate of the electronic device is 60 Hz. Among them, application 1 is the focus application, application 2 is in the fling state, and application 3 and application 4 are neither the focus application nor in the fling state, and the highest target refresh rate corresponding to application 1 is 120 Hz. When the VSync period of the electronic device arrives, the electronic device can set the screen refresh rate to 120 Hz, i.e., the screen refresh rate changes from 60 Hz to 120 Hz, keep the rendering frame rate of application 1 and application 2 at 120 Hz, and set the rendering frame rate of application 3 and application 4 to 60 Hz.
[0150] In some embodiments of the present application, r=k*Ri. That is, the rendering frame rate of the B-type applications among the N applications corresponding to the window displayed by the electronic device on the display screen can be divisible by r, and the quotient is k. Wherein, k is an integer greater than 1. For example, k can be 1. For another example, k can be 3. It can be understood that in the case that s is greater than 1, k can change or remain unchanged.
[0151] In a possible implementation, in the case that s is greater than 1, Ri is constant and k is constant when i is different. For example, r = 120 Hz, s = 2, and k = 2. It can be understood that there are two B-class applications in the N applications, and the rendering frame rates of the two B-class applications are both r ÷ k = 60 Hz.
[0152] In another possible implementation, in the case that s is greater than 1, Ri changes and k changes accordingly when i is different. For example, r = 120 Hz, s = 2. It can be understood that there are two B-class applications in the N applications, for one of the two B-class applications, k = 2, and the rendering frame rate of the application is r ÷ k = 60 Hz, however, for the other of the two B-class applications, k = 3, and the rendering frame rate of the other application is r ÷ k = 40 Hz.
[0153] In some embodiments of the present application, in the case that s is greater than 1 (that is, there are multiple B-class applications in the N applications corresponding to the windows displayed on the display screen of the electronic device), the rendering frame rates of a part of the B-class applications in the N applications can be divisible by r (that is, the rendering frame rates of the part of the B-class applications satisfy r = k * Ri), and the rendering frame rates of another part of the B-class applications in the N applications cannot be divisible by r (that is, the rendering frame rates of the other part of the B-class applications do not satisfy r = k * Ri).
[0154] For example, the electronic device can display windows of application 1, application 2, application 3, and application 4 on the display screen, and the screen refresh rate of the electronic device is 60 Hz. The application 1 is the focus application, the application 2 is in the fling state, the application 3 and the application 4 are neither the focus application nor in the fling state, and the highest target refresh rate corresponding to the application 1 is 120 Hz. When the VSync cycle of the electronic device arrives, the electronic device can set the screen refresh rate to 120 Hz, that is, the screen refresh rate changes from 60 Hz to 120 Hz, the rendering frame rates of the application 1 and the application 2 are kept to be 120 Hz, the rendering frame rate of the application 3 is set to be 30 Hz (which can be divisible by 120 Hz), and the rendering frame rate of the application 4 is set to be 45 Hz (which cannot be divisible by 120 Hz).
[0155] S102: render pictures of the N applications based on the rendering frame rates of the N applications respectively.
[0156] Specifically, for the application in focus or in fling state among the N applications, the electronic device can render the picture (or the picture in the corresponding window) of the application based on the current screen refresh rate, while the electronic device keeps the rendering frame rate of the application the same as the current screen refresh rate. Similarly, for the application not in fling state among the N applications, the electronic device can render the picture (or the picture in the corresponding window) of the application based on the rendering frame rate of the application which is less than the current screen refresh rate, while the electronic device sets the rendering frame rate of the application to be less than the current screen refresh rate.
[0157] According to the above, the VSync period (which can be understood as the interval duration of generating two adjacent VSync signals) changes with the change of the screen refresh rate, that is, the frequency of generating VSync signals changes with the change of the screen refresh rate, and the APP-VSync signal and the SF-VSync signal are distributed based on the VSync period, which means that the distribution frequency of the App-VSync signal and the SF-VSync signal will also change with the change of the VSync period.
[0158] In some embodiments of the present application, if the application requests the APP-VSync signal, the electronic device can send the APP-VSync signal to the application according to the frequency of generating VSync signals, that is, the electronic device generates an App-VSync signal based on each VSync signal and sends the App-VSync signal to the application, while the rendering frame rate of the application is the same as the current screen refresh rate.
[0159] In some embodiments of the present application, if the application requests the APP-VSync signal, the electronic device can send the APP-VSync signal to the application according to the frequency of generating VSync signals, that is, the electronic device generates an App-VSync signal based on each VSync signal and sends the App-VSync signal to the application, while the rendering frame rate of the application is the same as the current screen refresh rate.
[0160] In some embodiments of the present application, if the rendering frame rate of the application is less than the current screen refresh rate, the electronic device can send an App-VSync signal to the application at least every 2 VSync periods.
[0161] For ease of description, the present application records the multiple of the rendering rate of the application most similar to the current screen refresh rate as z. z is a positive integer.
[0162] In a possible implementation, in the case that the rendering frame rate of the application is less than the current screen refresh rate, if z = 1, the electronic device can generate and send an App-VSync signal to the application once every 2 VSync periods, and if z is greater than 1, the electronic device can generate and send an App-VSync signal to the application once every z VSync periods. Specifically, in the case that z = 1, after the electronic device generates a VSync signal, the electronic device can send an APP-VSync signal generated based on the VSync signal to the application, and then wait for z VSync periods before generating a VSync signal again, and then send an APP-VSync signal generated based on the VSync signal generated again to the application, and then repeat the step of sending an APP-VSync signal every 2 VSync periods. Similarly, in the case that z is greater than 1, after the electronic device generates a VSync signal, the electronic device can send an APP-VSync signal generated based on the VSync signal to the application, and then wait for z VSync periods before generating a VSync signal again, and then send an APP-VSync signal generated based on the VSync signal generated again to the application, and then repeat the step of sending an APP-VSync signal every z VSync periods. It should be noted that in the case that z is greater than 1, the electronic device can still generate a VSync signal according to the VSync period, but does not send an APP-VSync signal to the application. Correspondingly, after receiving the App-VSync signal, the application in the electronic device can start drawing and rendering the picture in the window corresponding to the application.
[0163] For ease of description, the quotient of the current screen refresh rate and the rendering frame rate of the application is denoted as x in the present application. x is a positive integer. It can be understood that x can be equal to z, or equal to z-1 (in this case, z is at least 3).
[0164] In a possible implementation, in the case that the rendering frame rate of the application is less than the current screen refresh rate, if x = 1, the electronic device can generate an App-VSync signal every 2 VSync periods, and if x is greater than 1, the electronic device can generate an App-VSync signal every x VSync periods. Specifically, in the case that x = 1, after the electronic device generates a VSync signal, the electronic device can send, to the application, an App-VSync signal generated based on the VSync signal, and then wait for 2 VSync periods before generating a VSync signal again, and in the case that the electronic device generates the VSync signal again, the electronic device can send, to the application, an App-VSync signal generated based on the VSync signal generated again, and then repeat the step of sending the App-VSync signal every 2 VSync periods. Similarly, in the case that x is greater than 1, after the electronic device generates a VSync signal, the electronic device can send, to the application, an App-VSync signal generated based on the VSync signal, and then wait for x VSync periods before generating a VSync signal again, and in the case that the electronic device generates the VSync signal again, the electronic device can send, to the application, an App-VSync signal generated based on the VSync signal generated again, and then repeat the step of sending the App-VSync signal every x VSync periods. It should be noted that, in the case that x is greater than 1, the electronic device can still generate a VSync signal according to a VSync period, but does not send an App-VSync signal to the application. Correspondingly, after receiving the App-VSync signal, the application in the electronic device can start to draw and render a picture in a window corresponding to the application.
[0165] It can be understood that, in the case that the current screen refresh rate can be divided by the rendering frame rate of the application (or the rendering frame rate of the application can be divided by the current screen refresh rate), x and z can be equal to k mentioned above.
[0166] In some embodiments of the present application, in the case that the rendering frame rate of the application is less than the current screen refresh rate, if the application requests the APP-VSync signal and the rendering frame rate of the application can be evenly divided by the current screen refresh rate, the electronic device can set a VSync software timer based on a defined timing duration to remind the electronic device to send the APP-VSync signal to the application, i.e., the electronic device can generate an App-VSync signal once every x VSync periods (or z VSync periods) based on the VSync software timer, and send the App-VSync signal to the application. However, in the case that the rendering frame rate of the application is less than the current screen refresh rate, if the application requests the APP-VSync signal and the rendering frame rate of the application cannot be evenly divided by the current screen refresh rate, the electronic device can additionally set a VSync software timer to remind the electronic device to send the App-VSync signal to the application. It can be understood that the timing duration defined by the additionally set VSync software timer is not a VSync period, but is determined based on the rendering frame rate of the application, i.e., the timing duration defined by the additionally set VSync software timer is the reciprocal of the rendering frame rate of the application.
[0167] In some embodiments of the present application, after the electronic device generates a VSync signal each time, the electronic device can directly send the APP-VSync signal generated based on the VSync signal to the application, without adding a time offset after generating the VSync signal before sending the APP-VSync signal.
[0168] In some embodiments of the present application, after the electronic device generates a VSync signal each time, the electronic device can add a time offset and then send the APP-VSync signal generated based on the VSync signal to the application.
[0169] In some embodiments of the present application, when the electronic device performs step S101 and step S102, for each of the N applications, the electronic device can perform the steps as shown in FIG. 8A, which can include but are not limited to the following steps:
[0170] S201: Determine whether the application is a current focus application.
[0171] The electronic device can determine whether the application is a current focus application. If the application is a current focus application, the electronic device can continue to perform step S202, and if the application is not a current focus application, the electronic device can continue to perform step S203, i.e., determine whether the application is in a fling state.
[0172] S202: Set the rendering frame rate of the application to be equal to the current screen refresh rate.
[0173] In a case where the application is a current focus application, the electronic device can determine that the rendering frame rate of the application is the current screen refresh rate, and keep the rendering frame rate.
[0174] S203: Determine whether the application is in a fling state.
[0175] In a case where the application is not a current focus application, the electronic device can determine whether the application is in a fling state. If the application is in a fling state, the electronic device can continue to perform step S202, and if the application is not in a fling state, the electronic device can continue to perform step S204.
[0176] In some embodiments of the present application, in a case where the application is not a current focus application, and the application is not in a fling state, the electronic device can determine whether the current screen refresh rate is greater than a threshold 2. If the current screen refresh rate is greater than the threshold 2, the electronic device can continue to perform step S204, and if the current screen refresh rate is less than or equal to the threshold 2, the electronic device can perform step S202 or step S204, i.e., the electronic device can determine that the rendering frame rate of the application is equal to or less than the current screen refresh rate.
[0177] S204: Set the rendering frame rate of the application to be less than the current screen refresh rate.
[0178] In a case where the application is neither a focus application nor in a fling state, the electronic device can set the rendering frame rate of the application such that the rendering frame rate corresponding to the application set by the electronic device is less than the current screen refresh rate. The specific setting method can refer to the related description of step S102, which will not be repeated here.
[0179] S205: Send an App-VSync signal to the application based on the rendering frame rate of the application.
[0180] It can be understood that in a case where the application has a demand for an updated interface, the application can request an App-VSync signal. After determining that the rendering frame rate of the application is equal to the current screen refresh rate, or setting the rendering frame rate of the application to be less than the current screen refresh rate, in a case where the application requests an App-VSync signal, the electronic device can send an App-VSync signal to the application based on the rendering frame rate of the application.
[0181] It can be understood that according to step S101, the VSync period will also change with the change of the current screen refresh rate.
[0182] In some embodiments of the present application, in the case that the rendering frame rate of the application is equal to the current screen refresh rate, the interval time length for the application to draw and render two adjacent frame images is equal to a VSync period. In this case, the electronic device can directly send the App-VSync signal to the application based on the VSync period. Specifically, the electronic device can directly send the App-VSync signal based on the VSync signal to the application after generating the VSync signal, then send the App-VSync signal based on the VSync signal to the application again after generating the VSync signal next time, and repeat the step of sending the App-VSync signal based on the VSync signal to the application again after generating the VSync signal next time.
[0183] In some embodiments of the present application, in the case that the rendering frame rate of the application is less than the current screen refresh rate, the interval time length for the application to draw and render two adjacent frame images is greater than a VSync period. In this case, the electronic device can send the App-VSync signal to the application based on the multiple relationship between the interval time length and the VSync period (i.e. the multiple relationship between the current screen refresh rate and the rendering frame rate of the application), and the specific implementation manner can be referred to the above, which will not be described herein again.
[0184] In some embodiments of the present application, no matter whether the rendering frame rate of the application is equal to the current screen refresh rate or less than the current screen refresh rate, the electronic device can send the App-VSync signal to the application by setting a timer (e.g. a first timer), and the timing time length defined by the timer is a VSync period. Specifically, the electronic device can determine how many VSync periods are sent once the App-VSync signal based on the multiple relationship between the current screen refresh rate and the rendering frame rate of the application, and send the App-VSync signal to the application once the total timing time length of the VSync software timer reaches the corresponding VSync period.
[0185] For the convenience of understanding and description, the thread in which the timer is located is referred to as timer distribution thread 1 in the present application. That is, no matter whether the rendering frame rate of the application is equal to the current screen refresh rate or less than the current screen refresh rate, the electronic device can send the App-VSync signal to the application by the timer distribution thread 1. Wherein, the timing time length defined by the timer in the timer distribution thread 1 is a VSync period, or the timing time length corresponding to the timer distribution thread 1 is a VSync period. This means that the timing time length corresponding to the timer distribution thread 1 changes with the change of the VSync period, i.e. changes with the change of the current screen refresh rate.
[0186] As shown in FIG. 9A, the electronic device can display windows corresponding to application 1, application 2, application 3, application 4, and application 5 on the display screen. After the VSync signal is generated, the electronic device can determine that the current focus application is focus 1, and the highest target refresh rate corresponding to focus 1 is 120 Hz. The electronic device can set the current screen refresh rate to 120 Hz, and the VSync period is 1 / 120 s. The electronic device can generate a VSync signal every 1 / 120 s. When the timer distribution thread 1 reaches the corresponding timing duration, the electronic device can generate a VSync signal. Since focus 1 is the focus application, the electronic device can determine that the rendering frame rate of focus 1 is 120 Hz. Since application 2, application 3, application 4, and application 5 are non-focus applications that are not in the fling state, the electronic device can set the rendering frame rate of application 2, application 3, application 4, and application 5 to be lower than 120 Hz. Specifically, the electronic device can set the rendering frame rate of application 2 and application 3 to 60 Hz, the rendering frame rate of application 4 to 45 Hz, and the rendering frame rate of application 5 to 90 Hz.
[0187] The current screen refresh rate can be divided by the rendering frame rate set by application 2 and application 3, and the quotient of the current screen refresh rate divided by the rendering frame rate set by application 2 / application 3 is 2. The electronic device can send an APP-VSync signal to application 2 and application 3 every 2 VSync periods. The current screen refresh rate cannot be divided by the rendering frame rate set by application 4, and (120-45*2)>(45*3-120), that is, the multiple of the rendering frame rate set by application 4 closest to the current screen refresh rate is 3. The electronic device can send an APP-VSync signal to application 4 every 3 VSync periods. Similarly, the current screen refresh rate cannot be divided by the rendering frame rate set by application 4, and (120-90*1)<(90*2-120), that is, the multiple of the rendering frame rate set by application 5 closest to the current screen refresh rate is 1. That is, for application 4, z=1. According to the above, in this case, the electronic device can send an APP-VSync signal to application 4 every 2 VSync periods.
[0188] Specifically, as shown in FIG. 9A, after the electronic device generates the first VSync signal, the electronic device can generate the APP-VSync signal and the SF-VSync signal based on the VSync signal, in which case the electronic device can send the APP-VSync signal to the application 1 for the first time, the application 2 for the first time, the application 3 for the first time, the application 4 for the first time, and the application 5 for the first time, and send the SF-VSync signal to the SurfaceFlinger for the first time. After an interval of one VSync period (i.e., the timer distribution thread 1 starts timing from the generation of the VSync signal, and continues until the timing duration reaches the defined timing duration), the electronic device can generate the second VSync signal, and generate the APP-VSync signal and the SF-VSync signal based on the VSync signal, in which case the electronic device can send the APP-VSync signal to the application 1 for the second time, and send the SF-VSync signal to the SurfaceFlinger for the second time. After an interval of one VSync period (i.e., the timer distribution thread 1 restarts timing from the generation of the second VSync signal, and continues until the timing duration reaches the defined timing duration), the electronic device can generate the third VSync signal, and generate the APP-VSync signal and the SF-VSync signal based on the VSync signal, in which case the electronic device can send the APP-VSync signal to the application 1 for the third time, send the APP-VSync signal to the application 2 for the second time, send the APP-VSync signal to the application 3 for the second time, and send the APP-VSync signal to the application 5 for the second time, and send the SF-VSync signal to the SurfaceFlinger for the third time. After an interval of one VSync period (i.e., the timer distribution thread 1 restarts timing from the generation of the third VSync signal, and continues until the timing duration reaches the defined timing duration), the electronic device can generate the fourth VSync signal, and generate the APP-VSync signal and the SF-VSync signal based on the VSync signal, in which case the electronic device can send the APP-VSync signal to the application 1 for the fourth time, send the APP-VSync signal to the application 4 for the second time, and send the SF-VSync signal to the SurfaceFlinger for the fourth time. Moreover, the distribution of the APP-VSync signal to the application 1, the application 2, the application 3, the application 4, and the application 5 described above is completed by the timer distribution thread 1, and the timing duration corresponding to the timer distribution thread 1 is 1 / 120s.
[0189] In some embodiments of the present application, when the electronic device performs step S102 and step S103, for each of the N applications corresponding to the windows displayed on the display screen by the electronic device, the electronic device can perform the steps as shown in FIG. 8B, which can include but are not limited to the following steps:
[0190] S301: Determine whether the application is a current focus application.
[0191] The electronic device can determine whether the application is a current focus application. If the application is a current focus application, the electronic device can continue to perform step S302, and if the application is not a current focus application, the electronic device can continue to perform step S303, i.e., determine whether the application is in a fling state.
[0192] S302: Set the rendering frame rate of the application equal to the current screen refresh rate.
[0193] In the case where the application is a current focus application, the electronic device can determine that the rendering frame rate of the application is the current screen refresh rate, and maintain the rendering frame rate. In this case, the electronic device can perform step S306.
[0194] S303: Determine whether the application is in a fling state.
[0195] In the case where the application is not a current focus application, the electronic device can determine whether the application is in a fling state. If the application is in a fling state, the electronic device can continue to perform step S302, and if the application is not in a fling state, the electronic device can continue to perform step S304.
[0196] Similar to step S203, in some embodiments of the present application, in the case where the application is not a current focus application, and the application is not in a fling state, the electronic device can determine whether the current screen refresh rate is greater than threshold 2. If the current screen refresh rate is greater than threshold 2, the electronic device can continue to perform step S304, and if the current screen refresh rate is less than or equal to threshold 2, the electronic device can perform step S302 or step S304, i.e., the electronic device can determine that the rendering frame rate of the application is equal to or less than the current screen refresh rate.
[0197] S304: Set the rendering frame rate of the application less than the current screen refresh rate.
[0198] In the case where the application is neither a focus application nor in a fling state, the electronic device can adjust the rendering frame rate of the application such that the rendering frame rate corresponding to the application is set to be less than the current screen refresh rate, and the specific adjustment manner can refer to the related description of step S102, which will not be repeated here. In this case, the electronic device can continue to perform step S305.
[0199] S305: Determine whether the rendering frame rate corresponding to the application is an integer multiple of the current screen refresh rate.
[0200] In a case where the rendering frame rate of the application (i.e., the adjusted rendering frame rate corresponding to the application) is less than the current screen refresh rate, the electronic device can determine whether the rendering frame rate set for the application is divisible by the current screen refresh rate, i.e., whether the current screen refresh rate is divisible by the rendering frame rate set for the application. If the rendering frame rate set for the application is divisible by the current screen refresh rate (i.e., the current screen refresh rate is divisible by the rendering frame rate set for the application), the electronic device can perform step S306, and if the rendering frame rate set for the application is not divisible by the current screen refresh rate (i.e., the current screen refresh rate is not divisible by the rendering frame rate set for the application), the electronic device can perform step S307.
[0201] S306: The App-VSync signal is sent to the application by the timer distribution thread 1. The timing duration corresponding to the timer distribution thread 1 is determined based on the current screen refresh rate.
[0202] In a case where the rendering frame rate of the application is equal to the current screen refresh rate, or the rendering frame rate set for the application is less than the current screen refresh rate and is divisible by the current screen refresh rate, the electronic device can send the APP-VSync signal to the application by the timer distribution thread 1. The timing duration corresponding to the timer distribution thread 1 is one VSync period, i.e., the reciprocal of the current screen refresh rate. The related description of the timer distribution thread 1 can be referred to the above, which will not be described herein again.
[0203] It can be understood that in a case where the rendering frame rate of the application is equal to the current screen refresh rate, or the rendering frame rate set for the application is less than the current screen refresh rate and is divisible by the current screen refresh rate, the electronic device can send the APP-VSync signal to the application by the timer distribution thread 1 every x VSync periods (or z VSync periods). Specifically, after the electronic device generates a VSync signal, the electronic device can send the APP-VSync signal generated based on the VSync signal to the application, and then generate a VSync signal again after x VSync periods (specifically, the timer distribution thread 1 can determine that there are x VSync periods from the last time the APP-VSync signal is sent), and then send the APP-VSync signal generated based on the VSync signal generated again to the application, and then repeat the above step of sending the APP-VSync signal every x VSync periods.
[0204] For ease of description, the timer set in the timer distribution thread 1 is referred to as the first timer. The timing duration defined by the first timer is one VSync period. The first timer can be understood as the VSync software timer mentioned above.
[0205] It should be noted that the electronic device can send the SF-VSync signal to the SurfaceFlinger through the timer distribution thread 1. Specifically, the electronic device can generate a VSync signal each time the timing duration of the first timer reaches its defined timing duration (i.e., a VSync period), and then generate an SF-VSync signal based on the VSync signal and send the SF-VSync signal to the SurfaceFlinger. That is, the electronic device can generate an SF-VSync signal each time it generates a VSync signal.
[0206] However, according to the above, the electronic device can generate an APP-VSync signal each time it generates x+1 VSync signals (or z+1 VSync signals). That is, in the case of x=1, the electronic device can generate an APP-VSync signal each time it generates a VSync signal, and in the case of x>1, the electronic device can generate an APP-VSync signal each time it generates multiple VSync signals (at least 2 VSync signals).
[0207] S307: Send an App-VSync signal to the application through the timer distribution thread 2. The timing duration corresponding to the timer distribution thread 2 is determined based on the rendering frame rate set by the application.
[0208] In the case that the rendering frame rate set by the application is less than the current screen refresh rate, and the rendering frame rate set by the application cannot be evenly divided by the current screen refresh rate, the electronic device can send an APP-VSync signal to the application through the timer distribution thread 2. The timer distribution thread 2 is a thread independent of the timer distribution thread 1, and the timing duration corresponding to the timer distribution thread 2 is the reciprocal of the rendering frame rate set by the application.
[0209] As shown in FIG. 9B, the electronic device can display the windows corresponding to the application 1, the application 2, the application 3, the application 4 and the application 5 on the display screen. After the VSync signal is generated, the electronic device can determine that the current focus application is the focus 1, and the target refresh rate thereof is 120 Hz. Then, the electronic device can set the current screen refresh rate to 120 Hz, and the VSync period is correspondingly changed to 1 / 120 s, that is, the electronic device generates a VSync signal every 1 / 120 s. It can be understood that the electronic device can generate a VSync signal every time the timer distribution thread 1 reaches the corresponding timing duration. Since the focus 1 is the focus application, the electronic device can determine that the rendering frame rate thereof is 120 Hz. However, since the application 2, the application 3, the application 4 and the application 5 are non-focus applications not in the fling state, the electronic device can set the rendering frame rates of the application 2, the application 3, the application 4 and the application 5 to be lower than 120 Hz. Specifically, the electronic device can adjust the rendering frame rates of the application 2 and the application 3 to 60 Hz, set the rendering frame rate of the application 4 to 45 Hz, and set the rendering frame rate of the application 5 to 90 Hz. It can be understood that the corresponding timing duration of the timer distribution thread 1 is a VSync period. Therefore, the electronic device can generate a VSync signal according to the corresponding timing duration of the timer distribution thread 1, and send an APP-VSync signal to the application 1.
[0210] It can be understood that the current screen refresh rate can be divided by the rendering frame rates set by the application 2 and the application 3. The electronic device can send an APP-VSync signal to the application 2 and the application 3 every 2 VSync periods through the timer distribution thread 1. However, the current screen refresh rate cannot be divided by the rendering frame rate set by the application 4, nor by the rendering frame rate set by the application 5. However, there is a 2-fold relationship between the rendering frame rate set by the application 4 and the rendering frame rate set by the application 5. Therefore, the electronic device can send an APP-VSync signal to the application 4 and the application 5 through the timer distribution thread 2, and the corresponding timing duration of the timer distribution thread 2 can be determined based on the highest frame rate of the rendering frame rates set by the application 4 and the application 5, that is, the timer distribution thread 2 can be set to the inverse of the rendering frame rate set by the application 5, that is, 1 / 90 s. That is, the corresponding timing duration of the timer distribution thread 2 is 4 / 3 VSync periods.
[0211] It should be noted that the timer distribution thread 1 and the timer distribution thread 2 start timing synchronously. The specific process of sending an APP-VSync signal by the timer distribution thread 1 is exemplarily described as follows.
[0212] As shown in FIG. 9B, after the electronic device generates the first VSync signal, the electronic device can generate the APP-VSync signal and the SF-VSync signal based on the VSync signal, in which case the electronic device can send the APP-VSync signal to the application 1 for the first time and send the SF-VSync signal to the SurfaceFlinger for the first time. After an interval of one VSync period (i.e., the timer distribution thread 1 starts timing from the generation of the first VSync signal until the timing duration reaches the defined timing duration), the electronic device can generate the second VSync signal and generate the APP-VSync signal and the SF-VSync signal based on the VSync signal, in which case the electronic device can send the APP-VSync signal to the application 1 for the second time and send the SF-VSync signal to the SurfaceFlinger for the second time. After an interval of one VSync period (i.e., the timer distribution thread 1 starts timing from the generation of the second VSync signal until the timing duration reaches the defined timing duration), the electronic device can generate the third VSync signal and generate the APP-VSync signal and the SF-VSync signal based on the VSync signal, in which case the electronic device can send the APP-VSync signal to the application 1 for the third time and send the APP-VSync signal to the application 2, the application 3, and the application 5 for the second time and send the SF-VSync signal to the SurfaceFlinger for the third time. After an interval of one VSync period (i.e., the timer distribution thread 1 starts timing from the generation of the third VSync signal until the timing duration reaches the defined timing duration), the electronic device can generate the fourth VSync signal and generate the APP-VSync signal and the SF-VSync signal based on the VSync signal, in which case the electronic device can send the APP-VSync signal to the application 1 for the fourth time, send the APP-VSync signal to the application 4 for the second time, and send the SF-VSync signal to the SurfaceFlinger for the fourth time.
[0213] It should be further noted that the processes of sending the APP-VSync signal to the application by the timer distribution thread 2 and the timer distribution thread 1 are independent and synchronized. The specific process of sending the APP-VSync signal by the timer distribution thread 2 is exemplarily explained as follows:
[0214] As shown in FIG. 9B, after the electronic device generates the first VSync signal, the electronic device can generate the APP-VSync signal and the SF-VSync signal based on the VSync signal, in which case the electronic device can send the APP-VSync signal to the application 4 and the application 5 for the first time. After an interval of 4 / 3 VSync periods (i.e., the timer distribution thread 2 starts timing from the generation of the first VSync signal until the timing duration reaches the defined timing duration), the electronic device can send the APP-VSync signal to the application 5 for the second time. After an interval of 4 / 3 VSync periods again (i.e., the timer distribution thread 2 starts timing again from the last time the defined timing duration is reached until the timing duration reaches the defined timing duration again), the electronic device can send the APP-VSync signal to the application 5 for the third time and to the application 4 for the second time. After an interval of one VSync period again (i.e., the timer distribution thread 2 starts timing again from the last time the defined timing duration is reached until the timing duration reaches the defined timing duration again), the electronic device can send the APP-VSync signal to the application 5 for the fourth time.
[0215] For ease of description, the timer set in the timer distribution thread 2 is referred to as a second timer in this application. The defined timing duration of the second timer is the inverse of the rendering frame rate set for the application (i.e., the adjusted rendering frame rate corresponding to the application). The second timer can be understood as the VSync software timer mentioned above.
[0216] In some embodiments of this application, there are multiple applications corresponding to the rendering frame rates set for the N applications corresponding to the window displayed on the display screen of the electronic device. In this case, the electronic device can determine whether there is a multiple relationship between the rendering frame rates set for the multiple applications. If there is a multiple relationship between the rendering frame rates set for the multiple applications, the electronic device can send the APP-VSync signal to the multiple applications through the timer distribution thread 2. However, if there is no multiple relationship between the rendering frame rates set for the multiple applications, the electronic device can additionally set one or more timer distribution threads to send the APP-VSync signal to the other applications in the multiple applications in addition to sending the APP-VSync signal to one or more applications in the multiple applications through the timer distribution thread 2.
[0217] For example, the electronic device can display windows corresponding to application 1, application 2, application 3, application 4, application 5, and application 6 on the display screen. Application 1 is the focus application, and the target refresh rate corresponding to application 1 is 120 Hz. Therefore, the electronic device can adjust the current screen refresh rate to 120 Hz. Applications 2, 3, 4, 5, and 6 are non-focus applications that are not in the fling state. The rendering frame rates of applications 1-5 are the same as those shown in FIGS. 9A and 9B, and the rendering frame rate corresponding to application 6 is set to 50 Hz. Specifically, the electronic device can send APP-VSync signals to applications 1, 2, and 3 through timer distribution thread 1 and send APP-VSync signals to applications 4 and 5 through timer distribution thread 2, as shown in FIG. 9B. It can be understood that the rendering frame rate corresponding to application 6 cannot be evenly divided by the current screen refresh rate, and there is no multiple relationship between the rendering frame rate corresponding to application 6 and the rendering frame rate corresponding to application 4, or between the rendering frame rate corresponding to application 6 and the rendering frame rate corresponding to application 5. Therefore, the electronic device can additionally send APP-VSync signals to application 6 through timer distribution thread 3. Timer distribution thread 3 is a thread independent of timer distribution thread 1 and timer distribution thread 2, and the corresponding timing duration is the inverse of the rendering frame rate corresponding to application 6. Similar to timer distribution thread 1 and timer distribution thread 2, a timer can also be set in timer distribution thread 3, and the timing duration defined by the timer in timer distribution thread 3 is the inverse of the rendering frame rate corresponding to application 6.
[0218] S103: Display the pictures of the N applications on the display screen according to the current screen refresh rate.
[0219] After the electronic device renders the pictures of the N applications (or the pictures in the windows of the N applications), the electronic device can display the pictures of the N applications on the display screen according to the current screen refresh rate. It can be understood that, according to the foregoing, there can be some applications in the N applications whose rendering frame rates are less than the current screen refresh rate. When SurfaceFlinger prepares to synthesize the layers, the applications whose rendering frame rates are less than the current screen refresh rate can not have rendered new images. In this case, the applications whose rendering frame rates are less than the current screen refresh rate can send the last frame images rendered by the applications to SurfaceFlinger for synthesis.
[0220] In some embodiments of the present application, the N application windows displayed by the electronic device on the display screen can include M windows. Wherein, M is an integer not less than N. That is, one application can correspond to one window, or can correspond to multiple windows, which is not limited in the present application.
[0221] For example, as shown in FIG. 1, N can be 2, and the electronic device can display window 1a and window 2a on the display screen. Wherein, window 1a is a window corresponding to a video application, and window 2a is a window corresponding to a reading application. The electronic device creates window 1a after starting the video application, and similarly, the electronic device creates window 2a after starting the reading application.
[0222] For example, as shown in FIG. 2, N can be 2, and the electronic device can display window 3a, window 3b and window 2a on the display screen. Wherein, window 3a and window 3b are windows corresponding to a shopping application, and window 2a is a window corresponding to a reading application. The electronic device creates window 3a and window 3b after starting the shopping application.
[0223] It can be understood that when the electronic device displays N application windows on the display screen, the number of applications that have been started by the electronic device is not less than N. In some embodiments of the present application, the electronic device can start more than N applications, but only display the windows of the N applications on the display screen, and other started applications can run in the background.
[0224] The software structure of the electronic device related to the embodiments of the present application is introduced below.
[0225] The operating system of the electronic device can adopt a layered architecture, an event-driven architecture, a microkernel architecture, a microservice architecture, or a cloud architecture. The embodiments of the present application take the layered architecture of the Android operating system as an example to illustrate the software structure of the electronic device. It should be noted that the embodiments of the present application take the Android operating system (which can be referred to as Android system for short) as an example for illustration, but the basic principles are also applicable to electronic devices based on iOS or Windows operating systems.
[0226] FIG. 10 is a schematic diagram of the software structure of an electronic device provided by an embodiment of the present application.
[0227] The software structure of the electronic device adopts a layered architecture, i.e., the software is divided into several layers, each of which has a clear role and division of labor. Layers communicate with each other through software interfaces. For example, the Android system runs on the AP. In some embodiments of the present application, the software structure of the Android system is divided into five layers, from top to bottom, the application layer, the application framework layer (Framework), the Android runtime and system library, the hardware abstraction layer (HAL), and the kernel layer (Kernel).
[0228] The application layer can include a series of application packages. The application packages can include camera, gallery, calendar, call, map, WLAN, Bluetooth, music, video, short message, etc. The application layer can also include system UI (system User Interface, systemUI). The systemUI is used to display the interface of the electronic device, such as displaying the signal icon corresponding to the SIM card, displaying the call interface, etc. The application layer can also include application 1 and application 2. It can be understood that application 1 can be a system application or a third-party application, and similarly, application 2 can be a system application or a third-party application.
[0229] The application framework layer provides application programming interfaces (APIs) and programming frameworks for the applications of the application layer. The application framework layer can include some pre-defined functions. For example, the application framework layer can include a window manager (Window Manager, WM), a view system, etc. The WM can be used to implement the management (e.g., adding, removing, updating, etc.) and drawing of system and application windows, and its main functions include window creation and management, window level management, window event distribution, external application window management, and window style control, etc. The view system can be used to build an application, which can specifically include drawing and rendering the display interface (or user interface) of the application. The user interface can be composed of one or more views. The view system can call the three-dimensional graphics processing library and two-dimensional graphics engine in the system library during the process of drawing the user interface. The view system can include a rendering choreographer (or rendering manager), whose full name is Choreographer. Choreographer can cooperate with the VSync mechanism to provide a stable drawing processing opportunity for the rendering of the upper layer application. Specifically, when the VSync cycle arrives, the electronic device can wake up Choreographer to perform the drawing and rendering operation of the application. Choreographer plays a role in the Android rendering link.
[0230] The application framework layer can also include an input event management module. The input event management module can perform collection, processing and distribution of various input events (e.g., key events, touch events, etc.). In some embodiments of the present application, the input event management module can be inputflinger. The inputflinger is a service responsible for processing input events, which can receive raw input events from hardware devices and convert them into events that can be understood by the Android system, such as touch events, etc.
[0231] The application framework layer can also include a widget. The widget can include an over scroller. The over scroller is a class that can add a listener to a user interface to determine whether the current interaction state of the user interface is a fling state.
[0232] The application framework layer can also include a surface control interface. The surface control interface can be used to implement the interaction between the WM and the SurfaceFlinger. In some embodiments of the present application, the surface control interface can be surfaceControl.
[0233] The runtime is responsible for the scheduling and management of the system. The runtime includes a core library and a virtual machine. The core library includes two parts: one part is the function function required to be called by the programming language (for example, java language), and the other part is the core library of the system. The application layer and the application framework layer run in the virtual machine. The virtual machine executes the programming files (for example, java files) of the application layer and the application framework layer into binary files. The virtual machine is used to perform functions such as management of object life cycle, stack management, thread management, security and exception management, and garbage collection.
[0234] The system library can include a plurality of functional modules. For example, SurfaceFlinger, media libraries, three-dimensional graphics processing libraries (e.g., OpenGL ES), and two-dimensional graphics engines (e.g., SGL), etc. Among them, SurfaceFlinger is responsible for managing the UI display of all applications, and is also responsible for combining the UI elements (such as text, images, views, etc.) of the application into a complete screen picture by interacting with the hardware abstraction layer (HAL) and the GPU driver. SurfaceFlinger can include a touch focus layer management module, a connection management module, a sliding state management module, a Vsync signal modulation module, and a layer composition management module, etc. Among them, the touch focus layer management module can be used to manage and maintain the focus window, and specifically can update the focus window according to user operations. The connection management module can be used to manage and maintain the connection channel (which can also be understood as the distribution channel of the APP-VSync signal) of SurfaceFlinger and the application. In some embodiments of the application, the connection channel can be a socket channel (or socket connection). The sliding state management module can be used to manage and update the window interaction state (for example, the interaction state of the application mentioned above), which can specifically include the sliding state (including the fling state and the non-fling state). The Vsync signal modulation module can be used to distribute the APP-VSync signal to the application according to the rendering frame rate of the application. The layer composition management module can be used to combine the UI elements of different applications, and / or multiple UI elements of one application into a complete screen picture. It can be understood that the specific meaning and role of other functional modules in the system library can refer to related technical documents, which will not be expanded here.
[0235] The hardware abstraction layer (HAL) is an interface layer between the operating system kernel and the upper layer software, and its purpose is to abstract the hardware. The hardware abstraction layer is an abstract interface of the device kernel driver, which is used to provide an application programming interface for accessing the underlying device to the higher level Java API framework. The HAL can provide a standard interface to display the device hardware functions to the higher level Java API framework. The HAL includes a plurality of library modules (for example, camera HAL, audio HAL, etc.). When the system framework layer API requires access to the hardware of the portable device, the operating system will load the library module for the hardware component.
[0236] The kernel layer is the foundation of the Android system. The kernel layer is responsible for the driver of the hardware, network, power, system security, and memory management functions. The kernel layer is an intermediate layer between hardware and software, and its role is to pass the request of the application program to the hardware. The kernel layer can include audio driver, display driver, camera driver and sensor driver. The audio driver is an intermediate layer between audio software and audio hardware, used to pass the access request of the upper software module to the audio hardware.
[0237] It should be noted that the software structure diagram of the electronic device shown in FIG. 10 provided by the present application is only as an example, and does not limit the specific module division in different layers of the Android system, and the specific module division can be referred to the introduction of the software structure of the Android system in the conventional technology. In addition, the method provided by the present application can also be implemented based on other operating systems, and the present application will not be exemplified one by one.
[0238] Based on the software structure of the electronic device shown in FIG. 10, a specific implementation manner of the above embodiment is specifically introduced as follows.
[0239] Please refer to FIG. 11A and FIG. 11B, which are flowcharts of another image display method provided by the embodiments of the present application. The method can include but is not limited to the following steps:
[0240] 1. Create a window, update the focus application and / or the focus window, and update the interaction state information of the application (as shown in FIG. 11A).
[0241] S1: The WM starts the window creation process to create the window of the application 1.
[0242] The user can trigger the electronic device to start the application 1. After the electronic device receives the user operation of triggering the start of the application 1, the electronic device can create the window of the application 1 through the WM starting the window creation process.
[0243] S2: The WM sends an application connection request 1 to the SurfaceFlinger through the surface control interface.
[0244] After the electronic device receives the user operation of triggering the start of the application 1 and through the WM starting the window creation process, the WM can send an application connection request 1 to the SurfaceFlinger through the surface control interface. Correspondingly, the SurfaceFlinger can receive the application connection request 1 sent by the WM through the surface control interface.
[0245] In some embodiments of the present application, the application connection request 1 can comprise a package name of the application 1. The package name is a unique identification string of an application program, which usually adopts a reverse domain name naming manner to ensure the global uniqueness of the package name.
[0246] In some embodiments of the present application, the SurfaceFlinger can acquire the user identification (UID) and the process identification (PID) of the application 1 through the Binder mechanism.
[0247] It can be understood that the Binder mechanism is an interprocess communication (IPC) mechanism. Different operating systems have their own IPC mechanisms. Traditional process communication methods include Socket, pipe, memory sharing, message queue, etc.
[0248] It can be understood that the UID can be used to uniquely identify an application program. Each application program is assigned a unique UID, which determines the access permission of the application program to system resources. It can be understood that each process has a unique PID. The system automatically assigns a PID to the process corresponding to the application program when the application program is running. The PID is assigned by the system when the process is running, and does not represent a specific process. When the process is running, the PID of the process will not change, but after the process is terminated, the PID will be recycled by the system. The system can reassign the recycled PID to other newly running programs.
[0249] S3: The SurfaceFlinger creates a window of the application 1, establishes a connection channel 1 with the application 1, and manages the application 1 related information.
[0250] After the SurfaceFlinger receives the application connection request 1 sent by the WM through the surface control interface, the SurfaceFlinger can create a window of the application 1, establish a connection channel with the application 1, i.e., the connection channel 1, and manage the application 1 related information (for example, the package name of the application 1) carried in the application connection request 1.
[0251] In some embodiments of the present application, the connection channel can be a socket channel.
[0252] In some embodiments of the present application, the application 1 related information can further comprise the UID and the PID of the application 1. In a possible implementation manner, after the SurfaceFlinger receives the application connection request 1 sent by the WM through the surface control interface, the SurfaceFlinger can acquire the UID and the PID of the application 1 through the binder mechanism.
[0253] It should be noted that the SurfaceFlinger manages the application 1 related information, and it can also be understood that the SurfaceFlinger stores the mapping information between the application 1 and the corresponding package name, UID, and PID, and maintains the mapping information.
[0254] It can be understood that after the SurfaceFlinger creates the window of the application 1, the application 1 can draw and render the display interface in the window, and after the SurfaceFlinger performs layer composition, the window is sent to the display screen for display. In this way, the user can see the window of the application 1 and the user interface (or the picture in the window) in the window on the display screen.
[0255] In some embodiments of the present application, when the window of the application 1 is displayed on the display screen, the user can operate the window of the application 1. Accordingly, the electronic device can detect the user operation on the window of the application 1, and in response to the user operation, the electronic device can update the user interface in the window of the application 1. It can be understood that the present application does not specifically limit the user operation on the window of the application 1.
[0256] S4: The WM starts a window creation process to create a window of the application 2.
[0257] The user can trigger the electronic device to start the application 2. After the electronic device receives the user operation of triggering the start of the application 2, the electronic device can create a window of the application 2 through the WM starting a window creation process.
[0258] It can be understood that the present application does not limit the order of steps S1 and S4 performed by the electronic device. That is, the electronic device can first start the application 1 in response to a corresponding user operation, or the electronic device can first start the application 2 in response to a corresponding user operation.
[0259] S5: The WM sends an application connection request 2 to the SurfaceFlinger through a surface control interface.
[0260] After the electronic device receives the user operation of triggering the start of the application 2 and through the WM starting a window creation process, the WM can send an application connection request 2 to the SurfaceFlinger through a surface control interface. Accordingly, the SurfaceFlinger can receive the application connection request 2 sent by the WM through the surface control interface.
[0261] In some embodiments of the present application, the application connection request 2 can include the package name (Package Name) of the application 2.
[0262] In some embodiments of the present application, SurfaceFlinger can obtain the UID and PID of application 2 through the Binder mechanism.
[0263] S6: SurfaceFlinger creates the window of application 2, establishes connection channel 2 with application 2, and manages the information related to application 2.
[0264] After receiving the application connection request 2 sent by the WM through the surface control interface, SurfaceFlinger can create the window of application 2, establish connection channel 2 with application 2, and manage the information related to application 2 (for example, the package name of application 2) carried in the application connection request 2.
[0265] In some embodiments of the present application, the information related to application 2 can also include the UID and PID of application 2. In a possible implementation, after receiving the application connection request 2 sent by the WM through the surface control interface, SurfaceFlinger can obtain the UID and PID of application 2 through the binder mechanism.
[0266] It should be noted that the management of the information related to application 2 by SurfaceFlinger can also be understood as that the mapping information between application 2 and its corresponding package name, UID, and PID is stored in SurfaceFlinger, and the mapping information is maintained.
[0267] It can be understood that the mapping information between multiple applications (for example, application 1 and application 2) and their corresponding package names, UIDs, and PIDs can be stored in SurfaceFlinger.
[0268] For example, the mapping information of application 1 (also referred to as the mapping information of application 1) and the mapping information of application 2 (also referred to as the mapping information of application 2) can be stored in SurfaceFlinger. Specifically, SurfaceFlinger can store the information shown in Table 2. As shown in Table 2, the connection channel corresponding to application 1 is connection channel 1, which can be referred to as con1 for short, the package name of application 1 is com.example.app1, the UID and PID of application 1 are 11 and 213 respectively, the connection channel corresponding to application 2 is connection channel 2, which can be referred to as con2 for short, the package name of application 2 is com.example.app2, and the UID and PID of application 2 are 12 and 862 respectively.
[0269] Table 2
[0270] It can be understood that after SurfaceFlinger creates the window of application 2, application 2 can draw and render the display interface in the window, and send the display interface to the display screen for display after SurfaceFlinger performs layer composition. In this way, the user can see the window of application 1 and the window of application 2, as well as the user interface displayed by the window of application 1 and the user interface displayed by the window of application 2 on the display screen.
[0271] It can be understood that in the case where the electronic device has triggered the starting of application 1 and application 2, the user can also trigger the electronic device to start other applications. For specific implementation, reference can be made to steps S1-S6.
[0272] S7: The input event management module detects a touch operation acting on the window of application 2.
[0273] The user can touch the window of application 2, and the hardware device (for example, the display screen) of the electronic device can generate a raw input event accordingly. The input event management module in the electronic device can collect and acquire the raw input event, and process (for example, pre-process and classify) the raw input event to obtain a touch event (or touch control event). It can also be understood that the input event management module converts the raw input event into a more advanced class of objects (that is, the event that the Android system can understand mentioned above). The above process can be understood as that the input event management module detects a touch operation acting on the window of application 2.
[0274] In some embodiments of the present application, the touch event obtained by the input event management module based on the touch operation acting on the window of application 2 can be a down event (for example, MotionEvent.ACTION_DOWN).
[0275] For example, the window of application 2 can be window w2 as shown in FIG. 6A. Specifically, as shown in (1) of FIG. 6A, the user's finger falls on the area of the display screen (the first touch on the display screen in this sliding process) where window w2 is displayed, and the input event management module can detect a touch operation acting on the window of application 2 accordingly, that is, the input event management module can collect a raw input event and process it to obtain MotionEvent.ACTION_DOWN.
[0276] For example, the window of the application 2 can be a window 2a as shown in FIG. 7D. Specifically, as shown in (1) of FIG. 7D, the user's finger falls on the area of the display screen where the window of the application 2 is displayed (i.e., the user's finger falls on the area of the display screen where the window of the application 2 is displayed), and accordingly, the input event management module can detect the touch operation on the window of the application 2, that is, the input event management module can collect the original input event and process to obtain a MotionEvent.ACTION_DOWN.
[0277] S8: The input event management module notifies the WM to process the touch event.
[0278] After the input event management module converts the original input event into the touch event, the input event management module can notify the WM to process the touch event. In some embodiments of the present application, the input event management module can notify the WM to process the touch event by sending a message to the WM.
[0279] In some embodiments of the present application, the touch event can carry position information (e.g., coordinates of the touch point on the display screen).
[0280] S9: The WM determines the focus window.
[0281] After the input event management module notifies the WM to process the touch event, the WM can determine the focus window. Specifically, the WM can determine the focus window as the window of the application 2. In some embodiments of the present application, the WM can determine the focus window based on the position information carried by the touch event. For example, the coordinates of the touch point carried by the touch event mentioned in step S8 are located in the range of the window of the application 2, and then the WM can determine the window of the application 2 as the focus window. In some embodiments of the present application, the WM can determine the focus window based on the position information carried by the touch event, and can also determine the application corresponding to the focus window as the focus application. In some embodiments of the present application, the WM can determine the focus window by calling the handleTaskFocusChange method.
[0282] S10: The WM sends the focus window related information to the SurfaceFlinger through the surface control interface.
[0283] After the WM determines the focus window, the WM can send the focus window related information to the SurfaceFlinger through the surface control interface. Accordingly, the SurfaceFlinger can receive the focus window related information sent by the WM through the surface control interface.
[0284] In some embodiments of the present application, the focus window related information can comprise an identifier corresponding to the focus window. In some embodiments of the present application, in the case that an application corresponds to multiple windows, the WM and the SurfaceFlinger can add an identifier to the window in the process of creating the window of the application, and the SurfaceFlinger can store mapping information between the identifier corresponding to the window and the package name, UID, and PID of the application. It can be understood that the identifier corresponding to the window can be represented by a number, a symbol, a character, or the like, and the present application does not limit the specific representation thereof.
[0285] In some embodiments of the present application, the focus window related information can further comprise related information (for example, a package name, a UID, a PID, or the like) of an application corresponding to the focus application. For example, the focus window related information can comprise com.example.app2.
[0286] In some embodiments of the present application, the WM can send the focus application related information to the SurfaceFlinger by calling the setFocusedWindow method.
[0287] S11: The SurfaceFlinger updates the focus application and / or the focus window.
[0288] After the SurfaceFlinger receives the focus window related information sent by the WM through the surface control interface, the SurfaceFlinger can update the focus application and / or the focus window based on the focus window related information. Specifically, the SurfaceFlinger can update the focus application to be application 2, and / or update the focus window to be the window of application 2.
[0289] In some embodiments of the present application, after the SurfaceFlinger updates the focus application and / or the focus window, the SurfaceFlinger can set the screen refresh rate to be the highest target refresh rate corresponding to the updated focus application. Specifically, the SurfaceFlinger can set the screen refresh rate to be the highest target refresh rate corresponding to application 2.
[0290] In some embodiments of the present application, application 2 corresponds to multiple windows, and the SurfaceFlinger can determine, among the multiple windows corresponding to application 2, a window corresponding to an identifier same as the window identifier in the focus application related information as the focus window.
[0291] It should be noted that the SurfaceFlinger can record the focus application and / or the focus window. In some embodiments of the present application, the SurfaceFlinger can record the identifier corresponding to the focus window. In some embodiments of the present application, the SurfaceFlinger can record the package name or the UID corresponding to the focus application.
[0292] It can be understood that, in some embodiments of the present application, SurfaceFlinger can set the screen refresh rate based on the target refresh rate interval corresponding to the focus application. Not only can the screen refresh rate be set to the highest target refresh rate corresponding to the focus application, but also the screen refresh rate can be set lower than the highest target refresh rate corresponding to the focus application under certain conditions (e.g., no user operation). For details, please refer to the foregoing description, which will not be repeated here.
[0293] It should be further pointed out that,
[0294] S12: SurfaceFlinger synchronously updates the focus application and / or the focus window to the input event management module.
[0295] After SurfaceFlinger updates the focus application and / or the focus window, it can notify the input event management module of the updated focus application and / or the focus window, that is, synchronously update the focus application and / or the focus window to the input event management module.
[0296] S13: The input event management module detects a sliding and lifting hand operation acting on the window of application 2.
[0297] After the user touches the window of application 2, the user can slide and lift the hand immediately. Correspondingly, in the process of sliding and lifting the hand, the hardware device (e.g., display screen) of the electronic device can generate a series of original input events. The input event management module in the electronic device can collect, acquire and process (e.g., pre-process and classify) the series of original input events to obtain a series of touch events. The above process can be understood as the input event management module detecting a sliding and lifting hand operation acting on the window of application 2.
[0298] In some embodiments of the present application, the touch event obtained by the input event management module based on the sliding operation acting on the window of application 2 can be a movement event (e.g., MotionEvent.ACTION_MOVE). The touch event obtained by the input event management module based on the lifting hand operation acting on the window of application 2 can be a leave event (e.g., MotionEvent.ACTION_UP).
[0299] In some embodiments of the present application, in the process of the input event management module detecting a sliding and lifting hand operation acting on the window of application 2, the input event management module can obtain one or more movement events and one leave event.
[0300] For example, the window of the application 2 can be the window w2 as shown in FIG. 6A. Specifically, as shown in (2) of FIG. 6B, after the user's finger falls in the area of the display screen where the window w2 is displayed, the user's finger can slide upwards in the area of the display screen where the window w2 is displayed. Accordingly, the input event management module can detect the sliding operation on the window of the application 2, that is, the input event management module can collect a series of original input events and process to obtain a series of MotionEvent.ACTION_MOVE.
[0301] For example, the window of the application 2 can be the window 2a as shown in FIG. 7D. Specifically, as shown in (2) and (3) of FIG. 7D, after the user's finger falls in the area of the display screen where the window of the application 2 is displayed, the user's finger can slide upwards in the area of the display screen where the window of the application 2 is displayed. Accordingly, the input event management module can detect the sliding operation on the window of the application 2, that is, the input event management module can collect original input events and process to obtain MotionEvent.ACTION_MOVE.
[0302] For example, the window of the application 2 can be the window w2 as shown in FIG. 6A. Specifically, as shown in (3) of FIG. 6B, after the user's finger slides upwards in the area of the display screen where the window w2 is displayed, the user's finger can be lifted away from the display screen. Accordingly, the input event management module can detect the lifting operation on the window of the application 2, that is, the input event management module can collect original input events and process to obtain MotionEvent.ACTION_UP.
[0303] For example, the window of the application 2 can be the window 2a as shown in FIG. 7E. Specifically, as shown in (1) of FIG. 7E, after the user's finger slides upwards in the area of the display screen where the window of the application 2 is displayed, the user's finger can be lifted away from the display screen. Accordingly, the input event management module can detect the lifting operation on the window of the application 2, that is, the input event management module can collect original input events and process to obtain MotionEvent.ACTION_UP.
[0304] It should be noted that in some embodiments of the present application, during the process that the input event management module detects the sliding and lifting operation on the window of the application 2, the input event management module can constantly obtain touch events (i.e., the above-mentioned series of touch events), and the input event management module can constantly notify the WM to process the touch events.
[0305] S14: If the sliding speed of the user interface in the window of the application 2 is greater than the speed threshold when the user lifts the hand, the sliding component detects the fling operation.
[0306] According to the above, after the user's finger falls on the area of the display screen where the window of the application 2 is displayed and slides on the display screen, the user can lift the hand so that the finger is away from the display screen. If the sliding speed of the user interface in the window of the application 2 is greater than the speed threshold when the user lifts the hand, the sliding component can detect the fling operation.
[0307] S15: In the process of processing the fling operation, the sliding component sends the interaction state related information corresponding to the application 2 to the SurfaceFlinger.
[0308] First of all, it needs to be pointed out that after the sliding component detects the fling operation, the fling operation can be processed. In the process of processing the fling operation, the sliding component can determine the state of the fling operation and synchronize the state of the fling operation to the SurfaceFlinger. The state of the fling operation can include start (i.e. START) and end (i.e. END).
[0309] It can be understood that the interaction state related information can include the state information of the fling operation corresponding to the application (also can be called the state information of the fling operation corresponding to the window of the application). For example, the interaction state related information corresponding to the application 2 can include the state of the fling operation corresponding to the application 2.
[0310] Specifically, if the sliding speed of the user interface in the window of the application 2 is greater than the speed threshold when the user lifts the hand, the sliding component can detect the fling operation, and after the sliding component detects the fling operation, the sliding component can determine that the state of the fling operation is START and send the state information to the SurfaceFlinger. The sliding component can continue to process the fling operation subsequently, and when the sliding of the user interface in the window of the application 2 stops (i.e. the sliding speed is 0), the sliding component can determine that the state of the fling operation is END and send the state information to the SurfaceFlinger.
[0311] In some embodiments of the present application, the sliding component can detect multiple applications triggering a fling operation. For example, a user can first slide in the area where the window of application 2 is displayed on the display screen and lift the hand, accordingly, the sliding component can detect that the state of the fling operation corresponding to application 2 is START, and send the state information to SurfaceFlinger, further, the user can slide in the area where the window of application 1 is displayed on the display screen and lift the hand, and the sliding component can still send the state information to SurfaceFlinger before detecting that the state of the fling operation corresponding to application 2 changes to END. In this case, the user interface in the window of application 1 and the user interface in the window of application 2 are both in the fling state for a period of time.
[0312] In some embodiments of the present application, the sliding component can listen to the state of the fling operation by adding a stake point, and synchronize the state of the fling operation to SurfaceFlinger in time. Specifically, after adding a stake point, the sliding component can listen to the start and end of the fling operation corresponding to the window of application 2, and send the state information to SurfaceFlinger after listening to the state of the fling operation being START, and send the state information to SurfaceFlinger after listening to the state of the fling operation being END.
[0313] In some embodiments of the present application, the interaction state related information can not only include the state information of the fling operation corresponding to the application, but also include the UID and / or package name of the application. For example, the interaction state related information corresponding to application 2 can include the state of the fling operation corresponding to application 2, the UID of application 2 (such as 12), and the package name of application 2 (such as com.example.app2).
[0314] S16: SurfaceFlinger updates the interaction state corresponding to application 2 based on the interaction state related information corresponding to application 2.
[0315] After receiving the interaction state related information corresponding to application 2 sent by the sliding component, SurfaceFlinger can determine whether the state information of the fling operation in the interaction state related information corresponding to application 2 includes START or END. If the state information of the fling operation in the interaction state related information corresponding to application 2 includes START, SurfaceFlinger can determine that the interaction state corresponding to application 2 is a fling state, i.e., application 2 is in the fling state, and SurfaceFlinger can update the interaction state of application 2 to the fling state. If the state information of the fling operation in the interaction state related information corresponding to application 2 includes END, SurfaceFlinger can determine that the interaction state corresponding to application 2 is a non-fling state, i.e., application 2 is not in the fling state, and SurfaceFlinger can update the interaction state of application 2 to the non-fling state.
[0316] It can be understood that after the electronic device performs steps S1-S15, the electronic device can further perform steps S17-S22.
[0317] 2. Based on the focus application and / or the focus window and the interaction state information of the applications, determine the rendering frame rate of the applications that need to update the interface (as shown in FIG. 11B).
[0318] S17: SurfaceFlinger determines whether the current screen refresh rate is greater than the first refresh rate threshold once for each time SurfaceFlinger generates a VSync signal.
[0319] SurfaceFlinger can generate a VSync signal according to a VSync period (i.e., the reciprocal of the screen refresh rate). SurfaceFlinger can determine whether the current screen refresh rate is greater than the first refresh rate threshold once for each time SurfaceFlinger generates a VSync signal. If the current screen refresh rate is greater than the first refresh rate threshold, SurfaceFlinger can continue to perform step S18.
[0320] S18: SurfaceFlinger determines the rendering frame rate of application 1 and application 2 based on the focus application and / or the focus window and the interaction state corresponding to application 1 and application 2.
[0321] In the case that the windows of the application 1 and the application 2 are currently displayed, if the SurfaceFlinger determines whether the current screen refresh rate is greater than the first refresh rate threshold, the SurfaceFlinger can determine the rendering frame rate of the application 1 and the application 2 based on the focus application and / or the focus window, and the interaction state corresponding to the application 1 and the application 2. Specifically, if the application 1 is the focus application or is in the fling state, the SurfaceFlinger can determine that the rendering frame rate of the application 1 is the current screen refresh rate, and if the application 1 is the non-focus application not in the fling state, the SurfaceFlinger can determine that the rendering frame rate of the application 1 is less than the current screen refresh rate. Similarly, if the application 2 is the focus application or is in the fling state, the SurfaceFlinger can determine that the rendering frame rate of the application 2 is the current screen refresh rate, and if the application 2 is the non-focus application not in the fling state, the SurfaceFlinger can determine that the rendering frame rate of the application 2 is less than the current screen refresh rate.
[0322] It can be understood that the specific implementation of step S18 can refer to the related description of step S101, which will not be repeated here.
[0323] S19: The SurfaceFlinger sends the APP-VSync signal to the render composer based on the rendering frame rate of the application 1 through the connection channel 1.
[0324] After the SurfaceFlinger determines the rendering frame rate of the application 1, the SurfaceFlinger can send the APP-VSync signal to the render composer based on the rendering frame rate of the application 1 through the connection channel 1. The specific implementation can refer to the related description of steps S102 and S103, which will not be repeated here.
[0325] Correspondingly, the render composer can receive the APP-VSync signal sent by the SurfaceFlinger through the connection channel 1.
[0326] S20: The render composer initiates the rendering process corresponding to the application 1.
[0327] After the render composer receives the APP-VSync signal sent by the SurfaceFlinger through the connection channel 1, the render composer can initiate the rendering process corresponding to the application 1, that is, wake up the UI thread of the application 1 for drawing and rendering.
[0328] S21: The SurfaceFlinger sends the APP-VSync signal to the render composer based on the rendering frame rate of the application 2 through the connection channel 2.
[0329] After the SurfaceFlinger determines the rendering frame rate of the application 2, the SurfaceFlinger can send the APP-VSync signal to the render composer based on the rendering frame rate of the application 2 through the connection channel 2, and the specific implementation manner can refer to the related description of steps S102 and S103, and details are not described herein again.
[0330] Correspondingly, the render composer can receive the APP-VSync signal sent by the SurfaceFlinger through the connection channel 2.
[0331] S22: The render composer initiates the rendering process corresponding to the application 2.
[0332] After the render composer receives the APP-VSync signal sent by the SurfaceFlinger through the connection channel 2, the render composer can initiate the rendering process corresponding to the application 2, that is, wake up the UI thread of the application 2 to draw and render.
[0333] The hardware structure of the electronic device related to the embodiments of the present application will be introduced below.
[0334] Please refer to FIG. 12, which is a schematic diagram of the hardware structure of an electronic device provided by an embodiment of the present application.
[0335] As shown in FIG. 12, the electronic device can include a processor, an external memory interface, an internal memory, a Universal Serial Bus (USB) interface, a charging management module, a power management module, a battery, an antenna 1, an antenna 2, a mobile communication module, a wireless communication module, a sensor module, a key, a motor, an indicator, a camera, a display screen, and a Subscriber Identity Module (SIM) card slot, etc. Among them, the audio module can include a speaker, a receiver, a microphone, an earphone interface, etc., the sensor module can include a pressure sensor, a gyroscope sensor, a barometric pressure sensor, a magnetic sensor, an acceleration sensor, a distance sensor, a proximity light sensor, a fingerprint sensor, a temperature sensor, a touch sensor, an ambient light sensor, a bone conduction sensor, etc.
[0336] It can be understood that the structure illustrated in the embodiments of the present application does not constitute a specific limitation on the electronic device. It can be understood that the illustrated components can be implemented in hardware, software, or a combination of software and hardware. In some embodiments of the present application, the electronic device can include more components than illustrated. For example, the electronic device can include other types of sensors. In yet other embodiments of the present application, the electronic device can include fewer components than illustrated, or combine certain components, or split certain components, or different arrangement of components. The interface connection relationship between the modules illustrated in the embodiments of the present application is only illustrative and does not constitute a structural limitation on the electronic device.
[0337] The processor can include one or more processing units, for example: the processor can include an application processor (AP), a modem (also known as a baseband processor), a graphics processing unit (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), and / or a neural-network processing unit (NPU), etc. Among them, the AP is a processor responsible for running the operating system and application programs. The Modem is a processor responsible for processing various communication protocols.
[0338] The wireless communication function of the electronic device can be implemented through the antenna 1, the antenna 2, the mobile communication module, the wireless communication module, and the Modem, etc. The Modem can interact with the base station through the antenna (for example, the antenna 1, the antenna 2, etc.). In some embodiments, the antenna 1 and the mobile communication module of the electronic device are coupled, and the antenna 2 and the wireless communication module are coupled, so that the electronic device can communicate with the network and other devices through the wireless communication technology.
[0339] The electronic device can implement the display function through the GPU, the display screen, and the application processor, etc.
[0340] The GPU is a microprocessor for image processing, connected to the display screen and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor can include one or more GPUs that execute program instructions to generate or change display information. The display screen is used to display images, videos, etc. In some embodiments, the electronic device can include one or more display screens.
[0341] A camera is used to capture still images or videos. An ISP is used to process the data fed back by the camera. Light is transmitted onto a camera photosensitive element through a lens, and the light signal is converted into an electrical signal, which is transmitted by the camera photosensitive element to the ISP for processing and converted into an image visible to the naked eye. An electronic device can include one or more cameras.
[0342] Internal memory can include one or more RAMs and one or more non-volatile memories (NVMs). A random access memory can be directly read and written by a processor, and can be used to store executable programs (e.g., machine instructions) of an operating system or other programs that are currently running, and can also be used to store data of users and application programs, etc. A non-volatile memory can also store executable programs and store data of users and application programs, etc., and can be loaded into a random access memory in advance for direct reading and writing by a processor.
[0343] In embodiments of the present application, the code implementing the method described in the embodiments of the present application can be stored on a non-volatile memory. When a camera application is running, the electronic device can load the executable code stored in the non-volatile memory into the random access memory.
[0344] An external memory interface can be used to connect an external non-volatile memory, to realize the expansion of the storage capacity of the electronic device.
[0345] An electronic device can realize audio functions through an audio module, a speaker, a receiver, a microphone, a headset interface, and an application processor, etc.
[0346] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art can easily think of changes or replacements within the technical scope disclosed in the present application, which should be covered within the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.
Claims
1. An image display method characterized by, The method is applied to an electronic device including a display screen; the method includes: rendering a picture of a first application at a first frame rate to obtain a first picture, the first application being an application in a fling state or a focus application; rendering a picture of a second application at a second frame rate to obtain a second picture, the second application being a non-focus application in a non-fling state; performing a synthesis process on the first picture and the second picture to obtain a first image; displaying the first image on the display screen at a first refresh rate; wherein the first refresh rate is greater than a first threshold value, the first frame rate is equal to the first refresh rate, and the second frame rate is less than the first refresh rate.
2. The method of claim 1, wherein, The method further includes: generating a first VSync signal based on a first timer every first timing duration; the first timing duration is the reciprocal of the first refresh rate; generating a second VSync signal corresponding to each of Y first VSync signals; Y is an integer greater than 1; The method further includes: rendering the picture of the first application based on the first VSync signal; The method further includes: rendering the picture of the second application based on the second VSync signal.
3. The method of claim 1, wherein, The method further includes: generating a first VSync signal based on a first timer every first timing duration; the first timing duration is the reciprocal of the first refresh rate; generating a second VSync signal based on a second timer every second timing duration; the second timing duration is the reciprocal of the second frame rate; The method further includes: rendering the picture of the first application based on the first VSync signal; The method further includes: rendering the picture of the second application based on the second VSync signal.
4. The method according to any one of claims 1 to 3, characterized in that, The first refresh rate is a first multiple of the second frame rate, and the first multiple is equal to Y.
5. The method of claim 1 or 3, wherein, The first refresh rate is not an integer multiple of the second frame rate.
6. The method of claim 2 or 3, wherein, Before the method of rendering the picture of the first application at the first frame rate, the method further includes: in response to the first VSync signal, obtaining an interaction state of a focus application, the first application, and the second application; the interaction state includes the fling state and the non-fling state; based on the interaction state of the focus application, the first application, and the second application, determining the first frame rate and the second frame rate.
7. The method of any one of claims 1-6, wherein, The first application is a focus application in the non-fling state. After the method of displaying the first image on the display screen at the first refresh rate, the method further includes: in response to a user operation on the second picture in the first image, updating the focus application from the first application to the second application; setting a screen refresh rate to a second refresh rate; the second refresh rate is a highest refresh rate corresponding to the second application.
8. The method of claim 7, wherein, After the method of setting the screen refresh rate to the second refresh rate, the method further includes: in a case where the second refresh rate is greater than the first threshold, rendering a picture of the first application at the third frame rate to obtain a third picture, and rendering a picture of the second application at the fourth frame rate to obtain a fourth picture; performing synthesis processing on the third picture and the fourth picture to obtain a second image; displaying the second image on the display screen at the second refresh rate; wherein the third frame rate is less than the second refresh rate, and the fourth frame rate is equal to the second refresh rate.
9. The method of claim 7 or 8, wherein, after the screen refresh rate is set to the second refresh rate, the method further comprises: in a case where the second refresh rate is less than or equal to the first threshold, rendering a picture of the first application at a fourth frame rate to obtain a fifth picture, and rendering a picture of the second application at the fourth frame rate to obtain a fourth picture; the fourth frame rate is equal to the second refresh rate; performing synthesis processing on the fifth picture and the fourth picture to obtain a third image; displaying the third image on the display screen at the second refresh rate.
10. The method according to any one of claims 7 to 9, characterized in that, after the screen refresh rate is set to the second refresh rate, the method further comprises: if no user operation for displaying a picture on the display screen is detected within a preset time length, setting the screen refresh rate to a third refresh rate; the third refresh rate is less than the second refresh rate, and the third refresh rate is greater than or equal to the minimum refresh rate corresponding to the second application.
11. An electronic device, comprising: The electronic device comprises a display screen, one or more memories, and one or more processors; the display screen is coupled with the one or more memories and the one or more processors, the display screen is used to display a picture, the memory is used to store computer program code, the computer program code comprises computer instructions, and the processor invokes the computer instructions to execute the method in any one of claims 1-10.
12. A computer-readable storage medium, characterized in that, A computer program product for storing computer instructions, when the computer instructions are run on an electronic device, the electronic device executes the method in any one of claims 1-10. A computer program product for storing computer instructions, when the computer instructions are run on an electronic device, the electronic device executes the method in any one of claims 1-10.
Citation Information
Patent Citations
Control method, control device, electronic device and computer readable storage medium
CN111767013A
Method for displaying multiple windows and electronic equipment
CN114040238A
Screen refresh rate adjusting method, electronic equipment and readable storage medium
CN114495864A
Application processing method and related device
CN116196621A
System and method for managing application refresh rates presended on a display
CN117795478A