Rendering method and apparatus, and electronic device

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

WO2025066349A1PCT designated stage expired Publication Date: 2025-04-03HUAWEI TECH CO LTD

Patent Information

Application Number
PCT/CN2024/101973
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2024-02-26
Filing Date
2024-06-27
Publication Date
2025-04-03

AI Technical Summary

Technical Problem

When displaying 3D objects and 2D objects in electronic devices, the life cycles of 2D component objects and 3D component objects are inconsistent, resulting in inconsistent display progress and reducing user experience.

Method used

By synthesizing the texture data of 2D component objects and 3D component objects, and rendering the synthetic texture data based on their corresponding layout information, 2D objects and 3D objects are generated to achieve consistent life cycle and fusion display.

Benefits of technology

Ensure that the life cycle of 2D component objects and 3D component objects is consistent, realize the fusion display effect of 2D objects and 3D objects, and improve the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024101973_03042025_PF_FP_ABST
    Figure CN2024101973_03042025_PF_FP_ABST
Patent Text Reader

Abstract

Provided in the embodiments of the present application are a rendering method and apparatus, and an electronic device, relating to the technical field of terminals. The method comprises: the electronic device can determine 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 may also, on the basis of the first component type, create a 2D component object and first texture data of the 2D component object and, on the basis of the second component type, create a 3D component object and second texture data of the 3D component object. The electronic device can synthesise the first texture data and the second texture data to obtain third texture data and, on the basis of the first layout information and the second layout information, render the third texture data, and generate and display the 2D object and the 3D object. The 2D component object and the 3D component object can be fused and rendered, avoiding inconsistent display effects during the process of displaying the 3D object and the 2D object.
Need to check novelty before this filing date? Find Prior Art

Description

Rendering method, device and electronic device

[0001] This application claims priority to the Chinese patent applications filed with the State Intellectual Property Office on September 28, 2023, with application number 202311291866.8 and application name “Rendering method, device and electronic device” and filed with the State Intellectual Property Office on February 26, 2024, with application number 202410211643.4 and application name “Rendering method, device 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 technology, and in particular to a rendering method, device, and electronic device. Background Art

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

[0004] When electronic devices display 3D objects, they are usually displayed together with some 2D objects (such as 2D images). In this way, during the display process, electronic devices need to render 3D component objects (such as 3D view components) corresponding to 3D objects and 2D component objects (such as 2D view components) corresponding to 2D objects. Specifically, electronic devices need to render 3D component objects and 2D component objects independently, and send the rendered 3D component objects and 2D component objects for display to display 3D objects and 2D objects on the display screen. Since 2D component objects and 3D component objects are rendered independently and have different life cycles, there will be inconsistent display progress in the process of displaying 3D objects and 2D objects. In turn, the user's experience is reduced.

[0005] Summary of the Invention

[0006] The embodiments of the present application provide a rendering method, apparatus, and electronic device, which can enable the electronic device to render a fusion of 2D component objects and 3D component objects, thereby avoiding inconsistent display effects when displaying 3D objects and 2D objects.

[0007] In a first aspect, an embodiment of the present application provides a rendering method, which is applied to an electronic device, and the method includes: the electronic device can determine the first layout information and the first component type of a 2D object corresponding to the target application, and the second layout information and the second component type of a 3D object. The electronic device can also create a 2D component object and the first texture data of the 2D component object based on the first component type, and create a 3D component object and the 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 a 2D object and a 3D object. Then, the electronic device can display the application interface of the target application, and the application interface includes 2D objects and 3D objects.

[0008] In this way, the embodiment of the present application synthesizes the texture data of the 2D component object and the 3D component object, and renders the synthesized texture data according to their corresponding layout information, thereby ensuring that the life cycle of the 2D component object is consistent with that of the 3D component object, and achieving the effect of fusion display of the 2D object and the 3D object. Even in the scene where there is a transition change in the content of the 2D component object and the 3D component object, the content of the 2D component object and the 3D component object can also transition together to maintain a consistent dynamic effect experience for the two. In turn, the user's sense of use is improved.

[0009] In one implementation, when creating a 2D component object and first texture data for the 2D component object, the electronic device may 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. When creating a 3D component object and second texture data for the 3D component object, the electronic device may 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.

[0010] In this way, embodiments of the present application can pre-create 2D component objects and corresponding 2D rendering nodes, as well as 3D component objects and corresponding 3D rendering nodes. Subsequently, first texture data and second texture data are generated based on the 2D rendering nodes and 3D rendering nodes. This facilitates the subsequent synthesis of the texture data of the 2D component objects and the 3D component objects, and rendering of the texture data, thereby achieving a fused display effect of the 2D and 3D objects. This avoids the situation where the lifecycles of the 2D and 3D component objects are inconsistent.

[0011] In one implementation, the electronic device includes a rendering engine, which includes at least one application program interface (API) for setting a window handle to the rendering engine, and the rendering engine for rendering a 3D component object bound to the window handle. During the process of generating the second texture data in a 3D rendering node, the electronic device may 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 may also create rendering context state information and a rendering window in the virtual window, and generate the second texture data based on the rendering context state information and the rendering window.

[0012] In this way, the electronic device can pre-load the 3D resources in the rendering engine, create a virtual window, and update the window handle of the rendering engine. Then, the electronic device can create rendering context state information and a rendering window in the virtual window to generate the second texture data corresponding to the 3D component object. The component data preset in the 3D component object, such as background resources, text resources, and line resources, can be used to complete the subsequent rendering of the 3D component object through at least one application program interface of the rendering engine. There is no need to render all the data in the component object, which improves rendering efficiency.

[0013] In one implementation, the method further includes: the electronic device may register the first texture data and the second texture data in a graphics processor (GPU).

