User interface rendering method and electronic device

By rendering the rounded corner areas of the user interface separately on the electronic device, the problem of repeated rendering areas during the icon rendering process is solved, the rendering efficiency and response time are improved, and the user experience is improved.

WO2024198612A1PCT designated stage expired Publication Date: 2024-10-03HUAWEI TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/070841
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-03-27
Filing Date
2024-01-05
Publication Date
2024-10-03

AI Technical Summary

Technical Problem

On electronic devices, there are repeated rendering areas during the rendering process of icons, which results in extended rendering time and reduced energy utilization efficiency. Especially when switching between different pages, icons need to be rendered frequently, which affects user operation response time.

Method used

By rendering the rounded corner area in the user interface separately without repeatedly rendering the target icon containing the rounded corner, the processor is used to generate instruction information to determine the rounded corner area, and perform anti-aliasing operations to divide the rounded corner area into triangular sub-areas. , to improve rendering efficiency.

Benefits of technology

It reduces repeated rendering areas, shortens graphics rendering time, improves the rendering efficiency and energy utilization efficiency of the user interface, and reduces the response time of electronic devices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024070841_03102024_PF_FP_ABST
    Figure CN2024070841_03102024_PF_FP_ABST
Patent Text Reader

Abstract

The present application provides a user interface rendering method and an electronic device. A user interface to be rendered comprises a target icon, the target icon comprising at least one fillet. The electronic device can separate a fillet area in the user interface for independent rendering, so as to complete anti-aliasing operation and other operations without repeatedly rendering the whole target icon comprising the fillet, thus reducing the area of repeatedly rendered areas during graphic rendering, improving the graphic rendering efficiency of terminal devices, and shortening the operating response time of electronic devices, thus enhancing use experience of users.
Need to check novelty before this filing date? Find Prior Art

Description

User interface rendering method and electronic device

[0001] This application claims priority to the Chinese patent application filed with the State Intellectual Property Office of China on March 27, 2023, with application number 202310336973.1 and invention name “User Interface Rendering Method and Electronic Device”, the entire contents of which are incorporated by reference into this application. Technical Field

[0002] The present application relates to the field of terminal device software, and more specifically, to a user interface rendering method and electronic device. Background Art

[0003] With the development of electronic equipment software and hardware technology, the number of applications that can be run on electronic devices is increasing. On average, dozens or even hundreds of applications are installed on a mobile phone. Applications are usually displayed in the form of icons. In the process of electronic devices displaying icons, the processing unit of the electronic device (such as a central processing unit or a graphics processing unit) needs to render the icons. Taking the user interface of a desktop application as an example, in the process of switching back and forth between different pages of the application desktop, the processing unit of the electronic device needs to repeatedly render the icons on the application desktop. The larger the display area occupied by the icon, the more graphic information it contains, the longer it takes for the electronic device to render the icon, and the longer the response time of the electronic device to the user's operation.

[0004] How to improve the rendering efficiency of electronic devices for icons and shorten the response time of electronic devices to user operations are issues worth considering.

[0005] Summary of the Invention

[0006] The present application provides a user interface rendering method and electronic device. The electronic device can separately render the rounded corner area of ​​the foreground part of the user interface, reducing the area of ​​repeated rendering during the user interface rendering process and improving rendering efficiency.

[0007] In a first aspect, a method for rendering a user interface is provided, the method comprising: rendering a background portion of the user interface, the user interface including a background portion and a foreground portion having a target icon; rendering a rounded area of ​​the foreground portion, the foreground portion including a central area and a rounded area located around the central area, the rounded area including rounded corners of the target icon; rendering the foreground portion of the user interface.

[0008] The user interface may also be referred to as a target interface, an interface to be rendered, etc. It should be noted that the rounded corner areas of the background and foreground of the user interface may be rendered in one pass, or in other words, the rounded corner areas of the background and foreground of the user interface may be rendered together.

[0009] It should be understood that a target icon including rounded corners refers to a target icon whose outer border has at least two adjacent edges connected by an arc. The rounded corner area refers to the area containing the arc. There can be multiple target icons, and each target icon can include at least one rounded corner.

[0010] In a possible implementation, the background portion of the user interface may refer to an area of ​​the user interface that does not include rounded corners.

[0011] This technical solution renders the rounded corner area contained in the user interface separately without having to repeatedly render the entire target icon containing the rounded corners. This reduces the area of ​​repeated rendering during the user interface rendering process, improves rendering efficiency, shortens graphics rendering time, and enhances the user experience.

[0012] In combination with the first aspect, in some implementations of the first aspect, the method further includes: reading indication information, where the indication information is used to indicate the rounded corner area; or, determining the rounded corner area according to the target icon.

[0013] In a possible implementation, the electronic device includes a first processor and a second processor, the first processor may be configured to generate the indication information, and the second processor may be configured to read the indication information. The indication information may be stored in a global memory of the electronic device.

[0014] In some examples, the indication information includes coordinate information of vertices in the rounded area.

[0015] In some examples, the electronic device or the aforementioned second processor can determine the rounded corner area based on coordinate information, color information, etc. of the vertices in the target icon.

[0016] In this technical solution, the electronic device can determine the rounded corner area in the graphics in a variety of ways. When the electronic device includes multiple processors, the electronic device can execute different rounded corner area determination schemes according to the actual load of different processors, which is conducive to achieving load balancing of multiple processors and improving the processing efficiency of the electronic device for user interface rendering.

[0017] In combination with the first aspect, in some implementations of the first aspect, the method further includes: performing an anti-aliasing operation on the rounded corner area.

[0018] In some examples, the rounded area includes an arc, and the electronic device can obtain information about vertices on both sides of the arc and perform an anti-aliasing operation based on the vertex information.

[0019] In this technical solution, the electronic device performs anti-aliasing operations on the rounded corner area, which is beneficial to improving the display effect of the color and texture of the rounded corner area contained in the user interface and improving the energy utilization efficiency of the electronic device.

[0020] In combination with the first aspect, in some implementations of the first aspect, the rounded area includes multiple sub-areas, and the shapes of the multiple sub-areas are triangles.

[0021] In some examples, the plurality of sub-regions are not connected to each other.

[0022] In this technical solution, the rounded corner area is divided into triangles, which is more in line with the GPU's division method for rendering graphics, which is conducive to improving the rendering efficiency of the electronic device for the rounded corner area and further improving the electronic device's rendering efficiency for the overall user interface.

[0023] In a possible implementation, the triangle is circumscribed to the rounded corner of the target icon.

[0024] The triangle is circumscribed to the rounded corner of the target icon, which can also be understood as the triangle being circumscribed to the arc corresponding to the rounded corner of the target icon.

[0025] A triangle circumscribing a rounded corner can also be understood as the smallest triangle that can enclose the rounded corner. In this technical solution, the rounded corner area is divided into sizes that can circumscribe the rounded corner, reducing the area of ​​the rounded corner area, which is conducive to improving the rendering efficiency of the rounded corner area and further improving the overall rendering efficiency of the electronic device for the user interface.

