Rendering methods, devices and electronic equipment

By synthesizing and rendering texture data of 2D and 3D component objects, the problem of inconsistent display progress in electronic devices is solved, improving the user experience.

CN119722897BActive Publication Date: 2025-10-31HUAWEI TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410211643.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Priority Date
2023-09-28
Filing Date
2024-02-26
Publication Date
2025-10-31
Estimated Expiration
2044-02-26

AI Technical Summary

Technical Problem

In electronic devices, the independent rendering of 3D and 2D objects leads to inconsistent display progress, affecting the user experience.

Method used

By compositing the texture data of 2D component objects and 3D component objects and rendering them according to their layout information, fused texture data is generated, ensuring consistent lifecycle.

Benefits of technology

It achieves a seamless display of 2D and 3D objects, enhancing the user experience and avoiding inconsistencies in display progress.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119722897B_ABST
    Figure CN119722897B_ABST
Patent Text Reader

Abstract

This application provides a rendering method, apparatus, and electronic device, relating to the field of terminal technology. The method includes: the electronic device determining first layout information and a first component type of a 2D object corresponding to a target application, and second layout information and a second component type of a 3D object. The electronic device can also create a 2D component object and first texture data of the 2D component object based on the first component type, and create a 3D component object and second texture data of the 3D component object based on the second component type. The electronic device can synthesize the first texture data and the second texture data to obtain third texture data, and render the third texture data according to the first layout information and the second layout information to generate and display the 2D and 3D objects. This method enables the fusion rendering of 2D and 3D component objects, avoiding inconsistencies in display effects when displaying 3D and 2D objects.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application claims priority to Chinese Patent Application No. 202311291866.8, filed with the State Intellectual Property Office of China on September 28, 2023, entitled “Rendering Method, Apparatus and Electronic Device”, the entire contents of which are incorporated herein by reference. Technical Field

[0002] This application relates to the field of terminal technology, and in particular to a rendering method, apparatus and electronic device. Background Technology

[0003] Three-dimensional (3D) objects are rapidly evolving in electronic devices, offering stunning visual effects and providing users with a comprehensive interactive experience. Typical applications of 3D objects include 3D images, such as 3D digital humans, 3D object merchandise, 3D motion effects, and virtual reality (VR) / augmented reality (AR) experiences that heavily rely on 3D.

[0004] When displaying 3D objects, electronic devices often display them alongside 2D objects (such as 2D images). This requires the electronic device to render both the corresponding 3D component objects (e.g., 3D view components) and the corresponding 2D component objects (e.g., 2D view components) for the 3D objects. Specifically, the electronic device needs to render the 3D and 2D component objects independently and then send them to the display screen. Because the 2D and 3D component objects are rendered independently and have different lifecycles, inconsistencies in display progress can occur, ultimately reducing the user experience. Summary of the Invention

[0005] This application provides a rendering method, apparatus, and electronic device that enables the electronic device to merge and render 2D component objects and 3D component objects, avoiding inconsistencies in display effects when displaying 3D objects and 2D objects.

[0006] In a first aspect, embodiments of this application provide a rendering method applied to an electronic device. The method includes: the electronic device determining first layout information and a first component type of a 2D object corresponding to a target application, and second layout information and a second component type of a 3D object. The electronic device can also create a 2D component object and first texture data of the 2D component object based on the first component type, and create a 3D component object and second texture data of the 3D component object based on the second component type. The electronic device synthesizes the first texture data and the second texture data to obtain third texture data, and renders the third texture data according to the first layout information and the second layout information to generate 2D objects and 3D objects. Then, the electronic device can display the application interface of the target application, the application interface including 2D objects and 3D objects.

[0007] Thus, this embodiment of the application synthesizes the texture data of 2D component objects and 3D component objects, and renders the synthesized texture data according to their corresponding layout information. This ensures that the lifecycles of 2D and 3D component objects are consistent, and achieves a seamless display effect between them. Even in scenarios where there are transitions between the content of 2D and 3D component objects, the content of both objects can transition together, maintaining a consistent animation experience. This, in turn, improves the user experience.

[0008] In one possible implementation, during the creation of a 2D component object and its first texture data, the electronic device can create the 2D component object and its corresponding 2D rendering node, and generate the first texture data based on the 2D rendering node. Similarly, during the creation of a 3D component object and its second texture data, the electronic device can create the 3D component object and its corresponding 3D rendering node, and generate the second texture data based on the 3D rendering node.

[0009] Thus, in this embodiment, 2D component objects and their corresponding 2D rendering nodes can be pre-created, as well as 3D component objects and their corresponding 3D rendering nodes. Then, first texture data and second texture data are generated based on the 2D and 3D rendering nodes. This facilitates the subsequent compositing and rendering of the texture data of the 2D and 3D component objects, thereby achieving a blended display effect between the 2D and 3D objects. It also avoids situations where the lifecycles of the 2D and 3D component objects are inconsistent.

[0010] In one implementation, the electronic device includes a rendering engine, which includes at least one application programming interface (API) for setting a window handle to the rendering engine. The rendering engine then renders the 3D component object bound to the window handle. During the generation of second texture data in a 3D rendering node, the electronic device can load 3D resources from the rendering engine into the 3D rendering node, create a virtual window, and update the window handle in the rendering engine using the at least one API. The electronic device can also create rendering context state information and a rendering window within the virtual window, and generate the second texture data based on the rendering context state information and the rendering window.

[0011] In this way, the electronic device can preload 3D resources from the rendering engine, create a virtual window, and update the rendering engine's window handle. Then, the electronic device can create rendering context state information and a rendering window within the virtual window to generate second texture data corresponding to the 3D component object. This allows the device to use pre-defined component data from the 3D component object, such as background resources, text resources, and line resources, and complete the subsequent rendering of the 3D component object through at least one application programming interface (API) of the rendering engine. This eliminates the need to render all data in the component object, improving rendering efficiency.

[0012] In one possible implementation, the method further includes: the electronic device can register the first texture data and the second texture data to the graphics processing unit (GPU).

[0013] Thus, this embodiment of the application can directly register the texture data corresponding to 2D component objects and 3D component objects in the GPU, avoiding the creation of texture caches in the central processing unit (CPU). The subsequent rendering engine can directly obtain texture data from the GPU for rendering, eliminating the need for texture data transfer between the CPU and GPU. This saves CPU processing time between different texture caches and the time spent transferring textures to the GPU, improving rendering efficiency. Simultaneously, it also saves memory occupied by texture data and GPU video memory.

[0014] In one possible implementation, during the process of registering the first texture data and the second texture data to the graphics processing unit (GPU), the electronic device can generate a first texture identifier corresponding to the first texture data and a second texture identifier corresponding to the second texture data. The electronic device can also register the first texture data and the second texture data to the GPU based on the first texture identifier and the second texture identifier.

[0015] In this way, electronic devices can register the first and second texture data to the graphics processing unit (GPU) using texture identifiers. This allows subsequent rendering to directly retrieve the corresponding texture data from the GPU, eliminating the need for texture data transfer between the CPU and GPU, thus improving rendering performance and saving device resources.