[0014] In this way, embodiments of the present application can register the texture data corresponding to 2D and 3D component objects directly with the GPU, avoiding the creation of a texture cache in the central processing unit (CPU). Subsequent rendering engines can directly retrieve texture data from the GPU for rendering, eliminating the need to transfer texture data between the CPU and GPU. This saves CPU processing time between different texture caches and texture transfer time to the GPU, improving rendering efficiency. It also saves memory occupied by texture data and GPU video memory.

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

[0016] In this way, the electronic device can register the first texture data and the second texture data with the graphics processing unit (GPU) using the texture identifier. This allows the corresponding texture data to be directly retrieved from the GPU for rendering, eliminating the need to transfer texture data between the CPU and GPU. This improves rendering performance and saves device resources.

[0017] In one implementation, when synthesizing the first texture data and the second texture data to obtain the third texture data, the electronic device may obtain the first texture data from the GPU based on the first texture identifier, and may also obtain the second texture data from the GPU based on the second texture identifier. The electronic device may then synthesize the first texture data and the second texture data to obtain the third texture data.

[0018] In this way, the electronic device can use the texture identifier to directly obtain the corresponding texture data from the GPU for rendering, without the need to transfer texture data between the CPU and GPU, greatly improving rendering performance.

[0019] Furthermore, by synthesizing the first and second texture data, the present embodiment ensures that 2D and 3D component objects are rendered in parallel, eliminating the need for separate rendering. This effectively reduces rendering time and resources. This ensures that the lifecycles of 2D and 3D component objects are consistent, avoiding inconsistent display progress during subsequent display, thereby enhancing the user's visual experience.

[0020] In one achievable embodiment, when determining the first layout information and first component type of a 2D component object corresponding to a target application, and the second layout information and second component type of a 3D component object, the electronic device may parse the application interface to obtain the first component type and the second component type in the application interface, as well as the style and attributes corresponding to the 2D component object and the style and attributes of the 3D component object. The electronic device may 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.

[0021] In this way, the embodiment of the present application can parse the application interface in advance to obtain the style and attributes corresponding to the component object, and determine its corresponding position and size based on the style and attributes corresponding to the component object. In this way, the 2D component object and the 3D component object can be comprehensively rendered based on the first layout information corresponding to the 2D component object and the second layout information corresponding to the 3D component object. Thus, it is possible to ensure that the life cycle of the 2D component object is consistent with that of the 3D component object, and to achieve the effect of the fusion display of the 2D object and the 3D object. This improves the user experience.

[0022] In one possible implementation, the electronic device can obtain a component data packet of a rendering engine during the process of parsing an application interface; the component data includes at least one application program interface of the rendering engine, at least one application program interface works based on a native application program interface (Native API) mechanism, and parses the application interface according to the component data packet.

[0023] In this way, after the electronic device obtains at least one application program interface of the rendering engine, the at least one application program interface can work based on the Native API mechanism and can realize the TS (Type Script) to C++ two-way data communication mechanism. Even if different electronic devices correspond to different operating systems and their corresponding development framework languages ​​are different, different electronic devices can compile and run at least one application program interface of the rendering engine. For example, the development framework language used by the application can be Java, Kotlin, Swift, TS or JS, and the native language of the operating system can be C or C++. Based on the method of the example of this implementation method, in the process of developing applications for devices with 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 connect to the interface of the rendering engine. Developers use a certain language, such as any language from Java to JS mentioned above, to develop an application, and the application can be run on devices with different operating systems, which reduces the technical threshold for developers to develop target applications and ensures consistent rendering effects in different operating systems.

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

[0025] As such, the present embodiment does not request separate drawing canvases for 2D component objects and 3D component objects. Instead, a single drawing canvas is requested for each application interface. This ensures that 2D component objects and 3D component objects have consistent lifecycles and subsequent display progress, for example, consistent display duration, consistent display effect change timing, and consistent display end time. This, in turn, enhances the user experience.

[0026] In one implementation, at least one application program 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 the 2D scene can move, an interface for setting the background in the 3D scene and the 2D scene, an interface for setting transparency, an interface for adding custom drawn objects, an interface for adding shapes and geometric bodies, and an interface for setting 3D motion effects and 2D motion effects.

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

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

[0029] In one implementation, the component types of the 2D component object and the 3D component object include any one of the following: a text view component, a video view component, a web page view component, a link view component, a camera view component, a live view component, and an advertisement view component.

[0030] In a second aspect, an embodiment of the present application further provides a rendering device, which includes: a compilation module, a window cross-platform module, a component module, a rendering engine and a display module.

[0031] The compiling 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 corresponding to the 2D component object and the style and attributes of the 3D component object.

[0032] The window cross-platform module is used to determine the first layout information according to the style and properties corresponding to the 2D component object.

[0033] The window cross-platform module is further used to determine the second layout information according to the style and properties corresponding to the 3D component object.

[0034] The window cross-platform module is further used to create a 2D component object according to the first component type.

[0035] The window cross-platform module is further used to create a 3D component object according to the second component type.

[0036] The component module is used to create first texture data of a 2D component object.

[0037] The component module is further used to create second texture data of the 3D component object.

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

[0039] The rendering engine is configured to render the third texture data according to the first layout information and the second layout information to generate a 2D object and a 3D object.

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

[0041] In this way, the rendering device provided by the embodiment of the present application can synthesize the texture data of the 2D component object and the 3D component object, and render the synthesized texture data according to their corresponding layout information. Thereby, it is possible to ensure that the life cycles of the 2D component object and the 3D component object are consistent, and to achieve the effect of fusion display of the 2D object and the 3D object. Even in the scenario where there is a transition change in the content of the 2D component object and the 3D component object, the content of the 2D component object and the 3D component object can also transition together to maintain a consistent dynamic effect experience for the two. In turn, the user's sense of use is improved.