[0026] In combination with the first aspect, in certain implementations of the first aspect, the foreground portion is a rectangle, the size of the foreground portion in the length direction is equal to the maximum size of the target icon in the length direction, and the size of the foreground portion in the width direction is equal to the maximum size of the target icon in the width direction.

[0027] This technical solution can also be understood as that the foreground portion is the smallest rectangular area that can surround the target icon.

[0028] In this technical solution, the user interface is divided according to the principle of minimizing the area of ​​the foreground part, which is conducive to determining a smaller rounded corner area and improving the rendering efficiency of the electronic device for the user interface.

[0029] In combination with the first aspect, in some implementations of the first aspect, the target icon is one or more of an application icon, a mini-program icon, a quick app icon, or a desktop plug-in icon.

[0030] It should be understood that an application icon, a mini-program icon, a quick app icon, or a desktop plug-in icon may include at least one rounded corner.

[0031] This technical solution can be used to render icons containing applications, mini-programs, etc. The implementation of this technical solution is conducive to improving the rendering efficiency of electronic devices for user interfaces containing rounded-corner icons, thereby shortening the response time of electronic devices to user operations on these user interfaces.

[0032] In combination with the first aspect, in some implementations of the first aspect, the method further includes: displaying the user interface, where the user interface is a user interface of a desktop application.

[0033] This technical solution can be applied to scenarios where the user interface of a desktop application is displayed. Desktop applications generally contain a large number of rounded icons. Therefore, the implementation of this technical solution is conducive to improving the graphics rendering efficiency of electronic devices in these scenarios and shortening the response time of electronic devices.

[0034] The explanation and beneficial effects of the following technical solutions can be specifically referred to the relevant description of the first aspect. For the sake of brevity, they are not described in detail below.

[0035] In a second aspect, a method for rendering a user interface is provided, comprising: rendering a user interface, the user interface including a background portion and a foreground portion, the foreground portion being used to display a target icon, the foreground portion including a rounded corner area, the rounded corners of the target icon being located in the rounded corner area; rendering the rounded corner area with anti-aliasing.

[0036] In combination with the second aspect, in some implementations of the second aspect, the method further includes: reading indication information, where the indication information is used to indicate the rounded corner area; or, determining the rounded corner area based on the target icon.

[0037] In combination with the second aspect, in some implementations of the second aspect, the rounded corner area includes multiple sub-areas, and the shapes of the multiple sub-areas are triangles.

[0038] In a possible implementation, the triangle is circumscribed to the rounded corner of the target icon.

[0039] According to a third aspect, an electronic device is provided, comprising a processor and a memory, the memory being used to store program instructions, the processor being used to: render a background portion of a user interface, the user interface comprising a background portion and a foreground portion having a target icon; render a rounded area of ​​the foreground portion, the foreground portion comprising a central portion and a rounded area located around the central portion, the rounded area comprising the rounded corners of the target icon; and render the foreground portion of the user interface.

[0040] In combination with the third aspect, in certain implementations of the third aspect, the processor is further used to: read indication information, where the indication information is used to indicate the rounded corner area; or determine the rounded corner area based on the target icon.

[0041] In combination with the third aspect, in certain implementations of the third aspect, the processor is further configured to: perform an anti-aliasing operation on the rounded corner area.

[0042] In combination with the third aspect, in some implementations of the third aspect, the rounded area includes multiple sub-areas, and the shapes of the multiple sub-areas are triangles.

[0043] In a possible implementation, the triangle is circumscribed to the rounded corner of the target icon.

[0044] In combination with the third aspect, in certain implementations of the third aspect, the foreground portion is a rectangle, the size of the foreground portion in the length direction is equal to the maximum size of the target icon in the length direction, and the size of the foreground portion in the width direction is equal to the maximum size of the target icon in the width direction.

[0045] In combination with the third aspect, in certain implementations of the third aspect, the target icon is one or more of an application icon, a mini-program icon, a quick app icon, or a desktop plug-in icon.

[0046] In combination with the third aspect, in certain implementations of the third aspect, the processor is further used to: display the user interface, which is a user interface of a desktop application.

[0047] In a fourth aspect, an electronic device is provided, which includes a processor and a memory, the memory being used to store program instructions, the processor being used to: render a user interface, the user interface including a background portion and a foreground portion, the foreground portion being used to display a target icon, the foreground portion including a rounded corner area, the rounded corners of the target icon being located in the rounded corner area; and render the rounded corner area with anti-aliasing.

[0048] In combination with the fourth aspect, in certain implementations of the fourth aspect, the processor is further used to: read indication information, where the indication information is used to indicate the rounded corner area; or, determine the rounded corner area based on the target icon.

[0049] In combination with the fourth aspect, in some implementations of the fourth aspect, the rounded area includes multiple sub-areas, and the shapes of the multiple sub-areas are triangles.

[0050] In a fifth aspect, a rendering device for a user interface is provided, which includes a processing module, which is used to: render a background part of the user interface, which includes a background part and a foreground part with a target icon; render a rounded area of ​​the foreground part, which includes a central area and the rounded area located around the central area, which includes the rounded corners of the target icon; render the foreground part of the user interface.

[0051] In combination with the fifth aspect, in certain implementations of the fifth aspect, the device further includes an acquisition module, which is used to: read indication information, where the indication information is used to indicate the rounded corner area; or, the processing module is further used to: determine the rounded corner area based on the target icon.

[0052] In combination with the fifth aspect, in certain implementations of the fifth aspect, the processing module is further used to: perform an anti-aliasing operation on the rounded area.

[0053] In combination with the fifth aspect, in some implementations of the fifth aspect, the rounded area includes multiple sub-areas, and the shapes of the multiple sub-areas are triangles.

[0054] In a possible implementation, the triangle is circumscribed to the at least one rounded corner.

[0055] In combination with the fifth aspect, in certain implementations of the fifth aspect, the foreground portion is a rectangle, the size of the foreground portion in the length direction is equal to the maximum size of the target icon in the length direction, and the size of the foreground portion in the width direction is equal to the maximum size of the target icon in the width direction.

[0056] In combination with the fifth aspect, in certain implementations of the fifth aspect, the target icon is one or more of an application icon, a mini-program icon, a quick app icon, or a desktop plug-in icon.

[0057] In combination with the fifth aspect, in some implementations of the fifth aspect, the processing module is further used to: display the user interface, which is a user interface of a desktop application.

[0058] In a sixth aspect, a rendering device for a user interface is provided, the rendering device including a processing module, the processing module being used to: render a user interface, the user interface including a background part and a foreground part, the foreground part being used to display a target icon, the foreground part including a rounded corner area, the rounded corner of the target icon being located in the rounded corner area; and render the rounded corner area with anti-aliasing.

[0059] In combination with the sixth aspect, in certain implementations of the sixth aspect, the rendering device further includes an acquisition module, which is used to: read indication information, where the indication information is used to indicate the rounded corner area; or, the processing module is further used to: determine the rounded corner area based on the target icon.