[0016] In one possible implementation, during the process of combining first texture data and second texture data to obtain third texture data, the electronic device can obtain the first texture data from the GPU based on the first texture identifier, and can also obtain the second texture data from the GPU based on the second texture identifier. Then, the electronic device can combine the first texture data and the second texture data to obtain the third texture data.

[0017] In this way, electronic devices can directly obtain the corresponding texture data from the GPU for rendering using texture identifiers, without the need for texture data transfer between the CPU and GPU, which greatly improves rendering performance.

[0018] Furthermore, by combining the first texture data and the second texture data in this embodiment, the 2D component objects and 3D component objects can be rendered in parallel, eliminating the need for separate rendering and effectively reducing rendering time and resources. This ensures that the lifecycles of the 2D and 3D component objects are consistent, avoiding inconsistencies in display progress during subsequent display processes. Ultimately, this improves the user's visual experience.

[0019] In one possible implementation, during the process of determining the first layout information and first component type of the 2D component object corresponding to the target application, and the second layout information and second component type of the 3D component object, the electronic device can parse the application interface to obtain the first component type and second component type in the application interface, as well as the style and attributes corresponding to the 2D component object and the 3D component object. The electronic device can also determine the first layout information based on the style and attributes corresponding to the 2D component object, and determine the second layout information based on the style and attributes corresponding to the 3D component object.

[0020] Thus, this embodiment of the application can pre-parse the application interface to obtain the styles and attributes corresponding to the component objects, and determine their corresponding positions and sizes based on these styles and attributes. Subsequently, the 2D and 3D component objects can be rendered comprehensively based on the first layout information corresponding to the 2D component objects and the second layout information corresponding to the 3D component objects. This ensures that the lifecycles of the 2D and 3D component objects are consistent and achieves the effect of merging and displaying 2D and 3D objects, thereby improving the user experience.

[0021] In one possible implementation, the electronic device can obtain a component data package of the rendering engine during the parsing of the application interface; the component data includes at least one application programming interface (API) of the rendering engine, which operates based on a native API mechanism, and parses the application interface according to the component data package.

[0022] Thus, after an electronic device obtains at least one application programming interface (API) of the rendering engine, this API can operate based on the Native API mechanism, enabling bidirectional data communication between TypeScript (TS) and C++. Even if different electronic devices use different operating systems and different development framework languages, they can still compile and run at least one API of the rendering engine. For example, the development framework language used by the application can be Java, Kotlin, Swift, TypeScript, or JavaScript, while the native language of the operating system can be C or C++. Based on this implementation example, when developing applications for devices on different operating systems (such as HarmonyOS, iOS, or Android), developers do not need to use the development framework languages ​​corresponding to different operating systems to interface with the rendering engine. Developers can use a single language, such as any of the languages ​​mentioned above (Java to JavaScript), to develop an application that can run on devices with different operating systems, lowering the technical barrier for developers and ensuring consistent rendering effects across different operating systems.

[0023] In one possible implementation, the method further includes: the electronic device can create a drawing canvas corresponding to the application interface; wherein the drawing canvas is used to render 2D component objects and 3D component objects.

[0024] Therefore, this embodiment does not apply different drawing canvases for 2D component objects and 3D component objects, but instead applies for a corresponding drawing canvas for each application interface. This ensures that 2D component objects and 3D component objects have a consistent lifecycle and consistent subsequent display progress, such as consistent display time, consistent display effect change time, and consistent display end time. This, in turn, improves the user experience.

[0025] In one possible implementation, at least one application programming interface includes any one or more of the following: an interface for setting up 3D objects and creating 3D component objects; an interface for setting up 2D objects and creating 2D component objects; an interface for setting whether the camera in the 3D scene and the 2D scene can move; an interface for setting the background in the 3D scene and the 2D scene; an interface for setting the transparency; an interface for adding custom drawing objects; an interface for adding shapes and geometry; and an interface for setting 3D animation effects and 2D animation effects.

[0026] In one possible implementation, the operating system of the electronic device includes any of the following: system, system, system, system, system, and system.

[0027] In one implementation, the first layout information includes the position and size of the 2D object, and the second layout information includes the position and size of the 3D object.

[0028] In one possible implementation, the component types of the 2D component objects and 3D component objects include any of the following: text view component, video view component, webpage view component, link view component, camera view component, live stream view component, and advertisement view component.

[0029] Secondly, embodiments of this application also provide a rendering apparatus, which includes: a compilation module, a window cross-platform module, a component module, a rendering engine, and a display module.

[0030] The compilation module is used to determine the first component type of the 2D object and the second component type of the 3D object corresponding to the target application, as well as the style and properties of the 2D component object and the 3D component object.

[0031] The window cross-platform module is used to determine the first layout information based on the style and properties of the 2D component object.

[0032] The window cross-platform module is also used to determine the second layout information based on the style and attributes of the 3D component object.

[0033] The window cross-platform module is also used to create 2D component objects based on the first component type.

[0034] The window cross-platform module is also used to create 3D component objects based on the second component type.

[0035] The component module is used to create the initial texture data for 2D component objects.

[0036] The component module is also used to create secondary texture data for 3D component objects.

[0037] The component module is also used to synthesize the first texture data and the second texture data to obtain the third texture data.

[0038] The rendering engine is used to render the third texture data based on the first layout information and the second layout information, generating 2D objects and 3D objects.

[0039] The display module is used to display the application interface of the target application, which includes 2D objects and 3D objects.

[0040] Thus, the rendering apparatus provided in this application embodiment can synthesize the texture data of 2D component objects and 3D component objects, and render the synthesized texture data according to their corresponding layout information. This ensures that the lifecycles of 2D and 3D component objects are consistent, and achieves a seamless display effect between the two. Even in scenarios where there are transitions between the content of 2D and 3D component objects, the content of both objects can transition together, maintaining a consistent animation experience. This, in turn, improves the user experience.

[0041] Thirdly, embodiments of this application provide an electronic device, including a memory and one or more processors; the memory is coupled to the processors; wherein the memory stores computer program code, the computer program code including computer instructions, and when the computer instructions are executed by the processor, the electronic device performs the rendering method as described in the first aspect above.

[0042] Fourthly, embodiments of this application provide a computer-readable storage medium storing instructions that, when executed on a computer, enable the computer to perform the rendering method as described in the first aspect above. Attached Figure Description

[0043] Figure 1 A schematic diagram of the hardware structure of a mobile phone provided in an embodiment of this application;

[0044] Figure 2 A schematic diagram of the software structure of a mobile phone provided in an embodiment of this application;

[0045] Figure 3 A schematic diagram of the main screen interface provided in an embodiment of this application;

[0046] Figure 4 A flowchart illustrating the rendering method provided in an embodiment of this application;

[0047] Figure 5This is a schematic diagram illustrating the interaction between multiple modules provided in the embodiments of this application;

[0048] Figure 6 A schematic diagram of the rendering process of the rendering method provided in the embodiments of this application;

[0049] Figure 7 This is a schematic diagram of the structure of the rendering apparatus provided in the embodiments of this application;