[0042] In a third aspect, an embodiment of the present application provides an electronic device comprising a memory and one or more processors; the memory is coupled to the processor; wherein computer program code is stored in the memory, and the computer program code comprises computer instructions, and when the computer instructions are executed by the processor, the electronic device executes the rendering method as described in the first aspect above.

[0043] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, in which instructions are stored. When the instructions are executed on a computer, the computer can execute the rendering method described in the first aspect above. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] FIG1 is a schematic diagram of the hardware structure of a mobile phone provided in an embodiment of the present application;

[0045] FIG2 is a schematic diagram of the software structure of a mobile phone provided in an embodiment of the present application;

[0046] FIG3 is a schematic diagram of the main screen interface provided in an embodiment of the present application;

[0047] FIG4 is a schematic diagram of a flow chart of a rendering method provided in an embodiment of the present application;

[0048] FIG5 is a schematic diagram of the interaction between multiple modules provided in an embodiment of the present application;

[0049] FIG6 is a schematic diagram of the rendering process of the rendering method provided in an embodiment of the present application;

[0050] FIG7 is a schematic diagram of the structure of a rendering device provided in an embodiment of the present application;

[0051] FIG8 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0052] The technical solutions in the embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application. Among them, in the description of the present application, unless otherwise specified, " / " indicates that the objects associated before and after are in an "or" relationship. For example, A / B can represent A or B; "and / or" in the present application is only a description of the association relationship of the associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural. In addition, in the description of the present application, unless otherwise specified, "multiple" refers to two or more than two. "At least one of the following" or similar expressions refers 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, c can be single or multiple. In addition, in order to facilitate a clear description of the technical solutions of the embodiments of the present application, in the embodiments of the present application, words such as "first" and "second" are used to distinguish identical or similar items with basically the same functions and effects.

[0053] Those skilled in the art will understand that words such as "first" and "second" do not limit the quantity and execution order, and words such as "first" and "second" do not necessarily limit differences. At the same time, in some embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or design. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a concrete way for easy understanding.

[0054] In addition, the device architecture and business scenarios described in the embodiments of the present application are intended to more clearly illustrate the technical solutions of the embodiments of the present application, and do not constitute a limitation on the technical solutions provided in the embodiments of the present application. Ordinary technicians in this field can know that with the evolution of device architecture and the emergence of new business scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.

[0055] During the rendering process, electronic devices must independently render the 3D component objects corresponding to 3D objects and the 2D component objects corresponding to 2D objects. These rendered 3D component objects and 2D component objects are then displayed to enable the subsequent display of the 2D and 3D objects. Component objects are visual elements within a page or application, such as 2D view components and 3D view components. In other words, electronic devices must independently render 2D view components and 3D view components to display 2D and 3D objects.

[0056] Specifically, electronic devices can apply for different drawing canvases to render 2D component objects and 3D component objects respectively. The 3D component objects are merely placeholders, and rendering of the 3D component objects relies on the rendering engine. After rendering the content of the 3D component objects, the rendering engine transfers the rendered texture data to the 3D component objects for display.

[0057] In this way, since each drawing canvas is rendered and displayed independently, there will be inconsistencies in the lifecycles of 2D component objects and 3D component objects. As a result, in scenarios where the content in 2D component objects and 3D component objects transitions, the displayed 2D objects and 3D objects will have inconsistent animation experiences. In addition, if there is a pop-up component on the page, and the position of the pop-up component happens to be the display area where the 3D component object is located, there will also be the problem of blocking the pop-up component, causing the pop-up component to not display properly.

[0058] Based on the above content, an embodiment of the present application provides a rendering method that can be applied in an electronic device, and the method includes: the electronic device can determine the first layout information and the first component type of the 2D object corresponding to the target application, and the second layout information and the second component type of the 3D object. The electronic device can also create a 2D component object and the first texture data of the 2D component object based on the first component type, and create a 3D component object and the second texture data of the 3D component object based on the second component type. Then, 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 a 2D object and a 3D object. The electronic device can display the application interface of the target application, and the application interface includes 2D objects and 3D objects.

[0059] In embodiments of the present application, the first texture data of a 2D component object and the second texture data of a 3D component object can be combined to obtain third texture data. Furthermore, the third texture data can be rendered based on the first layout information of the 2D component object and the second layout information of the 3D component object to generate a 2D object and a 3D object. Thus, the 2D object and the 3D object can be displayed.

[0060] In this way, by synthesizing the texture data of the 2D component object and the 3D component object, and rendering the synthesized texture data according to their corresponding layout information, it is possible to ensure that the life cycle of the 2D component object is consistent with that of the 3D component object, and achieve the effect of fusion display of the 2D object and the 3D object. Even in the scene where the content of the 2D component object and the 3D component object is transitioning, the content of the 2D component object and the 3D component object can also transition together to maintain a consistent dynamic effect experience for the two. In turn, the user experience is improved.

[0061] In addition, the embodiment of the present application generates second texture data and displays it after creating a 3D component object. The 3D component object is not just a placeholder. Even if the display area where the 3D component object is located happens to be the location of the pop-up component, it will not block the pop-up component.

[0062] The electronic device provided in the embodiments of the present application may include at least one of a mobile phone, a smart watch, a tablet computer, a foldable electronic device, a desktop computer, a laptop computer, a handheld computer, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook, a cellular phone, a personal digital assistant (PDA), an augmented reality (AR) device, a virtual reality (VR) device, an artificial intelligence (AI) device, a wearable device, and an in-vehicle device. The embodiments of the present application do not impose any special restrictions on the specific type of the electronic device.

[0063] The operating system installed in the electronic device provided in the embodiment of the present application includes but is not limited to This application does not limit the specific type of electronic device and the type of operating system when an operating system is installed.

[0064] For example, taking the electronic device as a mobile phone as an example, FIG1 shows a schematic structural diagram of the mobile phone 100 .

[0065] The mobile phone 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 screen 194, and a subscriber identification module (SIM) card interface 195, etc. Among them, the sensor module 180 can 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.

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

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