[0060] In combination with the sixth aspect, in some implementations of the sixth aspect, the rounded area includes multiple sub-areas, and the shapes of the multiple sub-areas are triangles.

[0061] In the seventh aspect, a computer program product is provided, which includes a computer program code, and when the computer program code is run on a computer, the method in the first aspect and any possible implementation thereof is executed, or the method in the second aspect and any possible implementation thereof is executed.

[0062] In an eighth aspect, a computer-readable storage medium is provided, which stores a computer program code. When the computer program code runs on a computer, the method in the first aspect and any possible implementation thereof is executed, or the method in the second aspect and any possible implementation thereof is executed.

[0063] In the ninth aspect, a chip is provided, comprising a processor for reading instructions stored in a memory, wherein when the processor executes the instructions, the chip implements the method in the first aspect and any possible implementation thereof, or the chip implements the method in the second aspect and any possible implementation thereof. BRIEF DESCRIPTION OF THE DRAWINGS

[0064] FIG1 is a schematic diagram of a hardware architecture of an electronic device applicable to an embodiment of the present application.

[0065] FIG2 is a schematic diagram of a software architecture of an electronic device applicable to an embodiment of the present application.

[0066] FIG3 is a schematic diagram of a method for rendering a user interface provided in an embodiment of the present application.

[0067] 4 to 6 are schematic diagrams of application scenarios of the user interface rendering method provided in embodiments of the present application.

[0068] FIG7 is a schematic diagram of the shape of an icon provided in an embodiment of the present application.

[0069] FIG8 is a schematic diagram of a method for dividing user interface areas provided in an embodiment of the present application.

[0070] FIG9 is a schematic diagram of the architecture of a GPU provided in an embodiment of the present application.

[0071] FIG10 is a schematic diagram of a method for GPU rendering graphics provided in an embodiment of the present application.

[0072] FIG11 is a schematic diagram of another method for rendering a user interface provided in an embodiment of the present application.

[0073] FIG. 12 is a schematic diagram of different rendering areas of the user interface in the method shown in FIG. 11 .

[0074] FIG13 is a schematic diagram of a rendering device for a user interface provided in an embodiment of the present application.

[0075] FIG14 is a schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0076] The technical solution in this application will be described below with reference to the accompanying drawings.

[0077] The terms used in the following embodiments are only for the purpose of describing specific embodiments and are not intended to limit the present application. As used in the specification of this application and the appended claims, the singular expressions "a", "an", "said", "above", "the" and "this" are intended to also include expressions such as "one or more", unless there is a clear contrary indication in the context. It should also be understood that in the following embodiments of the present application, "at least one", "one or more" refer to one, two or more. The term "and / or" is used to describe the association relationship of associated objects, indicating that three relationships can exist; for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural. The character " / " generally indicates that the previous and subsequent associated objects are in an "or" relationship.

[0078] References to "one embodiment" or "some embodiments" in this specification mean that a particular feature, structure, or characteristic described in conjunction with that embodiment is included in one or more embodiments of the present application. Thus, phrases such as "in one embodiment," "in some embodiments," "in other embodiments," and "in yet other embodiments" appearing in various places in this specification do not necessarily refer to the same embodiment, but rather mean "one or more but not all embodiments," unless otherwise specifically emphasized. The terms "including," "comprising," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized.

[0079] The method provided in the embodiments of the present application can be applied to electronic devices such as mobile phones, tablet computers, wearable devices, in-vehicle devices, augmented reality (AR) / virtual reality (VR) devices, laptop computers, ultra-mobile personal computers (UMPCs), netbooks, and personal digital assistants (PDAs). The embodiments of the present application do not impose any restrictions on the specific types of electronic devices.

[0080] 1 shows a schematic structural diagram of an electronic device 100. The electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display 194, and a subscriber identification module (SIM) card interface 195. 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.

[0081] It should be understood that the structures illustrated in the embodiments of the present application do not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 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.

[0082] 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 memory, 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.

[0083] The controller may be the nerve center and command center of the electronic device 100. The controller may generate an operation control signal according to the instruction operation code and the timing signal to complete the control of fetching and executing instructions.

[0084] 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.

[0085] 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 subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface.

[0086] The USB interface 130 is an interface that complies with USB standards and may be a Mini USB interface, a Micro USB interface, a USB Type-C interface, or the like. The USB interface 130 can be used to connect a charger to charge the electronic device 100, or to transfer data between the electronic device 100 and peripheral devices. It can also be used to connect headphones to play audio. This interface can also be used to connect other electronic devices, such as augmented reality devices.

[0087] It is understood that the interface connection relationship between the modules illustrated in the embodiments of the present application is merely an illustrative illustration and does not constitute a structural limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may also adopt different interface connection methods from the above embodiments, or a combination of multiple interface connection methods.

[0088] The charging management module 140 is configured to receive charging input from a charger. The charger can be either a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 can receive charging input from the wired charger via the USB interface 130. In some wireless charging embodiments, the charging management module 140 can receive wireless charging input via the wireless charging coil of the electronic device 100. While charging the battery 142, the charging management module 140 can also provide power to the electronic device via the power management module 141.

[0089] The power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140, and provides power to the processor 110, the internal memory 121, the external memory, the display 194, the camera 193, and the wireless communication module 160. The power management module 141 can also be used to monitor parameters such as battery capacity, battery cycle count, and battery health status (leakage, impedance). In some other embodiments, the power management module 141 can also be set in the processor 110. In other embodiments, the power management module 141 and the charging management module 140 can also be set in the same device.

[0090] The wireless communication function of the electronic device 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.

[0091] Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve antenna utilization. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In other embodiments, the antennas can be used in conjunction with a tuning switch.

[0092] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G, etc., applied to the electronic device 100. The mobile communication module 150 can include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc.

[0093] The wireless communication module 160 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., which are applied to the electronic device 100. The wireless communication module 160 can be one or more devices that integrate at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, frequency modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 110. The wireless communication module 160 can also receive the signal to be sent from the processor 110, frequency modulate it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.

[0094] Electronic device 100 implements display functionality through a GPU, display screen 194, and an application processor. A GPU is a microprocessor for image processing that connects display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for image rendering. Processor 110 may include one or more GPUs that execute program instructions to generate or modify display information.

[0095] Display screen 194 is used to display images, videos, and the like. Display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a MiniLED, a MicroLED, a Micro-oLed, or a quantum dot light-emitting diode (QLED). In some embodiments, electronic device 100 may include one or N display screens 194, where N is a positive integer greater than one.

[0096] The electronic device 100 can implement a shooting function through an ISP, a camera 193, a video codec, a GPU, a display screen 194, and an application processor.