[0050] Figure 8 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0051] The technical solutions of the embodiments of this application will be described below with reference to the accompanying drawings. In the description of this application, unless otherwise stated, " / " indicates that the objects before and after are in an "or" relationship. For example, A / B can represent A or B. "And / or" in this application is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, and B alone, where A and B can be singular or plural. Furthermore, in the description of this application, unless otherwise stated, "multiple" refers to two or more. "At least one of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, or c can represent: a, b, c, ab, ac, bc, or abc, where a, b, and c can be single or multiple. In addition, in order to clearly describe the technical solutions of the embodiments of this application, the terms "first" and "second" are used in the embodiments of this application to distinguish the same or similar items with basically the same function and effect.

[0052] Those skilled in the art will understand that the terms "first," "second," etc., do not limit the quantity or order of execution, and that "first," "second," etc., are not necessarily different. Furthermore, in some embodiments of this application, words such as "exemplary" or "for example" are used to indicate that something is being described as an example, illustration, or description. Any embodiment or design scheme described as "exemplary" or "for example" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or design schemes. Specifically, the use of words such as "exemplary" or "for example" is intended to present the relevant concepts in a concrete manner for ease of understanding.

[0053] Furthermore, the device architecture and business scenarios described in the embodiments of this application are for the purpose of more clearly illustrating the technical solutions of the embodiments of this application, and do not constitute a limitation on the technical solutions provided in the embodiments of this application. As those skilled in the art will know, with the evolution of device architecture and the emergence of new business scenarios, the technical solutions provided in the embodiments of this application are also applicable to similar technical problems.

[0054] During the rendering process, electronic devices need to independently render the 3D component objects corresponding to 3D objects and the 2D component objects corresponding to 2D objects, and then send the rendered 3D component objects and 2D component objects to the display to enable the subsequent display of 2D and 3D objects. Here, component objects are visual elements in a page or application, such as 2D view components and 3D view components. In other words, electronic devices need to independently render 2D view components and 3D view components to display 2D and 3D objects.

[0055] Specifically, electronic devices can request different drawing canvases to render 2D component objects and 3D component objects separately. Among them, the 3D component object is only a placeholder. The rendering of the 3D component object depends on the rendering engine. After the rendering engine renders the content of the 3D component object, it transmits the rendered texture data to the 3D component object for display.

[0056] Therefore, since each drawing canvas is rendered and displayed independently, there can be inconsistencies in the lifecycles of 2D and 3D component objects. Consequently, in scenarios where content transitions between 2D and 3D component objects, the displayed animations of the 2D and 3D objects will appear inconsistent. Furthermore, if a pop-up component exists on the page, and its position happens to be within the display area of ​​the 3D component object, it may obscure the pop-up component, preventing it from displaying correctly.

[0057] Based on the above, this application provides a rendering method applicable to electronic devices. The method includes: the electronic device determining first layout information and a first component type for a 2D object corresponding to a target application, and second layout information and a second component type for a 3D object. The electronic device can also create a 2D component object and first texture data for the 2D component object based on the first component type, and create a 3D component object and second texture data for the 3D component object based on the second component type. Next, the electronic device can synthesize the first and second texture data to obtain third texture data, and render the third texture data according to the first and second layout information to generate 2D and 3D objects. The electronic device can display the application interface of the target application, which includes 2D and 3D objects.

[0058] This application embodiment can combine the first texture data of a 2D component object and the second texture data of a 3D component object to obtain third texture data. It can also render the third texture data based on the first layout information of the 2D component object and the second layout information of the 3D component object to generate 2D and 3D objects. Thus, the 2D and 3D objects are displayed.

[0059] In this way, by compositing the texture data of 2D and 3D component objects and rendering the composite texture data according to their corresponding layout information, it is possible to ensure that the lifecycles of 2D and 3D component objects are consistent and to achieve a seamless display effect between them. Even in scenarios where there are transitions between the content of 2D and 3D component objects, the content of both can transition together to maintain a consistent animation experience. This, in turn, improves the user experience.

[0060] Furthermore, in this embodiment of the application, the second texture data is generated and displayed after the 3D component object is created. The 3D component object is not merely a placeholder. Even if the display area where the 3D component object is located happens to be the position of the pop-up component, it will not obscure the pop-up component.

[0061] The electronic devices provided in this application embodiment may include at least one of the following: mobile phone, smartwatch, tablet computer, foldable electronic device, desktop computer, laptop computer, handheld computer, notebook computer, Ultra-Mobile Personal Computer (UMPC), netbook, cellular phone, Personal Digital Assistant (PDA), Augmented Reality (AR) device, Virtual Reality (VR) device, Artificial Intelligence (AI) device, wearable device, and in-vehicle device. This application embodiment does not impose any special limitation on the specific type of the electronic device.

[0062] Furthermore, the operating system installed on the electronic device provided in this application embodiment includes, but is not limited to, those that... Or other operating systems. This application does not limit the specific type of electronic device or the type of operating system installed thereon.

[0063] For example, taking a mobile phone as an electronic device, Figure 1 A structural schematic diagram of mobile phone 100 is shown.

[0064] Mobile phone 100 may include processor 110, external memory interface 120, internal memory 121, universal serial bus (USB) interface 130, charging management module 140, power management module 141, battery 142, antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, audio module 170, speaker 170A, receiver 170B, microphone 170C, headphone jack 170D, sensor module 180, buttons 190, motor 191, indicator 192, camera 193, display screen 194, and subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, a barometric pressure sensor 180C, a magnetic sensor 180D, an accelerometer sensor 180E, a distance sensor 180F, a proximity 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.

[0065] It is understood that the structures illustrated in the embodiments of this application do not constitute a specific limitation on the mobile phone 100. In other embodiments of this application, the mobile phone 100 may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

[0066] Processor 110 may include one or more processing units, such as: application processor (AP), modem processor, graphics processing unit (GPU), image signal processor (ISP), controller, memory, video codec, digital signal processor (DSP), baseband processor, and / or neural network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.

[0067] The wireless communication function of mobile phone 100 can be realized through antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, modem processor and baseband processor.

[0068] The wireless communication module 160 can provide solutions for wireless communication applications on the mobile phone 100, 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), and infrared (IR) technologies. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via antenna 2, performs frequency modulation and filtering of the electromagnetic wave signals, and sends the processed signal to processor 110. The wireless communication module 160 can also receive signals to be transmitted from processor 110, perform frequency modulation and amplification, and convert them into electromagnetic waves for radiation via antenna 2.

[0069] In some embodiments, the antenna 1 of the mobile phone 100 is coupled to the mobile communication module 150, and the antenna 2 is coupled to the wireless communication module 160, so that the mobile phone 100 can communicate with the network and other devices through wireless communication technology.

[0070] The mobile phone 100 implements display functions through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, connected to the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations and for graphics rendering. The processor 110 may include one or more GPUs, which execute program instructions to generate or modify display information.

[0071] In some embodiments of this application, the display screen 194 is used to display 2D and 3D objects, such as corresponding images and videos. The display screen 194 includes a display panel. The display panel may 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 LED, a MicroLED, a Micro-OLED, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the mobile phone 100 may include one or N display screens 194, where N is a positive integer greater than 1.