[0068] The wireless communication function of the mobile phone 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.

[0069] 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 mobile phone 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.

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

[0071] Mobile phone 100 implements display functionality through a GPU, display screen 194, and an application processor. The 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 graphics rendering. Processor 110 may include one or more GPUs that execute program instructions to generate or modify display information.

[0072] In some embodiments of the present application, the display screen 194 is used to display 2D objects and 3D objects, such as corresponding images, videos, etc. The 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 or an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a MiniLED, a MicroLed, a Micro-oLed, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the mobile phone 100 can include one or N display screens 194, where N is a positive integer greater than 1.

[0073] The software system of the mobile phone 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 software structure of the mobile phone 100 is exemplified by taking an operating system of a layered architecture as an example.

[0074] FIG2 is a block diagram of the software structure of the mobile phone 100 according to an embodiment of the present application.

[0075] A layered architecture divides software into several layers, each with distinct roles and responsibilities. Layers communicate with each other via software interfaces. In some embodiments, the operating system (OS) is divided into four layers: application layer, application framework layer, system library layer, and kernel layer, from top to bottom.

[0076] The operating system supports displaying various types of view components, such as 2D component objects and 3D component objects, which is conducive to the construction of the OS ecosystem. Among them, a view component is a component that can be responsible for drawing and event processing a display area in an application page.

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

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

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

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

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

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

[0083] The view system includes visual components, such as components for displaying text and images. The view system can be used to build applications. A display interface can consist of one or more views. For example, a display interface that includes a text notification icon can include a view that displays text and a view that displays an image.

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

[0085] 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 text messages in the status bar, beeps, vibrations on electronic devices, and flashing indicator lights.

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

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

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

[0089] In some examples, the system library may further include a package management module, and the meta-service management module may cooperate with the package management module to manage application resources of the target application.

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

[0091] For example, the above only uses a mobile phone as an example to illustrate the structure of the electronic device in the embodiment of the present application, but does not constitute a limitation on the structure and form of the electronic device. In some examples, the electronic device may include more or fewer components than those shown in Figures 1 or 2, or combine certain components, split certain components, replace certain components, or arrange the components differently. The embodiment of the present application does not limit the structure and form of the electronic device.

[0092] The following will describe the method provided by the embodiment of the present application in conjunction with the accompanying drawings and the above description. In the embodiment of the present application, each subject can perform some or all of the steps in the embodiment of the present application, and these steps or operations are only examples. The embodiment of the present application can also perform other operations or variations of various operations. In addition, each step can be performed in a different order according to the embodiment of the present application, and it is possible that not all operations in the embodiment of the present application need to be performed.

[0093] The following is an illustrative description of the rendering scenario provided in the embodiments of the present application.

[0094] In some embodiments of the present application, a target application may be installed in the electronic device, and the target application may be an application that can present 3D objects to the user. It should be understood that the target application may be an application that implements 3D functions, for example, the target application is a game application that includes 3D objects (such as 3D game characters, buildings, etc.). The target application may also be an application that can implement 3D functions, such as a modeling application, a shopping application, a social application, and a life service application (such as a car service application). It should be noted that the embodiments of the present application do not specifically limit the application type of the target application installed above.

[0095] In response to a user's operation on a target application, the electronic device can display the application interface corresponding to the target application. The application interface can include 3D objects, such as 3D images. A 3D image is an image that has a height dimension in addition to length and width. This allows the user to view the 3D object through the target application on their phone.

[0096] Exemplarily, the target application may include a desktop application, and the user can set the mobile phone desktop wallpaper as a dynamic wallpaper. The dynamic wallpaper may include some 3D objects, such as 3D game characters, buildings, etc. In this way, after the mobile phone is started, the desktop application can display the corresponding 3D object in response to the user's settings. As shown in Figure 3, the electronic device can display a main screen interface 300 (or desktop), which includes one or more application icons in the main screen interface, such as a shopping application icon, a settings application icon, etc., which are not illustrated one by one here. The icons of different applications can be used to open the running interface of the corresponding application and realize the functions of the corresponding application. At the same time, the desktop can display a 3D object corresponding to the dynamic wallpaper, which is a 3D town building.

[0097] As another example, the target application may also include a third-party application (such as a JS application) designed and written by a developer using a computer language. Among them, the JS application refers to an application developed using the JavaScript language. A JS page can be provided in the JS application, and the JS page can be displayed by calling a visual component object, that is, the JS page is a display page of the component object. Developers can use the JS application to develop other target applications. For example, a 3D component object for displaying a 3D object in a desktop application can be preconfigured in the JS application. The embodiment of the present application does not specifically limit the type and number of target applications used by the user.

[0098] It should be noted that a 3D object refers to a virtual object with a three-dimensional display effect, and the virtual object includes but is not limited to people, objects, animals, plants, etc.

[0099] In some embodiments of the present application, when an electronic device displays an application interface of a target application, the application interface may include not only 3D objects but also some 2D objects, such as 2D images, where a 2D image is an image having only two dimensions, length and width.

[0100] For example, referring to Figure 3, the desktop includes not only 3D town buildings, but also 2D cloud images and 2D sun images. For another example, in a game scene, the user's avatar or name is a 2D image, and the game character or game scene is a 3D image. In this way, the electronic device needs to render not only 3D objects but also other 2D objects. Referring to Figure 4, the rendering method provided in an embodiment of the present application includes the following steps:

[0101] S401: The electronic device determines first layout information and a first component type of a 2D object, and second layout information and a second component type of a 3D object corresponding to a target application.

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

[0103] Specifically, the electronic device can use a drawing canvas, such as surfaceNode, to fuse and render the 2D component objects and 3D component objects of the application interface to achieve the display of 2D objects and 3D objects. In this way, each application interface corresponds to only one drawing canvas, and different application interfaces correspond to different drawing canvases.