[0097] The ISP processes data fed back by camera 193. For example, when taking a photo, the shutter is opened, and light is transmitted through the lens to the camera's photosensitive element. The light signal is converted into an electrical signal, which is then passed to the ISP for processing and converted into a visible image. The ISP can also perform algorithmic optimization on image noise, brightness, and skin tone. It can also optimize parameters such as exposure and color temperature of the captured scene. In some embodiments, the ISP can be located within camera 193.

[0098] The camera 193 is used to capture still images or videos. The object generates an optical image through the lens and projects it onto the photosensitive element. The photosensitive element can be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the light signal into an electrical signal, and then passes the electrical signal to the ISP for conversion into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV or other format. In some embodiments, the electronic device 100 may include 1 or N cameras 193, where N is a positive integer greater than 1.

[0099] The digital signal processor is used to process digital signals. In addition to processing digital image signals, it can also process other digital signals. For example, when the electronic device 100 selects a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy.

[0100] Video codecs are used to compress or decompress digital video. Electronic device 100 may support one or more video codecs. This allows electronic device 100 to play or record videos in various encoding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, and MPEG4.

[0101] The NPU is a neural network (NN) computing processor. Drawing on the structure of biological neural networks, such as the transmission patterns between neurons in the human brain, it rapidly processes input information and can continuously self-learn. The NPU can enable intelligent cognitive applications in electronic device 100, such as image recognition, face recognition, speech recognition, and text comprehension.

[0102] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 via the external memory interface 120 to implement data storage functions. For example, files such as music and videos can be stored on the external memory card.

