WO2025097978A1 - Image rendering method and electronic device - Google Patents
Image rendering method and electronic device Download PDFInfo
- Publication number
- WO2025097978A1 WO2025097978A1 PCT/CN2024/115971 CN2024115971W WO2025097978A1 WO 2025097978 A1 WO2025097978 A1 WO 2025097978A1 CN 2024115971 W CN2024115971 W CN 2024115971W WO 2025097978 A1 WO2025097978 A1 WO 2025097978A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- component
- focus
- window
- information
- electronic device
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/01—Input arrangements or combined input and output arrangements for interaction between user and computer
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/451—Execution arrangements for user interfaces
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/50—Allocation of resources, e.g. of the central processing unit [CPU]
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T1/00—General purpose image data processing
- G06T1/20—Processor architectures; Processor configuration, e.g. pipelining
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T15/00—3D [Three Dimensional] image rendering
- G06T15/10—Geometric effects
- G06T15/20—Perspective computation
Definitions
- the embodiments of the present application relate to the field of image drawing technology, and in particular to an image rendering method and an electronic device.
- the process of image drawing is generally: the electronic device receives a user's click operation on the application icon displayed on the display screen of the electronic device. In response to the operation, the electronic device receives the first refresh information at the first moment. The electronic device determines the information of the first frame image, such as the information of each control at the first refresh moment. The electronic device renders each control according to the information of the first frame image to complete the rendering of the entire window, and then draws to obtain the first frame image, and sends it to the display screen for display. Since the refresh cycle of the screen of the electronic device is fixed, at the second refresh moment, the electronic device receives the second refresh information and determines the information of the second frame image, such as the information of each control at the second refresh moment.
- the electronic device renders each control according to the information of the second frame image to complete the rendering of the entire window, and then draws to obtain the second frame image, and sends it to the display screen for display.
- the electronic device obtains multiple frame images. These frame images are displayed sequentially on the screen of the electronic device, so that the screen can display an interface with animation effects at a constant frame rate.
- the image rendering method and electronic device provided in the embodiments of the present application give priority to ensuring the high frame rate of the focus component (such as the focus window/focus control), thereby improving the user's performance smoothness experience in high-load scenarios.
- the present application provides an image rendering method
- the execution subject of the method may be an electronic device, or a component located in the electronic device (for example, a chip, a chip system or a processor, etc.), and the following description is made by taking the execution subject being an electronic device as an example.
- the method may include: the electronic device displays a first interface, the first interface includes a first component and a second component, and the first interface is an interface of a first application.
- the electronic device determines whether the first component and the second component are focus nodes within a first refresh cycle based on first information of the first component and first information of the second component.
- the electronic device When the first component is a focus node and the second component is a non-focus node, the electronic device renders the first component through a first process within the first refresh cycle, and renders the second component through a second process, and the rendering priority of the first process is higher than the rendering priority of the second process.
- the first component may be understood as a first window or a first control
- the second component may be understood as a second window or a second control.
- the focus node can be understood as a node that needs to be processed first, such as the node currently operated by the user, that is, the node that the user pays attention to; or the node affected by the input event.
- the electronic device determines whether each component on the interface is a focus node. If the first component is a focus node, the first process of the electronic device renders the first component in real time. If the second component is a non-focus node, the second process of the electronic device renders the second component. In this way, the electronic device only needs to ensure the real-time rendering of the focus node that the user is concerned about, and give priority to ensuring the high frame rate of the focus node (such as the focus window/focus control), thereby ensuring that the image of the focus node is displayed smoothly, without stuttering or white screen phenomenon, and improving the user's performance experience in high-load scenarios.
- the high frame rate of the focus node such as the focus window/focus control
- the method further includes: when the second process has not completed rendering the second component within the first refresh cycle, the electronic device reuses the existing texture image of the second component within the second refresh cycle, and the second refresh cycle is the cycle before the first refresh cycle.
- the second process has not completed rendering the second component
- the existing texture image of the second component can be reused, and there is no need to render the second component in real time. It is sufficient to ensure the real-time rendering of the focus node that the user is concerned about, and give priority to ensuring the high frame rate of the focus node (such as the focus window/focus control).
- the method further includes: the electronic device displays a second interface, the second interface includes a third component, The second interface is an interface of a second application, and the second application is different from the first application.
- the electronic device determines whether the first component, the second component, and the third component are focus nodes in a first refresh cycle according to the first information of the first component, the first information of the second component, and the first information of the third component.
- the electronic device renders the third component through the first process in the first refresh cycle, and renders the first component and the second component through the second process.
- the electronic device determines the rendering priority of each non-focus node. After that, the electronic device renders the components corresponding to each non-focus node according to the rendering priority of each non-focus node, thereby achieving orderly rendering of each component and alleviating the tension of CPU and GPU resources in high-load scenarios.
- the rendering of the first component and the second component through the second process is specifically: the electronic device determines the rendering priority of the first component and the second component according to the second information of the first component and the second information of the second component, and the second information and its weight. When the rendering priority of the first component is higher than the rendering priority of the second component, the electronic device renders the first component and the second component in sequence through the second process.
- the second information includes at least one of the following: a visible window without generated cache, an invisible window without generated cache, a window with generated cache and visible dirty area, a window with generated cache and only invisible dirty area, and a static window with generated cache.
- the first information includes one or more of transparency, a focus window of a window management service, an overlapping order, whether it is blocked, and whether animation is performed.
- the first information includes transparency, and determining whether the first component and the second component are focus nodes in a first refresh cycle according to the first information of the first component and the first information of the second component is specifically:
- the transparency of the first component is greater than the transparency of the second component, it is determined that the first component is a non-focus node and the second component is a focus node.
- the first information includes a focus window of a window management service, and determining whether the first component and the second component are focus nodes in a first refresh cycle according to the first information of the first component and the first information of the second component is specifically:
- the first component When it is detected that the user operates the first component but does not operate the second component, it is determined that the first component is a focus node and the second component is a non-focus node.
- the first information includes a focus window of a window management service, and determining whether the first component and the second component are focus nodes in a first refresh cycle according to the first information of the first component and the first information of the second component is specifically:
- the first component is determined to be a focus node and the second component is determined to be a non-focus node.
- the first information includes a stacking order, and determining whether the first component and the second component are focus nodes in a first refresh cycle according to the first information of the first component and the first information of the second component is specifically:
- the first component is determined to be a focus node and the second component is determined to be a non-focus node.
- the first information includes whether to perform animation, and determining whether the first component and the second component are focus nodes in a first refresh cycle according to the first information of the first component and the first information of the second component is specifically:
- the first component is determined to be a focus node and the second component is determined to be a non-focus node.
- the first information includes transparency, a focus window of a window management service, an overlapping order, whether it is blocked, and whether animation is performed; and determining whether the first component and the second component are focus nodes in a first refresh cycle according to the first information of the first component and the first information of the second component is specifically:
- the first component and the second component transparency and its weight, the focus window of the window management service and its weight, the stacking order and its weight, whether it is blocked and its weight, whether to perform animation and its weight, determine whether the first component and the second component are focus nodes.
- the component includes a window or a control.
- the focus node is a node that needs to be processed first, such as a node currently operated by a user, that is, a node that the user is paying attention to; or a node affected by an input event.
- the present application provides an electronic device, comprising: a display module, a determination module and a rendering module, wherein the display module is used to display a first interface, the first interface includes a first component and a second component, and the first interface is an interface of a first application.
- the determination module is used to determine whether the first component and the second component are focus nodes in a first refresh cycle in response to receiving an operation on the first interface, according to first information of the first component and first information of the second component, and the focus node is a node that the user is concerned about.
- the rendering module is used to render the first component through a first process in the first refresh cycle, and render the second component through a second process when the first component is a focus node and the second component is a non-focus node, and the rendering priority of the first process is higher than the rendering priority of the second process.
- the first component may be understood as a first window or a first control
- the second component may be understood as a second window or a second control.
- the focus node is a node that needs to be processed first, such as a node currently operated by a user, that is, a node that the user is paying attention to; or a node affected by an input event.
- the electronic device determines whether each component on the interface is a focus node. If the first component is a focus node, the first process of the electronic device renders the first component in real time. If the second component is a non-focus node, the second process of the electronic device renders the second component. In this way, the electronic device only needs to ensure the real-time rendering of the focus node that the user is concerned about, and give priority to ensuring the high frame rate of the focus node (such as the focus window/focus control), thereby ensuring that the image of the focus node is displayed smoothly, without stuttering or white screen phenomenon, and improving the user's performance experience in high-load scenarios.
- the high frame rate of the focus node such as the focus window/focus control
- the rendering module is used to reuse the existing texture image of the second component in the second refresh cycle when the second process has not completed rendering the second component in the first refresh cycle, and the second refresh cycle is the cycle before the first refresh cycle.
- the existing texture image of the second component can be reused, and there is no need to render the second component in real time. It is sufficient to ensure the real-time rendering of the focus node that the user is concerned about, and give priority to ensuring the high frame rate of the focus node (such as the focus window/focus control).
- the display module is used to display a second interface, the second interface includes a third component, the second interface is an interface of a second application, and the second application is different from the first application.
- the determination module is used to determine whether the first component, the second component, and the third component are focus nodes in a first refresh cycle in response to an operation on the second interface, according to the first information of the first component, the first information of the second component, and the first information of the third component.
- the rendering module is used to render the third component through the first process in the first refresh cycle, and render the first component and the second component through the second process when the third component is the focus node and the first component and the second component are both non-focus nodes.
- the electronic device determines the rendering priority of each non-focus node. After that, the electronic device renders the components corresponding to each non-focus node according to the rendering priority of each non-focus node, thereby achieving orderly rendering of each component and alleviating the tension of CPU and GPU resources in high-load scenarios.
- the rendering module is used to: determine the rendering priority of the first component and the second component based on the second information of the first component and the second information of the second component, and the second information and its weight; when the rendering priority of the first component is higher than the rendering priority of the second component, render the first component and the second component in sequence through the second process.
- the second information includes at least one of the following: a visible window without generated cache, an invisible window without generated cache, a window with generated cache and visible dirty area, a window with generated cache and only invisible dirty area, and a static window with generated cache.
- the first information includes one or more of transparency, a focus window of a window management service, an overlapping order, whether it is blocked, and whether animation is performed.
- the first information includes transparency
- the determining module is configured to:
- the transparency of the first component is greater than the transparency of the second component, it is determined that the first component is a non-focus node and the second component is a focus node.
- the first information includes a focus window of a window management service
- the determining module is configured to:
- the first component When it is detected that the user operates the first component but does not operate the second component, it is determined that the first component is a focus node and the second component is a non-focus node.
- the first information includes a focus window of a window management service
- the determining module is configured to:
- the first component is determined to be a focus node and the second component is determined to be a non-focus node.
- the first information includes an overlay order
- the determining module is configured to:
- the first component is determined to be a focus node and the second component is determined to be a non-focus node.
- the first information includes whether to perform animation
- the determination module is used to:
- the first component is determined to be a focus node and the second component is determined to be a non-focus node.
- the first information includes transparency, a focus window of a window management service, an overlapping order, whether it is blocked, and whether animation is performed; and the determining module is used to:
- first component and the second component are focus nodes based on the following information of the first component and the second component: transparency and its weight, focus window of the window management service and its weight, stacking order and its weight, whether it is blocked and its weight, whether it is animated and its weight.
- the component includes a window or a control.
- the focus node is a node that needs to be processed first, such as a node currently operated by a user, that is, a node that the user is paying attention to; or a node affected by an input event.
- the present application provides an electronic device, comprising: one or more processors; and a memory, wherein the memory stores a code; when the code is executed by the processor, the electronic device executes the method described in the first aspect.
- the present application provides a computer-readable storage medium, which includes computer instructions.
- the computer instructions When the computer instructions are executed on an electronic device, the electronic device executes the method described in the first aspect.
- FIG1 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application.
- FIG2 is a schematic diagram of the architecture of the combination of software and hardware of the display system of the electronic device provided in an embodiment of the present application;
- FIG3-1 is a schematic diagram of a flow chart of an image rendering method provided in an embodiment of the present application.
- FIG3-2 is a schematic diagram of a flow chart of an image rendering method provided in an embodiment of the present application.
- FIG4 is a logic diagram of a separate rendering provided by an embodiment of the present application.
- FIG5 is a logic diagram of unified rendering provided by an embodiment of the present application.
- FIG. 6 is a schematic diagram of a main and secondary thread node processing timing of an image rendering method provided by an embodiment of the present application
- FIG7 is a schematic diagram of a flow chart of an image rendering method provided in an embodiment of the present application.
- FIG8 is a schematic diagram of an interface of another electronic device provided in an embodiment of the present application.
- FIG9 is a schematic diagram of an interface of another electronic device provided in an embodiment of the present application.
- FIG. 10 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application.
- a window is a basic unit in a graphical user interface that an application sets up to use data. It is a visual interface of an application. The application and data are integrated in the window. In the window, users can operate the application in the window to manage, generate and edit data.
- a window is a container for controls, and each window has its own controls (or views, etc.).
- a control is a graphical user interface element, such as a window or text box, whose displayed arrangement of information can be changed by the user.
- a control is included in an application and controls all data processed by the application and the interactions with that data. Interoperability.
- the process of drawing the above interface is generally: the electronic device receives an operation on the interface displayed on the display screen of the electronic device.
- the electronic device receives a user's click operation on an icon (such as an icon for setting an application) displayed on the display screen of the electronic device.
- the electronic device receives the first refresh information at the first moment.
- the electronic device determines the information of the first frame image, such as the information of each control at the first refresh moment.
- the electronic device renders each control according to the information of the first frame image to complete the rendering of the entire window, and then draws to obtain the first frame image, and sends it to the display screen for display.
- the electronic device Since the refresh cycle of the screen of the electronic device is fixed, at the second refresh moment, the electronic device receives the second refresh information and determines the information of the second frame image, such as the information of each control at the second refresh moment. The electronic device renders each control according to the information of the second frame image to complete the rendering of the entire window, and then draws to obtain the second frame image, and sends it to the display screen for display. In this way, by analogy, the electronic device obtains multiple frame images. These frame images are displayed sequentially on the screen of the electronic device, so that the screen can display an interface with animation effects at a constant frame rate.
- each control and each window needs to be rendered during the drawing process.
- more controls and windows need to be rendered, and frame loss, white screen, freeze, etc. may occur, affecting the user experience.
- the present application provides an image rendering method, which is applied to an electronic device, and the method may include: the electronic device displays a first interface, the interface includes a first component and a second component, and the first component and the second component can be windows or controls.
- the electronic device determines whether the first component and the second component are focus nodes in the first refresh cycle, and the focus node is a node that the user is concerned about.
- the first component is a focus node and the second component is a non-focus node
- the first component is rendered by the first process in the first refresh cycle
- the second component is rendered by the second process
- the rendering priority of the first process is higher than the rendering priority of the second process.
- the electronic device determines whether each component on the interface is a focus node. If the first component is a focus node, the first process of the electronic device renders the first component in real time. If the second component is a non-focus node, the second process of the electronic device renders the second component, and the texture image of the existing second component can be reused when the second process has not finished rendering the second component.
- the electronic device only needs to ensure the real-time rendering of the focus node that the user is concerned about, and give priority to ensuring the high frame rate of the focus node (such as the focus window/focus control), so as to ensure that the image of the focus node is displayed smoothly without any stuttering or white screen phenomenon, thereby improving the user's performance experience in high-load scenarios.
- the high frame rate of the focus node such as the focus window/focus control
- FIG1 is a structural block diagram of an electronic device provided in an embodiment of the present application.
- the electronic device 100 may include a processor 110, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, a memory 120, an antenna 1, a wireless communication module 160, a display screen 170, and a sensor module 150, etc.
- the sensor module 150 may include a pressure sensor 150A, a touch sensor 150B, etc.
- the structure illustrated in the embodiments of the present application does not constitute a specific limitation on the electronic device.
- the electronic device may include more or fewer components than shown in the figure, or combine certain components, or split certain components, or arrange the components differently.
- the components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
- the processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and/or a neural-network processing unit (NPU), etc.
- AP application processor
- GPU graphics processor
- ISP image signal processor
- DSP digital signal processor
- NPU neural-network processing unit
- Different processing units may be independent devices or integrated in one or more processors.
- the controller can generate operation control signals according to the instruction operation code and timing signal to complete the control of instruction fetching and execution.
- the processor 110 may also be provided with a memory for storing instructions and data.
- the memory in the processor 110 is a cache memory.
- the memory may store instructions or data that the processor 110 has just used or cyclically used. If the processor 110 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.
- the charging management module 140 is used to receive charging input from a charger.
- the charger can be a wireless charger or a wired charger.
- the charging management module 140 can receive charging input from a wired charger through the USB interface 130.
- the charging management module 140 can receive wireless charging input through a wireless charging coil of the electronic device. While the charging management module 140 is charging the battery 142, it can also charge the battery 142 through the power management module 141. Provides power to electronic devices.
- 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, and supplies power to the processor 110, the display screen 170, and the wireless communication module 160.
- the power management module 141 can also be used to monitor parameters such as battery capacity, battery cycle number, battery health status (leakage, impedance), etc.
- the power management module 141 can also be set in the processor 110.
- the power management module 141 and the charging management module 140 can also be set in the same device.
- the wireless communication function of the electronic device can be implemented through the antenna 1, the wireless communication module 160, the modem processor and the baseband processor.
- Antenna 1 is used to transmit and receive electromagnetic wave signals.
- Each antenna in the electronic device can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve the utilization of the antenna.
- antenna 1 can be reused as a diversity antenna for a wireless local area network.
- the antenna can be used in combination with a tuning switch.
- the wireless communication module 160 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) network), bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR) and the like applied to electronic devices.
- WLAN wireless local area networks
- BT wireless fidelity
- GNSS global navigation satellite system
- FM frequency modulation
- NFC near field communication
- IR infrared
- the wireless communication module 160 can be one or more devices integrating at least one communication processing module.
- the wireless communication module 160 receives electromagnetic waves via the antenna 1, modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 110.
- the wireless communication module 160 can also receive the signal to be sent from the processor 110, modulate the frequency, amplify it, and convert it into electromagnetic waves for radiation through the antenna 1.
- the wireless communication module 160 receives application information sent by the server.
- the electronic device implements the display function through a GPU, a display screen 170, and an application processor.
- the GPU is a microprocessor for image processing, connecting the display screen 170 and the application processor.
- the GPU is used to perform mathematical and geometric calculations for graphics rendering.
- the processor 110 may include one or more GPUs that execute program instructions to generate or change display information.
- the display screen 170 is used to display images, videos, etc.
- the display screen 170 includes a display panel.
- the display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-oLed, quantum dot light-emitting diodes (QLED), etc.
- the electronic device may include 1 or N display screens 170, where N is a positive integer greater than 1.
- the memory 120 may be used to store computer executable program codes, which include instructions.
- the memory 120 may include a program storage area and a data storage area.
- the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.
- the data storage area may store data created during the use of the electronic device (such as audio data, a phone book, etc.), etc.
- the memory 120 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc.
- the processor 110 executes various functional applications and data processing of the electronic device by running instructions stored in the memory 120 and/or instructions stored in a memory provided in the processor.
- the pressure sensor 150A is used to sense the pressure signal and can convert the pressure signal into an electrical signal.
- the pressure sensor 150A can be set on the display screen 170.
- the capacitive pressure sensor can be a parallel plate including at least two conductive materials. When a force acts on the pressure sensor 150A, the capacitance between the electrodes changes. The electronic device determines the intensity of the pressure based on the change in capacitance. When a touch operation acts on the display screen 170, the electronic device detects the touch operation intensity according to the pressure sensor 150A. The electronic device can also calculate the touch position according to the detection signal of the pressure sensor 150A.
- touch operations acting on the same touch position but with different touch operation intensities can correspond to different operation instructions. For example: when a touch operation with a touch operation intensity less than the first pressure threshold acts on the short message application icon, an instruction to view the short message is executed. When a touch operation with a touch operation intensity greater than or equal to the first pressure threshold acts on the short message application icon, an instruction to create a new short message is executed.
- the touch sensor 150B is also called a "touch control device”.
- the touch sensor 150B can be set on the display screen 170.
- the touch sensor 150B and the display screen 170 form a touch screen, also called a "touch control screen”.
- the touch sensor 150B is used to detect a touch operation acting on or near it.
- the touch sensor can pass the detected touch operation to the application processor to determine the type of touch event.
- Visual output related to the touch operation may be provided through the display screen 170.
- the touch sensor 150B may also be disposed on the surface of the electronic device, at a position different from that of the display screen 170.
- the electronic device may also include other functional units, which are not limited in the embodiments of the present application.
- the above-mentioned electronic devices can be mobile phones, tablet computers, laptops, notebook computers, ultra-mobile personal computers (UMPC), handheld computers, netbooks, personal digital assistants (PDA), wearable electronic devices and other devices.
- UMPC ultra-mobile personal computers
- PDA personal digital assistants
- the specific form of the electronic devices is not particularly limited in the embodiments of the present application.
- the software system of the electronic device 100 may adopt a layered architecture, an event-driven architecture, a micro-kernel architecture, a micro-service architecture, or a cloud architecture.
- a layered architecture adopted by the software system of the electronic device 100 as an example, in combination with the image rendering scheme described in FIG. 2
- FIG. 2 shows a schematic diagram of the structure of the combination of software and hardware of the electronic device 100 in the image rendering scheme.
- the layered architecture divides the software into several layers, each with a clear role and division of labor.
- the layers communicate with each other through software interfaces.
- the electronic device 100 includes at least: an application layer (or application program layer), an application architecture layer, a system service layer and a hardware layer.
- the application layer includes a series of application packages, such as settings, desktop, system applications, third-party applications, game applications, video applications, etc.
- Third-party applications may include but are not limited to third-party applications downloaded from application markets, such as social applications, shopping applications (not shown in the figure), etc.
- the windows/controls of each application may be rendered separately, or they may be rendered uniformly by the rendering service, and the rendered windows may be submitted to the synthesizer of the system service layer for synthesis.
- the application in the application layer may submit rendering instructions to the rendering service in the system service layer to complete the rendering of the application interface, etc.
- the application architecture layer may include Rosen rendering backend, user program framework, Ability framework, and Window.
- the system service layer includes rendering service, window manager service (WMS), data management service (DMS), production management system (PMS), application management service (AMS), intranet management system (IMS) and compositor.
- WMS is used to manage the windows of each application, such as desktop window, SystemUI window, negative one screen window, etc.
- WMS can manage window type, window level, window position, calculate window layout, and perform window form (such as full screen, floating window, split screen, maximize, minimize, etc.) switching management.
- the rendering service includes an animation module and a unified rendering module.
- the animation module can be used to modify the properties (such as position, size, etc.) of the control in each frame (or image) included in the animation to generate an animation effect.
- the properties of the control are different in different frames.
- the above-mentioned animation module may also be located in the application layer and executed through the application user interface (UI) thread of the application.
- UI application user interface
- the unified rendering module can perform rendering services based on the unified rendering mechanism, which can also be called the unified rendering service.
- the unified rendering mechanism means that the unified rendering module can receive rendering nodes of all applications and then render all rendering nodes of all applications together. Specifically, it can traverse all rendering nodes based on the control properties modified by the animation module to complete the rendering operation, and then send the rendering results to the display screen for display.
- a rendering node may also be referred to as a layer, a layer or other names.
- the hardware layer includes a synthesizer, which can be used to synthesize the layers corresponding to each window, such as the desktop layer, the SystemUI layer, the negative one screen layer, etc.
- the desktop window corresponds to the desktop layer
- the SystemUI window corresponds to the SystemUI layer
- the negative one screen window corresponds to the negative one screen layer
- the synthesizer may include a hardware synthesizer and a graphics processing unit (GPU), etc.
- the software and hardware combined architecture of the electronic device 100 shown in FIG2 is only an exemplary description. In actual applications, it may also include more or fewer modules, and the levels to which each module belongs may also be different. For example, there may also be a framework module between the unified application and the rendering service. Each level may also have other division methods, and this application does not limit this.
- FIG3-1 and FIG3-2 are schematic flow charts of an image rendering method provided in an embodiment of the present application. As shown in FIG3-2 , the method is applied to an electronic device. The method may include:
- An electronic device displays a first interface, where the first interface includes at least one component, such as a first component and a second component, and the first interface is an interface of a first application.
- first component and the second component may belong to the same application.
- the above components can be understood as windows or controls. Accordingly, the first component can be understood as the first window or the first control, and the second component can be understood as the second window or the second control. Similarly, the subsequent third component can also be understood as the third window or the third control.
- a window is a container for controls, and each window has its own control (or view, or widget, etc.).
- a control is a graphical user interface element, such as a window or text box, whose displayed arrangement of information can be changed by the user.
- a control is a basic visual building block included in an application, controlling all data processed by the application and the interactive operations on the data.
- a window is the most important part of a user interface. It is a rectangular area on the screen of an electronic device corresponding to an application and is a visual interface of an application.
- the application creates and displays a window.
- the user can also perform various operations on the window, such as: when the user operates an object in the window, the application will respond accordingly.
- the user can terminate the operation of the application by closing the window.
- the user can also select the corresponding application by selecting the window.
- the electronic device determines whether the first component and the second component are focus nodes in a first refresh cycle, where the focus node is a node that the user is paying attention to.
- step 1 in response to receiving an operation on the interface of the application, the focus node determination module of the electronic device determines whether the first component and the second component are focus nodes within the first refresh cycle.
- the operation can be understood as any operation on the first interface, such as a click operation, a browse operation, a slide operation, an edit operation, a cursor touch operation, etc.
- S302 may be specifically implemented as follows: the electronic device determines, according to the first information of the first component and the second component, whether the first component and the second component are focus nodes in a first refresh cycle.
- the first information is used to distinguish between focus nodes and non-focus nodes. Since the determination of focus nodes and non-focus nodes is based on the user's attention, that is, the component that the user pays attention to is the focus node, and the component that the user does not pay attention to is the non-focus node. Therefore, the first information tends to be more visible information, so the first information can include one or more of transparency, the focus window of the window management service, the stacking order (z-order), whether it is blocked, and whether animation is performed.
- the first information includes transparency
- S302 can be specifically implemented as follows: when the transparency of the first component is greater than the transparency of the second component, the electronic device determines that the first component is a non-focus node and the second component is a focus node. Exemplarily, assuming that the first information of the first component includes a transparency of 50%, and the first information of the second component includes a transparency of 10%, and 50%>10%, the electronic device determines that the first component is a non-focus node and the second component is a focus node.
- the first information includes the focus window of the window management service, that is, the window management service detects the user's window operation, for example, the window management service detects the component that the mouse is hovering over, or the window management service detects that the display position of the component is located in the middle area of the display screen, or the window management service detects the component affected by the user's input event.
- S302 can be specifically implemented as follows: when it is detected that the user operates the first component and does not operate the second component, the electronic device determines that the first component is the focus node and the second component is the non-focus node. Exemplarily, the first component is the first window and the second component is the second window. When the user edits on the first window, it means that the user pays more attention to the first window. At this time, the electronic device detects the user's operation and determines that the first window is the focus window and the second window is the non-focus window.
- the first information includes a focus window of a window management service, for example, the window management service detects the user's sight.
- S302 can be specifically implemented as follows: when it is detected that the user's sight falls on the first component and does not fall on the second component, the electronic device determines that the first component is a focus node and the second component is a non-focus node.
- the first information includes a stacking order
- S302 can be specifically implemented as follows: when the stacking order of the first component is the top layer, and the stacking order of the second component is the bottom layer, that is, the setting level of the first component is closer to the user interface than the setting level of the second component. At this time, the electronic device determines that the first component is a focus node and the second component is a non-focus node.
- the first information includes whether to perform animation
- S302 can be specifically implemented as follows: when the image of the first component When the image is a multi-frame image (ie, animation or video display) and the image of the second component is a single-frame image (ie, picture display), the electronic device determines that the first component is a focus node and the second component is a non-focus node.
- the first information includes whether it is blocked
- S302 can be specifically implemented as follows: when it is detected that the first component is not blocked and the second component is blocked, the electronic device determines that the first component is a focus node and the second component is a non-focus node.
- the first information may include transparency and whether it is blocked, or the first information may include the stacking order and the focus window of the window management service, or the first information may include transparency, whether to animate, and whether it is blocked.
- the embodiments of the present application are not specifically limited.
- the electronic device can determine whether each component is a focus node based on each dimensional information and its weight.
- the first information includes transparency, the focus window of the window management service, the stacking order, whether it is blocked, and whether animation is performed.
- the weight of a large transparency is 0, and the weight of a small transparency is 1; the focus window of the window management service is 1, and the non-focus window of the window management service is 0; the weight of a stacking order closer to the user is 1, and vice versa; the weight of a blocked window is 0, and the weight of a non-blocked window is 1; the weight of an animated window is 1, and the weight of a non-animated window is 0.
- the first information of the first component may include: the user operates the first component, the transparency is 50%, the stacking order is the top layer, it is not blocked, and animation is performed; the first information of the second component may include: the transparency is 10%, the stacking order is the bottom layer, it is blocked, and no animation is performed.
- the first information of the first component may include: the first component is located in the middle of the display area, is not blocked, and is animated; the first information of the second component may include: the first component is located in the lower part of the display area, is not blocked, and is animated.
- two rendering architectures to which the technical solution provided by the embodiment of the present application can be applied are first introduced here.
- These two rendering architectures can include a separate rendering architecture and a unified rendering architecture. That is, the graphics architecture of the operating system of the electronic device provided by the embodiment of the present application can adopt a separate rendering architecture or a unified rendering architecture.
- the specific contents are as follows:
- FIG4 shows a logic diagram of separate rendering.
- each application window (referred to as window) can be rendered through a control tree and a rendering tree.
- the rendering tree is a data structure for generating an application program interface. That is, the rendering tree records all the information for generating a frame of the application program.
- the control tree of the window may include multiple control modules (or controls), such as a root control, control 1, control 2, control 3, etc.
- Each control includes control information of the corresponding control, such as control 1 includes control information of control 1 in the window (such as the display position, etc.), and the control information can be used to control the display of control 1.
- Each control in the control tree corresponds to each rendering node in the rendering tree.
- the rendering tree may include multiple rendering nodes, such as rendering node 0, rendering node 1, rendering node 2, rendering node 3, etc.
- the root control may correspond to rendering node 0, control 1 may correspond to rendering node 1, control 2 may correspond to rendering node 2, and control 3 may correspond to rendering node 3.
- rendering node 2 is assigned to the first process for rendering, that is, the first process renders control 2 according to the control information of control 2.
- Rendering node 0, rendering node 1, and rendering node 3 are assigned to the second process for rendering. That is, the second process renders the root control according to the control information of the root control, the second process renders control 1 according to the control information of control 1, and the second process renders control 3 according to the control information of control 3. Then, the rendering results of each process are submitted to the synthesizer, wherein each application window corresponds to a layer in the synthesizer, and the synthesizer can synthesize each application window, that is, synthesize the layer corresponding to each application window.
- the rendering tree may also be referred to as a layer tree, a layer tree, or other names.
- the hierarchical relationship of each window, the size of the window, etc. are managed by the window manager service (WMS). That is, the hierarchical management and size of the layers corresponding to each window are managed by WMS.
- WMS window manager service
- FIG5 shows a logic diagram of a unified rendering mechanism provided by an embodiment of the present application.
- the unified rendering architecture has a unified application, which can be used to abstract each window into a control for management, and each window is a control in the unified application.
- the unified application can manage controls 1, The layout and hierarchy of various controls such as control 2, container control 3, window control 4, and status bar control 5.
- control 1 and control 2 can be existing defined controls, such as icons.
- Both window control 4 and status bar control 5 can be child nodes of container control 3.
- the unified application can generate a corresponding rendering tree based on the control tree.
- the rendering nodes in the generated rendering tree can include a root rendering node and rendering nodes 1 to 5, and the unified application submits the rendering tree to the rendering service.
- control 1 corresponds to rendering node 1
- control 2 corresponds to rendering node 2
- container control 3 corresponds to rendering node 3
- window control 4 corresponds to rendering node 4
- status bar control 5 corresponds to rendering node 5.
- the rendering service traverses each rendering node and determines whether each rendering node is a focus node according to the above description, and assigns the focus node to the main thread (i.e., the first process mentioned above) for rendering, and assigns the non-focus node to the secondary thread (i.e., the second process mentioned above) for rendering, so as to complete the rendering of the entire interface. Subsequently, the rendering result can be directly sent to the display screen for display.
- the unified application can be understood as a virtualized application (or service) with the functions of various applications such as WMS, desktop, SystemUI, etc.
- the unified application can have functions similar to WMS, such as managing the position, size, and hierarchy of various controls (such as but not limited to window controls, etc.), and having functions such as split screen and full screen gesture management. It can also have functions similar to the desktop, such as managing icons, etc., and having functions such as multi-tasking gesture management, etc.
- the process with a high rendering priority renders the focus node
- the process with a low rendering priority renders the non-focus node.
- the focus node is rendered in real time to ensure a high frame rate
- the non-focus node is rendered while ensuring the real-time rendering of the focus node, so as to improve the user's experience of the smooth performance of the graphics of the focused node.
- window A is the focus node and window C is the non-focus node
- the electronic device receives the first refresh signal
- the first process of the electronic device renders window A
- the second process of the electronic device renders window C, and displays the rendered image on the screen.
- step 2 the focus node determination module of the electronic device determines that the first component is a focus node and the second component is a non-focus node. Afterwards, the focus node determination module of the electronic device sends the determination result to the rendering service of the electronic device, and the rendering service assigns the rendering task corresponding to the first component to the first process for rendering, and assigns the rendering task corresponding to the second component to the second process for rendering according to the determination result.
- the electronic device determines whether each component on the interface is a focus node. If the first component is a focus node, the first process of the electronic device renders the first component in real time. If the second component is a non-focus node, the second process of the electronic device renders the second component. In this way, the electronic device only needs to ensure the real-time rendering of the focus node that the user is concerned about, and gives priority to ensuring the high frame rate of the focus node (such as the focus window/focus control), thereby ensuring that the image of the focus node is displayed smoothly, without stuttering or white screen phenomenon, and improving the user's performance smoothness experience in high-load scenarios.
- the electronic device only needs to ensure the real-time rendering of the focus node that the user is concerned about, and gives priority to ensuring the high frame rate of the focus node (such as the focus window/focus control), thereby ensuring that the image of the focus node is displayed smoothly, without stuttering or white screen phenomenon, and improving the user's performance smoothness
- the cached texture image of the second component will be reused.
- the focus node is rendered in real time to ensure a high frame rate; for the nodes that the user is not concerned about (i.e., non-focus nodes), while ensuring the real-time rendering of the focus node, when the rendering of the non-focus node is not completed, the existing texture image of the non-focus node is reused, thereby improving the user's experience of the smooth performance of the graphics of the focused node.
- the electronic device when the electronic device receives the first refresh signal, the first process of the electronic device renders window A, and the second process of the electronic device renders window C.
- the electronic device displays the image rendered by the first process and the existing texture image of window C (such as the image rendered within the second refresh cycle) on the screen.
- the texture image of window C is cached.
- step 3 the rendering service of the electronic device sends the rendered image to the synthesizer, which synthesizes the rendering results. Then, in step 4, the synthesizer sends the synthesized image to the display screen for display.
- the embodiment of the present application is not limited to the first component and the second component, and may also include a third component, which may belong to the same application as the first component and the second component, or may not belong to the first component and the second component.
- a third component which may belong to the same application as the first component and the second component, or may not belong to the first component and the second component.
- FIG7 is a flow chart of an image rendering method provided by the embodiment of the present application. As shown in FIG7, the method provided by the embodiment of the present application includes the above-mentioned S301, and the method also includes:
- the electronic device displays a second interface, where the second interface includes a third component and is an interface of a second application, which is different from the first application.
- S702 may refer to the above S302, which will not be repeated here.
- the electronic device renders the first component and the second component through the second process, which may be:
- the electronic device determines the rendering priority of the first component and the second component according to the second information of the first component and the second information of the second component, and the second information and the weight thereof.
- the second information is different from the first information, and the second information is used to distinguish the rendering priority of non-focus nodes. That is, the rendering order of non-focus nodes can be determined by the second information. Therefore, the second information is more inclined to the information of rendering urgency, so the second information can include at least one of the following: a visible window without generated cache, an invisible window without generated cache, a window with generated cache and visible dirty area, a window with generated cache and only invisible dirty area, and a static window with generated cache.
- ⁇ _i is the weight corresponding to the i-th feature
- f_i is the i-th feature
- the second information includes a visible window without a generated cache, an invisible window without a generated cache, a window with a generated cache and a visible dirty area, a window with a generated cache and only an invisible dirty area, and a static window with a generated cache.
- the weights of these information are decreasing in sequence, for example, the weight of a visible window without a generated cache is 5, the weight of an invisible window without a generated cache is 4, the weight of a window with a generated cache and a visible dirty area is 3, the weight of a window with a generated cache and only an invisible dirty area is 2, and the weight of a static window with a generated cache is 1.
- Example 1 If the second information of the first component is a visible window without generating a cache, and the second information of the second component is an invisible window without generating a cache, then the priority of the first component is 5, and the priority of the second component is 4.
- Example 2 If the second information of the second component is a static window for generating cache, and the second information of the first component is a window for generating cache and having only invisible dirty areas, then the priority of the first component is 2, and the priority of the second component is 1.
- the second process of the electronic device renders the first component first and then the second component.
- the second process of the electronic device renders the first component first and then the second component.
- the electronic device determines the rendering priority of each non-focus node. Thereafter, the electronic device renders the components corresponding to each non-focus node according to the rendering priority of each non-focus node, thereby achieving orderly rendering of the components and alleviating the tension of CPU and GPU resources in high-load scenarios.
- Scenario 1 Rendering of different controls in the same window of the same application.
- FIG8 is a schematic diagram of an interface of an electronic device provided by the present application.
- the electronic device 100 displays an interface 801, and the interface 801 displays common controls 1, video controls 2, and video controls 3.
- the interface 801 corresponds to the root control, that is, to the rendering node 0;
- the common control 1 corresponds to the control 1, that is, to the rendering node 3;
- video control 2 corresponds to control 2, that is, corresponding to rendering node 2;
- video control 3 corresponds to control 3, that is, corresponding to rendering node 3.
- the video control 2 of the interface 801 is located in the middle area of the display screen.
- the electronic device 100 can detect that: ordinary control 1 is located in the upper area of the display screen, and the image of video control 2 is a single-frame image; video control 2 is located in the middle area of the display screen, and the image of video control 2 is a multi-frame image; video control 3 is located in the lower area of the display screen, and the image of video control 3 is a multi-frame image.
- the weight of the control located in the middle area is 1, otherwise it is 0, the weight of the control that is animated is 1, and the weight of the control that is not animated is 0.
- the electronic device 100 determines that the video control 2 is the focus node, and the common control 1 and the video control 3 are non-focus nodes. Further, since the common control 1 is a static window that generates a cache, and the video control 3 is a visible window that does not generate a cache, the electronic device 100 can determine that the rendering priority of the video control 3 is higher than the rendering priority of the common node 1.
- the electronic device 100 assigns the video control 2 to the first process, and the common control 1 and the video control 3 to the second process.
- the first process of the electronic device 100 renders the video control 2 in real time and displays the rendered image on the screen.
- the second process of the electronic device 100 renders the video control 3 first, and then renders the common control 1. If the second process does not complete the rendering of the common control 1 and the video control 3 within the first refresh cycle, the electronic device 100 displays the existing texture images of the common control 1 and the video control 3 on the screen. It can be seen that the electronic device can ensure the real-time rendering of the video control 2, so that the animation of the video control 2 is smooth and satisfies the user's experience. Moreover, the rendering of the ordinary control 1 and the video control 3 does not interfere with the video control 2, and if the rendering is not completed, the existing texture image can be used to further ensure the smooth animation of the video control 2 and effectively prevent the video control 2 from freezing.
- Scenario 2 Rendering of different windows in different applications.
- FIG9 is a schematic diagram of an interface of an electronic device provided by the present application.
- the electronic device 100 displays an interface 901, on which window 1, window 2 and window 3 are displayed.
- the interface 901 corresponds to the root control, that is, the root rendering node;
- window 1 corresponds to control 1, that is, the rendering node 1;
- window 2 corresponds to container control 3, that is, the rendering node 3;
- window 3 corresponds to control 2, that is, the rendering node 2.
- the electronic device 100 detects that: the stacking order of window 1 is the bottom layer; the stacking order of window 2 is the middle layer; the stacking order of window 3 is the top layer, and window 3 is the window where the mouse is suspended. At this time, it is assumed that the weight of the stacking order closer to the user is 1, otherwise it is 0. Then, the electronic device can determine that the score of window 1 is 0, the score of window 2 is 0, and the score of window 3 is 1, 1>0, which means that the user is more concerned about window 3. At this time, the electronic device 100 determines that window 3 is the focus node, and window 1 and window 2 are non-focus nodes.
- window 1 is a static window for generating cache
- window 2 is a visible window for generating cache
- the electronic device 100 can determine that the rendering priority of window 2 is higher than the rendering priority of window 1. Then, the electronic device 100 assigns window 3 to the first process for rendering, and assigns window 1 and window 2 to the second process for rendering.
- the first process of the electronic device 100 renders window 3 in real time, and displays the rendered image on the screen.
- the second process of the electronic device 100 renders window 2 first, and then renders window 1. If the second process does not complete the rendering of window 1 and window 2 within the first refresh cycle, the electronic device 100 displays the existing texture images of window 1 and window 2 on the screen.
- the electronic device can ensure the real-time rendering of window 3, so that window 3 is rendered and displayed in real time as a focus node in a high-load scenario to meet the user's experience.
- window 1 and window 2 can use existing texture images to further ensure the smooth performance of window 3 and effectively prevent window 3 from freezing.
- the electronic device includes a hardware structure and/or software module corresponding to the execution of each function.
- the embodiment of the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer-driven hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the technical solution of the embodiment of the present application.
- the present application is an embodiment that can divide the electronic device into functional modules according to the above method example.
- each functional module can be divided according to each function, or two or more functions can be integrated into one processing unit.
- the unit can be implemented in the form of hardware or software functional modules. It should be noted that the division of the units in the embodiment of the present application is schematic and is only a logical function division. There may be other division methods in actual implementation.
- FIG10 it is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application, and the electronic device 1000 can be used to implement the methods described in the above method embodiments.
- the electronic device 1000 may specifically include: a display unit 1001 and a processing unit 1002 .
- the display unit 1001 is used to support the electronic device 1000 to perform step S301 in FIG. 3-2 or steps S301 and S701 in FIG. 7. And/or, the display unit 1001 is also used to support the electronic device 1000 to perform other steps performed by the electronic device in the embodiment of the present application.
- the processing unit 1002 is used to support the electronic device 1000 to perform steps S302 to S304 in Figure 3-2, or steps S702 to S703 in Figure 7. And/or, the processing unit 1002 is also used to support the electronic device 1000 to perform other steps performed by the electronic device in the embodiment of the present application.
- the electronic device 1000 shown in FIG. 10 may further include a communication unit 1003, where the communication unit 1003 is used to support the electronic device 1000 in executing the steps of communication between the electronic device and other devices in the embodiments of the present application.
- the electronic device 1000 shown in FIG10 may further include a storage unit (not shown in FIG10 ), which stores a program or instruction.
- a storage unit not shown in FIG10
- the processing unit 1002 executes the program or instruction
- the electronic device 1000 shown in FIG10 may execute the method shown in FIG3-2 , etc.
- the technical effects of the electronic device 1000 shown in FIG. 10 can refer to the technical effects of the methods shown in FIG. 3-2, etc., and will not be repeated here.
- the processing unit 1002 involved in the electronic device 1000 shown in FIG. 10 can be implemented by a processor or a processor-related circuit component, which can be a processor or a processing module.
- the communication unit can be implemented by a transceiver or a transceiver-related circuit component, which can be a transceiver or a transceiver module.
- the display unit 1001 can be implemented by display screen-related components.
- each step in the above method embodiment can be completed by an integrated logic circuit of hardware in a processor or by instructions in the form of software.
- the method steps disclosed in the embodiments of the present application can be directly embodied as being executed by a hardware processor, or by a combination of hardware and software modules in a processor.
- An embodiment of the present application also provides a computer-readable storage medium, including instructions, which, when executed on a computer, enable the computer to execute any of the above methods.
- the embodiment of the present application also provides a computer program product including instructions, which, when executed on a computer, enables the computer to execute any of the above methods.
- An embodiment of the present application also provides a chip, which includes a processor and an interface circuit, the interface circuit is coupled to the processor, the processor is used to run a computer program or instruction to implement the above method, and the interface circuit is used to communicate with other modules outside the chip.
- A/B can mean A or B.
- “And/or” in this article is merely a description of the association relationship of associated objects, indicating that three relationships may exist.
- a and/or B can mean: A exists alone, A and B exist at the same time, and B exists alone.
- “at least one” means one or more, and “plurality” means two or more.
- the words “first”, “second”, etc. do not limit the quantity and execution order, and the words “first”, “second”, etc. do not limit them to be different.
- words such as “exemplary” or “for example” are used to indicate examples, illustrations or descriptions. Any embodiment or design described as “exemplary” or “for example” in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as “exemplary” or “for example” is intended to present related concepts in a specific way.
- the disclosed devices and methods can be implemented in other ways.
- the device embodiments described above are only schematic.
- the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed.
- Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
- the units described as separate components may or may not be physically separated, and the components shown as units may be one physical unit or multiple physical units, that is, they may be located in one place or distributed in multiple different places. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
- each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
- the above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
- the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium.
- the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions to enable a device (which can be a single-chip microcomputer, chip, etc.) or a processor (processor) to execute all or part of the steps of the method described in each embodiment of the present application.
- the aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program code.
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- Software Systems (AREA)
- General Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- Human Computer Interaction (AREA)
- Computing Systems (AREA)
- Geometry (AREA)
- Computer Graphics (AREA)
- Digital Computer Display Output (AREA)
- User Interface Of Digital Computer (AREA)
Abstract
Description
本申请要求于2023年11月06日提交国家知识产权局、申请号为202311471303.7、申请名称为“图像渲染方法和电子设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims priority to the Chinese patent application filed with the State Intellectual Property Office on November 6, 2023, with application number 202311471303.7 and application name “Image rendering method and electronic device”, the entire contents of which are incorporated by reference in this application.
本申请实施例涉及图像绘制技术领域,尤其涉及图像渲染方法和电子设备。The embodiments of the present application relate to the field of image drawing technology, and in particular to an image rendering method and an electronic device.
图像绘制的过程通常是:电子设备接收用户对电子设备的显示屏上显示的应用图标的点击操作。响应于该操作,电子设备在第一时刻接收第一刷新信息。电子设备确定第一帧图像的信息,如在第一刷新时刻的各控件的信息等。电子设备根据第一帧图像的信息对各控件进行渲染,以完成对整个窗口的渲染,之后,绘制得到第一帧图像,并送到显示屏显示。由于电子设备的屏幕的刷新周期是固定的,故,在第二刷新时刻,电子设备接收第二刷新信息,并确定第二帧图像的信息,如在第二刷新时刻的各控件的信息等。电子设备根据第二帧图像的信息对各控件进行渲染,以完成对整个窗口的渲染,之后,绘制得到第二帧图像,并送到显示屏显示。这样,以此类推,电子设备得到多个帧图像。这些帧图像在电子设备的屏幕上依次显示,即可使得屏幕能够以恒定的帧率显示具有动画效果的界面。可见,在绘制的过程中需要渲染每个控件及每个窗口,在高负载场景下,需要渲染的控件和窗口更多。因此,当在面对高负载场景时,会造成用户关注的窗口、整机卡顿或者是整个应用进程卡顿,造成用户体验感差。The process of image drawing is generally: the electronic device receives a user's click operation on the application icon displayed on the display screen of the electronic device. In response to the operation, the electronic device receives the first refresh information at the first moment. The electronic device determines the information of the first frame image, such as the information of each control at the first refresh moment. The electronic device renders each control according to the information of the first frame image to complete the rendering of the entire window, and then draws to obtain the first frame image, and sends it to the display screen for display. Since the refresh cycle of the screen of the electronic device is fixed, at the second refresh moment, the electronic device receives the second refresh information and determines the information of the second frame image, such as the information of each control at the second refresh moment. The electronic device renders each control according to the information of the second frame image to complete the rendering of the entire window, and then draws to obtain the second frame image, and sends it to the display screen for display. In this way, by analogy, the electronic device obtains multiple frame images. These frame images are displayed sequentially on the screen of the electronic device, so that the screen can display an interface with animation effects at a constant frame rate. It can be seen that each control and each window need to be rendered during the drawing process, and in a high-load scenario, more controls and windows need to be rendered. Therefore, when faced with high-load scenarios, the window that the user is paying attention to, the entire machine, or the entire application process may become stuck, resulting in a poor user experience.
发明内容Summary of the invention
本申请实施例提供的图像渲染方法和电子设备,优先保证焦点部件(如焦点窗口/焦点控件)的高帧率,提升高负载场景下用户的性能流畅体验。The image rendering method and electronic device provided in the embodiments of the present application give priority to ensuring the high frame rate of the focus component (such as the focus window/focus control), thereby improving the user's performance smoothness experience in high-load scenarios.
为达到上述目的,本申请实施例采用如下技术方案。In order to achieve the above-mentioned purpose, the embodiment of the present application adopts the following technical solution.
第一方面,本申请提供一种图像渲染方法,该方法的执行主体可以是电子设备,也可以是位于电子设备中的部件(例如,芯片,芯片系统或处理器等),下面以执行主体是电子设备为例进行描述。方法可以包括:电子设备显示第一界面,所述第一界面包括第一部件和第二部件,所述第一界面为第一应用的界面。响应于接收到对所述第一界面的操作,电子设备根据所述第一部件的第一信息和所述第二部件的第一信息,确定在第一刷新周期内所述第一部件和所述第二部件是否为焦点节点。当所述第一部件为焦点节点,所述第二部件为非焦点节点时,电子设备在所述第一刷新周期内通过第一进程渲染所述第一部件,并通过第二进程渲染所述第二部件,所述第一进程的渲染优先级高于所述第二进程的渲染优先级。In a first aspect, the present application provides an image rendering method, the execution subject of the method may be an electronic device, or a component located in the electronic device (for example, a chip, a chip system or a processor, etc.), and the following description is made by taking the execution subject being an electronic device as an example. The method may include: the electronic device displays a first interface, the first interface includes a first component and a second component, and the first interface is an interface of a first application. In response to receiving an operation on the first interface, the electronic device determines whether the first component and the second component are focus nodes within a first refresh cycle based on first information of the first component and first information of the second component. When the first component is a focus node and the second component is a non-focus node, the electronic device renders the first component through a first process within the first refresh cycle, and renders the second component through a second process, and the rendering priority of the first process is higher than the rendering priority of the second process.
其中,第一部件可以理解为第一窗口或第一控件,第二部件可以理解为第二窗口或第二控件。The first component may be understood as a first window or a first control, and the second component may be understood as a second window or a second control.
其中,焦点节点可以理解为需优先处理的节点,如当前用户操作的节点,即用户关注的节点;或者,输入事件作用的节点。The focus node can be understood as a node that needs to be processed first, such as the node currently operated by the user, that is, the node that the user pays attention to; or the node affected by the input event.
这样,电子设备在接收到用户对界面的操作之后,电子设备确定界面上的各部件是否为焦点节点。如果第一部件是焦点节点,则电子设备的第一进程实时渲染第一部件。如果第二部件是非焦点节点,则电子设备的第二进程渲染第二部件。这样,电子设备仅需确保用户关注的焦点节点的实时渲染即可,优先保证焦点节点(如焦点窗口/焦点控件)的高帧率,从而保证该焦点节点的图像显示顺畅,无卡顿白屏现象发生,提升高负载场景下用户的性能流畅体验。In this way, after receiving the user's operation on the interface, the electronic device determines whether each component on the interface is a focus node. If the first component is a focus node, the first process of the electronic device renders the first component in real time. If the second component is a non-focus node, the second process of the electronic device renders the second component. In this way, the electronic device only needs to ensure the real-time rendering of the focus node that the user is concerned about, and give priority to ensuring the high frame rate of the focus node (such as the focus window/focus control), thereby ensuring that the image of the focus node is displayed smoothly, without stuttering or white screen phenomenon, and improving the user's performance experience in high-load scenarios.
在一些设计方案中,所述方法还包括:当在所述第一刷新周期内所述第二进程未完成对所述第二部件的渲染时,电子设备复用所述第二部件在第二刷新周期内已有的纹理图像,所述第二刷新周期为所述第一刷新周期的前一个周期。这样,在第二进程未渲染完第二部件时可以复用已有的第二部件的纹理图像,无需实时渲染第二部件,确保用户关注的焦点节点的实时渲染即可,优先保证焦点节点(如焦点窗口/焦点控件)的高帧率。In some design solutions, the method further includes: when the second process has not completed rendering the second component within the first refresh cycle, the electronic device reuses the existing texture image of the second component within the second refresh cycle, and the second refresh cycle is the cycle before the first refresh cycle. In this way, when the second process has not completed rendering the second component, the existing texture image of the second component can be reused, and there is no need to render the second component in real time. It is sufficient to ensure the real-time rendering of the focus node that the user is concerned about, and give priority to ensuring the high frame rate of the focus node (such as the focus window/focus control).
在一些设计方案中,所述方法还包括:电子设备显示第二界面,所述第二界面包括第三部件, 所述第二界面为第二应用的界面,所述第二应用与所述第一应用不同。响应于对所述第二界面的操作,电子设备根据所述第一部件的第一信息、所述第二部件的第一信息和所述第三部件的第一信息,确定在第一刷新周期内所述第一部件、所述第二部件和所述第三部件是否为焦点节点。当所述第三部件为焦点节点,所述第一部件和所述第二部件均为非焦点节点时,电子设备在所述第一刷新周期内通过所述第一进程渲染所述第三部件,并通过所述第二进程渲染所述第一部件和所述第二部件。In some embodiments, the method further includes: the electronic device displays a second interface, the second interface includes a third component, The second interface is an interface of a second application, and the second application is different from the first application. In response to an operation on the second interface, the electronic device determines whether the first component, the second component, and the third component are focus nodes in a first refresh cycle according to the first information of the first component, the first information of the second component, and the first information of the third component. When the third component is a focus node and the first component and the second component are both non-focus nodes, the electronic device renders the third component through the first process in the first refresh cycle, and renders the first component and the second component through the second process.
当存在多个非焦点节点时,电子设备确定各非焦点节点的渲染优先级,之后,电子设备根据各非焦点节点的渲染优先级,来渲染各非焦点节点对应的部件,实现秩序渲染各部件,缓解在高负载场景下CPU和GPU资源的紧张。When there are multiple non-focus nodes, the electronic device determines the rendering priority of each non-focus node. After that, the electronic device renders the components corresponding to each non-focus node according to the rendering priority of each non-focus node, thereby achieving orderly rendering of each component and alleviating the tension of CPU and GPU resources in high-load scenarios.
在一种设计方案中,所述通过所述第二进程渲染所述第一部件和所述第二部件,具体为:电子设备根据所述第一部件的第二信息和所述第二部件的第二信息,及所述第二信息及其权重,确定所述第一部件和所述第二部件的渲染优先级。当所述第一部件的渲染优先级高于所述第二部件的渲染优先级时,电子设备通过所述第二进程依次渲染所述第一部件和所述第二部件。In one design solution, the rendering of the first component and the second component through the second process is specifically: the electronic device determines the rendering priority of the first component and the second component according to the second information of the first component and the second information of the second component, and the second information and its weight. When the rendering priority of the first component is higher than the rendering priority of the second component, the electronic device renders the first component and the second component in sequence through the second process.
在一种设计方案中,所述第二信息包括以下至少一项:没有生成缓存的可见窗口、没有生成缓存的不可见窗口、生成缓存且有可见脏区的窗口、生成缓存且只有不可见脏区的窗口、及生成缓存的静态窗口。In one design scheme, the second information includes at least one of the following: a visible window without generated cache, an invisible window without generated cache, a window with generated cache and visible dirty area, a window with generated cache and only invisible dirty area, and a static window with generated cache.
在一种设计方案中,所述第一信息包括透明度、窗口管理服务的焦点窗口、叠置顺序、是否被遮挡、是否做动画中的一个或多个。In one design, the first information includes one or more of transparency, a focus window of a window management service, an overlapping order, whether it is blocked, and whether animation is performed.
在一种设计方案中,所述第一信息包括透明度,所述根据所述第一部件的第一信息和所述第二部件的第一信息,确定在第一刷新周期内所述第一部件和所述第二部件是否为焦点节点,具体为:In one design solution, the first information includes transparency, and determining whether the first component and the second component are focus nodes in a first refresh cycle according to the first information of the first component and the first information of the second component is specifically:
当所述第一部件的透明度大于所述第二部件的透明度时,确定所述第一部件为非焦点节点,所述第二部件为焦点节点。When the transparency of the first component is greater than the transparency of the second component, it is determined that the first component is a non-focus node and the second component is a focus node.
在一种设计方案中,所述第一信息包括窗口管理服务的焦点窗口,所述根据所述第一部件的第一信息和所述第二部件的第一信息,确定在第一刷新周期内所述第一部件和所述第二部件是否为焦点节点,具体为:In one design solution, the first information includes a focus window of a window management service, and determining whether the first component and the second component are focus nodes in a first refresh cycle according to the first information of the first component and the first information of the second component is specifically:
当检测到用户操作所述第一部件,且未操作所述第二部件时,确定所述第一部件为焦点节点,所述第二部件为非焦点节点。When it is detected that the user operates the first component but does not operate the second component, it is determined that the first component is a focus node and the second component is a non-focus node.
在一种设计方案中,所述第一信息包括窗口管理服务的焦点窗口,所述根据所述第一部件的第一信息和所述第二部件的第一信息,确定在第一刷新周期内所述第一部件和所述第二部件是否为焦点节点,具体为:In one design solution, the first information includes a focus window of a window management service, and determining whether the first component and the second component are focus nodes in a first refresh cycle according to the first information of the first component and the first information of the second component is specifically:
当检测到用户的视线落在所述第一部件上,且未落在所述第二部件上时,确定所述第一部件为焦点节点,所述第二部件为非焦点节点。When it is detected that the user's sight falls on the first component and does not fall on the second component, the first component is determined to be a focus node and the second component is determined to be a non-focus node.
在一种设计方案中,所述第一信息包括叠置顺序,所述根据所述第一部件的第一信息和所述第二部件的第一信息,确定在第一刷新周期内所述第一部件和所述第二部件是否为焦点节点,具体为:In one design solution, the first information includes a stacking order, and determining whether the first component and the second component are focus nodes in a first refresh cycle according to the first information of the first component and the first information of the second component is specifically:
当所述第一部件的叠置顺序高于所述第二部件的叠置顺序时,确定所述第一部件为焦点节点,所述第二部件为非焦点节点。When the stacking order of the first component is higher than the stacking order of the second component, the first component is determined to be a focus node and the second component is determined to be a non-focus node.
在一种设计方案中,所述第一信息包括是否做动画,所述根据所述第一部件的第一信息和所述第二部件的第一信息,确定在第一刷新周期内所述第一部件和所述第二部件是否为焦点节点,具体为:In one design solution, the first information includes whether to perform animation, and determining whether the first component and the second component are focus nodes in a first refresh cycle according to the first information of the first component and the first information of the second component is specifically:
当所述第一部件的图像为多帧图像,所述第二部件的图像为单帧图像时,确定所述第一部件为焦点节点,所述第二部件为非焦点节点。When the image of the first component is a multi-frame image and the image of the second component is a single-frame image, the first component is determined to be a focus node and the second component is determined to be a non-focus node.
在一种设计方案中,所述第一信息包括透明度、窗口管理服务的焦点窗口、叠置顺序、是否被遮挡、及是否做动画;所述根据所述第一部件的第一信息和所述第二部件的第一信息,确定在第一刷新周期内所述第一部件和所述第二部件是否为焦点节点,具体为:In one design, the first information includes transparency, a focus window of a window management service, an overlapping order, whether it is blocked, and whether animation is performed; and determining whether the first component and the second component are focus nodes in a first refresh cycle according to the first information of the first component and the first information of the second component is specifically:
根据所述第一部件和所述第二部件的如下信息:透明度及其权重、窗口管理服务的焦点窗口 及其权重、叠置顺序及其权重、是否被遮挡及其权重、是否做动画及其权重,确定所述第一部件和所述第二部件是否为焦点节点。According to the following information of the first component and the second component: transparency and its weight, the focus window of the window management service and its weight, the stacking order and its weight, whether it is blocked and its weight, whether to perform animation and its weight, determine whether the first component and the second component are focus nodes.
在一种设计方案中,所述部件包括窗口或控件。In one design solution, the component includes a window or a control.
在一种设计方案中,所述焦点节点为需优先处理的节点,如当前用户操作的节点,即用户关注的节点;或者,输入事件作用的节点。In one design, the focus node is a node that needs to be processed first, such as a node currently operated by a user, that is, a node that the user is paying attention to; or a node affected by an input event.
第二方面,本申请提供一种电子设备,其包括:显示模块,确定模块和渲染模块,其中,所述显示模块用于显示第一界面,所述第一界面包括第一部件和第二部件,所述第一界面为第一应用的界面。所述确定模块用于响应于接收到对所述第一界面的操作,根据所述第一部件的第一信息和所述第二部件的第一信息,确定在第一刷新周期内所述第一部件和所述第二部件是否为焦点节点,所述焦点节点为用户关注的节点。所述渲染模块用于当所述第一部件为焦点节点,所述第二部件为非焦点节点时,在所述第一刷新周期内通过第一进程渲染所述第一部件,并通过第二进程渲染所述第二部件,所述第一进程的渲染优先级高于所述第二进程的渲染优先级。In a second aspect, the present application provides an electronic device, comprising: a display module, a determination module and a rendering module, wherein the display module is used to display a first interface, the first interface includes a first component and a second component, and the first interface is an interface of a first application. The determination module is used to determine whether the first component and the second component are focus nodes in a first refresh cycle in response to receiving an operation on the first interface, according to first information of the first component and first information of the second component, and the focus node is a node that the user is concerned about. The rendering module is used to render the first component through a first process in the first refresh cycle, and render the second component through a second process when the first component is a focus node and the second component is a non-focus node, and the rendering priority of the first process is higher than the rendering priority of the second process.
其中,第一部件可以理解为第一窗口或第一控件,第二部件可以理解为第二窗口或第二控件。The first component may be understood as a first window or a first control, and the second component may be understood as a second window or a second control.
其中,所述焦点节点为需优先处理的节点,如当前用户操作的节点,即用户关注的节点;或者,输入事件作用的节点。The focus node is a node that needs to be processed first, such as a node currently operated by a user, that is, a node that the user is paying attention to; or a node affected by an input event.
这样,电子设备在接收到用户对界面的操作之后,电子设备确定界面上的各部件是否为焦点节点。如果第一部件是焦点节点,则电子设备的第一进程实时渲染第一部件。如果第二部件是非焦点节点,则电子设备的第二进程渲染第二部件。这样,电子设备仅需确保用户关注的焦点节点的实时渲染即可,优先保证焦点节点(如焦点窗口/焦点控件)的高帧率,从而保证该焦点节点的图像显示顺畅,无卡顿白屏现象发生,提升高负载场景下用户的性能流畅体验。In this way, after receiving the user's operation on the interface, the electronic device determines whether each component on the interface is a focus node. If the first component is a focus node, the first process of the electronic device renders the first component in real time. If the second component is a non-focus node, the second process of the electronic device renders the second component. In this way, the electronic device only needs to ensure the real-time rendering of the focus node that the user is concerned about, and give priority to ensuring the high frame rate of the focus node (such as the focus window/focus control), thereby ensuring that the image of the focus node is displayed smoothly, without stuttering or white screen phenomenon, and improving the user's performance experience in high-load scenarios.
在一种设计方案中,所述渲染模块用于:当在所述第一刷新周期内所述第二进程未完成对所述第二部件的渲染时,复用所述第二部件在第二刷新周期内已有的纹理图像,所述第二刷新周期为所述第一刷新周期的前一个周期。这样,在第二进程未渲染完第二部件时可以复用已有的第二部件的纹理图像,无需实时渲染第二部件,确保用户关注的焦点节点的实时渲染即可,优先保证焦点节点(如焦点窗口/焦点控件)的高帧率。In one design, the rendering module is used to reuse the existing texture image of the second component in the second refresh cycle when the second process has not completed rendering the second component in the first refresh cycle, and the second refresh cycle is the cycle before the first refresh cycle. In this way, when the second process has not completed rendering the second component, the existing texture image of the second component can be reused, and there is no need to render the second component in real time. It is sufficient to ensure the real-time rendering of the focus node that the user is concerned about, and give priority to ensuring the high frame rate of the focus node (such as the focus window/focus control).
在一种设计方案中,所述显示模块用于显示第二界面,所述第二界面包括第三部件,所述第二界面为第二应用的界面,所述第二应用与所述第一应用不同。所述确定模块用于响应于对所述第二界面的操作,根据所述第一部件的第一信息、所述第二部件的第一信息和所述第三部件的第一信息,确定在第一刷新周期内所述第一部件、所述第二部件和所述第三部件是否为焦点节点。所述渲染模块用于当所述第三部件为焦点节点,所述第一部件和所述第二部件均为非焦点节点时,在所述第一刷新周期内通过所述第一进程渲染所述第三部件,并通过所述第二进程渲染所述第一部件和所述第二部件。In one design scheme, the display module is used to display a second interface, the second interface includes a third component, the second interface is an interface of a second application, and the second application is different from the first application. The determination module is used to determine whether the first component, the second component, and the third component are focus nodes in a first refresh cycle in response to an operation on the second interface, according to the first information of the first component, the first information of the second component, and the first information of the third component. The rendering module is used to render the third component through the first process in the first refresh cycle, and render the first component and the second component through the second process when the third component is the focus node and the first component and the second component are both non-focus nodes.
当存在多个非焦点节点时,电子设备确定各非焦点节点的渲染优先级,之后,电子设备根据各非焦点节点的渲染优先级,来渲染各非焦点节点对应的部件,实现秩序渲染各部件,缓解在高负载场景下CPU和GPU资源的紧张。When there are multiple non-focus nodes, the electronic device determines the rendering priority of each non-focus node. After that, the electronic device renders the components corresponding to each non-focus node according to the rendering priority of each non-focus node, thereby achieving orderly rendering of each component and alleviating the tension of CPU and GPU resources in high-load scenarios.
在一种设计方案中,所述渲染模块用于:根据所述第一部件的第二信息和所述第二部件的第二信息,及所述第二信息及其权重,确定所述第一部件和所述第二部件的渲染优先级;当所述第一部件的渲染优先级高于所述第二部件的渲染优先级时,通过所述第二进程依次渲染所述第一部件和所述第二部件。In one design scheme, the rendering module is used to: determine the rendering priority of the first component and the second component based on the second information of the first component and the second information of the second component, and the second information and its weight; when the rendering priority of the first component is higher than the rendering priority of the second component, render the first component and the second component in sequence through the second process.
在一种设计方案中,所述第二信息包括以下至少一项:没有生成缓存的可见窗口、没有生成缓存的不可见窗口、生成缓存且有可见脏区的窗口、生成缓存且只有不可见脏区的窗口、及生成缓存的静态窗口。In one design scheme, the second information includes at least one of the following: a visible window without generated cache, an invisible window without generated cache, a window with generated cache and visible dirty area, a window with generated cache and only invisible dirty area, and a static window with generated cache.
在一种设计方案中,所述第一信息包括透明度、窗口管理服务的焦点窗口、叠置顺序、是否被遮挡、是否做动画中的一个或多个。In one design, the first information includes one or more of transparency, a focus window of a window management service, an overlapping order, whether it is blocked, and whether animation is performed.
在一种设计方案中,所述第一信息包括透明度,所述确定模块用于:In one design solution, the first information includes transparency, and the determining module is configured to:
当所述第一部件的透明度大于所述第二部件的透明度时,确定所述第一部件为非焦点节点,所述第二部件为焦点节点。 When the transparency of the first component is greater than the transparency of the second component, it is determined that the first component is a non-focus node and the second component is a focus node.
在一种设计方案中,所述第一信息包括窗口管理服务的焦点窗口,所述确定模块用于:In one design solution, the first information includes a focus window of a window management service, and the determining module is configured to:
当检测到用户操作所述第一部件,且未操作所述第二部件时,确定所述第一部件为焦点节点,所述第二部件为非焦点节点。When it is detected that the user operates the first component but does not operate the second component, it is determined that the first component is a focus node and the second component is a non-focus node.
在一种设计方案中,所述第一信息包括窗口管理服务的焦点窗口,所述确定模块用于:In one design solution, the first information includes a focus window of a window management service, and the determining module is configured to:
当检测到用户的视线落在所述第一部件上,且未落在所述第二部件上时,确定所述第一部件为焦点节点,所述第二部件为非焦点节点。When it is detected that the user's sight falls on the first component and does not fall on the second component, the first component is determined to be a focus node and the second component is determined to be a non-focus node.
在一种设计方案中,所述第一信息包括叠置顺序,所述确定模块用于:In one design solution, the first information includes an overlay order, and the determining module is configured to:
当所述第一部件的叠置顺序高于所述第二部件的叠置顺序时,确定所述第一部件为焦点节点,所述第二部件为非焦点节点。When the stacking order of the first component is higher than the stacking order of the second component, the first component is determined to be a focus node and the second component is determined to be a non-focus node.
在一种设计方案中,所述第一信息包括是否做动画,所述确定模块用于:In one design solution, the first information includes whether to perform animation, and the determination module is used to:
当所述第一部件的图像为多帧图像,所述第二部件的图像为单帧图像时,确定所述第一部件为焦点节点,所述第二部件为非焦点节点。When the image of the first component is a multi-frame image and the image of the second component is a single-frame image, the first component is determined to be a focus node and the second component is determined to be a non-focus node.
在一种设计方案中,所述第一信息包括透明度、窗口管理服务的焦点窗口、叠置顺序、是否被遮挡、及是否做动画;所述确定模块用于:In one design, the first information includes transparency, a focus window of a window management service, an overlapping order, whether it is blocked, and whether animation is performed; and the determining module is used to:
根据所述第一部件和所述第二部件的如下信息:透明度及其权重、窗口管理服务的焦点窗口及其权重、叠置顺序及其权重、是否被遮挡及其权重、是否做动画及其权重,确定所述第一部件和所述第二部件是否为焦点节点。Determine whether the first component and the second component are focus nodes based on the following information of the first component and the second component: transparency and its weight, focus window of the window management service and its weight, stacking order and its weight, whether it is blocked and its weight, whether it is animated and its weight.
在一种设计方案中,所述部件包括窗口或控件。In one design solution, the component includes a window or a control.
在一种设计方案中,所述焦点节点为需优先处理的节点,如当前用户操作的节点,即用户关注的节点;或者,输入事件作用的节点。In one design, the focus node is a node that needs to be processed first, such as a node currently operated by a user, that is, a node that the user is paying attention to; or a node affected by an input event.
第三方面,本申请提供一种电子设备,所述电子设备包括:一个或多个处理器;以及存储器,所述存储器中存储有代码;当所述代码被所述处理器执行时,使得所述电子设备执行如第一方面所述的方法。In a third aspect, the present application provides an electronic device, comprising: one or more processors; and a memory, wherein the memory stores a code; when the code is executed by the processor, the electronic device executes the method described in the first aspect.
第四方面,本申请提供一种计算机可读存储介质,其包括计算机指令,当所述计算机指令电子设备上运行时,使得所述电子设备执行如第一方面所述的方法。In a fourth aspect, the present application provides a computer-readable storage medium, which includes computer instructions. When the computer instructions are executed on an electronic device, the electronic device executes the method described in the first aspect.
其中,上述第二方面至第四方面中各个的具体实施方式及对应的技术效果可以参见上述第一方面的具体实施方式及技术效果。Among them, the specific implementation methods and corresponding technical effects of each of the second to fourth aspects mentioned above can refer to the specific implementation methods and technical effects of the first aspect mentioned above.
图1为本申请实施例提供的一种电子设备的结构示意图;FIG1 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application;
图2为本申请实施例提供的电子设备的显示系统的软件和硬件结合的架构示意图;FIG2 is a schematic diagram of the architecture of the combination of software and hardware of the display system of the electronic device provided in an embodiment of the present application;
图3-1为本申请实施例提供的一种图像渲染方法的一种流程示意图;FIG3-1 is a schematic diagram of a flow chart of an image rendering method provided in an embodiment of the present application;
图3-2为本申请实施例提供的一种图像渲染方法的一种流程示意图;FIG3-2 is a schematic diagram of a flow chart of an image rendering method provided in an embodiment of the present application;
图4为本申请实施例提供的一种分离渲染的逻辑示意图;FIG4 is a logic diagram of a separate rendering provided by an embodiment of the present application;
图5为本申请实施例提供的一种统一渲染的逻辑示意图;FIG5 is a logic diagram of unified rendering provided by an embodiment of the present application;
图6为本申请实施例提供的一种图像渲染方法的主副线程节点处理时序的示意图;6 is a schematic diagram of a main and secondary thread node processing timing of an image rendering method provided by an embodiment of the present application;
图7为本申请实施例提供的一种图像渲染方法的一种流程示意图;FIG7 is a schematic diagram of a flow chart of an image rendering method provided in an embodiment of the present application;
图8为本申请实施例提供的另一种电子设备的界面示意图;FIG8 is a schematic diagram of an interface of another electronic device provided in an embodiment of the present application;
图9为本申请实施例提供的另一种电子设备的界面示意图;FIG9 is a schematic diagram of an interface of another electronic device provided in an embodiment of the present application;
图10为本申请实施例提供的一种电子设备的结构示意图。FIG. 10 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application.
窗口是指应用程序为使用数据而在图形用户界面中设置的基本单元,是一个应用程序的可视界面。应用程序和数据在窗口内实现一体化。在窗口中,用户可以在窗口中操作应用程序,进行数据的管理、生成和编辑。A window is a basic unit in a graphical user interface that an application sets up to use data. It is a visual interface of an application. The application and data are integrated in the window. In the window, users can operate the application in the window to manage, generate and edit data.
窗口是控件的容器,每个窗口中均有各自的控件(或称视图(view)等)。控件是一种图形用户界面元素,例如:视窗或文本框,其显示的排列信息可由用户改变。并且,控件作为一种基本的可视构件块,包含在应用程序中,控制着该应用程序处理的所有数据以及关于这些数据的交 互操作。A window is a container for controls, and each window has its own controls (or views, etc.). A control is a graphical user interface element, such as a window or text box, whose displayed arrangement of information can be changed by the user. And, as a basic visual building block, a control is included in an application and controls all data processed by the application and the interactions with that data. Interoperability.
上述界面绘制的过程通常是:电子设备接收到对电子设备的显示屏上显示的界面的操作。示例性的,电子设备接收用户对电子设备的显示屏上显示的图标(如设置应用的图标)的点击操作。响应于该操作,电子设备在第一时刻接收第一刷新信息。电子设备确定第一帧图像的信息,如在第一刷新时刻的各控件的信息等。电子设备根据第一帧图像的信息对各控件进行渲染,以完成对整个窗口的渲染,之后,绘制得到第一帧图像,并送到显示屏显示。由于电子设备的屏幕的刷新周期是固定的,故,在第二刷新时刻,电子设备接收第二刷新信息,并确定第二帧图像的信息,如在第二刷新时刻的各控件的信息等。电子设备根据第二帧图像的信息对各控件进行渲染,以完成对整个窗口的渲染,之后,绘制得到第二帧图像,并送到显示屏显示。这样,以此类推,电子设备得到多个帧图像。这些帧图像在电子设备的屏幕上依次显示,即可使得屏幕能够以恒定的帧率显示具有动画效果的界面。The process of drawing the above interface is generally: the electronic device receives an operation on the interface displayed on the display screen of the electronic device. Exemplarily, the electronic device receives a user's click operation on an icon (such as an icon for setting an application) displayed on the display screen of the electronic device. In response to the operation, the electronic device receives the first refresh information at the first moment. The electronic device determines the information of the first frame image, such as the information of each control at the first refresh moment. The electronic device renders each control according to the information of the first frame image to complete the rendering of the entire window, and then draws to obtain the first frame image, and sends it to the display screen for display. Since the refresh cycle of the screen of the electronic device is fixed, at the second refresh moment, the electronic device receives the second refresh information and determines the information of the second frame image, such as the information of each control at the second refresh moment. The electronic device renders each control according to the information of the second frame image to complete the rendering of the entire window, and then draws to obtain the second frame image, and sends it to the display screen for display. In this way, by analogy, the electronic device obtains multiple frame images. These frame images are displayed sequentially on the screen of the electronic device, so that the screen can display an interface with animation effects at a constant frame rate.
可见,在绘制的过程中需要渲染每个控件及每个窗口,在高负载场景下,需要渲染的控件和窗口更多,可能出现丢帧、白屏、卡顿等情况,影响用户体验。It can be seen that each control and each window needs to be rendered during the drawing process. In high-load scenarios, more controls and windows need to be rendered, and frame loss, white screen, freeze, etc. may occur, affecting the user experience.
为了解决上述技术问题,本申请提供一种图像渲染方法,该方法应用于电子设备,该方法可以包括:电子设备显示第一界面,该界面包括第一部件和第二部件,第一部件和第二部件均可以为窗口或控件。响应于接收到对第一界面的操作,电子设备确定在第一刷新周期内第一部件和第二部件是否为焦点节点,焦点节点为用户关注的节点。当第一部件为焦点节点,第二部件为非焦点节点时,在第一刷新周期内通过第一进程渲染第一部件,并通过第二进程渲染第二部件,第一进程的渲染优先级高于第二进程的渲染优先级。就是说,电子设备在接收到用户对界面的操作之后,电子设备确定界面上的各部件是否为焦点节点。如果第一部件是焦点节点,则电子设备的第一进程实时渲染第一部件。如果第二部件是非焦点节点,则电子设备的第二进程渲染第二部件,在第二进程未渲染完第二部件时可以复用已有的第二部件的纹理图像。这样,电子设备仅需确保用户关注的焦点节点的实时渲染即可,优先保证焦点节点(如焦点窗口/焦点控件)的高帧率,从而保证该焦点节点的图像显示顺畅,无卡顿白屏现象发生,提升高负载场景下用户的性能流畅体验。In order to solve the above technical problems, the present application provides an image rendering method, which is applied to an electronic device, and the method may include: the electronic device displays a first interface, the interface includes a first component and a second component, and the first component and the second component can be windows or controls. In response to receiving an operation on the first interface, the electronic device determines whether the first component and the second component are focus nodes in the first refresh cycle, and the focus node is a node that the user is concerned about. When the first component is a focus node and the second component is a non-focus node, the first component is rendered by the first process in the first refresh cycle, and the second component is rendered by the second process, and the rendering priority of the first process is higher than the rendering priority of the second process. That is, after the electronic device receives the user's operation on the interface, the electronic device determines whether each component on the interface is a focus node. If the first component is a focus node, the first process of the electronic device renders the first component in real time. If the second component is a non-focus node, the second process of the electronic device renders the second component, and the texture image of the existing second component can be reused when the second process has not finished rendering the second component. In this way, the electronic device only needs to ensure the real-time rendering of the focus node that the user is concerned about, and give priority to ensuring the high frame rate of the focus node (such as the focus window/focus control), so as to ensure that the image of the focus node is displayed smoothly without any stuttering or white screen phenomenon, thereby improving the user's performance experience in high-load scenarios.
图1为本申请实施例提供的电子设备的一种结构框图。FIG1 is a structural block diagram of an electronic device provided in an embodiment of the present application.
如图1所示,电子设备100可以包括处理器110,通用串行总线(universal serial bus,USB)接口130,充电管理模块140,电源管理模块141,电池142,存储器120,天线1,无线通信模块160,显示屏170,及传感器模块150等。其中传感器模块150可以包括压力传感器150A,触摸传感器150B等。As shown in FIG1 , the electronic device 100 may include a processor 110, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, a memory 120, an antenna 1, a wireless communication module 160, a display screen 170, and a sensor module 150, etc. The sensor module 150 may include a pressure sensor 150A, a touch sensor 150B, etc.
可以理解的是,本申请实施例示意的结构并不构成对电子设备的具体限定。在本申请另一些实施例中,电子设备可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。It is to be understood that the structure illustrated in the embodiments of the present application does not constitute a specific limitation on the electronic device. In other embodiments of the present application, the electronic device may include more or fewer components than shown in the figure, or combine certain components, or split certain components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
处理器110可以包括一个或多个处理单元,例如:处理器110可以包括应用处理器(application processor,AP),调制解调处理器,图形处理器(graphics processing unit,GPU),图像信号处理器(image signal processor,ISP),控制器,视频编解码器,数字信号处理器(digital signal processor,DSP),基带处理器,和/或神经网络处理器(neural-network processing unit,NPU)等。其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。The processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and/or a neural-network processing unit (NPU), etc. Different processing units may be independent devices or integrated in one or more processors.
控制器可以根据指令操作码和时序信号,产生操作控制信号,完成取指令和执行指令的控制。The controller can generate operation control signals according to the instruction operation code and timing signal to complete the control of instruction fetching and execution.
处理器110中还可以设置存储器,用于存储指令和数据。在一些实施例中,处理器110中的存储器为高速缓冲存储器。该存储器可以保存处理器110刚用过或循环使用的指令或数据。如果处理器110需要再次使用该指令或数据,可从所述存储器中直接调用。避免了重复存取,减少了处理器110的等待时间,因而提高了系统的效率。The processor 110 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may store instructions or data that the processor 110 has just used or cyclically used. If the processor 110 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.
充电管理模块140用于从充电器接收充电输入。其中,充电器可以是无线充电器,也可以是有线充电器。在一些有线充电的实施例中,充电管理模块140可以通过USB接口130接收有线充电器的充电输入。在一些无线充电的实施例中,充电管理模块140可以通过电子设备的无线充电线圈接收无线充电输入。充电管理模块140为电池142充电的同时,还可以通过电源管理模块141 为电子设备供电。The charging management module 140 is used to receive charging input from a charger. The charger can be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 can receive charging input from a wired charger through the USB interface 130. In some wireless charging embodiments, the charging management module 140 can receive wireless charging input through a wireless charging coil of the electronic device. While the charging management module 140 is charging the battery 142, it can also charge the battery 142 through the power management module 141. Provides power to electronic devices.
电源管理模块141用于连接电池142,充电管理模块140与处理器110。电源管理模块141接收电池142和/或充电管理模块140的输入,为处理器110,显示屏170,和无线通信模块160等供电。电源管理模块141还可以用于监测电池容量,电池循环次数,电池健康状态(漏电,阻抗)等参数。在其他一些实施例中,电源管理模块141也可以设置于处理器110中。在另一些实施例中,电源管理模块141和充电管理模块140也可以设置于同一个器件中。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, and supplies power to the processor 110, the display screen 170, and the wireless communication module 160. The power management module 141 can also be used to monitor parameters such as battery capacity, battery cycle number, battery health status (leakage, impedance), etc. In some other embodiments, the power management module 141 can also be set in the processor 110. In other embodiments, the power management module 141 and the charging management module 140 can also be set in the same device.
电子设备的无线通信功能可以通过天线1,无线通信模块160,调制解调处理器以及基带处理器等实现。The wireless communication function of the electronic device can be implemented through the antenna 1, the wireless communication module 160, the modem processor and the baseband processor.
天线1用于发射和接收电磁波信号。电子设备中的每个天线可用于覆盖单个或多个通信频带。不同的天线还可以复用,以提高天线的利用率。例如:可以将天线1复用为无线局域网的分集天线。在另外一些实施例中,天线可以和调谐开关结合使用。Antenna 1 is used to transmit and receive electromagnetic wave signals. Each antenna in the electronic device can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve the utilization of the antenna. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In some other embodiments, the antenna can be used in combination with a tuning switch.
无线通信模块160可以提供应用在电子设备上的包括无线局域网(wireless local area networks,WLAN)(如无线保真(wireless fidelity,Wi-Fi)网络),蓝牙(bluetooth,BT),全球导航卫星系统(global navigation satellite system,GNSS),调频(frequency modulation,FM),近距离无线通信技术(near field communication,NFC),红外技术(infrared,IR)等无线通信的解决方案。无线通信模块160可以是集成至少一个通信处理模块的一个或多个器件。无线通信模块160经由天线1接收电磁波,将电磁波信号调频以及滤波处理,将处理后的信号发送到处理器110。无线通信模块160还可以从处理器110接收待发送的信号,对其进行调频,放大,经天线1转为电磁波辐射出去。在一些实施例中,无线通信模块160接收服务器发送的应用信息。The wireless communication module 160 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) network), bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR) and the like applied to electronic devices. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 1, modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 110. The wireless communication module 160 can also receive the signal to be sent from the processor 110, modulate the frequency, amplify it, and convert it into electromagnetic waves for radiation through the antenna 1. In some embodiments, the wireless communication module 160 receives application information sent by the server.
电子设备通过GPU,显示屏170,以及应用处理器等实现显示功能。GPU为图像处理的微处理器,连接显示屏170和应用处理器。GPU用于执行数学和几何计算,用于图形渲染。处理器110可包括一个或多个GPU,其执行程序指令以生成或改变显示信息。The electronic device implements the display function through a GPU, a display screen 170, and an application processor. The GPU is a microprocessor for image processing, connecting the display screen 170 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs that execute program instructions to generate or change display information.
显示屏170用于显示图像,视频等。显示屏170包括显示面板。显示面板可以采用液晶显示屏(liquid crystal display,LCD),有机发光二极管(organic light-emitting diode,OLED),有源矩阵有机发光二极体或主动矩阵有机发光二极体(active-matrix organic light emitting diode的,AMOLED),柔性发光二极管(flex light-emitting diode,FLED),Miniled,MicroLed,Micro-oLed,量子点发光二极管(quantum dot light emitting diodes,QLED)等。在一些实施例中,电子设备可以包括1个或N个显示屏170,N为大于1的正整数。The display screen 170 is used to display images, videos, etc. The display screen 170 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-oLed, quantum dot light-emitting diodes (QLED), etc. In some embodiments, the electronic device may include 1 or N display screens 170, where N is a positive integer greater than 1.
存储器120可以用于存储计算机可执行程序代码,所述可执行程序代码包括指令。存储器120可以包括存储程序区和存储数据区。其中,存储程序区可存储操作系统,至少一个功能所需的应用程序(比如声音播放功能,图像播放功能等)等。存储数据区可存储电子设备使用过程中所创建的数据(比如音频数据,电话本等)等。此外,存储器120可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件,闪存器件,通用闪存存储器(universal flash storage,UFS)等。处理器110通过运行存储在存储器120的指令,和/或存储在设置于处理器中的存储器的指令,执行电子设备的各种功能应用以及数据处理。The memory 120 may be used to store computer executable program codes, which include instructions. The memory 120 may include a program storage area and a data storage area. The program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc. The data storage area may store data created during the use of the electronic device (such as audio data, a phone book, etc.), etc. In addition, the memory 120 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc. The processor 110 executes various functional applications and data processing of the electronic device by running instructions stored in the memory 120 and/or instructions stored in a memory provided in the processor.
压力传感器150A用于感受压力信号,可以将压力信号转换成电信号。在一些实施例中,压力传感器150A可以设置于显示屏170。压力传感器150A的种类很多,如电阻式压力传感器,电感式压力传感器,电容式压力传感器等。电容式压力传感器可以是包括至少两个具有导电材料的平行板。当有力作用于压力传感器150A,电极之间的电容改变。电子设备根据电容的变化确定压力的强度。当有触摸操作作用于显示屏170,电子设备根据压力传感器150A检测所述触摸操作强度。电子设备也可以根据压力传感器150A的检测信号计算触摸的位置。在一些实施例中,作用于相同触摸位置,但不同触摸操作强度的触摸操作,可以对应不同的操作指令。例如:当有触摸操作强度小于第一压力阈值的触摸操作作用于短消息应用图标时,执行查看短消息的指令。当有触摸操作强度大于或等于第一压力阈值的触摸操作作用于短消息应用图标时,执行新建短消息的指令。The pressure sensor 150A is used to sense the pressure signal and can convert the pressure signal into an electrical signal. In some embodiments, the pressure sensor 150A can be set on the display screen 170. There are many types of pressure sensors 150A, such as resistive pressure sensors, inductive pressure sensors, capacitive pressure sensors, etc. The capacitive pressure sensor can be a parallel plate including at least two conductive materials. When a force acts on the pressure sensor 150A, the capacitance between the electrodes changes. The electronic device determines the intensity of the pressure based on the change in capacitance. When a touch operation acts on the display screen 170, the electronic device detects the touch operation intensity according to the pressure sensor 150A. The electronic device can also calculate the touch position according to the detection signal of the pressure sensor 150A. In some embodiments, touch operations acting on the same touch position but with different touch operation intensities can correspond to different operation instructions. For example: when a touch operation with a touch operation intensity less than the first pressure threshold acts on the short message application icon, an instruction to view the short message is executed. When a touch operation with a touch operation intensity greater than or equal to the first pressure threshold acts on the short message application icon, an instruction to create a new short message is executed.
触摸传感器150B,也称“触控器件”。触摸传感器150B可以设置于显示屏170,由触摸传感器150B与显示屏170组成触摸屏,也称“触控屏”。触摸传感器150B用于检测作用于其上或附近的触摸操作。触摸传感器可以将检测到的触摸操作传递给应用处理器,以确定触摸事件类型。 可以通过显示屏170提供与触摸操作相关的视觉输出。在另一些实施例中,触摸传感器150B也可以设置于电子设备的表面,与显示屏170所处的位置不同。The touch sensor 150B is also called a "touch control device". The touch sensor 150B can be set on the display screen 170. The touch sensor 150B and the display screen 170 form a touch screen, also called a "touch control screen". The touch sensor 150B is used to detect a touch operation acting on or near it. The touch sensor can pass the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation may be provided through the display screen 170. In other embodiments, the touch sensor 150B may also be disposed on the surface of the electronic device, at a position different from that of the display screen 170.
当然,电子设备还可以包括其他功能单元,本申请实施例对此不进行限定。Of course, the electronic device may also include other functional units, which are not limited in the embodiments of the present application.
此外,本申请的各实施例之间涉及的动作,术语等均可以相互参考,不予限制。本申请的实施例中各个消息名称或消息中的参数名称等只是一个示例,具体实现中也可以采用其他的名称,不予限制。In addition, the actions, terms, etc. involved in the various embodiments of the present application can refer to each other without limitation. The names of the messages or parameter names in the messages in the embodiments of the present application are only examples, and other names can also be used in the specific implementation without limitation.
其中,上述电子设备可以为手机、平板电脑、膝上型、笔记本电脑、超级移动个人计算机(ultra-mobile personal computer,UMPC)、手持计算机、上网本、个人数字助理(personal digital assistant,PDA)、可穿戴电子设备等设备,本申请实施例中对电子设备的具体形式不做特殊限制。Among them, the above-mentioned electronic devices can be mobile phones, tablet computers, laptops, notebook computers, ultra-mobile personal computers (UMPC), handheld computers, netbooks, personal digital assistants (PDA), wearable electronic devices and other devices. The specific form of the electronic devices is not particularly limited in the embodiments of the present application.
在一些实施例中,电子设备100的软件系统可以采用分层架构,事件驱动架构,微核架构,微服务架构,或云架构。示例性的,以电子设备100的软件系统采用分层架构为例,结合图2所述的图像渲染方案,图2示出了该图像渲染方案中电子设备100的软件和硬件结合的结构示意图。In some embodiments, the software system of the electronic device 100 may adopt a layered architecture, an event-driven architecture, a micro-kernel architecture, a micro-service architecture, or a cloud architecture. Exemplarily, taking the layered architecture adopted by the software system of the electronic device 100 as an example, in combination with the image rendering scheme described in FIG. 2 , FIG. 2 shows a schematic diagram of the structure of the combination of software and hardware of the electronic device 100 in the image rendering scheme.
分层架构将软件分为若干层,每一层都有清晰的角色和分工。层与层之间通过软件接口通信。The layered architecture divides the software into several layers, each with a clear role and division of labor. The layers communicate with each other through software interfaces.
如图2所示,电子设备100至少包括:应用层(或称应用程序层)、应用架构层、系统服务层和硬件层。As shown in FIG. 2 , the electronic device 100 includes at least: an application layer (or application program layer), an application architecture layer, a system service layer and a hardware layer.
其中,应用层包括一系列的应用程序包,如设置、桌面、系统应用、三方应用、游戏应用、视频应用等。其中,三方应用可以包括但不限于从应用市场等下载的第三方应用,如社交应用、购物应用(图中未示出)等。其中,各应用程序的窗口/控件可以各自进行渲染,也可以由渲染服务进行统一渲染,并将渲染后的窗口提交给系统服务层的合成器合成。在一些实施例中,应用层中的应用程序可以向系统服务层中的渲染服务提交渲染指令,以完成对应用程序界面的渲染等。The application layer includes a series of application packages, such as settings, desktop, system applications, third-party applications, game applications, video applications, etc. Third-party applications may include but are not limited to third-party applications downloaded from application markets, such as social applications, shopping applications (not shown in the figure), etc. The windows/controls of each application may be rendered separately, or they may be rendered uniformly by the rendering service, and the rendered windows may be submitted to the synthesizer of the system service layer for synthesis. In some embodiments, the application in the application layer may submit rendering instructions to the rendering service in the system service layer to complete the rendering of the application interface, etc.
应用架构层可以包括Rosen渲染后端、用户程序框架、Ability框架、Window。The application architecture layer may include Rosen rendering backend, user program framework, Ability framework, and Window.
系统服务层包括渲染服务、窗口管理服务(window manager service,WMS)、数据管理服务(database management service,DMS)、设备管理服务(production management system,PMS)、应用管理服务(application management system,AMS)、内网管理系统(intranet management system,IMS)以及合成器。其中,WMS用于管理各应用的窗口,如桌面窗口、SystemUI窗口、负一屏窗口等。示例性的,WMS可以管理窗口类型、窗口层级、窗口位置,计算窗口布局,进行窗口形态(如全屏、悬浮窗、分屏、最大化、最小化等)切换管理等。The system service layer includes rendering service, window manager service (WMS), data management service (DMS), production management system (PMS), application management service (AMS), intranet management system (IMS) and compositor. Among them, WMS is used to manage the windows of each application, such as desktop window, SystemUI window, negative one screen window, etc. For example, WMS can manage window type, window level, window position, calculate window layout, and perform window form (such as full screen, floating window, split screen, maximize, minimize, etc.) switching management.
渲染服务中包括动画模块以及统一渲染模块。其中,动画模块可用于修改动画中包括的每一帧画面(或称图像)中,控件的属性(如位置、大小等),以生成动画效果。可选的,不同的画面帧中,控件的属性有所不同。The rendering service includes an animation module and a unified rendering module. The animation module can be used to modify the properties (such as position, size, etc.) of the control in each frame (or image) included in the animation to generate an animation effect. Optionally, the properties of the control are different in different frames.
可选的,上述动画模块也可位于应用层,通过应用的应用用户界面(user interface,UI)线程执行。Optionally, the above-mentioned animation module may also be located in the application layer and executed through the application user interface (UI) thread of the application.
统一渲染模块可基于统一渲染机制,执行渲染服务,也可称为执行统一渲染服务。统一渲染机制指的是统一渲染模块可接收所有应用的渲染节点,然后对所有应用的渲染节点一起进行渲染。具体的,其可基于动画模块修改的控件属性遍历所有渲染节点,完成渲染操作,后续还可以将渲染结果送到显示屏显示。The unified rendering module can perform rendering services based on the unified rendering mechanism, which can also be called the unified rendering service. The unified rendering mechanism means that the unified rendering module can receive rendering nodes of all applications and then render all rendering nodes of all applications together. Specifically, it can traverse all rendering nodes based on the control properties modified by the animation module to complete the rendering operation, and then send the rendering results to the display screen for display.
在本申请实施例中,渲染节点也可称为层(layer)、图层或其他名称。In the embodiment of the present application, a rendering node may also be referred to as a layer, a layer or other names.
硬件层包括合成器,合成器可用于将各窗口对应的图层,如桌面图层、SystemUI图层、负一屏图层等进行合成。其中,桌面窗口对应桌面图层,SystemUI窗口对应SystemUI图层,负一屏窗口对应负一屏图层等。示例性的,合成器可以包括硬件合成器以及图形处理器(graphic processing unit,GPU)等。The hardware layer includes a synthesizer, which can be used to synthesize the layers corresponding to each window, such as the desktop layer, the SystemUI layer, the negative one screen layer, etc. Among them, the desktop window corresponds to the desktop layer, the SystemUI window corresponds to the SystemUI layer, the negative one screen window corresponds to the negative one screen layer, etc. Exemplarily, the synthesizer may include a hardware synthesizer and a graphics processing unit (GPU), etc.
可以理解,图2所示的电子设备100的软件和硬件结合的架构仅为示例性说明,在实际应用中,其还可以包括更多或者更少的模块,各模块所属的层次也可以有所不同。比如:在合一应用和渲染服务之间还可以存在框架模块等。各层次也可以有其他的划分方式,本申请对此均不做限制。It is understood that the software and hardware combined architecture of the electronic device 100 shown in FIG2 is only an exemplary description. In actual applications, it may also include more or fewer modules, and the levels to which each module belongs may also be different. For example, there may also be a framework module between the unified application and the rendering service. Each level may also have other division methods, and this application does not limit this.
以下实施例所涉及的技术方案均可以在具有如图1、图2所示结构的设备中实现。 The technical solutions involved in the following embodiments can all be implemented in a device having the structure shown in FIG. 1 and FIG. 2 .
图3-1和图3-2为本申请实施例提供的一种图像渲染方法的流程示意图,如图3-2所示,该方法应用于电子设备,该方法可以包括:FIG3-1 and FIG3-2 are schematic flow charts of an image rendering method provided in an embodiment of the present application. As shown in FIG3-2 , the method is applied to an electronic device. The method may include:
S301、电子设备显示第一界面,第一界面包括至少一个部件,如第一部件和第二部件,第一界面为第一应用的界面。S301. An electronic device displays a first interface, where the first interface includes at least one component, such as a first component and a second component, and the first interface is an interface of a first application.
可以理解为,第一部件和第二部件可以属于同一应用。It can be understood that the first component and the second component may belong to the same application.
在一示例中,上述部件(如第一部件和第二部件)可以理解为窗口或控件。相应的,第一部件可以理解为第一窗口或第一控件,第二部件可以理解为第二窗口或第二控件。同理,后续的第三部件也可以理解为第三窗口或第三控件。In one example, the above components (such as the first component and the second component) can be understood as windows or controls. Accordingly, the first component can be understood as the first window or the first control, and the second component can be understood as the second window or the second control. Similarly, the subsequent third component can also be understood as the third window or the third control.
在一示例中,窗口是控件的容器,每个窗口中均有各自的控件(或称视图(view),或称部件(widget)等)。控件是一种图形用户界面元素,例如:视窗或文本框,其显示的排列信息可由用户改变。并且,控件作为一种基本的可视构件块,包含在应用程序中,控制着该应用程序处理的所有数据以及关于这些数据的交互操作。In one example, a window is a container for controls, and each window has its own control (or view, or widget, etc.). A control is a graphical user interface element, such as a window or text box, whose displayed arrangement of information can be changed by the user. Moreover, a control is a basic visual building block included in an application, controlling all data processed by the application and the interactive operations on the data.
在一示例中,窗口是用户界面中最重要的部分。其是电子设备屏幕上与一个应用程序相对应的矩形区域,是一个应用程序的可视界面。当用户启动一个应用程序,使得该应用程序开始运行时,该应用程序即创建并显示一个窗口。在一些实施例中,用户还可以对窗口执行各种操作,比如:当用户操作窗口中的对象时,应用程序会做出相应的响应。再比如:用户可以通过关闭窗口来终止应用程序的运行。再比如:用户还可以通过选择窗口来选定对应的应用程序。In one example, a window is the most important part of a user interface. It is a rectangular area on the screen of an electronic device corresponding to an application and is a visual interface of an application. When a user starts an application and the application starts running, the application creates and displays a window. In some embodiments, the user can also perform various operations on the window, such as: when the user operates an object in the window, the application will respond accordingly. For another example: the user can terminate the operation of the application by closing the window. For another example: the user can also select the corresponding application by selecting the window.
S302、响应于接收到对第一界面的操作,电子设备确定在第一刷新周期内第一部件和第二部件是否为焦点节点,焦点节点为用户关注的节点。S302: In response to receiving an operation on the first interface, the electronic device determines whether the first component and the second component are focus nodes in a first refresh cycle, where the focus node is a node that the user is paying attention to.
在一种具体可实现方式中,结合图3-1所示,步骤①响应于接收到对应用的界面的操作,电子设备的焦点节点确定模块确定在第一刷新周期内第一部件和第二部件是否为焦点节点。In a specific implementation, as shown in FIG3-1, in step ①, in response to receiving an operation on the interface of the application, the focus node determination module of the electronic device determines whether the first component and the second component are focus nodes within the first refresh cycle.
在一示例中,该操作可以理解为对第一界面的任一操作,例如,点击操作、浏览操作、滑动操作、编辑操作、光标触控操作等。In one example, the operation can be understood as any operation on the first interface, such as a click operation, a browse operation, a slide operation, an edit operation, a cursor touch operation, etc.
在一种具体可实现方式中,S302具体可实现为:电子设备根据第一部件和第二部件的第一信息,确定在第一刷新周期内第一部件和第二部件是否为焦点节点。In a specific implementation manner, S302 may be specifically implemented as follows: the electronic device determines, according to the first information of the first component and the second component, whether the first component and the second component are focus nodes in a first refresh cycle.
其中,第一信息用于区分焦点节点和非焦点节点。由于焦点节点和非焦点节点的判断是基于用户的关注度,即用户关注的部件为焦点节点,用户不关注的部件为非焦点节点。因此,第一信息更趋于可显现的信息,故,第一信息可以包括透明度、窗口管理服务的焦点窗口、叠置顺序(z-order)、是否被遮挡、是否做动画中的一个或多个。The first information is used to distinguish between focus nodes and non-focus nodes. Since the determination of focus nodes and non-focus nodes is based on the user's attention, that is, the component that the user pays attention to is the focus node, and the component that the user does not pay attention to is the non-focus node. Therefore, the first information tends to be more visible information, so the first information can include one or more of transparency, the focus window of the window management service, the stacking order (z-order), whether it is blocked, and whether animation is performed.
在一种具体可实现方式中,第一信息包括透明度,S302具体可实现为:当第一部件的透明度大于第二部件的透明度时,电子设备确定第一部件为非焦点节点,第二部件为焦点节点。示例性的,假设第一部件的第一信息包括透明度为50%,第二部件的第一信息包括透明度为10%,50%>10%,则电子设备确定第一部件为非焦点节点,第二部件为焦点节点。In a specific implementation, the first information includes transparency, and S302 can be specifically implemented as follows: when the transparency of the first component is greater than the transparency of the second component, the electronic device determines that the first component is a non-focus node and the second component is a focus node. Exemplarily, assuming that the first information of the first component includes a transparency of 50%, and the first information of the second component includes a transparency of 10%, and 50%>10%, the electronic device determines that the first component is a non-focus node and the second component is a focus node.
在一种具体可实现方式中,第一信息包括窗口管理服务的焦点窗口,就是说,窗口管理服务检测到用户的窗口操作,例如,窗口管理服务检测到鼠标悬浮于的部件,或者,窗口管理服务检测到部件的显示位置位于显示屏的中部区域,再或者,窗口管理服务检测到用户的输入事件作用的部件。S302具体可实现为:当检测到用户操作第一部件,且未操作第二部件时,电子设备确定第一部件为焦点节点,第二部件为非焦点节点。示例性的,第一部件为第一窗口,第二部件为第二窗口,当用户在第一窗口上进行编辑时,意味着用户较关注第一窗口。此时,电子设备检测到用户的操作,并确定第一窗口为焦点窗口,第二窗口为非焦点窗口。In a specific implementation, the first information includes the focus window of the window management service, that is, the window management service detects the user's window operation, for example, the window management service detects the component that the mouse is hovering over, or the window management service detects that the display position of the component is located in the middle area of the display screen, or the window management service detects the component affected by the user's input event. S302 can be specifically implemented as follows: when it is detected that the user operates the first component and does not operate the second component, the electronic device determines that the first component is the focus node and the second component is the non-focus node. Exemplarily, the first component is the first window and the second component is the second window. When the user edits on the first window, it means that the user pays more attention to the first window. At this time, the electronic device detects the user's operation and determines that the first window is the focus window and the second window is the non-focus window.
在一种具体可实现方式中,第一信息包括窗口管理服务的焦点窗口,例如,窗口管理服务检测用户的视线。S302具体可实现为:当检测到用户的视线落在第一部件上,且未落在第二部件上时,电子设备确定第一部件为焦点节点,第二部件为非焦点节点。In a specific implementation, the first information includes a focus window of a window management service, for example, the window management service detects the user's sight. S302 can be specifically implemented as follows: when it is detected that the user's sight falls on the first component and does not fall on the second component, the electronic device determines that the first component is a focus node and the second component is a non-focus node.
在一种具体可实现方式中,第一信息包括叠置顺序,S302具体可实现为:当第一部件的叠置顺序为顶层,第二部件的叠置顺序为底层时,就是说,第一部件的设置层级较第二部件的设置层级更接近用户面,此时,电子设备确定第一部件为焦点节点,第二部件为非焦点节点。In a specific implementation method, the first information includes a stacking order, and S302 can be specifically implemented as follows: when the stacking order of the first component is the top layer, and the stacking order of the second component is the bottom layer, that is, the setting level of the first component is closer to the user interface than the setting level of the second component. At this time, the electronic device determines that the first component is a focus node and the second component is a non-focus node.
在一种具体可实现方式中,第一信息包括是否做动画,S302具体可实现为:当第一部件的图 像为多帧图像(即动画或视频显示),第二部件的图像为单帧图像(即图片显示)时,电子设备确定第一部件为焦点节点,第二部件为非焦点节点。In a specific implementation, the first information includes whether to perform animation, and S302 can be specifically implemented as follows: when the image of the first component When the image is a multi-frame image (ie, animation or video display) and the image of the second component is a single-frame image (ie, picture display), the electronic device determines that the first component is a focus node and the second component is a non-focus node.
在一种具体可实现方式中,第一信息包括是否被遮挡,S302具体可实现为:当检测到第一部件未被遮挡,第二部件被遮挡时,电子设备确定第一部件为焦点节点,第二部件为非焦点节点。In a specific implementation manner, the first information includes whether it is blocked, and S302 can be specifically implemented as follows: when it is detected that the first component is not blocked and the second component is blocked, the electronic device determines that the first component is a focus node and the second component is a non-focus node.
当然,上述实现方式可以相互组合,具体的,第一信息可以包括透明度和是否被遮挡,或者,第一信息可以包括叠置顺序和窗口管理服务的焦点窗口,再或者,第一信息可以包括透明度、是否做动画、是否被遮挡。本申请实施例不做具体限定。当第一信息包括多个维度信息时,电子设备可以根据各维度信息及其权重,确定各部件是否为焦点节点。Of course, the above implementations can be combined with each other. Specifically, the first information may include transparency and whether it is blocked, or the first information may include the stacking order and the focus window of the window management service, or the first information may include transparency, whether to animate, and whether it is blocked. The embodiments of the present application are not specifically limited. When the first information includes multiple dimensional information, the electronic device can determine whether each component is a focus node based on each dimensional information and its weight.
示例性的,假设第一信息包括透明度、窗口管理服务的焦点窗口、叠置顺序、是否被遮挡、是否做动画。透明度大其权重为0,透明度小其权重为1;窗口管理服务的焦点窗口为1,窗口管理服务的非焦点窗口为0;叠置顺序更接近用户的其权重为1,反之为0;被遮挡的其权重为0,未被遮挡的其权重为1;做动画的其权重为1,未做动画的其权重为0。For example, it is assumed that the first information includes transparency, the focus window of the window management service, the stacking order, whether it is blocked, and whether animation is performed. The weight of a large transparency is 0, and the weight of a small transparency is 1; the focus window of the window management service is 1, and the non-focus window of the window management service is 0; the weight of a stacking order closer to the user is 1, and vice versa; the weight of a blocked window is 0, and the weight of a non-blocked window is 1; the weight of an animated window is 1, and the weight of a non-animated window is 0.
例如,假设第一部件的第一信息可以包括:用户操作第一部件,透明度为50%,叠置顺序为顶层,未被遮挡,做动画;第二部件的第一信息可以包括:透明度为10%,叠置顺序为底层,被遮挡,未做动画。则,第一部件得分为0+1+1+1=3,第二部件得分为1+0+0+0=1,3>1,电子设备可以确定第一部件为焦点节点,第二部件为非焦点节点。For example, assuming that the first information of the first component may include: the user operates the first component, the transparency is 50%, the stacking order is the top layer, it is not blocked, and animation is performed; the first information of the second component may include: the transparency is 10%, the stacking order is the bottom layer, it is blocked, and no animation is performed. Then, the score of the first component is 0+1+1+1=3, and the score of the second component is 1+0+0+0=1, 3>1, and the electronic device can determine that the first component is a focus node and the second component is a non-focus node.
例如,假设第一部件的第一信息可以包括:第一部件位于显示区域的中部,且未被遮挡,做动画;第二部件的第一信息可以包括:第一部件位于显示区域的下部,且未被遮挡,做动画。则,第一部件得分为1+1+1=3,第二部件得分为0+1+1=2,3>2,电子设备可以确定第一部件为焦点节点,第二部件为非焦点节点。For example, assuming that the first information of the first component may include: the first component is located in the middle of the display area, is not blocked, and is animated; the first information of the second component may include: the first component is located in the lower part of the display area, is not blocked, and is animated. Then, the score of the first component is 1+1+1=3, and the score of the second component is 0+1+1=2, 3>2, and the electronic device may determine that the first component is a focus node and the second component is a non-focus node.
在介绍S303之前,此处先介绍本申请实施例提供的技术方案能够应用于的两种渲染架构,这两种渲染架构可以包括分离渲染架构和统一渲染架构。就是说,本申请实施例提供的电子设备的操作系统的图形架构可以采用分离渲染架构,也可以采用统一渲染架构,具体内容如下:Before introducing S303, two rendering architectures to which the technical solution provided by the embodiment of the present application can be applied are first introduced here. These two rendering architectures can include a separate rendering architecture and a unified rendering architecture. That is, the graphics architecture of the operating system of the electronic device provided by the embodiment of the present application can adopt a separate rendering architecture or a unified rendering architecture. The specific contents are as follows:
第一,电子设备采用分离渲染架构。First, electronic devices adopt a separate rendering architecture.
图4示出了一种分离渲染的逻辑示意图。如图4所示,每个应用窗口(简称窗口)可以通过控件树以及渲染树完成渲染。其中,渲染树是用于生成应用程序界面的一个数据结构体。即,渲染树记录有生成应用程序一帧画面的所有信息。示例性的,窗口的控件树中可以包括多个控件模块(或称控件),如根控件、控件1、控件2、控件3等。每个控件中包括对应控件的控制信息,如控件1中包括窗口中的控件1的控制信息(如显示的位置等),该控制信息可用于控制控件1的显示。控件树中各控件与渲染树中各渲染节点一一对应。渲染树可以包括多个渲染节点,如渲染节点0、渲染节点1、渲染节点2、渲染节点3等。相应的,根控件可以对应渲染节点0,控件1可以对应渲染节点1,控件2可以对应渲染节点2,控件3可以对应渲染节点3。按照上述,确定渲染节点0、渲染节点1、渲染节点2和渲染节点3是否为焦点节点。假设确定渲染节点2为焦点节点,渲染节点0、渲染节点1和渲染节点3为非焦点节点,后续如下所述,渲染节点2分配给第一进程进行渲染,就是说,第一进程按照控件2的控制信息对控件2进行渲染。渲染节点0、渲染节点1和渲染节点3分配给第二进程进行渲染。就是说,第二进程按照根控件的控制信息对根控件进行渲染,第二进程按照控件1的控制信息对控件1进行渲染,第二进程按照控件3的控制信息对控件3进行渲染。然后,各进程的渲染结果提交给合成器,其中,每个应用窗口均对应合成器中的一个图层,合成器可以对各应用窗口进行合成,也即对各应用窗口对应的图层进行合成。在本申请实施例中,渲染树也可称为layer树、图层树或其他名称等。FIG4 shows a logic diagram of separate rendering. As shown in FIG4 , each application window (referred to as window) can be rendered through a control tree and a rendering tree. Among them, the rendering tree is a data structure for generating an application program interface. That is, the rendering tree records all the information for generating a frame of the application program. Exemplarily, the control tree of the window may include multiple control modules (or controls), such as a root control, control 1, control 2, control 3, etc. Each control includes control information of the corresponding control, such as control 1 includes control information of control 1 in the window (such as the display position, etc.), and the control information can be used to control the display of control 1. Each control in the control tree corresponds to each rendering node in the rendering tree. The rendering tree may include multiple rendering nodes, such as rendering node 0, rendering node 1, rendering node 2, rendering node 3, etc. Correspondingly, the root control may correspond to rendering node 0, control 1 may correspond to rendering node 1, control 2 may correspond to rendering node 2, and control 3 may correspond to rendering node 3. According to the above, it is determined whether rendering node 0, rendering node 1, rendering node 2, and rendering node 3 are focus nodes. Assume that rendering node 2 is determined to be the focus node, and rendering node 0, rendering node 1, and rendering node 3 are non-focus nodes. As described below, rendering node 2 is assigned to the first process for rendering, that is, the first process renders control 2 according to the control information of control 2. Rendering node 0, rendering node 1, and rendering node 3 are assigned to the second process for rendering. That is, the second process renders the root control according to the control information of the root control, the second process renders control 1 according to the control information of control 1, and the second process renders control 3 according to the control information of control 3. Then, the rendering results of each process are submitted to the synthesizer, wherein each application window corresponds to a layer in the synthesizer, and the synthesizer can synthesize each application window, that is, synthesize the layer corresponding to each application window. In an embodiment of the present application, the rendering tree may also be referred to as a layer tree, a layer tree, or other names.
其中,上述分离渲染架构下,各窗口的层级关系、窗口的大小等由窗口管理服务(window manager service,WMS)进行管理。也即,各窗口对应的图层的层级管理、大小等由WMS进行管理。Among them, under the above-mentioned separated rendering architecture, the hierarchical relationship of each window, the size of the window, etc. are managed by the window manager service (WMS). That is, the hierarchical management and size of the layers corresponding to each window are managed by WMS.
第二,电子设备采用统一渲染架构。Second, electronic devices adopt a unified rendering architecture.
图5示出了本申请实施例提供的一种统一渲染机制的逻辑示意图。如图5所示,相比较于上述分离渲染架构,统一渲染架构存在合一应用,该合一应用可用于将各窗口抽象为控件进行管理,各窗口均为该合一应用中的控件。示例性的,如图5所示,合一应用可以通过控件树管理控件1、 控件2、容器控件3、窗口控件4、状态栏控件5等各种控件的布局以及层级等。其中,控件1以及控件2可以为现有定义的控件,如图标等。窗口控件4以及状态栏控件5均可作为容器控件3的子节点。合一应用可以根据控件树生成对应的渲染树,如生成的渲染树中的渲染节点可以包括根渲染节点以及渲染节点1至渲染节点5等,合一应用并将该渲染树提交给渲染服务。可以理解,控件1对应渲染节点1,控件2对应渲染节点2,容器控件3对应渲染节点3,窗口控件4对应渲染节点4,状态栏控件5对应渲染节点5等。渲染服务通过遍历各渲染节点,并按照上述描述确定各个渲染节点是否为焦点节点,并将焦点节点分配给主线程(即上述第一进程)进行渲染,将非焦点节点分配给次线程(即上述第二进程)进行渲染,从而可以完成对整个界面的渲染。后续,可以直接将渲染结果送到显示屏显示。FIG5 shows a logic diagram of a unified rendering mechanism provided by an embodiment of the present application. As shown in FIG5, compared with the above-mentioned separate rendering architecture, the unified rendering architecture has a unified application, which can be used to abstract each window into a control for management, and each window is a control in the unified application. For example, as shown in FIG5, the unified application can manage controls 1, The layout and hierarchy of various controls such as control 2, container control 3, window control 4, and status bar control 5. Among them, control 1 and control 2 can be existing defined controls, such as icons. Both window control 4 and status bar control 5 can be child nodes of container control 3. The unified application can generate a corresponding rendering tree based on the control tree. For example, the rendering nodes in the generated rendering tree can include a root rendering node and rendering nodes 1 to 5, and the unified application submits the rendering tree to the rendering service. It can be understood that control 1 corresponds to rendering node 1, control 2 corresponds to rendering node 2, container control 3 corresponds to rendering node 3, window control 4 corresponds to rendering node 4, and status bar control 5 corresponds to rendering node 5. The rendering service traverses each rendering node and determines whether each rendering node is a focus node according to the above description, and assigns the focus node to the main thread (i.e., the first process mentioned above) for rendering, and assigns the non-focus node to the secondary thread (i.e., the second process mentioned above) for rendering, so as to complete the rendering of the entire interface. Subsequently, the rendering result can be directly sent to the display screen for display.
在一些实施例中,合一应用可以理解为具有WMS、桌面、SystemUI等各种应用的功能的虚拟化应用(或称服务)。比如:合一应用可以具有与WMS类似的,对各控件(如包括但不限于窗口控件等)位置、大小、层级等进行管理的功能以及具有分屏、全屏等手势管理的功能。还可以具有与桌面类似的,对图标等进行管理的功能以及具有多任务等手势管理的功能等。In some embodiments, the unified application can be understood as a virtualized application (or service) with the functions of various applications such as WMS, desktop, SystemUI, etc. For example, the unified application can have functions similar to WMS, such as managing the position, size, and hierarchy of various controls (such as but not limited to window controls, etc.), and having functions such as split screen and full screen gesture management. It can also have functions similar to the desktop, such as managing icons, etc., and having functions such as multi-tasking gesture management, etc.
在此处介绍图4和图5所示的两种渲染架构,是为了说明本申请实施例提供的技术方案至少可以应用于这两种渲染架构。可以理解的,本申请实施例通过的技术方案也可以应用于其他的渲染架构,本申请实施例中不做一一列举。The two rendering architectures shown in Figures 4 and 5 are introduced here to illustrate that the technical solutions provided in the embodiments of the present application can at least be applied to these two rendering architectures. It can be understood that the technical solutions adopted in the embodiments of the present application can also be applied to other rendering architectures, which are not listed one by one in the embodiments of the present application.
S303、当第一部件为焦点节点,第二部件为非焦点节点时,在第一刷新周期内通过第一进程渲染第一部件,并通过第二进程渲染第二部件,第一进程的渲染优先级高于第二进程的渲染优先级。S303: When the first component is a focus node and the second component is a non-focus node, the first component is rendered by a first process in a first refresh cycle, and the second component is rendered by a second process, and the rendering priority of the first process is higher than the rendering priority of the second process.
就是说,电子设备存在并行渲染进程,渲染优先级高的进程渲染焦点节点,渲染优先级低的进程渲染非焦点节点,这样,针对用户关注的节点(即焦点节点),对该焦点节点进行实时渲染,保证高帧率;针对用户不关注的节点(即非焦点节点),在保证焦点节点实时渲染的情况下,对该非焦点节点进行渲染,以提高用户对关注节点图形性能流畅体验。That is to say, there are parallel rendering processes in the electronic device. The process with a high rendering priority renders the focus node, and the process with a low rendering priority renders the non-focus node. In this way, for the node that the user is concerned about (i.e., the focus node), the focus node is rendered in real time to ensure a high frame rate; for the node that the user is not concerned about (i.e., the non-focus node), the non-focus node is rendered while ensuring the real-time rendering of the focus node, so as to improve the user's experience of the smooth performance of the graphics of the focused node.
示例性的,如图6所示,假设窗口A为焦点节点,窗口C为非焦点节点,则,当电子设备接收第一刷新信号时,电子设备的第一进程对窗口A进行渲染,电子设备的第二进程对窗口C进行渲染,并将渲染后的图像上屏显示。Exemplarily, as shown in Figure 6, assuming that window A is the focus node and window C is the non-focus node, when the electronic device receives the first refresh signal, the first process of the electronic device renders window A, and the second process of the electronic device renders window C, and displays the rendered image on the screen.
在一种具体可实现方式中,结合图3-1所示,步骤②电子设备的焦点节点确定模块确定第一部件为焦点节点,第二部件为非焦点节点。之后,电子设备的焦点节点确定模块将该确定结果发送给电子设备的渲染服务,该渲染服务根据该确定结果,将第一部件对应的渲染任务分配给第一进程进行渲染,将第二部件对应的渲染任务分配给第二进程进行渲染。In a specific implementation, as shown in FIG3-1, in step ②, the focus node determination module of the electronic device determines that the first component is a focus node and the second component is a non-focus node. Afterwards, the focus node determination module of the electronic device sends the determination result to the rendering service of the electronic device, and the rendering service assigns the rendering task corresponding to the first component to the first process for rendering, and assigns the rendering task corresponding to the second component to the second process for rendering according to the determination result.
在本申请实施例中,电子设备在接收到用户对界面的操作之后,电子设备确定界面上的各部件是否为焦点节点。如果第一部件是焦点节点,则电子设备的第一进程实时渲染第一部件。如果第二部件是非焦点节点,则电子设备的第二进程渲染第二部件。这样,电子设备仅需确保用户关注的焦点节点的实时渲染即可,优先保证焦点节点(如焦点窗口/焦点控件)的高帧率,从而保证该焦点节点的图像显示顺畅,无卡顿白屏现象发生,提升高负载场景下用户的性能流畅体验。In an embodiment of the present application, after receiving an operation of the user on the interface, the electronic device determines whether each component on the interface is a focus node. If the first component is a focus node, the first process of the electronic device renders the first component in real time. If the second component is a non-focus node, the second process of the electronic device renders the second component. In this way, the electronic device only needs to ensure the real-time rendering of the focus node that the user is concerned about, and gives priority to ensuring the high frame rate of the focus node (such as the focus window/focus control), thereby ensuring that the image of the focus node is displayed smoothly, without stuttering or white screen phenomenon, and improving the user's performance smoothness experience in high-load scenarios.
S304、当在第一刷新周期内第二进程未完成对第二部件的渲染时,复用第二部件在第二刷新周期内已有的纹理图像,第二刷新周期为第一刷新周期的前一个周期。S304: when the second process has not completed rendering of the second component within the first refresh cycle, reuse the existing texture image of the second component within the second refresh cycle, where the second refresh cycle is a cycle before the first refresh cycle.
就是说,如果在第一刷新周期内第二进程未完成对第二部件的渲染,则复用第二部件已缓存的纹理图像,这样,针对用户关注的节点(即焦点节点),对该焦点节点进行实时渲染,保证高帧率;针对用户不关注的节点(即非焦点节点),在保证焦点节点实时渲染的情况下,当对该非焦点节点未完成渲染时,复用该非焦点节点已有的纹理图像,进而提高用户对关注节点图形性能流畅体验。That is to say, if the second process has not completed the rendering of the second component within the first refresh cycle, the cached texture image of the second component will be reused. In this way, for the node that the user is concerned about (i.e., the focus node), the focus node is rendered in real time to ensure a high frame rate; for the nodes that the user is not concerned about (i.e., non-focus nodes), while ensuring the real-time rendering of the focus node, when the rendering of the non-focus node is not completed, the existing texture image of the non-focus node is reused, thereby improving the user's experience of the smooth performance of the graphics of the focused node.
沿用上述示例,如图6所示,当电子设备接收第一刷新信号时,电子设备的第一进程对窗口A进行渲染,电子设备的第二进程对窗口C进行渲染,但是,当在第一刷新周期内第二进程未完成对窗口C的渲染时,电子设备将第一进程渲染后的图像和窗口C已有的纹理图像(如第二刷新周期内渲染的图像)上屏显示。当第二进程完成对窗口C的渲染之后,将该窗口C的纹理图像进行缓存。 Continuing with the above example, as shown in FIG6 , when the electronic device receives the first refresh signal, the first process of the electronic device renders window A, and the second process of the electronic device renders window C. However, when the second process has not completed the rendering of window C within the first refresh cycle, the electronic device displays the image rendered by the first process and the existing texture image of window C (such as the image rendered within the second refresh cycle) on the screen. After the second process completes the rendering of window C, the texture image of window C is cached.
在渲染结束之后,如图3-1所示,步骤③电子设备的渲染服务将渲染后的图像发送给合成器,该合成器对各渲染结果进行合成。之后,步骤④合成器将合成后的图像发送给显示屏进行显示。After the rendering is finished, as shown in FIG3-1, in step ③, the rendering service of the electronic device sends the rendered image to the synthesizer, which synthesizes the rendering results. Then, in step ④, the synthesizer sends the synthesized image to the display screen for display.
在一些实施例中,本申请实施例并不局限于第一部件和第二部件,还可以包括第三部件,该第三部件可以与第一部件和第二部件属于同一应用,也可以与第一部件和第二部件属于不应用。示例性的,以第三部件与第一部件和第二部件属于不应用为例,图7为本申请实施例提供的一种图像渲染方法的流程示意图,如图7所示,本申请实施例提供的方法包括上述S301,该方法还包括:In some embodiments, the embodiment of the present application is not limited to the first component and the second component, and may also include a third component, which may belong to the same application as the first component and the second component, or may not belong to the first component and the second component. Exemplarily, taking the third component as an example of not belonging to the first component and the second component, FIG7 is a flow chart of an image rendering method provided by the embodiment of the present application. As shown in FIG7, the method provided by the embodiment of the present application includes the above-mentioned S301, and the method also includes:
S701、电子设备显示第二界面,第二界面包括第三部件,第二界面为第二应用的界面,第二应用与第一应用不同。S701. The electronic device displays a second interface, where the second interface includes a third component and is an interface of a second application, which is different from the first application.
具体的,S701的具体描述可参加上述S301,在此不再赘述。Specifically, the detailed description of S701 can be found in the above S301, which will not be repeated here.
S702、响应于对第二界面的操作,根据第一部件的第一信息、第二部件的第一信息和第三部件的第一信息,确定在第一刷新周期内第一部件、第二部件和第三部件是否为焦点节点。S702 . In response to an operation on the second interface, determine whether the first component, the second component, and the third component are focus nodes in a first refresh cycle according to first information of the first component, first information of the second component, and first information of the third component.
具体的,S702的具体描述可参加上述S302,在此不再赘述。Specifically, the detailed description of S702 may refer to the above S302, which will not be repeated here.
S703、当第三部件为焦点节点,第一部件和第二部件均为非焦点节点时,在第一刷新周期内通过第一进程渲染第三部件,并通过第二进程渲染第一部件和第二部件。S703: When the third component is a focus node and the first component and the second component are both non-focus nodes, render the third component through the first process in a first refresh cycle, and render the first component and the second component through the second process.
具体的,S703的具体描述可参加上述S303,在此不再赘述。Specifically, the specific description of S703 can be found in the above S303, which will not be repeated here.
在一种具体可实现方式中,电子设备通过第二进程渲染第一部件和第二部件,具体可以为:In a specific implementation manner, the electronic device renders the first component and the second component through the second process, which may be:
S7031、电子设备根据第一部件的第二信息和第二部件的第二信息,及第二信息及其权重,确定第一部件和第二部件的渲染优先级。S7031. The electronic device determines the rendering priority of the first component and the second component according to the second information of the first component and the second information of the second component, and the second information and the weight thereof.
其中,第二信息不同于第一信息,第二信息用于区分非焦点节点的渲染优先级。就是说,通过第二信息可以判断非焦点节点的渲染顺序。因此,第二信息更趋于渲染迫切性的信息,故,第二信息可以包括以下至少一项:没有生成缓存的可见窗口、没有生成缓存的不可见窗口、生成缓存且有可见脏区的窗口、生成缓存且只有不可见脏区的窗口、及生成缓存的静态窗口。The second information is different from the first information, and the second information is used to distinguish the rendering priority of non-focus nodes. That is, the rendering order of non-focus nodes can be determined by the second information. Therefore, the second information is more inclined to the information of rendering urgency, so the second information can include at least one of the following: a visible window without generated cache, an invisible window without generated cache, a window with generated cache and visible dirty area, a window with generated cache and only invisible dirty area, and a static window with generated cache.
其中,电子设备确定第一部件和第二部件的优先级的表达式可以为:
The expression used by the electronic device to determine the priority of the first component and the second component may be:
其中,ω_i为第i个特征对应的权重,f_i为第i个特征。Among them, ω_i is the weight corresponding to the i-th feature, and f_i is the i-th feature.
示例性的,假设第二信息包括没有生成缓存的可见窗口、没有生成缓存的不可见窗口、生成缓存且有可见脏区的窗口、生成缓存且只有不可见脏区的窗口、及生成缓存的静态窗口。这些信息的权重依次递减,如,没有生成缓存的可见窗口的权重为5,没有生成缓存的不可见窗口的权重为4,生成缓存且有可见脏区的窗口的权重为3,生成缓存且只有不可见脏区的窗口的权重为2,生成缓存的静态窗口的权重为1。Exemplarily, it is assumed that the second information includes a visible window without a generated cache, an invisible window without a generated cache, a window with a generated cache and a visible dirty area, a window with a generated cache and only an invisible dirty area, and a static window with a generated cache. The weights of these information are decreasing in sequence, for example, the weight of a visible window without a generated cache is 5, the weight of an invisible window without a generated cache is 4, the weight of a window with a generated cache and a visible dirty area is 3, the weight of a window with a generated cache and only an invisible dirty area is 2, and the weight of a static window with a generated cache is 1.
例1、若第一部件的第二信息为没有生成缓存的可见窗口,第二部件的第二信息为没有生成缓存的不可见窗口。则,第一部件的优先级为5,第二部件的优先级为4。Example 1: If the second information of the first component is a visible window without generating a cache, and the second information of the second component is an invisible window without generating a cache, then the priority of the first component is 5, and the priority of the second component is 4.
例2、若第二部件的第二信息为生成缓存的静态窗口,第一部件的第二信息为生成缓存且只有不可见脏区的窗口。则,第一部件的优先级为2,第二部件的优先级为1。Example 2: If the second information of the second component is a static window for generating cache, and the second information of the first component is a window for generating cache and having only invisible dirty areas, then the priority of the first component is 2, and the priority of the second component is 1.
S7032、当第一部件的渲染优先级高于第二部件的渲染优先级时,通过第二进程依次渲染第一部件和第二部件。S7032: When the rendering priority of the first component is higher than the rendering priority of the second component, render the first component and the second component in sequence through the second process.
沿用上述例1,5>4,则电子设备的第二进程优先渲染第一部件,之后渲染第二部件。Continuing with the above example 1, 5>4, the second process of the electronic device renders the first component first and then the second component.
沿用上述例2,2>1,则电子设备的第二进程优先渲染第一部件,之后渲染第二部件。Using the above example 2, 2>1, the second process of the electronic device renders the first component first and then the second component.
本申请实施例中,当存在多个非焦点节点时,电子设备确定各非焦点节点的渲染优先级,之后,电子设备根据各非焦点节点的渲染优先级,来渲染各非焦点节点对应的部件,实现秩序渲染各部件,缓解在高负载场景下CPU和GPU资源的紧张。In an embodiment of the present application, when there are multiple non-focus nodes, the electronic device determines the rendering priority of each non-focus node. Thereafter, the electronic device renders the components corresponding to each non-focus node according to the rendering priority of each non-focus node, thereby achieving orderly rendering of the components and alleviating the tension of CPU and GPU resources in high-load scenarios.
在实际应用中,需要结合如下应用场景对本申请实施例提供的方法进行详细说明。具体如下:In practical applications, the method provided in the embodiment of the present application needs to be described in detail in combination with the following application scenarios. Specifically:
场景一,同一应用中同一窗口中不同控件的渲染。Scenario 1: Rendering of different controls in the same window of the same application.
图8为本申请提供的一种电子设备的界面示意图。如图8所示,电子设备100显示界面801,该界面801上显示普通控件1、视频控件2和视频控件3。以统一渲染架构为例,则结合图4所示的统一渲染架构,该界面801对应根控件,即对应渲染节点0;普通控件1对应控件1,即对应渲 染节点1;视频控件2对应控件2,即对应渲染节点2;视频控件3对应控件3,即对应渲染节点3。在第一刷新周期内,当用户滑动该界面801时,该界面801的视频控件2位于显示屏的中部区域,此时,电子设备100可以检测到:普通控件1位于显示屏的上部区域,且视频控件2的图像为单帧图像;视频控件2位于显示屏的中部区域,且视频控件2的图像为多帧图像;视频控件3位于显示屏的下部区域,且视频控件3的图像为多帧图像。此时,假设;位于中部区域的其权重为1,反之为0,做动画的其权重为1,未做动画的其权重为0。则,电子设备可以确定普通控件1的得分为0+0=0,视频控件2的得分为1+1=2,视频控件3的得分为0+1=1,2>1>0,则意味着用户较关注视频控件2,此时,电子设备100确定视频控件2为焦点节点,普通控件1和视频控件3为非焦点节点。进一步的,由于普通控件1为生成缓存的静态窗口,视频控件3为没有生成缓存的可见窗口,则电子设备100可以确定视频控件3的渲染优先级高于普通节点1的渲染优先级。则,电子设备100将视频控件2分配给第一进程,普通控件1和视频控件3分配给第二进程。电子设备100的第一进程实时渲染视频控件2,并将渲染后的图像上屏显示。电子设备100的第二进程先渲染视频控件3、再渲染普通控件1,若在第一刷新周期内第二进程未完成的普通控件1和视频控件3的渲染,则电子设备100将普通控件1和视频控件3的已有纹理图像上屏显示。可见,电子设备可以确保视频控件2的实时渲染,使得视频控件2动画流畅,满足用户的使用体验。而且,普通控件1和视频控件3的渲染并未干扰视频控件2,且如果未完成渲染可以采用已有的纹理图像,进一步确保视频控件2动画流畅,有效防止视频控件2卡顿。FIG8 is a schematic diagram of an interface of an electronic device provided by the present application. As shown in FIG8, the electronic device 100 displays an interface 801, and the interface 801 displays common controls 1, video controls 2, and video controls 3. Taking the unified rendering architecture as an example, in combination with the unified rendering architecture shown in FIG4, the interface 801 corresponds to the root control, that is, to the rendering node 0; the common control 1 corresponds to the control 1, that is, to the rendering node 3; Rendering node 1; video control 2 corresponds to control 2, that is, corresponding to rendering node 2; video control 3 corresponds to control 3, that is, corresponding to rendering node 3. In the first refresh cycle, when the user slides the interface 801, the video control 2 of the interface 801 is located in the middle area of the display screen. At this time, the electronic device 100 can detect that: ordinary control 1 is located in the upper area of the display screen, and the image of video control 2 is a single-frame image; video control 2 is located in the middle area of the display screen, and the image of video control 2 is a multi-frame image; video control 3 is located in the lower area of the display screen, and the image of video control 3 is a multi-frame image. At this time, it is assumed that the weight of the control located in the middle area is 1, otherwise it is 0, the weight of the control that is animated is 1, and the weight of the control that is not animated is 0. Then, the electronic device can determine that the score of the common control 1 is 0+0=0, the score of the video control 2 is 1+1=2, and the score of the video control 3 is 0+1=1. 2>1>0 means that the user pays more attention to the video control 2. At this time, the electronic device 100 determines that the video control 2 is the focus node, and the common control 1 and the video control 3 are non-focus nodes. Further, since the common control 1 is a static window that generates a cache, and the video control 3 is a visible window that does not generate a cache, the electronic device 100 can determine that the rendering priority of the video control 3 is higher than the rendering priority of the common node 1. Then, the electronic device 100 assigns the video control 2 to the first process, and the common control 1 and the video control 3 to the second process. The first process of the electronic device 100 renders the video control 2 in real time and displays the rendered image on the screen. The second process of the electronic device 100 renders the video control 3 first, and then renders the common control 1. If the second process does not complete the rendering of the common control 1 and the video control 3 within the first refresh cycle, the electronic device 100 displays the existing texture images of the common control 1 and the video control 3 on the screen. It can be seen that the electronic device can ensure the real-time rendering of the video control 2, so that the animation of the video control 2 is smooth and satisfies the user's experience. Moreover, the rendering of the ordinary control 1 and the video control 3 does not interfere with the video control 2, and if the rendering is not completed, the existing texture image can be used to further ensure the smooth animation of the video control 2 and effectively prevent the video control 2 from freezing.
场景二,不同应用中不同窗口的渲染。Scenario 2: Rendering of different windows in different applications.
图9为本申请提供的一种电子设备的界面示意图。如图9所示,电子设备100显示界面901,该界面901上显示窗口1、窗口2和窗口3。以分离渲染架构为例,则结合图5所示的分离渲染架构,该界面901对应根控件,即对应根渲染节点;窗口1对应控件1,即对应渲染节点1;窗口2对容器控件3,即对应渲染节点3;窗口3对应控件2,即对应渲染节点2。当鼠标悬浮于窗口3时,电子设备100检测到:窗口1的叠置顺序为底层;窗口2的叠置顺序为中间层;窗口3的叠置顺序为顶层,且窗口3为鼠标悬浮的窗口。此时,假设;叠置顺序更接近用户的其权重为1,反之为0。则,电子设备可以确定窗口1的得分为0,窗口2的得分为0,窗口3的得分为1,1>0,则意味着用户较关窗口3,此时,电子设备100确定窗口3为焦点节点,窗口1和窗口2为非焦点节点。进一步的,由于窗口1为生成缓存的静态窗口,窗口2为生成缓存的可见窗口,则电子设备100可以确定窗口2的渲染优先级高于窗口1的渲染优先级。则,电子设备100将窗口3分配给第一进程进行渲染,窗口1和窗口2分配给第二进程进行渲染。电子设备100的第一进程实时渲染窗口3,并将渲染后的图像上屏显示。电子设备100的第二进程先渲染窗口2、再渲染窗口1,若在第一刷新周期内第二进程未完成的窗口1和窗口2的渲染,则电子设备100将窗口1和窗口2的已有纹理图像上屏显示。可见,电子设备可以确保窗口3的实时渲染,使得在高负载场景下窗口3作为焦点节点进行实时渲染显示,满足用户的使用体验。而且,窗口1和窗口2可以采用已有的纹理图像,进一步确保窗口3性能流畅,有效防止窗口3卡顿。FIG9 is a schematic diagram of an interface of an electronic device provided by the present application. As shown in FIG9 , the electronic device 100 displays an interface 901, on which window 1, window 2 and window 3 are displayed. Taking the separated rendering architecture as an example, in combination with the separated rendering architecture shown in FIG5 , the interface 901 corresponds to the root control, that is, the root rendering node; window 1 corresponds to control 1, that is, the rendering node 1; window 2 corresponds to container control 3, that is, the rendering node 3; window 3 corresponds to control 2, that is, the rendering node 2. When the mouse is suspended over window 3, the electronic device 100 detects that: the stacking order of window 1 is the bottom layer; the stacking order of window 2 is the middle layer; the stacking order of window 3 is the top layer, and window 3 is the window where the mouse is suspended. At this time, it is assumed that the weight of the stacking order closer to the user is 1, otherwise it is 0. Then, the electronic device can determine that the score of window 1 is 0, the score of window 2 is 0, and the score of window 3 is 1, 1>0, which means that the user is more concerned about window 3. At this time, the electronic device 100 determines that window 3 is the focus node, and window 1 and window 2 are non-focus nodes. Further, since window 1 is a static window for generating cache, and window 2 is a visible window for generating cache, the electronic device 100 can determine that the rendering priority of window 2 is higher than the rendering priority of window 1. Then, the electronic device 100 assigns window 3 to the first process for rendering, and assigns window 1 and window 2 to the second process for rendering. The first process of the electronic device 100 renders window 3 in real time, and displays the rendered image on the screen. The second process of the electronic device 100 renders window 2 first, and then renders window 1. If the second process does not complete the rendering of window 1 and window 2 within the first refresh cycle, the electronic device 100 displays the existing texture images of window 1 and window 2 on the screen. It can be seen that the electronic device can ensure the real-time rendering of window 3, so that window 3 is rendered and displayed in real time as a focus node in a high-load scenario to meet the user's experience. Moreover, window 1 and window 2 can use existing texture images to further ensure the smooth performance of window 3 and effectively prevent window 3 from freezing.
可见,本申请实施例提供的技术方案可以适用于图8所示的侧重于针对同一窗口中不同控件差异化渲染处理,也可以适用于图9所示的侧重于针对不同窗口差异化渲染处理,当然,还可以适用于其他场景,本申请实施例不做具体限定。It can be seen that the technical solution provided in the embodiment of the present application can be applicable to the differentiated rendering processing focused on different controls in the same window as shown in Figure 8, and can also be applicable to the differentiated rendering processing focused on different windows as shown in Figure 9. Of course, it can also be applicable to other scenarios, and the embodiment of the present application does not make specific limitations.
如果没有特殊说明以及逻辑冲突,本申请各个实施例之间的术语和/或描述具有一致性、且可以相互引用,不同的实施例中的技术特征根据其内在的逻辑关系可以组合形成新的实施例。Unless otherwise specified or there is no logical conflict, the terms and/or descriptions between the various embodiments of the present application are consistent and can be referenced to each other. The technical features in different embodiments can be combined to form new embodiments according to their internal logical relationships.
上述主要是从方法的角度对本申请实施例提供的方案进行了介绍。可以理解的是,电子设备为了实现上述功能,其包含了执行各个功能相应的硬件结构和/或软件模块。结合本申请中所公开的实施例描述的各示例的单元及算法步骤,本申请实施例能够以硬件或硬件和计算机软件的结合形式来实现。某个功能究竟以硬件还是计算机驱动硬件的方式来执行,取决于技术方案的特定应用和设计约束条件。本领域技术人员可以对每个特定的应用来使用不同的方法来实现所描述的功能,但是这种实现不应认为超过本申请实施例的技术方案的范围。The above mainly introduces the solution provided by the embodiment of the present application from the perspective of the method. It is understandable that, in order to realize the above functions, the electronic device includes a hardware structure and/or software module corresponding to the execution of each function. In combination with the units and algorithm steps of each example described in the embodiment disclosed in this application, the embodiment of the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer-driven hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the technical solution of the embodiment of the present application.
本申请是实施例可以根据上述方法示例对电子设备进行功能模块的划分,例如,可以对应各个功能划分各个功能模块,也可以将两个或两个以上的功能集成在一个处理单元中。上述集成的 单元既可以采用硬件的形式,也可以采用软件功能模块的形式实现。需要说明的是,本申请实施例中对单元的划分是示意性的,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式。The present application is an embodiment that can divide the electronic device into functional modules according to the above method example. For example, each functional module can be divided according to each function, or two or more functions can be integrated into one processing unit. The unit can be implemented in the form of hardware or software functional modules. It should be noted that the division of the units in the embodiment of the present application is schematic and is only a logical function division. There may be other division methods in actual implementation.
如图10所示,为本申请实施例提供的一种电子设备的结构示意图,该电子设备1000可用于实现以上各个方法实施例中记载的方法。示例性的,该电子设备1000具体可以包括:显示单元1001和处理单元1002。As shown in FIG10 , it is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application, and the electronic device 1000 can be used to implement the methods described in the above method embodiments. Exemplarily, the electronic device 1000 may specifically include: a display unit 1001 and a processing unit 1002 .
其中,显示单元1001用于执行支持电子设备1000执行图3-2中步骤S301或图7中步骤S301和S701。和/或,显示单元1001还用于支持电子设备1000执行本申请实施例中电子设备执行的其他步骤。The display unit 1001 is used to support the electronic device 1000 to perform step S301 in FIG. 3-2 or steps S301 and S701 in FIG. 7. And/or, the display unit 1001 is also used to support the electronic device 1000 to perform other steps performed by the electronic device in the embodiment of the present application.
处理单元1002用于执行支持电子设备1000执行图3-2中的步骤S302至S304,或图7中步骤S702至S703。和/或,处理单元1002还用于支持电子设备1000执行本申请实施例中电子设备执行的其他步骤。The processing unit 1002 is used to support the electronic device 1000 to perform steps S302 to S304 in Figure 3-2, or steps S702 to S703 in Figure 7. And/or, the processing unit 1002 is also used to support the electronic device 1000 to perform other steps performed by the electronic device in the embodiment of the present application.
可选的,图10所示的电子设备1000还可以包括通信单元1003,该通信单元1003,用于支持电子设备1000执行本申请实施例中电子设备与其他设备之间通信的步骤。Optionally, the electronic device 1000 shown in FIG. 10 may further include a communication unit 1003, where the communication unit 1003 is used to support the electronic device 1000 in executing the steps of communication between the electronic device and other devices in the embodiments of the present application.
可选的,图10所示的电子设备1000还可以包括存储单元(图10中未示出),该存储单元存储有程序或指令。当处理单元1002执行该程序或指令时,使得图10所示的电子设备1000可以执行如图3-2等中所示的方法。Optionally, the electronic device 1000 shown in FIG10 may further include a storage unit (not shown in FIG10 ), which stores a program or instruction. When the processing unit 1002 executes the program or instruction, the electronic device 1000 shown in FIG10 may execute the method shown in FIG3-2 , etc.
图10所示的电子设备1000的技术效果可以参考图3-2等所示的方法的技术效果,此处不再赘述。图10所示的电子设备1000中涉及的处理单元1002可以由处理器或处理器相关电路组件实现,可以为处理器或处理模块。通信单元可以由收发器或收发器相关电路组件实现,可以为收发器或收发模块。显示单元1001可以由显示屏相关组件实现。The technical effects of the electronic device 1000 shown in FIG. 10 can refer to the technical effects of the methods shown in FIG. 3-2, etc., and will not be repeated here. The processing unit 1002 involved in the electronic device 1000 shown in FIG. 10 can be implemented by a processor or a processor-related circuit component, which can be a processor or a processing module. The communication unit can be implemented by a transceiver or a transceiver-related circuit component, which can be a transceiver or a transceiver module. The display unit 1001 can be implemented by display screen-related components.
应理解,上述方法实施例中的各步骤可以通过处理器中的硬件的集成逻辑电路或者软件形式的指令完成。结合本申请实施例所公开的方法步骤可以直接体现为硬件处理器执行完成,或者用处理器中的硬件及软件模块组合执行完成。It should be understood that each step in the above method embodiment can be completed by an integrated logic circuit of hardware in a processor or by instructions in the form of software. The method steps disclosed in the embodiments of the present application can be directly embodied as being executed by a hardware processor, or by a combination of hardware and software modules in a processor.
需要说明的是,上述方法实施例涉及的各步骤的所有相关内容均可以援引到对应功能模块的功能描述,在此不再赘述。It should be noted that all relevant contents of each step involved in the above method embodiment can be referred to the functional description of the corresponding functional module and will not be repeated here.
本申请实施例还提供了一种计算机可读存储介质,包括指令,当其在计算机上运行时,使得计算机执行上述任一方法。An embodiment of the present application also provides a computer-readable storage medium, including instructions, which, when executed on a computer, enable the computer to execute any of the above methods.
本申请实施例还提供了一种包含指令的计算机程序产品,当其在计算机上运行时,使得计算机执行上述任一方法。The embodiment of the present application also provides a computer program product including instructions, which, when executed on a computer, enables the computer to execute any of the above methods.
本申请实施例还提供了一种芯片,该芯片包括处理器和接口电路,该接口电路和该处理器耦合,该处理器用于运行计算机程序或指令,以实现上述方法,该接口电路用于与该芯片之外的其它模块进行通信。An embodiment of the present application also provides a chip, which includes a processor and an interface circuit, the interface circuit is coupled to the processor, the processor is used to run a computer program or instruction to implement the above method, and the interface circuit is used to communicate with other modules outside the chip.
本申请各实施例的任意特征或任意步骤的全部或部分,均可以自由组合。组合后的技术方案也在本申请的范围之内。All or part of any features or steps in the embodiments of the present application can be freely combined, and the combined technical solutions are also within the scope of the present application.
在本申请的描述中,除非另有说明,“/”表示“或”的意思,例如,A/B可以表示A或B。本文中的“和/或”仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。此外,“至少一个”是指一个或多个,“多个”是指两个或两个以上。“第一”、“第二”等字样并不对数量和执行次序进行限定,并且“第一”、“第二”等字样也并不限定一定不同。In the description of this application, unless otherwise specified, "/" means "or", for example, A/B can mean A or B. "And/or" in this article is merely a description of the association relationship of associated objects, indicating that three relationships may exist. For example, A and/or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, "at least one" means one or more, and "plurality" means two or more. The words "first", "second", etc. do not limit the quantity and execution order, and the words "first", "second", etc. do not limit them to be different.
在本申请的描述中,“示例性的”或者“例如”等词用于表示作例子、例证或说明。本申请实施例中被描述为“示例性的”或者“例如”的任何实施例或设计方案不应被解释为比其它实施例或设计方案更优选或更具优势。确切而言,使用“示例性的”或者“例如”等词旨在以具体方式呈现相关概念。In the description of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.
通过以上实施方式的描述,所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将装置的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。 Through the description of the above implementation methods, technical personnel in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.
在本申请所提供的几个实施例中,应该理解到,所揭露的装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述模块或单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个装置,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是一个物理单元或多个物理单元,即可以位于一个地方,或者也可以分布到多个不同地方。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and the components shown as units may be one physical unit or multiple physical units, that is, they may be located in one place or distributed in multiple different places. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个可读取存储介质中。基于这样的理解,本申请实施例的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该软件产品存储在一个存储介质中,包括若干指令用以使得一个设备(可以是单片机,芯片等)或处理器(processor)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(read only memory,ROM)、随机存取存储器(random access memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions to enable a device (which can be a single-chip microcomputer, chip, etc.) or a processor (processor) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program code.
以上内容,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何在本申请揭露的技术范围内的变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以所述权利要求的保护范围为准。 The above contents are only specific implementation methods of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions within the technical scope disclosed in the present application shall be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.
Claims (30)
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202311471303.7A CN119941964A (en) | 2023-11-06 | 2023-11-06 | Image rendering method and electronic device |
| CN202311471303.7 | 2023-11-06 |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2025097978A1 true WO2025097978A1 (en) | 2025-05-15 |
Family
ID=95547536
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2024/115971 Pending WO2025097978A1 (en) | 2023-11-06 | 2024-08-30 | Image rendering method and electronic device |
Country Status (2)
| Country | Link |
|---|---|
| CN (1) | CN119941964A (en) |
| WO (1) | WO2025097978A1 (en) |
Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20140361977A1 (en) * | 2013-06-07 | 2014-12-11 | Sony Computer Entertainment Inc. | Image rendering responsive to user actions in head mounted display |
| US20180077409A1 (en) * | 2016-09-09 | 2018-03-15 | Samsung Electronics Co., Ltd. | Method, storage medium, and electronic device for displaying images |
| CN111047676A (en) * | 2018-10-12 | 2020-04-21 | 中国移动通信集团广西有限公司 | Image rendering method, device and storage medium |
| CN116680046A (en) * | 2023-04-25 | 2023-09-01 | 麒麟软件有限公司 | Focused window rendering priority method |
| CN116980696A (en) * | 2023-06-21 | 2023-10-31 | 腾讯科技(深圳)有限公司 | Image processing method, device, equipment, storage medium and product |
-
2023
- 2023-11-06 CN CN202311471303.7A patent/CN119941964A/en active Pending
-
2024
- 2024-08-30 WO PCT/CN2024/115971 patent/WO2025097978A1/en active Pending
Patent Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20140361977A1 (en) * | 2013-06-07 | 2014-12-11 | Sony Computer Entertainment Inc. | Image rendering responsive to user actions in head mounted display |
| US20180077409A1 (en) * | 2016-09-09 | 2018-03-15 | Samsung Electronics Co., Ltd. | Method, storage medium, and electronic device for displaying images |
| CN111047676A (en) * | 2018-10-12 | 2020-04-21 | 中国移动通信集团广西有限公司 | Image rendering method, device and storage medium |
| CN116680046A (en) * | 2023-04-25 | 2023-09-01 | 麒麟软件有限公司 | Focused window rendering priority method |
| CN116980696A (en) * | 2023-06-21 | 2023-10-31 | 腾讯科技(深圳)有限公司 | Image processing method, device, equipment, storage medium and product |
Also Published As
| Publication number | Publication date |
|---|---|
| CN119941964A (en) | 2025-05-06 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US11069106B1 (en) | Dynamic mesh generation to minimize fillrate utilization | |
| CN113805745B (en) | Control method of suspension window and electronic equipment | |
| CN115097994B (en) | Data processing method and related device | |
| CN118276722A (en) | Window display method and electronic device | |
| CN117615055A (en) | Display control method and electronic equipment | |
| WO2024007703A1 (en) | Display method for task display area, window display method, and electronic device | |
| WO2023040666A1 (en) | Keyboard display method, foldable screen device, and computer-readable storage medium | |
| CN115705231B (en) | Screen display method and terminal equipment | |
| WO2023001163A1 (en) | Screen refreshing method and device capable of improving dynamic effect performance | |
| CN117058291B (en) | Video memory switching method and electronic device | |
| WO2023005751A1 (en) | Rendering method and electronic device | |
| WO2025060580A1 (en) | Interface display method, electronic device, and storage medium | |
| CN115562771A (en) | Application window management method, electronic device and computer readable storage medium | |
| CN117724783A (en) | Dynamic effect display method and electronic equipment | |
| WO2023284625A1 (en) | Cross-platform display method for application, and readable medium and electronic device | |
| WO2022252788A1 (en) | Control method and electronic device | |
| WO2025097978A1 (en) | Image rendering method and electronic device | |
| CN114461312A (en) | Method for switching application and task in application and electronic equipment | |
| CN118626201A (en) | Operation frame rate control method, electronic device, chip system and readable storage medium | |
| CN117453085A (en) | Display method, electronic device and storage medium | |
| WO2024078111A1 (en) | Interface rendering method and electronic device | |
| CN116048317A (en) | A display method and device | |
| CN116700850A (en) | Display method and electronic device | |
| US20250264976A1 (en) | Display method, display apparatus, and electronic device | |
| CN119271280B (en) | Screen bright processing method, device, chip, electronic device and medium |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| 121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 24887597 Country of ref document: EP Kind code of ref document: A1 |