Display control methods, electronic devices, and storage media
By dynamically adjusting the composite frame rate, drawing only the occluded layers while also considering the composite frame rate of the unoccluded layers, the problem of high power consumption of electronic devices in multi-layer display scenes is solved, and power consumption is optimized.
Patent Information
- Application Number
- CN202411818158.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-11
- Publication Date
- 2026-01-30
- Estimated Expiration
- 2044-12-11
AI Technical Summary
In multi-layer display scenarios, since different layers require different composite frame rates, existing technologies typically use the maximum or fixed high frame rate for composite, resulting in high power consumption of electronic devices.
By reducing the composition frame rate when a layer is completely occluded, drawing only the upper layer, and balancing the composition frame rate when the lower layer is not occluded to ensure display quality, the composition frame rate of electronic devices is dynamically adjusted to reduce unnecessary drawing.
It effectively reduces the power consumption of electronic devices and improves battery efficiency.
Smart Images

Figure CN119356512B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of terminal technology, and in particular to a display control method, electronic device and storage medium. Background Technology
[0002] Currently, in multi-layer display scenarios, electronic devices use the highest frame rate among the required composite frame rates for layer compositing, or they fix a higher frame rate such as 60FPS, 90FPS, or 120FPS for layer compositing to be compatible with multiple layers that require different composite frame rates. However, this results in higher power consumption for electronic devices. Summary of the Invention
[0003] This application provides 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, embodiments of this application provide a display control method applied to an electronic device, the method comprising:
[0005] During a first time period, a first interface of a first application is displayed, the image frames of the first interface being composited based on a first layer, and the composite frame rate of the electronic device during the first time period is a first value; after the first time period, in response to a first operation, a second interface of the first application is displayed, the image frames of the second interface being drawn based on a second layer; during a second time period of displaying the second interface, the composite frame rate of the electronic device is a second value, the second value being less than the first value, the second layer being on top of the first layer, and the first layer being completely obscured by the second layer; during the second time period, the electronic device acquires data from the first layer, and the electronic device does not draw the first layer.
[0006] For example, the image frames of the first interface are composited based solely on the first layer, or the image frames of the first interface are composited based on the first layer and other layers.
[0007] For example, the first operation includes operations that can change the first interface of a first application displayed on the electronic device. For instance, the first operation includes a user's touch operation on a control in the first interface or a user's swiping operation on the first interface.
[0008] When the first layer below is completely obscured by the second layer above, the electronic device does not draw the first layer, so that the composite frame rate used by the electronic device is smaller than the maximum frame rate required by the first and second layers, thereby effectively reducing the power consumption of the electronic device.
[0009] For example, the second layer is the top layer, and the first layer is a non-top layer.
[0010] When all non-top-level layers are completely obscured by the top-level layer, the electronic device only draws the top-level layer. This allows the electronic device to use a lower composite frame rate than the maximum composite frame rate required by both the non-top-level and top-level layers, thereby effectively reducing the power consumption of the electronic device.
[0011] As an example of this application, the frequency at which the first application writes data of the first layer to the buffer is a third value, which is greater than the second value.
[0012] For example, the frequency at which the first application writes data of the first layer to the first buffer is a third value.
[0013] For example, the first value is greater than or equal to the third value.
[0014] When the first layer below is completely obscured by the second layer above, the electronic device does not use the maximum frame rate required by the first and second layers, but instead uses a smaller frame rate than the maximum frame rate required by the first and second layers, thus effectively reducing the power consumption of the electronic device.
[0015] As an example of this 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:
[0016] 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 composite frame rate of the electronic device is set to the second value.
[0017] For example, the frequency at which the first application writes data of the second layer to the second buffer is a fourth value.
[0018] For example, the second value is greater than or equal to the fourth value.
[0019] When the first layer below is completely obscured by the second layer above, and the required composite frame rate of the second layer is less than that required by the first layer, the electronic device does not use the maximum composite frame rate required by the first and second layers, but instead uses a composite frame rate that is smaller than the maximum composite frame rate required by the first and second layers, thus effectively reducing the power consumption of the electronic device.
[0020] As an example of this application, the method further includes: after the first operation, based on the fact that the first layer is completely occluded 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, when the layer drawing function is called and the layer to be drawn is the first layer, the layer management service does not draw the first layer.
[0021] As an example of this application, the method further includes: 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 occluded by the second layer based on the layer information of the first layer and the layer information of the second layer.
[0022] For example, after the first operation, when the layer management service calls the new layer function to create the second layer, it sends the layer information of the first layer and the layer information of the second layer to the second application.
[0023] For example, after the first operation, if the first application is included in the application whitelist, the layer management service sends the layer information of the first layer and the layer information of the second layer to the second application.
[0024] For example, 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, then it is determined 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, then it is determined that the first layer is not completely obscured by the second layer.
[0025] For example, determining whether the second layer is opaque includes: the second application communicating with a layer management service to obtain an image frame to be displayed, the image frame to be displayed being 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, then the second layer is determined to be opaque; if the transparency of some of the multiple pixels is less than the preset threshold, then the second layer is determined to be transparent.
[0026] For example, 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 layer level. Alternatively, the layer management service sends the layer information of the first layer and the layer information of the second layer together to the second application.
[0027] As an example of this application, the method further includes: after the first operation, based on the fact that the first layer is completely occluded by the second layer and the fourth value is less than the third value, the second application sends the second value to the layer management service; the layer management service sets the composite frame rate of the first application to the second value.
[0028] As an example of this application, the method further includes: after the first operation, based on the fact that the first layer is completely occluded by the second layer and the fourth value is less than the third value, the second application sends a frame rate setting message to the layer management service, the frame rate setting message being used by the layer management service to instruct the first application to set the composite frame rate of the first application to the second value; when the layer management service receives the frame rate setting message, it sets the composite frame rate of the first application to the second value.
[0029] As an example of this application, the method further includes: after the first time period, in response to a second operation, displaying a third interface of the first application, wherein the image frames of the third interface are composited based on the first layer and the third layer; during the third time period of displaying the third interface, the composite frame rate of the electronic device is a fourth value, the fourth value being less than the first value, the third layer being on top of the first layer, the first layer not being completely obscured by the third layer, and the area in the first layer not obscured by the third layer not including the first control.
[0030] For example, the second operation includes operations that can change the first interface of the first application displayed on the electronic device. For instance, the second operation includes a user's touch operation on a control in the first interface or a user's swiping operation on the first interface.
[0031] For example, the image frame of the third interface is composited based on the first layer, the third layer, and other layers. The third layer is above the first layer and above the other layers. The first layer and / or other layers are not completely obscured by the third layer, and the areas in the first layer not obscured by the third layer do not include the first control, and the areas in / or other layers not obscured by the third layer do not include the second control. The first application writes data of the second control to the buffer more frequently than the first application writes data of the third layer to the buffer.
[0032] For example, the area in the first layer that is not obscured by the third layer does not include the first control, which means that the area in the first layer that is obscured by the third layer includes the first control in the first layer, that is, the first control in the first layer is completely obscured by the third layer.
[0033] For example, the first layer is a non-top layer, and the third layer is the top layer.
[0034] When the first layer below is not completely obscured by the third layer above, and the first control in the first layer is obscured by the third layer, the electronic device does not use the maximum frame rate required by the first and third layers, but instead uses a smaller frame rate than the maximum frame rate required by the first and third layers, thus effectively reducing the power consumption of the electronic device.
[0035] As an example of this application, the frequency at which the first application writes data of the first control to the buffer is a fifth value, which is greater than the fourth value.
[0036] For example, the frequency at which the first application writes data of the first control to the third buffer is the fifth value.
[0037] For example, the first value is greater than or equal to the fifth value.
[0038] When the first layer below is not completely obscured by the third layer above, and the first control in the first layer is obscured by the third layer, the electronic device does not use the maximum frame rate required by the first and third layers, but instead uses a smaller frame rate than the maximum frame rate required by the first and third layers, thus effectively reducing the power consumption of the electronic device.
[0039] As an example of this 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 obscured by the third layer, the area in the first layer that is not obscured by the third layer does not include the first control, and the sixth value is less than the fifth value, setting the composite frame rate of the electronic device to the fourth value.
[0040] For example, the frequency at which the first application writes data from the third layer to the fourth buffer is a sixth value.
[0041] For example, the fourth value is greater than or equal to the sixth value.
[0042] When the first layer below is not completely obscured by the third layer above, the first control in the first layer is obscured 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 among the combined frame rates required by the first and third layers, but uses a combined frame rate that is smaller than the maximum frame rate among the combined frame rates required by the first and third layers, thus effectively reducing the power consumption of the electronic device.
[0043] As an example of this application, after the second operation, based on the fact that the first layer is not completely obscured by the third layer, the area in the first layer that is not obscured 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.
[0044] As an example of this application, after the second operation, iterate through the areas in the first layer that are not obscured by the third layer to see if the first control is excluded.
[0045] For example, after the second operation, based on the layer information of the first layer and the image information of the third layer, it is determined whether the area in the first layer that is not obscured by the third layer does not include the first control.
[0046] As an example of this application, the method further includes: after the first time period, in response to a third operation, displaying a fourth interface of the first application, wherein the image frames of the fourth interface are composited based on the first layer and the fourth layer; during the fourth time period of displaying the fourth interface, the composite frame rate of the electronic device is the first value, the fourth layer is at the upper level of the first layer, the first layer is not completely obscured by the fourth layer, and the area in the first layer that is not obscured by the fourth layer includes the first control.
[0047] For example, the image frame of the fourth interface is composited based on the first layer, the fourth layer, and other layers. The fourth layer is above the first layer and above the other layers. The first layer is not completely obscured by the fourth layer, and / or other layers are not completely obscured by the fourth layer. The areas in the first layer not obscured by the fourth layer include the first control, and / or the areas in the other layers not obscured by the fourth layer include the second control. The first application writes data of the second control to the buffer more frequently than the first application writes data of the fourth layer to the buffer.
[0048] For example, the third operation can change the operation of the first interface of the first application displayed on the electronic device. For instance, the third operation includes a user's touch operation on a control in the first interface or a user's swiping operation on the first interface.
[0049] For example, the area in the first layer that is not obscured by the fourth layer includes the first control, meaning that the first control in the first layer is not completely obscured by the fourth layer.
[0050] For example, the first layer is a non-top layer, and the fourth layer is the top layer.
[0051] If the first layer below is not completely obscured by the fourth layer above, and the first control in the first layer is not completely obscured by the fourth layer, in order to balance the composite frame rate required by the first and fourth layers, the electronic device adopts the maximum frame rate or a frame rate greater than the maximum frame rate required by the first and fourth layers to ensure the display effect of the interface.
[0052] As an example of this application, the frequency at which the first application writes data of the fourth layer to the buffer is a seventh value, which is less than the first value.
[0053] For example, the frequency at which the first application writes data from the fourth layer to the fifth buffer is the seventh value.
[0054] As an example of this 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 obscured by the fourth layer, the area in the first layer that is not obscured by the fourth layer includes the first control, and the fifth value is greater than the seventh value, setting the composite frame rate of the electronic device to the first value.
[0055] If the first layer below is not completely obscured by the fourth layer above, and the first control in the first layer is not completely obscured 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 balance the composite frame rate required by the first layer and the fourth layer, the electronic device adopts the maximum frame rate or a larger frame rate among the composite frame rates required by the first layer and the fourth layer, in order to ensure the display effect of the interface.
[0056] Secondly, embodiments of this application also provide a display control method applied to an electronic device, the method comprising:
[0057] During a first time period, a first interface of a first application is displayed, the image frames of the first interface being composited based on a first layer, and the composite frame rate of the electronic device during the first time period is a first value; after the first time period, in response to a first operation, a second interface of the first application is displayed, the image frames of the second interface being composited based on the first layer and a second layer; during a second time period of displaying the second interface, the composite frame rate of the electronic device is a second value, the second value being less than the first value, the second layer being on top of the first layer, the first layer not being completely obscured by the second layer, and the area in the first layer not obscured by the second layer not including the first control.
[0058] When the first layer below is not completely obscured by the second layer above, and the first control in the first layer is completely obscured by the second layer, the electronic device does not use the maximum frame rate required by the first and second layers, but uses a smaller frame rate than the maximum frame rate required by the first and second layers, thus effectively reducing the power consumption of the electronic device.
[0059] As an example of this application, the method further includes:
[0060] After the first time period, in response to the second operation, a third interface of the first application is displayed, wherein the image frames of the third interface are composited based on the first layer and the third layer; during the third time period of displaying the third interface, the composite frame rate of the electronic device is the first value, the third layer is on top of the first layer, the first layer is not completely obscured by the third layer, and the area in the first layer that is not obscured by the third layer includes the first control.
[0061] If the first layer below is not completely obscured by the third layer above, and the first control in the first layer is not completely obscured by the third layer, in order to balance the composite frame rate required by the first and third layers, the electronic device adopts the maximum frame rate or a larger frame rate among the composite frame rates required by the first and third layers to ensure the display effect of the interface.
[0062] Thirdly, embodiments of this application provide an electronic device, including:
[0063] Memory and processor, with memory coupled to the processor;
[0064] The memory stores program instructions that, when executed by a processor, cause the electronic device to perform the method as described in any one of the first or second aspects.
[0065] Fourthly, embodiments of this application provide a chip system applied to an electronic device; the electronic device includes at least one processor and at least one interface circuit, the processor and the interface circuit being interconnected via a line; the interface circuit is used to receive a signal from the memory of the electronic device and send the signal to the processor, the signal including program instructions stored in the memory; when the processor executes the program instructions, it causes the electronic device to perform the method as described in any one of the first or second aspects.
[0066] Fifthly, embodiments of this application provide a computer-readable storage medium storing a computer program that, when executed by a processor, causes the processor to perform the method as described in any one of the first or second aspects.
[0067] Sixthly, this application provides a computer program product that, when run on an electronic device, causes the electronic device to perform the method as described in any one of the first or second aspects.
[0068] It should be understood that the technical effects achieved by the third, fourth, fifth and sixth aspects mentioned above are similar to the technical effects achieved by the corresponding technical means in the first or second aspects mentioned above, and will not be elaborated here. Attached Figure Description
[0069] To more clearly illustrate the technical solutions of the embodiments of this application, the drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0070] Figure 1This is a schematic diagram of multiple layers superimposed according to an embodiment of this application;
[0071] Figure 2 This is another schematic diagram showing the overlay of multiple layers provided in the embodiments of this application;
[0072] Figure 3 This is a block diagram of a software system for an electronic device provided in an embodiment of this application;
[0073] Figure 4 This is a schematic diagram of the interface of the electronic device in the embodiments of this application;
[0074] Figure 4a This is another schematic diagram showing the overlay of multiple layers in the embodiments of this application;
[0075] Figure 5 This is another schematic diagram of the interface of the electronic device in the embodiments of this application;
[0076] Figure 5a This is another schematic diagram showing the overlay of multiple layers in the embodiments of this application;
[0077] Figure 6 This is a hardware structure block diagram of an electronic device in some embodiments of this application;
[0078] Figure 7 This is a flowchart illustrating a display control method provided in an embodiment of this application;
[0079] Figure 8 This is a schematic diagram of extracting a plurality of uniformly distributed pixels from an image frame to be displayed in an embodiment of this application;
[0080] Figure 9 This is another schematic diagram showing the overlay of multiple layers in the embodiments of this application;
[0081] Figure 10 This is another schematic diagram showing the superposition of multiple layers in the embodiments of this application. Detailed Implementation
[0082] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0083] The flowchart shown in the attached diagram is for illustrative purposes only and does not necessarily include all content and operations / steps, nor does it necessarily have to be performed in the order described. For example, some operations / steps can be broken down, combined, or partially merged, so the actual execution order may change depending on the actual situation.
[0084] It should be understood that the terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to limit the scope of the application. As used in this specification and the appended claims, the singular forms “a,” “an,” and “the” are intended to include the plural forms unless the context clearly indicates otherwise.
[0085] The following detailed description of some embodiments of this application is provided in conjunction with the accompanying drawings. Unless otherwise specified, the following embodiments and features can be combined with each other.
[0086] Before introducing the display control method provided in the embodiments of this application, the nouns and terms involved in the embodiments of this application will be briefly introduced.
[0087] Layer: This refers to the object passed to SurfaceFlinger for compositing from the application layer. Each layer can contain different image elements. Each layer has corresponding layer properties, which can include at least one of the following: position, size, and level. Position information indicates the layer's location. For example, taking a rectangular layer, the position information can include the coordinates of each vertex of the layer, such as the coordinates of the top-left and bottom-right vertices, or the coordinates of the bottom-left and top-right vertices. Optionally, the coordinates of each vertex of the layer are in screen coordinates, which is a Cartesian coordinate system with the top-left corner of the display as the origin, the positive x-axis to the right, and the positive y-axis downwards. Size information indicates the size of the layer.
[0088] The layer level indicates the vertical stacking order of layers during compositing. The higher the layer level, the earlier the corresponding layer appears in the vertical direction during compositing. During compositing, higher-level layers can completely cover lower-level layers, or they can partially cover lower-level layers. This application does not specifically limit this aspect.
[0089] For example, following the bottom-to-top order during compositing, multiple layers include Layer0 (layer 0, i.e., layer numbered 0), Layer1 (layer 1, i.e., layer numbered 1), and Layer2 (layer 2, layer numbered 2). The layer information for Layer0, Layer1, and Layer2 is represented as 0, 1, and 2, respectively. For instance, the stacking order of Layer0, Layer1, and Layer2 is as follows: Figure 1 and Figure 2 As shown, and Figure 1 and Figure 2 In the diagram, 41 is used to identify Layer 0, 42 is used to identify Layer 1, and 43 is used to identify Layer 2. For example... Figure 1 As shown, higher-level layers completely cover lower-level layers; that is, Layer 2 is superimposed on Layer 1, and Layer 2 completely covers Layer 1, while Layer 1 is superimposed on Layer 0, and Layer 1 completely covers Layer 0. Figure 2 As shown, higher-level layers partially overlap lower-level layers. That is, Layer2 is superimposed on Layer1, and Layer2 partially overlaps Layer1. Layer1 is superimposed on Layer0, and Layer1 partially overlaps Layer0.
[0090] To facilitate understanding, the software system of the electronic device involved in the embodiments of this application will be described first. The software system of the electronic device may adopt a layered architecture, event-driven architecture, microkernel architecture, microservice architecture, or cloud architecture. The embodiments of this application take the layered architecture Android system as an example to illustrate the software system of the electronic device.
[0091] Figure 3 This is a block diagram of a software system for an electronic device provided in an embodiment of this application. See also... Figure 3 A layered architecture divides software into several layers, each with a clear role and function. Layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, from top to bottom: the application layer (App layer), the application framework layer (FWK layer), the hardware abstraction layer (HAL layer), and the kernel layer.
[0092] The application layer can include a series of applications, such as Figure 3As shown, the application layer can include a first application and a second application, but it is not limited to these. For example, it can also include applications such as camera, map, Bluetooth, contacts, and SMS. The first application and the second application can be the same application or different applications. The second application can include power-saving apps, phone managers, and adaptive power saving applications (APS). APS is a system application mainly used to enable adaptive power saving in electronic devices to reduce power consumption. For example, it can prevent unnecessary application auto-start.
[0093] The application framework layer provides application programming interfaces (APIs) and a programming framework for applications in the application layer; the application framework layer includes some predefined functions. For example... Figure 3 As shown, the application framework layer includes the layer management service SurfaceFlinger (SF) and the activity management service Activity Manager Service (AMS). SurfaceFlinger is a system service that enables the drawing and compositing of layers. For example, after the application starts, it can create one or more layers, and SurfaceFlinger can draw and composite these layers to obtain the image frame to be displayed.
[0094] Activity Management Service (AMS) is a system service primarily responsible for managing and coordinating the lifecycle of application components (Activities), handling operations such as application startup, switching, and stopping, as well as tasks related to task stack management and process management. For example, when a user switches from application A to application B, AMS pauses the current Activity in application A and resumes the Activity in application B. Process management refers to AMS deciding when to create or destroy application processes based on application needs and system resource availability. Task stack management involves AMS maintaining one or more task stacks, each containing an ordered series of Activities. Users can switch between Activities in the task stack using the back button.
[0095] The hardware abstraction layer is a layer of abstraction between the kernel layer and upper layers (such as the application framework layer and the application layer). For example, the hardware abstraction layer is a wrapper around the kernel layer driver, shielding the underlying implementation details and providing a unified interface to the upper layers. Upper-layer applications do not need to care about how the lower layers specifically implement the work.
[0096] The kernel layer is the layer between hardware and software. The kernel layer can include the touch sensor driver (TP Driver) for the touch screen, the display driver (Display subsystem Driver, DSS Driver) for the display screen, and can also include the graphics processing unit (GPU) driver, sensor driver, etc.
[0097] Layer frame rate: This refers to the frequency at which an application (APP) writes layer data to a buffer, usually expressed as frames per second (FPS). Electronic device composition frame rate: This can represent the number of image frames composed per second by SurfaceFlinger in the electronic device. Optionally, in some scenarios, the composition frame rate is equal to the frequency at which SurfaceFlinger reads layer data from the buffer when drawing and compositing layers; it can also be expressed as the number of frames read per second by SurfaceFlinger from the buffer. Optionally, the electronic device's composition frame rate can be greater than or equal to the layer frame rate, or it can be less than the layer frame rate. For example, ... Figure 3 As 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.
[0098] Screen refresh rate: This refers to the number of times the screen of an electronic device refreshes its display per second, measured in Hz (Hertz). For example, a 60Hz screen refresh rate means the display can refresh 60 times per second. A higher refresh rate results in smoother visuals, but also higher power consumption. The screen refresh rate can adaptively adjust based on the composite frame rate. For instance, at a composite frame rate of 60 FPS, the electronic device will adaptively adjust the screen refresh rate to 60Hz; at a composite frame rate of 120 FPS, the electronic device will adaptively adjust the screen refresh rate to 120Hz. Generally, the composite frame rate should match or be close to the screen refresh rate for optimal display performance.
[0099] In multi-layer display scenarios, electronic devices may use the highest frame rate among the required frame rates for layer compositing, or set a higher frame rate such as 60FPS, 90FPS or 120FPS for layer compositing, in order to be compatible with multiple layers that require different frame rates. However, this will result in higher power consumption for the electronic devices.
[0100] For example, on the main page of some third-party applications, there are often many constantly refreshing small animations. When the user does not perform any operation, these small animations keep refreshing, causing SurfaceFlinger to render and composite at a frame rate of 60 FPS. However, when the user clicks on a piece of 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 participating in the compositing. As a result, when compositing the small animation layer and the layer of the new content page, SurfaceFlinger still renders and composites at a frame rate of 60 FPS, which leads to higher power consumption.
[0101] For example, such as Figure 4 As shown, during the first time period T1, the electronic device displays the first interface 10 of the first application (e.g., a lifestyle service application), and the first interface 10 has an animation 11 of opening a red envelope, as shown. Figure 4a As shown, the image frames of the first interface 10 are synthesized based on the first layer 13. The first layer 13 includes the first control 131 corresponding to the animation 11 of opening red envelopes. 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 red envelopes) to the first buffer at a frame rate of 30 FPS. Therefore, SurfaceFlinger can read the data of the first layer 13 from the first buffer at a frame rate of 30 FPS for drawing and synthesis. Thus, the synthesis frame rate of the electronic device in the first time period T1 is 30 FPS.
[0102] After the first time period T1, in response to the user's click on the thumbnail 12 in the first interface 10, the electronic device displays as follows: Figure 5 The second interface 20 shown is as follows: Figure 5a As shown, the first application writes data of the first layer 13 to the first buffer at a frame rate of 30 FPS and writes data of the second layer 14 to the second buffer at a frame rate of 1 FPS. The first layer 13 is completely obscured by the second layer 14. In order to be compatible with the frame rate of the first layer 13 (30 FPS) and the frame rate of the second layer 14 (1 FPS), SurfaceFlinger reads data of the first layer 13 from the first buffer at a frame rate of 30 FPS and reads data of the second layer 14 from the second buffer at a frame rate of 1 FPS. Thus, the image frame of the second interface 20 is synthesized based on the first layer 13 and the second layer 14. In this way, although the first layer 13 is completely obscured by the second layer 14, during the second time period T2 of displaying the second interface 20, the synthesized frame rate of the electronic device is the maximum value of 30 FPS and 1 FPS. That is, the synthesized frame rate of the electronic device is still 30 FPS, and the power consumption of the electronic device is high.
[0103] To address this, this application provides a display control method. This method involves displaying a first interface of a first application during a first time period. The image frames of the first interface are composited based on a first layer. During this first time period, the composite 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. The image frames of the second interface are drawn based on a second layer. During a second time period of displaying the second interface, the composite frame rate of the electronic device is a second value, which is less than the first value. The second layer is on top of the first layer, and the first layer is completely obscured by the second layer. During the second time period, the electronic device acquires data from the first layer but does not draw the first layer. This results in a lower composite frame rate being used by the electronic device, thereby reducing the power consumption of the electronic device.
[0104] For example, after the first time period T1, the electronic device responds to the user's click on the thumbnail 12 in the first interface 10, and displays as follows: Figure 5 The second interface 20 shown is as follows: Figure 5a As shown, the first application writes data of the first layer 13 to the first buffer at a frame rate of 30 FPS and writes data of the second layer 14 to the second buffer at a frame rate of 1 FPS. Since the first layer 13 is completely obscured by the second layer 14, and the frame rate of the first layer 13 (30 FPS) is greater than the frame rate of the second layer 14 (1 FPS), during the second time period T2 of displaying the second interface 20, although the first application still writes data of the first layer 13 to the first buffer at a frame rate of 30 FPS, SurfaceFlinger does not draw the first layer. In this way, SurfaceFlinger reads data of the second layer 14 from the second buffer at a frame rate of 1 FPS and draws the second layer 14, thereby obtaining the image frame of the second interface 20. Thus, during the second time period T2 of displaying the second interface, the composite frame rate of the electronic device is 1 FPS instead of 30 FPS, thereby effectively reducing the power consumption of the electronic device.
[0105] In some embodiments, the display control method provided in this application can be applied to electronic devices. Figure 6 This is a schematic diagram of the structure of an electronic device 100 provided in an embodiment of this application. The electronic device 100 is capable of executing the display control method provided in the embodiment of this application.
[0106] For example, electronic devices include, but are not limited to, at least one of the following: mobile phones, in-vehicle devices (also known as vehicle-mounted systems), tablet computers, laptops, ultra-mobile personal computers (UMPCs), handheld computers, netbooks, personal digital assistants (PDAs), wearable electronic devices, and virtual reality devices. This application does not impose any limitations on these categories.
[0107] 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, a headphone jack 170D, a sensor module 180, buttons 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc.
[0108] It is 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 illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0109] Processor 110 may include one or more processing units, such as: application processor (AP), modem processor, graphics processing unit (GPU), image signal processor (ISP), controller, memory, video codec, digital signal processor (DSP), baseband processor, and / or neural network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.
[0110] The controller can be the nerve center and command center of the electronic device 100. The controller can generate operation control signals according to the instruction opcode and timing signals to complete the control of fetching and executing instructions.
[0111] The processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. This memory can store instructions or data that the processor 110 has just used or that are used repeatedly. If the processor 110 needs to use the instruction or data again, it can retrieve it directly from this memory. This avoids repeated accesses, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.
[0112] The charging management module 140 receives charging input from the charger. While charging the battery 142, the charging management module 140 can also supply power to the electronic device through the power management module 141.
[0113] 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, internal memory 121, external memory, display 194, camera 193, and wireless communication module 160, etc.
[0114] The wireless communication function of electronic device 100 can be implemented through 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 electronic device 100 can be used to cover one or more communication frequency bands.
[0115] The mobile communication module 150 can provide solutions for wireless communication, including 2G / 3G / 4G / 5G, applied to the electronic device 100. The mobile communication module 150 may include at least one filter, switch, power amplifier, low noise amplifier (LNA), etc.
[0116] The wireless communication module 160 can provide solutions for wireless communication applications on the electronic device 100, including wireless local area networks (WLANs) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), and infrared (IR) technologies. The wireless communication module 160 can be one or more devices integrating at least one communication processing module.
[0117] Electronic device 100 implements display functions through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, connected to the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations and for graphics rendering. Processor 110 may include one or more GPUs, which execute program instructions to generate or modify display information.
[0118] Display screen 194 is used to display images, videos, etc. Display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), a light-emitting diode (LED), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a MiniLED, a MicroLED, a Micro-OLED, a quantum dot light-emitting diode (QLED), etc.
[0119] In this embodiment, if the display screen 194 integrates a touch sensor, then the display screen 194 can be a touchscreen. This touch sensor can also be called a "touch panel." That is, the display screen 194 can include a display panel and a touch panel; the touch sensor and the display screen 194 together form a touchscreen, also called a "touch screen." The touch sensor is used to detect touch operations applied to or near it. After detecting a touch operation, the touch sensor can trigger a kernel-level driver (such as a TP driver) to periodically scan the touch parameters generated by the touch operation. Then, the kernel-level driver passes the touch parameters to the relevant upper-layer modules so that the relevant modules can determine the touch event type corresponding to the touch parameters.
[0120] Additionally, the display screen 194 can provide visual output related to touch operations. In other embodiments, the touch sensor may be disposed on the surface of the electronic device 100, rather than integrated into the display screen 194. In this case, the positions of the touch sensor and the display screen 194 may differ. In this embodiment, the specific process of adjusting the TP sampling rate is described using a display screen with an integrated touch sensor as an example.
[0121] 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 perform data storage functions. For example, music, video, and other files can be saved on the external memory card. The internal memory 121 can be used to store computer executable program code, which includes 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.
[0122] 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. Examples include music playback and recording. The audio module 170 is used to convert digital audio information into analog audio signals for output, and also to convert analog audio input into digital audio signals. The audio module 170 can also be used for encoding and decoding audio signals. The speaker 170A, also called a "loudspeaker," is used to convert audio electrical signals into sound signals. The receiver 170B, also called a "handpiece," is used to convert audio electrical signals into sound signals. The microphone 170C, also called a "microphone" or "voice transducer," is used to convert sound signals into electrical signals. The headphone jack 170D is used to connect wired headphones.
[0123] Buttons 190 include a power button, volume buttons, etc. Buttons 190 can be mechanical buttons or touch buttons. Electronic device 100 can receive button input and generate key signal inputs related to user settings and function control. Motor 191 can generate vibration alerts. Motor 191 can be used for incoming call vibration alerts or for touch vibration feedback. Indicator 192 can be an indicator light, used to indicate charging status, battery level changes, messages, missed calls, notifications, etc. SIM card interface 195 is used to connect a SIM card. The SIM card can be inserted into or removed from the SIM card interface 195 to achieve contact and separation with electronic device 100. Electronic device 100 can support one or N SIM card interfaces, where N is a positive integer greater than 1. SIM card interface 195 can support Nano SIM cards, Micro SIM cards, SIM cards, etc.
[0124] The methods described in this application embodiment can be applied to, but are not limited to, electronic devices 100 having the above-described hardware structure.
[0125] Please see Figure 7 , Figure 7 This is a flowchart illustrating a display control method provided in an embodiment of this application. The method may include some or all of the following content, which will be explained using APS as an example in the second application:
[0126] S101, AMS sends the first application to APS.
[0127] Optionally, when performing step S101, the first application is an application running in the foreground. Optionally, in some embodiments, the AMS can send identification information of all applications running in the foreground to the APS.
[0128] In some embodiments, in response to the first application starting or switching from background to foreground operation, the AMS sends the identification information of the first application to the APS. The first application can be any application in the electronic device, such as a shopping application. The identification information of the first application is used to uniquely identify the first application, and this identification information can be a package name or a process ID.
[0129] For example, when the first application is launched, the electronic device runs the first application in the foreground, and the AMS sends the identification information of the first application to the APS. As another example, when a 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.
[0130] S102, APS determines whether the first application is included in the application whitelist.
[0131] Optionally, the application whitelist includes one or more applications that exhibit the target scenario. Further, the application whitelist includes identification information for one or more applications that exhibit the target scenario. The target scenario includes situations where the top layer completely obscures non-top layers, and the frame rate of the non-top layers is greater than the frame rate of the top layer; or where the top layer partially obscures non-top layers, and all controls in the non-top layers with a frame rate greater than the frame rate of the top layer are obscured by the top layer.
[0132] In some embodiments, the APS determines whether the application whitelist includes the identification information of the first application. If the application whitelist includes the identification information of the first application, the application whitelist is determined to include the first application; if the application whitelist does not include the identification information of the first application, the application whitelist is determined not to include the first application.
[0133] In some embodiments, the application whitelist in the APS is pre-configured. For example, developers filter out applications that exist in the target scenario, thereby pre-establishing an application whitelist that includes the identification information of the applications that exist in the target scenario, and then setting the application whitelist in the APS.
[0134] In some embodiments, the application whitelist in the APS can be automatically updated by the electronic device. For example, if a third application in the application whitelist had a target scenario before a version update, but no longer has a target scenario after the version update, the server automatically deletes the identifier information of the third application from the application whitelist, obtains a new application whitelist, and sends the new application whitelist to the electronic device, which then updates the application whitelist in the APS to the latest application whitelist.
[0135] In some embodiments, after an application in an electronic device is updated, the electronic device determines whether the updated application exists in the target scenario. If the updated application exists in the target scenario and the updated application is not included in the application whitelist, the identification information of the updated application is added to the application whitelist. If the updated application does not exist in the target scenario and the application whitelist includes the updated application, the identification information of the updated application is removed from the application whitelist. If the updated application exists in the target scenario and the application whitelist includes the updated application, or if the updated application does not exist in the target scenario and the application whitelist does not include the updated application, the application whitelist remains unchanged.
[0136] S103. If the first application is included in the application whitelist, APS sets the value of the first flag bit to the first preset value.
[0137] The first flag indicates whether an application in the application whitelist is currently running in the foreground. Optionally, in this embodiment, since the application running in the foreground is the first application, the first flag can indicate whether the application whitelist includes the first application. When the value of the first flag is a first preset value, such as true, it indicates that the application whitelist includes the first application, that is, there is an application currently running in the foreground in the application whitelist. When the value of the first flag is a second preset value, such as false, it indicates that the application whitelist does not include the first application, that is, there is no application currently running in the foreground in the application whitelist. The specific style of the first flag can be set based on the actual situation, and this embodiment does not specifically limit it. For example, the first flag is isWhiteListAppRunning.
[0138] S104, APS sends the second flag bit to SF.
[0139] At this time, the value of the second flag bit is the third preset value. The second flag bit indicates whether the SF needs to send layer information to the APS. When the value of the second flag bit is the third preset value, such as true, it means that the SF needs to send the layer information to the APS. When the value of the second flag bit is the fourth preset value, such as false, it means that the SF does not need to send the layer information to the APS. The specific style of the second flag bit can be set based on actual conditions, and this application embodiment does not specifically limit it.
[0140] In some embodiments, when the SF receives a second flag bit sent by the APS, it saves the second flag bit or sets a third flag bit and sets its value to a fifth preset value. For example, if the SF receives a second flag bit with a value of true, it saves the second flag bit and sets its value to true; or it sets a third flag bit that is different from the second flag bit and sets its value to true. The third flag bit indicates whether the SF needs to send layer information to the APS. A value of the third flag bit of the fifth preset value, such as true, indicates that the SF needs to send layer information to the APS; a value of the third flag bit of the sixth preset value, such as false, indicates that the SF does not need to send layer information to the APS.
[0141] In some embodiments, the APS sends a first message to the SF, the first message indicating that the value of the second flag bit is a first preset value. Accordingly, the SF sets the value of the second flag bit to the first preset value based on the first message. It is understood that before receiving the first message, the value of the second flag bit in the SF is false.
[0142] Optionally, combined Figure 7As can be seen from the flowchart of the display control method shown, the method provided in this application embodiment may further include steps S105 to S109. Optionally, there is no necessary temporal relationship between steps S105 to S109 and steps S101 to S104. Steps S105 to S109 may be executed before, after, or simultaneously with any of steps S101 to S104.
[0143] S105 and SF respond to a layer change by determining whether the value of the second flag bit is the third preset value. If the value of the second flag bit is the third preset value, the first applied layer information is sent to the APS.
[0144] In some embodiments, the SF responds to a layer change and the value of the second flag bit is a third preset value by sending layer information of all applications running in the foreground to the APS.
[0145] Optionally, in response to a layer change, the SF determines whether the value of the third flag bit is the fifth preset value. If the value of the third flag bit is the fifth preset value, the SF sends the layer information of the first application to the APS.
[0146] In some embodiments, layer information includes layer position information and frame rate. The layer position information indicates the layer's position during compositing, and the layer frame rate indicates the required frame rate for compositing. Further, layer information may also include layer hierarchy information and layer name, where the layer hierarchy information can be a zIndex value.
[0147] In some embodiments, SF executes step 105 when creating or destroying a layer. Creating a new layer is implemented using the `NewLayer()` function, and destroying a layer is implemented using the `DeleteLayer()` function. That is, when SF calls the `NewLayer()` function or the `DeleteLayer()` function, it sends the layer information of the first application to APS. For example, as... Figure 4 As shown, when a user clicks on thumbnail 12 in the first interface 10, SF calls the NewLayer() function to create a new layer corresponding to the content details of thumbnail 12. SF then sends a message to APS. Figure 5a The layer information of the first layer 13 and the second layer 14 in the image.
[0148] In some embodiments, sending layer information of the first application to the APS may include: the SF sequentially sending layer information of each layer in a plurality of layers of the first application to the APS in descending order of layer level. For example, as Figure 5aAs shown, the first application includes two layers: a first layer 13 and a second layer 14. The layer information of the first layer 13 and the second layer 14 is represented as 0 and 1, respectively. That is, 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.
[0149] In some embodiments, sending layer information of the first application to the APS may include: the SF sequentially sending layer information of each layer in a plurality of layers of the first application to the APS in ascending order of layer level. For example, as Figure 5a As shown, the first application includes two layers: a first layer 13 and a second layer 14. The layer information of the first layer 13 and the second layer 14 is represented as 0 and 1, respectively. That is, 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.
[0150] In some embodiments, sending layer information of the first application to the APS may include: the SF sending layer information of multiple layers of the first application together to the APS. The layer information includes layer location information, frame rate, and layer level information. For example, such as... Figure 5a As shown, the first application includes two layers: first layer 13 and second layer 14. Therefore, SF sends the layer information of first layer 13 and second layer 14 together to APS.
[0151] 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. If the value of the second flag bit is a fourth preset value, then the layer information of the first application is not sent to the APS. This embodiment reduces communication overhead by indicating that the layer information of the first application does not need to be sent to the APS when the value of the second flag bit in the SF is the fourth preset value.
[0152] S106, APS determines whether the first application has multiple layers based on the layer information.
[0153] 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 only one layer information in the layer information queue, it is determined that the first application has only one layer.
[0154] In some embodiments, each time the APS receives a layer information, it stores the received layer information into a layer information queue in sequence. In any two adjacent layer information in the layer information queue, the layer information of the earlier layer information has a higher level than the layer information of the later layer information.
[0155] For example, such as 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 Layer message2 of the second layer 14, and then receives the layer information Layer message1 of the first layer 13. Therefore, when it receives Layer message2, it stores Layer message2 at the beginning of the empty layer information queue to update the layer information queue. When it receives Layer message1, it stores Layer message1 at the next position of Layer message3 in the layer information queue, thus obtaining the final layer information queue [Layer message2, Layer message1].
[0156] In some embodiments, the layer level of the first layer in any two adjacent layers within a layer information queue is lower than the layer level of the second layer. For example, such as... Figure 5a As shown, SF first sends the layer information Layer message1 of the first layer 13 to APS, and then sends the layer information Layer message2 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 Layer message2 of the second layer 14. When Layer message1 is received, it is placed at the beginning of the empty layer information queue to update the layer information queue. When Layer message2 is received, it is placed at the next position of Layer message1 in the layer information queue, thus obtaining the final layer information queue [Layer message1, Layer message2].
[0157] In some embodiments, the layer information of the first application is sent to the APS along with the SF. The APS determines whether the first application has multiple layers based on the layer information. This can include: the APS determining whether there are multiple different layer identifiers in the received layer information; if there are multiple different layer identifiers in the received layer information, then the first application has multiple layers; if there is only one layer identifier in the received layer information, then the first application has only one layer. The layer identifier can include a layer name or a layer ID.
[0158] For example, such as 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 Layer message2 of the second layer 14 to APS. APS receives Layer message1 and Layer message2. Since Layer message1, Layer message2, 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.
[0159] S107. If the first application has multiple layers, the APS determines whether the non-top layer is completely obscured by the top layer based on the layer information of the top layer and the non-top layer among the multiple layers.
[0160] The top layer is the highest-level layer among the multiple layers in the first application, and non-top layers are layers with a lower level than the top layer among the multiple layers in the first application. Optionally, a non-top layer not being completely obscured by the top layer means that at least a portion of the non-top layer's coverage area is outside the top layer's coverage area, or the top layer is transparent. A non-top layer being completely obscured by the top layer means that the entire coverage area of the non-top layer is within the top layer's coverage area, and the top layer is opaque. For example, as... Figure 5a As shown, the second layer 14 is the top layer, and the first layer 13 is not the top layer. Since the entire coverage area of the first layer 13 is located within the coverage area of the second layer 14, and the second layer 14 is opaque, the first layer 13 is completely obscured by the second layer 14.
[0161] In some embodiments, the APS determines whether a non-top-level layer is completely occluded by the top-level layer based on the layer information of the top-level layer and the layer information of non-top-level layers among multiple layers. This may include: the APS obtaining the first layer information in the layer information queue as the layer information of the top-level layer, and sequentially obtaining the layer information after the first layer information in the layer information queue as the layer information of non-top-level layers; or obtaining the last layer information in the layer information queue as the layer information of the top-level layer, and sequentially obtaining the layer information before the last layer information in the layer information queue as the layer information of non-top-level layers; for each non-top-level layer, determining whether the non-top-level layer is completely covered by the top-level layer and determining whether the top-level layer is opaque based on the position information in the non-top-level layer's layer information and the position information in the top-level layer's layer information; if the non-top-level layer is completely covered by the top-level layer and the top-level layer is opaque, then the non-top-level layer is determined to be completely occluded by the top-level layer; if the non-top-level layer is completely covered by the top-level layer and the top-level layer is transparent or the non-top-level layer is not completely covered by the top-level layer, then the non-top-level layer is determined not to be completely occluded by the top-level layer.
[0162] In some embodiments, taking a top-layer and non-top-layer layers as examples where both are rectangular layers, the position information in the layer information of the top-layer layer includes the coordinates of the first and second vertices of the top-layer layer, and the position information in the layer information of the non-top-layer layer includes the coordinates of the third and fourth vertices of the non-top-layer layer. Determining whether the non-top-layer layer is covered by the top-layer layer based on the position information in the layer information of the non-top-layer layer and the layer information of the top-layer layer may include: determining a first coverage area of the top-layer layer based on the coordinates of the first and second vertices, and determining a second coverage area of the non-top-layer layer based on the coordinates of the third and fourth vertices; if the second coverage area is completely located within the first coverage area, it is determined that the non-top-layer layer is completely covered by the top-layer layer; if at least a portion of the second coverage area is located outside the first coverage area, it is determined that the non-top-layer layer is not completely covered by the top-layer layer.
[0163] Optionally, the first vertex is the top-left vertex of the second layer, the second vertex is the bottom-right vertex of the second layer, the third vertex is the top-left vertex of the first layer, and the fourth vertex is the bottom-right vertex of the first layer. Alternatively, the first vertex is the bottom-left vertex of the second layer, the second vertex is the top-right vertex of the second layer, the third vertex is the bottom-left vertex of the first layer, and the fourth vertex is the top-right vertex of the first layer. For example, the coordinates of the top-left vertex of the second layer are (a1, b1), the coordinates of the bottom-right vertex of the second layer are (a2, b2), the coordinates of the top-left vertex of the first layer are (c1, d1), and the coordinates of the bottom-right vertex of the first layer are (c2, d2). Optionally, the coordinates of the aforementioned vertices are coordinates in the screen coordinate system. The screen coordinate system is a rectangular coordinate system with the top-left corner of the screen as the origin, the positive x-axis to the right, and the positive y-axis downwards. Therefore, if a1 is less than or equal to c1, and b1 is less than or equal to d1, and a2 is greater than or equal to c2, and b2 is greater than or equal to d2, meaning the entire coverage area of the non-top layer is located within the coverage area of the top layer, then it is determined that the first layer is completely covered by the second layer. Simultaneously, if the second layer is opaque, then it is determined that the first layer is completely occluded by the second layer. If a1 is greater than c1, b1 is greater than d1, a2 is less than c2, and / or b2 is less than d2, then it is determined that the first layer is completely occluded by the second layer. 2, If at least part of the area covered by a non-top layer is outside the area covered by the top layer, then 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 obscured by the second layer.
[0164] In some embodiments, determining whether the top layer is opaque may include: APS communicating with SF to obtain an image frame to be displayed, the image frame being synthesized based on the top layer and a 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 all greater than or equal to a preset threshold; if the transparency of the multiple pixels is all greater than or equal to the preset threshold, then the top layer is determined to be opaque; if the transparency of some pixels among the multiple pixels is less than the preset threshold, then 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 it. For example, a preset threshold of 255 means that if the transparency of the multiple pixels is all equal to 255, the top layer is determined to be opaque; if the transparency of some pixels among the multiple pixels is less than 255, the top layer is determined to be transparent. Optionally, the preset threshold can also be other values, such as 254, 251, 248, 245, or 240.
[0165] For example, such as Figure 8As shown, 10 pixels are extracted evenly distributed along the central horizontal axis 31 and central vertical axis 32 of the image frame 30 to be displayed, respectively. 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 both the 10 pixels on the central horizontal axis 31 and the 10 pixels on the central vertical axis 32 is equal to 255, then the top layer is determined to be 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, multiple pixels can be evenly distributed from each row and / or each column of the image frame to be displayed.
[0166] S108. If the non-top layer is completely obscured by the top layer, 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.
[0167] The frame rate in the layer information of the top layer is the frame rate required for compositing the top layer. That is, the frame rate used by SurfaceFlinger when compositing the top layer must be greater than or equal to the frame rate required for compositing the top layer. Similarly, the frame rate in the layer information of non-top layers is the frame rate required for compositing the non-top layer. For example, ... Figure 5a As shown, the second layer 14 is the top layer, and the first layer 13 is not the top layer. The second layer 14 completely occludes 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.
[0168] S109. If the frame rate in the layer information of a 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.
[0169] For example, such as Figure 5a As shown, the frame rate of the second layer 14 is 1 FPS, and the frame rate of the first layer 13 is 30 FPS. Since the second layer 14 completely occludes 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.
[0170] Optionally, if the frame rate in the layer information of a non-top-level layer is greater than the frame rate in the layer information of the top-level layer, the 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, the APS sends a control command to the SF. If the value of the fourth flag bit is the eighth preset value, the APS sets the value of the fourth flag bit to the seventh preset value. The fourth flag bit indicates whether to not draw the non-top-level layers of the first application. When the value of the fourth flag bit is the seventh preset value, for example, true, it means that the non-top-level layers of the first application do not need to be drawn; when the value of the fourth flag bit is the eighth preset value, for example, false, it means that the non-top-level layers of the first application need to be drawn.
[0171] In some embodiments, when SF receives a control command, it saves the fourth flag bit and sets its value to the seventh preset value; or it creates a fifth flag bit and sets its value to the ninth preset value. The fifth flag bit indicates whether SF does not draw the non-top-level layer of the first application. When the value of the fifth flag bit is the ninth preset value (e.g., true), it means that SF does not need to draw the non-top-level layer of the first application. When the value of the fifth flag bit is the tenth preset value (e.g., false), it means that SF needs to draw the non-top-level layer of the first application.
[0172] Optionally, combined Figure 7 As can be seen from the flowchart of the display control method shown, the method provided in this application embodiment may further include step S110. There is no necessary temporal relationship between step S110 and steps S105 to S109. Step S110 may be executed before, after or simultaneously with any of steps S105 to S109.
[0173] S110 and SF respond to the call of the layer drawing function, and the layer to be drawn is not the top layer. They determine whether the value of the fourth flag is the seventh preset value. If so, the non-top layer is not drawn.
[0174] Optionally, the layer drawing function is `onDraw()`. When SF receives a control command and calls `onDraw()`, if the layer to be drawn is not the top-level layer and the fourth flag is true, SF returns directly without drawing the non-top-level layer. This way, the frame rate used by SF when compositing layers will not consider the frame rate of the undrawn non-top-level layer, resulting in a frame rate lower than that of the non-top-level layer, thus reducing the power consumption of the electronic device. Conversely, if `onDraw()` is called, the layer to be drawn is not the top-level layer, and the fourth flag is false, SF draws the non-top-level layer.
[0175] For example, SF calls the layer drawing function onDraw(), and the layer to be drawn is... Figure 5a If the first layer 13 (not the top layer) is set to true and SF returns directly without drawing the first layer 13, SF only needs to draw the second layer 14 when compositing layers. Therefore, the frame rate used by SF will not take into account the frame rate of the first layer 13, but will take into account the frame rate of the second layer 14. The frame rate of the first layer 13 is 30 FPS, and the frame rate of the second layer 14 is 1 FPS. Thus, SF uses a frame rate of 1 FPS to draw and composite the second layer 14, instead of 30 FPS, which reduces the power consumption of the electronic device.
[0176] Optionally, combined Figure 7 As can be seen from the flowchart of the display control method shown, the method provided in this application embodiment may further include steps S111 to S117. There is no necessary temporal relationship between steps S111 to S117 and step S110. Steps S111 to S117 may be executed before, after or simultaneously with step S110.
[0177] S111. If the frame rate in the layer information of a 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 the seventh preset value.
[0178] Understandably, if the frame rate in the layer information of a 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. Furthermore, by checking if the value of the fourth flag is the seventh preset value, it can be determined whether a non-top layer has been previously controlled. That is, when the value of the fourth flag is the seventh preset value, it means that a non-top layer has been previously controlled; when the value of the fourth flag is the eighth preset value, it means that a non-top layer has not been previously controlled. Optionally, if the frame rate in the layer information of a non-top layer is less than or equal to the frame rate in the layer information of the top layer, the APS can directly send a command to the SF to cancel control without checking if the value of the fourth flag is the seventh preset value.
[0179] S112. If the value of the fourth flag is the seventh preset value, the APS sends a command to the SF to cancel control.
[0180] If the frame rate of a 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 is the seventh preset value, it indicates that a non-top-level layer has been previously controlled. Therefore, a command to cancel control is sent to SF, causing SF to remove control over the non-top-level layer. If the frame rate in the layer information of a 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 is the eighth preset value, then APS does not perform any action.
[0181] Optionally, if the value of the fourth flag is the seventh preset value, the APS sets the value of the fourth flag to the eighth preset value and sends a command to the SF to cancel control.
[0182] 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 the value of the fifth flag to the tenth preset value. Specifically, when SF calls a layer drawing function, and the layer to be drawn is not the top-level layer, and the value of the fourth flag is the eighth preset value, SF draws the non-top-level layer. For example, when SF calls the onDraw() function, and the layer to be drawn is... Figure 5a When the first layer 13 (not the top layer) is set in the first layer and the value of the fourth flag bit is false, SF draws the first layer 13.
[0183] S113. If the top layer is partially obscured by the top layer, APS traverses all controls on the non-top layer to find a control that is not obscured by the top layer and whose frame rate is greater than that of the top layer.
[0184] Optionally, non-top-level layers are partially obscured by the top-level layer, meaning that non-top-level layers are not completely obscured by the top-level layer.
[0185] Here, the frame rate of a control refers to the frequency at which the first application writes data of the control to the buffer. Optionally, the data of a layer may include data of one or more controls. For example, the first layer (not the top layer) includes a first control and a second control. The first application writes the data of the first control to buffer1 at a frame rate of 30 FPS and writes the data of the second control to buffer2 at a frame rate of 1 FPS. Therefore, the frame rate of the first control is 30 FPS and the frame rate of the second control is 1 FPS.
[0186] Understandably, if the following conditions are met: there are controls in non-top layers that are not obscured by the top layer, and the frame rate of these controls is greater than the frame rate of the top layer, then it means that there are controls in non-top layers with a frame rate greater than the frame rate of the top layer that are not obscured by the top layer. If the following conditions are not met: there are controls in non-top layers that are not obscured by the top layer, and the frame rate of these controls is greater than the frame rate of the top layer, then it means that all controls in non-top layers with a frame rate greater than the frame rate of the top layer are obscured by the top layer.
[0187] In some embodiments, if a control in a non-top-level layer is not obscured by the top-level layer, and the frame rate of that control is greater than the frame rate of the top-level layer, and all controls in the non-top-level layer have not been traversed, then traversal stops. This embodiment stops traversal as soon as a control in a non-top-level layer is found to be not obscured by the top-level layer, and the frame rate of that control is greater than the frame rate of the top-level layer, without needing to traverse all controls in the non-top-level layer, thus reducing traversal time.
[0188] In some embodiments, iterating through all controls on non-top-level layers to see if any control is not obscured by the top-level layer and if the frame rate of that control is greater than the frame rate of the top-level layer is equivalent to determining whether all controls on non-top-level layers with a frame rate greater than the frame rate of the top-level layer are obscured by the top-level layer. Therefore, based on the layer information of the first application, it can be determined whether all controls on non-top-level layers with a frame rate greater than the frame rate of the top-level layer are obscured by the top-level layer. For example, based on the layer information of the first application, iterating through all controls on non-top-level layers to see if any control is not obscured by the top-level layer and if the frame rate of that control is greater than the frame rate of the top-level layer.
[0189] In some embodiments, iterating through all controls on non-top-level layers to determine if a control is not occluded by the top-level layer and has a frame rate greater than that of the top-level layer may include: based on the layer information of the non-top-level layer and the top-level layer, determining if any control on non-top-level layers is not occluded by the top-level layer and has a frame rate greater than that of the top-level layer. This embodiment, by using the layer information of the non-top-level layer and the top-level layer, can accurately determine if any control on non-top-level layers is not occluded by the top-level layer and has a frame rate greater than that of the top-level layer.
[0190] 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. Determining whether there is a control that is not occluded by the top layer and has a frame rate greater than that of the top layer, based on the layer information of the non-top layer and the top layer, can include: for any control in the non-top layer, determining whether the control is not occluded by the top layer based on 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. If the control is not obscured by the top layer and its frame rate is greater than the top layer's frame rate, stop iterating. If the control is not obscured by the top layer and its frame rate is less than or equal to the top layer's frame rate, or if the control is obscured by the top layer and its frame rate is greater than the top layer's frame rate, or if the control is obscured by the top layer and its frame rate is less than or equal to the top layer's frame rate, continue iterating through the next control until there is a control in a non-top layer that is not obscured by the top layer and its frame rate is greater than the top layer's frame rate, or until all controls in non-top layers have been iterated through.
[0191] Optionally, a control being occluded by the top-level layer means that the entire coverage area of the control is completely within the coverage area of the top-level layer, and the coverage area corresponding to the position information of the control in the top-level layer is opaque. A control not being occluded by the top-level layer means that at least a portion of the control's coverage area is outside the coverage area of the top-level layer, or the coverage area corresponding to the position information of the control in the top-level layer is transparent.
[0192] In some embodiments, taking a rectangular layer as an example, the position information in the layer information of the top layer includes the coordinates of the first vertex and the second vertex of the top layer. Taking a rectangular control as an example, the position information of the control includes the coordinates of the fifth vertex and the sixth vertex of the control. Determining whether the control is not occluded by the top layer based on the position information of the control in a non-top layer and the position information of the top layer may include: determining the first coverage area of the top layer based on the coordinates of the first vertex and the second vertex; determining the third coverage area of the control based on the coordinates of the fifth vertex and the sixth vertex; if the third coverage area is completely located within the first coverage area, then determining whether the coverage area corresponding to the position information of the control in the top layer is opaque; if the coverage area corresponding to the position information of the control in the top layer is opaque, then determining that the control is occluded by the top layer; if the coverage area corresponding to the position information of the control in the top layer is transparent or if at least part of the third coverage area is located outside the first coverage area, then determining that the control is not occluded by the top layer.
[0193] S114. If the following conditions are not met: if there are controls in a non-top layer that are not obscured by the top layer, and the frame rate of the controls is greater than the frame rate of the top layer, then APS sends the frame rate of the top layer to SF.
[0194] Understandably, if the following conditions are not met: there are controls in non-top-level layers that are not obscured by the top-level layer, and the frame rate of these controls is greater than the frame rate of the top-level layer (i.e., all controls in non-top-level layers with a frame rate greater than the top-level layer are obscured by the top-level layer), then... For example, ... Figure 9As shown, the first layer 13 (non-top layer) includes a first control 131 and a second control 132. The frame rate of the first control 131 is 30 FPS, the frame rate of the second control 132 is 1 FPS, and the frame rate of the third layer 15 (top layer) is 1 FPS. Therefore, the frame rate of the first control 131 is greater than that of the third layer 15 (top layer), and the frame rate of the second control 132 is the same as that of the third layer 15. Furthermore, the area A in the first layer 13 that is occluded by the third layer 15 includes the first control 131 but excludes the second control 132. Thus, the APS sends the frame rate of the third layer 15 to the SF. The SF uses the frame rate of the third layer 15, i.e., 1 FPS, to composite the first layer 13 and the third layer 15. The composite frame rate of the electronic device is 1 FPS instead of 30 FPS, thus reducing the power consumption of the electronic device. Of course, the SF can also use a larger composite frame rate than 1 FPS to composite the first layer 13 and the third layer 15, for example, using 2 FPS.
[0195] Optionally, if the following conditions are not met: there are controls in non-top-level layers that are not obscured 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. This 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. When the SF receives the frame rate setting message, it sets the composite frame rate of the multiple layers of the first application to the frame rate of the top-level layer.
[0196] In some embodiments, setting the composite frame rate of multiple layers of the first application to the frame rate of the top-level layer includes: the SF setting a timer based on the frame rate of the top-level layer; if the SF acquires a non-top-level layer and the timer has not expired, the SF does not draw the non-top-level layer; if the SF acquires a non-top-level layer and the timer has expired, the 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 duration of 1 second is set. If the SF acquires a non-top-level layer and the timer has not expired, the SF does not draw the non-top-level layer; if the SF acquires a non-top-level layer and the timer has expired, the SF draws the non-top-level layer and resets the timer with a duration of 1 second.
[0197] S115. If the following conditions are met: there is a control in a non-top layer that is not obscured by the top layer, and the frame rate of the control is greater than the frame rate of the top layer, then the APS sends the maximum frame rate among the frame rates of multiple layers to the SF.
[0198] For example, such as Figure 10As 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 30 FPS, the frame rate of the second control 132 is 1 FPS, and the frame rate of the fourth layer 16 (top layer) is 1 FPS. Therefore, the frame rate of the first control 131 is greater than the frame rate of the third layer 15 (top layer), and the frame rate of the second control 132 is the same as the frame rate of the fourth layer 16. Furthermore, the area B in the first layer 13 that is occluded 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 of the frame rates of the first control 131 and the second control 132, which is 30 FPS. Therefore, the APS sends 30 FPS to the SF, and the SF uses 30 FPS to composite the first layer 13 and the fourth layer 16. Of course, SF can also use a frame rate greater than the maximum of the frame rate of the first control 131 and the frame rate of the second control 132 to composite the first layer 13 and the fourth layer 16. For example, SF uses 31 FPS to composite the first layer 13 and the fourth layer 16.
[0199] S116. If the first application is not included in the application whitelist, APS resets the values of the first and second flag bits.
[0200] At this point, the reset first flag bit is the second preset value, and the reset second flag bit is the fourth preset value. For example, APS resets the values of the first and second flag bits to false. Optionally, if the first application is not included in the application whitelist, APS resets the values of the first, second, and fourth flag bits. For example, it resets the values of the first, second, and fourth flag bits to false.
[0201] S117, APS sends the reset second flag bit to SF.
[0202] When SF receives the reset second flag, it sets the previously saved value of the second flag to false, or sets the value of the previously created third flag to false.
[0203] Optionally, the APS sends the reset fourth flag bit to the SF. Upon receiving the reset fourth flag bit, the SF sets the previously saved value of the fourth flag bit to false, or sets the value of the previously created fifth flag bit to false.
[0204] Some embodiments of this application also provide an electronic device, which includes a memory and one or more processors. The memory and processors are coupled. The memory stores computer program code, which includes computer instructions. When the processor executes the computer instructions, the electronic device can perform various functions or steps performed by the electronic device in the above method embodiments. The structure of the electronic device can be referred to... Figure 6 The structure of the electronic device 100 shown.
[0205] This application also provides a chip system including at least one processor and at least one interface circuit. The processor and the interface circuit are interconnected via lines. For example, the interface circuit can be used to receive signals from other devices (e.g., the memory of an electronic device). As another example, the interface circuit can be used to send signals to other devices (e.g., the processor or the touchscreen 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 instructions are executed by the processor, the electronic device can perform the steps in the above embodiments. Of course, the chip system may also include other discrete devices, which are not specifically limited in this application.
[0206] This application also provides a computer-readable storage medium including computer instructions that, when executed on the electronic device, cause the electronic device to perform various functions or steps performed by the electronic device in the above method embodiments.
[0207] The storage medium can be an internal storage unit of the electronic device described in the foregoing embodiments, such as a hard drive or memory of the electronic device. Alternatively, the storage medium can be an external storage device of the electronic device, such as a plug-in hard drive, Smart Media Card (SMC), Secure Digital (SD) card, or Flash Card.
[0208] This application also provides a computer program product that, when run on an electronic device, causes the electronic device to perform various functions or steps performed by the electronic device in the above method embodiments.
[0209] In this embodiment, the electronic devices (such as tablets, mobile phones, etc.), computer-readable storage media, computer program products, or chips are all used to execute the corresponding methods provided above. Therefore, the beneficial effects they can achieve can be referred to the beneficial effects in the corresponding methods provided above, and will not be repeated here.
[0210] Those skilled in the art will understand that all or some of the steps, systems, or apparatuses disclosed above, and their functional modules / units, can be implemented as software, firmware, hardware, or suitable combinations thereof. In hardware embodiments, the division between 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 collaboratively by several physical components. Some or all physical components may be implemented as software executed by a processor, such as a central processing unit, digital signal processor, or microprocessor, or as hardware, or as an integrated circuit, such as an application-specific integrated circuit. Such software may be distributed on a computer-readable medium, which may include computer storage media (or non-transitory media) and communication media (or transient media). As is known to those skilled in the art, the term computer storage media 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 technologies, CD-ROM, digital versatile disc (DVD) or other optical disc storage, magnetic cartridges, magnetic tape, disk storage or other magnetic storage devices, or any other medium that can be used to store desired information and can be accessed by a computer. Furthermore, 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 modulated data signals such as carrier waves or other transmission mechanisms, and may include any information delivery medium.
[0211] It should be understood that the term "and / or" as used in this specification and the appended claims refers to any combination and all possible combinations of one or more of the associated listed items, and includes such combinations. It should be noted that, herein, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or system. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or system that includes that element.
[0212] The sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments. The above descriptions are merely specific embodiments of this application, but the scope of protection of this application is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in this application, and these modifications or substitutions should all be covered within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A display control method characterized by comprising: The method is applied to an electronic device, and the method comprises: In a first time period, a first interface of a first application is displayed, an image frame of the first interface is synthesized based on a first layer, and a frame rate of the electronic device is a first value in the first time period; After the first time period, a second interface of the first application is displayed in response to a first operation; In a second time period during which the second interface is displayed, the second layer is above the first layer in a hierarchy, the first layer is completely occluded by the second layer, and a frame rate of the first layer is greater than a frame rate of the second layer, a frame rate of the electronic device is set to a second value, the second value is less than the first value, an image frame of the second interface is drawn based on the second layer, and the electronic device acquires data of the first layer in the second time period, and the electronic device does not draw the first layer; and a screen refresh rate of the electronic device is adjusted to the second value based on the frame rate of the electronic device; In the second time period during which the second interface is displayed, the second layer is above the first layer in the hierarchy, the first layer is not completely occluded by the second layer, and a region of the first layer that is not occluded by the second layer does not include a first control, and a frame rate of the first control is greater than the frame rate of the second layer, the frame rate of the electronic device is set to the second value, the second value is less than the first value, and an image frame of the second interface is synthesized based on the first layer and the second layer; and the screen refresh rate of the electronic device is adjusted to the second value based on the frame rate of the electronic device.
2. The method of claim 1, wherein, A frequency at which the first application writes data of the first layer to a buffer is a third value, and the third value is greater than the second value.
3. The method of claim 2, wherein, A frequency at which the first application writes data of the second layer to the buffer is a fourth value, and the fourth value is less than the third value.
4. The method of claim 3, wherein, A 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.
5. The method according to any one of claims 1 to 3, characterized in that, In the second time period during which the second interface is displayed, the second layer is above the first layer in the hierarchy, the first layer is not completely occluded by the second layer, and the region of the first layer that is not occluded by the second layer includes the first control, the frame rate of the electronic device is the first value, and the image frame of the second interface is synthesized based on the first layer and the second layer.
6. The method of claim 1, wherein, The method further comprises: After the first operation, a second application sends a management command to a layer management service based on the first layer being completely occluded by the second layer and the frame rate of the first layer being greater than the frame rate of the second layer; The layer management service, after receiving the management command, does not draw the first layer when a layer drawing function is called and a layer to be drawn is the first layer.
7. The method of claim 1, wherein, The method further comprises: After the first operation, the layer management service sends layer information of the first layer and layer information of the second layer to the second application; The second application acquires 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 occluded by the second layer according to the layer information of the first layer and the layer information of the second layer.
8. The method of claim 7, wherein, The method further comprises: After the first operation, the layer management service sends layer information of the first layer and layer information of the second layer to the second application when the second layer is newly created by calling a new layer function.
9. The method according to claim 7 or 8, characterized in that, The method further comprises: After the first operation, if the first application is included in an application white list, the layer management service sends layer information of the first layer and layer information of the second layer to the second application.
10. The method of claim 1, wherein, The setting of the composition frame rate of the electronic device to the second value comprises: 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.
11. An electronic device, comprising: Comprise: A memory and a processor, the memory is coupled with the processor; The memory stores program instructions, when the program instructions are executed by the processor, the electronic device executes the display control method as claimed in any one of claims 1 to 10.
12. A computer-readable storage medium, characterized in that, The computer readable storage medium stores a computer program, when the computer program is executed by the processor, the processor executes the display control method as claimed in any one of claims 1 to 10.
Citation Information
Patent Citations
Method for obtaining application frame rate, refreshing device, mobile terminal and storage medium
CN113791684A
Display processing method and device, product and medium
CN117931329A
Interface rendering method and electronic equipment
CN118227238A