[0104] As such, the present embodiment does not request separate drawing canvases for 2D component objects and 3D component objects. Instead, a single drawing canvas is requested for each application interface. This ensures that 2D component objects and 3D component objects have consistent lifecycles and subsequent display progress, for example, consistent display duration, consistent display effect change timing, and consistent display end time. This, in turn, enhances the user experience.

[0105] In some embodiments of the present application, the electronic device may, in response to a user operation on a target application, launch the target application and parse the target application's application interface. For example, in response to a user clicking an application icon, the electronic device may launch the target application and parse the target application's application interface. For another example, in response to a user moving a 3D component object in the target application, the electronic device may load the resources corresponding to the 3D component object and parse the application interface to be displayed.

[0106] Specifically, referring to FIG5 , the electronic device includes a meta-capability management module, which can manage the application resources of the target application and parse the target application (such as S501). Exemplarily, the meta-capability management module can start the target application in response to a user clicking on the application icon. In another exemplary embodiment, the meta-capability management module can also manage the application process of the target application after the target application is started. In another exemplary embodiment, the meta-capability management module can also load the application resources of the target application after the target application is started.

[0107] The electronic device may further include a compilation module. Continuing with the example of the electronic device parsing the application interface, the compilation module may 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 properties corresponding to the 2D component object and the style and properties of the 3D component object (such as S502).

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

[0109] Of course, each application interface may include information such as the hierarchical relationship of multiple component objects, the labels of each component object, common properties, private property styles, and events. The compilation module can obtain the above information during the process of parsing the application interface. The embodiment of the present application does not specifically limit the information of the above component objects. The compilation module obtains information such as the component objects, styles, properties, and events corresponding to each application page, and saves the information such as each component object, style, property, and event in the application page in the corresponding data structure.

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

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

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

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

[0114] Data binding refers to the process of establishing a connection between the application UI interface and the data source, which is used to automatically draw and update the corresponding UI node when the data of each VDOM node changes.

[0115] Of course, after the window cross-platform module generates the corresponding front-end DOM nodes according to the styles and properties of the 2D component objects and 3D component objects, the window cross-platform module can also create corresponding back-end component (component) nodes, element (element) nodes, and rendering (render) nodes in sequence according to the front-end DOM nodes to complete the layout calculation, component style and property updates, etc.

[0116] Exemplarily, the window cross-platform module may calculate first layout information corresponding to a 2D component object and second layout information corresponding to a 3D component object at a virtual node, wherein the first layout information includes the position and size of the 2D component object, and the second layout information includes the position and size of the 3D component object.

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

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

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

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

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

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

[0123] Specifically, the electronic device may include a rendering engine. During the process of generating the second texture data in the 3D rendering node, the component module may notify the rendering engine in the 3D rendering node to load pre-set resources. Exemplarily, the component module may dynamically load a dynamic dependency library (so) and third-party 3D resources in the 3D engine in advance. The pre-loaded third-party 3D resources may be component data pre-set in a 3D component object, for example, corresponding background resources, text resources, and line resources in the pre-loaded 3D component object.

[0124] In some embodiments of the present application, the rendering engine includes at least one application program interface (API), which can set corresponding window handles for multiple virtual windows and set the multiple window handles in the rendering engine. At the same time, 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 the multiple window handles and bind the 3D component objects corresponding to the multiple window handles to the corresponding rendering threads. In this way, when rendering the 3D component objects, the rendering engine can call the rendering threads corresponding to the window handles, thereby completing the rendering of the 3D component objects.

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

[0126] In some examples, at least one application program interface may include one or more callback interfaces implemented by the rendering engine. For example, the callback interfaces may include a virtual window initialized callback interface, a graphics context initialized callback interface, a drawing completed callback interface, a SurfaceNode creation callback interface, a SurfaceNode content changed callback interface, and a SurfaceNode destroyed callback interface. It should be noted that the embodiments of this application do not limit the specific implementation of the callback interfaces.

[0127] After obtaining one or more APIs from the rendering engine, the component module may also create a virtual window and update the window handle in the rendering engine using at least one API. The component module then creates rendering context state information and a rendering window in the virtual window, and generates second texture data based on the rendering context state information and the rendering window.

[0128] Specifically, the component module can call the rendering interface between the graphics programming interface and the native window system in the virtual window, and create rendering context state information and a rendering window. For example, the graphics programming interface may include Open Graphics Library (OpenGL), the rendering interface may include EGL (Embedded Graphic Library), and the rendering window may include an EGL window. In this way, after calling the EGL interface, the component module can create EGL context state information and an EGL window, and generate the 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 for rendering the 3D component object.

[0129] S403: The electronic device synthesizes the first texture data and the second texture data to obtain third texture data.

[0130] In some embodiments of the present application, before the rendering engine synthesizes the first texture data and the second texture data, the component module may register the first texture data and the second texture data in a graphics processing unit (GPU).

[0131] In this way, embodiments of the present application can register the texture data corresponding to 2D and 3D component objects directly with the GPU, avoiding the creation of a texture cache in the central processing unit (CPU). Subsequent rendering engines can directly retrieve texture data from the GPU for rendering, eliminating the need to transfer texture data between the CPU and GPU. This saves CPU processing time between different texture caches and texture transfer time to the GPU, improving rendering efficiency. It also saves memory occupied by texture data and GPU video memory.

[0132] Specifically, the component module may 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 in the graphics processor GPU according to the first texture identifier and the second texture identifier.

[0133] For example, the first texture identifier of the first texture data may be the first texture ID of the first texture data, and the first texture ID may represent unique identification information of the first texture data. The component module may register the first texture data with 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 may be the second texture ID of the second texture data, and the second texture ID may represent unique identification information of the second texture data. The component module may register the second texture data with the GPU based on the second texture identifier of the second texture data corresponding to the 3D component object.

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

