Display control method, electronic equipment and storage medium
By dynamically adjusting the synthesis frame rate according to the occlusion relationship of layers in multi-layer display scenes of electronic devices, the problem of high power consumption of electronic devices is solved and more efficient energy use is achieved.
Patent Information
- Application Number
- CN202411818158.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-11
- Publication Date
- 2025-01-24
- Estimated Expiration
- 2044-12-11
AI Technical Summary
In a multi-layer display scenario, due to the different synthetic frame rates required by different layers, the synthetic frame rate used by electronic devices is the maximum synthetic frame rate required by multiple layers, resulting in power consumption. Higher.
By displaying the first interface of the first application during a first period of time, the image frame is synthesized based on the first layer, and after responding to the first operation, the second interface is displayed, and the image frame is drawn based on the second layer. During the second time period, the electronic device acquires the data of the first layer but does not draw the first layer. When the first layer is completely blocked by the second layer, the synthesis frame rate is reduced to reduce power consumption.
It effectively reduces the power consumption of electronic equipment and improves the energy efficiency performance of the equipment by reducing unnecessary layer drawing and synthesis frame rate.
Smart Images

Figure CN119356512A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of terminal technology, and in particular to a display control method, an electronic device and a storage medium. Background Art
[0002] Currently, in multi-layer display scenarios, since different layers require different synthesis frame rates, electronic devices will take the maximum frame rate required by multiple layers for layer synthesis or set a fixed higher frame rate such as 60FPS, 90FPS or 120FPS for layer synthesis to be compatible with multiple layers requiring different synthesis frame rates. However, this will result in higher power consumption of the electronic equipment. Summary of the invention
[0003] Embodiments of the present application provide a display control method, an electronic device, and a storage medium, aiming to reduce the power consumption of the electronic device.
[0004] In a first aspect, an embodiment of the present application provides a display control method, which is applied to an electronic device, and the method includes: In a first time period, a first interface of a first application is displayed, and an image frame of the first interface is synthesized based on a first layer. During the first time period, a synthesis frame rate of the electronic device is a first value. After the first time period, in response to a first operation, a second interface of the first application is displayed, and an image frame of the second interface is drawn based on a second layer. During a second time period when the second interface is displayed, the synthesis frame rate of the electronic device is a second value, and the second value is less than the first value. The second layer is at an upper layer than the first layer, and the first layer is completely blocked by the second layer. During the second time period, the electronic device obtains data of the first layer, and the electronic device does not draw the first layer.
[0005] Exemplarily, the image frame of the first interface is synthesized based on the first layer only, or the image frame of the first interface is synthesized based on the first layer and other layers.
[0006] Exemplarily, the first operation includes an operation capable of changing a first interface of a first application displayed on the electronic device. For example, the first operation includes a user's touch operation on a control in the first interface or a user's sliding operation on the first interface.
[0007] When the first layer of the lower layer is completely blocked by the second layer of the upper layer, the electronic device does not draw the first layer, so that the synthesis frame rate adopted by the electronic device is smaller than the maximum frame rate of the synthesis frame rates required by the first layer and the second layer, thereby effectively reducing the power consumption of the electronic device.
[0008] Exemplarily, the second layer is a top-level layer, and the first layer is a non-top-level layer.
[0009] When all non-top layers are completely blocked by the top layer, the electronic device only draws the top layer, so that the synthesis frame rate adopted by the electronic device is smaller than the maximum of the synthesis frame rates required by the non-top layer and the top layer, thereby effectively reducing the power consumption of the electronic device.
[0010] As an example of the present application, the frequency at which the first application writes data of the first layer to the buffer is a third value, and the third value is greater than the second value.
[0011] Exemplarily, the frequency at which the first application writes data of the first layer to the first buffer is a third value.
[0012] Exemplarily, the first value is greater than or equal to the third value.
[0013] When the first layer of the lower layer is completely blocked by the second layer of the upper layer, the electronic device does not adopt the maximum frame rate of the composite frame rates required by the first layer and the second layer, but adopts a composite frame rate that is smaller than the maximum frame rate of the composite frame rates required by the first layer and the second layer, thereby effectively reducing the power consumption of the electronic device.
[0014] As an example of the present application, the frequency at which the first application writes data of the second layer to the buffer is a fourth value, and the method further includes: After the first operation, based on the fact that the first layer is completely blocked by the second layer and the fourth value is less than the third value, the synthesis frame rate of the electronic device is set to the second value.
[0015] Exemplarily, the frequency at which the first application writes data of the second layer to the second buffer is a fourth value.
[0016] Exemplarily, the second value is greater than or equal to the fourth value.
[0017] When the first layer of the lower layer is completely blocked by the second layer of the upper layer, and the synthesis frame rate required by the second layer is less than the synthesis frame rate required by the first layer, the electronic device does not adopt the maximum frame rate of the synthesis frame rates required by the first layer and the second layer, but adopts a synthesis frame rate that is smaller than the maximum frame rate of the synthesis frame rates required by the first layer and the second layer, thereby effectively reducing the power consumption of the electronic device.
[0018] As an example of the present application, the method also includes: after the first operation, based on the fact that the first layer is completely obscured by the second layer and the fourth value is less than the third value, the second application sends a control command to the layer management service; after receiving the control command, the layer management service does not draw the first layer when the layer drawing function is called and the layer to be drawn is the first layer.
[0019] As an example of the present application, the method also includes: after the first operation, the layer management service sends layer information of the first layer and layer information of the second layer to a second application; the second application obtains the layer information of the first layer and the layer information of the second layer sent by the layer management service; the second application determines whether the first layer is completely obscured by the second layer based on the layer information of the first layer and the layer information of the second layer.
[0020] Exemplarily, after the first operation, when the layer management service calls a new layer function to create the second layer, the layer information of the first layer and the layer information of the second layer are sent to the second application.
[0021] Exemplarily, after the first operation, if the application whitelist includes the first application, the layer management service sends the layer information of the first layer and the layer information of the second layer to the second application.
[0022] Exemplarily, determining whether the first layer is completely obscured by the second layer based on the layer information of the first layer and the layer information of the second layer includes: determining whether the first layer is completely covered by the second layer and determining whether the second layer is opaque based on the position information in the layer information of the first layer and the position information in the layer information of the second layer; if the first layer is completely covered by the second layer and the second layer is opaque, determining that the first layer is completely obscured by the second layer; if the first layer is completely covered by the second layer and the second layer is transparent or if the first layer is not completely covered by the second layer, determining that the first layer is not completely obscured by the second layer.
[0023] Exemplarily, determining whether the second layer is opaque includes: the second application communicates with the layer management service to obtain an image frame to be displayed, wherein the image frame to be displayed is synthesized based on the first layer and the second layer; extracting multiple evenly distributed pixels from the image frame to be displayed, and reading the transparency of the multiple pixels; determining whether the transparency of the multiple pixels is greater than or equal to a preset threshold; if the transparency of the multiple pixels is greater than or equal to the preset threshold, determining that the second layer is opaque; if the transparency of some of the multiple pixels is less than the preset threshold, determining that the second layer is transparent.
[0024] Exemplarily, the layer management service sends the layer information of the second layer and the layer information of the first layer to the second application in descending order of hierarchy. Alternatively, the layer management service sends the layer information of the first layer and the layer information of the second layer to the second application together.
[0025] As an example of the present application, the method also includes: after the first operation, based on the first layer being completely obscured by the second layer and the fourth value being less than the third value, the second application sends the second value to the layer management service; the layer management service sets the synthesis frame rate of the first application to the second value.
[0026] As an example of the present application, the method also includes: after the first operation, based on the first layer being completely obscured by the second layer and the fourth value being less than the third value, the second application sends a frame rate setting message to the layer management service, and the frame rate setting message is used by the layer management service to instruct the layer management service to set the composite frame rate of the first application to the second value; when receiving the frame rate setting message, the layer management service sets the composite frame rate of the first application to the second value.
[0027] As an example of the present application, the method also includes: after the first time period, in response to a second operation, displaying a third interface of the first application, the image frame of the third interface is synthesized based on the first layer and the third layer; in the third time period of displaying the third interface, the synthesis frame rate of the electronic device is a fourth value, the fourth value is less than the first value, the level of the third layer is above the first layer, the first layer is not completely blocked by the third layer, and the area of the first layer that is not blocked by the third layer does not include the first control.
[0028] Exemplarily, the second operation includes an operation capable of changing the first interface of the first application displayed on the electronic device. For example, the second operation includes a user's touch operation on a control in the first interface or a user's sliding operation on the first interface.
[0029] Exemplarily, the image frame of the third interface is synthesized based on the first layer, the third layer and other layers. The third layer is located above the first layer and above other layers, the first layer and / or other layers are not completely blocked by the third layer, and the area of the first layer not blocked by the third layer does not include the first control and / or the area of other layers not blocked by the third layer does not include the second control. The frequency at which the first application writes the data of the second control to the buffer is greater than the frequency at which the first application writes the data of the third layer to the buffer.
[0030] Exemplarily, the area in the first layer that is not blocked by the third layer does not include the first control, which means that the area in the first layer that is blocked by the third layer includes the first control in the first layer, that is, the first control in the first layer is completely blocked by the third layer.
[0031] Exemplarily, the first layer is a non-top layer, and the third layer is a top layer.
[0032] When the first layer of the lower layer is not completely blocked by the third layer of the upper layer, and the first control in the first layer is blocked by the third layer, the electronic device does not adopt the maximum frame rate of the composite frame rates required by the first layer and the third layer, but adopts a composite frame rate that is smaller than the maximum frame rate of the composite frame rates required by the first layer and the third layer, thereby effectively reducing the power consumption of the electronic device.
[0033] As an example of the present application, the frequency at which the first application writes data of the first control to the buffer is a fifth value, and the fifth value is greater than the fourth value.
[0034] Exemplarily, the frequency at which the first application writes data of the first control to the third buffer is a fifth value.
[0035] Exemplarily, the first value is greater than or equal to the fifth value.
[0036] When the first layer of the lower layer is not completely blocked by the third layer of the upper layer, and the first control in the first layer is blocked by the third layer, the electronic device does not adopt the maximum frame rate of the composite frame rates required by the first layer and the third layer, but adopts a composite frame rate that is smaller than the maximum frame rate of the composite frame rates required by the first layer and the third layer, thereby effectively reducing the power consumption of the electronic device.
[0037] As an example of the present application, the frequency at which the first application writes data of the third layer to the buffer is a sixth value, and the method further includes: after the second operation, based on the fact that the first layer is not completely blocked by the third layer, the area of the first layer not blocked by the third layer does not include the first control, and the sixth value is less than the fifth value, setting the synthetic frame rate of the electronic device to the fourth value.
[0038] Exemplarily, the frequency at which the first application writes the data of the third layer to the fourth buffer is a sixth value.
[0039] Exemplarily, the fourth value is greater than or equal to the sixth value.
[0040] When the first layer of the lower layer is not completely blocked by the third layer of the upper layer, the first control in the first layer is blocked by the third layer, and the frame rate of the first control is greater than the frame rate of the third layer, the electronic device does not use the maximum frame rate of the composite frame rates required by the first layer and the third layer, but uses a composite frame rate that is smaller than the maximum frame rate of the composite frame rates required by the first layer and the third layer, thereby effectively reducing the power consumption of the electronic device.
[0041] As an example of the present application, after the second operation, based on the fact that the first layer is not completely blocked by the third layer, the area in the first layer not blocked by the third layer does not include the first control, and the sixth value is less than the fifth value, the second application sends the fourth value to the layer management service; the layer management service sets the composite frame rate of the electronic device to the fourth value.
[0042] As an example of the present application, after the second operation, it is checked whether the area in the first layer that is not blocked by the third layer does not include the first control.
[0043] Exemplarily, after the second operation, based on the layer information of the first layer and the image information of the third layer, it is checked whether the area in the first layer that is not blocked by the third layer does not include the first control.
[0044] As an example of the present application, the method also includes: after the first time period, in response to a third operation, displaying a fourth interface of the first application, the image frame of the fourth interface is synthesized based on the first layer and the fourth layer; in a fourth time period for displaying the fourth interface, the synthesis frame rate of the electronic device is the first value, the level of the fourth layer is above the first layer, the first layer is not completely blocked by the fourth layer, and the area of the first layer that is not blocked by the fourth layer includes a first control.
[0045] Exemplarily, the image frame of the fourth interface is synthesized based on the first layer, the fourth layer and other layers. The fourth layer is located above the first layer and above other layers, the first layer is not completely blocked by the fourth layer and / or other layers are not completely blocked by the fourth layer, and the area of the first layer not blocked by the fourth layer includes the first control and / or the area of the other layers not blocked by the fourth layer includes the second control. The frequency at which the first application writes the data of the second control to the buffer is greater than the frequency at which the first application writes the data of the fourth layer to the buffer.
[0046] Exemplarily, the third operation can change the operation of the first interface of the first application displayed by the electronic device. For example, the third operation includes a user's touch operation on a control in the first interface or a user's sliding operation on the first interface.
[0047] Exemplarily, the area in the first layer that is not blocked by the fourth layer includes the first control, which means that the first control in the first layer is not completely blocked by the fourth layer.
[0048] Exemplarily, the first layer is a non-top layer, and the fourth layer is a top layer.
[0049] When the first layer of the lower layer is not completely blocked by the fourth layer of the upper layer, and the first control in the first layer is not completely blocked by the fourth layer, in order to take into account the composite frame rate required by the first layer and the fourth layer, the electronic device adopts the maximum frame rate of the composite frame rate required by the first layer and the fourth layer or a frame rate greater than the maximum frame rate to ensure the display effect of the interface.
[0050] As an example of the present application, the frequency at which the first application writes data of the fourth layer to the buffer is a seventh value, and the seventh value is less than the first value.
[0051] Exemplarily, the frequency at which the first application writes the data of the fourth layer to the fifth buffer is a seventh value.
[0052] As an example of the present application, the frequency at which the first application writes data of the first control to the buffer is a fifth value, and the method further includes: after the third operation, based on the fact that the first layer is not completely blocked by the fourth layer, the area of the first layer not blocked by the fourth layer includes the first control, and the fifth value is greater than the seventh value, setting the synthetic frame rate of the electronic device to the first value.
[0053] When the first layer of the lower layer is not completely blocked by the fourth layer of the upper layer, the first control in the first layer is not completely blocked by the fourth layer, and the frame rate of the first control is greater than the frame rate of the fourth layer, in order to take into account the composite frame rate required by the first layer and the fourth layer, the electronic device adopts the maximum frame rate of the composite frame rate required by the first layer and the fourth layer or a frame rate greater than the maximum frame rate to ensure the display effect of the interface.
[0054] In a second aspect, an embodiment of the present application further provides a display control method, which is applied to an electronic device, and the method includes: In a first time period, a first interface of a first application is displayed, and an image frame of the first interface is synthesized based on a first layer. During the first time period, a synthesis frame rate of the electronic device is a first value. After the first time period, in response to a first operation, a second interface of the first application is displayed, and an image frame of the second interface is synthesized based on the first layer and a second layer. During a second time period when the second interface is displayed, the synthesis frame rate of the electronic device is a second value, and the second value is less than the first value. The second layer is at an upper layer than the first layer, and the first layer is not completely blocked by the second layer. The area of the first layer that is not blocked by the second layer does not include the first control.
[0055] When the first layer in the lower layer is not completely blocked by the second layer in the upper layer, and the first control in the first layer is completely blocked by the second layer, the electronic device does not adopt the maximum frame rate of the composite frame rates required by the first layer and the second layer, but adopts a composite frame rate that is smaller than the maximum frame rate of the composite frame rates required by the first layer and the second layer, thereby effectively reducing the power consumption of the electronic device.
[0056] As an example of the present application, the method further includes: After the first time period, in response to a second operation, a third interface of the first application is displayed, and an image frame of the third interface is synthesized based on the first layer and the third layer; during a third time period of displaying the third interface, the synthesis frame rate of the electronic device is the first value, the third layer is at an upper layer than the first layer, the first layer is not completely blocked by the third layer, and an area of the first layer that is not blocked by the third layer includes a first control.
[0057] When the first layer of the lower layer is not completely blocked by the third layer of the upper layer, and the first control in the first layer is not completely blocked by the third layer, in order to take into account the composite frame rate required by the first layer and the third layer, the electronic device adopts the maximum frame rate of the composite frame rate required by the first layer and the third layer or a frame rate greater than the maximum frame rate to ensure the display effect of the interface.
[0058] In a third aspect, an embodiment of the present application provides an electronic device, including: A memory and a processor, the memory being coupled to the processor; The memory stores program instructions, and when the program instructions are executed by the processor, the electronic device executes the method as described in any one of the first aspect or the second aspect.
[0059] In a fourth aspect, an embodiment of the present application provides a chip system, which is applied to an electronic device; the electronic device includes at least one processor and at least one interface circuit, and the processor and the interface circuit are interconnected through lines; the interface circuit is used to receive a signal from a memory of the electronic device and send the signal to the processor, and the signal includes a program instruction stored in the memory; when the processor executes the program instruction, the electronic device executes a method as described in any one of the first aspect or the second aspect.
[0060] In a fifth aspect, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the processor executes a method as described in any one of the first aspect or the second aspect.
[0061] In a sixth aspect, the present application provides a computer program product. When the computer program product is executed on an electronic device, the electronic device executes the method as described in any one of the first aspect or the second aspect.
[0062] It should be understood that the technical effects obtained by the above-mentioned third, fourth, fifth and sixth aspects are similar to the technical effects obtained by the corresponding technical means in the above-mentioned first or second aspects, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0063] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0064] Figure 1 It is a schematic diagram of a superposition of multiple layers provided in an embodiment of the present application; Figure 2 is another schematic diagram of superimposing multiple layers provided in an embodiment of the present application; Figure 3 is a block diagram of a software system of an electronic device provided in an embodiment of the present application; Figure 4 is a schematic diagram of an interface of an electronic device in an embodiment of the present application; Figure 4a is another schematic diagram of superimposing multiple layers in an embodiment of the present application; Figure 5 is another schematic diagram of an interface of an electronic device in an embodiment of the present application; Figure 5a is another schematic diagram of superimposing multiple layers in an embodiment of the present application; Figure 6 is a hardware structure block diagram of an electronic device in some embodiments of the present application; Figure 7 It is a flowchart of a display control method provided in an embodiment of the present application; Figure 8 is a schematic diagram of extracting a plurality of uniformly distributed pixels from an image frame to be displayed in an embodiment of the present application; Fig. 9 is another schematic diagram of superimposing multiple layers in an embodiment of the present application; Fig.10 It is another schematic diagram of superposition of multiple layers in an embodiment of the present application. DETAILED DESCRIPTION
[0065] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0066] The flowcharts shown in the accompanying drawings are only examples and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps may also be decomposed, combined or partially merged, so the actual execution order may change according to actual conditions.
[0067] It should be understood that the terms used in this application specification are only for the purpose of describing specific embodiments and are not intended to limit the application. As used in this application specification and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.
[0068] Some embodiments of the present application are described in detail below in conjunction with the accompanying drawings. In the absence of conflict, the following embodiments and features in the embodiments can be combined with each other.
[0069] Before introducing the display control method provided in the embodiment of the present application, a brief introduction to the nouns and terms involved in the embodiment of the present application is first given.
[0070] Layer: refers to the object passed by the application layer to SurfaceFlinger for synthesis. Each layer can contain different image elements. Each layer has corresponding layer properties, which can include at least one of the position, size, and level of the layer. Among them, the position information is used to indicate the position of the layer. Exemplarily, taking a rectangular layer as an example, the position information may include the coordinates of each vertex of the layer, such as the position information of the layer includes the coordinates of the upper left and lower right vertices, or the coordinates of the lower left and upper right vertices. Optionally, the coordinates of each vertex of the layer are coordinates in the screen coordinate system, which is a rectangular coordinate system with the upper left corner of the display screen as the origin, the right as the positive direction of the x-axis, and the downward direction as the positive direction of the y-axis. The size information is used to indicate the size of the layer.
[0071] The level of a layer is used to indicate the vertical stacking order of the layers when they are synthesized. The larger the level of the layer, the closer the corresponding layer is to the front in the vertical direction when synthesized. When synthesizing, a high-level layer can completely cover a low-level layer, or a high-level layer can partially cover a low-level layer. This embodiment of the application does not specifically limit this.
[0072] For example, in the order from bottom to top during synthesis, the multiple layers include Layer0 (layer 0, i.e., layer numbered 0), Layer1 (layer 1, i.e., layer numbered 1), and Layer2 (layer 2, i.e., layer numbered 2), and the level information of Layer0, Layer1, and Layer2 are respectively represented as: 0, 1, 2. For example, the stacking order of Layer0, Layer1, and Layer2 is as follows: Figure 1 and Figure 2 shown, and Figure 1 and Figure 2 In the example, 41 is used to identify Layer 0, 42 is used to identify Layer 1, and 43 is used to identify Layer 2. Figure 1 As shown in , the high-level layer completely covers the low-level layer, that is, Layer2 is superimposed on Layer1, and Layer2 completely covers Layer1, and Layer1 is superimposed on Layer0, and Layer1 completely covers Layer0. Figure 2 As shown, the high-level layer partially covers the low-level layer, that is, Layer2 is superimposed on Layer1, and Layer2 partially covers Layer1, and Layer1 is superimposed on Layer0, and Layer1 partially covers Layer0.
[0073] For ease of understanding, the software system of the electronic device involved in the embodiment of the present application is first introduced. The software system of the electronic device can adopt a layered architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture. The embodiment of the present application takes the Android system with a layered architecture as an example to exemplify the software system of the electronic device.
[0074] Figure 3 is a block diagram of a software system of an electronic device provided in an embodiment of the present application. Figure 3 The layered architecture divides the software into several layers, each with a clear role and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, from top to bottom: application layer (application layer, App layer), application framework layer (application framework layer, FWK layer), hardware abstract layer (hardwareabstract layer, HAL layer), and kernel layer (kernel layer).
[0075] The application layer can include a series of applications, such as Figure 3 As shown, the application layer may include a first application and a second application, etc., but it is certainly not limited thereto, and may also include, for example, camera, map, Bluetooth, contact, short message and other applications. Among them, the first application and the second application may be the same application or different applications, and the second application may include power saving wizard, mobile phone manager and adaptive power saving application (Adaptive Power Saving, APS), etc. APS is a system application, which is mainly used to realize adaptive energy saving of electronic devices to reduce the power consumption of electronic devices. For example, unnecessary self-starting of applications is prohibited.
[0076] The application framework layer provides application programming interface (API) and programming framework for the applications in the application layer; the application framework layer includes some predefined functions. Figure 3 As shown, the application framework layer includes the layer management service SurfaceFlinger (SF for short) and the activity management service Activity Manager Service (AMS for short). Among them, the layer management service SurfaceFlinger is a system service, and the layer drawing and synthesis can be realized through Surfaceflinger. For example, after the application is started, the application can create one or more layers, and Surfaceflinger can draw and synthesize one or more layers to obtain the image frame to be displayed.
[0077] Activity Management Service AMS is a system service that is mainly responsible for managing and coordinating the life cycle of application component Activities, handling operations such as application startup, switching, and stopping, as well as handling tasks related to task stack management and process management. For example, when a user switches from application A to application B, AMS will pause the current Activity of application A and resume the Activity of application B. Process management means that AMS decides when to create or destroy application processes based on application requirements and system resource conditions. Task stack management means that AMS maintains one or more task stacks, each of which contains a series of ordered Activities. Users can switch between Activities in a task stack by pressing the back key.
[0078] The hardware abstraction layer is an abstract structure between the kernel layer and the upper layer (such as the application framework layer and the application layer). For example, the hardware abstraction layer is an encapsulation of the kernel layer driver, shielding the underlying implementation details and providing a unified interface to the upper layer. The upper layer application does not need to pay attention to how the lower layer implements its work.
[0079] The kernel layer is the layer between hardware and software. The kernel layer may include the touch sensor driver (TP Driver) corresponding to the touch screen, the display driver (Display subsystem Driver, DSSDriver) corresponding to the display screen, and may also include the graphics processing unit (GPU) driver, sensor driver, etc.
[0080] The frame rate of a layer: refers to the frequency at which an application (Application, APP) writes layer data to the buffer (buffer), usually expressed as the number of frames per second (FPS) that the APP writes to the buffer per second. The synthesis frame rate of an electronic device: can represent the number of image frames synthesized per second by SurfaceFlinger in the electronic device. Optionally, in some scenarios, the value of the synthesis frame rate is equal to the value of the frequency at which SurfaceFlinger reads layer data from the buffer when drawing and synthesizing the layer, and can also be expressed as the number of frames of data read from the buffer by SurfaceFlinger per second. Optionally, the synthesis frame rate of an electronic device can be greater than or equal to the frame rate of the layer, and the synthesis frame rate can also be less than the frame rate of the layer. For example, Figure 3As shown, the first application writes data of the first layer to the buffer at a first frame rate, and SurfaceFlinger reads data of the first layer from the buffer at a second frame rate. Therefore, the frame rate of the first layer is the first frame rate, the composite frame rate of the electronic device is the second frame rate, and the second frame rate is greater than or equal to the first frame rate.
[0081] Screen refresh rate: refers to the number of times the display screen of an electronic device refreshes the screen per second, measured in Hz (Hertz). For example, a screen refresh rate of 60Hz means that the display screen can be refreshed 60 times in 1 second. The higher the screen refresh rate, the smoother the displayed image will be, but the power consumption will also be higher. Among them, the screen refresh rate can be adaptively adjusted according to the composite frame rate. For example, when the composite frame rate is 60FPS, the electronic device will adaptively adjust the screen refresh rate to 60Hz, and when the composite frame rate is 120FPS, the electronic device will adaptively adjust the screen refresh rate to 120Hz. Normally, the composite frame rate should match or be close to the screen refresh rate to obtain the best display effect.
[0082] In a multi-layer display scenario, since different layers require different synthesis frame rates, the electronic device will take the maximum frame rate required by the multiple layers for layer synthesis or set a fixed higher frame rate such as 60FPS, 90FPS or 120FPS for layer synthesis to be compatible with multiple layers requiring different synthesis frame rates. However, this will result in higher power consumption of the electronic device.
[0083] For example, on the main page of some third-party applications, there are often many small animations that refresh continuously. When the user does not perform any operation, these small animations are constantly refreshing, causing SurfaceFlinger to draw and synthesize at a frame rate of 60FPS. However, when the user clicks on a certain content on the main page and enters a new content page, the small animation layer is covered. The layer of the new content page is actually static, but the small animation layer is still involved in the synthesis, resulting in SurfaceFlinger still drawing and synthesizing at a frame rate of 60FPS when synthesizing the small animation layer and the layer of the new content page, which will result in higher power consumption.
[0084] For example, Figure 4 As shown, in the first time period T1, the electronic device displays a first interface 10 of a first application (for example, a life service application), and there is an animation 11 of opening a red envelope on the first interface 10, such as Figure 4aAs shown, the image frame of the first interface 10 is synthesized based on the first layer 13, and the first layer 13 includes the first control 131 corresponding to the animation 11 of opening a red envelope. The first application writes the data of the first layer 13 (including the data of the first control 131 corresponding to the animation 11 of opening a red envelope) to the first buffer at a frame rate of 30FPS. Therefore, SurfaceFlinger can use a frame rate of 30FPS to read the data of the first layer 13 from the first buffer for drawing and synthesis, so that the synthesis frame rate of the electronic device in the first time period T1 is 30FPS.
[0085] After the first time period T1, the electronic device responds to the user's click operation on the thumbnail 12 in the first interface 10, and the electronic device displays the following Figure 5 The second interface 20 shown, such as Figure 5a As shown, the first application writes the data of the first layer 13 to the first buffer at a frame rate of 30FPS, and writes the data of the second layer 14 to the second buffer at a frame rate of 1FPS. The first layer 13 is completely blocked by the second layer 14. In order to be compatible with the frame rate of the first layer 13 (30FPS) and the frame rate of the second layer 14 (1FPS), SurfaceFlinger reads the data of the first layer 13 from the first buffer at a frame rate of 30FPS, and reads the data of the second layer 14 from the second buffer at a frame rate of 1FPS, thereby synthesizing the image frame of the second interface 20 based on the first layer 13 and the second layer 14. In this way, although the first layer 13 is completely blocked by the second layer 14, in the second time period T2 for displaying the second interface 20, the synthesized frame rate of the electronic device is the maximum value of 30FPS and 1FPS, that is, the synthesized frame rate of the electronic device is still 30FPS, and the power consumption of the electronic device is relatively high.
[0086] To this end, an embodiment of the present application provides a display control method, which displays a first interface of a first application in a first time period, wherein the image frame of the first interface is synthesized based on a first layer, and in the first time period, the synthesis frame rate of the electronic device is a first value; after the first time period, in response to a first operation, the second interface of the first application is displayed, and the image frame of the second interface is drawn based on a second layer; in a second time period when the second interface is displayed, the synthesis frame rate of the electronic device is a second value, which is less than the first value, the level of the second layer is above the first layer, and the first layer is completely blocked by the second layer; in the second time period, the electronic device obtains data of the first layer, and the electronic device does not draw the first layer, so that the synthesis frame rate adopted by the electronic device is a smaller one, thereby reducing the power consumption of the electronic device.
[0087] For example, after the first time period T1, in response to the user clicking the thumbnail 12 in the first interface 10, the electronic device displays the following Figure 5 The second interface 20 shown, such as Figure 5a As shown, the first application writes the data of the first layer 13 to the first buffer at a frame rate of 30FPS, and writes the data of the second layer 14 to the second buffer at a frame rate of 1FPS. Since the first layer 13 is completely blocked by the second layer 14, and the frame rate of the first layer 13 (30FPS) is greater than the frame rate of the second layer 14 (1FPS), during the second time period T2 when the second interface 20 is displayed, although the first application still writes the data of the first layer 13 to the first buffer at a frame rate of 30FPS, SurfaceFlinger does not draw the first layer. In this way, SurfaceFlinger reads the data of the second layer 14 from the second buffer at a frame rate of 1FPS to draw the second layer 14, thereby obtaining the image frame of the second interface 20. In this way, during the second time period T2 when the second interface is displayed, the synthetic frame rate of the electronic device is 1FPS instead of 30FPS, thereby effectively reducing the power consumption of the electronic device.
[0088] In some embodiments, the display control method provided in the embodiments of the present application can be applied to electronic devices. Figure 6 1 is a schematic diagram of the structure of an electronic device 100 provided in an embodiment of the present application. The electronic device 100 can execute the display control method provided in an embodiment of the present application.
[0089] For example, the electronic device includes but is not limited to at least one of the following: a mobile phone, a vehicle-mounted device (also referred to as a car computer), a tablet computer, a laptop computer, an ultra-mobile personal computer (UMPC), a handheld computer, a netbook, a personal digital assistant (PDA), a wearable electronic device, and a virtual reality device. The embodiments of the present application do not impose any restrictions on this.
[0090] like Figure 6 As shown, the electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc.
[0091] It is to be understood that the structure illustrated in this embodiment does not constitute a specific limitation on the electronic device 100. In other embodiments, the electronic device 100 may include more or fewer components than shown in the figure, or combine some components, or separate some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
[0092] The processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.
[0093] The controller may be the nerve center and command center of the electronic device 100. The controller may generate an operation control signal according to the instruction operation code and the timing signal to complete the control of fetching and executing instructions.
[0094] The processor 110 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may store instructions or data that the processor 110 has just used or cyclically used. If the processor 110 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.
[0095] The charging management module 140 is used to receive charging input from a charger. While the charging management module 140 is charging the battery 142 , it can also power the electronic device through the power management module 141 .
[0096] The power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140 to power the processor 110, the internal memory 121, the external memory, the display screen 194, the camera 193, and the wireless communication module 160.
[0097] The wireless communication function of the electronic device 100 can be implemented by antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, modem processor and baseband processor. Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in the electronic device 100 can be used to cover a single or multiple communication frequency bands.
[0098] The mobile communication module 150 may provide solutions for wireless communications including 2G / 3G / 4G / 5G, etc., applied to the electronic device 100. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc.
[0099] The wireless communication module 160 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., which are applied to the electronic device 100. The wireless communication module 160 can be one or more devices integrating at least one communication processing module.
[0100] The electronic device 100 implements the display function through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs that execute program instructions to generate or change display information.
[0101] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), a light-emitting diode (LED), an organic light-emitting diode (OLED), an active-matrix organic light emitting diode or an active-matrix organic light emitting diode (AMOLED), a flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-oLed, a quantum dot light emitting diode (QLED), etc.
[0102] Among them, if the display screen 194 in the embodiment of the present application is integrated with a touch sensor, the display screen 194 can be a touch screen. The touch sensor can also be called a "touch panel". That is to say, the display screen 194 may include a display panel and a touch panel, and the touch sensor and the display screen 194 form a touch screen, also known as a "touch screen". The touch sensor is used to detect touch operations acting on or near it. After the touch sensor detects a touch operation, it can trigger the driver of the kernel layer (such as the TP driver) to periodically scan the touch parameters generated by the touch operation. Then, the driver of the kernel layer passes the touch parameters to the relevant modules of the upper layer so that the relevant modules can determine the touch event type corresponding to the touch parameters.
[0103] In addition, the display screen 194 can provide visual output related to the touch operation. In other embodiments, the touch sensor can also be arranged on the surface of the electronic device 100 instead of being integrated in the display screen 194. In this case, the position of the touch sensor and the display screen 194 can be different. In the embodiment of the present application, the specific process of the method for adjusting the TP sampling rate is described by taking the touch screen as a display screen integrated with a touch sensor as an example.
[0104] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 through the external memory interface 120 to implement a data storage function. For example, files such as music and videos are stored in the external memory card. The internal memory 121 can be used to store computer executable program codes, which include instructions. The processor 110 executes various functional applications and data processing of the electronic device 100 by running the instructions stored in the internal memory 121.
[0105] The electronic device 100 can implement audio functions through an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, a headphone jack 170D, and an application processor. For example, music playback, recording, etc. The audio module 170 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signals. The audio module 170 can also be used to encode and decode audio signals. The speaker 170A, also known as a "speaker", is used to convert audio electrical signals into sound signals. The receiver 170B, also known as a "earpiece", is used to convert audio electrical signals into sound signals. The microphone 170C, also known as a "microphone" or "microphone", is used to convert sound signals into electrical signals. The headphone jack 170D is used to connect wired headphones.
[0106] The button 190 includes a power button, a volume button, etc. The button 190 can be a mechanical button. It can also be a touch button. The electronic device 100 can receive the button input and generate a key signal input related to the user settings and function control of the electronic device 100. The motor 191 can generate a vibration prompt. The motor 191 can be used for incoming call vibration prompts, and can also be used for touch vibration feedback. The indicator 192 can be an indicator light, which can be used to indicate the charging status, power changes, messages, missed calls, notifications, etc. The SIM card interface 195 is used to connect the SIM card. The SIM card can be inserted into the SIM card interface 195, or pulled out from the SIM card interface 195 to achieve contact and separation with the electronic device 100. The electronic device 100 can support 1 or N SIM card interfaces, N is a positive integer greater than 1. The SIM card interface 195 can support Nano SIM cards, Micro SIM cards, SIM cards, etc.
[0107] The method in the embodiment of the present application can be applied to but not limited to the electronic device 100 having the above hardware structure.
[0108] See also Figure 7 , Figure 7 : is a flow chart of a display control method provided by an embodiment of the present application. The method may include part or all of the following contents, and the following part or all of the contents are explained by taking the second application as APS as an example: S101. AMS sends a first application to APS.
[0109] Optionally, when executing step S101, the first application is an application running in the foreground. Optionally, in some embodiments, the AMS may send identification information of all applications running in the foreground to the APS.
[0110] In some embodiments, in response to the first application being started or the first application being switched from background operation to foreground operation, the AMS sends identification information of the first application to the APS. The first application may be any application in the electronic device, for example, the first application is a shopping application in the electronic device. The identification information of the first application is used to uniquely identify the first application, and the identification information may be a package name or a process ID.
[0111] For example, when the first application is started, the electronic device runs the started first application in the foreground, and the AMS sends the identification information of the first application to the APS. For another example, when the third application running in the background of the electronic device is switched to the foreground, the AMS sends the identification information of the third application to the APS.
[0112] S102: The APS determines whether the application whitelist includes the first application.
[0113] Optionally, the application whitelist includes one or more applications in the target scene. Further, the application whitelist includes identification information of one or more applications in the target scene. Wherein, the target scene includes the top layer completely blocking the non-top layer, and the frame rate of the non-top layer is greater than the frame rate of the top layer, or the top layer partially blocks the non-top layer, and all controls in the non-top layer whose frame rate is greater than the frame rate of the top layer are blocked by the top layer.
[0114] In some embodiments, the APS determines whether the application whitelist includes identification information of the first application. When the application whitelist includes identification information of the first application, it determines that the application whitelist includes the first application; when the application whitelist does not include identification information of the first application, it determines that the application whitelist does not include the first application.
[0115] In some embodiments, the application whitelist in the APS is pre-set. For example, the developer screens out applications with target scenarios, thereby pre-establishing an application whitelist including identification information of applications with target scenarios, and then sets the application whitelist in the APS.
[0116] In some embodiments, the application whitelist in the APS can be automatically updated by the electronic device. For example, the third application in the application whitelist has a target scenario before the version is updated, and due to the version update, the third application does not have the target scenario after the version is updated. The server automatically deletes the identification information of the third application in the application whitelist, obtains a new application whitelist, and sends the new application whitelist to the electronic device, which updates the application whitelist in the APS to the latest application whitelist.
[0117] In some embodiments, after an application in an electronic device is updated, the electronic device determines whether the updated version of the application has a target scenario; if the updated version of the application has a target scenario and the updated version of the application is not included in the application whitelist, the identification information of the updated version of the application is added to the application whitelist; if the updated version of the application does not have a target scenario and the updated version of the application is included in the application whitelist, the identification information of the updated version of the application is deleted from the application whitelist; if the updated version of the application has a target scenario and the updated version of the application is included in the application whitelist or the updated version of the application does not have a target scenario and the updated version of the application is not included in the application whitelist, the application whitelist remains unchanged.
[0118] S103: If the application whitelist includes the first application, the APS sets the value of the first flag bit to a first preset value.
[0119] The first flag indicates whether the application in the application whitelist is currently running in the foreground; optionally, in this embodiment, because the application running in the foreground is the first application, the first flag can indicate whether the first application is included in the application whitelist. When the value of the first flag is the first preset value, such as true, it indicates that the application whitelist includes the first application, that is, the application whitelist contains an application currently running in the foreground; when the value of the first flag is the second preset value, such as false, it indicates that the application whitelist does not include the first application, that is, the application whitelist does not contain an application currently running in the foreground. Among them, the specific style of the first flag can be set based on actual conditions, and the embodiments of the present application do not make specific limitations on this. For example, the first flag is isWhiteListAppRunning.
[0120] S104. The APS sends a second flag bit to the SF.
[0121] At this time, the value of the second flag is a third preset value. The second flag indicates whether SF needs to send the layer information to APS. When the value of the second flag is the third preset value, such as true, it indicates that SF needs to send the layer information to APS. When the value of the second flag is a fourth preset value, such as false, it indicates that SF does not need to send the layer information to APS. The specific style of the second flag can be set based on actual conditions, and the embodiment of the present application does not specifically limit this.
[0122] In some embodiments, when SF receives the second flag bit sent by APS, it saves the second flag bit, or sets the third flag bit, and sets the value of the third flag bit to the fifth preset value. For example, when the value of the second flag bit received by SF is true, the second flag bit is saved, and the value of the second flag bit is true, or a third flag bit different from the second flag bit is set, and the value of the third flag bit is set to true. Among them, the third flag bit indicates whether SF needs to send the layer information to APS, the value of the third flag bit is the fifth preset value, such as true, which means that SF needs to send the layer information to APS, and the value of the third flag bit is the sixth preset value, such as false, which means that SF does not need to send the layer information to APS.
[0123] In some embodiments, the APS sends a first message to the SF, and the first message is used to indicate that the value of the second flag position is a first preset value. Correspondingly, the SF sets the value of the second flag position to the first preset value according to the first message. It is understandable that before the SF receives the first message, the value of the second flag position in the SF is false.
[0124] Optionally, combined Figure 7 It can be seen from the flow chart of the display control method shown that the method provided in the embodiment of the present application may also include steps S105 to S109. Optionally, there is no necessary timing relationship between steps S105 to S109 and steps S101 to S104, and steps S105 to S109 may be executed before, after or simultaneously with any one of steps S101 to S104.
[0125] S105. In response to the layer change, the SF determines whether the value of the second flag bit is a third preset value, and if the value of the second flag bit is the third preset value, sends the layer information of the first application to the APS.
[0126] In some embodiments, in response to a layer change and the value of the second flag bit being a third preset value, the SF sends layer information of all applications running in the foreground to the APS.
[0127] Optionally, in response to a layer change, the SF determines whether the value of the third flag bit is a fifth preset value, and if the value of the third flag bit is the fifth preset value, sends the layer information of the first application to the APS.
[0128] In some embodiments, the layer information includes the position information and frame rate of the layer, the position information of the layer is used to indicate the position of the layer during synthesis, and the frame rate of the layer is used to indicate the frame rate required for the layer during synthesis. Further, the layer information may also include the layer level information and layer name, etc., and the layer level information may be a zIndex value.
[0129] In some embodiments, when SF creates a new layer or destroys a layer, it executes step 105. The new layer is implemented based on the new layer function NewLayer(), and the layer is destroyed based on the destroy layer function DeleteLayer(), that is, when SF calls the new layer function NewLayer() or the destroy layer function DeleteLayer(), it sends the layer information of the first application to the APS. For example, Figure 4 As shown, when the user clicks on the thumbnail 12 in the first interface 10, the SF calls the new layer function NewLayer() to create a layer corresponding to the content details of the thumbnail 12, and the SF sends a Figure 5a The layer information of the first layer 13 and the second layer 14 in the.
[0130] In some embodiments, sending the layer information of the first application to the APS may include: the SF sending the layer information of each layer of the multiple layers of the first application to the APS in descending order of hierarchy. Figure 5a As shown, the first application includes two layers, a first layer 13 and a second layer 14. The level information of the first layer 13 and the second layer 14 are respectively represented as: 0, 1, that is, the level of the second layer 14 is above the first layer 13. Therefore, SF first sends the layer information of the second layer 14 to APS, and then sends the layer information of the first layer 13 to APS.
[0131] In some embodiments, sending the layer information of the first application to the APS may include: the SF sends the layer information of each layer of the multiple layers of the first application to the APS in order from low to high levels. Figure 5a As shown, the first application includes two layers, a first layer 13 and a second layer 14. The level information of the first layer 13 and the second layer 14 are respectively represented as: 0, 1, that is, the level of the second layer 14 is above the first layer 13. Therefore, SF first sends the layer information of the first layer 13 to APS, and then sends the layer information of the second layer 14 to APS.
[0132] In some embodiments, sending the layer information of the first application to the APS may include: the SF sends the layer information of multiple layers of the first application to the APS together. The layer information includes the location information, frame rate and level information of the layer. For example, Figure 5a As shown, the first application includes two layers, namely a first layer 13 and a second layer 14. Therefore, the SF sends the layer information of the first layer 13 and the second layer 14 together to the APS.
[0133] In some embodiments, in response to a layer change, the SF determines whether the value of the second flag bit is a third preset value, and if the value of the second flag bit is a fourth preset value, the layer information of the first application is not sent to the APS. In this embodiment, when the value of the second flag bit in the SF is the fourth preset value, it indicates that the layer information of the first application does not need to be sent to the APS, and therefore the layer information of the first application is not sent to the APS, thereby reducing communication overhead.
[0134] S106. The APS determines whether the first application has multiple layers based on the layer information.
[0135] In some embodiments, the APS determines whether there are multiple layer information in the layer information queue; if there are multiple layer information in the layer information queue, it is determined that the first application has multiple layers; if there is one layer information in the layer information queue, it is determined that the first application has one layer.
[0136] In some embodiments, each time the APS receives a layer information, it stores the received layer information in the layer information queue in sequence. The level of the earlier layer information in any two adjacent layer information in the layer information queue is higher than the level of the later layer information.
[0137] For example, Figure 5a As shown, SF first sends the layer information Layer message2 of the second layer 14 to APS, and then sends the layer information Layer message1 of the first layer 13 to APS. Therefore, APS first receives the layer information Layermessage2 of the second layer 14, and then receives the layer information Layer message1 of the first layer 13. Therefore, when Layer message2 is received, Layer message2 is stored at the first position of the empty layer information queue to update the layer information queue. When Layermessage1 is received, Layermessage1 is stored at the next position of Layermessage3 in the layer information queue to obtain the final layer information queue [Layermessage2, Layer message1].
[0138] In some embodiments, the level of the layer in the first layer information of any two adjacent layer information in the layer information queue is lower than the level of the layer in the second layer information. Figure 5aAs shown, SF first sends the layer information Layer message1 of the first layer 13 to APS, and then sends the layer information Layermessage2 of the second layer 14 to APS. Therefore, APS first receives the layer information Layer message1 of the first layer 13, and then receives the layer information Layermessage2 of the second layer 14. In this way, when Layer message1 is received, Layer message1 is stored at the first position of the empty layer information queue to update the layer information queue. When Layermessage2 is received, Layermessage2 is stored at the next position of Layer message1 in the layer information queue to obtain the final layer information queue [Layer message1, Layermessage2].
[0139] In some embodiments, the layer information of the first application is sent to the APS together with the SF, and the APS determines whether the first application has multiple layers according to the layer information, which may include: the APS determines whether there are multiple different layer identifiers in the received layer information; if there are multiple different layer identifiers in the received layer information, it is determined that the first application has multiple layers; if there is one layer identifier in the received layer information, it is determined that the first application has one layer. The layer identifier may include a layer name or a layer ID.
[0140] For example, Figure 5a As shown, the first application includes two layers, a first layer 13 and a second layer 14. Therefore, SF sends the layer information Layer message1 of the first layer 13 and the layer information Layermessage2 of the second layer 14 to APS. APS obtains Layer message1 and Layermessage2. Since Layer message1, Layermessage2 and Layer message3 contain the layer identifier of the first layer 13 and the layer identifier of the second layer 14, and these two layer identifiers are different, it is determined that the first application has multiple (two) layers.
[0141] S107: If the first application has multiple layers, the APS determines whether the non-top-layer is completely blocked by the top-layer according to the layer information of the top-layer and the layer information of the non-top-layer among the multiple layers.
[0142] The top layer is the highest layer among the multiple layers of the first application, and the non-top layer is a layer of a lower level than the top layer among the multiple layers of the first application. Optionally, the non-top layer is not completely blocked by the top layer, which means that at least part of the coverage area of the non-top layer is outside the coverage area of the top layer or the top layer is transparent, and the non-top layer is completely blocked by the top layer, which means that the entire coverage area of the non-top layer is within the coverage area of the top layer, and the top layer is opaque. For example, Figure 5a As shown, the second layer 14 is a top-layer, and the first layer 13 is a non-top-layer. Since the entire coverage area of the first layer 13 is located in the coverage area of the second layer 14 and the second layer 14 is opaque, the first layer 13 is completely blocked by the second layer 14.
[0143] In some embodiments, the APS determines whether the non-top-layer is completely blocked by the top-layer according to the layer information of the top-layer and the layer information of the non-top-layer among the multiple layers, which may include: the APS obtains the first layer information in the layer information queue as the layer information of the top-layer, and sequentially uses the layer information after the first layer information in the layer information queue as the layer information of the non-top-layer, or obtains the last layer information in the layer information queue as the layer information of the top-layer, and sequentially uses the layer information before the last layer information in the layer information queue as the layer information of the non-top-layer; for each non-top-layer, according to the position information in the layer information of the non-top-layer and the position information in the layer information of the top-layer, determines whether the non-top-layer is completely covered by the top-layer and determines whether the top-layer is opaque; if the non-top-layer is completely covered by the top-layer and the top-layer is opaque, it is determined that the non-top-layer is completely blocked by the top-layer; if the non-top-layer is completely covered by the top-layer and the top-layer is transparent or the non-top-layer is not completely covered by the top-layer, it is determined that the non-top-layer is not completely blocked by the top-layer.
[0144] In some embodiments, taking the case where both the top-level layer and the non-top-level layer are rectangular layers as an example, the position information in the layer information of the top-level layer includes the coordinates of the first vertex and the second vertex of the top-level layer, and the position information in the layer information of the non-top-level layer includes the coordinates of the third vertex and the fourth vertex of the non-top-level layer. Determining whether the non-top-level layer is covered by the top-level layer based on the position information in the layer information of the non-top-level layer and the position information in the layer information of the top-level layer may include: determining a first coverage area of the top-level layer based on the coordinates of the first vertex and the coordinates of the second vertex, and determining a second coverage area of the non-top-level layer based on the coordinates of the third vertex and the coordinates of the fourth vertex; if the second coverage area is completely located within the first coverage area, determining that the non-top-level layer is completely covered by the top-level layer; if at least part of the second coverage area is located outside the first coverage area, determining that the non-top-level layer is not completely covered by the top-level layer.
[0145] Optionally, the first vertex is the upper left vertex of the second layer, the second vertex is the lower right vertex of the second layer, the third vertex is the upper left vertex of the first layer, and the fourth vertex is the lower right vertex of the first layer. Alternatively, the first vertex is the lower left vertex of the second layer, the second vertex is the upper right vertex of the second layer, the third vertex is the lower left vertex of the first layer, and the fourth vertex is the upper right vertex of the first layer. For example, the coordinates of the upper left vertex of the second layer are (a 1 , b 1 ), the coordinates of the lower right vertex of the second layer are (a 2 , b 2 ), the coordinates of the upper left vertex of the first layer are (c 1 , d 1 ), the coordinates of the lower right vertex of the first layer are (c 2 , d 2 ). Optionally, the coordinates of the above vertices are coordinates in the screen coordinate system. The screen coordinate system is a rectangular coordinate system with the upper left corner of the screen as the origin, the right as the positive direction of the x-axis, and the downward as the positive direction of the y-axis. Therefore, if a 1 Less than or equal to c 1 , and b 1 Less than or equal to d 1 and coordinates a 2 Greater than or equal to c 2 , and b 2 Greater than or equal to d 2 , that is, the entire coverage area of the non-top layer is within the coverage area of the top layer, then it is determined that the first layer is completely covered by the second layer. At the same time, the second layer is opaque, then it can be determined that the first layer is completely blocked by the second layer. If a 1 Greater than c 1 、b 1 Greater than d 1 、a 2Less than c 2 and / or b 2 Less than d 2, That is, if at least part of the coverage area of the non-top layer is outside the coverage area of the top layer, it is determined that the non-top layer is not completely covered by the top layer. In this case, the first layer is not completely blocked by the second layer.
[0146] In some embodiments, determining whether the top-layer is opaque may include: APS communicates with SF to obtain an image frame to be displayed, the image frame to be displayed is synthesized based on the top-layer and the non-top-layer; extracting multiple uniformly distributed pixels from the image frame to be displayed, and reading the transparency of the multiple pixels; determining whether the transparency of the multiple pixels is greater than or equal to a preset threshold; if the transparency of the multiple pixels is greater than or equal to the preset threshold, the top-layer is determined to be opaque; if the transparency of some of the multiple pixels is less than the preset threshold, the top-layer is determined to be transparent. The preset threshold can be set based on actual conditions, and this embodiment does not specifically limit this. For example, the preset threshold is 255, that is, the transparency of the multiple pixels is equal to 255, and the top-layer is determined to be opaque. The transparency of some of the multiple pixels is less than 255, and the top-layer is determined to be transparent. Optionally, the preset threshold may also be other values, for example, the preset threshold includes 254, 251, 248, 245 or 240.
[0147] For example, Figure 8 As shown, 10 pixels evenly distributed on the central horizontal axis 31 and the central vertical axis 32 of the image frame 30 to be displayed are extracted respectively, and the transparency of the 10 pixels on the central horizontal axis 31 and the transparency of the 10 pixels on the central vertical axis 32 are read. If the transparency of the 10 pixels on the central horizontal axis 31 and the transparency of the 10 pixels on the central vertical axis 32 are both equal to 255, it is determined that the top layer is opaque. It is understandable that other methods can also be used to evenly extract multiple pixels from the image frame to be displayed. For example, evenly distributed multiple pixels are extracted from each row and / or each column in the image frame to be displayed.
[0148] S108: If the non-top-layer is completely blocked by the top-layer, the APS determines whether the frame rate in the layer information of the non-top-layer is greater than the frame rate in the layer information of the top-layer.
[0149] The frame rate in the layer information of the top layer is the frame rate required when the top layer is synthesized, that is, the frame rate used by Surfaceflinger when synthesizing the top layer needs to be greater than or equal to the frame rate required when the top layer is synthesized. The frame rate in the layer information of the non-top layer is the frame rate required when the non-top layer is synthesized, that is, the frame rate used by Surfaceflinger when synthesizing the non-top layer needs to be greater than or equal to the frame rate required when the non-top layer is synthesized. For example, Figure 5a As shown, the second layer 14 is a top layer, the first layer 13 is a non-top layer, and the second layer 14 completely covers the first layer 13 , then it is determined whether the frame rate of the first layer 13 is greater than the frame rate of the second layer 14 .
[0150] S109: If the frame rate in the layer information of the non-top layer is greater than the frame rate in the layer information of the top layer, the APS sends a control command to the SF.
[0151] For example, Figure 5a As shown, the frame rate of the second layer 14 is 1FPS, and the frame rate of the first layer 13 is 30FPS. Since the second layer 14 completely blocks the first layer 13, and the frame rate of the first layer 13 is greater than the frame rate of the second layer 14, the APS sends a control command to the SF.
[0152] Optionally, if the frame rate in the layer information of the non-top layer is greater than the frame rate in the layer information of the top layer, APS determines whether the value of the fourth flag bit is the seventh preset value; if the value of the fourth flag bit is the seventh preset value, APS sends a control command to SF. Among them, if the value of the fourth flag bit is the eighth preset value, APS sets the value of the fourth flag bit to the seventh preset value. The fourth flag bit indicates whether the non-top layer of the first application is not drawn. When the value of the fourth flag bit is the seventh preset value, such as true, it indicates that the non-top layer of the first application does not need to be drawn. When the value of the fourth flag bit is the eighth preset value, such as false, it indicates that the non-top layer of the first application needs to be drawn.
[0153] In some embodiments, when SF receives the control command, it saves the fourth flag bit and sets the value of the fourth flag bit to the seventh preset value; or creates a fifth flag bit and sets the value of the fifth flag bit to the ninth preset value. The fifth flag bit indicates whether SF does not draw the non-top-level layers of the first application. When the value of the fifth flag bit is the ninth preset value, such as true, it indicates that SF does not need to draw the non-top-level layers of the first application. When the value of the fifth flag bit is the tenth preset value, such as false, it indicates that SF needs to draw the non-top-level layers of the first application.
[0154] Optionally, combined Figure 7It can be seen from the flow chart of the display control method that the method provided in the embodiment of the present application may also include step S110. There is no necessary timing relationship between step S110 and steps S105 to S109. Step S110 may be executed before, after or simultaneously with any step in steps S105 to S109.
[0155] S110. In response to the call of the layer drawing function, and the layer to be drawn is a non-top-level layer, SF determines whether the value of the fourth flag bit is a seventh preset value. If so, the non-top-level layer is not drawn.
[0156] Optionally, the layer drawing function is onDraw(), that is, after SF receives the control command, when the onDraw() function is called, and the layer to be drawn is a non-top layer, and the value of the fourth flag is true, SF directly returns without drawing the non-top layer, so that the frame rate used by SF when synthesizing the layer will not take into account the frame rate of the non-top layer that is not drawn, so that the frame rate used by SF synthesis is lower than the frame rate of the non-top layer, thereby reducing the power consumption of the electronic device. When the onDraw() function is called, and the layer to be drawn is a non-top layer, and the value of the fourth flag is false, SF draws the non-top layer.
[0157] For example, SF calls the layer drawing function onDraw(), and the layer to be drawn is Figure 5a , and the value of the fourth flag is true, SF returns directly without drawing the first layer 13. In this way, SF only needs to draw the second layer 14 when synthesizing the layers. Therefore, the frame rate used by SF does not consider the frame rate of the first layer 13, but needs to consider the frame rate of the second layer 14. The frame rate of the first layer 13 is 30FPS, and the frame rate of the second layer 14 is 1FPS. In this way, SF uses a frame rate of 1FPS to draw and synthesize the second layer 14, instead of synthesizing at a frame rate of 30FPS, thereby reducing the power consumption of the electronic device.
[0158] Optionally, combined Figure 7 It can be seen from the flow chart of the display control method shown that the method provided in the embodiment of the present application may also include steps S111 to S117. There is no necessary timing relationship between steps S111 to S117 and step S110. Steps S111 to S117 may be executed before, after or simultaneously with step S110.
[0159] S111. If the frame rate in the layer information of the non-top layer is less than or equal to the frame rate in the layer information of the top layer, the APS determines whether the value of the fourth flag bit is a seventh preset value.
[0160] It can be understood that if the frame rate in the layer information of the non-top layer is less than or equal to the frame rate in the layer information of the top layer, it means that the non-top layer does not need to be controlled, and by judging whether the value of the fourth flag bit is the seventh preset value, it can be determined whether the non-top layer has been controlled before, that is, when the value of the fourth flag bit is the seventh preset value, it means that the non-top layer has been controlled before, and when the value of the fourth flag bit is the eighth preset value, it means that the non-top layer has not been controlled before. Optionally, if the frame rate in the layer information of the non-top layer is less than or equal to the frame rate in the layer information of the top layer, the APS may not judge whether the value of the fourth flag bit is the seventh preset value, and directly send a command to cancel the control to the SF.
[0161] S112: If the value of the fourth flag bit is the seventh preset value, the APS sends a command to cancel the control to the SF.
[0162] It can be seen from the fact that the frame rate of the non-top-level layer is less than or equal to the frame rate of the top-level layer, and the value of the fourth flag bit is the seventh preset value that the non-top-level layer has been controlled before, so a command to cancel control is sent to SF, so that SF cancels the control of the non-top-level layer. Among them, if the frame rate in the layer information of the non-top-level layer is less than or equal to the frame rate in the layer information of the top-level layer, and the value of the fourth flag bit is the eighth preset value, APS does not process it.
[0163] Optionally, if the value of the fourth flag bit is the seventh preset value, the APS sets the value of the fourth flag bit to the eighth preset value and sends a command to cancel the control to the SF.
[0164] In some embodiments, when SF receives a command to cancel control, it sets the value of the fourth flag to the eighth preset value, or sets the value of the fifth flag to the tenth preset value. When SF calls the layer drawing function, and the layer to be drawn is a non-top layer, and the value of the fourth flag is the eighth preset value, SF draws the non-top layer. For example, when SF calls the onDraw() function, and the layer to be drawn is Figure 5a When the first layer 13 (non-top layer) in the image is drawn and the value of the fourth flag is false, SF draws the first layer 13.
[0165] S113: If the non-top-layer is partially blocked by the top-layer, the APS traverses all controls on the non-top-layer to see whether there is a control that is not blocked by the top-layer and whose frame rate is greater than the frame rate of the top-layer.
[0166] Optionally, the non-top-layer is partially obscured by the top-layer, that is, the non-top-layer is not completely obscured by the top-layer.
[0167] The frame rate of a control refers to the frequency at which the first application writes data of the control into the buffer. Optionally, the data of a layer may include data of one or more controls. For example, the first layer (non-top-level layer) includes the first control and the second control. The first application writes the data of the first control into buffer1 at a frame rate of 30FPS and writes the data of the second control into buffer2 at a frame rate of 1FPS. Therefore, the frame rate of the first control is 30FPS and the frame rate of the second control is 1FPS.
[0168] It can be understood that if the following conditions are met: there are controls in the non-top layer that are not blocked by the top layer, and the frame rate of the control is greater than the frame rate of the top layer, then it means that there are controls in the non-top layer whose frame rate is greater than that of the top layer and are not blocked by the top layer; if the following conditions are not met: there are controls in the non-top layer that are not blocked by the top layer, and the frame rate of the control is greater than the frame rate of the top layer, then it means that all controls in the non-top layer whose frame rate is greater than that of the top layer are blocked by the top layer.
[0169] In some embodiments, if a control is found in a non-top-layer layer that is not blocked by the top-layer layer, and the frame rate of the control is greater than the frame rate of the top-layer layer, and all controls in the non-top-layer layer have not been traversed, the traversal is stopped. In this embodiment, the traversal is stopped when a control is found in a non-top-layer layer that is not blocked by the top-layer layer, and the frame rate of the control is greater than the frame rate of the top-layer layer, and all controls in the non-top-layer layer do not need to be traversed, thereby reducing the traversal time.
[0170] In some embodiments, traversing all controls on non-top-layers to determine whether there is a control that is not blocked by the top-layer and whose frame rate is greater than that of the top-layer is to determine whether all controls in non-top-layers whose frame rate is greater than that of the top-layer are blocked by the top-layer. Therefore, it can be determined whether all controls in non-top-layers whose frame rate is greater than that of the top-layer are blocked by the top-layer according to the layer information of the first application. Exemplarily, according to the layer information of the first application, traversing all controls on non-top-layers to determine whether there is a control that is not blocked by the top-layer and whose frame rate is greater than that of the top-layer.
[0171] In some embodiments, traversing all controls on non-top-level layers to determine whether there is a control that is not blocked by the top-level layer and whose frame rate is greater than that of the top-level layer may include: traversing all controls on non-top-level layers to determine whether there is a control that is not blocked by the top-level layer and whose frame rate is greater than that of the top-level layer according to the layer information of the non-top-level layer and the layer information of the top-level layer. This embodiment can accurately determine whether there is a control that is not blocked by the top-level layer and whose frame rate is greater than that of the top-level layer among all controls on non-top-level layers through the layer information of the non-top-level layer and the layer information of the top-level layer.
[0172] In some embodiments, the layer information of the non-top-layer includes the position information and frame rate of each control in the non-top-layer, and the layer information of the top-layer includes the position information and frame rate of the top-layer. According to the layer information of the non-top-layer and the layer information of the top-layer, traversing all the controls on the non-top-layer to see whether there is a control that is not blocked by the top-layer, and the frame rate of the control is greater than the frame rate of the top-layer may include: for any control on the non-top-layer, determining whether the control is not blocked by the top-layer according to the position information of the control in the non-top-layer and the position information of the top-layer, and determining the frame rate of the control Is it greater than the frame rate of the top layer? If the control is not blocked by the top layer and the frame rate of the control is greater than the frame rate of the top layer, stop traversal. If the control is not blocked by the top layer and the frame rate of the control is less than or equal to the frame rate of the top layer, or if the control is blocked by the top layer and the frame rate of the control is greater than the frame rate of the top layer, or if the control is blocked by the top layer and the frame rate of the control is less than or equal to the frame rate of the top layer, continue to traverse the next control until there is a control in the non-top layer that is not blocked by the top layer and the frame rate of the control is greater than the frame rate of the top layer or all controls in the non-top layer are traversed.
[0173] Optionally, the control is blocked by the top layer, which means that the entire coverage area of the control is completely located in the coverage area of the top layer, and the coverage area corresponding to the position information of the control in the top layer is opaque. The control is not blocked by the top layer, which means that at least part of the coverage area of the control is located outside the coverage area of the top layer or the coverage area corresponding to the position information of the control in the top layer is transparent.
[0174] In some embodiments, taking a rectangular layer as an example, the position information in the layer information of the top-level layer includes the coordinates of the first vertex and the coordinates of the second vertex of the top-level layer. Taking a rectangular control as an example, the position information of the control includes the coordinates of the fifth vertex and the coordinates of the sixth vertex of the control. According to the position information of the control in the non-top-level layer and the position information of the top-level layer, determining whether the control is not blocked by the top-level layer may include: determining the first coverage area of the top-level layer according to the coordinates of the first vertex and the coordinates of the second vertex; determining the third coverage area of the control according to the coordinates of the fifth vertex and the coordinates of the sixth vertex; if the third coverage area is completely located in the first coverage area, determining whether the coverage area corresponding to the position information of the control in the top-level layer is opaque; if the coverage area corresponding to the position information of the control in the top-level layer is opaque, determining that the control is blocked by the top-level layer; if the coverage area corresponding to the position information of the control in the top-level layer is transparent or if at least part of the third coverage area is located outside the first coverage area, determining that the control is not blocked by the top-level layer.
[0175] S114. If the following conditions are not met: there are controls in the non-top-layer that are not blocked by the top-layer, and the frame rate of the controls is greater than the frame rate of the top-layer, then the APS sends the frame rate of the top-layer to the SF.
[0176] It is understandable that if the following conditions are not met: there is a control in the non-top-level layer that is not blocked by the top-level layer, and the frame rate of the control is greater than the frame rate of the top-level layer, that is, all controls in the non-top-level layer whose frame rate is greater than the frame rate of the top-level layer are blocked by the top-level layer. Fig. 9 As shown, the first layer 13 (non-top layer) includes the first control 131 and the second control 132, the frame rate of the first control 131 is 30FPS, the frame rate of the second control 132 is 1FPS, and the frame rate of the third layer 15 (top layer) is 1FPS, then the frame rate of the first control 131 is greater than the frame rate of the third layer 15 (top layer), the frame rate of the second control 132 is the same as the frame rate of the third layer 15, and the area A in the first layer 13 blocked by the third layer 15 includes the first control 131, but does not include the second control 132, then the APS sends the frame rate of the third layer 15 to the SF, and the SF synthesizes the first layer 13 and the third layer 15 at the frame rate of the third layer 15, that is, 1FPS, and the synthesis frame rate of the electronic device is 1FPS instead of 30FPS, thereby reducing the power consumption of the electronic device. Of course, the SF can also use a synthesis frame rate greater than 1FPS to synthesize the first layer 13 and the third layer 15, for example, using 2FPS to synthesize the first layer 13 and the third layer 15.
[0177] Optionally, if the following conditions are not met: there are controls in the non-top-level layers that are not blocked by the top-level layer, and the frame rate of the controls is greater than the frame rate of the top-level layer, then the APS sends a frame rate setting message to the SF, where the frame rate setting message is used to instruct the SF to set the composite frame rate of the multiple layers of the first application to the frame rate of the top-level layer; upon receiving the frame rate setting message, the SF sets the composite frame rate of the multiple layers of the first application to the frame rate of the top-level layer.
[0178] In some embodiments, SF sets the composite frame rate of multiple layers of the first application to the frame rate of the top-level layer, including: SF sets a timer according to the frame rate of the top-level layer; if SF obtains a non-top-level layer and the timer has not expired, SF does not draw the non-top-level layer; if SF obtains a non-top-level layer and the timer has expired, SF draws the non-top-level layer and resets the timer. For example, if the frame rate of the top-level layer is 1 frame per second, a timer with a timer of 1 second is set, if SF obtains a non-top-level layer and the timer has not expired, SF does not draw the non-top-level layer, if SF obtains a non-top-level layer and the timer has expired, SF draws the non-top-level layer and resets the timer with a timer of 1 second.
[0179] S115. If the following conditions are met: there is a control in the non-top-layer that is not blocked by the top-layer, and the frame rate of the control is greater than the frame rate of the top-layer, the APS sends the maximum frame rate of the frame rates of the multiple layers to the SF.
[0180] For example, Fig.10 As shown, the first layer 13 (non-top layer) includes the first control 131 and the second control 132, the frame rate of the first control 131 is 30FPS, the frame rate of the second control 132 is 1FPS, and the frame rate of the fourth layer 16 (top layer) is 1FPS, then the frame rate of the first control 131 is greater than the frame rate of the third layer 15 (top layer), the frame rate of the second control 132 is the same as the frame rate of the fourth layer 16, and the area B of the first layer 13 blocked by the fourth layer 16 does not include the first control 131, but includes the second control 132, the frame rate of the first layer 13 is the maximum value of the frame rate of the first control 131 and the frame rate of the second control 132, that is, the frame rate of the first layer 13 is 30FPS, therefore, APS sends 30FPS to SF, and SF synthesizes the first layer 13 and the fourth layer 16 at 30FPS. Of course, SF can also use a frame rate greater than the maximum value of the frame rate of the first control 131 and the frame rate of the second control 132 to synthesize the first layer 13 and the fourth layer 16. For example, SF uses 31FPS to synthesize the first layer 13 and the fourth layer 16.
[0181] S116: If the application whitelist does not include the first application, the APS resets the values of the first flag bit and the second flag bit.
[0182] At this time, the reset first flag is the second preset value, and the reset second flag is the fourth preset value. For example, APS resets the values of the first flag and the second flag to false. Optionally, if the application whitelist does not include the first application, APS resets the values of the first flag, the second flag, and the fourth flag. For example, the values of the first flag, the second flag, and the fourth flag are reset to false.
[0183] S117. APS sends the reset second flag bit to SF.
[0184] When SF receives the reset second flag, it sets the previously saved value of the second flag to false, or sets the previously created value of the third flag to false.
[0185] Optionally, the APS sends the reset fourth flag to the SF. When the SF receives the reset fourth flag, it sets the previously saved value of the fourth flag to false, or sets the previously created value of the fifth flag to false.
[0186] Some embodiments of the present application also provide an electronic device, the electronic device comprising: a memory and one or more processors. The memory and the processor are coupled. The memory is used to store computer program code, the computer program code including computer instructions. When the processor executes the computer instructions, the electronic device can perform the various functions or steps performed by the electronic device in the above method embodiment. The structure of the electronic device can refer to Figure 6 The structure of the electronic device 100 is shown.
[0187] The embodiment of the present application also provides a chip system, which includes at least one processor and at least one interface circuit. The processor and the interface circuit can be interconnected by lines. For example, the interface circuit can be used to receive signals from other devices (such as a memory of an electronic device). For another example, the interface circuit can be used to send signals to other devices (such as a processor or a touch screen of an electronic device). In some feasible embodiments, the interface circuit can read instructions stored in the memory and send the instructions to the processor. When the instruction is executed by the processor, the electronic device can perform the various steps in the above embodiments. Of course, the chip system can also include other discrete devices, which is not specifically limited in the embodiment of the present application.
[0188] An embodiment of the present application also provides a computer-readable storage medium, which includes computer instructions. When the computer instructions are executed on the above-mentioned electronic device, the electronic device executes each function or step executed by the electronic device in the above-mentioned method embodiment.
[0189] The storage medium may be an internal storage unit of the electronic device described in the above embodiment, such as a hard disk or memory of the electronic device. The storage medium may also be an external storage device of the electronic device, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the electronic device.
[0190] The embodiment of the present application also provides a computer program product. When the computer program product is run on an electronic device, the electronic device executes each function or step executed by the electronic device in the above method embodiment.
[0191] Among them, the electronic device (such as a tablet, a mobile phone, etc.), computer-readable storage medium, computer program product or chip provided in this embodiment is used to execute the corresponding method provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding method provided above, and will not be repeated here.
[0192] It will be appreciated by those skilled in the art that all or some of the steps, systems, and functional modules / units in the methods disclosed above may be implemented as software, firmware, hardware, and appropriate combinations thereof. In a hardware embodiment, the division between the functional modules / units mentioned in the above description does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may be performed by several physical components in cooperation. Some or all physical components may be implemented as software executed by a processor, such as a central processing unit, a digital signal processor, or a microprocessor, or implemented as hardware, or implemented as an integrated circuit, such as an application-specific integrated circuit. Such software may be distributed on a computer-readable medium, which may include a computer storage medium (or non-transitory medium) and a communication medium (or transient medium). As is known to those skilled in the art, the term computer storage medium includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules, or other data). Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tapes, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to store the desired information and can be accessed by a computer. In addition, it is well known to those skilled in the art that communication media typically contain computer-readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media.
[0193] It should be understood that the term "and / or" used in the specification of this application and the appended claims refers to any combination of one or more of the associated listed items and all possible combinations, including these combinations. It should be noted that, in this article, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or system including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or system. In the absence of further restrictions, an element defined by the sentence "including a..." does not exclude the presence of other identical elements in the process, method, article or system including the element.
[0194] The serial numbers of the embodiments of the present application are only for description and do not represent the advantages and disadvantages of the embodiments. The above are only specific embodiments of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in the present application, and these modifications or replacements should be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims.
Claims
1. A display control method, characterized in that: Applied to electronic equipment, the method comprises: In a first time period, a first interface of a first application is displayed, the image frame of the first interface is synthesized based on a first layer, and in the first time period, the synthesis frame rate of the electronic device is a first value; After the first time period, in response to the first operation, a second interface of the first application is displayed, and the image frame of the second interface is drawn based on the second layer; in the second time period of displaying the second interface, the synthesis frame rate of the electronic device is a second value, the second value is less than the first value, the second layer is at an upper layer of the first layer, and the first layer is completely blocked by the second layer; In the second time period, the electronic device obtains data of the first layer, and the electronic device does not draw the first layer.
2. The method according to claim 1, characterized in that The frequency at which the first application writes data of the first layer to the buffer is a third value, and the third value is greater than the second value.
3. The method according to claim 2, characterized in that The frequency at which the first application writes data of the second layer into the buffer is a fourth value, and the method further includes: After the first operation, based on the fact that the first layer is completely blocked by the second layer and the fourth value is less than the third value, the synthesis frame rate of the electronic device is set to the second value.
4. The method according to any one of claims 1 to 3, characterized in that The method further comprises: After the first time period, in response to a second operation, a third interface of the first application is displayed, and an image frame of the third interface is synthesized based on the first layer and the third layer; during a third time period of displaying the third interface, the synthesis frame rate of the electronic device is a fourth value, the fourth value is less than the first value, the level of the third layer is above the first layer, the first layer is not completely blocked by the third layer, and the area of the first layer that is not blocked by the third layer does not include the first control.
5. The method according to claim 4, characterized in that The frequency at which the first application writes data of the first control to the buffer is a fifth value, and the fifth value is greater than the fourth value.
6. The method according to claim 5, characterized in that The frequency at which the first application writes the data of the third layer into the buffer is a sixth value, and the method further includes: After the second operation, based on the fact that the first layer is not completely blocked by the third layer, the area in the first layer not blocked by the third layer does not include the first control, and the sixth value is less than the fifth value, the composite frame rate of the electronic device is set to the fourth value.
7. The method according to any one of claims 1 to 3, characterized in that The method further comprises: After the first time period, in response to a third operation, a fourth interface of the first application is displayed, and an image frame of the fourth interface is synthesized based on the first layer and the fourth layer; during a fourth time period for displaying the fourth interface, the synthesis frame rate of the electronic device is the first value, the fourth layer is at an upper layer than the first layer, the first layer is not completely blocked by the fourth layer, and an area in the first layer that is not blocked by the fourth layer includes a first control.
8. The method according to claim 7, characterized in that The frequency at which the first application writes data of the fourth layer to the buffer is a seventh value, and the seventh value is less than the first value.
9. The method according to claim 8, characterized in that The frequency at which the first application writes data of the first control into the buffer is a fifth value, and the method further includes: After the third operation, based on the fact that the first layer is not completely blocked by the fourth layer, the area in the first layer that is not blocked by the fourth layer includes the first control, and the fifth value is greater than the seventh value, the synthetic frame rate of the electronic device is set to the first value.
10. The method according to claim 3, characterized in that The method further comprises: After the first operation, based on the fact that the first layer is completely blocked by the second layer and the fourth value is less than the third value, the second application sends a control command to the layer management service; After receiving the control command, the layer management service does not draw the first layer when calling a layer drawing function and the layer to be drawn is the first layer.
11. The method according to claim 1, characterized in that: The method further comprises: After the first operation, the layer management service sends the layer information of the first layer and the layer information of the second layer to the second application; The second application obtains the layer information of the first layer and the layer information of the second layer sent by the layer management service; The second application determines whether the first layer is completely blocked by the second layer according to the layer information of the first layer and the layer information of the second layer.
12. The method according to claim 11, characterized in that The method further comprises: After the first operation, when the layer management service calls a new layer function to create the second layer, the layer information of the first layer and the layer information of the second layer are sent to the second application.
13. The method according to claim 11 or 12, characterized in that: The method further comprises: After the first operation, if the application whitelist includes the first application, the layer management service sends the layer information of the first layer and the layer information of the second layer to the second application.
14. The method according to claim 3, characterized in that The step of setting the synthetic frame rate of the electronic device to the second value includes: The second application sends the second value to the layer management service; The layer management service sets the composition frame rate of the first application to the second value.
15. A display control method, characterized in that: Applied to electronic equipment, the method comprises: In a first time period, a first interface of a first application is displayed, the image frame of the first interface is synthesized based on a first layer, and in the first time period, the synthesis frame rate of the electronic device is a first value; After the first time period, in response to a first operation, a second interface of the first application is displayed, and an image frame of the second interface is synthesized based on the first layer and the second layer; during the second time period for displaying the second interface, the synthesis frame rate of the electronic device is a second value, the second value is less than the first value, the level of the second layer is above the first layer, the first layer is not completely blocked by the second layer, and the area of the first layer that is not blocked by the second layer does not include the first control.
16. The method according to claim 15, characterized in that The method further comprises: After the first time period, in response to a second operation, a third interface of the first application is displayed, and an image frame of the third interface is synthesized based on the first layer and the third layer; during a third time period of displaying the third interface, the synthesis frame rate of the electronic device is the first value, the third layer is at an upper layer than the first layer, the first layer is not completely blocked by the third layer, and an area of the first layer that is not blocked by the third layer includes a first control.
17. An electronic device, characterized in that: include: a memory and a processor, the memory being coupled to the processor; The memory stores program instructions, and when the program instructions are executed by the processor, the electronic device executes the display control method according to any one of claims 1 to 16.
18. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the processor executes the display control method according to any one of claims 1 to 16.
Citation Information
Patent Citations
Method for obtaining application frame rate, refreshing device, mobile terminal and storage medium
CN113791684A
Display frame rate control method and device, computer readable medium and electronic equipment
CN114040252A
Display processing method and device, product and medium
CN117931329A
Interface rendering method and electronic equipment
CN118227238A
Running frame rate control method, electronic equipment, chip system and readable storage medium
CN118626201A
Cited By
Image processing method, electronic device, readable medium and program product
CN119788911A