[0072] The software system of mobile phone 100 can adopt a layered architecture, event-driven architecture, microkernel architecture, microservice architecture, or cloud architecture. This application embodiment uses a layered architecture operating system as an example to illustrate the software structure of mobile phone 100.

[0073] Figure 2 This is a software structure block diagram of the mobile phone 100 according to an embodiment of this application.

[0074] A layered architecture divides software into several layers, each with a clear role and function. Layers communicate with each other through software interfaces. In some embodiments, the operating system (OS) is divided into four layers, from top to bottom: the application layer, the application framework layer, the system libraries, and the kernel layer.

[0075] The operating system supports displaying various types of view components, such as 2D and 3D component objects, which is beneficial for building the OS ecosystem. A view component is a component responsible for drawing and handling events for a specific display area within an application page.

[0076] The application layer can include a series of application packages.

[0077] like Figure 2 As shown, the application package may include applications such as camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, and target applications.

[0078] The application framework layer provides application programming interfaces (APIs) and a programming framework for applications in the application layer. The application framework layer includes some predefined functions.

[0079] like Figure 2 As shown, the application framework layer may include a window manager, content provider, view system, phone manager, resource manager, notification manager, etc.

[0080] The window manager is used to manage windowed applications. It can retrieve screen size, determine the presence of a status bar, lock the screen, and capture screenshots, among other things.

[0081] Content providers store and retrieve data, making that data accessible to applications. This data can include videos, images, audio, phone calls made and received, browsing history and bookmarks, phone books, and more.

[0082] A view system includes visual components, such as components that display text, components that display images, etc. View systems can be used to build applications. A display interface can consist of one or more views. For example, a display interface including a text message notification icon can include views that display text and views that display images.

[0083] The file explorer provides applications with various resources, such as localized strings, icons, images, layout files, video files, and more.

[0084] The notification manager allows applications to display notifications in the status bar. These notifications can be used to deliver informational messages and can disappear automatically after a short pause, requiring no user interaction. For example, the notification manager can be used to notify users of completed downloads or message alerts. The notification manager can also display notifications as icons or scrolling text in the top status bar, such as notifications from background applications, or as dialog boxes on the screen. Examples include displaying text messages in the status bar, emitting sounds, vibrating electronic devices, and flashing indicator lights.

[0085] The application layer and application framework layer run in a virtual machine. The virtual machine executes the Java files of 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.

[0086] The system library can include multiple functional modules. For example: meta-capability management module, compilation module, cross-platform window module, component module, rendering engine, and display module.

[0087] In some examples, the meta-capability management module can be used to manage the application resources of the target application. The compilation module can parse the application interface of the target application, determine the first component type of 2D objects and the second component type of 3D objects, as well as the styles and attributes of the 2D and 3D component objects. The window cross-platform module is used to determine the first layout information based on the styles and attributes of the 2D component objects, and the second layout information based on the styles and attributes of the 3D component objects. The component module is used to create 2D component objects, 3D component objects, 2D rendering nodes, and 3D rendering nodes based on the first and second component types. The component module is also used to create the second texture data corresponding to the 3D component objects and the first texture data corresponding to the 2D component objects. The rendering engine combines the first and second texture data to obtain the third texture data, and renders the third texture data according to the first and second layout information to generate 2D and 3D objects. The display module can be used to display the 2D and 3D objects.

[0088] In some examples, the system library may also include a package management module, and the metaservice management module can work in conjunction with the package management module to manage the application resources of the target application.

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

[0090] For example, the above description uses a mobile phone as an example to illustrate the structure of the electronic device in this application embodiment, but it does not constitute a limitation on the structure or form of the electronic device. In some examples, the electronic device may include... Figure 1 or Figure 2 The embodiments of this application do not limit the structure or form of the electronic device. They may include more or fewer components, combine some components, split some components, replace some components, or have different component arrangements.

[0091] The method provided in the embodiments of this application will now be described in detail with reference to the accompanying drawings and the above description. In the embodiments of this application, each subject may perform some or all of the steps in the embodiments of this application. These steps or operations are merely examples, and the embodiments of this application may also perform other operations or variations thereof. Furthermore, the steps may be performed in different orders as presented in the embodiments of this application, and it is not necessary to perform all the operations in the embodiments of this application.

[0092] The rendering scenarios provided in the embodiments of this application will be described exemplarily below.

[0093] In some embodiments of this application, a target application may be installed in the electronic device. This target application can be an application capable of presenting 3D objects to the user. It should be understood that the target application can be an application that implements 3D functionality; for example, it may be a game application that includes 3D objects (such as 3D game characters, buildings, etc.). The target application can also be a modeling application, a shopping application, a social application, or a lifestyle service application (such as a car service application), etc., that can implement 3D functionality. It should be noted that the embodiments of this application do not specifically limit the application type of the installed target application.

[0094] Electronic devices can respond to user actions on a target application by displaying the application's interface. This interface can include 3D objects, such as 3D images. A 3D image is an image that has a height dimension in addition to its length and width dimensions. This allows users to view 3D objects through the target application on their mobile phone.

[0095] For example, the target application could include a desktop application where the user can set their phone's desktop wallpaper to a live wallpaper. The live wallpaper could include 3D objects, such as 3D game characters or buildings. Thus, when the phone is launched, the desktop application can display the corresponding 3D objects in response to the user's settings. Figure 3 As shown, the electronic device can display a main screen interface 300 (or desktop), which includes icons for one or more applications, such as shopping applications, settings applications, etc., which will not be listed here. Different application icons can be used to open the corresponding application's interface and perform the corresponding application's functions. Simultaneously, the desktop can display 3D objects corresponding to the live wallpaper; these 3D objects are 3D town buildings.

[0096] As another example, the target application may also include third-party applications (such as JS applications) designed and written by developers using computer languages. Here, a JS application refers to an application developed using the JavaScript language. The JS application can provide JS pages, which can be displayed by calling view component objects; that is, the JS page is a display page for component objects. Developers can use the JS application to develop other target applications; for example, they can pre-configure 3D component objects used in desktop applications to display 3D objects within the JS application. This application does not impose specific limitations on the type and number of target applications used by the user.

[0097] It should be noted that 3D objects refer to virtual objects with three-dimensional display effects. Virtual objects include, but are not limited to, people, objects, animals, plants, etc.

[0098] In some embodiments of this application, during the process of displaying the application interface of a target application, the electronic device may include not only 3D objects but also some 2D objects, such as 2D images. Here, a 2D image refers to an image that only has length and width dimensions.

[0099] For example, see [link to previous article] Figure 3 The desktop can include not only 3D town buildings, but also 2D cloud images and 2D sun images. As another example, in a game scene, the user's avatar or name is a 2D image, while the game characters or game scene are 3D images. Thus, the electronic device needs to render not only 3D objects but also other 2D objects. See also... Figure 4 The rendering method provided in this application includes the following steps:

[0100] S401, The electronic device determines the first layout information and the first component type of the 2D object corresponding to the target application, as well as the second layout information and the second component type of the 3D object.

[0101] In some embodiments of this application, the electronic device may pre-create a drawing canvas corresponding to the application interface before rendering the application interface. The drawing canvas is used to render 2D component objects and 3D component objects, and each application interface corresponds to one drawing canvas.

[0102] Specifically, electronic devices can use a drawing canvas, such as a surfaceNode, to blend and render 2D and 3D component objects of the application interface, thereby displaying both 2D and 3D objects. In this way, each application interface corresponds to only one drawing canvas, and different application interfaces correspond to different drawing canvases.

[0103] Therefore, this embodiment does not apply different drawing canvases for 2D component objects and 3D component objects, but instead applies for a corresponding drawing canvas for each application interface. This ensures that 2D component objects and 3D component objects have a consistent lifecycle and consistent subsequent display progress, such as consistent display time, consistent display effect change time, and consistent display end time. This, in turn, improves the user experience.

[0104] In some embodiments of this application, the electronic device can launch the target application and parse its interface in response to a user's operation on the target application. For example, the electronic device can launch the target application and parse its interface in response to a user's click on the application icon. As another example, the electronic device can load the resources corresponding to the 3D component object and parse the application interface to be displayed in response to a user's movement operation on a 3D component object in the target application.

[0105] Specifically, see Figure 5 The electronic device includes a meta-capability management module, which can manage the application resources of a target application and parse the target application (e.g., S501). For example, the meta-capability management module can launch the target application in response to a user's click on the application icon. Further, the meta-capability management module can manage the application process of the target application after it has been launched. Still further, the meta-capability management module can load the application resources of the target application after it has been launched.

[0106] Electronic devices may also include a compilation module. Continuing with the example of an electronic device parsing an application interface, the compilation module can parse the application interface to determine the first component type of the 2D object and the second component type of the 3D object corresponding to the application interface in the target application, as well as the style and attributes of the 2D component object and the style and attributes of the 3D component object (such as S502).

[0107] In this way, the compilation module can parse the application interface to obtain the component type, style, and attributes of each component object included in the application interface. That is, the compilation module can parse the 2D and 3D objects in the application interface to determine the existing 2D and / or 3D objects, as well as the view component type, style, and attributes of the 2D and / or 3D objects.

[0108] Of course, each application interface can include the hierarchical relationship of multiple component objects, the tags of each component object, common attributes, private attribute styles, and events, etc. The compilation module can obtain the above information during the parsing of the application interface. This application embodiment does not specifically limit the information of the above component objects. The compilation module obtains the component objects, styles, attributes, and events corresponding to each application page, and stores the information of each component object, style, attribute, and event in the application page in the corresponding data structure.

[0109] In some embodiments of this application, the component types of 2D component objects and 3D component objects include any of the following: text view component, video view component, webpage view component, link view component, camera view component, live stream view component, and advertisement view component. It should be noted that the embodiments of this application do not limit the specific type corresponding to the component object. Of course, the component type of the component object can be a component type preset by the developer.

[0110] In some embodiments of this application, the electronic device may further include a window cross-platform module, which can determine first layout information based on the style and attributes corresponding to the 2D component object. The window cross-platform module can also determine second layout information based on the style and attributes corresponding to the 3D component object.

[0111] In this way, the compilation module can create virtual nodes corresponding to 2D and 3D component objects through the window cross-platform module. The window cross-platform module can then determine the first layout information based on the styles and attributes of the 2D component objects within the virtual nodes, and determine the second layout information (such as S503) based on the styles and attributes of the 3D component objects. It should be noted that the styles and attributes corresponding to the 2D and 3D component objects can be preset styles and attributes by the developers.

[0112] Specifically, the compilation module can control the cross-platform window module to generate a tree structure of virtual nodes (e.g., a VDOM tree) based on arrays and functions corresponding to 2D and 3D component objects. The VDOM tree includes multiple virtual nodes. The cross-platform window module can set the styles and properties of the 2D and 3D component objects to the corresponding virtual nodes and perform data binding on each virtual node in the VDOM tree. Simultaneously, the cross-platform window module can also create the corresponding front-end DOM nodes while generating virtual nodes.

[0113] Data binding refers to the process of establishing a connection between the application's UI and the data source, so that when the data of each VDOM node changes, the corresponding UI node will be automatically drawn and updated.

[0114] Of course, after the window cross-platform module generates the corresponding front-end DOM nodes based on the styles and attributes of 2D and 3D component objects, it can also sequentially create the corresponding back-end component nodes, element nodes, and render nodes based on the front-end DOM nodes to complete layout calculations, component style and attribute updates, etc.

[0115] For example, the cross-platform window module can calculate first layout information corresponding to 2D component objects and second layout information corresponding to 3D component objects in virtual nodes. The first layout information includes the position and size of the 2D component objects, and the second layout information includes the position and size of the 3D component objects.

[0116] S402. The electronic device creates a 2D component object and first texture data of the 2D component object according to a first component type, and creates a 3D component object and second texture data of the 3D component object according to a second component type.

[0117] In some embodiments of this application, the electronic device may further include a component module, which can create 2D component objects according to a first component type and create 3D component objects according to a second component type.

[0118] For example, the first component type is a text view component, and the component module can create a corresponding 2D text view component. The second component type is a video view component, and the component module can create a corresponding 3D video view component.

[0119] For another example, the first component type is a link view component, and the component module can create corresponding 2D link view components. The second component type is an advertisement view component, and the component module can create corresponding 3D advertisement view components.

[0120] In some embodiments of this application, after the 2D component object is created, the component module can create a 2D rendering node corresponding to the 2D component object and generate the first texture data in the 2D rendering node.

[0121] In some embodiments of this application, after the 3D component object is created, the component module can also create a 3D rendering node corresponding to the 3D component object and generate second texture data in the 3D rendering node (such as S504).

[0122] Specifically, the electronic device may include a rendering engine. During the process of generating second texture data in a 3D rendering node, the component module can notify the rendering engine to load pre-built resources. For example, the component module can dynamically load dynamic dependency libraries (.so) and third-party 3D resources from the 3D engine in advance. The pre-loaded third-party 3D resources can be pre-built component data within the 3D component object, such as pre-loaded background resources, text resources, and line resources, etc., from the 3D component object.

[0123] In some embodiments of this application, the rendering engine includes at least one application programming interface (API). The API can set corresponding window handles for multiple virtual windows and configure these window handles within the rendering engine. Simultaneously, the rendering engine can be used to render 3D component objects bound to the window handles. Specifically, the rendering engine can create corresponding rendering threads for each of the multiple window handles and bind the 3D component objects corresponding to each window handle to their respective rendering threads. Thus, when rendering 3D component objects, the rendering engine can invoke the rendering threads corresponding to the respective window handles, thereby completing the rendering of the 3D component objects.

[0124] In this way, the component module can obtain at least one application programming interface of the rendering engine to complete the subsequent rendering of 3D component objects.