[0135] In some embodiments of the present application, the rendering engine may obtain first texture data from the GPU based on the first texture ID and obtain second texture data from the GPU based on the second texture ID. After obtaining the first texture data and the second texture data using the first texture ID and the second texture ID, the rendering engine may call a texture synthesis interface to synthesize the first texture data and the second texture data to obtain third texture data (e.g., S505).

[0136] S404: The electronic device renders the third texture data according to the first layout information and the second layout information to generate a 2D object and a 3D object.

[0137] In some embodiments of the present application, the component module can generate rendering instructions required for rendering in 2D rendering nodes and 3D rendering nodes based on the content status of 2D component objects and 3D component objects and the required rendering effects. These instructions include information such as the vertex positions, lighting, shadows, physical motion effects, texture maps, etc. of the drawn objects.

[0138] In this way, when controlling the rendering engine to perform actual rendering, the component module can perform a series of operations such as vertex processing, lighting calculation, shadow calculation, physical motion effect calculation, texture mapping, etc. according to the received rendering instructions. Then, through fusion rendering technology, the rendering tasks corresponding to the 2D component objects and the rendering tasks corresponding to the 3D component objects are unified for rendering, and the rendering results of the 2D component objects and 3D component objects are merged to obtain the rendering results. In some examples, the rendering process can include the processing of occlusion relationships and the calculation of blending effects to achieve seamless fusion display of 2D component objects and 3D component objects.

[0139] Specifically, the rendering engine can obtain the 2D first texture data and the second texture data from the GPU according to the texture identifier of the texture data corresponding to the 2D component object and the 3D component object, and render the texture data corresponding to the 2D component object and the 3D component object according to the layout information corresponding to the 2D component object and the 3D component object.

[0140] That is, the rendering engine may render the third texture data according to the position and size of the 2D component object and the position and size of the 3D component object, thereby subsequently displaying the 2D object and the 3D object (such as S506).

[0141] In this way, the rendering engine can use the texture identifier to directly obtain the corresponding texture data from the GPU for rendering, without the need to transfer texture data between the CPU and GPU, greatly improving rendering performance.

[0142] Furthermore, by synthesizing the first and second texture data, the present embodiment ensures that 2D and 3D component objects are rendered in parallel, eliminating the need for separate rendering. This effectively reduces rendering time and resources. This ensures that the lifecycles of 2D and 3D component objects are consistent, avoiding inconsistent display progress during subsequent display, thereby enhancing the user's visual experience.

[0143] S405: The electronic device displays the 2D object and the 3D object.

[0144] In some embodiments of the present application, after rendering the third texture data, the rendering engine may send the rendering result obtained after rendering 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, and the component module can display the rendering result on the 2D component object and the 3D component object to achieve a fusion display effect of the 2D object and the 3D object.

[0145] Of course, the electronic device may further include a display module, which may display an application interface of the target application, wherein the application interface includes the above-mentioned 2D objects and 3D objects.

[0146] In some embodiments of the present application, the above examples illustrate the electronic device rendering 2D component objects and 3D component objects and displaying the corresponding rendering results. In actual applications, after generating the rendering results, the data in the rendering results can also be updated, and a new rendering result can be generated based on the updated data. The embodiments of the present application do not limit the specific implementation steps of the rendering process.

[0147] In some embodiments of the present application, referring to FIG6 , a developer can develop a target application at one time, and the electronic device runs the target application and parses the corresponding application interface, creates a corresponding component object, and renders the component object according to its style, attributes, etc. to obtain the application interface. During the rendering process of the electronic device, the electronic device can use the UI framework to pull up the backend rendering service (render service), and the render service can transmit the drawing instructions to the rendering engine, and the rendering engine completes the rendering operation. The render service also shares the rendering context (render context) in the GPU to speed up rendering efficiency. In this way, the rendering engine can complete the rendering operation and synthesize the rendering results for display on the screen.

[0148] In some embodiments of the present application, while parsing an application interface in a target application, the electronic device may obtain a component data packet of a rendering engine. The component data includes at least one application program interface (API) of the rendering engine, and at least one API operates based on a Native API mechanism. The electronic device may then parse the application interface in the target application based on the at least one API of the rendering engine in the component data packet.

[0149] Among them, at least one application 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 the 2D scene can move, an interface for setting the background in the 3D scene and the 2D scene, an interface for setting transparency, an interface for adding custom drawing objects, an interface for adding shapes and geometric bodies, and an interface for setting 3D animation effects and 2D animation effects.

[0150] Electronic devices can download and install the rendering engine component data packages from servers and app stores to generate an executable file corresponding to the rendering engine. It should be understood that an executable file is in binary format and is typically a runnable program or script. The executable file contains the rendering engine code, data, and resources and can be directly executed on a computer. The executable file can be directly called by the user or the operating system to activate and execute the rendering engine.

[0151] In an embodiment of the present application, at least one application program interface of the rendering engine can be packaged through the Native API mechanism and exposed to the electronic device side. In this way, the electronic device can call at least one application program interface of the rendering engine in the component data packet to use the rendering engine to perform the rendering process. That is to say, by using the Native API mechanism to package at least one application program interface of the rendering engine, after the electronic device obtains at least one application program interface of the rendering engine, the at least one application program interface can work based on the Native API mechanism, and can realize the TS (Type Script) to C++ two-way data communication mechanism. In this way, the electronic device can compile and run the corresponding TS API through C++, that is, it can call at least one application program interface of the rendering engine.

