WO2025260366A1 - 一种图像处理方法及电子设备 - Google Patents
一种图像处理方法及电子设备Info
- Publication number
- WO2025260366A1 WO2025260366A1 PCT/CN2024/100737 CN2024100737W WO2025260366A1 WO 2025260366 A1 WO2025260366 A1 WO 2025260366A1 CN 2024100737 W CN2024100737 W CN 2024100737W WO 2025260366 A1 WO2025260366 A1 WO 2025260366A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- layer
- window
- rounded corner
- rounded
- image
- 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
- G06F3/048—Interaction techniques based on graphical user interfaces [GUI]
- G06F3/0484—Interaction techniques based on graphical user interfaces [GUI] for the control of specific functions or operations, e.g. selecting or manipulating an object, an image or a displayed text element, setting a parameter value or selecting a range
- G06F3/04845—Interaction techniques based on graphical user interfaces [GUI] for the control of specific functions or operations, e.g. selecting or manipulating an object, an image or a displayed text element, setting a parameter value or selecting a range for image manipulation, e.g. dragging, rotation, expansion or change of colour
Definitions
- This application relates to the field of image processing technology, and in particular to an image processing method and electronic device.
- Multitasking refers to running multiple applications in the foreground, allowing users to use multiple applications simultaneously.
- a typical multitasking scenario involves an electronic device displaying an application interface while simultaneously showing a video in a pop-up window, allowing users to watch a video while using another application.
- this typical multitasking scenario will be referred to as the "video pop-up scenario" below.
- the outer contour of the video window is usually a rounded rectangle.
- the electronic device also needs to use the graphics processing unit (GPU) to process the rounded corners of the rectangle. This will increase the GPU load, significantly increasing the possibility of the electronic device overheating and affecting its performance.
- GPU graphics processing unit
- This application provides an image processing method and an electronic device that can reduce the possibility of overheating in multi-tasking operation scenarios, including rounded corner windows (such as the video window scenario mentioned above), thereby improving the performance of the electronic device.
- this application provides an image processing method applied to an electronic device.
- the method includes: receiving an event to launch a first window, wherein the first window is a non-full-screen rounded corner window, such as a picture-in-picture video window 1021 in Figure 1 or a floating window window 2031 in Figure 2.
- a first image is displayed, wherein the first image includes the first window, such as image frame 404 in Figure 4 below.
- the electronic device can achieve the rounded corner effect without going through the image processor GPU to synthesize the rounded corner effect. Instead, it can achieve the rounded corner effect by drawing a transparent rounded rectangle area and superimposing the transparent rounded rectangle area on the content to be displayed in the rounded corner window. In this way, the GPU load can be reduced and the performance of the electronic device can be improved.
- the rounded corner effect of the first window is not synthesized during the generation of the first image, including: if the display area of the first window on the display screen of the electronic device remains unchanged for a continuous period of time (duration 1 as described below), it indicates that the first window remains stable for a long time, such as not moving or scaling. In this case, the rounded corner effect of the first window is not synthesized during the generation of the first image.
- the method before or after displaying the first image, the method further includes: generating a second image, displaying the second image, the second image including the first window. During the generation of the second image, rounded corners of the first window are composited.
- the rounded corner effect of the first window is synthesized, including: if the continuous duration during which the display area of the first window on the display screen of the electronic device remains unchanged does not reach a first duration, the rounded corner effect of the first window is synthesized during the generation of the second image.
- the electronic device uses GPU compositing to achieve the rounded corner effect, thus ensuring the rounded corner effect.
- generating the first image includes: drawing or refreshing the first content to be displayed in the first layer. This can be understood as follows: if the first window displays video content, the image content can be refreshed to the first layer without needing to be drawn. The second content to be displayed and a transparent rounded rectangle area are drawn in the second layer. The second layer is then overlaid on top of the first layer to generate the first image. This allows the rounded corner effect to be achieved without compositing.
- drawing a transparent rounded rectangle area in the second layer includes: based on the layer properties of the first layer, such as the position and size of the first layer, the corner radius of the first window, etc., drawing the transparent rounded rectangle area in the second layer so that the position of the transparent rounded rectangle area is the same as the position of the display area of the first window. This ensures that the content of the first window can be seen through the transparent rounded rectangle area.
- the above-mentioned drawing of a transparent rounded rectangle area in the second layer includes: if there is a first indication information (indication 1 below), drawing a transparent rounded rectangle area in the second layer, wherein the first indication information indicates drawing a transparent rounded rectangle area.
- the electronic device can use the first instruction information to instruct the drawing of a transparent rounded rectangle area, thus enabling the electronic device to clearly specify the transparent rounded rectangle area to be drawn.
- the above method also includes:
- a first instruction message is generated. This allows the electronic device to achieve a rounded corner effect through a transparent rounded rectangle area after the rounded corner window is launched.
- a first indication message is generated.
- the electronic device can achieve a rounded corner effect through the transparent rounded rectangular area.
- the above before overlaying the second layer on top of the first layer to generate the first image, the above also includes: canceling the rounded corner effect of the first window so that the rounded corner effect of the first window is not composited during the generation of the first image.
- rounded corners are usually achieved through compositing. If compositing is not used, electronic devices can cancel the compositing process to ensure that the rounded corners are achieved without compositing.
- the method before overlaying the second layer on top of the first layer, the method further includes: obtaining a first overlay order (as described below), in which the first layer is on top of the second layer; adjusting the first overlay order to obtain a second overlay order (as described below), in which the second layer is on top of the first layer; and overlaying the second layer on top of the first layer, which includes: overlaying the second layer on top of the first layer based on the second overlay order.
- the established stacking order is first. If compositing is not used, electronic devices can adjust the stacking order to ensure that the first layer is stacked on top of the next layer.
- the electronic device includes an image compositor SurfaceFlinger, a rendering module libhwui, a hardware compositor HWC, and an image processor GPU;
- the above method After receiving the event to start the first window, the above method also includes: the image synthesizer listens for the existence of a rounded corner window and sends a first notification message (notification 1 below) to the drawing module.
- the first notification message includes first indication information and the layer attributes of the first layer.
- the generation of the first image includes: the drawing module drawing the second content to be displayed on the second layer.
- the drawing module draws a transparent rounded rectangle area on the second layer based on the first notification message, such as determining the transparent rounded rectangle area to be drawn based on the first instruction information, and determining the position, size, and corner radius of the transparent rounded rectangle area based on layer attributes.
- the drawing module sends the second instruction information (instruction information 2 below) to the image compositor.
- the image compositor Upon receiving the second instruction information, the image compositor does not call the GPU to composite the rounded corner effect, but calls HWC to overlay the second layer on top of the first layer to generate the first image.
- the first content to be displayed in the first layer is either drawn by the drawing module or refreshed by the image compositor.
- the image synthesizer detects the presence of a rounded corner window and sends a first notification message to the drawing module, including:
- the image synthesizer detects the presence of a rounded corner window and the first window remains unchanged in its display area on the electronic device's screen for a continuous period of time, it sends a first notification message to the rendering module.
- this application also provides an electronic device including a display screen, a memory, and one or more processors.
- the display screen, memory, and processors are coupled.
- the memory stores computer program code, including computer instructions, which, when executed by the processor, cause the electronic device to perform the methods described in the first aspect and any of its possible designs.
- this application provides a chip system applied to an electronic device including a display screen and a memory; the chip system includes one or more interface circuits and one or more processors; the interface circuits and processors are interconnected via lines; the interface circuits are used to receive signals from the memory of the electronic device and send signals to the processor, the signals including computer instructions stored in the memory; when the processor executes the computer instructions, the electronic device performs the method as described in the first aspect and any of its possible design embodiments.
- this application provides a computer storage medium including computer instructions that, when executed on an electronic device, cause the electronic device to perform a method as described in the first aspect and any possible design thereof.
- this application provides a computer program product that, when run on a computer, causes the computer to perform the method as described in the first aspect and any of its possible design methods.
- the beneficial effects that the electronic device of the second aspect, the chip system of the third aspect, the computer storage medium of the fourth aspect, and the computer program product of the fifth aspect can achieve can be referred to the beneficial effects of the first aspect and any of its possible design embodiments, which will not be repeated here.
- Figure 1 is a schematic diagram of an application scenario according to an embodiment of this application.
- Figure 2 is a schematic diagram of another application scenario of the present application embodiment
- FIG. 3 is a schematic diagram of an image processing procedure provided in an embodiment of this application.
- FIG. 4 is a schematic diagram of another image processing procedure provided in an embodiment of this application.
- FIG. 5 is a hardware structure diagram of an electronic device provided in an embodiment of this application.
- Figure 6 is a software architecture diagram of an electronic device provided in an embodiment of this application.
- FIG. 7 is a flowchart of an image processing method provided in an embodiment of this application.
- FIG. 8 is a timing interaction diagram of an image processing method provided in an embodiment of this application.
- Figure 9A is a schematic diagram of adjusting a video window according to an embodiment of this application.
- Figure 9B is a schematic diagram of a rounded corner effect provided in an embodiment of this application.
- FIG. 10 is a flowchart of another image processing method provided in an embodiment of this application.
- FIG 11 is a timing interaction diagram of another image processing method provided in an embodiment of this application.
- Figure 12 is a schematic diagram of closing a video window according to an embodiment of this application.
- FIG. 13 is a flowchart of another image processing method provided in an embodiment of this application.
- FIG 14 is a timing interaction diagram of another image processing method provided in the embodiments of this application.
- a and/or B can represent: A alone, A and B simultaneously, or B alone, where A and B can be singular or plural.
- the character "/" generally indicates that the preceding and following related objects are in an "or" relationship.
- references to "one embodiment” or “some embodiments” in this specification mean that one or more embodiments of this application include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases “in one embodiment,” “in some embodiments,” “in other embodiments,” “in still other embodiments,” etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean “one or more, but not all, embodiments,” unless otherwise specifically emphasized.
- the terms “comprising,” “including,” “having,” and variations thereof mean “including but not limited to,” unless otherwise specifically emphasized.
- connection includes direct connections and indirect connections, unless otherwise stated. "First” and “second” are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated.
- the words “exemplarily” or “for example” are used to indicate examples, illustrations, or explanations. Any embodiment or design described as “exemplarily” or “for example” in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or design solutions. Specifically, the use of the words “exemplarily” or “for example” is intended to present the relevant concepts in a specific manner.
- This application provides an image processing method that can be applied to multi-task operation scenarios including rounded corner windows to process and obtain image frames with rounded corner effects including rounded corner windows.
- the rounded-corner window can be a video window, i.e., a video window scene.
- the mobile phone can display interface 101, which is the application interface of a video player, and video 1011 is playing in interface 101.
- the mobile phone can return to the desktop and display interface 102, which is the mobile phone's desktop, and interface 102 includes a video window 1021.
- Video 1011 continues to play in the video window 1021.
- the video window 1021 is a rounded-corner window.
- the image processing method provided in this application embodiment can be used to process and obtain image frames of interface 102, and the image frames include the rounded corner effect of the video window 1021.
- rounded corner windows can be application floating windows.
- the phone can display interface 201, which is the phone's desktop.
- the phone can display interface 202, which is also the phone's desktop, and includes a pop-up window 2021.
- Pop-up window 2021 includes application icons for multiple quick applications, such as the application icon 2022 for Favorites, the application icon 2023 for Email, the application icon 2024 for Notes, etc.
- the phone can further display the application interface of that quick application as a floating window.
- Interface 203 in response to a user clicking on the Email application icon 2023 in interface 202, the phone can display interface 203.
- Interface 203 remains the phone's desktop, and includes an email application floating window 2031 displaying the email application interface.
- the application floating window 2031 is a rounded-corner window.
- the image processing method provided in this application embodiment can be used to process and obtain image frames of interface 203, the image frames including the rounded-corner effect of the application floating window 2031.
- Figures 1 and 2 above only show two typical rounded corner windows, and are not limited to these in practice.
- the following text mainly uses a video window scenario as an example to illustrate the solution of this application.
- the rounded corner effect of the rounded window is achieved by the GPU in the electronic device through compositing (such as performing rounded corner clipping).
- the electronic device can obtain (e.g., through drawing, refreshing, etc.) the content of multiple layers, including the rounded window layer (hereinafter referred to as the rounded corner layer).
- the GPU performs rounded corner clipping on the rounded corner layer, and the clipped rounded corner layer is overlaid with other layers to obtain an image frame.
- the phone can draw desktop icons in the desktop layer 302, draw wallpaper in the wallpaper layer 303, and refresh video content in the video window layer 301.
- the phone decodes the video file using a codec component (such as mediacodec), obtains the video frames, and then refreshes them into the video window layer 301; it does not need to obtain the content in the video window layer 301 through drawing.
- the phone can use its GPU to composite the video window layer, resulting in a video window layer 304 with rounded corners.
- Image frame 305 includes a video window 3031 with rounded corners.
- the electronic device uses the GPU to complete the rounded corner effect, which will increase the GPU load during image processing, greatly increasing the possibility of the electronic device overheating and affecting its performance.
- this application proposes an image processing method whereby an electronic device can draw transparent rounded rectangular areas (figuratively termed "holes") in other layers after the content of other layers has been drawn.
- These other layers include all layers in the image frame that need to be drawn, excluding the rounded corner layer, such as the desktop layer 303 and wallpaper layer 304 in Figure 3 above.
- the rounded rectangular areas are matched with the position, size, and radius of the rounded corner window.
- the electronic device overlays these other layers with the transparent rounded rectangular areas onto the rounded corner layer, i.e., the rounded corner layer is at the bottom layer, resulting in the image frame.
- the content of the bottom rounded corner layer is visible through the transparent rounded rectangular areas overlaid on the other layers, thus presenting a rounded corner effect.
- the desktop layer 402 and wallpaper layer 403 are other layers.
- the phone can draw a transparent rounded rectangle area 4021 in the desktop layer 402 (where desktop icons are drawn), and a transparent rounded rectangle area 4022 in the wallpaper layer 403 (where desktop wallpaper is drawn).
- the phone overlays the desktop layer 402, wallpaper layer 403, and video window layer 401 in a top-to-bottom order, with the video window layer 401 at the bottom, resulting in image frame 404.
- Image frame 404 is the same as image frame 305 in Figure 3, both having rounded corners.
- the electronic device can achieve a rounded corner effect by drawing a transparent rounded rectangular area and overlaying the rounded corner layer on the bottom layer (hereinafter referred to as the "hole-cutting method"), instead of using GPU compositing.
- the aforementioned electronic devices may be mobile phones, tablets, desktop computers, laptop computers, handheld computers, notebook computers, ultra-mobile personal computers (UMPCs), netbooks, as well as cellular phones, personal digital assistants (PDAs), artificial intelligence (AI) devices, wearable devices, in-vehicle devices, smart home devices, and/or smart city devices.
- PDAs personal digital assistants
- AI artificial intelligence
- the electronic device may include a processor 210, an external memory interface 220, an internal memory (RAM) 221, a universal serial bus (USB) interface 230, a charging management module 240, a power management module 241, a battery 242, an antenna 1, an antenna 2, a mobile communication module 250, a wireless communication module 260, an audio module 270, a speaker 270A, a receiver 270B, a microphone 270C, a headphone jack 270D, a sensor module 280, buttons 290, a motor 291, an indicator 292, a camera 293, a display screen 294, and a subscriber identification module (SIM) card interface 295, etc.
- SIM subscriber identification module
- the structure illustrated in this embodiment does not constitute a specific limitation on the mobile phone.
- the mobile phone may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements.
- the illustrated components may be implemented in hardware, software, or a combination of software and hardware.
- the processor 210 may include one or more processing units, such as an application processor (AP), a modem processor, a central processing unit (CPU), a graphics processing unit (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). These different processing units may be independent devices or integrated into one or more processors.
- AP application processor
- CPU central processing unit
- GPU graphics processing unit
- ISP image signal processor
- DSP digital signal processor
- NPU neural network processing unit
- the charging management module 240 receives charging input from the charger.
- the power management module 241 connects the battery 242, the charging management module 240, and the processor 210.
- the power management module 241 receives input from the battery 242 and/or the charging management module 240, providing power to the processor 210, internal memory 221, display screen 294, camera 293, and wireless communication module 260, etc.
- the power management module 241 can also monitor parameters such as battery capacity, battery cycle count, and battery health status (leakage current, impedance).
- the wireless communication function of a mobile phone can be implemented through antenna 1, antenna 2, mobile communication module 250, wireless communication module 260, modem processor, and baseband processor.
- Mobile communication module 250 can provide wireless communication solutions for mobile phones, including 2G/3G/4G/5G.
- Wireless communication module 260 can provide wireless communication solutions for mobile phones, including wireless local area networks (WLANs) (such as Wireless Fidelity (Wi-Fi) networks), Bluetooth (BT), Bluetooth Low Energy (BLE), ultra-wideband (UWB), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), and infrared (IR) technologies.
- WLANs wireless local area networks
- Wi-Fi Wireless Fidelity
- BLE Bluetooth Low Energy
- UWB ultra-wideband
- GNSS global navigation satellite system
- FM frequency modulation
- NFC near field communication
- IR infrared
- the mobile phone can achieve display functions through a GPU, a display screen 294, and an application processor.
- the GPU is a microprocessor for image processing, connected to the display screen 294 and the application processor.
- the GPU is used to perform mathematical and geometric calculations and for graphics rendering.
- the processor 210 may include one or more GPUs, which execute program instructions to generate or modify display information.
- Mobile phones can achieve camera functions through the camera 293, ISP, video codec, GPU, display 294, application processor (AP), neural network processor (NPU), etc.
- AP application processor
- NPU neural network processor
- Mobile phones can perform audio functions, such as music playback and recording, through an audio module 270, a speaker 270A, a receiver 270B, a microphone 270C, a headphone jack 270D, and an application processor.
- audio module 270 a speaker 270A, a receiver 270B, a microphone 270C, a headphone jack 270D, and an application processor.
- the software system of the aforementioned electronic device can adopt a layered architecture, event-driven architecture, microkernel architecture, microservice architecture, or cloud architecture.
- This application embodiment uses the layered architecture of the Android TM system as an example to exemplify the software structure of the electronic device.
- a layered architecture divides the software system of the electronic device into several layers, each with a clear role and division of labor, and the layers communicate with each other through software interfaces.
- the hardware and software architecture of an electronic device can include an application (APP) layer, an application framework layer, a native layer, a kernel layer, and a hardware layer.
- APP application
- an application framework layer an application framework layer
- a native layer a native layer
- a kernel layer a hardware layer
- the application layer can accommodate applications such as launchers, email, video players, memo pads, alarm clocks, settings, and games. Multiple applications can run in the foreground, and one of these applications can include a rounded-corner window.
- the mobile phone can run a desktop application and a video player in the foreground, and the video player includes a rounded corner window.
- the mobile phone can run a desktop application and an email application in the foreground, and the email application includes a rounded corner window.
- the application framework layer provides the application programming interface (API) and programming framework for the application layer.
- API application programming interface
- the application framework layer can include various system servers, such as the Window Manager Service (WMS) and the Display Manager Service (DMS).
- WMS Window Manager Service
- DMS Display Manager Service
- WMS Window Management System
- DMS Wind Management System
- DMS Window Management System
- the application framework layer can include the View System API and the Graphics System API.
- the View System API is used for application layout calculations and the execution of drawing instructions. For example, layout calculations include calculating the positions of various icons on the desktop.
- the View System API includes classes such as View, ViewGroup, and SurfaceView.
- the Graphics System API is used to set graphics-related properties.
- the Graphics System API includes classes such as Canvas, RenderNode, and Paint.
- the native layer provides various services to the upper layers (such as the application framework layer).
- the native layer includes an image compositor (SurfaceFlinger), a drawing module (libhwui), a capability library for the Skia (an open-source 2D graphics library) API (libskia), a module providing OpenGL API support (libGLES_XX), a layer management module (libgui), etc.
- SurfaceFlinger can also be translated as surface thrower, surface drawing module, image compositing service, etc., and this application does not specifically limit it to these terms.
- SurfaceFlinger can be used for refresh rate control, image compositing control, and more. For example, SurfaceFlinger can make decisions to assign compositing tasks to hardware compositing (HWC) or the GPU.
- HWC hardware compositing
- SurfaceFlinger can be used to monitor rounded corner windows, such as whether a rounded corner window exists, and to control the on/off state of a switch based on the monitoring results.
- SurfaceFlinger can turn on the switch when it detects the presence of a rounded-corner window, such as a video window. If it detects the absence of a rounded-corner window, SurfaceFlinger can turn the switch off.
- SurfaceFlinger can turn on the switch when it detects the presence of a rounded window and the rounded window remains stable. It can turn off the switch when it detects the presence of a rounded window but the rounded window is unstable (e.g., its position or size is changing), or when it detects the absence of a rounded window.
- SurfaceFlinger can be used to disable rounded corner compositing when the switch is on, and to overlay the rounded corner layer on top of the compositing layer.
- SurfaceFlinger can also be used to perform rounded corner compositing by invoking the GPU when the switch is off and a rounded corner window exists, and to overlay the rounded corner layer on top of the compositing layer.
- a listener service can be started in SurfaceFlinger to monitor rounded corner windows.
- libhwui can be used for image drawing.
- libhwui can also be used to achieve a rounded corner effect by creating a hole when the switch is on; libhwui can also be used to draw the layer content normally when the switch is off, without having to draw a transparent rounded rectangle area.
- each application can complete its drawing through its corresponding rendering thread (RenderThread).
- RenderThread implements drawing by calling values from libhwui.
- each application has its own libhwui library for implementing its specific drawing functionality; for example, desktop applications use libhwui 1, wallpaper applications use libhwui 2, video players use libhwui 3, and so on.
- RenderThread will be represented as the actions of libhwui, such as RenderThread drawing being represented as libhwui drawing.
- libskia can be used by libhwui to submit drawing commands to the GPU for rendering.
- libGLES_XX can be used to convert the drawing commands submitted by libskia into GLES format for GPU execution.
- libgui can be used for layer and layer attribute rotation; for example, libhwui uses libgui to submit layers and layer attributes to SurfaceFlinger.
- the image processing method provided in this application can be executed in an electronic device having the above-described hardware and software structure.
- the image processing method provided in this application is described with the electronic device as the executing entity; the executing entity will not be described in detail below.
- Case 1 Rounded corner window not started
- Case 2 Rounded corner window started
- Case 3 Rounded corner window closed.
- situation 1 may occur, or any of the following combinations may occur: a combination of situation 1 and situation 2; a combination of situation 1, situation 2, and situation 3.
- Event 1 is used to trigger the launch of the rounded corner window, such as when the user swipes up from the bottom of the video playback interface, or when the user clicks on the application icon of any shortcut application in the pop-up window 2021 mentioned above. That is to say, before receiving event 1, it is all considered case one where the rounded corner window has not been launched.
- a rounded corner window can be launched.
- the image processing procedure includes:
- An image frame can be any image frame displayed after the rounded corner window is started in response to event 1 and before it is closed (as described below, the rounded corner window is closed in response to event 3). For example, if the image frame displayed when event 1 is received is the image frame in interface 101, then an image frame can be the image frame in interface 102.
- Event 1 is used to trigger the launch of a rounded corner window.
- a rounded corner window is launched, and the existence of a rounded corner window can be detected after Event 1.
- rounded corner layers have a rounded corner attribute.
- the presence of a rounded corner window can be detected by identifying whether the layers included in an image frame (such as layers involved in compositing) have a rounded corner attribute. Specifically, if any layer in the image frame has a rounded corner attribute, the presence of a rounded corner window can be detected. If none of the layers in the image frame have a rounded corner attribute, the absence of a rounded corner window can be detected.
- the phone can also store a whitelist, which includes identifiers, such as names, of layers that can be used to draw specific content.
- Specific content includes content that might be displayed in a rounded-corner window.
- specific content includes video content, email interface content, etc.
- the layers included in an image frame can be matched against the whitelist to determine whether a rounded-corner window exists.
- a video window layer can be created to refresh the video content in the video window 1021 shown in interface 102; that is, the video window layer is the layer for drawing video content. Matching the video window layer with the whitelist, determining that the name attribute of the video window layer is in the whitelist, and determining that the video window layer has rounded corners, then detecting the existence of a rounded corner window.
- multiple layers refer to the layers included in the image frame, and other layers refer to the layers in the image frame other than the rounded corner layer, such as the desktop layer and wallpaper layer in Figure 4.
- a transparent rounded rectangle area can be drawn according to the layer properties of the rounded rectangle layer, ensuring that the rounded rectangle area is consistent with the rounded window, such as having the same position and size. This way, when subsequent layers are overlaid to obtain an image frame, the complete rounded window and its content can be presented through the transparent rounded rectangle area.
- the position of the rounded rectangle area within other layers can be calculated by combining the phone's status information.
- This status information includes landscape and portrait modes, or the screen's rotation angle. It can be understood that a change in screen rotation angle allows switching between landscape and portrait modes.
- the rotation angle corresponds to landscape and portrait modes; for example, when the rotation angle is less than a threshold, it is in portrait mode, and when the rotation angle is greater than the threshold, it switches to landscape mode.
- the display orientation of the interface on the screen changes, and correspondingly, the position of the rounded rectangle area may also change.
- the positions of each other layer on the screen can be calculated. Based on this, and using the layer properties of the rounded corner layer, the position of the rounded rectangle area within each other layer can be calculated, ensuring that the position of the rounded rectangle area matches the positions of other layers on the screen.
- the rounded corner layer is overlaid on the bottom layer to obtain an image frame.
- the rounded corner windows in the image frame have a rounded corner effect.
- rounded corner compositing can be disabled, which eliminates the need for GPU compositing to achieve rounded corner effects, thus reducing the GPU load.
- placing the rounded corner layer at the bottom layer effectively changes the layering order, shifting it from being the top layer to the bottom layer. This allows the rounded corner effect to be achieved through the boundaries of the rounded rectangle area.
- the image processing process includes:
- SurfaceFlinger can enable the monitoring of rounded corner windows by starting a listening service.
- the desktop application In response to event 1, the desktop application sends a desktop layer creation request to WMS.
- event 1 is the user's swipe-up operation from the bottom of the video playback interface.
- the desktop application determines that it needs to display desktop content and sends a desktop layer creation request to WMS to request the creation of a desktop layer for drawing desktop content (such as desktop icons).
- the wallpaper application sends a request to WMS to create a wallpaper layer.
- the wallpaper application determines that it needs to display the wallpaper and sends a wallpaper layer creation request to the WMS to request the creation of a wallpaper layer to draw the wallpaper.
- the video player sends a request to WMS to create a video window layer.
- the video player determines that the video needs to be played in a video window and sends a video window layer creation request to WMS to request the creation of a video window layer to refresh the video content.
- WMS can add layer properties based on the creation requests of various applications, such as adding position, size and other properties to the video window layer, and also adding rounded corner properties.
- WMS can simultaneously create each layer and add layer properties within SurfaceFlinger.
- desktop applications After sending the corresponding layer creation request, desktop applications, wallpaper applications, and video players can initialize RenderThread to set the corresponding layers, as shown in S806 and S809 below.
- a desktop application can initialize its RenderThread to set the rendering environment parameters for the desktop layer.
- the RenderThread sets the rendering environment parameters through a SurfaceControl, which is a value held by WMS, libhwui, etc., corresponding to a layer in SurfaceFlinger.
- This SurfaceControl serves as a unique identifier for the layer, enabling information exchange with the layer in SurfaceFlinger, including setting layer properties.
- libhwui1 can identify the layer content to be rendered when the RenderThread sets the rendering environment parameters for the desktop layer.
- libhwui1 can also execute the following S807 and S808 so that libhwui1 can determine whether to cut holes and send back an indication of whether the hole cutting is completed.
- libhwui1 can register listener callbacks with surfaceflinger through binder (a cross-process communication mechanism).
- libhwui1 By registering a listener callback, libhwui1 can subsequently receive an indication of whether or not to dig a hole.
- libhwui1 can also obtain the layer properties of the rounded corner layer, the phone's status information, etc., through listening to callbacks, in order to draw a rounded rectangular area consistent with the rounded corner window.
- S808 and SurfaceFlinger store callback functions in the layer properties of the desktop layer.
- the wallpaper application initializes RenderThread to set the desktop layers.
- a wallpaper application can also initialize its RenderThread to set the rendering environment parameters for the wallpaper layer. Based on this, libhwui2 can indicate the layer content to be drawn when the RenderThread sets the rendering environment parameters for the wallpaper layer.
- libhwui2 After detecting that RenderThread is setting the desktop layer, libhwui2 can also execute S810 and S811 to determine whether to cut holes.
- registering a listener callback means registering a listener and a callback function.
- libhwui2 can obtain an indication of whether to dig a hole.
- libhwui2 can also obtain the layer properties of the rounded corner layer, the phone's status information, etc., through listening to callbacks, in order to draw a rounded rectangular area consistent with the rounded corner window.
- S811 and SurfaceFlinger store callback functions in the layer properties of the desktop layer.
- the execution order of S806-S808 and S809-S811 is not limited to that shown in Figure 8.
- the execution order of S806 and S809 is not specific; it is possible that S809 is executed first and then S806, or that S806 and S809 are executed simultaneously.
- libhwui will trigger the execution of subsequent steps.
- S806-S811 above only demonstrates the process of setting the desktop and wallpaper layers and triggering subsequent registered listener callbacks.
- video players can also initialize RenderThread to set the video window layer.
- the libhwui 3 video player can also trigger the registration of a listener callback after detecting the setting of the video window layer.
- surfaceflinger can recognize that the video window layer is a rounded corner layer. Therefore, even if the listener callback for the video window layer is registered, surfaceflinger will not provide feedback to libhwui 3 on whether to cut a hole, so that libhwui will not draw a transparent rounded rectangle area in the video window layer.
- libhwui 3 of the video player can recognize that the video window layer is a rounded corner layer, and therefore does not trigger the registered listener callback. In this way, SurfaceFlinger will not provide feedback to libhwui 3 regarding whether to create a hole, preventing libhwui from drawing a transparent rounded rectangle area in the video window layer.
- This explanation will primarily use this implementation as an example.
- SurfaceFlinger listens to whether the layers involved in the composition include rounded corner layers. For example, if SurfaceFlinger detects that the name of the video window layer is in the whitelist and that the video window layer has rounded corner attributes, then it detects the existence of a rounded corner window.
- surfaceflinger generates notification message 1, which includes the layer properties and indicator information 1 of the video window layer.
- instruction information 1 is used to indicate the hole-digging, that is, to enable the rounded corner effect by drawing a transparent rounded rectangle area.
- the layer properties of the video window layer can be used to calculate the position, size, and corner radius of the rounded rectangle area.
- the desktop layer's layer properties store callback functions, it indicates that the desktop layer has registered a listener callback.
- SurfaceFlinger can then send notification messages to libhwui 1, which draws the desktop layer.
- surfaceflinger dispatches notification message 1 to libhwui 2 based on the callback function in the layer properties of the wallpaper layer.
- the wallpaper layer's layer properties store a callback function, it indicates that the wallpaper layer has registered a listener callback.
- SurfaceFlinger can then send notification messages to libhwui 2, which draws the wallpaper layer.
- SurfaceFlinger can send notification message 1 to the libhwui corresponding to each layer that has registered a listener callback, instructing libhwui to draw a transparent rounded rectangle area during the layer drawing process.
- content 1 is a desktop icon.
- S817 and libhwui 1 draw content 1 in the desktop layer, and draw a rounded rectangle area in the desktop layer according to notification message 1.
- the drawing phase mainly focuses on drawing the layer content, and there is no need to implement the rounded corner effect during the drawing phase.
- libhwui 1 after receiving the content 1 to be drawn, can draw the content 1 on the desktop layer.
- libhwui 1 also receives a notification message 1. After libhwui 1 finishes drawing the content 1 on the desktop layer, it can also determine to draw a transparent rounded rectangle area based on the indication information 1 in the notification message 1, and calculate the position, size, and radius of the rounded rectangle area based on the layer attributes of the video window layer in the notification message 1, and then draw the rounded rectangle area.
- libhwui 1 can also calculate the position, size, and corner radius of the rounded rectangle region based on more information.
- This information can be carried in notification message 1, such as the phone's status information, the scaling ratio of the desktop layer, etc.
- this information can also be obtained by libhwui 1 from other modules, such as obtaining the length and width information of the display screen from memory. This application does not specifically limit this.
- instruction information 2 is used to indicate the completion of digging.
- the completion of the drawing includes drawing content 1 and completing the transparent rounded rectangle area.
- libhwui 1 can send feedback to surfaceflinger via surfacecontrol to indicate that the hole-digging is complete 2.
- the desktop application sends the content to be drawn to libhwui2.
- content 2 is wallpaper.
- libhwui 2 can determine the transparent rounded rectangle area to be drawn based on the instruction information 1 in notification message 1, and calculate the position, size, rounded radius, etc. of the rounded rectangle area based on the layer attributes of the video window layer in notification message 1 and draw the rounded rectangle area.
- the completion of the drawing includes drawing content 2 and the transparent rounded rectangle area.
- libhwui 2 can send feedback to surfaceflinger via surfacecontrol to indicate that the hole has been dug.
- each application can send the content to be drawn to the corresponding libhwui to achieve drawing.
- the video content in the video window can be obtained by decoding and refreshing. Therefore, the video player can draw the video content in the video window layer without sending the video content to the corresponding libhwui 3.
- the image frame includes a desktop layer, a wallpaper layer, and a video window layer.
- the video window layer is a rounded corner layer, so there is no need to draw a transparent rounded rectangle area.
- SurfaceFlinger receives instruction information 2 corresponding to the desktop layer and the wallpaper layer, indicating that it has received instruction information 2 corresponding to all other layers. That is, all other layers have completed the cutout.
- SurfaceFlinger can execute a set of processes in conjunction with the transparent rounded rectangle area, including canceling the rounded corner composition and refreshing the video window layer in S822A, and S823-S825, to achieve the rounded corner effect through the rounded rectangle area.
- SurfaceFlinger can save instruction information 2 to the layer properties of the desktop layer. After receiving instruction information 2 from libhwui 2, it can save instruction information 2 to the layer properties of the wallpaper layer. SurfaceFlinger can compare the layer containing instruction information 2 with other layers in the image frame. If the layer properties of other layers also contain instruction information 2, it indicates that it has received instruction information 2 for all other layers.
- rounded corners are achieved through compositing.
- it indicates that a rounded corner effect can be achieved through a transparent rounded rectangle area, and SurfaceFlinger cancels the rounded corner compositing.
- SurfaceFlinger can refresh the content of the video window layer, i.e., the video content, so that the video window layer can display the latest video frame.
- the codec component decodes the latest video frame, it sends the video frame to SurfaceFlinger, and SurfaceFlinger can then refresh the video window layer.
- the timing of SurfaceFlinger refreshing the video window layer is not limited to that shown in Figure 8.
- the codec component can decode a video frame according to the needs of the video player and send it to SurfaceFlinger; SurfaceFlinger can refresh the video window layer after receiving the video frame.
- the video content displayed in the video window may be static. For example, after pausing playback, the video content remains unchanged and is static. In this case, SurfaceFlinger does not need to refresh the video window layer for every frame. That is, refreshing the video window layer is not necessary for every frame.
- surfaceflinger retrieves the stacking order of the desktop layer, wallpaper layer, and video window layer, with the video window layer at the top.
- S824 and SurfaceFlinger adjust the video window layer from the top layer to the bottom layer to obtain the adjusted stacking order.
- S825 and SurfaceFlinger combine the desktop layer, wallpaper layer, and video window layer in the adjusted overlay order to obtain the image frame.
- SurfaceFlinger does not call the GPU to crop the video window layer to achieve the rounded corner effect, thus reducing the GPU load. For example, SurfaceFlinger can call HWC to complete the layer overlay and obtain the image frame.
- the display screen shows image frames.
- the display shows the next image frame after each refresh.
- each image frame can be processed in a similar way, thus achieving a rounded corner effect in each image frame. That is, the phone can listen for the presence of a rounded corner window while processing each image frame. If a rounded corner window is detected, a transparent rounded rectangular area will be drawn when drawing other layers.
- the process shown in Figure 8 can be executed cyclically from S812 to S827, thereby reducing the GPU load in each image frame. Specifically, after S812 detects the presence of a rounded rectangle region, SurfaceFlinger can activate a switch and generate notification message 1. Subsequent executions of S812 that detect the presence of a rounded rectangle region again can check the switch status. If it is found to be activated, S813-S815 can be omitted, eliminating the need to repeatedly generate and distribute notification message 1. Correspondingly, after receiving notification message 1, libhwui can save it. Subsequently, upon receiving content to be drawn, libhwui can draw a transparent rounded rectangle region based on the saved notification message 1. This reduces communication between SurfaceFlinger and libhwui.
- scenario 2 explained the processing procedure for each image frame after the rounded corner window is activated. Furthermore, after activating the rounded corner window, in response to event 2, the position, size, and corner radius of the rounded corner window can also be adjusted. Event 2 is used to trigger the phone to adjust the rounded corner window. For example, event 2 could be a user dragging operation on the rounded corner window, or it could be a user scaling operation on the rounded corner window (such as a double-tap operation).
- the video player in response to the user dragging the video window 9011 in the direction of the arrow in interface 901, the video player can send a layer attribute update request to WMS.
- WMS can update the position attributes of the video window layer and synchronize them with SurfaceFlinger.
- SurfaceFlinger After receiving the updated position attributes, SurfaceFlinger can generate a new notification 1, which carries the updated layer attributes of the video window layer and indicator 1, and distributes it to libhwui 1 and libhwui 2, enabling libhwui 1 and libhwui 2 to draw transparent rounded rectangular areas based on the updated layer attributes of the video window layer.
- the rounded corner effect is achieved by the GPU through rounded corner compositing.
- case 22 the adjustment is completed and stabilized (referred to as case 22), such as after adjusting to the position of video window 9011 in interface 902, the rounded corner effect is achieved by punching holes.
- libhwui may have already been drawing the (k+1)-th frame of the image before receiving the updated layer properties. This means libhwui might be drawing the rounded rectangle area based on the unupdated layer properties; in other words, there is a delay in the layer properties used for the "hole-punch" effect.
- SurfaceFlinger may use the updated layer properties for compositing, such as calculating the compositing position of the rounded corner window based on the updated position properties. This can lead to inconsistencies between the rounded rectangle area and the rounded corner window, such as different positions, resulting in issues like the rounded rectangle area being black or the content in the rounded corner window being incompletely displayed.
- the interface 911 shown in Figure 9B may be displayed.
- part of the rounded rectangle area 9111 is black (i.e., there is no pixel fill), and the content in the video window 9011 only shows the part of the person, which is missing.
- this embodiment adopts the method of using the GPU to perform rounded corner compositing to achieve the rounded corner effect during the adjustment of rounded corner windows, which can avoid the above-mentioned problems caused by the delay in punching holes.
- a hole-punch method can be used to achieve the rounded corner effect and reduce the GPU load
- the GPU can be used to perform rounded corner compositing to achieve the rounded corner effect and avoid problems such as the rounded rectangle area being black or the content in the rounded corner window not being fully displayed.
- the image processing procedure includes:
- an unstable state includes adjusting the rounded corner window, such as adjusting its position or size (as described in case 21 above).
- Another example is the immediate launch of the rounded corner window.
- Yet another example is the immediate completion of adjusting the rounded corner window, such as immediately finishing moving its position. In such cases, steps S1003-S1005 below can be executed to achieve the rounded corner effect through GPU compositing.
- a rounded corner window remains unchanged for a continuous duration of 1, it indicates that the rounded corner window is in a stable state.
- a stable state includes not receiving event 2 after the rounded corner window is started.
- Another example is a stable state including a relatively long period of time after the rounded corner window is adjusted. All remain unchanged, i.e., situation 21 above.
- the following steps S1006-S1008 can be executed to achieve a rounded corner effect by creating a hole.
- the rounded corner effect is composited using the GPU to ensure its timely implementation. Also, the rounded corner layer is overlaid on top to ensure the content within the rounded corner window remains visible.
- a transparent rounded rectangle area can be drawn based on the layer properties of the rounded corner layer at the end of the change, so that the rounded rectangle area is consistent with the changed rounded corner window.
- Scenario 1 The rounded corner window is started at time t1, and then the adjustment of the rounded corner window is triggered at time t2 (the time interval between t1 and t2 is less than 1). The adjustment ends at time t3, and no further adjustments are made thereafter.
- Executing S1001 detects the presence of a rounded corner window; executing S1002 detects that the continuous duration of the rounded corner window remaining unchanged has not reached duration 1. Subsequently, S1003-S1005 are executed, and the rounded corner effect is synthesized by the GPU. In other words, after the rounded corner window is started, if the rounded corner window is adjusted within a short period of time, the rounded corner effect will be synthesized by the GPU.
- Executing S1001 detects the presence of a rounded corner window; executing S1002 detects that the continuous duration for which the rounded corner window remains unchanged has not reached duration 1. Subsequently, S1003-S1005 are executed, and the rounded corner effect is composited by the GPU. In other words, the rounded corner effect is composited by the GPU during the process of adjusting the rounded corner window and during the time interval of duration 1 after the adjustment ends. It should be noted that during the adjustment process, the layer properties of the rounded corner layer can be updated, and the updated layer properties are used to generate image frames.
- Executing S1001 detects the presence of a rounded corner window; executing S1002 detects that the rounded corner window has remained unchanged for a continuous duration of 1 second. Subsequently, S1006-S1008 are executed, achieving the rounded corner effect by drawing a transparent rounded rectangle area. In other words, the rounded corner effect is achieved by drawing a transparent rounded rectangle area only after the adjustment of the rounded corner window has ended and a duration of 1 second has elapsed.
- Scenario 2 The rounded corner window is started at time t1, the rounded corner window is adjusted at time t5 (the time interval between t1 and t5 is greater than or equal to the duration of 1), the adjustment ends at time t6, and no further adjustments are made.
- Executing S1001 detects the presence of a rounded corner window; executing S1002 detects that the continuous duration for which the rounded corner window remains unchanged has not reached duration 1. Subsequently, S1003-S1005 are executed to synthesize the rounded corner effect using the GPU. In other words, after the rounded corner window is activated, even if it is not adjusted within a short period, the rounded corner effect will still be synthesized by the GPU because the duration 1 has not been reached.
- Executing S1001 detects the presence of a rounded corner window; executing S1002 detects that the rounded corner window has remained unchanged for a continuous duration of 1 second. Subsequently, S1006-S1008 are executed, achieving a rounded corner effect by drawing a transparent rounded rectangle. In other words, after starting a rounded corner window, if the window remains unchanged for a long time, a rounded corner effect can be achieved by drawing a transparent rounded rectangle.
- Executing S1001 detects the presence of a rounded corner window; executing S1002 detects that the continuous duration for which the rounded corner window remains unchanged has not reached duration 1. Subsequently, S1003-S1005 are executed, and the rounded corner effect is composited by the GPU. In other words, the rounded corner effect is composited by the GPU during the process of adjusting the rounded corner window and during the time interval of duration 1 after the adjustment ends. It should be noted that during the adjustment process, the layer properties of the rounded corner layer can be updated, and the updated layer properties are used to generate image frames.
- Executing S1001 detects the presence of a rounded corner window; executing S1002 detects that the rounded corner window has remained unchanged for a continuous duration of 1 second. Subsequently, S1006-S1008 are executed, achieving the rounded corner effect by drawing a transparent rounded rectangle area. In other words, after adjusting the rounded corner window and pausing for 1 second, the rounded corner effect is achieved by drawing a transparent rounded rectangle area.
- S1101 SurfaceFlinger checks whether the continuous duration for which the video window layer remains unchanged reaches duration 1. If yes, proceed to S813; otherwise, proceed to S1102.
- the video player in response to event 2, can send an attribute update request for the video window layer to the WMS.
- the WMS can update the layer attributes of the video window layer.
- the WMS can also synchronize the updated layer information to SurfaceFlinger, allowing SurfaceFlinger to receive the updated layer information and thus control the restart of the timing.
- step S813-S827 can be executed, which will not be repeated here. It should be noted that if the rounded window changes, in step S813, the notification 1 generated by surfaceflinger carries the layer properties of the video window layer after its last update, ensuring that the transparent rounded rectangle area drawn by libhwui matches the video window at the end of the change.
- instruction information 3 is used to indicate that no holes are cut, that is, to turn off the rounded corner effect achieved by drawing a transparent rounded rectangle area.
- surfaceflinger dispatches notification message 2 to libhwui 1 based on the callback function in the layer properties of the desktop layer.
- the desktop application sends the content to be drawn to libhwui1.
- instruction information 4 is used to indicate that the excavation has not been completed.
- the wallpaper application sends the content to be drawn to libhwui2.
- S1103-S1110 The principles and specific implementations of S1103-S1110 are similar to those of S814-S821 mentioned above. For details, please refer to the descriptions of S814-S821. They will not be repeated here.
- S1111A and SurfaceFlinger do not cancel rounded corner compositing after receiving instruction information 4 from the desktop layer and wallpaper layer.
- surfaceflinger retrieves the stacking order of the desktop layer, wallpaper layer, and video window layer, with the video window layer at the top.
- the video window layer When using GPU compositing, the video window layer should be overlaid on top to ensure its visibility. Correspondingly, SurfaceFlinger, after determining the overlay order, does not need to move the video window layer to the bottom layer.
- SurfaceFlinger can turn on the switch; if the continuous duration of the video window layer remaining unchanged does not reach duration 1, SurfaceFlinger can turn off the switch. Subsequently, SurfaceFlinger can query the switch status to decide whether to cancel rounded corner composition and adjust the stacking order. Specifically, if SurfaceFlinger finds the switch status to be off, it decides not to cancel rounded corner composition or adjust the stacking order, as shown in S1111 and S1112. If SurfaceFlinger finds the switch status to be on and receives instruction 2 indicating that all other layers have completed the cutout, it decides to cancel rounded corner composition and adjust the stacking order, as shown in S822-S824.
- S1113 and SurfaceFlinger call the GPU to synthesize rounded corner effects, compositing the desktop layer, wallpaper layer, and video window layer in the order of overlay to obtain image frames.
- the display screen shows image frames.
- each image frame can be processed in a similar manner, thereby achieving a rounded corner effect in each image frame. That is, during the processing of each image frame, the system can monitor whether a rounded corner window exists and detect whether the continuous duration of the rounded corner window remaining unchanged reaches duration 1. If a rounded corner window is detected and the continuous duration of the rounded corner window remaining unchanged reaches duration 1, then a transparent rounded rectangular area will be drawn when drawing other layers.
- S812-S1115 can be executed cyclically. This reduces the GPU load in each image frame when a rounded corner window is detected and remains unchanged for a continuous duration of 1. Conversely, if a rounded corner window is detected but its continuous duration does not reach 1, delays that could lead to issues such as black rounded corner areas or incomplete display of content within the rounded corner window are avoided. Similarly, when a rounded corner area is detected in S812 and the video window layer remains unchanged for a continuous duration of 1 in S1101, SurfaceFlinger can query the on/off status. If it is found to be on, S813-S815 can be omitted, eliminating the need to repeatedly generate and distribute notification 1.
- step S1007 the GPU does not need to be invoked; instead, HWC can be used to complete the layer overlay.
- the GPU needs to composite other effects, it indicates that during the compositing stage, not only the rounded corner effect needs to be composited, but also other effects need to be composited.
- the GPU still needs to be composited other effects during the compositing stage, and the effect of reducing the GPU load is not significant.
- the rounded corner effect can still be achieved by using the GPU compositing method, such as executing the above S1003-S1005, and calling the GPU to composite other effects in S1004.
- the rounded corner effect is achieved by punching holes, which is implemented through S813-S827 in Figure 11, and the rounded corner effect is achieved by GPU compositing, which is implemented through S1102-S1115 in Figure 11.
- the rounded corner window can be closed.
- Event 3 is used to trigger the closure of the rounded corner window.
- Event 3 can be a user-triggered operation event of closing the rounded corner window, or an operation event of dragging the rounded corner window to the edge of the display screen, or an operation event of exiting the rounded corner window, etc., and this application does not specifically limit it in this way.
- the image processing does not include implementing the rounded corner effect. See Figure 13; the image processing includes:
- the system has been continuously monitoring since power-on, and can detect the presence or absence of rounded corner windows for each image frame. Specifically, after receiving event 3, the rounded corner window will be closed, and subsequent monitoring will detect the absence of a rounded corner window.
- desktop icons can be drawn in the desktop layer and wallpaper can be drawn in the wallpaper layer without further refreshing the content of the video window layer.
- the image processing can be completed according to the conventional image processing flow, i.e., conventional drawing and rendering.
- the transparent rounded rectangle area does not need to be drawn
- the rounded corners do not need to be composited.
- the image processing process includes:
- the video player responds to event 3 by sending a request to the WMS to destroy the video window layer.
- WMS destroys the video window layer.
- WMS can destroy a video window layer by releasing its address.
- WMS can simultaneously destroy the video window layer in SurfaceFlinger by destroying the video window layer. In this way, SurfaceFlinger can then monitor the result as shown in S1403.
- SurfaceFlinger can query the switch status. If the switch is on, it means that hole-drilling is enabled. If the switch is off, it means that hole-drilling is not enabled.
- instruction information 3 is used to indicate that no holes are cut, that is, to turn off the rounded corner effect achieved by drawing a transparent rounded rectangle area.
- S1406 surfaceflinger dispatches notification message 2 to libhwui 1 based on the callback function in the layer properties of the desktop layer.
- the desktop application sends the content to be drawn to libhwui1.
- libhwui 1 stores notification message 2. libhwui 1 can use the stored notification message 2 to avoid drawing the rounded rectangle area.
- libhwui1 can save this notification message 2 and, until it receives notification 1 again, will not draw the rounded corner rectangular area based on the saved notification message 2.
- the wallpaper application sends the content to be drawn to libhwui2.
- libhwui 2 can avoid drawing the rounded rectangle area based on the stored notification message 2.
- S1405-S1413 are similar to those of S1102-S1110 mentioned above. For details, please refer to the descriptions of S1102-S1110. They will not be repeated here.
- S1414 and surfaceflinger After receiving the instruction information 4 for the desktop layer and wallpaper layer, S1414 and surfaceflinger obtain the stacking order of the desktop layer, wallpaper layer and video window layer, with the video window layer at the top.
- the video window layer When using GPU compositing, the video window layer should be overlaid on top to ensure its visibility. Correspondingly, SurfaceFlinger, after determining the overlay order, does not need to move the video window layer to the bottom layer.
- SurfaceFlinger can turn off the switch. Subsequently, SurfaceFlinger can query the switch status to decide whether to cancel corner rounding and adjust the stacking order. Specifically, if SurfaceFlinger finds the switch is off, it decides not to cancel corner rounding or adjust the stacking order.
- S1415 and SurfaceFlinger combine the desktop layer and wallpaper layer in the order of overlay to obtain an image frame, which does not include the video window.
- the display screen shows image frames.
- FIG. 13 and 14 above illustrate the processing of an image frame after receiving event 3.
- the processing of each image frame can be done in a similar manner, so that transparent rounded rectangular areas are not drawn and the stacking order between layers is not changed during the processing of each image frame.
- steps S1403-S1417 can be executed cyclically. This allows for the avoidance of drawing transparent rounded rectangles or changing the layer stacking order in each image frame if no rounded corner window is detected. Furthermore, if S1403 detects the absence of a rounded rectangle and S1404 detects that hole-punching is not enabled, steps S1405-S1407 can be omitted, eliminating the need to repeatedly generate and distribute notification message 2. This also reduces communication between SurfaceFlinger and libhwui.
- This application also provides an electronic device, which may include a memory and one or more processors (such as a CPU, GPU, NPU, etc.).
- the memory and processor are coupled.
- the memory is used to store computer program code, which includes computer instructions.
- the processor executes the computer instructions, the electronic device can perform various functions or steps performed by the device in the above method embodiments.
- This application also provides a chip system including at least one processor and at least one interface circuit.
- the processor and the interface circuit are interconnected via lines.
- the interface circuit can be used to receive signals from other devices (e.g., the memory of an electronic device).
- the interface circuit can be used to send signals to other devices (e.g., the processor).
- the interface circuit can read instructions stored in the memory and send the instructions to the processor.
- the electronic device can perform the steps in the above embodiments.
- the chip system may also include other discrete devices, and this application does not specifically limit this.
- This embodiment also provides a computer storage medium storing computer instructions.
- the computer instructions When the computer instructions are executed on an electronic device, the electronic device performs the aforementioned method steps to implement the image processing method described above.
- This embodiment also provides a computer program product that, when run on a computer, causes the computer to perform the aforementioned steps to implement the image processing method described above.
- inventions of this application also provide an apparatus, which may specifically be a chip, component, or module.
- the apparatus may include a connected processor and a memory; wherein the memory is used to store computer execution instructions, and when the apparatus is running, the processor may execute the computer execution instructions stored in the memory to cause the chip to execute the image processing methods in the above-described method embodiments.
- the electronic device, computer storage medium, computer program product or chip are all used to execute the corresponding method provided above. Therefore, the beneficial effects that can be achieved can be referred to the beneficial effects of the corresponding method provided above, and will not be repeated here.
- the disclosed apparatus and methods can be implemented in other ways.
- the apparatus embodiments described above are merely illustrative.
- the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods.
- multiple units or components may be combined or integrated into another device, or some features may be ignored or not executed.
- the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.
- the unit described as a separate component may or may not be physically separate.
- the component shown as a unit can be one physical unit or multiple physical units, that is, it can be located in one place or distributed in multiple different places. Some or all of the units can be selected to achieve the purpose of the solution in this embodiment according to actual needs.
- the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
- the integrated unit can be implemented in hardware or as a software functional unit.
- the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium.
- This software product is stored in a storage medium and includes several instructions to cause a device (which may be a microcontroller, chip, etc.) or processor to execute all or part of the steps of the methods of the various embodiments of this application.
- the aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
Landscapes
- Engineering & Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Human Computer Interaction (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Controls And Circuits For Display Device (AREA)
Abstract
一种图像处理方法及电子设备,涉及图像处理技术领域。其中,方法包括:电子设备在接收到启动第一窗口的事件之后,至接收到关闭第一窗口的事件之前,第一窗口为圆角窗口:电子设备合成第一窗口的圆角,处理得到第一图像帧;电子设备不合成第一窗口的圆角,处理得到第二图像帧;其中,第一图像帧和第二图像帧是两个不同的图像帧,第一图像帧和第二图像帧都包括第一窗口的圆角效果。这样,在启动圆角窗口中,电子设备针对一些图像帧,可以不通过合成实现圆角效果,从而可以降低GPU的负载,提升电子设备的使用性能。
Description
本申请实施例涉及图像处理技术领域,尤其涉及一种图像处理方法及电子设备。
在手机、平板等电子设备中,通常支持多任务操作的能力。其中,多任务操作是指通过在前台运行多个应用,使得用户可以同时使用多个应用。一种典型的多任务操作场景包括:电子设备在显示某个应用界面的情况下,还进一步显示视频小窗,使得用户可以在使用某个应用的同时,通过视频小窗看视频。下文中为方便说明,将这种典型的多任务操作场景简称为视频小窗场景。
在上述视频小窗场景中,视频小窗的外轮廓通常是圆角矩形,相应的,在每一帧图像的处理过程中,电子设备还需要通过图形处理器(Graphics Processing Unit,GPU)处理得到圆角矩形的圆角效果,这将增加GPU的负载,使得电子设备出现发热现象的可能性大幅提升,影响电子设备的使用性能。
发明内容
本申请提供一种图像处理方法及电子设备,可以在包括圆角窗口的多任务操作场景(如上述视频小窗场景)中,降低电子设备出现发热现象的可能性,提升电子设备的使用性能。
为达到上述目的,本申请采用如下技术方案:
第一方面,本申请提供一种图像处理方法,应用于电子设备,方法包括:接收启动第一窗口的事件,第一窗口为非全屏的圆角窗口,如下文图1中画中画形式的视频小窗1021或者图2中悬浮窗形式的窗口2031。在接收到启动第一窗口的事件之后,显示第一图像,第一图像中包括第一窗口,如第一图像为下文图4中的图像帧404。
其中,第一图像包括第一图层和第二图层,第一图层中绘制有第一窗口的第一待显示内容,第二图层中绘制有第一窗口之外的其他区域的第二待显示内容。也就是说,第一图层为用于绘制圆角窗口的待显示内容的图层,即下文中的圆角图层,如第一图层为视频小窗图层,相应的,第一待显示内容为视频内容。第二图层为用于绘制除圆角窗口之外的待显示内容的图层,即下文中的其他图层,如第二图层为桌面图层、壁纸图层等,相应的,第二待显示内容包括桌面图标、壁纸等。
并且,第二图层中还绘制有透明圆角矩形区域,透明圆角矩形区域的位置与第一窗口的显示区域的位置相同,换言之,透明圆角矩形区域与第一窗口的显示区域相同,如图4中透明圆角矩形区域4021、4022与图像帧404中的视频小窗的显示区域是相同的。在第一图像中,第二图层叠加在第一图层的上层。这样,就可以透过透明圆角矩形区域,看到第一窗口,从而可以在第一图像中显示第一窗口。
综上所述,采用本申请方案,在启动圆角窗口后,电子设备可以不经过图像处理器GPU来合成圆角效果,而通过绘制透明圆角矩形区域并将透明圆角矩形区域叠加在圆角窗口的待显示内容之上,实现圆角效果,这样,可以降低GPU的负载,提升电子设备的使用性能。
在第一方面的一种可能设计方式中,在显示第一图像之前,上述方法还包括:生成第一图像。其中,生成第一图像的过程中,不合成第一窗口的圆角效果。即,不会调用GPU合成圆角效果。
在第一方面的另一种可能设计方式中,生成第一图像的过程中,不合成第一窗口的圆角效果,包括:若第一窗口在电子设备的显示屏中的显示区域保持不变的连续时长达到第一时长(如下文中的时长1),则表明第一窗口长时间保持稳定,如未移动或者未缩放,这种情况下,在生成第一图像的过程中,则不合成第一窗口的圆角效果。
实际中,在第一窗口不稳定的情况下,通过透明圆角矩形区域替代合成的方式实现圆角效果,通常会因为存在延迟而导致效果不好,具体可参见下文图9B的相关介绍。基于此,电子设备可以在第一窗口稳定的情况下,才不合成圆角效果,而通过透明圆角矩形区域实现圆角效果,可以在降低GPU负载的同时,保证圆角效果。
在第一方面的另一种可能设计方式中,在显示第一图像之前或者之后,上述方法还包括:生成第二图像,显示第二图像,第二图像包括第一窗口。其中,生成第二图像的过程中,合成第一窗口的圆角效果。
也就是说,在启动第一窗口后,有些图像帧的处理过程中,还是会采用GPU合成的方式实现圆角效果。
在第一方面的另一种可能设计方式中,第二图像包括第三图层和第四图层,第三图层中绘制有第一窗口的第三待显示内容,第四图层中绘制有第一窗口之外的其他区域的第四待显示内容。也就是说,第三图层为用于绘制圆角窗口的待显示内容的图层,第四图层为用于绘制除圆角窗口之外的待显示内容的图层。并且,第四图层中未绘制透明圆角矩形区域,第四图层叠加在第三图层的下层。
可见,在通过合成实现圆角效果的方式中,电子设备则无需绘制透明的圆角矩形区域,并且需要将绘制圆角窗口的待显示内容的图层叠加在上层,这样才能使得圆角窗口可见。
在第一方面的另一种可能设计方式中,生成第二图像的过程中,合成第一窗口的圆角效果,包括:若第一窗口在电子设备的显示屏中的显示区域保持不变的连续时长未达到第一时长,生成第二图像的过程中,合成第一窗口的圆角效果。
也就是说,如果第一窗口不稳定,电子设备则采用GPU合成的方式实现圆角效果,从而可以保证圆角效果。
在第一方面的另一种可能设计方式中,上述生成第一图像,包括:在第一图层中绘制或者刷新第一待显示内容。可以理解是,如果第一窗口显示的是视频内容,则可以通过刷新的方式将图像内容刷新到第一图层中,而无需绘制得到。在第二图层中绘制第二待显示内容和透明圆角矩形区域。将第二图层叠加在第一图层的上层,生成第一图像。从而可以不通过合成实现圆角效果。
在第一方面的另一种可能设计方式中,上述在第二图层中绘制透明圆角矩形区域,包括:基于第一图层的图层属性,如第一图层的位置、大小、第一窗口的圆角半径等,在第二图层中绘制透明圆角矩形区域,使得透明圆角矩形区域的位置与第一窗口的显示区域的位置相同。这样,才能保证可以透过透明圆角矩形区域看到第一窗口中的内容。
在第一方面的另一种可能设计方式中,上述在第二图层中绘制透明圆角矩形区域,包括:若存在第一指示信息(如下文中的指示1),在第二图层中绘制透明圆角矩形区域,第一指示信息指示绘制透明圆角矩形区域。
也就是说,电子设备可以通过第一指示信息,指示绘制透明圆角矩形区域,这样电子设备可以通过第一指示信息明确要绘制透明圆角矩形区域。
在第一方面的另一种可能设计方式中,上述方法还包括:
在接收到启动第一窗口的事件之后,生成第一指示信息。这样,在启动圆角窗口后,电子设备则可以通过透明圆角矩形区域实现圆角效果。
或者,在接收到启动第一窗口的事件,且第一窗口在电子设备的显示屏中的显示区域保持不变的连续时长达到第一时长后,生成第一指示信息。这样,在启动圆角窗口且圆角窗口保持稳定之后,电子设备才可以通过透明圆角矩形区域实现圆角效果。
在第一方面的另一种可能设计方式中,在将第二图层叠加在第一图层的上层,生成第一图像之前,上述还包括:取消合成第一窗口的圆角效果,使得在生成第一图像的过程中,不合成第一窗口的圆角效果。
可以理解,通常情况下会采用合成的方式实现圆角效果,如果不采用合成的方式,电子设备可以取消合成圆角效果的动作,从而保证不采用合成的方式实现圆角效果。
在第一方面的另一种可能设计方式中,在将第二图层叠加在第一图层的上层之前,上述方法还包括:获取第一叠加顺序(如下文中的叠加顺序),在第一叠加顺序中,第一图层位于第二图层上层。调整第一叠加顺序,得到第二叠加顺序(如下文中调整后的叠加顺序),在第二叠加顺序中,第二图层位于第一图层上层。上述将第二图层叠加在第一图层的上层,包括:基于第二叠加顺序,将第二图层叠加在第一图层的上层。
可以理解,通常情况下采用合成的方式实现圆角效果时,确定的叠加顺序是第一顺序,如果不采用合成的方式,电子设备可以调整叠加顺序,从而保证将第一图层叠加在下层。
在第一方面的另一种可能设计方式中,电子设备包括图像合成器SurfaceFlinger、绘制模块libhwui、硬件合成器HWC和图像处理器GPU;
在接收到启动第一窗口的事件之后,上述方法还包括:图像合成器监听到存在圆角窗口,向绘制模块发送第一通知消息(如下文中的通知1),第一通知消息包括第一指示信息和第一图层的图层属性。
上述生成第一图像,包括:绘制模块在第二图层绘制第二待显示内容。绘制模块基于第一通知消息在第二图层绘制透明圆角矩形区域,如基于第一指示信息确定要绘制透明圆角矩形区域,基于图层属性确定透明圆角矩形区域的位置、大小、圆角半径等。在绘制完透明圆角矩形区域之后,绘制模块向图像合成器发送第二指示信息(如下文中的指示信息2)。在接收到第二指示信息之后,图像合成器不调用GPU合成圆角效果,调用HWC将第二图层叠加在第一图层的上层,生成第一图像。其中,第一图层中的第一待显示内容由绘制模块绘制得到,或者由图像合成器刷新得到。
在第一方面的另一种可能设计方式中,图像合成器监听到存在圆角窗口,向绘制模块发送第一通知消息,包括:
图像合成器监听到存在圆角窗口,且第一窗口在电子设备的显示屏中的显示区域保持不变的连续时长达到第一时长后,向绘制模块发送第一通知消息。
第二方面,本申请还提供一种电子设备,电子设备包括显示屏、存储器和一个或多个处理器。显示屏、存储器和处理器耦合。存储器用于存储计算机程序代码,计算机程序代码包括计算机指令,当计算机指令被处理器执行时,使得电子设备执行第一方面及其任一种可能的设计中的方法。
第三方面,本申请提供一种芯片系统,该芯片系统应用于包括显示屏和存储器的电子设备;芯片系统包括一个或多个接口电路和一个或多个处理器;接口电路和处理器通过线路互联;接口电路用于从电子设备的存储器接收信号,并向处理器发送信号,信号包括存储器中存储的计算机指令;当处理器执行计算机指令时,电子设备执行如第一方面及其任一种可能的设计方式的方法。
第四方面,本申请提供一种计算机存储介质,该计算机存储介质包括计算机指令,当计算机指令在电子设备上运行时,使得电子设备执行如第一方面及其任一种可能的设计方式的方法。
第五方面,本申请提供一种计算机程序产品,当计算机程序产品在计算机上运行时,使得计算机执行如第一方面及其任一种可能的设计方式的方法。
可以理解地,上述提供的第二方面的电子设备,第三方面的芯片系统,第四方面的计算机存储介质,第五方面的计算机程序产品所能达到的有益效果,可参考第一方面及其任一种可能的设计方式中的有益效果,此处不再赘述。
图1为本申请实施例的一种应用场景的示意图;
图2为本申请实施例的另一种应用场景的示意图;
图3为本申请实施例提供的一种图像处理过程的原理图;
图4为本申请实施例提供的另一种图像处理过程的原理图;
图5为本申请实施例提供的一种电子设备的硬件结构图;
图6为本申请实施例提供的一种电子设备的软件架构图;
图7为本申请实施例提供的一种图像处理方法的流程图;
图8为本申请实施例提供的一种图像处理方法的时序交互图;
图9A为本申请实施例提供的一种调整视频小窗的示意图;
图9B为本申请实施例提供的一种圆角效果的示意图;
图10为本申请实施例提供的另一种图像处理方法的流程图;
图11为本申请实施例提供的另一种图像处理方法的时序交互图;
图12为本申请实施例提供的一种关闭视频小窗的示意图;
图13为本申请实施例提供的再一种图像处理方法的流程图;
图14为本申请实施例提供的再一种图像处理方法的时序交互图。
下面结合本申请实施例中的附图,对本申请实施例中的技术方案进行描述。其中,在本申请实施例的描述中,以下实施例中所使用的术语只是为了描述特定实施例的目的,而并非旨在作为对本申请的限制。如在本申请的说明书和所附权利要求书中所使用的那样,单数表达形式“一种”、“所述”、“上述”、“该”和“这一”旨在也包括例如“一个或多个”这种表达形式,除非其上下文中明确地有相反指示。还应当理解,在本申请以下各实施例中,“至少一个”、“一个或多个”是指一个或两个以上(包含两个)。术语“和/或”,用于描述关联对象的关联关系,表示可以存在三种关系;例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B的情况,其中A、B可以是单数或者复数。字符“/”一般表示前后关联对象是一种“或”的关系。
在本说明书中描述的参考“一个实施例”或“一些实施例”等意味着在本申请的一个或多个实施例中包括结合该实施例描述的特定特征、结构或特点。由此,在本说明书中的不同之处出现的语句“在一个实施例中”、“在一些实施例中”、“在其他一些实施例中”、“在另外一些实施例中”等不是必然都参考相同的实施例,而是意味着“一个或多个但不是所有的实施例”,除非是以其他方式另外特别强调。术语“包括”、“包含”、“具有”及它们的变形都意味着“包括但不限于”,除非是以其他方式另外特别强调。术语“连接”包括直接连接和间接连接,除非另外说明。“第一”、“第二”仅用于描述目的,而不能理解为指示或暗示相对重要性或者隐含指明所指示的技术特征的数量。
在本申请实施例中,“示例性地”或者“例如”等词用于表示作例子、例证或说明。本申请实施例中被描述为“示例性地”或者“例如”的任何实施例或设计方案不应被解释为比其它实施例或设计方案更优选或更具优势。确切而言,使用“示例性地”或者“例如”等词旨在以具体方式呈现相关概念。
本申请实施例提供一种图像处理方法,可以应用于包括圆角窗口的多任务操作场景中,处理得到包括圆角窗口的圆角效果的图像帧。
其中,圆角窗口可以是视频小窗,即为视频小窗场景。以电子设备是手机为例,参见图1,手机可以显示界面101,界面101为视频播放器的应用界面,界面101中正在播放视频1011。响应于用户从界面101的底部向上(如界面101中箭头所指的方向)的上滑操作,手机可以回到桌面,显示界面102,界面102是手机的桌面,且界面102包括视频小窗1021。视频小窗1021中在接着播放视频1011。视频小窗1021为圆角窗口。本申请实施例提供的图像处理方法,可用于处理得到界面102的图像帧,图像帧中包括视频小窗1021的圆角效果。
其中,圆角窗口可以是应用悬浮窗。仍以电子设备是手机为例,参见图2,手机可以显示界面201,界面201为手机的桌面。响应于用户从界面201的右边缘向左(如界面201中箭头所指的方向)的左滑后暂停的操作,手机可以显示界面202,界面202还是手机的桌面,且界面202包括弹窗2021。弹窗2021包括多个快捷应用的应用图标,如收藏空间的应用图标2022、电子邮箱的应用图标2023、笔记的应用图标2024……响应于用户对任一快捷应用的应用图标的点击操作,手机可以进一步以悬浮窗形式显示该任一快捷应用的应用界面。以任一快捷应用是电子邮箱为例,响应于用户对界面202中电子邮箱的应用图标2023的点击操作,手机可以显示界面203。界面203依然是手机的桌面,且界面203包括电子邮箱的应用悬浮窗2031,应用悬浮窗2031中显示有电子邮箱的应用界面。应用悬浮窗2031为圆角窗口。本申请实施例提供的图像处理方法,可用于处理得到界面203的图像帧,图像帧中包括应用悬浮窗2031的圆角效果。
当然,上述图1和图2所示的仅为两种典型的圆角窗口,实际中并不以此为限。下文中,主要以视频小窗场景为例,说明本申请方案。
在一些方案中,圆角窗口的圆角效果由电子设备中的GPU通过合成(如执行圆角裁剪)得到。具体的,电子设备可以获得(如通过绘制、刷新等方式获得)多个图层的图层内容,多个图层包括圆角窗口的图层(下文简称圆角图层),通过GPU对圆角图层进行圆角裁剪,将裁剪后的圆角图层和多个图层中的其他图层叠加,得到图像帧。
以电子设备是手机,多个图层包括图3所示的视频小窗图层301、桌面图层302和壁纸图层303,且视频小窗图层301为圆角图层为例:手机可以在桌面图层302中绘制桌面图标,在壁纸图层303中绘制壁纸,并在视频小窗图层301中刷新视频内容。应注意,手机通过编解码器组件(如mediacodec)对视频文件解码,得到视频帧之后,刷新到视频小窗图层301中即可,可以无需通过绘制的方式获得视频小窗图层301中的内容。手机可以通过GPU对视频小窗图层进行合成处理,得到具有圆角效果的视频小窗图层304。然后,手机将具有圆角效果的视频小窗图层304、绘制有桌面图标的桌面图层302以及绘制有桌面壁纸的壁纸图层303按照由上到下的顺序叠加,即将具有圆角效果的视频小窗图层304叠加在最上层,可以得到图像帧305。图像帧305包括具有圆角效果的视频小窗3031。
在上述方案中,电子设备通过GPU完成圆角效果的合成,这将增加图像处理过程中GPU的负载,使得电子设备出现发热现象的可能性大幅提升,影响电子设备的使用性能。
基于此,本申请实施例提出了一种图像处理方法,电子设备可以在其他图层的图层内容绘制完成后,在其他图层中进一步绘制透明的圆角矩形区域(形象的称为挖洞)。其中,其他图层包括图像帧中需要绘制内容的多个图层中,除圆角图层之外的图层,如上述图3中的桌面图层303和壁纸图层304。其中,圆角矩形区域与圆角窗口的位置、大小和圆角半径等属性相匹配。电子设备将上述绘制有透明的圆角矩形区域的其他图层叠加在圆角图层之上,即圆角图层位于底层,得到图像帧。在图像帧中,透过叠加在上层的其他图层中透明的圆角矩形区域,使得底层圆角图层内容可见,从而呈现圆角效果。
仍以电子设备是手机,多个图层包括图4所示的视频小窗图层401、桌面图层402和壁纸图层403,且视频小窗图层401为圆角图层为例,则桌面图层402和壁纸图层403为其他图层。手机可以在绘制有桌面图标的桌面图层402中绘制透明的圆角矩形区域4021,以及在绘制有桌面壁纸的壁纸图层403中绘制透明的圆角矩形区域4022。手机将桌面图层402、壁纸图层403和视频小窗图层401按照从上到下的顺序叠加,即视频小窗图层401位于最底层,可以得到图像帧404,图像帧404和前述图3中的图像帧305相同,都具有圆角效果。
由此可见,本申请实施例,电子设备可以通过绘制透明的圆角矩形区域,并将圆角图层叠加在最底层的方式(下文中简称为挖洞的方式),替代GPU合成的方式,实现圆角效果的呈现。这样,圆角效果无需通过GPU合成来实现,可以减少图像处理过程中GPU的负载,降低电子设备出现发热现象的可能性,提升电子设备的使用性能,如使得多任务操作可以流畅的响应。
至此,需要说明的是:手机通常也是通过GPU完成在其他图层中绘制透明的圆角矩形区域。实际中,GPU绘制透明的圆角矩形区域的功耗,极大的低于通过GPU合成圆角效果的功耗。因此,电子设备通过绘制透明的圆角矩形区域,并将圆角图层叠加在最底层的方式,可以降低GPU的负载。
示例性的,上述电子设备可以是手机、平板电脑、桌面型计算机、膝上型计算机、手持计算机、笔记本电脑、超级移动个人计算机(ultra-mobile personal computer,UMPC)、上网本,以及蜂窝电话、个人数字助理(personal digital assistant,PDA)、人工智能(artificial intelligence,AI)设备、可穿戴式设备、车载设备、智能家居设备和/或智慧城市设备等电子设备。本申请实施例对该电子设备的具体形态不作特殊限制。
参见图5,为一种电子设备的硬件结构图。如图5所示,以电子设备是手机为例,电子设备可以包括处理器210,外部存储器接口220,内部存储器(简称内存)221,通用串行总线(universal serial bus,USB)接口230,充电管理模块240,电源管理模块241,电池242,天线1,天线2,移动通信模块250,无线通信模块260,音频模块270,扬声器270A,受话器270B,麦克风270C,耳机接口270D,传感器模块280,按键290,马达291,指示器292,摄像头293,显示屏294,以及用户标识模块(subscriber identification module,SIM)卡接口295等。
可以理解的是,本实施例示意的结构并不构成对手机的具体限定。在另一些实施例中,手机可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。
其中,处理器210可以包括一个或多个处理单元,例如:处理器210可以包括应用处理器(application processor,AP),调制解调处理器,中央处理器(Central Processing Unit,CPU),图形处理器(graphics processing unit,GPU),图像信号处理器(image signal processor,ISP),控制器,视频编解码器,数字信号处理器(digital signal processor,DSP),基带处理器,和/或神经网络处理器(neural-network processing unit,NPU)等。其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。
充电管理模块240用于接收充电器的充电输入。电源管理模块241用于连接电池242,充电管理模块240与处理器210。电源管理模块241接收电池242和/或充电管理模块240的输入,为处理器210,内部存储器221,显示屏294,摄像头293,和无线通信模块260等供电。电源管理模块241还可以用于监测电池容量,电池循环次数,电池健康状态(漏电,阻抗)等参数。
手机的无线通信功能可以通过天线1,天线2,移动通信模块250,无线通信模块260,调制解调处理器以及基带处理器等实现。移动通信模块250可以提供应用在手机上的包括2G/3G/4G/5G等无线通信的解决方案。无线通信模块260可以提供应用在手机上的包括无线局域网(wireless local area networks,WLAN)(如无线保真(wireless fidelity,Wi-Fi)网络),蓝牙(bluetooth,BT),蓝牙低功耗(bluetooth low energy,BLE),超宽带(ultra wide band,UWB),全球导航卫星系统(global navigation satellite system,GNSS),调频(frequency modulation,FM),近距离无线通信技术(near field communication,NFC),红外技术(infrared,IR)等无线通信的解决方案。
手机可以通过GPU,显示屏294,以及应用处理器等实现显示功能。GPU为图像处理的微处理器,连接显示屏294和应用处理器。GPU用于执行数学和几何计算,用于图形渲染。处理器210可包括一个或多个GPU,其执行程序指令以生成或改变显示信息。
手机可以通过摄像头293,ISP,视频编解码器,GPU,显示屏294以及应用处理器AP、神经网络处理器NPU等实现摄像功能。
手机可以通过音频模块270,扬声器270A,受话器270B,麦克风270C,耳机接口270D,以及应用处理器等实现音频功能。例如音乐播放,录音等。
上述电子设备的软件系统可以采用分层架构,事件驱动架构,微核架构,微服务架构,或云架构。本申请实施例以分层架构的安卓(AndroidTM)系统为例,示例性说明电子设备的软件结构。分层架构将电子设备的软件系统分成若干个层,每一层都有清晰的角色和分工,层与层之间通过软件接口通信。
参见图6,以手机为例,电子设备的软硬件架构可以包括应用程序(applications,APP)层,应用程序框架(framework)层,本地(Native)层,内核层(kernel)以及硬件层等。
其中,应用程序层中可以安装桌面应用(launcher)、电子邮箱、视频播放器、备忘录、闹钟、设置、游戏应用等应用。手机可以在前台运行上述应用中的多个,并且其中一个应用可以包括圆角窗口。
以前文图1所示的场景(一种具体的视频小窗场景)为例,手机可以在前台运行桌面应用和视频播放器,并且视频播放器包括圆角窗口。
以前文图2所示的场景为例,手机可以在前台运行桌面应用和电子邮箱应用,并且电子邮箱应用包括圆角窗口。
应用程序框架层为应用程序层提供应用编程接口(application programming interface,API)和编程框架。
其中,应用程序框架层可以包括多种系统服务(System Server),如窗口管理服务(Window Manager Service,WMS)和显示屏管理服务(Display Manager Service,
DMS)等。WMS可以用于窗口管理、窗口动画管理、surface(表面)管理以及作为输入系统的中转站。DMS可用于应用视图(view)的刷新,帧缓冲(framebuffer)的管理,以及作为双屏显示的通路来实现显示屏的切换。
应用程序框架层可以包括视图系统接口(view system API)和图形系统接口(Graphics System API)。view system API可用于应用的布局计算以及绘制指令的执行等。例如,布局计算包括计算桌面中各个图标的位置。进一步的,view system API包括视图(view)、视图组(ViewGroup)、表面视图(surfaceview)等类。Graphics System API可用于设置图形的相关属性。进一步的,Graphics System API包括画布(cavas)、渲染节点(RenderNode)、绘制(Paint)等类。
本地层为上层(如应用程序框架层)提供各种服务。示例性的,本地层中包括图像合成器(SurfaceFlinger)、绘制模块(libhwui)、skia(一个开源的2D图形库)API的能力库(libskia)、提供OpenGL的API支持模块(libGLES_XX)、图层管理模块(libgui)等。应注意,SurfaceFlinger也可以译为表面抛掷者、表面绘图模块、图像合成处理服务等,本申请对此不作具体限定。
其中,SurfaceFlinger可以用于刷新率控制、图像合成的控制等。例如,SurfaceFlinger可以通过决策,将合成任务分配给硬件合成(Hardware Composer,HWC)或者GPU。
在一些实施例中,SurfaceFlinger可用于监听圆角窗口,如监听是否存在圆角窗口,以及基于监听结果控制开关开启与关闭。
在一种具体的实现方式中,在监听到存在圆角窗口的情况下,如监听到存在视频小窗后,SurfaceFlinger可以开启开关。在监听到不存在圆角窗口的情况下,SurfaceFlinger可以关闭开关。
在另一种具体的实现方式中,在监听到存在圆角窗口,且圆角窗口保持稳定的情况下,SurfaceFlinger可以开启开关。在监听到存在圆角窗口,但圆角窗口不稳定(如位置、大小在变化)的情况下,或者,在监听到不存在圆角窗口的情况下,SurfaceFlinger可以关闭开关。
在一些实施例中,SurfaceFlinger可用于在开启开关的情况下,取消圆角合成,在合成时,将圆角图层叠加在最底层。SurfaceFlinger可用于在关闭开关,且存在圆角窗口的情况下,通过调用GPU执行圆角合成,并将圆角图层叠加在最上层。
进一步的,可以在SurfaceFlinger中启动一个监听服务,用于监听圆角窗口。
其中,libhwui可用于图像绘制。在一些实施例中,libhwui还可用于在开启开关的情况下,通过挖洞的方式,实现圆角效果;libhwui还可用于在关闭开关后,则正常绘制图层内容即可,无需绘制透明的圆角矩形区域。
示例性的,SurfaceFlinger在开启开关后,可以向libhwui发送通知1,指示通过绘制实现圆角效果。libhwui收到通知1之后,在上述其他图层的绘制过程中,可以绘制透明的圆角矩形区域。
又示例性的,SurfaceFlinger在关闭开关后,可以向libhwui发送通知2,指示取消通过绘制实现圆角效果。libhwui收到通知2之后,在上述其他图层的绘制过程中,不绘制透明的圆角矩形区域。
可以理解,各个应用可以通过相应的渲染线程(RenderThread)完成绘制。其中,RenderThread是通过调用libhwui中的值实现绘制的。也就是说,每个应用都有对应的libhwui,用于实现该应用对应的绘制,如桌面应用具有libhwui 1、壁纸应用具有libhwui 2、视频播放器具有libhwui 3等。
下文中,为简化说明,将RenderThread的动作表示为libhwui的动作,如 RenderThread绘制表示为libhwui绘制。
libskia可用于libhwui提交绘制指令给GPU完成绘制处理。libGLES_XX可用于将libskia提交的绘制指令转换为GLES格式,以便于GPU执行。libgui可以用于图层及图层属性的轮转,如libhwui通过libgui将图层和图层属性提交给SurfaceFlinger。
内核层中包括驱动硬件工作的驱动,如显示驱动(Display drivers)、GPU驱动等。显示驱动可驱动显示屏显示图像,如显示包括圆角窗口的图像帧。GPU驱动可驱动GPU工作,如驱动GPU执行图像合成。
本申请实施例提供的图像处理方法,可以在具有上述软硬件结构的电子设备中执行。下文中,除图8、图11和图14的时序交互图之外,都以执行主体是电子设备,说明本申请实施例提供的图像处理方法,下文中不再一一赘述执行主体。
下面分三种情况,分别说明本申请实施例提供的图像处理方法。
情况1,未启动圆角窗口;情况2,启动圆角窗口;情况3,关闭圆角窗口。
需要说明的是,在一次运行(如从开机到关机)的过程中,可以仅出现情况1,也可以出现下述各种组合中的任一种:情况1和情况2的组合;情况1、情况2和情况3的组合。
情况1,未启动圆角窗口。例如,在显示前文界面101、界面201、界面202时,都还未启动圆角窗口,相应的,在处理各个图像帧时,也无需处理得到圆角效果。
示例性的,响应于事件1,启动圆角窗口。事件1用于触发启动圆角窗口,如事件1为用户从视频播放界面的底部向上的上滑操作事件、事件1为用户在前文弹窗2021中对任一快捷应用的应用图标的点击操作事件。也就是说,在接收到事件1之前,都属于未启动圆角窗口的情况一。
在情况1中,在各个图像帧的处理过程中,不会监听到存在圆角窗口,则可以确定图像处理的过程不包括实现圆角效果,无需GPU通过合成实现圆角效果,不存在因实现圆角效果增加GPU的负载的问题。相应的,针对情况1,可以经过图像绘制和图像合成处理得到图像帧。其中,图像绘制和图像合成的过程都不包括实现圆角效果的步骤,如图像绘制的过程不包括绘制透明的圆角矩形区域的步骤,图像合成的过程不包括合成圆角效果的步骤。
关于情况1中图像处理过程的具体实现,可以参见相关技术中的说明,本文对此不作具体限定。
情况2,启动圆角窗口。例如,前述界面102中的视频小窗1021为圆角窗口,界面203中的悬浮窗2031为圆角窗口,都属于启动了圆角窗口的情况。
示例性的,在接收到事件1之后,可以启动圆角窗口。
在情况2中,由于启动了圆角窗口,则图像处理的过程包括实现圆角效果。可以通过挖洞的方式,替代GPU合成的方式,实现圆角效果,从而降低GPU的负载,提升的使用性能。
在一些实施例中,参见图7,图像处理的过程包括:
S701、在接收到事件1之后,在处理得到一个图像帧的过程中,监听到存在圆角窗口。
关于事件1,可以参见前文的相关说明,此处不再赘述。
其中,一个图像帧可以是响应于事件1启动圆角窗口之后,关闭圆角窗口(如下文响应于事件3关闭圆角窗口)之前,显示的任一图像帧。例如,在接收到事件1时,显示的是上述界面101中的图像帧,则一个图像帧可以是界面102中的图像帧。
事件1用于触发启动圆角窗口,响应于事件1,启动圆角窗口,则在事件1之后,可以监听到存在圆角窗口。
可以理解的是,若启动圆角窗口,则会创建对应圆角窗口的图层,即前文圆角图层,用于绘制(或刷新)显示在圆角窗口中的内容。
圆角图层与其他图层的明显区别在于,圆角图层具有圆角属性(corner radius)。基于此,在一种具体的实现方式中,可以通过识别一个图像帧包括的图层(如参与合成的图层)是否具有圆角属性,监听是否存在圆角窗口。其中,图像帧包括的任一图层具有圆角属性,可以监听到存在圆角窗口。图像帧包括的所有图层都不具有圆角属性,监听到不存在圆角窗口。
进一步的,手机中还可以记录白名单,白名单包括可用于绘制特定内容的图层的标识,如名字。特定内容包括可能在圆角窗口中呈现的内容。例如,特定内容包括视频内容、电子邮箱的界面内容等。可以将图像帧包括的图层与白名单匹配,从而确定是否存在圆角窗口。
可以获取图像帧包括的图层的图层属性,图层属性包括名字(name)属性、圆角属性等。如果图层标识在白名单中,表明图层可能用于绘制(或刷新)显示在圆角窗口中的内容,即可能是圆角图层。并且,如果具有圆角属性,则监听到存在圆角窗口。如果图层标识不在白名单中,表明图层不用于绘制(或刷新)显示在圆角窗口中的内容,即不可能是圆角图层,监听到不存在圆角窗口。
以白名单包括刷新视频内容的图层的名字为例,在显示前述界面101时,响应于事件1,可以创建用于刷新界面102所示视频小窗1021中视频内容的视频小窗图层,即视频小窗图层为绘制视频内容的图层。将视频小窗图层与白名单匹配,确定视频小窗图层的name属性在白名单中,且确定视频小窗图层具有圆角属性,则监听到存在圆角窗口。
这样,可以通过白名单和图层属性两方面,准确监听到是否存在圆角窗口。
应注意,一个图像帧包括一个或多个图层,如视频小窗图层、桌面图层、壁纸图层等,其中有一个图层具有圆角属性或者在白名单中且具有圆角属性,则监听到存在圆角窗口。
S702、绘制/刷新多个图层。其中,在绘制其他图层时,绘制透明的圆角矩形区域。
其中,多个图层指图像帧包括的图层,其他图层指图像帧中除圆角图层之外的图层,如图4中的桌面图层和壁纸图层。
针对圆角图层,在圆角图层中绘制/刷新显示在圆角窗口中的内容,即圆角图层的图层内容为显示在圆角窗口中的内容,如视频小窗中的视频内容。至此,需要说明的是:通常情况下,可以在圆角图层中绘制得到圆角图层的图层内容,而对于视频内容,也可以通过解码并刷新的方式得到圆角图层的图层内容。下文中,主要以刷新圆角图层(如视频小窗图层)的方式为例说明。
在监听到存在圆角窗口后,针对其他图层,不仅在其他图层中绘制对应的图层内容,如在桌面图层中绘制桌面图标、在壁纸图层绘制壁纸,还在其他图层中绘制透明的圆角矩形区域。
在一些实施例中,可以根据圆角图层的图层属性绘制透明的圆角矩形区域,使得圆角矩形区域与圆角窗口保持一致,如位置、大小等都相同。这样后续图层叠加得到图像帧之后,可以通过透明的圆角矩形区域,呈现完整的圆角窗口及其中呈现的内容。
其中,圆角图层的图层属性包括圆角窗口在显示屏中的位置信息、圆角窗口的尺寸大小、圆角窗口的圆角半径等属性,使得可以基于圆角图层的图层属性计算得到圆角矩形区域在各个其他图层中的位置、大小、圆角半径,从而可以使圆角矩形区域与圆角窗口保持一致。
进一步的,还可以结合手机的状态信息,计算圆角矩形区域在各个其他图层中的位置。其中,状态信息包括横屏状态和竖屏状态,或者状态信息包括显示屏的旋转角度。可以理解,显示屏的旋转角度变化,可以在横屏状态和竖屏状态间切换。也就是说,旋转角度与横屏状态和竖屏状态是对应的,如旋转角度小于角度阈值时,处于竖屏状态,旋转角度大于角度阈值时,切换为横屏状态。处于横屏状态和竖屏状态时,显示屏中界面的显示方向会发生变化,相应的,圆角矩形区域的位置也可能发生变化。结合状态信息计算圆角矩形区域在各个其他图层中的位置,使得计算得到的位置与手机的状态相匹配。
进一步的,还可以结合显示屏的长宽信息、各个其他图层的缩放比例等信息,计算得到各个其他图层在显示屏中的位置。在此基础上,基于圆角图层的图层属性,计算得到圆角矩形区域在各个其他图层中的位置,使得圆角矩形区域的位置与其他图层在显示屏中的位置相匹配。
S703、合成多个图层时,将圆角图层叠加在最底层,得到图像帧,图像帧中的圆角窗口具有圆角效果。
在S703中,可以取消圆角合成,相应的,则无需GPU合成得到圆角效果,可以减少GPU的负载。
以及,将圆角图层叠加在最底层,相当于改变了叠加顺序,从将圆角图层叠加在最上层调整为叠加在最底层。这样,可以通过圆角矩形区域的边界呈现出圆角效果。
S704、显示图像帧。从而可以呈现圆角效果。
下面结合手机的软硬件结构,并以图4所示的场景为例,即圆角图层为视频小窗图层、其他图层为桌面图层和壁纸图层,进一步介绍情况2的图像处理流程。具体的,如图8所示,图像处理的过程包括:
S801、响应于开机初始化,surfaceflinger启动圆角窗口的监听。
在手机开机时,surfaceflinger也会进行初始化,在surfaceflinger初始化时,则可以启动圆角窗口的监听,从而可以监听到开机后圆角窗口启动与关闭。
在一些实施例中,surfaceflinger可以通过启动监听服务,实现圆角窗口的监听。
在surfaceflinger启动圆角窗口的监听后,在事件1之后,surfaceflinger可以监听到存在圆角窗口。
S802、响应于事件1,桌面应用向WMS发送桌面图层的创建请求。
应理解,在图4的场景中,事件1为用户从视频播放界面的底部向上的上滑操作事件。
响应于事件1,桌面应用确定需要显示桌面内容,向WMS发送桌面图层的创建请求,用于请求创建绘制桌面内容(如桌面图标)的桌面图层。
S803、响应于事件1,壁纸应用向WMS发送壁纸图层的创建请求。
响应于事件1,壁纸应用确定需要显示壁纸,向WMS发送壁纸图层的创建请求,用于请求创建绘制壁纸的壁纸图层。
S804、响应于事件1,视频播放器向WMS发送视频小窗图层的创建请求。
响应于事件1,视频播放器确定需要在视频小窗中播放视频,向WMS发送视频小窗图层的创建请求,用于请求创建刷新视频内容的视频小窗图层。
S805、WMS创建桌面图层、壁纸图层和视频小窗图层,为各个图层添加图层属性。
可以理解的是,WMS可以基于各个应用的创建请求添加图层属性,如为视频小窗图层添加位置、大小等属性,还可以添加圆角属性。
应注意,WMS可以在surfaceflinger中同步创建各个图层并添加图层属性。
经过上述S802-S805,可以创建得到一个图像帧包括的各个图层。
桌面应用、壁纸应用、视频播放器在发送相应的图层创建请求后,可以初始化RenderThread进行相应图层的设置,如下S806和S809所示。
S806、桌面应用初始化RenderThread进行桌面图层的设置。
示例性的,桌面应用可以初始化桌面应用的RenderThread进行桌面图层的绘制环境参数的设置。例如,RenderThread通过表面控制(SurfaceControl)进行绘制环境参数的设置,SurfaceControl是WMS、libhwui等持有的与surfaceflinger中的图层对应的值,可以作为图层的唯一标识,与surfaceflinger中的图层完成信息交互,包括图层属性的设置。基于此,libhwui1可以在RenderThread进行桌面图层的绘制环境参数的设置时,标识将绘制桌面图层的图层内容。
libhwui1在检测到RenderThread进行桌面图层的设置后,还可以执行下述S807和S808,以便后续libhwui1确定是否挖洞以及回传是否完成挖洞的指示。
S807、libhwui1向surfaceflinger注册桌面图层的监听回调。
例如,libhwui1可以通过binder(一种跨进程通信机制)向surfaceflinger注册监听回调。
通过注册监听回调,libhwui1后续可以获得是否挖洞的指示。
进一步的,在接收到挖洞的指示的情况下,通过监听回调,libhwui1还可以获得圆角图层的图层属性、手机的状态信息等,用于绘制得到与圆角窗口一致的圆角矩形区域。
S808、surfaceflinger在桌面图层的图层属性中保存回调函数。
关于在桌面图层的图层属性中保存的回调函数的作用,可以参见下述S814的说明,此处暂不做过多说明。
S809、壁纸应用初始化RenderThread进行桌面图层的设置。
示例性的,壁纸应用也可以初始化壁纸应用的RenderThread进行壁纸图层的绘制环境参数的设置。基于此,libhwui2可以在RenderThread进行壁纸图层的绘制环境参数的设置时,标识将绘制壁纸图层的图层内容。
libhwui2在检测到RenderThread进行桌面图层的设置后,还可以执行下述S810和S811,以便后续libhwui2确定是否挖洞。
S810、libhwui2向surfaceflinger注册桌面图层的监听回调。
可以理解,注册监听回调即注册监听器及回调函数。
通过监听回调,libhwui2可以获得是否挖洞的指示。
进一步的,在接收到挖洞的指示的情况下,通过监听回调,libhwui2还可以获得圆角图层的图层属性、手机的状态信息等,用于绘制得到与圆角窗口一致的圆角矩形区域。
S811、surfaceflinger在桌面图层的图层属性中保存回调函数。
关于在壁纸图层的图层属性中保存的回调函数的作用,可以参见下述S815的说明,此处暂不做过多说明。
至此,需要说明以下几点:
第一,上述S806-S808与S809-S811的执行顺序,并不以图8所示为限。示例性的,S806和S809的执行顺序不分先后,也可能是先执行S809,后执行S806,也可能是同时执行S806和S809,并且,相应的libhwui在检测到进行相应图层的设置后,则触发执行后续步骤。
第二,上述S806-S811仅示出了进行桌面图层和壁纸图层的设置以及触发后续注册监听回调的过程。实际中,视频播放器也可以初始化RenderThread进行视频小窗图层的设置。
在一种具体的实现方式中,视频播放器的libhwui 3在检测到进行视频小窗图层的设置之后,也可以触发注册监听回调,但是,surfaceflinger可以识别到视频小窗图层为圆角图层,因此即使注册了视频小窗图层的监听回调,surfaceflinger也不会向libhwui 3反馈是否挖洞的指示,使得libhwui不会在视频小窗图层中绘制透明的圆角矩形区域。
在另一种具体的实现方式中,视频播放器的libhwui 3在检测到进行视频小窗图层的设置之后,可以识别到视频小窗图层为圆角图层,则可以不触发注册监听回调。这样,surfaceflinger不会向linbhwui 3反馈是否挖洞的指示,使得libhwui不会在视频小窗图层中绘制透明的圆角矩形区域。下文中,主要以这种实现方式为例说明。
第三,libhwui在向surfaceflinger注册某个图层的监听回调之后,后续当libhwui再次检测到进行该某个图层的设置时,无需再次注册。也就是说,在手机开机到关机的一次使用过程中,针对该某个图层,libhwui仅向surfaceflinger注册一次监听回调即可。那么,上述S807-S808、S810-S811也可能并不会在图8所示的流程执行,而可能在图8的流程之前注册了监听回调,如在开机后首次进到桌面时,则注册了桌面图层的监听回调以及壁纸图层的监听回调。简言之,在图8的流程的,上述S807-S808、S810-S811并不是必须的,而且大概率是不存在的。
S812、surfaceflinger基于视频小窗图层的图层属性,监听到启动圆角图层。
surfaceflinger在每一帧的合成信息检测阶段,监听参与合成的图层中是否包括圆角图层。示例性的,surfaceflinger检测到视频小窗图层的名字在白名单中,且视频小窗图层具有圆角属性,则监听到存在圆角窗口。
S813、surfaceflinger生成通知消息1,通知消息1包括视频小窗图层的图层属性和指示信息1。
其中,指示信息1用于指示挖洞,即开启通过绘制透明的圆角矩形区域实现圆角效果。
其中,通知消息1中视频小窗图层的图层属性可用于计算圆角矩形区域的位置、大小、圆角半径等。
S814、surfaceflinger基于桌面图层的图层属性中的回调函数,向libhwui 1分发通知消息1。
由于桌面图层的图层属性中保存了回调函数,则表明桌面图层注册了监听回调,surfaceflinger基于可以向绘制桌面图层的libhwui 1分发通知消息1。
S815、surfaceflinger基于壁纸图层的图层属性中的回调函数,向libhwui 2分发通知消息1。
由于壁纸图层的图层属性中保存了回调函数,则表明壁纸图层注册了监听回调,surfaceflinger基于可以向绘制壁纸图层的libhwui 2分发通知消息1。
也就是说,surfaceflinger可以向各个注册了监听回调的图层对应的libhwui分发通知消息1,用于通知libhwui在图层绘制过程中,绘制透明的圆角矩形区域。
可以理解的是,当应用需要绘制新一个图像帧时,可以向libhwui发送待绘制的内容,使libhwui可以在相应的图层中绘制该内容。具体如下S816和S819所示。
S816、桌面应用向libhwui1发送待绘制的内容1。
例如,内容1是桌面图标。
S817、libhwui 1在桌面图层中绘制内容1,根据通知消息1在桌面图层中绘制圆角矩形区域。
在通常情况下,即使图像帧中存在圆角窗口,在绘制阶段也主要是完成图层内容的绘制即可,无需在绘制阶段实现圆角效果。
在本申请实施例中,libhwui 1在接收到待绘制的内容1之后,可以在桌面图层中绘制内容1。除此之外,libhwui1还接收到了通知消息1,则在libhwui 1在桌面图层中绘制完内容1之后,还可以基于通知消息1中的指示信息1确定绘制透明的圆角矩形区域,以及,基于通知消息1中视频小窗图层的图层属性计算圆角矩形区域的位置、大小、圆角半径等并绘制圆角矩形区域。
当然,libhwui 1还可以基于更多的信息计算圆角矩形区域的位置、大小、圆角半径等,这些信息可以携带在通知消息1中,如手机的状态信息、桌面图层的缩放比例等,或者,这些信息也可以是libhwui 1从其他模块获取的,如从内存中获得显示屏的长宽信息等。本申请对此不作具体限定。
S818、libhwui 1在绘制完成后,反馈指示信息2。
其中,指示信息2用于指示完成挖洞。
其中,绘制完成包括绘制内容1和透明的圆角矩形区域完成。
示例性的,libhwui 1可以通过surfacecontrol向surfaceflinger反馈完成挖洞的指示信息2。
S819、桌面应用向libhwui2发送待绘制的内容2。
例如,内容2是壁纸。
S820、libhwui 2在壁纸图层中绘制内容2,根据通知消息1在壁纸图层中绘制圆角矩形区域。
与前述S817同理,libhwui 2可以基于通知消息1中的指示信息1确定绘制透明的圆角矩形区域,以及,基于通知消息1中视频小窗图层的图层属性计算圆角矩形区域的位置、大小、圆角半径等并绘制圆角矩形区域。
S821、libhwui 2在绘制完成后,反馈指示信息2。
其中,绘制完成包括绘制内容2和透明的圆角矩形区域完成。
示例性的,libhwui 2可以通过surfacecontrol向surfaceflinger反馈完成挖洞的指示信息2。
至此,需要说明以下几点:
第一,通常通常情况下,各个应用都可以向对应的libhwui发送待绘制的内容,以实现绘制。而基于前文说明可知,视频小窗中的视频内容可以通过解码并刷新的方式获得,则视频播放器可以不通过向对应的libhwui 3发送视频内容实现在视频小窗图层中绘制视频内容。
第二,如果其他图层是静态的,即图层内容与上一个图像帧相同,则相应的应用不会重复发送待绘制的内容。相应的,libhwui也无需重复绘制图层内容。
S822A、surfaceflinger在接收到桌面图层和壁纸图层对应的指示信息2之后,取消圆角合成。
在图4所示的场景中,事件1之后,图像帧包括的图层有桌面图层、壁纸图层和视频小窗图层,而视频小窗图层是圆角图层,无需绘制透明的圆角矩形区域,则surfaceflinger接收到桌面图层和壁纸图层对应的指示信息2,表明接收到所有其他图层对应的指示信息2,即所有其他图层都已完成挖洞,surfaceflinger可以执行与透明的圆角矩形区域相配合的一套流程,包括S822A中的取消圆角合成、刷新视频小窗图层,以及S823-S825,实现透过圆角矩形区域呈现圆角效果。
示例性的,surfaceflinger在接收到libhwui 1的指示信息2之后,可以将指示信息2保存到桌面图层的图层属性中,在接收到libhwui 2的指示信息2之后,可以将指示信息2保存到壁纸图层的图层属性中。Surfaceflinger可以将保存有指示信息2的图层与图像帧中的其他图层比较,如果其他图层的图层属性中都保存有指示信息2,表明接收到所有其他图层对应的指示信息2。
在通常情况下,通过合成实现圆角效果。本申请实施例中,在接收到所有其他图层对应的指示信息2后,则表明可以通过透明的圆角矩形区域实现圆角效果,surfaceflinger取消圆角合成。
S822B、surfaceflinger刷新视频小窗图层的视频内容。
surfaceflinger可以刷新视频小窗图层的图层内容,即视频内容,使得视频小窗图层可以呈现最新的视频帧。示例性的,编解码器组件可以在解码得到最新的视频帧之后,将视频帧发送至surfaceflinger,surfaceflinger则可以刷新视频小窗图层。需要说明的是,surfaceflinger刷新视频小窗图层的时机并不以图8所示为限。例如,编解码器组件可以按照视频播放器的需求解码出一个视频帧并发送至surfaceflinger,surfaceflinger在接收到视频帧之后即可刷新视频小窗图层。当然,在连续多个图像帧中,视频小窗中显示的视频内容可能是静态的,如暂停播放后,则视频内容不变,是静态的,这种情况下,surfaceflinger则无需每帧都刷新视频小窗图层。即,刷新视频小窗图层的动作并不是每帧都必要的。
S823、surfaceflinger获取桌面图层、壁纸图层和视频小窗图层的叠加顺序,其中,视频小窗图层位于最上层。
S824、surfaceflinger将视频小窗图层从位于最上层调整为位于最底层,得到调整后的叠加顺序。
这样,surfaceflinger则可以实现将视频小窗图层叠加在最底层,从而可以通过圆角矩形区域的轮廓实现圆角效果。
S825、surfaceflinger按照调整后的叠加顺序合成桌面图层、壁纸图层和视频小窗图层,得到图像帧。
由于取消了圆角合成,surfaceflinger不会调用GPU对视频小窗图层裁剪实现圆角效果,从而可以降低GPU的负载。示例性的,surfaceflinger可以调用HWC完成图层叠加,得到图像帧。
在上述S816-S825中,以所有其他图层都完成了挖洞的情况进行了说明。实际中,也可能出现多个其他图层中的至少一个图层未完成挖洞的情况,相应的,libhwui则不会向surfaceflinger反馈该至少一个图层对应的指示信息2,surfaceflinger可以确定未接收到所有其他图层对应的指示信息2,则不取消圆角合成。后续,surfaceflinger可以不执行S824,且在S825中,surfaceflinger按照未调整的叠加顺序合成桌面图层、壁纸图层和视频小窗图层,得到图像帧,其中surfaceflinger调用GPU完成圆角合成,使得得到的图像帧中的视频小窗具有圆角效果。
S826、surfaceflinger向显示屏发送图像帧。
S827、显示屏显示图像帧。
示例性的,显示屏在每次刷新后,则会显示下一个图像帧。
上述图7和图8的实施例,说明了接收到事件1之后一个图像帧的处理过程。实际中,在关闭圆角窗口之前,每一个图像帧的处理都可以按照类似的方式处理,从而可以在每一个图像帧中实现圆角效果。也就是手机可以在处理得到每一个图像帧的过程中,监听是否存在圆角窗口,如果监听到存在圆角窗口,则会在绘制各个其他图层时,绘制透明的圆角矩形区域。
在一种具体的实现方式中,在图8所示的流程中,可以循环执行S812-S827,从而可以在每一个图像帧中,降低GPU的负载。其中,在S812监听到存在圆角矩形区域之后,surfaceflinger可以开启开关并生成通知消息1,后续执行S812再次监听到存在圆角矩形区域之后,可以查询开关状态,若查询到为开启状态,则可以省略S813-S815,则无需重复生成并分发通知消息1。相应的,libhwui在接收到通知消息1之后,可以保存通知消息1,后续在接收到待绘制的内容之后,libhwui可以基于保存的通知消息1绘制透明的圆角矩形区域。这样,可以减少surfaceflinger和libhwui之前的通信。
前述关于情况2的介绍中,说明了启动圆角窗口后,每一个图像帧的处理过程。进一步的,在启动圆角窗口后,响应于事件2,还可以调整圆角窗口的位置、大小、圆角半径等。其中,事件2用于触发手机调整圆角窗口。示例性的,事件2可以是用户对圆角窗口的拖动操作事件,或者事件2可以是用户对圆角窗口的缩放操作(如双击操作)事件等。
以事件2是对圆角窗口的拖动操作事件为例,在启动视频小窗口后,可以显示图9A所示的界面901,界面901包括视频小窗9011。响应于用户将界面901中视频小窗9011沿界面901中的箭头方向的拖动操作,可以调整视频小窗9011的位置,如调整后可以显示界面902。界面2中同样包括视频小窗9011。与界面901不同的是,界面902中的视频小窗9011的位置发生了变化。
在一些实施例中,针对上述调整圆角窗口的情况,依然可以针对每一个图像帧,通过挖洞的方式,实现圆角效果,以减少每一个图像帧的处理过程中GPU的负载。
以图9A所示的场景为例,响应于用户将界面901中视频小窗9011沿界面901中的箭头方向的拖动操作,视频播放器可以向WMS发送图层属性的更新请求,WMS响应于更新请求,可以更新视频小窗图层的位置属性并同步给surfaceflinger。Surfaceflinger在接收到更新的位置属性后,可以生成新的通知1,在通知1中携带视频小窗图层更新后的图层属性和指示1,并分发给libhwui 1和libhwui 2,使得libhwui 1和libhwui 2可以基于视频小窗图层更新后的图层属性绘制透明的圆角矩形区域。
在另一些实施例中,针对上述调整圆角窗口的情况,在调整的过程中(称为情况21),如从界面901中视频小窗9011的位置调整到界面902中视频小窗9011的位置的过程中,通过GPU进行圆角合成实现圆角效果,在调整结束并保持稳定之后(称为情况22),如调整到界面902中视频小窗9011的位置之后,通过挖洞的方式,实现圆角效果。
实际实施时,在调整圆角窗口的过程中,如果通过挖洞的方式,实现圆角效果,可能存在延迟,通常可能存在1帧的延迟。示例性的,在第k帧图像显示时接收到事件2。surfaceflinger在接收到更新后的圆角窗口的图层属性(如位置属性)之后,通过通知1向libhwui发送更新的图层属性。而libhwui在接收到更新的图层属性之前,可能已经在执行第k+1帧图像的绘制了,也就是libhwui可能基于未更新的图层属性绘制圆角矩形区域,即挖洞使用的图层属性存在延迟,简称挖洞存在延迟。后续,surfaceflinger在合成时,可能使用更新的图层属性进行合成,如基于更新的位置属性计算圆角窗口合成的位置。这样,就可能出现圆角矩形区域与圆角窗口不一致,如位置不相同,从而出现圆角矩形区域为黑色、圆角窗口中的内容显示不全等问题。
仍以从图9A所示界面901中视频小窗9011所在的位置沿箭头所指的方向拖动视频小窗9011为例,在拖动的过程中,如果采用挖洞的方式,可能显示图9B所示的界面911,界面911中圆角矩形区域9111中的部分区域为黑色(即没有像素填充),视频小窗9011中的内容也仅显示了人物部分,存在缺失。
基于上述调整圆角窗口的过程中产生的问题,采用本实施例,在调整圆角窗口的过程中,依然采用GPU进行圆角合成的方式实现圆角效果,可以避免挖洞存在延迟而导致的上述问题。
也就是说,在同样存在有圆角窗口的场景中,一些情况下可以采用挖洞的方式,实现圆角效果,减少GPU的负载,另一些情况下可以采用GPU进行圆角合成的方式,实现圆角效果,避免出现圆角矩形区域为黑色、圆角窗口中的内容显示不全等问题。
参见图10,图像处理的过程包括:
S1001、在接收到事件1之后,在处理得到一个图像帧的过程中,监听到存在圆角窗口。
应注意,在事件1之后,直至关闭圆角窗口之前,都可以监听到存在圆角窗口。
S1002、检测圆角窗口保持不变的连续时长是否达到时长1。若否,则执行S1003;若是,则执行S1006。
如果检测到圆角窗口保持不变的连续时长未达到时长1,如未达到1s、2s等,则表明圆角窗口处于不稳定的状态。示例性的,圆角窗口处于不稳定的状态包括在调整圆角窗口,如调整圆角窗口的位置、大小等,即上述情况21。又示例性的,圆角窗口处于不稳定的状态包括刚启动圆角窗口。再示例性的,圆角窗口处于不稳定的状态包括刚结束调整圆角窗口,如刚结束移动圆角窗口的位置。针对这种情况,可以执行下述S1003-S1005,通过GPU合成的方式实现圆角效果。
如果检测到圆角窗口保持不变的连续时长达到时长1,则表明圆角窗口处于稳定的状态。示例性的,圆角窗口处于稳定的状态包括启动圆角窗口后一直未接收到事件2。又示例性的,圆角窗口处于稳定的状态包括在调整圆角窗口后较长时间都保持不变,即上述情况21。针对这种情况,可以执行下述S1006-S1008,通过挖洞的方式实现圆角效果。
S1003、绘制/刷新多个图层。其中,在绘制其他图层时,不绘制透明的圆角矩形区域。
由于通过GPU合成的方式实现圆角效果,则无需绘制透明的圆角矩形区域。
S1004、合成多个图层,通过GPU合成圆角效果,将圆角图层叠加在最上层,得到图像帧,图像帧中的圆角窗口具有圆角效果。
即,通过GPU合成圆角效果,以保证实现圆角效果的及时性。以及,将圆角图层叠加在最上层,以保证圆角窗口中的内容可见。
S1005、显示图像帧。从而可以呈现圆角效果。
在接收到事件1之后,直至关闭圆角窗口之前,满足圆角窗口保持不变的连续时长未达到时长1,则可以采用上述S1003-S1005的步骤完成每个图像帧的处理,以保证实现圆角效果的及时性。
S1006、绘制/刷新多个图层。其中,在绘制其他图层时,绘制透明的圆角矩形区域。
在圆角窗口变化结束并达到时长1之后,执行S1006时,可以基于变化结束时圆角图层的图层属性绘制透明的圆角矩形区域,使得圆角矩形区域与变化后的圆角窗口保持一致。
S1007、合成多个图层时,将圆角图层叠加在最底层,得到图像帧,图像帧中的圆角窗口具有圆角效果。
S1008、显示图像帧。从而可以呈现圆角效果。
上述S1006-S1008,可以参见前文S702-S704的说明,此处不再赘述。
在接收到事件1之后,直至关闭圆角窗口之前,满足圆角窗口保持不变的连续时长达到时长1,则可以采用上述S1006-S1008的步骤完成每个图像帧的处理,以降低GPU的负载。
下面代入一些典型的场景,对上述图10的流程做进一步介绍:
场景1,在t1时刻启动圆角窗口,紧接着在t2(t1和t2之间的时间间隔小于时长1)时刻触发调整圆角窗口,在t3时刻调整结束,后续一直不调整。
在t1-t2之间:执行S1001,可以监听到存在圆角窗口;执行S1002,可以检测到圆角窗口保持不变的连续时长未达到时长1,后续,则会执行S1003-S1005,通过GPU合成圆角效果。也就是说,在启动圆角窗口后,如果短时间内则调整圆角窗口,会通过GPU合成圆角效果。
在t2-t4之间,t4<t3+时长1:执行S1001,可以监听到存在圆角窗口;执行S1002,可以检测到圆角窗口保持不变的连续时长未达到时长1,后续,则会执行S1003-S1005,通过GPU合成圆角效果。也就是说,在调整圆角窗口使得圆角窗口发生变化的过程中以及在结束调整圆角窗口后间隔时长1的时间段内,也会通过GPU合成圆角效果。应注意,在调整的过程中,可以更新圆角图层的图层属性,使用更新的图层属性生成图像帧。
在t4之后:执行S1001,可以监听到存在圆角窗口;执行S1002,可以检测到圆角窗口保持不变的连续时长达到时长1,后续,则会执行S1006-S1008,通过绘制透明的圆角矩形区域实现圆角效果。也就是说,在结束调整圆角窗口并间隔时长1之后,才通过绘制透明的圆角矩形区域实现圆角效果。
场景2,在t1时刻启动圆角窗口,在t5(t1和t5之间的时间间隔大于或等于时长1)时刻触发调整圆角窗口,在t6时刻结束调整,后续一直不调整。
在t1-t7之间,t7<t1+时长1:执行S1001,可以监听到存在圆角窗口;执行S1002,可以检测到圆角窗口保持不变的连续时长未达到时长1,后续,则会执行S1003-S1005,通过GPU合成圆角效果。也就是说,在启动圆角窗口后,即使短时间内未调整圆角窗口,也会因为未达到时长1通过GPU合成圆角效果。
在t7-t5之间:执行S1001,可以监听到存在圆角窗口;执行S1002,可以检测到圆角窗口保持不变的连续时长达到时长1,后续,则会执行S1006-S1008,通过绘制透明的圆角矩形区域实现圆角效果。也就是说,在启动圆角窗口后,如果长时间未调整圆角窗口,则可以通过绘制透明的圆角矩形区域实现圆角效果。
在t5-t8之间,t8<t6+时长1:执行S1001,可以监听到存在圆角窗口;执行S1002,可以检测到圆角窗口保持不变的连续时长未达到时长1,后续,则会执行S1003-S1005,通过GPU合成圆角效果。也就是说,在调整圆角窗口使得圆角窗口发生变化的过程中以及在结束调整圆角窗口后间隔时长1的时间段内,也会通过GPU合成圆角效果。应注意,在调整的过程中,可以更新圆角图层的图层属性,使用更新的图层属性生成图像帧。
在t8之后:执行S1001,可以监听到存在圆角窗口;执行S1002,可以检测到圆角窗口保持不变的连续时长达到时长1,后续,则会执行S1006-S1008,通过绘制透明的圆角矩形区域实现圆角效果。也就是说,在结束调整圆角窗口并间隔时长1之后,通过绘制透明的圆角矩形区域实现圆角效果。
当然,在调整一次圆角窗口之后,还可以触发再次调整圆角窗口。或者,在启动圆角窗口之后,也可以一直不调整圆角窗口。此处不再一一赘述。
下面结合手机的软硬件结构,并仍然以图4所示的场景为例,即圆角图层为视频小窗图层、其他图层为桌面图层和壁纸图层,进一步介绍图10的图像处理流程。
具体的,如图11所示,在S812之后,还包括S1101:
S1101、surfaceflinger检测视频小窗图层保持不变的连续时长是否达到时长1。若是,则执行S813;若否,则执行S1102。
其中,视频小窗图层保持不变,则表明视频小窗保持不变。
surfaceflinger在监听到启动圆角窗口后,可以开始计时,后续,surfaceflinger在每次接收到视频小窗图层更新后的图层属性后,则重新计时。这样,计时达到时长1时,则表明视频小窗图层保持不变的连续时长达到时长1。
在一种具体的实现方式中,响应于事件2,视频播放器可以向WMS发送视频小窗图层的属性更新请求。WMS在接收到属性更新请求后,可以更新视频小窗图层的图层属性。WMS还可以将更新的图层信息向surfaceflinger同步,这样,surfaceflinger可以接收到更新后的图层信息,从而可以控制重新开始计时。
如果检测到视频小窗图层保持不变的连续时长达到时长1,表明圆角窗口处于稳定的状态,则可以执行前文S813-S827,此处不再赘述。应注意,如果圆角窗口发生了变化,则在S813中,surfaceflinger生成的通知1中携带的是视频小窗图层最后一次更新后的图层属性,使得libhwui在绘制的透明的圆角矩形区域,与变化结束时的视频小窗一致。
如果检测到视频小窗图层保持不变的连续时长未达到时长1,表明圆角窗口未稳定,则可以执行下述S1102-S1110:
S1102、surfaceflinger生成通知消息2,通知消息2包括指示信息3。
其中,指示信息3用于指示不挖洞,即关闭通过绘制透明的圆角矩形区域实现圆角效果。
S1103、surfaceflinger基于桌面图层的图层属性中的回调函数,向libhwui 1分发通知消息2。
S1104、surfaceflinger基于壁纸图层的图层属性中的回调函数,向libhwui 2分发通知消息2。
可以理解的是,当应用需要绘制新一个图像帧时,可以向libhwui发送待绘制的内容,使libhwui可以在相应的图层中绘制该内容。具体如下S1105和S1108所示。
S1105、桌面应用向libhwui1发送待绘制的内容3。
S1106、libhwui 1在桌面图层中绘制内容3,根据通知消息2不在桌面图层中绘制圆角矩形区域。
S1107、libhwui 1在绘制完成后,反馈指示信息4。
其中,指示信息4用于指示未完成挖洞。
S1108、壁纸应用向libhwui2发送待绘制的内容4。
S1109、libhwui 2在壁纸图层中绘制内容4,根据通知消息2不在壁纸图层中绘制圆角矩形区域。
S1110、libhwui 2在绘制完成后,反馈指示信息4。
上述S1103-S1110的原理与具体实现,与前文S814-S821类似,具体可参见S814-S821的说明,此处不再赘述。
S1111A、surfaceflinger在接收到桌面图层和壁纸图层的指示信息4后,不取消圆角合成。
由于视频小窗图层保持不变的连续时长未达到时长1,表明应采用GPU合成的方式实现圆角效果,则surfaceflinger在接收到未挖洞的指示信息4之后,可以不取消圆角合成。
S1111B、surfaceflinger刷新视频小窗图层的视频内容。
S1112、surfaceflinger获取桌面图层、壁纸图层和视频小窗图层的叠加顺序,其中,视频小窗图层位于最上层。
采用GPU合成的方式,则视频小窗图层应叠加在最上层,以保证视频小窗可见。相应的,surfaceflinger在确定出叠加顺序之后,可以不将视频小窗图层调整到最底层。
在一种具体的实现方式中,在S1101中检测到视频小窗图层保持不变的连续时长达到时长1之后,surfaceflinger可以开启开关,检测到视频小窗图层保持不变的连续时长未达到时长1之后,surfaceflinger可以关闭开关。后续surfaceflinger可以通过查询开关状态,决策是否取消圆角合成和调整叠加顺序。其中,surfaceflinger查询到开关状态为关闭开关,决策不取消圆角合成、不调整叠加顺序,如S1111和S1112所示。surfaceflinger查询到开关状态为开启开关,且接收到所有其他图层完成挖洞的指示2,决策取消圆角合成、调整叠加顺序,如S822-S824所示。surfaceflinger查询到开关状态为开启开关,且接收到部分其他图层完成挖洞的指示2,决策不取消圆角合成、不调整叠加顺序,从而可以在部分其他图层未完成挖洞的情况下,也实现圆角效果。
S1113、surfaceflinger调用GPU合成圆角效果,按照叠加顺序合成桌面图层、壁纸图层和视频小窗图层,得到图像帧。
由于没有取消圆角合成,在合成阶段,surfaceflinger可以调用GPU完成圆角合成,则得到的图像帧中的视频小窗也具有圆角效果。
S1114、surfaceflinger向显示屏发送图像帧。
S1115、显示屏显示图像帧。
上述图10和图11的实施例,说明了接收到事件1之后一个图像帧的处理过程。实际中,在关闭圆角窗口之前,每一个图像帧的处理都可以按照类似的方式处理,从而可以在每一个图像帧中实现圆角效果。也就是可以在处理得到每一个图像帧的过程中,监听是否存在圆角窗口以及检测圆角窗口保持不变的连续时长是否达到时长1,如果监听到存在圆角窗口,且圆角窗口保持不变的连续时长达到时长1,则会在绘制各个其他图层时,绘制透明的圆角矩形区域。
在一种具体的实现方式中,在图11所示的流程中,可以循环执行S812-S1115,从而可以在每一个图像帧中,在监听到存在圆角窗口,且圆角窗口保持不变的连续时长达到时长1的情况下,降低GPU的负载,在监听到存在圆角窗口,但圆角窗口保持不变的连续时长未达到时长1的情况下,避免延迟而导致出现圆角矩形区域为黑色、圆角窗口中的内容显示不全等问题。同样,在S812监听到存在圆角矩形区域,且S1101检测视频小窗图层保持不变的连续时长达到时长1的情况下,surfaceflinger可以查询开关状态,若查询到为开启状态,则可以省略S813-S815,无需重复生成并分发通知1。反之,在S812监听到存在圆角矩形区域,但S1101检测视频小窗图层保持不变的连续时长达到未时长1的情况下,surfaceflinger可以查询开关状态,若查询到为关闭状态,则可以省略S1102-S1104,无需重复生成并分发通知消息2。这样,也可以减少surfaceflinger和libhwui之前的通信。
除上述圆角合成之外,还有一些其他效果,如阴影、模糊效果等,也需要GPU合成得到。相应的,在合成阶段,要调用(如手机中的surfaceflinger调用)GPU完成其他效果的合成。
针对这种情况,在一些实施例中,在监听到存在圆角小窗的情况下,还可以进一步检测(如通过surfaceflinger)是否要采用GPU合成其他效果。如果检测到不用GPU合成其他效果,表明在合成阶段,主要调用GPU合成圆角效果,则可以采用挖洞的方式实现圆角效果,如执行上述S1006-S1008,且在S1007中无需调用GPU,而可以仅调用HWC完成图层叠加即可。这样,针对无需GPU合成其他效果的场景,采用挖洞的方式实现圆角效果,从而可以在合成阶段,完全不调用GPU执行合成处理,明显降低GPU的负载。
另外,如果检测到要GPU合成其他效果,则表明在合成阶段,不仅要调用GPU合成圆角效果,还要调用GPU合成其他效果,针对这种情况,即使采用挖洞的方式实现圆角效果,在合成阶段依然还要调用GPU合成其他效果,降低GPU负载的效果并不明显,可以仍然采用GPU合成的方式实现圆角效果,如执行上述S1003-S1005,并在S1004中调用GPU合成其他效果。
关于本实施例中采用挖洞或者GPU合成的方式实现圆角效果的具体实现,可以参见图11中的相关介绍,此处不再赘述。例如,采用挖洞的方式实现圆角效果,则通过图11中的S813-S827来实现,采用GPU合成的方式实现圆角效果,则通过图11中的S1102-S1115来实现。
实际实施时,上述情况2中的实施例也可以结合。示例性的,也可以在监听到存在圆角窗口,且圆角窗口保持不变的持续时长超过时长1,且不用GPU合成其他效果的情况下,采用挖洞的方式实现圆角效果。
情况3,关闭圆角窗口。
响应于事件3,可以关闭圆角窗口。其中,事件3用于触发关闭圆角窗口。其中,事件3可以是用户对圆角窗口中关闭控件的触发操作事件,或者,事件3可以是用户将圆角窗口拖到显示屏边缘的操作事件,或者,事件3可以是退出圆角窗口的操作事件等,本申请对此不作具体限定。
以事件3是用户对圆角窗口中关闭控件的触发操作事件,并且关闭控件是图12所示界面1201中视频小窗12011中的“×”12012为例,响应于用户对“×”12012的点击操作,可以关闭视频小窗12011并显示图12所示的界面1202。界面1202中不再包括视频小窗12011。
在关闭圆角窗口后,则图像处理的过程不包括实现圆角效果。参见图13,图像处理的过程包括:
S1301、在接收到事件3之后,在一个图像帧的处理过程中,监听到不存在圆角窗口。
需要说明的是,从开机后就一直在监听,针对每一个图像帧都可以监听得到存在或者不存在圆角窗口的结果。其中,在接收到事件3之后,会关闭圆角窗口,则后续会监听到不存在圆角窗口。
S1302、绘制/刷新多个图层。
例如,在图4所示的场景中,当关闭视频小窗图层之后,可以在桌面图层中绘制桌面图标,在壁纸图层中绘制壁纸,而无需进一步刷新视频小窗图层的图层内容。
S1303、合成多个图层,得到图像帧,图像帧中不具有圆角效果。
针对不存在圆角窗口的情况,则可以按照常规的图像处理流程,即常规的绘制和渲染完成图像处理,如在S1302中可以不绘制透明的圆角矩形区域,在S1303中可以不合成圆角。
S1304、显示图像帧。
下面结合手机的软硬件结构,并以图12所示的场景为例,即圆角图层为视频小窗图层,其他图层为桌面图层和壁纸图层,进一步介绍情况3中的图像处理流程。
具体的,如图14所示,图像处理的过程包括:
S1401、视频播放器响应于事件3,向WMS发送视频小窗图层的销毁请求。
S1402、WMS销毁视频小窗图层。
例如,WMS可以通过释放视频小窗图层的地址,实现销毁视频小窗图层。
应注意,WMS通过销毁视频小窗图层,可以同步销毁掉surfaceflinger中的视频小窗图层。这样,surfaceflinger则可以监听到如下S1403的结果。
S1403、surfaceflinger监听到不存在圆角窗口。
在销毁视频小窗图层之后,在再次启动视频小窗(也可以是其他圆角窗口)之前,surfaceflinger都可以监听到不存在圆角窗口。
S1404、surfaceflinger检测是否开启挖洞。若是,则执行S1405-S1407;若否,则不执行S1405-S1407。
示例性的,surfaceflinger可以查询开关状态,如果是开启开关的,则表明已开启挖洞,如果是关闭开关的,则表明未开启挖洞。
如果开启挖洞,则需要关闭挖洞,surfaceflinger可以执行下述S1405-S1407,以实现关闭挖洞。
如果未开启挖洞,则无需执行关闭挖洞处理,surfaceflinger可以不执行下述S1405-S1407。
S1405、surfaceflinger生成通知消息2,通知消息2包括指示信息3。
其中,指示信息3用于指示不挖洞,即关闭通过绘制透明的圆角矩形区域实现圆角效果。
S1406、surfaceflinger基于桌面图层的图层属性中的回调函数,向libhwui 1分发通知消息2。
S1407、surfaceflinger基于壁纸图层的图层属性中的回调函数,向libhwui 2分发通知消息2。
S1408、桌面应用向libhwui1发送待绘制的内容5。
S1409、libhwui 1在桌面图层中绘制内容5,根据通知消息2不在桌面图层中绘制圆角矩形区域。
应注意,对于S1404中检测为若否的情况,surfaceflinger虽然未通过S1405生成通知消息2并通过S1406向libhwui 1发送通知消息2,但是libhwui 1中保存有通知消息2,libhwui 1可以根据保存的通知消息2不绘制圆角矩形区域。
示例性的,在关闭圆角窗口前,surfaceflinger检测到圆角窗口保持不变的连续时长未达到时长1,则可以开启挖洞,如开启开关,并生成通知消息2发送给libhwui1。libhwui 1可以保存该通知消息2,并在后续接收到通知1之前,一直基于保存的通知消息2不绘制圆角矩形区域。
S1410、libhwui 1在绘制完成后,反馈指示信息4。
S1411、壁纸应用向libhwui2发送待绘制的内容6。
S1412、libhwui 2在壁纸图层中绘制内容6,根据通知消息2不在壁纸图层中绘制圆角矩形区域。
同理,对于S1404中检测为若否的情况,surfaceflinger虽然未通过S1405生成通知消息2并通过S1407向libhwui 2发送通知消息2,但是libhwui 2中保存有通知消息2,libhwui 2可以根据保存的通知消息2不绘制圆角矩形区域。
S1413、libhwui 2在绘制完成后,反馈指示信息4。
采用上述S1403-S1413,在关闭圆角窗口之后,libhwui也可以基于通知消息2不绘制圆角矩形区域,并向surfaceflinger反馈指示信息4。
上述S1405-S1413的原理与具体实现,与前文S1102-S1110类似,具体可参见S1102-S1110的说明,此处不再赘述。
S1414、surfaceflinger在接收到桌面图层和壁纸图层的指示信息4后,获取桌面图层、壁纸图层和视频小窗图层的叠加顺序,其中,视频小窗图层位于最上层。
采用GPU合成的方式,则视频小窗图层应叠加在最上层,以保证视频小窗可见。相应的,surfaceflinger在确定出叠加顺序之后,可以不将视频小窗图层调整到最底层。
在一种具体的实现方式中,在S1404中检测到开启挖洞的情况下,surfaceflinger 可以关闭开关。后续surfaceflinger可以通过查询开关状态,决策是否取消圆角合成和调整叠加顺序。其中,surfaceflinger查询到开关状态为关闭开关,决策不取消圆角合成、不调整叠加顺序。
另外,由于监听到不存在圆角窗口,表明根本不会调用GPU合成圆角,则surfaceflinger在接收到未挖洞的指示信息4之后,可以不取消圆角合成。以及,由于已经销毁视频小窗图层了,surfaceflinger也无需刷新视频小窗图层中的视频内容。
S1415、surfaceflinger按照叠加顺序合成桌面图层和壁纸图层,得到图像帧,图像帧中不包括视频小窗。
由于不存在圆角小窗,如视频小窗,在合成阶段,surfaceflinger不会调用GPU完成圆角合成。
S1416、surfaceflinger向显示屏发送图像帧。
S1417、显示屏显示图像帧。
上述图13和图14的实施例,说明了接收到事件3之后一个图像帧的处理过程。实际中,在关闭圆角窗口之后,到再次启动圆角窗口之前,每一个图像帧的处理都可以按照类似的方式处理,从而可以在每一个图像帧的处理过程中,不绘制透明的圆角矩形区域,也不改变图层之间的叠加顺序。
在一种具体的实现方式中,在图14所示的流程中,可以循环执行S1403-S1417,从而可以在每一个图像帧中,在监听到不存在圆角窗口的情况下,不绘制透明的圆角矩形区域,也不改变图层之间的叠加顺序。并且,在S1403监听到不存在圆角矩形区域,且S1404检测到未开启挖洞的情况下,可以省略S1405-S1407,无需重复生成并分发通知消息2。这样,也可以减少surfaceflinger和libhwui之前的通信。
至此,需要说明的是,在前文关于情况2和情况3的说明中,都以libhwui执行绘制操作来说明。实际中,有一些图层可能是通过其他模块,如surfaceview实现绘制的,针对这种情况,在创建这些图层之后,也需要通过其他模块向surfaceflinger注册监听回调,建立其他模块与surfaceflinger之间的通路。后续,通过该通路实现上述通知1、通知2的传递,以控制其他模块挖洞,以及通过该通路反馈,其他模块可以向surfaceflinger反馈是否完成挖洞的指示。此处不再赘述。
本申请实施例还提供一种电子设备,该电子设备可以包括:存储器和一个或多个处理器(如CPU、GPU、NPU等)。存储器和处理器耦合。该存储器用于存储计算机程序代码,该计算机程序代码包括计算机指令。当处理器执行计算机指令时,电子设备可执行上述方法实施例中设备执行的各个功能或者步骤。
本申请实施例还提供一种芯片系统,该芯片系统包括至少一个处理器和至少一个接口电路。处理器和接口电路可通过线路互联。例如,接口电路可用于从其它装置(例如电子设备的存储器)接收信号。又例如,接口电路可用于向其它装置(例如处理器)发送信号。示例性的,接口电路可读取存储器中存储的指令,并将该指令发送给处理器。当所述指令被处理器执行时,可使得电子设备执行上述实施例中的各个步骤。当然,该芯片系统还可以包含其他分立器件,本申请实施例对此不作具体限定。
本实施例还提供一种计算机存储介质,该计算机存储介质中存储有计算机指令,当该计算机指令在电子设备上运行时,使得电子设备执行上述相关方法步骤实现上述实施例中的图像处理方法。
本实施例还提供了一种计算机程序产品,当该计算机程序产品在计算机上运行时,使得计算机执行上述相关步骤,以实现上述实施例中的图像处理方法。
另外,本申请的实施例还提供一种装置,这个装置具体可以是芯片,组件或模块,该装置可包括相连的处理器和存储器;其中,存储器用于存储计算机执行指令,当装置运行时,处理器可执行存储器存储的计算机执行指令,以使芯片执行上述各方法实施例中的图像处理方法。
其中,本实施例提供的电子设备、计算机存储介质、计算机程序产品或芯片均用于执行上文所提供的对应的方法,因此,其所能达到的有益效果可参考上文所提供的对应的方法中的有益效果,此处不再赘述。
通过以上的实施方式的描述,所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将装置的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。
在本申请所提供的几个实施例中,应该理解到,所揭露的装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,该模块或单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个装置,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。
该作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是一个物理单元或多个物理单元,即可以位于一个地方,或者也可以分布到多个不同地方。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。
该集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个可读取存储介质中。基于这样的理解,本申请实施例的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该软件产品存储在一个存储介质中,包括若干指令用以使得一个设备(可以是单片机,芯片等)或处理器(processor)执行本申请各个实施例方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(Read-Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。
最后应说明的是,以上实施例仅用以说明本申请的技术方案而非限制,尽管参照较佳实施例对本申请进行了详细说明,本领域的普通技术人员应当理解,可以对本申请的技术方案进行修改或等同替换,而不脱离本申请技术方案的精神和范围。
Claims (17)
- 一种图像处理方法,其特征在于,应用于电子设备,所述方法包括:接收启动第一窗口的事件,所述第一窗口为非全屏的圆角窗口;在接收到启动所述第一窗口的事件之后,显示第一图像;其中,所述第一图像包括第一图层和第二图层,所述第二图层叠加在所述第一图层的上层,所述第一图层中绘制有所述第一窗口的第一待显示内容,所述第二图层中绘制有所述第一窗口之外的其他区域的第二待显示内容和透明圆角矩形区域,所述透明圆角矩形区域的位置与所述第一窗口的显示区域的位置相同。
- 根据权利要求1所述的方法,其特征在于,在所述显示第一图像之前,所述方法还包括:生成所述第一图像;其中,生成所述第一图像的过程中,不合成所述第一窗口的圆角效果。
- 根据权利要求2所述的方法,其特征在于,所述生成所述第一图像的过程中,不合成所述第一窗口的圆角效果,包括:若所述第一窗口在所述电子设备的显示屏中的显示区域保持不变的连续时长达到第一时长,在生成所述第一图像的过程中,则不合成所述第一窗口的圆角效果。
- 根据权利要求2或3所述的方法,其特征在于,在所述显示第一图像之前或者之后,所述方法还包括:生成第二图像,显示所述第二图像,所述第二图像包括所述第一窗口;其中,生成所述第二图像的过程中,合成所述第一窗口的圆角效果。
- 根据权利要求4所述的方法,其特征在于,所述第二图像包括第三图层和第四图层,所述第四图层叠加在所述第三图层的下层,所述第三图层中绘制有所述第一窗口的第三待显示内容,所述第四图层中绘制有所述第一窗口之外的其他区域的第四待显示内容。
- 根据权利要求4或5所述的方法,其特征在于,所述生成所述第二图像的过程中,合成所述第一窗口的圆角效果,包括:若所述第一窗口在所述电子设备的显示屏中的显示区域保持不变的连续时长未达到所述第一时长,生成所述第二图像的过程中,合成所述第一窗口的圆角效果。
- 根据权利要求2-6中任一项所述的方法,其特征在于,所述生成所述第一图像,包括:在所述第一图层中绘制或者刷新所述第一待显示内容;在所述第二图层中绘制所述第二待显示内容,以及基于所述第一图层的图层属性在所述第二图层绘制所述透明圆角矩形区域,使得所述透明圆角矩形区域的位置与所述第一窗口的显示区域的位置相同;将所述第二图层叠加在所述第一图层的上层,生成所述第一图像。
- 根据权利要求7所述的方法,其特征在于,所述图层属性包括所述第一图层的位置、大小和第一窗口的圆角半径。
- 根据权利要求7或8所述的方法,其特征在于,在所述第二图层中绘制所述透明圆角矩形区域,包括:若存在第一指示信息,在所述第二图层中绘制所述透明圆角矩形区域,所述第一指示信息指示绘制所述透明圆角矩形区域。
- 根据权利要求9所述的方法,其特征在于,所述方法还包括:在接收到启动所述第一窗口的事件之后,生成所述第一指示信息;或者,在接收到启动所述第一窗口的事件,且所述第一窗口在所述电子设备的显示屏中的显示区域保持不变的连续时长达到第一时长后,生成所述第一指示信息。
- 根据权利要求7-10中任一项所述的方法,其特征在于,在所述将所述第二图层叠加在所述第一图层的上层,生成所述第一图像之前,所述方法还包括:取消合成所述第一窗口的圆角效果,使得在生成所述第一图像的过程中,不合成所述第一窗口的圆角效果。
- 根据权利要求7-11中任一项所述的方法,其特征在于,在所述将所述第二图层叠加在所述第一图层的上层之前,所述方法还包括:获取第一叠加顺序,在所述第一叠加顺序中,所述第一图层位于所述第二图层上层;调整所述第一叠加顺序,得到第二叠加顺序,在所述第二叠加顺序中,所述第二图层位于所述第一图层上层;所述将所述第二图层叠加在所述第一图层的上层,包括:基于所述第二叠加顺序,将所述第二图层叠加在所述第一图层的上层。
- 根据权利要求2-12中任一项所述的方法,其特征在于,所述电子设备包括图像合成器、绘制模块、硬件合成器HWC和图像处理器GPU;在接收到启动所述第一窗口的事件之后,所述方法还包括:所述图像合成器监听到存在圆角窗口,向所述绘制模块发送第一通知消息,所述第一通知消息包括第一指示信息和所述第一图层的图层属性;所述生成所述第一图像,包括:所述绘制模块在所述第二图层绘制所述第二待显示内容;所述绘制模块基于所述第一通知消息在所述第二图层绘制所述透明圆角矩形区域;在绘制完所述透明圆角矩形区域之后,所述绘制模块向所述图像合成器发送第二指示信息;在接收到所述第二指示信息之后,所述图像合成器不调用所述GPU合成所述圆角效果,调用所述HWC将所述第二图层叠加在所述第一图层的上层,生成所述第一图像;其中,所述第一图层中的所述第一待显示内容由所述绘制模块绘制得到,或者由所述图像合成器刷新得到。
- 根据权利要求13所述的方法,其特征在于,所述图像合成器监听到存在圆角窗口,向所述绘制模块发送第一通知消息,包括:所述图像合成器监听到存在所述圆角窗口,且所述第一窗口在所述电子设备的显示屏中的显示区域保持不变的连续时长达到第一时长后,向所述绘制模块发送第一通知消息。
- 一种电子设备,其特征在于,包括:显示屏,一个或多个处理器,以及一个或多个存储器;所述一个或多个处理器与所述显示屏,以及所述一个或多个存储器耦合;所述一个或多个存储器用于存储计算机程序代码,所述计算机程序代码包括计算机指令,当所述一个或多个处理器执行所述计算机指令时,使得所述电子设备执行如权利要求1-14中任一项所述的方法。
- 一种计算机可读存储介质,其上存储有计算机指令,其特征在于,当所述计算机指令在电子设备上运行时,使得所述电子设备执行如权利要求1-14中任一项所述的方法。
- 一种计算机程序产品,包括计算机指令,其特征在于,当计算机程序产品在计算机上运行时,使得计算机执行如权利要求1-14中任一项所述的方法。
Priority Applications (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| PCT/CN2024/100737 WO2025260366A1 (zh) | 2024-06-21 | 2024-06-21 | 一种图像处理方法及电子设备 |
| CN202480040969.3A CN121605380A (zh) | 2024-06-21 | 2024-06-21 | 一种图像处理方法及电子设备 |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| PCT/CN2024/100737 WO2025260366A1 (zh) | 2024-06-21 | 2024-06-21 | 一种图像处理方法及电子设备 |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2025260366A1 true WO2025260366A1 (zh) | 2025-12-26 |
Family
ID=98212207
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2024/100737 Pending WO2025260366A1 (zh) | 2024-06-21 | 2024-06-21 | 一种图像处理方法及电子设备 |
Country Status (2)
| Country | Link |
|---|---|
| CN (1) | CN121605380A (zh) |
| WO (1) | WO2025260366A1 (zh) |
Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN110377264A (zh) * | 2019-07-17 | 2019-10-25 | Oppo广东移动通信有限公司 | 图层合成方法、装置、电子设备及存储介质 |
| CN112328130A (zh) * | 2020-09-04 | 2021-02-05 | 华为技术有限公司 | 显示处理方法及电子设备 |
| CN116400917A (zh) * | 2023-03-20 | 2023-07-07 | 惠州市德赛西威汽车电子股份有限公司 | 显示屏圆角显示方法、装置、设备、汽车智能座舱及车辆 |
| WO2023174322A1 (zh) * | 2022-03-17 | 2023-09-21 | 华为技术有限公司 | 图层处理方法和电子设备 |
| WO2023236801A1 (zh) * | 2022-06-07 | 2023-12-14 | 华为技术有限公司 | 识别图形码的方法及电子设备 |
-
2024
- 2024-06-21 CN CN202480040969.3A patent/CN121605380A/zh active Pending
- 2024-06-21 WO PCT/CN2024/100737 patent/WO2025260366A1/zh active Pending
Patent Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN110377264A (zh) * | 2019-07-17 | 2019-10-25 | Oppo广东移动通信有限公司 | 图层合成方法、装置、电子设备及存储介质 |
| CN112328130A (zh) * | 2020-09-04 | 2021-02-05 | 华为技术有限公司 | 显示处理方法及电子设备 |
| WO2023174322A1 (zh) * | 2022-03-17 | 2023-09-21 | 华为技术有限公司 | 图层处理方法和电子设备 |
| WO2023236801A1 (zh) * | 2022-06-07 | 2023-12-14 | 华为技术有限公司 | 识别图形码的方法及电子设备 |
| CN116400917A (zh) * | 2023-03-20 | 2023-07-07 | 惠州市德赛西威汽车电子股份有限公司 | 显示屏圆角显示方法、装置、设备、汽车智能座舱及车辆 |
Also Published As
| Publication number | Publication date |
|---|---|
| CN121605380A (zh) | 2026-03-03 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN113741840B (zh) | 多窗口投屏场景下的应用界面显示方法及电子设备 | |
| US12216881B2 (en) | Method for displaying application icon and electronic device | |
| EP4336950A1 (en) | Multi-device cooperation method, electronic device and related product | |
| CN112181572B (zh) | 互动特效展示方法、装置、终端及存储介质 | |
| WO2024041047A1 (zh) | 一种屏幕刷新率切换方法及电子设备 | |
| CN111611031A (zh) | 一种图形绘制方法和电子设备 | |
| CN110083282A (zh) | 基于信息展示页面的人机交互方法、装置、终端及介质 | |
| CN106575138A (zh) | 提供用户界面的电子设备和方法 | |
| KR20120045304A (ko) | 이동 단말기 및 그 제어 방법 | |
| CN111368114B (zh) | 信息展示方法、装置、设备及存储介质 | |
| CN108762881B (zh) | 界面绘制方法、装置、终端及存储介质 | |
| WO2022088884A1 (zh) | 页面展示方法和终端 | |
| WO2021129254A1 (zh) | 控制屏幕显示的方法和电子设备 | |
| CN112004134B (zh) | 多媒体数据的展示方法、装置、设备及存储介质 | |
| WO2023050737A1 (zh) | 基于直播间的资源展示方法及终端 | |
| WO2025194878A9 (zh) | 显示方法、图形界面及相关装置 | |
| CN111045562B (zh) | 界面显示方法、装置、设备及可读存储介质 | |
| CN110738972A (zh) | 用于墨水屏的页面刷新方法及装置 | |
| CN116033219A (zh) | 基于图片的视频播放方法、装置、电子设备及存储介质 | |
| CN112068887B (zh) | 对应用进行加速处理的方法和装置 | |
| US20250208743A1 (en) | Embedded window display method and apparatus, electronic device, and readable storage medium | |
| CN114816143A (zh) | 一种应用切换方法、电子设备及存储介质 | |
| CN111523876A (zh) | 支付方式的显示方法、装置、系统及存储介质 | |
| CN121605380A (zh) | 一种图像处理方法及电子设备 | |
| CN118279965A (zh) | 基于人眼检测的控制方法及电子设备 |
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: 24945111 Country of ref document: EP Kind code of ref document: A1 |