[0125] In some examples, at least one application programming interface (API) may include one or more callback interfaces implemented by the rendering engine. For example, callback interfaces may include callback interfaces for virtual window initialization, graphics context initialization, drawing completion, SurfaceNode creation, SurfaceNode content change, and SurfaceNode destruction. It should be noted that this application does not limit the specific implementation of the callback interfaces.

[0126] After obtaining one or more application programming interfaces (APIs) of the rendering engine, the component module can also create a virtual window and update the window handle in the rendering engine using at least one API. Next, within the virtual window, the component module creates rendering context state information and a rendering window, and generates second texture data based on the rendering context state information and the rendering window.

[0127] Specifically, the component module can call the rendering interface between the graphics programming interface and the native window system within a virtual window, and create rendering context state information and a rendering window. For example, the graphics programming interface may include the Open Graphics Library (OpenGL), the rendering interface may include EGL (Embedded GraphicLibrary), and the rendering window may include an EGL window. Thus, after calling the EGL interface, the component module can create EGL context state information and an EGL window, and generate second texture data based on the EGL context state information and the EGL window. The EGL context state information is the context state information required when rendering the 3D component object.

[0128] S403, the electronic device combines the first texture data and the second texture data to obtain the third texture data.

[0129] In some embodiments of this application, before the rendering engine synthesizes the first texture data and the second texture data, the component module can register the first texture data and the second texture data to the graphics processing unit (GPU).

[0130] Thus, this embodiment of the application can directly register the texture data corresponding to 2D component objects and 3D component objects into the GPU, avoiding the creation of texture caches in the central processing unit (CPU). The subsequent rendering engine can directly obtain texture data from the GPU for rendering, eliminating the need for texture data transfer between the CPU and GPU. This saves CPU processing time between different texture caches and the time spent transferring textures to the GPU, improving rendering efficiency. Simultaneously, it also saves memory occupied by texture data and GPU video memory.

[0131] Specifically, the component module can generate a first texture identifier corresponding to the first texture data and a second texture identifier corresponding to the second texture data, and register the first texture data and the second texture data to the graphics processor GPU according to the first texture identifier and the second texture identifier.

[0132] For example, the first texture identifier of the first texture data can be the first texture ID of the first texture data, where the first texture ID represents the unique identity information of the first texture data. The component module can register the first texture data to the GPU based on the first texture identifier of the first texture data corresponding to the 2D component object. Similarly, the second texture identifier of the second texture data can be the second texture ID of the second texture data, where the second texture ID represents the unique identity information of the second texture data. The component module can register the second texture data to the GPU based on the second texture identifier of the second texture data corresponding to the 3D component object.

[0133] In some examples, there can be a one-to-one binding between texture IDs and texture data. This allows the rendering engine to retrieve texture data from the GPU based on the texture ID, improving the efficiency of texture data lookup and subsequent rendering performance.

[0134] In some embodiments of this application, the rendering engine can obtain first texture data from the GPU based on a first texture identifier, and obtain second texture data from the GPU based on a second texture identifier. Then, after obtaining the first texture data and the second texture data through the first texture ID and the second texture ID, the rendering engine can call the texture compositing interface to composite the first texture data and the second texture data to obtain third texture data (as in S505).

[0135] S404. The electronic device renders the third texture data based on the first layout information and the second layout information to generate 2D objects and 3D objects.

[0136] In some embodiments of this application, the component module can generate rendering instructions required for rendering in the 2D rendering node and the 3D rendering node according to the content state of the 2D component object and the 3D component object and the required rendering effect. These instructions include information such as the position of each vertex of the drawn object, lighting, shadows, physical effects, texture mapping, etc.

[0137] In this way, when the component module controls the rendering engine to perform actual rendering, it will perform a series of operations according to the received rendering instructions, such as vertex processing, lighting calculation, shadow calculation, physical motion effect calculation, and texture mapping. Then, through blending rendering technology, the rendering tasks corresponding to the 2D component objects and the rendering tasks corresponding to the 3D component objects are rendered in a unified manner, and the rendering results of the 2D component objects and 3D component objects are blended to obtain the rendering result. In some examples, the rendering process may include handling occlusion relationships and calculating blending effects to achieve seamless blending and display of 2D component objects and 3D component objects.

[0138] Specifically, the rendering engine can obtain the first and second 2D texture data from the GPU based on the texture identifiers of the texture data corresponding to the 2D component objects and 3D component objects, and render the texture data corresponding to the 2D component objects and 3D component objects based on the layout information corresponding to the 2D component objects and 3D component objects.

[0139] In other words, the rendering engine can render the third texture data based on the position and size of the 2D component object and the position and size of the 3D component object, so that the 2D object and 3D object can be displayed subsequently (such as S506).

[0140] In this way, the rendering engine can directly obtain the corresponding texture data from the GPU using the texture identifier for rendering, without the need for texture data transfer between the CPU and GPU, which greatly improves rendering performance.

[0141] Furthermore, by combining the first texture data and the second texture data in this embodiment, the 2D component objects and 3D component objects can be rendered in parallel, eliminating the need for separate rendering and effectively reducing rendering time and resources. This ensures that the lifecycles of the 2D and 3D component objects are consistent, avoiding inconsistencies in display progress during subsequent display processes. Ultimately, this improves the user's visual experience.

[0142] S405. Electronic devices display 2D and 3D objects.

[0143] In some embodiments of this application, after rendering the third texture data, the rendering engine can send the rendered result to the texture cache management module. In this way, the electronic device can input the generated rendering result (such as the rendered third texture data) into the component module, which can then display the rendering result on 2D and 3D component objects to achieve a fusion display effect between 2D and 3D objects.

[0144] Of course, electronic devices may also include a display module, which can display the application interface of the target application, including the aforementioned 2D and 3D objects.

[0145] In some embodiments of this application, the above examples illustrate the rendering of 2D and 3D component objects by an electronic device and the display of the corresponding rendering results. In practical applications, after generating the rendering results, the data in the rendering results can be updated, and new rendering results can be generated based on the updated data. This application does not limit the specific implementation steps in the rendering process.

[0146] In some embodiments of this application, see Figure 6 Developers can develop a target application in one go. The electronic device runs the target application, parses the corresponding application interface, creates corresponding component objects, and renders the component objects according to their styles and attributes to obtain the application interface. During the rendering process, the electronic device can use the UI framework to launch a backend rendering service. The rendering service can transmit drawing instructions to the rendering engine, which then completes the rendering operation. The rendering service also shares the rendering context in the GPU to speed up rendering. In this way, the rendering engine can complete the rendering operation and composite the rendering results for display on the screen.

[0147] In some embodiments of this application, during the process of parsing the application interface of a target application, the electronic device can obtain a component data package of the rendering engine. This component data includes at least one application programming interface (API) of the rendering engine, which operates based on a native API mechanism. The electronic device can then parse the application interface of the target application according to the at least one API of the rendering engine in the component data package.

[0148] At least one application programming interface includes any one or more of the following: an interface for setting 3D objects and creating 3D component objects; an interface for setting 2D objects and creating 2D component objects; an interface for setting whether the camera in the 3D scene and 2D scene can move; an interface for setting the background in the 3D scene and 2D scene; an interface for setting the transparency; an interface for adding custom drawing objects; an interface for adding shapes and geometry; and an interface for setting 3D animation effects and 2D animation effects.