[0152] Even if different electronic devices correspond to different operating systems and their corresponding development framework languages ​​are different, different electronic devices can compile and run the above-mentioned application program interface. In this way, after the target application in the electronic device is started, it can compile and run the above-mentioned application program interface, parse the application interface in the target application, and complete the subsequent rendering process of the application interface. That is, developers can complete the development and deployment of target applications based on a unified component data package, without having to use the development framework language corresponding to different operating systems to connect to the rendering engine interface. The target application can be seamlessly deployed in different operating systems and perform rendering tasks, and different operating systems can correspond to target applications with the same mechanism. It greatly reduces the code maintenance cost in different operating systems, lowers the technical threshold for developers to develop target applications, and ensures consistent rendering effects in different operating systems. In turn, it improves the user experience.

[0153] In an embodiment of the present application, the electronic device can perform object creation and module registration according to the component data package. For example, the electronic device can register the meta-capability management module, compilation module, window cross-platform module, component module and rendering engine.

[0154] In some embodiments of the present application, the electronic device may correspond to different operating systems, and the operating system of the electronic device may include any of the following: and wait.

[0155] In some embodiments of the present application, developers can develop the logic code or functional instructions and data of the target application to ensure the UI (User Interface) interface and corresponding business processing logic in the target application. Exemplarily, developers can use programming languages ​​and utilize the program code of the editing function in the development tool, that is, development files. The development file may include description files and resource files, wherein the description file includes a description of the layout of the UI, the components in the UI, and the visual effects of the layout and components using a programming language. The description file also includes a file that defines the interface behavior using a programming language. The interface behavior includes the dynamic changes of the UI and the response of the electronic device to the dynamic changes of the UI (such as the response of the terminal device to the user's UI operation). The resource file may include prescriptive files for the configuration resources required for the operation of the target application, such as image resources, font resources, etc.

[0156] It is understandable that in some embodiments of the present 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 embodiment of the present application is not limited to this.

[0157] The embodiment of the present application further provides a rendering device. Referring to FIG. 7 , the rendering device includes: a compilation module 710 , a window cross-platform module 720 , a component module 730 , a rendering engine 740 and a display module 750 .

[0158] The compiling 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 properties corresponding to the 2D component object and the style and properties of the 3D component object.

[0159] The window cross-platform module 720 is used to determine first layout information according to the style and properties corresponding to the 2D component object.

[0160] The window cross-platform module 720 is further configured to determine the second layout information according to the style and properties corresponding to the 3D component object.

[0161] The window cross-platform module 720 is further configured to create a 2D component object according to the first component type.

[0162] The window cross-platform module 720 is further configured to create a 3D component object according to the second component type.

[0163] The component module 730 is used to create first texture data of a 2D component object.

[0164] The component module 730 is further configured to create second texture data of the 3D component object.

[0165] The component module 730 is further configured to synthesize the first texture data and the second texture data to obtain third texture data.

[0166] The rendering engine 740 is configured to render the third texture data according to the first layout information and the second layout information to generate a 2D object and a 3D object.

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

[0168] In some embodiments, multiple embodiments of the present application may be combined and the combined embodiments may be implemented. Optionally, some operations in the processes of the various method embodiments may be optionally combined, and / or the order of some operations may be optionally 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 the steps. Other execution orders may also be used between the steps. This is not intended to indicate that the execution order is the only order in which these operations may be performed.

[0169] Those skilled in the art will appreciate various ways to reorder the operations described in the embodiments of the present application. In addition, it should be noted that the process details involved in a certain embodiment of the present application are also applicable to other embodiments in a similar manner, or different embodiments can be used in combination.

[0170] Furthermore, some steps in the method embodiments may be equivalently replaced with other possible steps. Alternatively, some steps in the method embodiments may be optional and may be deleted in certain usage scenarios. Alternatively, other possible steps may be added to the method embodiments.

[0171] Furthermore, the various method embodiments may be implemented separately or in combination.

[0172] An embodiment of the present application further provides an electronic device, such as the mobile phone mentioned above. As shown in FIG8 , the mobile phone may include one or more processors 810 , a memory 820 and a communication interface 830 .

[0173] The memory 820 and the communication interface 830 are coupled to the processor 810. For example, the memory 820, the communication interface 830 and the processor 810 may be coupled together via a bus 840.

[0174] The communication interface 830 is used to transmit data with other devices. The memory 820 stores computer program code. The computer program code includes computer instructions. When the computer instructions are executed by the processor 810, the electronic device performs the relevant method steps in the embodiments of the present application.

[0175] 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 the present disclosure. The processor may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, and the like.

[0176] Bus 840 may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. Bus 840 may be divided into an address bus, a data bus, a control bus, and the like. For ease of illustration, FIG8 shows only one thick line, but this does not imply that there is only one bus or only one type of bus.

[0177] An embodiment of the present application also provides an electronic device, which includes a memory and one or more processors; the memory is coupled to the processor; wherein computer program code is stored in the memory, and the computer program code includes computer instructions, and when the computer instructions are executed by the processor, the electronic device executes the relevant method steps in the above method embodiment.

[0178] An embodiment of the present application also provides a communication device, which includes a memory and one or more processors; the memory is coupled to the processor; wherein computer program code is stored in the memory, and the computer program code includes computer instructions, and when the computer instructions are executed by the processor, the communication device executes the relevant method steps in the above method embodiment.

[0179] An embodiment of the present application further provides a computer-readable storage medium, in which computer program code is stored. When the processor executes the computer program code, the electronic device executes the relevant method steps in the above method embodiment.

[0180] An embodiment of the present application further provides a computer program product, which, when executed on a computer, enables the computer to execute the relevant method steps in the above method embodiment.

[0181] An embodiment of the present application also provides a chip system, including: a processor, the processor is coupled to a memory, the memory is used to store programs or instructions, and when the program or instructions are executed by the processor, the chip system implements the method in any of the above method embodiments.

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

[0183] Optionally, the memory in the chip system may be one or more. The memory may be integrated with the processor or may be provided separately from the processor, which is not limited in the embodiments of the present application. 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 provided on different chips. The embodiments of the present application do not specifically limit the type of memory or the configuration of the memory and the processor.

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

[0185] The electronic device, computer storage medium or computer program product provided in this application is used to execute the corresponding method provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding method provided above, and will not be repeated here.

[0186] Through the description of the above implementation methods, technical personnel in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.

[0187] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of modules or units is only 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 device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0188] Units described as separate components may or may not be physically separate, and components shown as units may be one physical unit or multiple physical units, located in one place or distributed across multiple locations. Some or all of the units may be selected to achieve the purpose of this embodiment according to actual needs.