[0103] The internal memory 121 can be used to store computer executable program codes, which include instructions. The processor 110 executes various functional applications and data processing of the electronic device 100 by running the instructions stored in the internal memory 121. 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 100 (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.

[0104] The electronic device 100 can implement audio functions such as music playback and recording through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D, and the application processor.

[0105] The audio module 170 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signals. The audio module 170 can also be used to encode and decode audio signals. In some embodiments, the audio module 170 can be provided in the processor 110, or some functional modules of the audio module 170 can be provided in the processor 110.

[0106] The buttons 190 include a power button, a volume button, and the like. The buttons 190 may be mechanical buttons or touch buttons. The electronic device 100 may receive key inputs and generate key signal inputs related to user settings and function control of the electronic device 100.

[0107] The software system of the electronic device 100 can adopt a layered architecture, an event-driven architecture, a micro-kernel architecture, a micro-service architecture, or a cloud architecture. In the embodiment of the present application, the Android system with a layered architecture is used as an example to illustrate the software structure of the electronic device 100.

[0108] Figure 2 is a software structure diagram of the electronic device 100 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 four layers, namely, the application layer, the application framework layer, the Android runtime (Android runtime) and the system library, and the kernel layer, from top to bottom. The application layer may include a series of application packages.

[0109] As shown in FIG2 , the application package may include applications such as camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, and short message.

[0110] 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.

[0111] As shown in FIG2 , the application framework layer may include a window manager, a content provider, a view system, a telephony manager, a resource manager, a notification manager, and the like.

[0112] 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, take screenshots, etc.

[0113] Content providers are used to store and retrieve data and make it accessible to applications. The data may include videos, images, audio, calls made and received, browsing history and bookmarks, phone books, etc.

[0114] The view system includes visual controls, such as those for displaying text and images. The view system is used to build applications. A display interface can consist of one or more views. For example, a display interface containing a text notification icon might include a view for displaying text and a view for displaying images.

[0115] The phone manager is used to provide communication functions of the electronic device 100, such as management of call status (including answering, hanging up, etc.).

[0116] The resource manager provides various resources for applications, such as localized strings, icons, images, layout files, video files, and so on.

[0117] The Notification Manager allows applications to display notifications in the status bar. These messages can be displayed briefly and then disappear automatically without user interaction. For example, the Notification Manager is used to notify users of completed downloads and message reminders. The Notification Manager can also display notifications in the top status bar of the system as icons or scrolling text, such as notifications from background applications, or as dialog windows on the screen. Examples include displaying text messages in the status bar, emitting alert sounds, vibrating electronic devices, or flashing indicator lights.

[0118] The Android runtime includes the core library and the virtual machine. The Android runtime is responsible for scheduling and management of the Android system.

[0119] 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.

[0120] The application layer and application framework layer run in a virtual machine. The virtual machine executes Java files in the application layer and application framework layer as binary files. The virtual machine manages object lifecycles, stack management, thread management, security and exception management, and garbage collection.

[0121] The system library can include multiple functional modules, such as surface manager, media libraries, 3D graphics processing library (such as OpenGL ES), 2D graphics engine (such as SGL), etc.

[0122] The surface manager is used to manage the display subsystem and provide fusion of 2D and 3D layers for multiple applications.

[0123] 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.

[0124] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.

[0125] A 2D graphics engine is a drawing engine for 2D drawings.

[0126] The kernel layer is the layer between hardware and software. The kernel layer includes at least display driver, camera driver, audio driver, and sensor driver.

[0127] It should be understood that the technical solutions in the embodiments of the present application can be used in Android, IOS, Hongmeng and other systems.

[0128] A rounded corner icon can refer to an icon whose two adjacent sides are connected by an arc, and the area where the arc part is located can be called the rounded corner area of ​​the icon. For the rendering process of a user interface containing rounded corner icons, the background area of ​​the rounded corner icon is generally rendered first, then the rectangular icon corresponding to the rounded corner icon is rendered, and finally the rounded corner icon itself is rendered. There are a large number of repeated rendering areas between different stages of the above rendering process, which leads to longer icon rendering time and lower energy utilization efficiency of electronic devices.

[0129] For example, as shown in FIG3 , to draw a target display area 304 containing a rounded-corner icon, the electronic device may generally first draw a background area 301, and then draw a square icon 302 corresponding to the rounded-corner icon. To perform anti-aliasing on the rounded corners of the rounded-corner icon, the electronic device performs anti-aliasing on the rounded-corner icon 303 after drawing the square icon 302. Thereafter, the electronic device may transmit pixel information corresponding to the processed background and icon to the display, thereby displaying the target display area 304 on the screen of the electronic device. During the drawing process of the target display area 304, an area the size of the rounded-corner icon 303 is repeatedly drawn, and the area that requires repeated drawing is relatively large.

[0130] In order to reduce the area where electronic devices perform repeated rendering during the graphics rendering process, shorten the rendering time of electronic devices, and improve the energy utilization efficiency of electronic devices, the present application provides a graphics rendering method, which is described as follows.

[0131] Before introducing the graphics rendering method provided in the embodiments of the present application, some terms that may be used in the following embodiments are first introduced.

[0132] An icon, in a broad sense, refers to a sign with an indicative function. It generally refers to an icon on the desktop of an electronic device screen that serves as an auxiliary display for characters and is used to instruct users to perform various operations. Icons can be divided into various types, such as icons used to identify file types (document icons) and application icons (application icons). Within an application, toolbar icons, menu icons, video playback windows, video playback cards, application plug-ins, application cards, etc. can all be considered icons.

[0133] Shaders include two-dimensional shaders and three-dimensional shaders. Two-dimensional shaders are used to process digital images and can also participate in the rendering of three-dimensional graphics. Two-dimensional shaders include "pixel shaders", which are also called fragment shaders. Three-dimensional shaders are used to process three-dimensional models or other geometric bodies and can access the colors and textures used to draw models. Three-dimensional shaders include vertex shaders, geometry shaders, and tessellation shaders. The vertex shader processes each vertex and projects the spatial position of the vertex on the screen, that is, calculates the two-dimensional coordinates of the vertex; the geometry shader can add or delete vertices from polygons; the tessellation shader can add details to a group of vertices.

[0134] In practice, shaders can be further subdivided into tens of thousands of types based on their specific uses, such as vertex lighting (Vertex-Lit), diffuse (Diffuse), decals (Decal), and diffuse detail (Diffuse Detail). When the graphics image in the application display interface includes vertex lighting effects, the electronic device loads the Vertex-Lit shader responsible for implementing this effect into memory. When the graphics image in the application display interface includes decal effects, the electronic device loads the Decal shader responsible for implementing this effect into memory.

[0135] The anti-aliasing process begins with enlarging the image. First, the entire image or the more precise edge of the object is enlarged. Then, the pixels at the edge of the object with large color contrast and the pixels around it are extracted and blended to form a more natural but also more blurred color transition than the original. Finally, the image is reduced back to its original size to eliminate the blur caused by the color transition.

[0136] Figures 4 to 7 illustrate some application scenarios of the graphics rendering method provided in embodiments of the present application.

[0137] Figure 4 shows a schematic diagram of the user interface of a desktop application of a first electronic device. The shaded area 401 in the figure can be regarded as the background in the rendering process of the user interface. One or more rounded icons are displayed on the user interface of the desktop application. Any of the multiple rounded icons can be called a target icon, such as the "browser" application icon 402. In response to an operation on the target icon (such as clicking), the electronic device can display the user interface of the application corresponding to the target icon. The target icon can be an icon of an application installed locally on the electronic device, or it can be an icon of a small program or quick application that does not need to be installed locally.

[0138] The shaded area 401 in FIG4 can be considered as the background of any target icon in the figure. In other words, multiple icons displayed on the same user interface have the same background. When displaying the user interface shown in FIG4 , the electronic device can render the background and icons separately. The background shared by multiple icons can be rendered only once.

[0139] A desktop application may include multiple application icon display interfaces, as shown in FIG4 . When an electronic device displays the multiple application icon display interfaces, it needs to render the application icons included in the display interfaces. In this case, the more application icons included in the display interface, the more icons the electronic device needs to render. When a user switches between the multiple display interfaces, each switch requires rendering the rounded-corner icons included in the switched user interface.

[0140] Figure 5 shows another example of a rounded corner icon. The shaded area 501 displayed on the desktop application of the second electronic device can be regarded as the background in the rendering process of the user interface. A target icon 502 can be displayed on the user interface. The target icon 502 can be a desktop plug-in of the second electronic device. Therefore, the target icon 502 can also be called a desktop plug-in 502. The desktop plug-in 502 may include a rounded corner area. In response to an operation on the desktop plug-in 502 (such as a click), the electronic device can display the user interface of the desktop plug-in 502. The desktop plug-in 502 can be a desktop plug-in for an application that has been installed on the electronic device, or it can be a desktop plug-in for an application that does not need to be installed locally on the electronic device, such as a mini-program or quick application that the electronic device supports to run. Exemplarily, the desktop plug-in can include a desktop plug-in for a "weather" application, a desktop plug-in for a "music" application, a desktop plug-in for a "news browsing" quick application, or a desktop plug-in for a "network ticket booking" mini-program, etc.

[0141] Figure 6 shows a first user interface of a first application (e.g., an "App Store" application) on a third electronic device. The shaded area 601 in the first user interface can be regarded as the background in the rendering process of the first user interface. One or more rounded icons 602 (e.g., an icon of a "File Management" application) are displayed on the first user interface. In response to an operation on the rounded icon 602, the electronic device can display a second user interface of the first application, which can be used to indicate the content of the application of the rounded icon 602. Exemplarily, the second user interface can include information such as an introduction to the functions of the application corresponding to the rounded icon 602. Also exemplary, the second user interface can also be used to indicate the way to install the first application.

[0142] It should be understood that the graphics rendering method provided in the embodiments of the present application can also be applied to other application scenarios that include rounded-corner icons. For example, the user interface of a video playback application may include multiple video playback controls, each of which may include one or more rounded corners. The graphics rendering method provided in the embodiments of the present application can also be used to render the video playback controls on the user interface of the video playback application.

[0143] In actual applications, the size, shape, curvature, etc. of the rounded corners of different types of rounded icons may be different. The following is an illustrative introduction to some possible shapes of rounded icons in conjunction with Figure 7. It should be understood that the shape of the icon shown in Figure 7 should not be regarded as a limitation on the graphics rendering method provided in this application.

[0144] Figure 7 illustrates four different rounded-corner icons: a first rounded-corner icon 701, a second rounded-corner icon 702, a third rounded-corner icon 703, and a fourth rounded-corner icon 704. These four rounded-corner icons can be considered to be evolved from rectangular icons with different types of rounded corners. For the first rounded-corner icon 701, the second rounded-corner icon 702, and the fourth rounded-corner icon 704, the four rounded corners are all the same size and arc. Each rounded corner of the first rounded-corner icon 701 has a smaller central angle and a shorter arc length. Each rounded corner of the second rounded-corner icon 702 has a larger central angle and a longer arc length. The fourth rounded-corner icon 704 has the largest arc portion and the longest arc length. This fourth rounded-corner icon 704 can also be referred to as a circular icon 704.

[0145] Unlike the first rounded corner icon 701, the second rounded corner icon 702, or the fourth rounded corner icon 704, the third rounded corner icon 703 includes two different types of rounded corners (hereinafter referred to as rounded corner a and rounded corner b). Rounded corner a includes an arc portion with a smaller central angle and a shorter arc length, while rounded corner b includes an arc portion with a larger central angle and a longer arc length.

[0146] Taking the first rounded-corner icon 701 in Figure 7 as an example, the composition of rounded-corner icons will be further described. As shown in Figure 8, the first rounded-corner icon 701 may include a first area 810 and a second area 820. The first area 810 includes the arc in the first icon 701 and can also be referred to as the rounded-corner area 810. The second area 820 does not include the arc in the first icon 701.

[0147] 7 , the larger the central angle of the arc contained in the first region 810 or the longer the arc length, the larger the area of ​​the first region, and correspondingly, the smaller the area of ​​the second region 820. In the actual rendering process, it is possible to minimize repeated drawing of the second region 820.

[0148] In the above Figure 8, for the sake of convenience of explanation, the first area 810 is represented in the form of a triangle. It should be understood that the first area is the part (area) in the icon that contains an arc. In the actual rendering process, this part can also be divided into other shapes, such as rectangles, circles, hexagons and other polygons.

[0149] FIG9 is a schematic diagram showing the architecture of a graphics processing unit (GPU) suitable for use in an embodiment of the present application.

[0150] As shown in the figure, the GPU includes video memory and multiple computer units (CUs). Video memory, also known as global memory, generally refers to the dynamic random access memory (DRAM) on the GPU motherboard. It has large capacity but relatively slow speed. Both the central processing unit (CPU) and the GPU can access the global cache.

[0151] A compute unit (CU) is a unit within a GPU that processes data and / or instructions. Each CU may also include components such as a control module, registers, cache, and an instruction pipeline. Different GPU types may have different CU names and configurations.

[0152] Exemplarily, the computing unit may also be referred to as a stream multiprocessor (SM), a streaming processor (SP), or a shader processor (SP).

[0153] For example, the computing unit may include an L1 cache, a register file, an interconnect network, and shared memory (SMEM). The register file is used to store data that the computing unit needs to process, the interconnect network is used to support data transmission between modules within the computing unit, and the shared memory can also be called a programmable cache.

[0154] During the actual graphics rendering process, the GPU can obtain the data to be processed and instructions indicating how to process the data from the global memory, and transmit these data and instructions to multiple computing units inside the GPU. Multiple computing units can assist each other in completing data processing. After the processed data is written to the global memory, it can be read by electronic devices to obtain the graphics rendering results.

[0155] FIG10 exemplarily provides a method for GPU rendering graphics.

[0156] S1001, obtain vertex information.

[0157] In response to an instruction to draw graphics, the CPU may send data and instructions used to render the target graphics to the global memory, and the GPU may obtain these data and instructions by reading the global memory.

[0158] In some examples, the CPU may send the target graphics information to the global memory at one time, or the CPU may send the target graphics information to the global memory multiple times.

[0159] In some examples, the GPU may read all of the target graphics information in the global memory at once, or the GPU may read the target graphics information in batches.

[0160] In one possible implementation, the CPU can divide the target graphics into multiple target triangles, which can be spliced ​​together to form the target graphics. Each of the multiple triangles can include vertex information. The GPU can read the vertex information for drawing the target rounded icon from the global memory. The vertex information can include the vertex coordinates of each triangle.

[0161] S1002, geometry processing.

[0162] The GPU's geometric processing is mainly used to perform vertex coordinate transformation, lighting, clipping, projection, and screen mapping. The above processing operations can be specifically performed by multiple computing units contained in the GPU. After the above processing, information such as vertex coordinates, color, and texture coordinates can be obtained.

[0163] In some examples, after obtaining the aforementioned vertex information, the GPU may distribute the vertex information to multiple computing units included in the GPU, and the multiple computing units may process the distributed vertex information.

[0164] The multiple calculation units may determine corresponding triangles according to vertex coordinates included in the vertex information. Specifically, the multiple calculation units may connect multiple vertices according to a first preset rule to form a triangle.

[0165] Optionally, after determining the triangle, the plurality of computing units may further adjust the vertex coordinates of some of the plurality of vertices according to a second preset rule. This adjustment process may improve the similarity between the rendered graphic and the target graphic.

[0166] In some examples, after the above processing, the GPU may also determine the geometric texture and geometric lighting properties of the vertices included in the graphics to be rendered. Specifically, the GPU may retrieve the texture information and lighting information of each vertex from the cache and add the retrieved texture information and lighting information to the corresponding vertex.

[0167] S1003, rasterization.

[0168] The coordinate information obtained after geometric processing is three-dimensional information. In some scenarios, since the rendered graphics need to be displayed on a two-dimensional screen, it is necessary to convert the three-dimensional information into two-dimensional information.

[0169] Rasterization is the process of converting geometric primitives into a two-dimensional image. Rasterization is primarily used to determine which integer grid areas in window coordinates are occupied by primitives and to assign color and depth values ​​to different areas. In other words, the purpose of rasterization is to find the pixels covered by a geometric unit (such as a circle).

[0170] The GPU can determine how many pixels are needed to form a geometric unit based on the coordinates of the three vertices of the triangle, as well as the information of each pixel, such as the two-dimensional coordinates of the pixel.

[0171] S1004, pixel shader processing.

[0172] Pixel shader processing is the process of processing each pixel obtained in S1003. The two-dimensional image generated in S1003 is composed of individual pixels. In some examples, the pixel shader can perform mapping on the pixels to achieve visual effects such as surface lighting, semi-reflection, diffuse reflection, or refraction between interfaces.

[0173] In some examples, the pixel shader may also determine the color and transparency of each pixel. For example, the pixel shader may determine the red, green, blue, alpha (RGBA) value of each pixel.

[0174] In other examples, the pixel shader can obtain texture map data from global memory and load the texture map data into the corresponding pixel.

[0175] S1005, rendering output.

[0176] Special effects processing such as atomization is performed on the graphics obtained in S1004, and the graphics are mixed into a final image and output.

[0177] In some examples, the GPU may also perform sampling and anti-aliasing operations on the target graphics.

[0178] The GPU can transfer the processed image data to the global memory, which is read by the CPU and displayed on the screen.

[0179] FIG11 illustrates a graphics rendering method provided by an embodiment of the present application. In this embodiment, an electronic device can render only the rounded corner areas of a rounded icon that contain arc portions, thereby reducing the need for repeated rendering of non-rounded corner areas. This method is described in detail below with reference to FIG11 and FIG12.

[0180] S1101, rendering the first part of the user interface.

[0181] The user interface may also be referred to as a target interface or a to-be-rendered interface. The user interface includes a first portion and a second portion. The second portion includes a target icon, and the target icon includes at least one rounded corner. In some scenarios, the first portion of the user interface may also be referred to as the background portion of the user interface, and the second portion of the user interface may also be referred to as the foreground portion of the user interface.

[0182] In some examples, the second portion may refer to a portion of the user interface that includes rounded corners, and the first portion may refer to a portion of the user interface that does not include rounded corners. Taking the first interface 1210 in Figure 12 as an example, in the first interface 1210, the first portion may refer to the first portion to be rendered 1211, and the second portion may refer to the second portion to be rendered 1212.

[0183] In some examples, for a user interface displayed on a desktop, the second portion may include icons, cards, and other portions of the user interface; icons, cards, and other portions may have rounded corners. The first portion may include portions of the user interface other than icons, cards, and other portions.

[0184] Taking the second rendering portion 1212 as an example, the four triangular regions illustrated can be used as the rounded corner regions of the foreground portion, and the region within the four triangular regions (not shown) can be used as the central region of the foreground portion. It should be understood that for an icon, the central region and the rounded corner regions can be a rectangular shape as a whole, or the central region and the rounded corner regions can be a non-rectangular symmetrical shape as a whole.

[0185] In Figure 12 , second portion to be rendered 1212 is a rectangle. In other examples, the second portion to be rendered can also be a pentagon, hexagon, or other shape. In Figure 12 , second portion to be rendered 1212 can just contain the rounded icon, or in other words, second portion to be rendered 1212 is the smallest rectangle that can contain the rounded icon. In some scenarios, the second portion can be larger than the area of ​​second portion to be rendered 1212 in Figure 12 .

[0186] The first interface 1210 shows the case where the user interface to be rendered contains only one icon. If the user interface to be rendered contains multiple rounded-corner icons, the second part may refer to a set of multiple areas containing rounded corners, each of which contains at least one rounded corner. In this case, the first part may refer to areas of the user interface to be rendered other than the set of multiple areas.

[0187] In some examples, the CPU can read information of the user interface to be rendered from the memory and determine the first part and the second part based on the information. In other words, the CPU can divide the user interface to be rendered into regions based on the information of the user interface to be rendered.

[0188] After dividing the user interface to be rendered into regions, the CPU may store a first portion of information (hereinafter referred to as first information) in the global memory (see FIG. 9 ). The first information may include coordinate information, color information, texture information, etc. of the vertices included in the first portion. The CPU may also store a second portion of information (hereinafter referred to as second information) in the global memory. The second information may include coordinate information, color information, texture information, etc. of the vertices included in the second portion.

[0189] The GPU can read the first information from the global memory and render the first part of the user interface to be rendered. The detailed process of the GPU rendering the first part can refer to the embodiment shown in Figure 10, and for the sake of brevity, detailed description is not given here.

[0190] S1102, rendering the rounded corner area of ​​the second part.

[0191] The rounded corner area may refer to an area including an arc portion in the user interface to be rendered. The shape of the rounded corner area may be different depending on the division method. For example, the rounded corner area may be a triangle, a rectangle, or other polygons.

[0192] In some examples, the rounded corner area may be circumscribed to the arc it contains. In other words, the rounded corner area may be the smallest triangle, rectangle, or other polygon that can contain the arc.

[0193] Taking the third portion to be rendered 1220 in FIG. 12 as an example (for ease of explanation, the third portion to be rendered 1220 in FIG. 12 is an enlarged view of the rounded corner area), the third portion to be rendered 1220 includes four sub-areas, which can all be referred to as rounded corner areas. The shapes of the four sub-areas are all exemplified as triangles, and each sub-area contains a circular arc. Two of the three sides of the triangle are tangent to the circular arc.

[0194] In some examples, the rounded corner area can be determined by the CPU. For example, the CPU can divide the rounded corner area included in the user interface to be rendered based on the information of the user interface to be rendered. After determining the position and range of the rounded corner area, the CPU can store the information of the rounded corner area (hereinafter referred to as third information) in the global memory, so that the GPU can read the third information from the global memory and render the rounded corner area.

[0195] The third information may include coordinate information, color information, texture information, etc. of the vertices included in the rounded area.

[0196] In other examples, the rounded corner area may be determined by a GPU. For example, the GPU may read the second portion of information (eg, second information) stored in the global memory in S1101 and determine the rounded corner area based on the second information.

[0197] For example, the GPU can read the color information of each vertex in the second information, and determine that the vertices with large differences in color, texture, etc. between adjacent vertices are the vertices on both sides of the arc in the rounded area, and then determine the length and range of the arc. Based on the length and range of the arc, the rounded area that can contain the arc can be determined.

[0198] Also illustratively, the GPU may crop the second portion according to the second information, thereby determining the aforementioned rounded corner area.

[0199] After determining the rounded corner area, the GPU can obtain information about the vertices within the rounded corner area and render the rounded corner area. Different from the CPU's determination method, this information is referred to as fourth information below and can include vertex coordinates, color, texture, and other information.

[0200] The detailed process of GPU rendering the rounded corner area can be referred to the embodiment shown in FIG9 , and for the sake of brevity, detailed description is omitted here.

[0201] It should be noted that the above S1101 and S1102 can be executed in one rendering process.

[0202] S1103: Render the second part of the user interface to be rendered.

[0203] The second part may refer to a part including rounded corners in the user interface to be rendered, and the second part and the first part constitute the user interface to be rendered.

[0204] The second portion to be rendered 1212 in FIG. 12 is an example of the second portion. The second portion to be rendered 1212 may include a target icon, and the target icon includes at least one rounded corner.

[0205] In some examples, the target icon may be one or more of an icon of an application program installed on the electronic device, an icon of a mini-program, an icon of a quick app, an icon of a desktop plug-in, and the like.

[0206] The GPU can read the second information in S1101 from the global memory and render the second part according to the second information. The process of GPU rendering the second part can be specifically referred to the embodiment shown in FIG9 , which is not described in detail here for the sake of brevity.

[0207] In some examples, the GPU can also perform anti-aliasing on rounded corners.

[0208] For example, the GPU can extract information about the vertices on both sides of the arc in the rounded area, such as color, transparency, etc., and mix the vertex information on both sides. For example: the color value of the vertex on one side of the arc (such as the first side 1221 in Figure 12) is A, and the color area of ​​the vertex on the other side (such as the second side 1222 in Figure 12) is B. The color value after mixing the vertices on both sides is C, and the value of C can be A×α+B×﹙1-α﹚, where α is greater than 0 and less than 1.

[0209] In other examples, the electronic device may render the user interface and then render the rounded corner area of ​​the first portion. It should be understood that the electronic device may repeatedly render the rounded corner area but not repeatedly render other areas of the first portion (such as the central area) and the second portion, thereby reducing the rendering power consumption of the electronic device and improving rendering efficiency.

[0210] In other examples, for the above-mentioned repeated rendering, the electronic device may render the rounded area 2 times, 3 times, or 4 times, etc., and the embodiments of the present application do not impose any restrictions on this.

[0211] For example, after the electronic device renders the user interface, the rounded corner area of ​​the user interface may not be anti-aliased. Repeatedly rendering the rounded corner area may add an anti-aliasing effect to the rounded corner area.

[0212] S1104: Output the user interface to be rendered.

[0213] After the GPU renders the first part, the second part and the rounded corner area, the color, texture and other information of the pixels corresponding to these areas can be stored in the global memory. The CPU can read this information and display the user interface to be rendered on the screen of the electronic device based on this information, thereby realizing the output of the user interface to be rendered.

[0214] Exemplarily, after the GPU renders the first portion to be rendered 1211 , the second portion to be rendered 1212 , and the third portion to be rendered 1220 in FIG. 12 , the electronic device may display the graphics to be rendered on the screen, namely, the first interface 1210 in FIG. 12 .

[0215] Taking Figure 12 as an example, if the size of the second part to be rendered 1212 is 150 pixels × 150 pixels, and the size of the four sub-areas contained in the third part to be rendered 1220 is 35 pixels × 35 pixels / 2, then the number of pixels required to render the second part to be rendered 1212 in the manner shown in Figure 3 is 45,000, while the number of pixels required to render in the manner shown in Figure 12 is 25,950. Since the number of pixels required to be rendered is greatly reduced, the graphics rendering method provided in this application can improve rendering efficiency and enhance the response speed of electronic devices to user operations in rendering scenarios.

[0216] It should be noted that the order of execution of the above processes does not necessarily imply a specific sequence. The execution order of each process should be determined by its function and inherent logic. For example, S1103 can be executed before S1101, or after S1101 and before S1102.

[0217] Based on the same inventive concept as the above method embodiments, as shown in Figure 13, an embodiment of the present application also provides a user interface rendering device 1300, which includes an acquisition module 1310 and a processing module 1320. The acquisition module is used to execute the acquisition operation performed by the electronic device in the embodiments shown in Figures 3 to 12, such as reading information of the user interface to be rendered from the global memory; the processing unit is used to execute the processing operation performed by the electronic device in the embodiments shown in Figures 3 to 12, such as rendering the target user interface.

[0218] Optionally, the user interface rendering device 1300 may further include a storage module 1330 for storing program codes and data of the user interface rendering device 1300 .

[0219] Figure 14 is a schematic block diagram of an electronic device 1400 provided in an embodiment of the present application. As shown, the electronic device 1400 includes at least one processor 1410 and a transceiver 1420. The processor 1410 is coupled to a memory and is configured to execute instructions stored in the memory to control the transceiver 1420 to transmit and / or receive signals.

[0220] Optionally, the electronic device 1400 further includes a memory 1430 for storing instructions.

[0221] In some embodiments, the processor 1410 and memory 1430 may be combined into a processing device, and the processor 1410 is configured to execute program codes stored in the memory 1430 to implement the aforementioned functions. In specific implementations, the memory 1430 may also be integrated into the processor 1410 or independent of the processor 1410.

[0222] In some embodiments, the transceiver 1420 may include a receiver (or receiver) and a transmitter (or transmitter).

[0223] The transceiver 1420 may further include an antenna, which may be one or more. The transceiver 1420 may be a communication interface or an interface circuit.

[0224] When the electronic device 1400 is a chip, the chip includes a transceiver unit and a processing unit. The transceiver unit may be an input / output circuit or a communication interface; the processing unit may be a processor, microprocessor, or integrated circuit integrated on the chip.

[0225] During implementation, each step of the above method can be completed by an integrated logic circuit of the hardware in the processor or by instructions in the form of software. The steps of the method disclosed in conjunction with the embodiments of the present application can be directly embodied as being executed by a hardware processor, or can be executed by a combination of hardware and software modules in the processor. The software module can be located in a storage medium mature in the art such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory, and the processor reads the information in the memory and completes the steps of the above method in conjunction with its hardware. To avoid repetition, it will not be described in detail here.

[0226] An embodiment of the present application further provides a computer-readable storage medium storing computer instructions for implementing the method executed by the electronic device in the above method embodiment.

[0227] For example, when the computer program is executed by a computer, the computer can implement the method performed by the electronic device in the above method embodiment.

[0228] The explanation of the relevant contents and beneficial effects of any of the above-mentioned devices can be referred to the corresponding method embodiments provided above, which will not be repeated here.

[0229] It should be understood that the processor mentioned in the embodiments of the present application may be a central processing unit, or may be other general-purpose processors, DSPs, application-specific integrated circuits (ASICs), field programmable gate arrays (FPGAs) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor.

[0230] It should also be understood that the memory mentioned in the embodiments of the present application may be a volatile memory and / or a non-volatile memory. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM). For example, RAM can be used as an external cache. As an example and not a limitation, RAM may include the following forms: static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct rambus RAM (DR RAM).