[0149] Electronic devices can download and install the rendering engine component data package from servers and application stores, generating an executable file corresponding to the rendering engine. It should be understood that an executable file is in binary form, typically a runnable program or script. The executable file contains the rendering engine's code, data, and resources, and can be executed directly on a computer. The executable file can be directly invoked by the user or operating system to enable and execute the rendering engine.

[0150] In this embodiment, at least one application interface of the rendering engine can be packaged and exposed to the electronic device via a Native API mechanism. This allows the electronic device to call at least one application interface of the rendering engine within the component data package to perform the rendering process. In other words, by packaging at least one application interface of the rendering engine using the Native API mechanism, after obtaining the at least one application interface, the electronic device can operate based on the Native API mechanism, enabling bidirectional data communication between TypeScript (TS) and C++. Thus, the electronic device can compile and run the corresponding TS API using C++, thereby calling at least one application interface of the rendering engine.

[0151] Even though different electronic devices use different operating systems and have different development framework languages, they can still compile and run the aforementioned application programming interfaces (APIs). This allows the target application on the electronic device to compile and run these APIs after startup, parsing the application interface to complete the subsequent rendering process. In other words, developers can develop and deploy the target application based on a unified component data package, without needing to use different operating system-specific development framework languages ​​to interface with the rendering engine. The target application can be seamlessly deployed and rendered on different operating systems, with the same mechanism applied to different operating systems. This significantly reduces code maintenance costs across different operating systems, lowers the technical barrier for developers, and ensures consistent rendering effects across different operating systems, thereby improving the user experience.

[0152] In this embodiment, the electronic device can perform object creation and module registration based on the aforementioned component data package. For example, the electronic device can register the aforementioned meta-capability management module, compilation module, window cross-platform module, component module, and rendering engine.

[0153] In some embodiments of this application, the electronic device may correspond to different operating systems, and the operating system of the electronic device includes any of the following: system, system, system, system, System and Systems, etc.

[0154] In some embodiments of this application, developers can develop the logic code or functional instructions and data of the target application to ensure the UI (User Interface) and corresponding business processing logic of the target application. For example, developers can use a programming language and utilize the program code for editing functions in development tools, i.e., development files. The development files may include description files and resource files. The description file includes a description of the UI layout using a programming language, the components in the UI, and the visual effects of the layout and components. The description file also includes files defining the interface behavior using a programming language. Interface behavior includes dynamic changes to the UI and the electronic device's response to these dynamic changes (e.g., the terminal device's response to the user's UI operations). The resource files may include specification files for the configuration resources required for the target application to run, such as image resources and font resources.

[0155] It is understood that, in some embodiments of this application, developers can directly develop the UI of the target application on the electronic device and run the target application on the electronic device. This application does not limit this aspect.

[0156] This application also provides a rendering device, see [link to relevant documentation] Figure 7 The rendering apparatus includes: a compilation module 710, a window cross-platform module 720, a component module 730, a rendering engine 740, and a display module 750.

[0157] The compilation module 710 is used to determine the first component type of the 2D object and the second component type of the 3D object corresponding to the target application, as well as the style and attributes of the 2D component object and the 3D component object.

[0158] The window cross-platform module 720 is used to determine the first layout information based on the style and attributes of the 2D component object.

[0159] The window cross-platform module 720 is also used to determine the second layout information based on the style and attributes of the 3D component object.

[0160] The window cross-platform module 720 is also used to create 2D component objects based on the first component type.

[0161] The window cross-platform module 720 is also used to create 3D component objects based on the second component type.

[0162] Component module 730 is used to create the first texture data for 2D component objects.

[0163] Component module 730 is also used to create second texture data for 3D component objects.

[0164] Component module 730 is also used to synthesize the first texture data and the second texture data to obtain the third texture data.

[0165] Rendering engine 740 is used to render third texture data based on first layout information and second layout information, generating 2D and 3D objects.

[0166] Display module 750 is used to display the application interface of the target application, which includes 2D objects and 3D objects.

[0167] In some solutions, multiple embodiments of this application can be combined, and the combined solution can be implemented. Optionally, some operations in the process of each method embodiment may be combined, and / or the order of some operations may be changed. Furthermore, the execution order between the steps of each process is merely exemplary and does not constitute a limitation on the execution order between steps; other execution orders are also possible. It is not intended to indicate that the execution order is the only possible order in which these operations can be performed.

[0168] Those skilled in the art will conceive of various ways to reorder the operations described in the embodiments of this application. Furthermore, it should be noted that process details involved in one embodiment of this application are similarly applicable to other embodiments, or different embodiments can be combined.

[0169] Furthermore, some steps in the method embodiments can be equivalently replaced with other possible steps. Alternatively, some steps in the method embodiments may be optional and can be deleted in certain use cases. Or, other possible steps may be added to the method embodiments.

[0170] Furthermore, the various method embodiments can be implemented individually or in combination.

[0171] This application also provides an electronic device, such as the aforementioned mobile phone, etc. Figure 8As shown, the mobile phone may include one or more processors 810, memory 820 and communication interfaces 830.

[0172] The memory 820, communication interface 830, and processor 810 are coupled together. For example, the memory 820, communication interface 830, and processor 810 can be coupled together via bus 840.

[0173] The communication interface 830 is used for data transmission with other devices. The memory 820 stores computer program code. The computer program code includes computer instructions, which, when executed by the processor 810, cause the electronic device to perform the relevant method steps in the embodiments of this application.

[0174] The processor 810 may be a processor or controller, such as a central processing unit (CPU), a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. It may implement or execute the various exemplary logic blocks, modules, and circuits described in conjunction with this disclosure. The processor may also be a combination that implements computational functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, etc.

[0175] Bus 840 can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The aforementioned bus 840 can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 8 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.

[0176] This application also provides an electronic device, which includes a memory and one or more processors; the memory is coupled to the processors; wherein the memory stores computer program code, which includes computer instructions, and when the computer instructions are executed by the processor, the electronic device performs the relevant method steps in the above method embodiments.

[0177] This application also provides a communication device, which includes a memory and one or more processors; the memory is coupled to the processors; wherein the memory stores computer program code, which includes computer instructions, and when the computer instructions are executed by the processor, the communication device performs the relevant method steps in the above method embodiments.

[0178] This application also provides a computer-readable storage medium storing computer program code. When the processor executes the computer program code, the electronic device executes the relevant method steps in the above method embodiments.

[0179] This application also provides a computer program product that, when run on a computer, causes the computer to execute the relevant method steps described in the above method embodiments.

[0180] This application also provides a chip system, including: a processor coupled to a memory, the memory being used to store programs or instructions, and when the program or instructions are executed by the processor, the chip system enables the methods in any of the above method embodiments.

[0181] Optionally, the chip system may contain one or more processors. These processors can be implemented in hardware or software. When implemented in hardware, the processor can be a logic circuit, an integrated circuit, etc. When implemented in software, the processor can be a general-purpose processor, implemented by reading software code stored in memory.