[0189] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.

[0190] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially or the contributing part or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling a device (which can be a single-chip microcomputer, chip, etc.) or a processor to execute all or part of the steps of the various embodiments 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 (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0191] The above content is only a specific embodiment of this application, but the scope of protection of this application is not limited to this. Any changes or replacements within the technical scope disclosed in this application should be included in the scope of protection of this application. Therefore, the scope of protection of this application should be based on the scope of protection of the claims.

Claims

1. A rendering method, characterized in that: Applied to electronic equipment, the method comprises: Determine first layout information and a first component type of a 2D object corresponding to the target application, and second layout information and a second component type of a 3D object; Creating a 2D component object and first texture data of the 2D component object according to the first component type; creating the 3D component object and second texture data of the 3D component object according to the second component type; synthesizing the first texture data and the second texture data to obtain third texture data; Rendering the third texture data according to the first layout information and the second layout information to generate the 2D object and the 3D object; An application interface of the target application is displayed, where the application interface includes the 2D object and the 3D object.

2. The method according to claim 1, characterized in that: The creating the 2D component object and the first texture data of the 2D component object comprises: Creating the 2D component object; Creating a 2D rendering node corresponding to the 2D component object, and generating the first texture data based on the 2D rendering node; The creating the 3D component object and the second texture data of the 3D component object comprises: Creating the 3D component object; A 3D rendering node corresponding to the 3D component object is created, and the second texture data is generated based on the 3D rendering node.

3. The method according to claim 2, characterized in that The electronic device includes a rendering engine, the rendering engine includes at least one application program interface, the application program interface is used to set a window handle to the rendering engine, and the rendering engine is used to render a 3D component object bound to the window handle; generating the second texture data in the 3D rendering node includes: Loading 3D resources in the rendering engine in the 3D rendering node; Creating a virtual window, and updating the window handle in the rendering engine using at least one of the application programming interfaces; In the virtual window, creating rendering context state information and a rendering window; The second texture data is generated according to the rendering context state information and the rendering window.

4. The method according to any one of claims 1 to 3, characterized in that: The method further comprises: The first texture data and the second texture data are registered in a graphics processor GPU.

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

6. The method according to claim 5, characterized in that The synthesizing the first texture data and the second texture data to obtain third texture data includes: Acquire the first texture data from the GPU according to the first texture identifier; Acquire the second texture data from the GPU according to the second texture identifier; The first texture data and the second texture data are synthesized to obtain the third texture data.

7. The method according to any one of claims 1 to 6, characterized in that: The determining of the first layout information and the first component type of the 2D component object corresponding to the target application, and the second layout information and the second component type of the 3D component object, comprises: Parsing the application interface to obtain the first component type and the second component type in the application interface, as well as the style and properties corresponding to the 2D component object and the style and properties of the 3D component object; Determine the first layout information according to the style and attributes corresponding to the 2D component object; The second layout information is determined according to 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: Acquire a component data packet of the rendering engine; the component data packet includes at least one application program interface of the rendering engine, and the at least one application program interface works based on a Native API mechanism; The application interface is parsed according to the component data packet.

9. The method according to claim 8, characterized in that At least one of the application interfaces 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 the 2D scene can move, an interface for setting the background in the 3D scene and the 2D scene, an interface for setting transparency, an interface for adding custom drawn objects, an interface for adding shapes and geometric bodies, and an interface for setting 3D animation effects and 2D animation effects.

10. The method according to any one of claims 1 to 9, characterized in that: The method further comprises: A drawing canvas corresponding to the application interface is created; wherein the drawing canvas is used to render the 2D component object and the 3D component object.

11. The method according to any one of claims 1 to 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 any one of claims 1 to 11, characterized in that: The component types of the 2D component object and the 3D component object include any one of the following: a text view component, a video view component, a web page view component, a link view component, a camera view component, a live view component, and an advertisement view component.

13. A rendering device, characterized in that: The rendering device comprises: a compiling module, a window cross-platform module, a component module, a rendering engine and a display module; The compiling module is used to determine a first component type of a 2D object and a second component type of a 3D object corresponding to the target application, as well as a style and property corresponding to the 2D component object and a style and property of the 3D component object; The window cross-platform module is used to determine the first layout information according to the style and attributes corresponding to the 2D component object; The window cross-platform module is further used to determine the second layout information according to the style and attributes corresponding to the 3D component object; The window cross-platform module is further used to create the 2D component object according to the first component type; The window cross-platform module is further used to create the 3D component object according to the second component type; The component module is used to create first texture data of the 2D component object; The component module is further used to create second texture data of the 3D component object; The component module is further used to synthesize the first texture data and the second texture data to obtain 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 an application interface of the target application, wherein the application interface includes the 2D object and the 3D object.

14. An electronic device, characterized in that: It includes a memory and one or more processors; the memory is coupled to the processor; wherein the memory stores computer program code, the computer program code includes computer instructions, and when the computer instructions are executed by the processor, the electronic device executes 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, and when the instructions are executed on a computer, the computer can execute the rendering method according to any one of claims 1 to 12.

Citation Information

Patent Citations

  • Texture synthesis method, device and equipment

    CN108010095A

  • Graphical interface rendering method and device, electronic equipment and storage medium

    CN113409411A

  • Method and device for displaying view control

    CN115480762A

  • Data processing method and device

    CN116309074A

Cited By

  • Component rendering method and device, equipment and medium

    CN122411927A