[0231] It should be noted that when the processor is a general-purpose processor, DSP, ASIC, FPGA or other programmable logic device, discrete gate or transistor logic device, discrete hardware component, the memory (storage module) can be integrated into the processor.

[0232] It should also be noted that the memory described herein is intended to include, but is not limited to, these and any other suitable types of memory.

[0233] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software 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 beyond the scope of this application.

[0234] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0235] In the several embodiments provided in this application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of the units is merely a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0236] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of the solution of this embodiment according to actual needs.

[0237] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0238] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory, a random access memory, a magnetic disk, or an optical disk.

[0239] The above description is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this application should be included in the scope of protection of the present application. Therefore, the scope of protection of the present application should be based on the scope of protection of the claims.

Claims

1. A method for rendering a user interface, characterized in that: The method comprises: Rendering a background portion of the user interface, the user interface comprising the background portion and a foreground portion having a target icon; Rendering a rounded corner area of ​​the foreground portion, wherein the foreground portion includes a central area and the rounded corner area located around the central area, and the rounded corner area includes a rounded corner of the target icon; Rendering the foreground portion of the user interface.

2. The method according to claim 1, characterized in that The method further comprises: reading indication information, where the indication information is used to indicate the rounded corner area; or, The rounded corner area is determined according to the target icon.