[0182] Optionally, the chip system may contain one or more memories. The memory may be integrated with the processor or disposed separately from it; this application embodiment does not limit this. For example, the memory may be a non-transient processor, such as a read-only memory (ROM), which may be integrated with the processor on the same chip or disposed separately on different chips. This application embodiment does not specifically limit the type of memory or the arrangement of the memory and processor.

[0183] For example, the chip system can be a field programmable gate array (FPGA), an application-specific integrated circuit (ASIC), a system-on-chip (SoC), a central processing unit (CPU), a network processor (NP), a digital signal processor (DSP), a micro controller unit (MCU), a programmable logic device (PLD), or other integrated chips.

[0184] The electronic devices, computer storage media, or computer program products provided in this application are all used to execute the corresponding methods provided above. Therefore, the beneficial effects they can achieve can be referred to the beneficial effects in the corresponding methods provided above, and will not be repeated here.

[0185] Through the above description of the embodiments, those skilled in the art can clearly understand that, for the sake of convenience and brevity, only the division of the above functional modules is used as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.

[0186] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another apparatus, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.

[0187] The units described as separate components may or may not be physically separate. A component shown as a unit can be one or more physical units, located in one place or distributed in multiple different locations. Some or all of the units can be selected to achieve the purpose of this embodiment, depending on actual needs.

[0188] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0189] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solutions of the embodiments of this application, in essence, or the contributing parts, or all or part of the technical solutions, can be embodied in the form of a software product. This software product is stored in a storage medium and includes several instructions to cause a device (which may be a microcontroller, chip, etc.) or processor to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0190] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A rendering method, characterized in that, Applied to electronic devices, the method includes: Determine the first layout information and first component type of the 2D object corresponding to the target application, and the second layout information and second component type of the 3D object; Based on the first component type, create a 2D component object and the first texture data of the 2D component object; Based on the second component type, create a 3D component object and the second texture data of the 3D component object; The first texture data and the second texture data are combined to obtain the third texture data; The third texture data is rendered based on the first layout information and the second layout information to generate the 2D object and the 3D object; The application interface of the target application is displayed, and the application interface includes the 2D object and the 3D object.

2. The method according to claim 1, characterized in that, The creation of the 2D component object and the first texture data of the 2D component object include: Create the 2D component object; Create a 2D rendering node corresponding to the 2D component object, and generate the first texture data based on the 2D rendering node; The creation of the 3D component object and the second texture data of the 3D component object include: Create the 3D component object; Create a 3D rendering node corresponding to the 3D component object, and generate the second texture data based on the 3D rendering node.

3. The method according to claim 2, characterized in that, The electronic device includes a rendering engine, which includes at least one application programming interface (API) for setting a window handle to the rendering engine. The rendering engine is used to render a 3D component object bound to the window handle. Generating the second texture data based on the 3D rendering node includes: Load the 3D resources from the rendering engine into the 3D rendering node; Create a virtual window and update the window handle in the rendering engine using at least one of the application programming interfaces; In the virtual window, rendering context state information and a rendering window are created; The second texture data is generated based on the rendering context state information and the rendering window.

4. The method according to any one of claims 1-3, characterized in that, The method further includes: Register the first texture data and the second texture data to the graphics processing unit (GPU).

5. The method according to claim 4, characterized in that, The step of registering the first texture data and the second texture data to the graphics processing unit (GPU) includes: Generate a first texture identifier corresponding to the first texture data and a second texture identifier corresponding to the second texture data; Based on the first texture identifier and the second texture identifier, the first texture data and the second texture data are registered to the graphics processing unit (GPU).

6. The method according to claim 5, characterized in that, The step of synthesizing the first texture data and the second texture data to obtain the third texture data includes: The first texture data is obtained from the GPU based on the first texture identifier; The second texture data is obtained from the GPU based on the second texture identifier; The first texture data and the second texture data are combined to obtain the third texture data.

7. The method according to claim 6, characterized in that, The determination of the first layout information and first component type of the 2D object corresponding to the target application, and the second layout information and second component type of the 3D object, includes: The application interface is parsed to obtain the first component type and the second component type in the application interface, as well as the style and attributes of the 2D component object and the style and attributes of the 3D component object; The first layout information is determined based on the style and attributes corresponding to the 2D component object; The second layout information is determined based on the style and attributes corresponding to the 3D component object.

8. The method according to claim 7, characterized in that, The parsing of the application interface includes: Obtain the component data package of the rendering engine; the component data package includes at least one application interface of the rendering engine, the at least one application interface working based on the native API mechanism; The application interface is parsed based on the component data package.

9. The method according to claim 8, characterized in that, At least one of the application programming interfaces includes any one or more of the following: an interface for setting up 3D objects and creating 3D component objects; an interface for setting up 2D objects and creating 2D component objects; an interface for setting whether the camera in the 3D scene and 2D scene can move; an interface for setting the background in the 3D scene and 2D scene; an interface for setting the transparency; an interface for adding custom drawing objects; an interface for adding shapes and geometry; and an interface for setting 3D animation effects and 2D animation effects.

10. The method according to claim 9, characterized in that, The method further includes: Create a drawing canvas corresponding to the application interface; wherein, the drawing canvas is used to render the 2D component object and the 3D component object.

11. The method according to claim 10, characterized in that, The first layout information includes the position and size of the 2D object, and the second layout information includes the position and size of the 3D object.

12. The method according to claim 11, characterized in that, The component types of the 2D component object and the 3D component object include any one of the following: text view component, video view component, webpage view component, link view component, camera view component, live stream view component, and advertisement view component.

13. A rendering apparatus, characterized in that, The rendering device includes: a compilation module, a cross-platform window module, a component module, a rendering engine, and a display module; The compilation module is used to determine the first component type of the 2D object and the second component type of the 3D object corresponding to the target application, as well as the style and attributes of the 2D component object and the 3D component object; The cross-platform window module is used to determine the first layout information based on the style and attributes corresponding to the 2D component object; The cross-platform window module is also used to determine the second layout information based on the style and attributes corresponding to the 3D component object; The cross-platform window module is also used to create the 2D component object according to the first component type; The window cross-platform module is also used to create the 3D component object according to the second component type; The component module is used to create the first texture data of the 2D component object; The component module is also used to create second texture data for the 3D component object; The component module is further configured to synthesize the first texture data and the second texture data to obtain the third texture data; The rendering engine is used to render the third texture data according to the first layout information and the second layout information to generate the 2D object and the 3D object; The display module is used to display the application interface of the target application, the application interface including the 2D object and the 3D object.

14. An electronic device, characterized in that, The device includes a memory and one or more processors; the memory is coupled to the processors; wherein the memory stores computer program code, the computer program code including computer instructions, which, when executed by the processor, cause the electronic device to perform the rendering method as described in any one of claims 1-12.

15. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores instructions that, when executed on a computer, enable the computer to perform the rendering method as described in any one of claims 1-12.

Citation Information

Patent Citations

  • Rendering method and device

    CN103559730A

  • Method and device for displaying view control

    CN115480762A