Interface display method and related apparatus
By screenshotting and blurring the content of the electronic device interface, dynamic changes in the background blur effect are achieved, and the problem that background blur cannot change with the content in the existing technology is solved, which improves the user experience and interface beauty, and saves resources.
Patent Information
- Application Number
- PCT/CN2024/080649
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-05-23
- Filing Date
- 2024-03-07
- Publication Date
- 2024-11-28
AI Technical Summary
When existing electronic devices achieve blurred interface background, the blurred background cannot change dynamically with the changes in interface content, resulting in poor user experience.
By screenshotting the interface content in the same application and blurring the screenshots, generating blurred screenshots and rendering them, dynamic changes in the background blur effect are achieved.
Improves user experience, increases interface beauty, and saves computing power and power consumption.
Smart Images

Figure CN2024080649_28112024_PF_FP_ABST
Abstract
Description
Interface display method and related device
[0001] This application claims priority to the Chinese patent application filed with the State Intellectual Property Office of China on May 23, 2023, with application number 202310589820.8 and application name “Interface Display Method and Related Devices”, the entire contents of which are incorporated by reference into this application. Technical Field
[0002] The present application relates to the field of terminal technology, and in particular to an interface display method and related devices. Background Art
[0003] Current electronic devices can implement background blurring in their interfaces. Background blurring can enhance the quality of the display interface and highlight the aesthetic design of the interface.
[0004] In some implementations, when a certain area of an application needs to have its background blurred, the application may pre-provide a blurred image as the blurred background image of the area. However, the implementation of the above background blurring makes the blurred background of the area appear relatively monotonous, resulting in a poor user experience.
[0005] Summary of the Invention
[0006] The interface display method and related devices provided in the embodiments of the present application enable an electronic device to take a screenshot of the content of the application interface in the same application, and blur the screenshot to obtain a blurred screenshot. The electronic device can then render the blurred screenshot onto the layer corresponding to the application, thereby presenting a background blur effect in the application interface.
[0007] In a first aspect, an interface display method provided by an embodiment of the present application includes:
[0008] At a first moment, a first blurred object is displayed in a target application. The first blurred object is obtained by adding a first blurred background to the target object. The first blurred object is located at a first position. The first blurred background includes a blurred background obtained by blurring the content of a first area in the target application's interface, and the first area includes the first position. At a second moment, a second blurred object is displayed in the target application. The second blurred object is obtained by adding a second blurred background to the target object. The second blurred object is located at a second position. The second blurred background includes a blurred background obtained by blurring the content of a second area in the target application's interface, and the second area includes the second position. The content of the first area in the target application's interface is different from the content of the second area in the target application's interface. The second moment is later than the first moment. In this way, the electronic device can make the blurred background in the application change dynamically as the content on the application interface changes, thereby presenting a dynamic background blur effect in the application interface and improving the user experience.
[0009] In one possible implementation, before displaying the second blurred object in the target application, the method may further include: receiving a user trigger operation on the target object; and in response to the trigger operation, moving the target object to the second position. In this way, in a negative-one-screen application scenario, as the target object moves, the blurred background corresponding to the target object can also dynamically change, thereby enhancing the aesthetics of the application interface and improving the user experience.
[0010] In one possible implementation, the target object's position remains unchanged within the target application's interface. Before displaying the second blurred object within the target application, the process may further include: receiving a user trigger operation on an area outside the second area within the target application's interface; and, in response to the trigger operation, changing the content of the target application's interface. In this way, in a photo album application scenario, when the application's interface content changes, the blurred background corresponding to the target object can also dynamically change, enriching the application interface and enhancing the user experience.
[0011] In one possible implementation, the target application is configured with blur parameters, which include one or more of the following: blur radius, color value, saturation, frame interval, blur algorithm, and blur mode. When the blur parameters include a blur radius, a smaller blur radius indicates a lighter blur in the first area, while a larger blur radius indicates a heavier blur in the first area. The frame interval indicates the period for calculating the blurred background. The blur mode includes a first mode and a second mode. If the blur mode is the first mode, the first blurred object is obtained by drawing the first blurred background in the first area. Alternatively, if the blur mode is the second mode, the first blurred object is obtained by filling the target object with the first blurred background. This allows for different display effects in the application interface, enriching the display of blurred objects in the application interface.
[0012] In one possible implementation, before displaying the first blurred object in the target application, the following steps may also be performed: the target application passes blur parameters to the View control in the application layer in the first thread; the View control passes the blur parameters to the drawing node in the Native library in the first thread, with the blur parameters in a pending synchronization state; if the blur radius in the blur parameter is greater than zero, the Skia graphics library in the Native library generates a blur filter based on the blur radius in the first thread; otherwise, the blur filter is left blank. In this way, passing application parameters in the main thread eliminates the need to restart other threads, reduces thread startup overhead, and improves the operating efficiency of the electronic device.
[0013] In one possible implementation, before displaying the first blurred object in the target application, the following steps may be performed: synchronizing blur parameters and a blur filter in the properties of a drawing node based on a second thread; if the blur filter is not null, obtaining a screenshot of the target application's canvas in the second thread; determining a pre-blurred background image in the second thread, where the pre-blurred background image is the content in the first area of the canvas screenshot; and the skia graphics library mixing the pre-blurred background image and the blur filter in the second thread to obtain a first blurred background. This allows the blurred background in the application to dynamically change as the content on the application interface changes, enriching the background blur display effect on the electronic device interface.
[0014] In one possible implementation, synchronizing the blur parameters and blur filter in the properties of the drawing node based on the second thread may include: the Skia graphics library calling the syncProperties() function in the second thread to synchronize the blur parameters and blur filter in the properties of the drawing node. In this way, the blur parameters and blur filter in the pending state can be synchronized with the properties of the drawing node, thereby preparing for further background blurring.
[0015] In one possible implementation, obtaining a screenshot of the target application's canvas in the second thread may include: the skia graphics library obtaining a screenshot of the target application's canvas in the second thread based on the properties of the drawing node. In this way, by dynamically obtaining a screenshot of the canvas, the blurred background can be dynamically changed as the content on the application interface changes.
[0016] In one possible implementation, after obtaining the first blurred background, the process may include: caching the first blurred background; and displaying a third blurred object in the target application at a third moment, where the third blurred object is obtained by adding the cached first blurred background to the target object, the third moment being later than the first moment. This reduces the number of canvas screenshots and the number of calculations required to draw node positions, thereby conserving computing power and reducing power consumption.
[0017] In one possible implementation, the first blurred background, blur parameters, and layout of the drawing nodes remain unchanged between the first and third moments. This eliminates the need for the electronic device to capture every frame of the canvas, reducing the blur processing flow and saving computing power.
[0018] In one possible implementation, the number of frames N is a positive integer greater than or equal to 1. After obtaining the first blurred background, the process may include: caching the first blurred background; and at a fourth moment, displaying a fourth blurred object in the target application, where the fourth blurred object is less than or equal to N frames apart from the first blurred object, the fourth blurred object being obtained by adding the cached first blurred background to the target object, and the fourth moment being later than the first moment. In this way, the electronic device can reduce the process of taking screenshots of the canvas and calculating the position information of drawing nodes, thereby saving computing power and reducing power consumption of the electronic device.
[0019] In one possible implementation, the second thread runs in a graphics processing unit (GPU). In this way, the GPU completes the drawing of the blurred background image, which can shorten the interface rendering speed without affecting the performance of the CPU.
[0020] In a second aspect, an embodiment of the present application provides an interface display device, which may be an electronic device or a chip or chip system within an electronic device. The device may include a processing unit and a display unit. The processing unit is configured to implement any processing-related method performed by the electronic device in the first aspect or any possible implementation of the first aspect. The display unit is configured to implement any display-related method performed by the electronic device in the first aspect or any possible implementation of the first aspect. When the device is an electronic device, the processing unit may be a processor. The device may also include a storage unit, which may be a memory. The storage unit is configured to store instructions, and the processing unit executes the instructions stored in the storage unit to cause the electronic device to implement the method described in the first aspect or any possible implementation of the first aspect. When the device is a chip or chip system within an electronic device, the processing unit may be a processor. The processing unit executes the instructions stored in the storage unit to cause the electronic device to implement the method described in the first aspect or any possible implementation of the first aspect. The storage unit may be a storage unit within the chip (e.g., a register, a cache, etc.) or a storage unit within the electronic device located outside the chip (e.g., a read-only memory, a random access memory, etc.).
[0021] Exemplarily, the display unit is used to display a first blurred object in the target application and also to display a second blurred object in the target application; the processing unit is used to blur the content of the first area in the interface of the target application and also to blur the content of the second area in the interface of the target application.
[0022] In a possible implementation, the processing unit is configured to receive a trigger operation on a target object by a user, and further configured to move the target object to a second position in response to the trigger operation.
[0023] In one possible implementation, the processing unit is configured to receive a user trigger operation on an area outside the second area of the target application interface, and to change the content of the target application interface in response to the trigger operation.
[0024] In a possible implementation, the target application is provided with blur parameters, which include one or more of the following parameters: blur radius, color value, saturation, number of frames, blur algorithm, and blur mode.
[0025] In one possible implementation, the processing unit is used to pass the blur parameter to the View view control in the application layer, and is also used to pass the blur parameter to the drawing node in the Native library, and specifically is used to generate a blur filter based on the blur radius.
[0026] In one possible implementation, the processing unit is used to synchronize blur parameters and blur filters in the properties of the drawing node, and is also used to obtain a screenshot of the canvas of the target application, specifically to determine the background image before blurring, and to mix the background image before blurring and the blur filter.
[0027] In a possible implementation, the processing unit is configured to call the syncProperties() function to synchronize the blur parameters and the blur filter in the properties of the drawing node.
[0028] In a possible implementation, the processing unit is configured to obtain a screenshot of the canvas of the target application in the second thread based on the attributes of the drawing node.
[0029] In a possible implementation, the processing unit is configured to cache the first blurred background and to add the first blurred background in the cache to the target object; and the display unit is configured to display the third blurred object in the target application.
[0030] In a possible implementation, between the first moment and the third moment, the first blurred background, the blur parameters, and the layout of the drawing nodes do not change.
[0031] In a possible implementation, the processing unit is configured to cache the first blurred background and to add the first blurred background in the cache to the target object; and the display unit is configured to display the fourth blurred object in the target application.
[0032] In a possible implementation, the second thread runs in a graphics processing unit (GPU).
[0033] In a third aspect, an embodiment of the present application provides a terminal device, comprising a processor and a memory, wherein the memory is used to store code instructions, and the processor is used to run the code instructions to execute the method described in the first aspect or any possible implementation of the first aspect.
[0034] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, in which a computer program or instruction is stored. When the computer program or instruction is run on a computer, the computer executes the method described in the first aspect or any possible implementation of the first aspect.
[0035] In a fifth aspect, an embodiment of the present application provides a computer program product comprising a computer program, which, when the computer program runs on a computer, enables the computer to execute the method described in the first aspect or any possible implementation of the first aspect.
[0036] In a sixth aspect, the present application provides a chip or chip system, comprising at least one processor and a communication interface, wherein the communication interface and the at least one processor are interconnected via a line, and the at least one processor is configured to execute a computer program or instruction to perform the method described in the first aspect or any possible implementation of the first aspect. The communication interface in the chip may be an input / output interface, a pin, or a circuit.
[0037] In one possible implementation, the chip or chip system described above in this application further includes at least one memory, in which instructions are stored. The memory may be a storage unit within the chip, such as a register, a cache, etc., or a storage unit of the chip (e.g., a read-only memory, a random access memory, etc.).
[0038] It should be understood that the second to sixth aspects of the present application correspond to the technical solutions of the first aspect of the present application, and the beneficial effects achieved by each aspect and the corresponding feasible implementation methods are similar and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] FIG1 is a schematic diagram of an interface of a settings application provided in an embodiment of the present application;
[0040] FIG2 is a schematic diagram of an interface display method provided in an embodiment of the present application;
[0041] FIG3 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application;
[0042] FIG4 is a schematic diagram of a software structure of an electronic device provided in an embodiment of the present application;
[0043] FIG5 is a schematic diagram of interaction between modules during an interface display process provided by an embodiment of the present application;
[0044] FIG6 is a schematic diagram of an application passing parameters to a native library according to an embodiment of the present application;
[0045] FIG7 is a schematic diagram of an interface display of a negative one screen application provided in an embodiment of the present application;
[0046] FIG8 is a schematic diagram of an interface display of another negative one screen application provided in an embodiment of the present application;
[0047] FIG9 is a schematic diagram of an interface display of a photo album application provided in an embodiment of the present application;
[0048] FIG10 is a schematic diagram of a process for implementing background blurring according to an embodiment of the present application;
[0049] FIG11 is a schematic diagram of an interface display in a fill fuzzy mode provided by an embodiment of the present application;
[0050] FIG12 is a schematic diagram of a specific interface display method provided in an embodiment of the present application;
[0051] FIG13 is a schematic diagram of the structure of a chip provided in an embodiment of the present application. DETAILED DESCRIPTION
[0052] To facilitate a clear description of the technical solutions of the embodiments of the present application, some of the terms and technologies involved in the embodiments of the present application are briefly introduced below:
[0053] 1. Terminology
[0054] In the embodiments of this application, terms such as "first" and "second" are used to distinguish between identical or similar items with substantially the same functions and effects. For example, the terms "first chip" and "second chip" are used solely to distinguish between different chips and do not define their order. Those skilled in the art will understand that terms such as "first" and "second" do not define the quantity or execution order, and do not necessarily define differences.
[0055] It should be noted that in the embodiments of this application, words such as "exemplary" or "for example" are used to indicate examples, illustrations, or descriptions. Any embodiment or design described in this application as "exemplary" or "for example" should not be construed as being preferred or advantageous over other embodiments or designs. Rather, the use of words such as "exemplary" or "for example" is intended to present the relevant concepts in a concrete manner.
[0056] In the embodiments of the present application, "at least one" refers to one or more, and "more" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: the existence of A alone, the existence of A and B at the same time, and the existence of B alone, where A and B can be singular or plural. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship. "At least one of the following items" or similar expressions refers to any combination of these items, including any combination of single items or plural items. For example, at least one of a, b, or c can represent: a, b, c, ab, a--c, bc, or abc, where a, b, c can be single or multiple.
[0057] Current electronic devices can implement background blurring in their interfaces. Background blurring can enhance the quality of the display interface and highlight the aesthetic design of the interface.
[0058] In some implementations, electronic devices can implement cross-layer background blur processing between different applications. It can be understood that in the embodiments of the present application, each application can correspond to a layer, and different applications can have their own corresponding layers, which can also be called canvases. The cross-layer background blur processing can be understood as the electronic device performing background blur processing on multiple layers.
[0059] As shown in Figure 1, the electronic device displays a settings application interface 101 and a volume application interface 102. When drawing the volume application interface 102, the electronic device can use the layer corresponding to the settings application interface 101 as the background and blur part of the background, so that the background of the volume application interface 102 appears blurred.
[0060] Electronic devices can also implement background blur processing for an application interface. In some implementations, when a certain area of the application needs to have the background blurred, the application can pre-provide a blurred image as the blurred background image of the area, and then the electronic device can render the blurred background image onto the layer corresponding to the application, so that the background of the area appears blurred.
[0061] However, when an electronic device uses a blurred background image to blur the background, since the blurred background image is pre-set, the blurred background of the area cannot change as the content on the application interface changes, making the blurred background display of the area relatively monotonous and the user experience poor.
[0062] In view of this, the interface display method provided in the embodiments of the present application allows an electronic device to take a screenshot of the content of the application interface within the same application, blur the screenshot to obtain a blurred screenshot, and then render the blurred screenshot onto the layer corresponding to the application, thereby presenting a blurred background effect in the application interface. In this way, the blurred background in the application can dynamically change as the content on the application interface changes, thereby improving the user experience.
[0063] For example, as shown in FIG2 , FIG2 a is an unprocessed image in an application. When the application wishes to blur the background of area 201 where the three icons are located in FIG2 a , the electronic device may first take a screenshot of the current layer before rendering the three icons in the layer corresponding to the application. The resulting screenshot is shown in FIG2 b . It is understandable that since the three icons have not yet been rendered on the current layer, the screenshot in FIG2 b does not include the three icons.
[0064] Furthermore, the electronic device can calculate the position of the area 201 where the three icons are located in the screenshot corresponding to b in Figure 2, and blur the area 201 where the three icons are located in the screenshot b in Figure 2 to generate a blurred image of the area corresponding to the area 201 where the three icons are located, and the blurred image of the area is shown in c in Figure 2.
[0065] The electronic device can also combine the screenshot in FIG2 b and the blurred image in FIG2 c to generate a blurred background image as shown in FIG2 d. The electronic device can then render the three icons on top of the blurred background image in FIG2 d to obtain a blurred image as shown in FIG2 e.
[0066] It is understandable that the electronic device of the embodiment of the present application may also be a terminal device in any form. For example, the electronic device may include a handheld device with a display function, a vehicle-mounted device, etc. For example, some electronic devices include: mobile phones, tablet computers, PDAs, laptop computers, mobile internet devices (MIDs), wearable devices, virtual reality (VR) devices, augmented reality (AR) devices, wireless terminals in industrial control, wireless terminals in self-driving cars, wireless terminals in remote medical surgery, wireless terminals in smart grids, wireless terminals in transportation safety, wireless terminals in smart cities, wireless terminals in smart homes, cellular phones, cordless phones, session initiation protocol (SIP) phones, wireless local loop (WLL) stations, personal digital assistants (PDAs), handheld devices with wireless communication capabilities, computing devices or other processing devices connected to wireless modems, in-vehicle devices, wearable devices, electronic devices in 5G networks or future evolved public land mobile communication networks (PLMNs). The electronic devices in the network (PLMN) are not limited to this in the embodiments of the present application.
[0067] As an example and not a limitation, in the embodiments of the present application, the electronic device may also be a wearable device. Wearable devices may also be referred to as wearable smart devices, which are a general term for wearable devices that are intelligently designed and developed using wearable technology for daily wear, such as glasses, gloves, watches, clothing, and shoes. A wearable device is a portable device that is worn directly on the body or integrated into the user's clothes or accessories. Wearable devices are not only hardware devices, but also achieve powerful functions through software support, data interaction, and cloud interaction. Broadly speaking, wearable smart devices include those that are fully functional, large in size, and can achieve complete or partial functions without relying on smartphones, such as smart watches or smart glasses, as well as those that only focus on a certain type of application function and need to be used in conjunction with other devices such as smartphones, such as various smart bracelets and smart jewelry for vital sign monitoring.
[0068] In addition, in the embodiment of the present application, the electronic device can also be an electronic device in the Internet of Things (IoT) system. IoT is an important part of the future development of information technology. Its main technical feature is to connect objects to the network through communication technology, thereby realizing an intelligent network of human-machine interconnection and object-to-object interconnection.
[0069] The electronic devices in the embodiments of the present application may also be referred to as: user equipment (UE), mobile station (MS), mobile terminal (MT), access terminal, user unit, user station, mobile station, mobile station, remote station, remote terminal, mobile device, user terminal, terminal, wireless communication equipment, user agent or user device, etc.
[0070] In the embodiments of the present application, the electronic device or each network device includes a hardware layer, an operating system layer running on the hardware layer, and an application layer running on the operating system layer. The hardware layer includes hardware such as a central processing unit (CPU), a memory management unit (MMU), and memory (also known as main memory). The operating system can be any one or more computer operating systems that implement business processing through processes, such as the Linux operating system, the Unix operating system, the Android operating system, the iOS operating system, or the Windows operating system. The application layer includes applications such as browsers, address books, word processing software, and instant messaging software.
[0071] For example, FIG3 shows a schematic structural diagram of an electronic device.
[0072] The electronic device may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.
[0073] It is understood that the structures illustrated in the embodiments of the present invention do not constitute specific limitations on the electronic device. In other embodiments of the present application, the electronic device may include more or fewer components than shown, or may combine or separate certain components, or arrange the components differently. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0074] The processor 110 may include one or more processing units. For example, the processor 110 may include an application processor (AP), a modem processor, a graphics 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). The different processing units may be independent devices or integrated into one or more processors.
[0075] Processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in processor 110 is a cache memory. This memory can store instructions or data that have just been used or are being recycled by processor 110. If processor 110 needs to use the same instruction or data again, it can directly access the memory. This avoids duplicate accesses, reduces processor 110 latency, and thus improves system efficiency.
[0076] In some embodiments, the processor 110 may include one or more interfaces. The interfaces may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a SIM card interface, and / or a USB interface.
[0077] It is understood that the interface connection relationship between the modules illustrated in the embodiments of the present invention is only a schematic illustration and does not constitute a structural limitation of the electronic device. In other embodiments of the present application, the electronic device may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.
[0078] The internal memory 121 can be used to store computer executable program code, and the executable program code includes instructions. The internal memory 121 may include a program storage area and a data storage area. Among them, the program storage area can store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc. The data storage area can store data created during the use of the electronic device (such as audio data, a phone book, etc.), etc. In addition, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc. The processor 110 executes various functional applications and data processing of the electronic device by running instructions stored in the internal memory 121, and / or instructions stored in a memory provided in the processor. For example, the method of an embodiment of the present application can be executed.
[0079] Display screen 194 is used to display images, videos, and the like. Display screen 194 includes a display panel. In some embodiments, the electronic device may include one or N display screens 194, where N is a positive integer greater than 1. The electronic device implements its display function through a GPU, display screen 194, and an application processor. The GPU is a microprocessor for image processing and connects display screen 194 and the application processor.
[0080] The electronic device implements display functionality through a GPU, display screen 194, and an application processor. The GPU is a microprocessor for image processing that connects the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. For example, in an embodiment of the present application, the GPU can be used to draw a blurred background image. The processor 110 may include one or more GPUs that execute program instructions to generate or change display information. The electronic device can implement a camera function through an ISP, camera 193, a video codec, a GPU, display screen 194, and an application processor.
[0081] Figure 4 is a schematic diagram of the software structure of an electronic device according to an embodiment of the present application. The layered architecture divides the software into several layers, each with clear roles and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into five layers: the application layer, the application framework layer, the Android runtime and system library, the hardware abstraction layer, and the kernel layer.
[0082] The application layer can include a series of application packages. As shown in Figure 2, the application package can include applications such as phone, music, video, game gallery, desktop, and negative one screen. Applications can include system applications and third-party applications.
[0083] The application framework layer provides an application programming interface (API) and programming framework for applications in the application layer. The application framework layer includes some predefined functions.
[0084] As shown in FIG4 , the application framework layer may also be referred to as the framework layer. The framework layer may include a View system, a rendering node object (renderNode), a window manager, a resource manager, a notification manager, and a content provider.
[0085] The view system can be responsible for the application interface drawing and event processing. The interface layout of the application in the electronic device can be implemented by calling the View control in the view system. For example, in the embodiment of the present application, the view system can provide the application with a background blur capability interface, allowing the application to set the blur parameters.
[0086] The drawing node object can be understood as the interface provided by the drawing node in the Native library for upper-layer interaction. The drawing node object can work with the view system to draw the application interface.
[0087] The window manager is used to manage window programs. The window manager can obtain the display size, determine whether there is a status bar, lock the screen, touch the screen, drag the screen, take screenshots, etc.
[0088] The resource manager provides various resources for applications, such as localized strings, icons, images, layout files, video files, and so on.
[0089] The notification manager enables applications to display notification information in the status bar, which can be used to convey informational messages and disappear automatically after a short stay without user interaction.
[0090] Content providers are used to implement data sharing between different applications, allowing one program to access data in another while ensuring the security of the accessed data.
[0091] The Android runtime includes the core library and the virtual machine. The Android runtime is responsible for scheduling and management of the Android system.
[0092] The core library consists of two parts: one is the function that needs to be called by the Java language, and the other is the Android core library.
[0093] The application layer and application framework layer run in a virtual machine. The virtual machine executes the Java files in the application layer and application framework layer as binary files. The virtual machine is used to perform functions such as object lifecycle management, stack management, thread management, security and exception management, and garbage collection. For example, in the embodiments of the present application, the virtual machine can be used to perform functions such as frame image drawing and background blur processing.
[0094] System libraries are also called native libraries. Native libraries can include multiple functional modules, such as graphics processing libraries (e.g., OpenGL ES), media libraries, and function libraries. Native libraries can also include pipelines and render nodes.
[0095] Graphics processing libraries are used to implement 3D graphics drawing, image rendering, compositing, and layer processing. These libraries can include the skia graphics library, which is a low-level graphics library for electronic devices, including graphics, images, animations, and text. When drawing or rendering images, applications call the APIs provided by the skia graphics library. This means that the application interface is displayed using functions provided by the skia graphics library in the electronic device's native library.
[0096] The media library supports playback and recording of a variety of common audio and video formats, as well as static image files. The media library can support a variety of audio and video encoding formats, such as MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.
[0097] The function library provides developers with API interfaces for multiple services, making it easy for developers to quickly integrate and implement various functions.
[0098] The pipeline can be understood as the rendering pipeline during the application interface drawing process. In other words, the application interface drawing and rendering process is performed within the pipeline. Within the pipeline, electronic devices can also call on the OpenGL and OpenGL ES capabilities encapsulated by the Skia graphics library and call the Skia graphics library drawing instructions to draw the application interface.
[0099] A render node (renderNode), also known as a renderer, can be understood as the underlying rendering mechanism used by electronic devices when rendering interfaces. For example, each interface in an application can have its own corresponding render node. The hardware abstraction layer (HAL) is an abstract structure between the kernel layer and the Android runtime. The HAL encapsulates hardware drivers and provides a unified interface for upper-layer applications to call.
[0100] The kernel layer is the layer between hardware and software. The kernel layer may include GPU driver, display driver, camera driver, audio driver, battery driver, Bluetooth driver, CPU driver, USB driver, etc.
[0101] It should be noted that the embodiments of the present application are only illustrated using the Android system as an example. In other operating systems (such as Windows system, IOS system, etc.), as long as the functions implemented by each functional module are similar to those in the embodiments of the present application, the solutions of the present application can also be implemented.
[0102] The following will illustrate the interaction process between the modules in conjunction with the interface display process of the electronic device.
[0103] As shown in Figure 5, the electronic device can draw the interface for the application based on the application's layout file. In the application layer, when an area of the application interface needs to be displayed with background blurred, the application can generate blur parameters for the area and pass the blur parameters to the background blur capability interface provided by the View view system of the electronic device's Framework layer. For example, the background blur capability interface may include a setBlurParameters() function.
[0104] The above-mentioned blur parameters may include at least one of the following: blur radius, color value, saturation, number of frames, blur algorithm or blur mode, etc.
[0105] The blur radius can be a parameter that determines the blur level of the blurred area. The blur radius includes the horizontal blurRadiusX blur radius and the vertical blurRadiusY blur radius. As you can see, a smaller blur radius results in less blur and a clearer background; a larger blur radius results in greater blur and a less clear background.
[0106] In a possible implementation, the electronic device can use a blur algorithm to take pixels with a blur radius around it. Taking a certain pixel in the blurred area as an example, the electronic device can take the pixel as the center and take the pixel with a horizontal blur radius of blurRadiusX and a vertical blurRadiusY radius. For example, the blur radius blurRadiusX and blurRadiusY are respectively 1, which can mean that the electronic device takes a pixel in the upper, lower, left, and right directions of the pixel to blur, or it can be a rectangular area formed by extending one pixel in the upper, lower, left, and right directions of the pixel. The specific implementation may be related to the blur algorithm, and the embodiments of the present application are not limited thereto.
[0107] Color values, also known as hue values, can be used to set the brightness of an app's interface, increasing or decreasing the brightening effect. For example, a color value could be the color overlaid on blurred content to adjust the display.
[0108] Saturation can be used to set the vividness of the colors in the application interface. For example, a higher saturation makes the colors in the application interface more vivid; a lower saturation makes the colors in the application interface closer to gray.
[0109] The frame interval can be used to indicate the period for performing the background blur calculation.
[0110] Blur algorithms may include Gaussian blur, Kawase blur, Box Blur, and other algorithms.
[0111] The blur mode may include a full blur mode and a fill blur mode.
[0112] In addition, after the application layout file is parsed by the framework layer's View system, it can generate the corresponding View tree information for the layout file. This View tree can represent the application interface layout. This View tree information can include information such as the length, width, and position of each control in the application interface, as well as information such as icons and text in the interface.
[0113] In the Framework layer, each View control in the View system has a corresponding renderNode object, which can be used to interact with the renderNode object in the Native library. When the background blur capability interface receives blur parameters from the application, the renderNode object can pass these blur parameters to the renderNode object in the Native library through the Java Native Interface (JNI).
[0114] The Native library can include modules that implement rendering. For example, background blur processing can be implemented in the Native library. It is understood that the rendering node (renderNode) in the Native library can have a corresponding displaylist of rendering instructions, which can be processed in the Pipeline pipeline.
[0115] Electronic devices can call OpenGL's capabilities through the skia graphics library to draw the application interface and blur the background. They can also convert the drawing instruction set displaylist in the drawing node renderNode into drawing rendering instructions that can be called by the GPU driver in the hardware driver layer. The GPU driver completes the drawing of the blurred background image, and then displays the application interface in the electronic device through the Display display driver.
[0116] Figure 6 shows a schematic diagram of an application transferring parameters to a native library of an electronic device. It is understandable that the parameter transfer process shown in Figure 6 can be executed in the main thread of the electronic device.
[0117] As shown in Figure 6, the application can generate blur parameters for the blurred area and call the relevant capability interface to set these blur parameters to the View control in the Framework layer. The View control can pass the blur parameters set by the application to the corresponding renderNode in the Native library through JNI. The renderNode can then store the blur parameters. It is understood that the blur parameters are in a state of pending synchronization at this time.
[0118] The skia graphics library in the Native library can generate a blur filter. In a possible implementation, when the blur radius in the blur parameter is greater than zero, the skia graphics library can generate a blur filter based on the blur radius; when the blur radius in the blur parameter is less than or equal to zero, the skia graphics library can set the blur filter to empty.
[0119] FIG7 shows a scenario in which the interface display method according to an embodiment of the present application is applied to a negative one screen application of an electronic device.
[0120] The negative one screen application interface 701 may include a card 702, which may be a card whose background needs to be blurred. In response to the user triggering the operation of moving the card 702, the electronic device may make the card 702 in a movable state in the negative one screen application interface 701, and may move it in the direction indicated by the user. For example, the user may long press the card 702 to put it in a movable state, and then the user may move the card 702 in the negative one screen application interface 701. The embodiment of the present application does not limit the operation of the user triggering the movement of the card 702.
[0121] As shown in FIG8 , in the negative-one-screen application interface 801, the electronic device can respond to the user triggering the operation of moving card 802, and card 802 can be moved to the position shown in FIG8 a. At this time, the interface background of card 802 can blur the interface of card 5. The electronic device can respond again to the user triggering the operation of moving card 802, and card 802 can be moved to the position shown in FIG8 b. At this time, the interface background of card 802 can blur the interface of card 6, card 8, and card 9.
[0122] That is to say, when card 802 moves in the negative one-screen application interface 801, the electronic device can use the content displayed in the negative one-screen application interface 801 as the background of card 802, and blur the position of card 802 in the background of card 802, thereby achieving dynamic background blur of card 802.
[0123] It can be understood that the interface display method of the embodiment of the present application can also be applied to scenarios where other application interfaces require dynamic background blur, such as album application interface, lock screen interface, etc. The specific application scenarios are not limited by the embodiment of the present application.
[0124] As shown in Figure 9, taking the photo album application as an example, in the photo album application interface 901 shown in Figure 9a, the areas where the title bar 902 and navigation bar 903 are located can each be areas where the background needs to be blurred. For example, the background of the area where the navigation bar 903 is located can be blurred to display pictures 16, 17, and 18. In response to the user triggering an operation to slide the photo album application interface 901, the electronic device can cause the pictures in the photo album application interface 901 to slide up or down.
[0125] Taking the upward sliding scenario as an example, in response to the user triggering the sliding operation of the album application interface 901, the electronic device can slide the pictures in the album application interface 901 upward. At this time, as shown in FIG9 b, the background of the area where the title bar 902 is located can blur pictures 1, 2, and 3, and the background of the area where the navigation bar 903 is located can blur pictures 19, 20, and 21.
[0126] That is to say, when the pictures in the album application interface 901 are slid, the electronic device can use the content of the album application interface 901 as the background of the title bar 902 and the background of the navigation bar 903, and blur the area where the title bar 902 is located in the background of the title bar 902, and blur the area where the navigation bar 903 is located in the background of the navigation bar 903, thereby achieving dynamic background blur of the title bar 902 and the navigation bar 903.
[0127] FIG10 shows a schematic diagram of a process for implementing background blurring.
[0128] S1001: Start drawing a frame.
[0129] S1002. Synchronously draw the renderNode attributes of the node.
[0130] During each frame's rendering process, the electronic device first synchronizes the properties of each renderNode. The blur parameters set by the application and the blur filter generated in the embodiment corresponding to FIG6 can be synchronized to the renderNode. In a possible implementation, the electronic device can synchronize the blur parameters and blur filter in the renderNode's properties using the syncProperties() function.
[0131] S1003, RootRenderNode node drawing.
[0132] The RootRenderNode node can be understood as the root node of all rendering nodes RenderNode. When rendering a frame of an image, execution can start from the RootRenderNode node.
[0133] S1004: Start drawing the rendering node renderNode.
[0134] The electronic device can create a canvas Canvas by calling an interface provided by the rendering node renderNode and draw on the canvas Canvas. In a possible implementation, the electronic device can create the canvas Canvas by calling a function start() provided by the rendering node renderNode.
[0135] S1005: Is the background blurred?
[0136] When an electronic device draws on a canvas, when executing each renderNode, it may prioritize determining whether the renderNode requires background blur. In a possible implementation, the electronic device may determine whether the blur filter in the renderNode's properties is null and / or whether the blur radius is greater than zero.
[0137] If the blur filter Filter in the renderNode attribute is not empty and / or the blur radius is greater than zero, it indicates that background blur drawing is required, and the electronic device may execute step S1006 to take a screenshot of the canvas Canvas.
[0138] If the blur filter Filter in the rendering node renderNode attribute is empty, or the blur radius is less than or equal to zero, it means that background blur drawing is not required, and the electronic device can execute step S1010 to draw the current rendering node renderNode.
[0139] S1006: Get a screenshot of the canvas at this time.
[0140] If the rendering node renderNode needs to perform background blur, the electronic device can obtain a snapshot of the current canvas Canvas. Since the rendering process is performed in the depth-first traversal order of the node tree of the rendering node renderNode, the background nodes of the current rendering node renderNode have already been drawn on the canvas Canvas.
[0141] In one possible implementation, the electronic device can calculate the location of the blurred area on the canvas based on the properties of the renderNode. The device can then take a screenshot of the canvas to obtain a partial screenshot of the canvas. The size of the partial screenshot can be the size of the blurred area set by the application. This partial screenshot can be understood as the background image before blurring. Taking a partial screenshot of the canvas can reduce memory usage, thereby conserving memory on the electronic device.
[0142] In another possible implementation, the electronic device can also take a screenshot of the entire canvas Canvas. The specific way in which the electronic device obtains the screenshot is not limited in this embodiment of the application.
[0143] It can be understood that the above-mentioned screenshot function can be implemented by calling the screenshot capability of the skia graphics library. The embodiment of the present application can add corresponding screenshot drawing instructions to the implementation process of background blur.
[0144] S1007: Calculate the position information of the rendering node renderNode.
[0145] In the above step S1006, if the electronic device takes a screenshot of the entire canvas Canvas, the electronic device also needs to calculate the position of the blurred area in the screenshot according to the properties of the rendering node renderNode. The position of the blurred area in the screenshot can be understood as the background image Image before blurring.
[0146] S1008: Obtain the blurred background image.
[0147] The electronic device can mix the blur filter Filter obtained in the embodiment corresponding to FIG. 6 with the background image Image obtained in step S1006 to generate a blurred background image. In a possible implementation, the electronic device can mix the blur filter Filter and the background image Image using the skia graphics library's ability to call OpenGL.
[0148] S1009, blur the background drawing.
[0149] During the blurred background rendering process, the electronic device can convert the blurring operation's related drawing instructions into drawing and rendering instructions that can be called by the GPU driver, which then completes the rendering of the blurred background image. Because the GPU's operation does not affect the CPU's main thread's execution time, having the GPU driver complete the blurred background image rendering can shorten the interface rendering speed without affecting CPU performance.
[0150] S1010: Execute the rendering instruction corresponding to the rendering node renderNode.
[0151] The electronic device may perform fuzzy processing on the rendering node renderNode according to the fuzzy mode in the fuzzy parameter.
[0152] If the blur mode is set to full blur mode, the electronic device needs to completely blur the background of the area covered by the layout corresponding to the renderNode. As shown in Figure 2 above, the electronic device needs to completely blur the background of the area where the three icons in the lower part of Figure 2a are located. The electronic device can use the drawing capabilities of the skia graphics library to draw the blurred image at the corresponding position on the canvas as the background of the renderNode, and then can draw the content of the renderNode.
[0153] If the blur mode is fill blur mode, it means that the electronic device needs to fill the content of the renderNode with a blurred background. It is understandable that the application can select fill blur mode to blur the background of text or icons of various shapes.
[0154] As shown in Figure 11, an application can select the fill blur mode for the text "16:59". When the electronic device draws the renderNode, it can use the skia graphics library's drawing capabilities to blend the blurred image as a shader with the shape area of the renderNode itself, thereby filling the blurred image content into the specified shape area, blurring the background of the text "16:59".
[0155] After the electronic device completes the background blur processing, it can perform processes such as rendering and synthesis of the current frame image, and can display the final drawing result on the screen of the electronic device.
[0156] S1011: Check whether the current rendering node renderNode has been finished.
[0157] After the electronic device has finished drawing the current renderNode, it can determine whether the current frame image has been drawn. In a possible implementation, the electronic device can determine whether there are any renderNodes to be drawn in the current frame image. If there are any renderNodes to be drawn, it indicates that the current frame image has not been drawn yet; if there are no renderNodes to be drawn, it indicates that the current frame image has been drawn.
[0158] If the current frame image has not been completely rendered, the electronic device may repeatedly execute the above steps S1004 to S1011 until all render nodes of the current frame image are completely rendered.
[0159] If the drawing of the current frame image is completed, it means that the electronic device has completed the drawing of all render nodes renderNode of the current frame image, and the electronic device can execute step S1012 to draw the next frame image.
[0160] S1012: Start drawing the next frame of image.
[0161] The drawing process of the next frame of the picture can refer to the relevant description of the above steps S1001 to S1011, which will not be repeated here.
[0162] It is understood that the embodiment shown in FIG10 can be executed in a non-main thread of the electronic device. For example, the rendering and background blurring processes of the renderNode in the Native library can be executed in a non-main thread of the electronic device. This can avoid affecting the performance of the main thread of the electronic device and reduce the lag of the application interface.
[0163] The embodiment of the present application can complete the drawing of different background blurs corresponding to each frame of the image on the canvas Canvas, achieve a real-time background blur effect, enrich the background blur display effect on the electronic device interface, and improve the user experience.
[0164] It should be noted that in the above step S1008, after the electronic device obtains the blurred background image, it can cache the blurred background image. In the subsequent drawing process of each frame of the image, if the background content of the rendering node renderNode, the set blur radius and the layout of the rendering node renderNode itself have not changed, then steps S1006-S1007 can be omitted. Instead, the blurred background image can be obtained from the cache. This can reduce the process of taking a screenshot of the canvas Canvas and calculating the position information of the rendering node renderNode, thereby saving computing power and reducing the power consumption of the electronic device.
[0165] Alternatively, in some application scenarios, such as the sliding scenario of the photo album application interface in the embodiment corresponding to FIG. 9 , even if the background content of the renderNode, the set blur radius, and the layout of the renderNode itself change, the electronic device may execute steps S1006 and S1007 every M frames to update the blurred background image, where M may be a positive integer greater than or equal to 1. This can reduce the power consumption of the electronic device while not significantly affecting the blurred background display.
[0166] Alternatively, when the application sets the number of frames per second in the blur parameter, assuming that the number of frames per second is set to N, the electronic device can execute steps S1006-S1007 every N frames to update the blurred background image, where N can be a positive integer greater than or equal to 1. It is understandable that if the application does not set the number of frames per second, the electronic device can pre-set the value of the number of frames per second, for example, the value of the number of frames per second can be set to 1. The specific value of the number of frames per second is not limited in the embodiments of the present application. Similarly, the electronic device can reduce the process of executing screenshots of the canvas Canvas and calculating the position information of the rendering node renderNode, thereby saving computing power and reducing the power consumption of the electronic device.
[0167] The following describes the method of the embodiment of the present application in detail through specific embodiments. The following embodiments can be combined with each other or implemented independently, and the same or similar concepts or processes may not be repeated in some embodiments.
[0168] FIG12 shows an interface display method according to an embodiment of the present application. The method includes:
[0169] S1201. At a first moment, a first blurred object is displayed in a target application. The first blurred object is obtained by adding a first blurred background to the target object. The first blurred object is located at a first position. The first blurred background includes a blurred background obtained by blurring content in a first area in an interface of the target application. The first area includes the first position.
[0170] In the embodiment of the present application, the first moment can be understood as the moment when the first blurred object is displayed in the target application.
[0171] The target application can be any application in the electronic device. For example, the target application can be the negative one screen application in the embodiment corresponding to FIG. 7 , or the photo album application in the embodiment corresponding to FIG. 9 , which is not limited in this embodiment.
[0172] The target object can be understood as the object in the target application that needs to be blurred. For example, the target object can be the card 702 in the embodiment corresponding to Figure 7 above, or the area where the title bar 902 or the area where the navigation bar 903 is located in the embodiment corresponding to Figure 9 above, and this embodiment of the application is not limited thereto.
[0173] The first position can be understood as the position of the first blurred object. For example, the first position can be the position of card 702 in the embodiment corresponding to FIG. 7 , or the position of title bar 902 or navigation bar 903 in the embodiment corresponding to FIG. 9 a , and this embodiment is not limited thereto.
[0174] The first area can be understood as the area in the target application where the target object needs to be blurred. For example, the first area can be the blurred area of card 702 in the embodiment corresponding to FIG. 7 , or the blurred area of title bar 902 or navigation bar 903 in the embodiment corresponding to FIG. 9 a , and this embodiment is not limited thereto.
[0175] S1202. At a second moment, a second blurred object is displayed in the target application. The second blurred object is obtained by adding a second blurred background to the target object. The second blurred object is located at a second position. The second blurred background includes a blurred background obtained by blurring the content of a second area in the interface of the target application. The second area includes the second position. The content of the first area in the interface of the target application is different from the content of the second area in the interface of the target application. The second moment is later than the first moment.
[0176] In the embodiment of the present application, the second moment can be understood as the moment when the second blurred object is displayed in the target application.
[0177] The second position can be understood as the location of the second blurred object. For example, the second position can be the location of card 802 in the embodiment corresponding to FIG8 , or the location of title bar 902 or navigation bar 903 in the embodiment corresponding to FIG9 b , and this embodiment is not limited thereto.
[0178] It is understood that the second position can be the same as or different from the first position. For example, in the album application scenario in the embodiment corresponding to FIG9 above, the second position of title bar 902 in FIG9b can be the same as the first position of title bar 902 in FIG9a; and in the negative one screen application scenario in the embodiments corresponding to FIG7 and FIG8 above, the second position of card 802 can be different from the first position of card 702, which is not limited in the present embodiment.
[0179] The second area can be understood as the area in the target application where the target object needs to be blurred. For example, the second area can be the blurred area of card 802 in the embodiment corresponding to FIG8 , or the blurred area of title bar 902 or navigation bar 903 in the embodiment corresponding to FIG9 b , and this embodiment is not limited thereto.
[0180] The interface display method provided in the embodiment of the present application enables an electronic device to dynamically change the blurred background in the same application as the content on the application interface changes, thereby presenting a dynamic background blur effect in the application interface and improving the user experience.
[0181] Optionally, based on the embodiment corresponding to FIG12 , before displaying the second blurred object in the target application, the method may further include: receiving a trigger operation of the user on the target object; and moving the target object to the second position in response to the trigger operation.
[0182] In the embodiment of the present application, the triggering operation can be any operation that triggers the movement of the target object. For example, the triggering operation can be a drag operation, or it can be an operation in which the user triggers the movement of card 702 in the negative one screen application scenario of the embodiment corresponding to FIG. 7 above. The specific triggering operation is not limited in the embodiment of the present application.
[0183] It is understandable that in the negative one screen application scenario, as the target object moves, the blurred background corresponding to the target object can also change dynamically, thereby increasing the beauty of the application interface and improving the user experience.
[0184] Optionally, based on the embodiment corresponding to Figure 12, in the interface of the target application, the position of the target object remains unchanged, and before the second blurred object is displayed in the target application, it may also include: receiving a trigger operation from the user on an area outside the second area in the interface of the target application; in response to the trigger operation, the content of the interface of the target application changes.
[0185] In the embodiment of the present application, the triggering operation can be any operation that triggers the movement of an area outside the second area in the interface of the target application. For example, the triggering operation can be an operation in which a user triggers the sliding of pictures in the album application interface 901 in the album application scenario of the embodiment corresponding to FIG. The specific triggering operation is not limited in the embodiment of the present application.
[0186] It is understandable that in the photo album application scenario, when the content of the application interface changes, the blurred background corresponding to the target object can also change dynamically, making the display of the application interface richer and improving the user experience.
[0187] Optionally, based on the embodiment corresponding to Figure 12, the target application is set with blur parameters, and the blur parameters include one or more of the following parameters: blur radius, color value, saturation, number of frames, blur algorithm, and blur mode; wherein, when the blur radius is included in the blur parameter, the smaller the blur radius, the lighter the blur degree of the first area, and the larger the blur radius, the heavier the blur degree of the first area; the number of frames is used to indicate the period for executing the calculation of the blurred background; the blur mode includes a first mode and a second mode, if the blur mode is the first mode, the first blurred object is obtained by drawing the first blurred background in the first area; or, if the blur mode is the second mode, the first blurred object is obtained by filling the target object with the first blurred background.
[0188] In the embodiments of the present application, the color value can refer to the relevant description of the color value in the embodiment corresponding to FIG5 above, and will not be repeated here. The saturation can refer to the relevant description of the saturation in the embodiment corresponding to FIG5 above, and will not be repeated here. The fuzzy algorithm can refer to the relevant description of the fuzzy algorithm in the embodiment corresponding to FIG5 above, and will not be repeated here.
[0189] The first mode may include a full blur mode, and the first mode may be specifically described in relation to step S1010 of the embodiment corresponding to FIG10 , which will not be described in detail here. The second mode may include a fill blur mode, and the second mode may be specifically described in relation to step S1010 of the embodiment corresponding to FIG10 , which will not be described in detail here.
[0190] Electronic devices can determine the blurriness of the target object, the brightness of the application interface, the vividness of the color, etc. based on the blur parameters set by the target application. They can also obtain blurred objects through different blurring methods. In this way, different display effects can be achieved in the application interface, enriching the display of blurred objects in the application interface, thereby improving the user experience.
[0191] Optionally, based on the embodiment corresponding to Figure 12, before displaying the first blurred object in the target application, it may also include: the target application passes the blur parameter to the View view control in the application layer in the first thread; the View view control passes the blur parameter to the drawing node in the Native library in the first thread, and the blur parameter is in a synchronization state; if the blur radius in the blur parameter is greater than zero, the skia graphics library in the Native library generates a blur filter based on the blur radius in the first thread; otherwise, the blur filter is empty.
[0192] In the embodiment of the present application, the first thread can be understood as the main thread. It can be understood that in the first thread, the electronic device can execute the process of transferring parameters from the application to the electronic device Native library in the embodiment corresponding to Figure 6 above.
[0193] The blur filter may be the blur filter in the embodiment corresponding to FIG6 , which will not be described in detail.
[0194] It is understandable that transferring application parameters in the main thread does not require restarting other threads, thus reducing the overhead of starting threads and improving the operating efficiency of the electronic device.
[0195] Optionally, based on the embodiment corresponding to Figure 12, before displaying the first blurred object in the target application, it may also include: synchronizing blur parameters and blur filters in the properties of the drawing node based on the second thread; if the blur filter is not empty, obtaining a screenshot of the canvas of the target application in the second thread; determining the background image before blurring in the second thread, the background image before blurring is the content in the first area of the screenshot of the canvas; the skia graphics library mixes the background image before blurring and the blur filter in the second thread to obtain a first blurred background.
[0196] In an embodiment of the present application, the second thread can be understood as a non-main thread or a child thread, etc. In the second thread, the process executed by the electronic device can refer to the various steps in the embodiment corresponding to Figure 10 above. For example, the electronic device can execute the drawing node renderNode in the Native library to perform drawing rendering and background blurring, etc., thereby achieving a real-time background blur effect.
[0197] It is understood that a screenshot of the canvas may include capturing the entire canvas content or a portion of the canvas content. For details on capturing a screenshot of the canvas, please refer to the description of step S1006 in the embodiment corresponding to FIG. 10 , and will not be repeated here. The background image before blurring can be understood as the background image Image before blurring in the embodiment corresponding to FIG. 10 , and will not be repeated here.
[0198] The embodiment of the present application can make the blurred background in the application change dynamically as the content on the application interface changes, enriching the background blur display effect on the electronic device interface, thereby improving the user experience.
[0199] Optionally, based on the embodiment corresponding to Figure 12, synchronizing the blur parameters and blur filters in the properties of the drawing node based on the second thread may include: the skia graphics library calls the syncProperties() function in the second thread to synchronize the blur parameters and blur filters in the properties of the drawing node.
[0200] In an embodiment of the present application, the skia graphics library can synchronize the blur parameters and blur filters in the to-be-synchronized state to the properties of the drawing node by calling the syncProperties() function, thereby preparing for further background blur.
[0201] Optionally, based on the embodiment corresponding to FIG12 , obtaining a screenshot of the canvas of the target application in the second thread may include: the skia graphics library obtaining a screenshot of the canvas of the target application in the second thread based on the attributes of the drawing node.
[0202] In the embodiment of the present application, the process of obtaining a screenshot of the canvas based on the properties of the drawing node can refer to the relevant description of steps S1006 and S1007 in the embodiment corresponding to Figure 10 above, and will not be repeated here. By dynamically obtaining a screenshot of the canvas, the blurred background can be dynamically changed as the content on the application interface changes.
[0203] Optionally, based on the embodiment corresponding to Figure 12, after obtaining the first blurred background, it can include: caching the first blurred background; at a third moment, displaying a third blurred object in the target application, the third blurred object is obtained by adding the first blurred background in the cache to the target object, and the third moment is later than the first moment.
[0204] In the embodiment of the present application, the third moment may be the moment when the third blurred object is displayed in the target application.
[0205] It is understood that between the first and third moments, the interface content of the target application may change or remain unchanged. Between the first and third moments, the electronic device may retrieve the first blurred background from the cache, thereby enabling the display of the third blurred object. The specific process of retrieval of the blurred background from the cache can be found in the description of the embodiment corresponding to FIG. 10 above, and will not be further elaborated.
[0206] In this way, the electronic device can reduce the process of executing screenshots of the canvas and the process of calculating the position information of the drawing nodes, thereby saving computing power and reducing the power consumption of the electronic device.
[0207] Optionally, based on the embodiment corresponding to FIG12 , between the first moment and the third moment, the first blurred background, the blur parameters, and the layout of the drawing nodes do not change.
[0208] In the embodiment of the present application, the fact that the first blurred background, blur parameters, and the layout of the drawing nodes remain unchanged can be understood as indicating that the interface content of the target application remains unchanged. This eliminates the need for the electronic device to capture every frame of the canvas, reducing the execution flow of the blurring process and thus saving computing power.
[0209] Optionally, based on the embodiment corresponding to Figure 12, the number of frames N is a positive integer greater than or equal to 1. After obtaining the first blurred background, it can include: caching the first blurred background; at a fourth moment, displaying a fourth blurred object in the target application, the fourth blurred object and the first blurred object are spaced less than or equal to N frames apart, the fourth blurred object is obtained by adding the first blurred background in the cache to the target object, and the fourth moment is later than the first moment.
[0210] In the embodiment of the present application, the fourth moment may be the moment when the fourth blurred object is displayed in the target application.
[0211] It is understood that between the first and fourth moments, the electronic device can retrieve the first blurred background from the cache based on the frame interval number N, thereby enabling display of the third blurred object. The specific process of retrieval of the blurred background from the cache based on the frame interval number N can be found in the description of the embodiment corresponding to FIG. 10 above, and will not be further elaborated.
[0212] In this way, the electronic device can reduce the process of executing screenshots of the canvas and calculating the position information of the drawing nodes, thereby saving computing power and reducing the power consumption of the electronic device.
[0213] Optionally, based on the embodiment corresponding to FIG12 , the second thread runs in a graphics processor GPU.
[0214] In the embodiment of the present application, the electronic device can convert the drawing instructions related to the blur operation into drawing rendering instructions that can be called by the GPU, and the GPU can complete the drawing of the blurred background image. Because the operation of the GPU does not affect the running time of the CPU main thread, the completion of the blurred background image drawing by the GPU can shorten the interface rendering speed without affecting the performance of the CPU.
[0215] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0216] The above mainly introduces the solution provided by the embodiment of the present application from the perspective of method. In order to realize the above functions, it includes hardware structures and / or software modules corresponding to the execution of each function. Those skilled in the art should easily appreciate that, in combination with the method steps of each example described in the embodiment disclosed herein, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in a hardware or computer software driven hardware manner depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0217] The embodiment of the present application can divide the functional modules of the device implementing the method according to the above method example. For example, each functional module can be divided according to each function, or two or more functions can be integrated into one processing module. The integrated module can be implemented in the form of hardware or in the form of software functional modules. It should be noted that the division of modules in the embodiment of the present application is schematic and is only a logical function division. In actual implementation, there may be other division methods.
[0218] FIG13 is a schematic diagram of the structure of a chip provided in an embodiment of the present application. The chip 1300 includes one or more (including two) processors 1301 , a communication line 1302 , a communication interface 1303 , and a memory 1304 .
[0219] In some embodiments, the memory 1304 stores the following elements: executable modules or data structures, or a subset thereof, or an extended set thereof.
[0220] The method described in the above embodiment of the present application can be applied to the processor 1301, or implemented by the processor 1301. The processor 1301 may be an integrated circuit chip with signal processing capabilities. During the implementation process, the steps of the above method can be completed by the hardware integrated logic circuit or software instructions in the processor 1301. The above-mentioned processor 1301 can be a general-purpose processor (for example, a microprocessor or a conventional processor), a digital signal processor (digital signal processing, DSP), an application specific integrated circuit (application specific integrated circuit, ASIC), a field-programmable gate array (field-programmable gate array, FPGA) or other programmable logic devices, discrete gates, transistor logic devices or discrete hardware components. The processor 1301 can implement or execute the methods, steps and logic block diagrams related to each processing disclosed in the embodiment of the present application.
[0221] The steps of the method disclosed in the embodiments of the present application can be directly implemented as being executed by a hardware decoding processor, or can be implemented by a combination of hardware and software modules in the decoding processor. The software module can be located in a storage medium mature in the art, such as a random access memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable read-only memory (EEPROM). The storage medium is located in the memory 1304, and the processor 1301 reads the information in the memory 1304 and performs the steps of the above method in combination with its hardware.
[0222] The processor 1301 , the memory 1304 , and the communication interface 1303 may communicate with each other via a communication line 1302 .
[0223] In the above embodiment, the instructions stored in the memory for execution by the processor may be implemented in the form of a computer program product, wherein the computer program product may be pre-written in the memory or downloaded and installed in the memory in the form of software.
[0224] The present application also provides a computer program product including one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function according to the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from one website, computer, server or data center to another website, computer, server or data center via a wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) method. The computer-readable storage medium can be any available medium that a computer can store or a data storage device such as a server or data center that includes one or more available media integrated. For example, the available medium can include magnetic media (e.g., floppy disk, hard disk or tape), optical media (e.g., digital versatile disc (DVD)), or semiconductor media (e.g., solid state disk (SSD)).
[0225] The present application also provides a computer-readable storage medium. The methods described in the above embodiments can be implemented in whole or in part via software, hardware, firmware, or any combination thereof. Computer-readable media can include computer storage media and communication media, and can also include any medium that can transfer a computer program from one location to another. The storage medium can be any target medium that can be accessed by a computer.
[0226] As one possible design, computer-readable media may include compact disc read-only memory (CD-ROM), RAM, ROM, EEPROM or other optical disc storage; computer-readable media may include magnetic disk storage or other magnetic disk storage devices. Moreover, any connecting line may also be appropriately referred to as a computer-readable medium. For example, if the software is transmitted from a website, server or other remote source using a coaxial cable, fiber optic cable, twisted pair, DSL or wireless technologies such as infrared, radio and microwave, then the coaxial cable, fiber optic cable, twisted pair, DSL or wireless technologies such as infrared, radio and microwave are included in the definition of medium. Disk and disc as used herein include compact disc (CD), laser disc, optical disc, digital versatile disc (DVD), floppy disk and Blu-ray disc, where disks usually reproduce data magnetically, while discs reproduce data optically using lasers.
[0227] The present application embodiment is described with reference to the flow chart and / or block diagram according to the method, device (system) and computer program product of the embodiment of the present application.It should be understood that each flow process and / or box in the flow chart and / or block diagram and the combination of the flow process and / or box in the flow chart and / or block diagram can be realized by computer program instructions.These computer program instructions can be provided to the processing unit of general-purpose computer, special-purpose computer, embedded processing machine or other programmable data processing equipment to produce a machine, so that the instruction executed by the processing unit of computer or other programmable data processing equipment produces the device for realizing the function specified in one flow chart flow chart or multiple flow charts and / or one block or multiple blocks of block diagram.
Claims
1. An interface display method, It is characterized in that The method comprises: At a first moment, a first blurred object is displayed in a target application, the first blurred object is obtained by adding a first blurred background to the target object, the first blurred object is located at a first position, the first blurred background includes a blurred background obtained by blurring content in a first area in an interface of the target application, and the first area includes the first position; At a second moment, a second blurred object is displayed in the target application, the second blurred object is obtained by adding a second blurred background to the target object, the second blurred object is located at a second position, the second blurred background includes a blurred background obtained by blurring the content of a second area in the interface of the target application, and the second area includes the second position; wherein the content of the first area in the interface of the target application is different from the content of the second area in the interface of the target application; the second moment is later than the first moment.
2. The method according to claim 1, It is characterized in that Before displaying the second blurred object in the target application, the method further includes: Receiving a trigger operation on the target object by a user; In response to the triggering operation, the target object moves to the second position.
3. The method according to claim 1, It is characterized in that In the interface of the target application, the position of the target object remains unchanged, and before displaying the second blurred object in the target application, the method further includes: receiving a trigger operation from a user on an area outside the second area in the interface of the target application; In response to the triggering operation, the content of the interface of the target application changes.
4. The method according to any one of claims 1 to 3, It is characterized in that The target application is provided with blur parameters, and the blur parameters include one or more of the following parameters: blur radius, color value, saturation, number of frames, blur algorithm, blur mode; Wherein, when the blur parameter includes the blur radius, the smaller the blur radius, the lighter the blur degree of the first area, and the larger the blur radius, the heavier the blur degree of the first area; The frame interval number is used to indicate the period for executing the calculation of the blurred background; The blur mode includes a first mode and a second mode. If the blur mode is the first mode, the first blurred object is obtained by drawing the first blurred background in the first area; or, if the blur mode is the second mode, the first blurred object is obtained by filling the target object with the first blurred background.
5. The method according to claim 4, It is characterized in that Before displaying the first blurred object in the target application, the method further includes: The target application passes the blur parameter to the View control in the application layer in the first thread; The View view control passes the fuzzy parameter to the drawing node in the Native library in the first thread, and the fuzzy parameter is in a state to be synchronized; If the blur radius in the blur parameter is greater than zero, the skia graphics library in the Native library generates a blur filter based on the blur radius in the first thread; otherwise, the blur filter is empty.
6. The method according to claim 5, It is characterized in that Before displaying the first blurred object in the target application, the method further includes: Synchronizing the blur parameter and the blur filter in the attributes of the drawing node based on a second thread; If the blur filter is not empty, obtaining a screenshot of the canvas of the target application in the second thread; Determine, in the second thread, a background image before blurring, wherein the background image before blurring is content in the first area of the screenshot of the canvas; The skia graphics library mixes the background image before blurring and the blur filter in the second thread to obtain the first blurred background.
7. The method according to claim 6, It is characterized in that The step of synchronizing the blur parameter and the blur filter in the attributes of the drawing node based on the second thread includes: The skia graphics library calls the syncProperties() function in the second thread to synchronize the blur parameters and the blur filter in the properties of the drawing node.
8. The method according to any one of claims 6 to 7, It is characterized in that Acquiring a screenshot of the canvas of the target application in the second thread includes: The skia graphics library obtains a screenshot of the canvas of the target application in the second thread based on the attributes of the drawing node.
9. The method according to any one of claims 1 to 8, It is characterized in that After obtaining the first blurred background, the method includes: caching the first blurred background; At a third moment, a third blurred object is displayed in the target application, and the third blurred object is obtained by adding the first blurred background in the cache to the target object. The third moment is later than the first moment.
10. The method according to claim 9, It is characterized in that Between the first moment and the third moment, the first blurred background, the blur parameters, and the layout of the drawing nodes do not change.
11. The method according to any one of claims 4 to 8, It is characterized in that The number of frames N is a positive integer greater than or equal to 1. After obtaining the first blurred background, the method includes: caching the first blurred background; At a fourth moment, a fourth blurred object is displayed in the target application. The fourth blurred object is spaced less than or equal to N frames from the first blurred object. The fourth blurred object is obtained by adding the first blurred background in the cache to the target object. The fourth moment is later than the first moment.
12. The method according to any one of claims 6 to 11, It is characterized in that The second thread runs in a graphics processor GPU.
13. An electronic device, It is characterized in that include: A memory and a processor, the memory being used to store a computer program, and the processor being used to execute the computer program to perform the method according to any one of claims 1 to 12.
14. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores instructions, and when the instructions are executed, the computer executes the method according to any one of claims 1 to 12.
15. A computer program product, It is characterized in that The invention comprises a computer program, which, when being executed, enables an electronic device to execute the method according to any one of claims 1 to 12.
Citation Information
Patent Citations
Interface display method and related device
CN119025195A
Display interface processing method, terminal and computer readable storage medium
CN108196766A
Picture fuzzy processing method and device, equipment and computer readable storage medium
CN112102158A
Background fuzzy control implementation method and device
CN113918249A
Information display method and device
CN114519212A