3. The method according to claim 1 or 2, characterized in that: The method further includes: performing an anti-aliasing operation on the rounded corner area.

4. The method according to any one of claims 1 to 3, characterized in that The rounded corner area includes a plurality of sub-areas, and the plurality of sub-areas are in a triangular shape.

5. The method according to any one of claims 1 to 4, characterized in that The foreground part is a rectangle, the size of the foreground part in the length direction is equal to the maximum size of the target icon in the length direction, and the size of the foreground part in the width direction is equal to the maximum size of the target icon in the width direction.

6. The method according to any one of claims 1 to 5, characterized in that The target icon is one or more of an application icon, a mini-program icon, a quick app icon, or a desktop plug-in icon.

7. The method according to claim 6, characterized in that The method further comprises: The user interface is displayed, where the user interface is a user interface of a desktop application.

8. A method for rendering a user interface, characterized in that: The method comprises: Rendering a user interface, the user interface comprising a background portion and a foreground portion, the foreground portion being used to display a target icon, the foreground portion comprising a rounded corner area, and the rounded corner of the target icon is located in the rounded corner area; Render the rounded area anti-aliased.

9. The method according to claim 8, characterized in that The method further includes: reading indication information, where the indication information is used to indicate the rounded corner area; or, The rounded corner area is determined according to the target icon.

10. The method according to claim 8 or 9, characterized in that The rounded corner area includes a plurality of sub-areas, and the plurality of sub-areas are in a triangular shape.

11. An electronic device, characterized in that: The method comprises a processor and a memory, wherein the memory is used to store program instructions, and the processor is used to call the program instructions to execute the method according to any one of claims 1 to 7, or execute the method according to any one of claims 8 to 10.

12. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and when the computer program is executed by a computer, the method according to any one of claims 1 to 7 is implemented, or the method according to any one of claims 8 to 10 is executed.

Citation Information

Patent Citations

  • Method for displaying user interface and electronic equipment

    CN110597512A

  • Image rendering method and system, VR equipment, device and readable storage medium

    CN112164016A

  • Display method and electronic equipment

    CN114356196A

  • Graph rendering method and device and storage medium

    CN114627225A

  • Compositing graphical objects

    US7079151B1