CN117707676A - Window rendering method, device, equipment, storage medium and program product - Google Patents
Window rendering method, device, equipment, storage medium and program product Download PDFInfo
- Publication number
- CN117707676A CN117707676A CN202311740743.8A CN202311740743A CN117707676A CN 117707676 A CN117707676 A CN 117707676A CN 202311740743 A CN202311740743 A CN 202311740743A CN 117707676 A CN117707676 A CN 117707676A
- Authority
- CN
- China
- Prior art keywords
- window
- rendering
- data
- browser
- native
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000009877 rendering Methods 0.000 title claims abstract description 587
- 238000000034 method Methods 0.000 title claims abstract description 134
- 238000003860 storage Methods 0.000 title claims abstract description 25
- 230000008569 process Effects 0.000 claims description 59
- 230000004044 response Effects 0.000 claims description 16
- 238000004590 computer program Methods 0.000 claims description 8
- 230000005540 biological transmission Effects 0.000 claims description 2
- 230000008901 benefit Effects 0.000 abstract description 10
- 238000005516 engineering process Methods 0.000 abstract description 10
- 238000013473 artificial intelligence Methods 0.000 abstract 1
- 230000000694 effects Effects 0.000 description 17
- 230000006870 function Effects 0.000 description 16
- 238000012545 processing Methods 0.000 description 14
- 238000011161 development Methods 0.000 description 13
- 230000000007 visual effect Effects 0.000 description 13
- 239000000872 buffer Substances 0.000 description 9
- 239000008186 active pharmaceutical agent Substances 0.000 description 6
- 239000000203 mixture Substances 0.000 description 6
- 239000000306 component Substances 0.000 description 5
- 239000002131 composite material Substances 0.000 description 5
- 238000010586 diagram Methods 0.000 description 5
- 230000003993 interaction Effects 0.000 description 4
- 238000004891 communication Methods 0.000 description 3
- 239000008358 core component Substances 0.000 description 3
- VYZAMTAEIAYCRO-UHFFFAOYSA-N Chromium Chemical compound [Cr] VYZAMTAEIAYCRO-UHFFFAOYSA-N 0.000 description 2
- 230000006399 behavior Effects 0.000 description 2
- 229910052804 chromium Inorganic materials 0.000 description 2
- 239000011651 chromium Substances 0.000 description 2
- 230000000295 complement effect Effects 0.000 description 2
- 238000012790 confirmation Methods 0.000 description 2
- 230000006872 improvement Effects 0.000 description 2
- 230000002452 interceptive effect Effects 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 239000007787 solid Substances 0.000 description 2
- GXCLVBGFBYZDAG-UHFFFAOYSA-N N-[2-(1H-indol-3-yl)ethyl]-N-methylprop-2-en-1-amine Chemical compound CN(CCC1=CNC2=C1C=CC=C2)CC=C GXCLVBGFBYZDAG-UHFFFAOYSA-N 0.000 description 1
- 238000013475 authorization Methods 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000003139 buffering effect Effects 0.000 description 1
- 238000004364 calculation method Methods 0.000 description 1
- 235000019219 chocolate Nutrition 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 230000002349 favourable effect Effects 0.000 description 1
- 238000009434 installation Methods 0.000 description 1
- 230000010354 integration Effects 0.000 description 1
- 230000004807 localization Effects 0.000 description 1
- 238000013507 mapping Methods 0.000 description 1
- 230000007246 mechanism Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000002360 preparation method Methods 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
- 238000012360 testing method Methods 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/451—Execution arrangements for user interfaces
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/95—Retrieval from the web
- G06F16/958—Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Software Systems (AREA)
- Databases & Information Systems (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Data Mining & Analysis (AREA)
- Human Computer Interaction (AREA)
- Image Generation (AREA)
Abstract
The application discloses a window rendering method, device, equipment, storage medium and program product, and relates to the technical field of computers. The method comprises the following steps: acquiring a native window and a browser window; creating an overlay binding relation between the browser window and the original window to obtain a rendering window; acquiring rendering data, wherein the rendering data corresponds to a window data identifier, and the window data identifier is used for representing a window adopted when rendering the rendering data; and adjusting transparency parameters of a browser window in the rendering window based on the window data identifier corresponding to the rendering data, and rendering to obtain a data rendering picture corresponding to the rendering data. Through the mode, the transparency parameters of the browser window can be flexibly adjusted according to the window data identification corresponding to the rendering data, and the advantages of high performance of the original window and the instantaneity of the browser window are comprehensively exerted while the display accuracy of the picture is not affected. The method and the device can be applied to various scenes such as cloud technology, artificial intelligence and the like.
Description
Technical Field
The embodiment of the application relates to the technical field of computers, in particular to a window rendering method, a device, equipment, a storage medium and a program product.
Background
With the development of computer technology, application programs are widely used, and in order to develop various functions in the application programs as completely as possible, a hybrid application model is generally adopted to perform the development process of the application programs.
In the related art, in order to consider both high-performance service scenarios and optimizing frequent service scenarios during the development of an application program, a browser mode is additionally introduced to complement and perfect the native mode of the application program, so as to strengthen the functional effect of the application program.
In the above process, in order to ensure smooth running of an application program, an interface display process is generally performed through a native mode or a browser mode when a display task for one interface is executed, in this case, the native mode and the browser mode are mutually split, the native mode often has a problem of poor flexibility, and the browser mode often has a problem of poor performance, so that a rendering process cannot be completed well, and rendering efficiency is affected.
Disclosure of Invention
The embodiment of the application provides a window rendering method, device, equipment, storage medium and program product, which can flexibly adjust transparency parameters of a browser window according to window data identifiers corresponding to rendering data, comprehensively exert the high-performance advantage of a native window and the instantaneity of the browser window while not affecting the display accuracy of a picture, and greatly improve the picture rendering efficiency. The technical scheme is as follows.
In one aspect, a method for rendering a window is provided, the method including:
the method comprises the steps of obtaining a native window and a browser window, wherein the native window is a window created based on a program framework corresponding to an application program, and the browser window is a window created based on a browser engine deployed in the application program;
creating an overlay binding relation between the browser window and the native window to obtain a rendering window, wherein the overlay binding relation is used for overlaying the browser window on the native window;
acquiring rendering data, wherein the rendering data corresponds to a window data identifier, and the window data identifier is used for representing a window adopted when the rendering data is rendered;
And adjusting transparency parameters of the browser window in the rendering window based on the window data identifier corresponding to the rendering data, rendering to obtain a data rendering picture corresponding to the rendering data, wherein the transparency parameters are used for representing the value of a window transparency channel.
In another aspect, there is provided a window rendering apparatus, the apparatus including:
the window acquisition module is used for acquiring a native window and a browser window, wherein the native window is a window created based on a program frame corresponding to an application program, and the browser window is a window created based on a browser engine deployed in the application program;
the relation creation module is used for creating an overlay binding relation between the browser window and the native window to obtain a rendering window, and the overlay binding relation is used for overlaying the browser window on the native window;
the data acquisition module is used for acquiring rendering data, wherein the rendering data corresponds to a window data identifier, and the window data identifier is used for representing a window adopted when the rendering data is rendered;
the data rendering module is used for adjusting transparency parameters of the browser window in the rendering window based on the window data identifier corresponding to the rendering data, rendering to obtain a data rendering picture corresponding to the rendering data, and the transparency parameters are used for representing the value of a window transparency channel.
In another aspect, a computer device is provided, the computer device including a processor and a memory, where the memory stores at least one instruction, at least one program, a set of codes, or a set of instructions, the at least one instruction, the at least one program, the set of codes, or the set of instructions being loaded and executed by the processor to implement a window rendering method as in any one of the embodiments of the application.
In another aspect, a computer readable storage medium is provided, in which at least one instruction, at least one program, a set of codes, or a set of instructions is stored, the at least one instruction, the at least one program, the set of codes, or the set of instructions being loaded and executed by a processor to implement a window rendering method as described in any one of the embodiments of the application.
In another aspect, a computer program product or computer program is provided, the computer program product or computer program comprising computer instructions stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device performs the window rendering method according to any one of the above embodiments.
The beneficial effects that technical scheme that this application embodiment provided include at least:
after the original window and the browser window are obtained, the browser window is covered on the original window through creating the covering binding relation to obtain the rendering window, and then transparency parameters of the browser window in the rendering window are adjusted according to window data identifiers when rendering the rendering data, so that a data rendering picture corresponding to the rendering data is obtained through rendering. By creating the overlay binding relation between the two, the transparency parameter of the browser window can be flexibly adjusted according to the window data identification required to be adopted when rendering the rendering data, so that the purpose of flexibly adjusting the relation between the original window and the browser window is realized, the display accuracy of a picture is not influenced, the high-performance advantage of the original window and the instantaneity of the browser window can be comprehensively exerted, and the picture rendering efficiency is greatly improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic illustration of an implementation environment provided by an exemplary embodiment of the present application;
FIG. 2 is a flowchart of a window rendering method provided by an exemplary embodiment of the present application;
FIG. 3 is a flowchart of a window rendering method provided in another exemplary embodiment of the present application;
FIG. 4 is a schematic illustration of a rendering window provided in an exemplary embodiment of the present application;
FIG. 5 is a flowchart of a window rendering method provided in yet another exemplary embodiment of the present application;
FIG. 6 is a flowchart of a window rendering method provided by yet another exemplary embodiment of the present application;
FIG. 7 is a schematic diagram of a related art provided by an exemplary embodiment of the present application;
FIG. 8 is a block diagram of a window rendering apparatus provided in an exemplary embodiment of the present application;
fig. 9 is a schematic structural diagram of a server according to an exemplary embodiment of the present application.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the present application more apparent, the embodiments of the present application will be described in further detail below with reference to the accompanying drawings.
In the related art, in order to consider both high-performance service scenarios and optimizing frequent service scenarios during the development of an application program, a browser mode is additionally introduced to complement and perfect the native mode of the application program, so as to strengthen the functional effect of the application program. In the above process, in order to ensure smooth running of an application program, an interface display process is generally performed through a native mode or a browser mode when a display task for one interface is executed, in this case, the native mode and the browser mode are mutually split, the native mode often has a problem of poor flexibility, and the browser mode often has a problem of poor performance, so that a rendering process cannot be completed well, and rendering efficiency is affected.
In the embodiment of the application, a window rendering method is introduced, which can flexibly adjust transparency parameters of a browser window according to window data identifiers corresponding to rendering data, comprehensively play the advantages of high performance of a native window and the instantaneity of the browser window while not affecting the display accuracy of a picture, and greatly improve the picture rendering efficiency. The window rendering method of the embodiment of the application can be applied to various scenes such as video playing scenes, live scenes, game scenes, social chat scenes, audio playing scenes and the like, and is not limited herein.
It should be noted that, before and during the process of collecting the relevant data of the user, the present application may display a prompt interface, a popup window or output a voice prompt message, where the prompt interface, popup window or voice prompt message is used to prompt the user to collect the relevant data currently, so that the present application only starts to execute the relevant step of obtaining the relevant data of the user after obtaining the confirmation operation of the user to the prompt interface or popup window, otherwise (i.e. when the confirmation operation of the user to the prompt interface or popup window is not obtained), the relevant step of obtaining the relevant data of the user is finished, i.e. the relevant data of the user is not obtained. In other words, all user data collected in the present application is collected with the consent and authorization of the user, and the collection, use and processing of relevant user data requires compliance with relevant laws and regulations and standards of the relevant region.
Secondly, the implementation environment related to the embodiment of the present application is described, where the window rendering method provided in the embodiment of the present application may be implemented by the terminal alone, or may be implemented by the server, or implemented by the terminal and the server through data interaction, which is not limited in this embodiment of the present application. Alternatively, a method of interactively executing window rendering by a terminal and a server is described as an example.
Referring to fig. 1, the implementation environment relates to a terminal 110 and a server 120, and the terminal 110 and the server 120 are connected through a communication network 130.
In some embodiments, the development and management process of the application program is performed by the server 120, and the server 120 may obtain the native window and the browser window during the development process or the management process.
The native window is a window created based on a program frame corresponding to the application program, and the browser window is a window created based on a browser engine deployed in the application program.
Optionally, after obtaining the native window and the browser window, the server 120 creates an overlay binding between the browser window and the native window, thereby obtaining the rendered window.
Wherein the overlay binding relationship is used to overlay the browser window on the native window.
In some embodiments, the rendering data is collected by the terminal 110, and the terminal 110 sends the rendering data to the server 120 through the communication network 130, so that the server obtains the rendering data.
Optionally, the server 120 obtains the window data identifier corresponding to the obtained rendering data, where the window data identifier is used to characterize a window adopted when rendering the rendering data.
In some embodiments, the server 120 adjusts transparency parameters of browser windows in the rendering windows based on the window data identifiers corresponding to the rendering data, so as to render a data rendering frame corresponding to the rendering data.
The transparency parameter is used for representing the value of the window transparency channel. Namely: by adjusting the transparency of the browser window located above the native window, the rendering data can be selectively targeted rendered through at least one of the native window and the browser window.
It should be noted that the above-mentioned terminals include, but are not limited to, mobile terminals such as mobile phones, tablet computers, portable laptop computers, intelligent voice interaction devices, intelligent home appliances, vehicle-mounted terminals, and the like, and may also be implemented as desktop computers and the like; the server may be an independent physical server, a server cluster or a distributed system formed by a plurality of physical servers, or a cloud server providing basic cloud computing services.
Cloud technology (Cloud technology) refers to a hosting technology that unifies serial resources such as hardware, application programs, networks and the like in a wide area network or a local area network to realize calculation, storage, processing and sharing of data.
In some embodiments, the servers described above may also be implemented as nodes in a blockchain system.
The window rendering method provided in the present application will be described with reference to the above noun introduction and application scenario, and the application of the method to a server will be described by taking the application of the method to the server as an example, as shown in fig. 2, and the method includes the following steps 210 to 240.
Step 210, a native window and a browser window are obtained.
The native window is a window created based on a program framework corresponding to the application program.
Illustratively, the window rendering process is performed by an application program, and a program framework corresponding to the application program is used to represent an operating system on which the application program depends. For example: applications perform tasks through services and interfaces provided by the operating system, such as: window management tasks, creation tasks for graphical user interfaces, and the like.
Alternatively, native (native) windows are content created and managed by the window manager of the operating system, typically in conformity with the user interface style of the operating system; the application program may interact with the native window through an application programming interface (Application Programming Interface, API) provided by the operating system, controlling the appearance and behavior of the window.
Illustratively, if the application is running in a Microsoft Windows graphical (Microsoft Windows, windows) system, the native window is a window provided by the Windows system; if the application is running in a malt tower (Macintosh Operation System, macOS) system, the native window is the window provided by the MacOS system.
Illustratively, the native window created based on the program framework corresponding to the application program can also be called a local window, and based on the creation process, the integration of the native window and the user interface style and the program function which can be expressed by the application program through the operating system is more compact. Namely: the native window can provide a more direct and deeper way of integrating with the operating system in the application development process, so that the localization experience and functions of the application can be improved through the operating system.
Wherein the browser window is a window created based on a browser engine deployed within the application.
Illustratively, in order to provide more immediate information in an application, a browser engine is typically integrated in the application, which may be implemented either manually by a user or by default within the application.
The browser engine is a core component of the browser and is responsible for analyzing and rendering webpage content. By deploying the browser engine within the application, more immediate information is facilitated to be obtained.
Illustratively, under the condition that a browser engine is disposed in an application program, the application program can use a corresponding API to create a browser (Web) window, wherein the browser window is a browser view embedded in the application program, so that a user using the application program can load and browse a webpage in the browser window to acquire instant information through the application program.
Namely: the browser window is an interface for accessing a web page on the internet, and the application program is independent software with a specific function; some applications choose to provide browser services by deploying a browser engine so that users can easily access instant messages on different devices and platforms, providing greater flexibility and convenience.
Illustratively, the application program obtains a native window based on its own program framework, and also obtains a browser window through a deployed browser engine, so as to integrate the native window and the browser window to execute a subsequent window rendering process.
And 220, creating an overlay binding relation between the browser window and the native window to obtain a rendering window.
Wherein the overlay binding relationship is used to overlay the browser window on the native window.
Optionally, obtaining a browser window and a native window based on the interface display size corresponding to the application program, so that the browser window and the native window have the same size; and overlaying the browser window on the original window to obtain a rendering window.
Optionally, adjusting a second window size corresponding to the browser window based on the first window size corresponding to the original window, and covering the browser window with the adjusted window size on the original window to obtain the rendering window.
At step 230, rendering data is acquired.
Illustratively, the obtained rendering window is used for executing a rendering process on the rendering data so as to display the rendering data on an interface corresponding to the application program through window rendering.
The rendering data corresponds to a window data identifier, and the window data identifier is used for representing a window adopted when rendering the rendering data.
Illustratively, different rendering data is rendered with corresponding windows, such as: rendering data associated with the application itself may be rendered with higher accuracy through the native window; the obtained more instant rendering data can be rendered more timely through a browser window; the rendering data obtained at a certain moment is partially suitable for being rendered by the original window and partially suitable for being rendered by the browser window, so that the original window and the browser window in the rendering window can be comprehensively adopted for common rendering, and the like.
Optionally, the different rendering data are respectively corresponding to a window data identifier so as to represent a window adopted when the rendering data are rendered.
Illustratively, the window data identifier corresponding to the rendering data is 00, which represents rendering the rendering data through the native window; or, the window data corresponding to the rendering data is identified as 11, which represents rendering the rendering data through the browser window; or, the window data corresponding to the rendering data is identified as 01, which represents that the rendering data is cooperatively rendered through the native window and the browser window, and the like.
It should be noted that the above is only an illustrative example, and the embodiments of the present application are not limited thereto.
Step 240, based on the window data identifier corresponding to the rendering data, adjusting the transparency parameter of the browser window in the rendering window, and rendering to obtain a data rendering picture corresponding to the rendering data.
Illustratively, after determining the rendering data and the window data identifier corresponding to the rendering data, considering that a browser window located above in the rendering window may have a shielding problem on a native window located below, it is necessary to flexibly adjust window parameters corresponding to the browser window according to the window data identifier.
Illustratively, the window parameters are parameters for adjusting the display condition of the browser window, and include background color parameters, transparency parameters, size parameters and other various parameter forms. The background color parameter is used for determining the background color corresponding to the browser window; the transparency parameter is used for controlling the transparency degree of the browser window; the size parameter is used to control the width and height of the browser window, in pixels, etc.
The transparency parameter is used for representing the value of the window transparency channel.
Optionally, the browser window is expressed by four channels, wherein the four channels comprise three color channels and one channel for expressing transparency, the three color channels are used for representing information of three channels of Red (Red), green (Green) and Blue (Blue), and the value range of each color channel is 0 to 255, and represents the intensity of the color; transparency channels are typically characterized by Alpha, which also has a value ranging from 0 to 255, where 0 means completely transparent and 255 means completely opaque. Namely: four channels may be characterized as RGBA.
The background color corresponding to the browser window can be determined by integrating the three color channels, the transparency channel determines the transparency of the browser window, and different effects can be displayed on the browser window by adjusting the numerical values corresponding to the four channels respectively.
For example: if the RGBA of the browser window is set to (255, 0, 128), which indicates that the background color is red and the transparency parameter has a value of 128, the background representing the window is translucent red; alternatively, if RGBA of the browser window is set to (126,5, 68,0) and the value based on the transparency parameter is 0, the background of the browser window is implemented to be transparent or the like regardless of the background color.
In an optional embodiment, according to the window data identifier corresponding to the rendering data, the transparency parameter of the browser window located at the upper layer in the rendering window is adjusted to differentially determine whether to display the browser window and the background color thereof remarkably.
Optionally, if the window data identifier corresponding to the rendering data indicates that the rendering data is rendered through the native window, in order to avoid a covering effect of the browser window on the native window, the transparency parameter is adjusted to set the background of the browser window to be transparent.
Optionally, if the window data identifier corresponding to the rendering data indicates that the rendering data is rendered by cooperation of the native window and the browser window, the transparency parameter may be adjusted to set the background of the browser window to be transparent in order to avoid the covering effect of the browser window on the native window, so that the rendering content of the browser window is displayed while the rendering content of the native window is not affected.
Optionally, if the window data identifier corresponding to the rendering data indicates that the rendering data is rendered through the browser window, the transparency parameter may not be adjusted, and the rendering data may be directly rendered through the browser window, or the like.
In some embodiments, based on the window data identifier corresponding to the rendering data, the rendering data is rendered by executing a rendering process through at least one window of the raw window and the browser window in the rendering window, and a data rendering picture corresponding to the rendering data is rendered.
Schematically, if the window data identifier corresponding to the rendering data indicates that the rendering data is rendered through the native window, after the transparency parameter of the browser window is adjusted, the rendering process is executed on the rendering data through the native window, so that the rendering effect of the native window is not interfered by the browser window while the rendering window presents the data rendering picture.
Schematically, if the window data identifier corresponding to the rendering data indicates that the rendering data is rendered through cooperation of the native window and the browser window, after the transparency parameter of the browser window is adjusted, part of the rendering data is subjected to the rendering process through the native window, and the other part of the rendering data is subjected to the rendering process through the browser window after the transparency parameter is adjusted, so that the rendering window is used for displaying the content rendered by the native window and the content rendered by the browser window while the rendering window is used for displaying the data rendering picture.
For example: the video content is rendered through the primary window, the barrage content is rendered through the browser window, and at the moment, the video content is rendered based on the primary window positioned at the lower layer in the rendering window, so that the accuracy is high; the barrage content is based on a browser window positioned above a native window in the rendering window, has strong flexibility and instantaneity, namely, the rendering data are processed more pertinently by combining the characteristics of the native window and the browser window under the condition that the rendering window and the rendering data are acquired.
It should be noted that the above is only an illustrative example, and the embodiments of the present application are not limited thereto.
In summary, after the native window and the browser window are obtained, the browser window is covered on the native window by creating the coverage binding relationship to obtain the rendering window, and then the transparency parameter of the browser window in the rendering window is adjusted according to the window data identifier when rendering the rendering data, so that the data rendering picture corresponding to the rendering data is rendered. By creating the overlay binding relation between the two, the transparency parameter of the browser window can be flexibly adjusted according to the window data identification required to be adopted when rendering the rendering data, so that the purpose of flexibly adjusting the relation between the original window and the browser window is realized, the display accuracy of a picture is not influenced, the high-performance advantage of the original window and the instantaneity of the browser window can be comprehensively exerted, and the picture rendering efficiency is greatly improved.
In an alternative embodiment, when the window data identifier corresponding to the rendering data indicates that the first rendering data is rendered through the native window, the rendering data may be referred to as first rendering data, and the corresponding window data identifier may be referred to as first window data identifier, so as to obtain the data rendering picture. Illustratively, as shown in fig. 3, the embodiment shown in fig. 2 described above may also be implemented as steps 310 through 350 below.
Step 310, a native window and a browser window are obtained.
The native window is a window created based on a program framework corresponding to the application program.
Illustratively, by taking an application program running in a Windows system as an example, the programming language C++ may be used to write code content related to data rendering by the application program.
An environment in which application development is performed using the programming language c++ under the Windows system is called Windows c++. C++ is a generic, static type, cross-platform programming language, an extension and enhancement of the C language. The method is widely applied in the fields of system programming, embedded development, game development, scientific computing, high-performance application and the like, has flexibility, high efficiency and expandability, and is a powerful programming language choice. By installing the C++ installation package under the Windows system, the code writing process can be performed by the C++ in the Windows system.
Alternatively, the native window is a window created based on c++.
Illustratively, in the C++ language environment, a window is created using the win32gui library, and a class is registered for the window and a window instance is created.
The win32gui library provides functionality to interact with the Windows API to enable developers to perform some underlying tasks related to Windows systems, such as window control, message handling, etc., in a c++ language environment.
Alternatively, a Window Class (Window Class) is registered for the native Window registration Class, i.e., representative, in Windows systems, the native Window is not just a visualized area, but many other properties and behaviors. Window classes define some basic features of a window, such as window procedure (processing functions of window messages), background color, icons, etc.
Optionally, after the window class is registered, then the actual window instance may be created by a win32gui. Createwindow function that needs to provide a series of parameters such as window class name, window title, window style (style), window position, window size, etc.
Illustratively, after ensuring that the pywin32 library is installed under the Windows system, a simple native window is created by the create_native_window function, and registers a window class, and then an actual window instance is created using the CreateWindow function so that the native window can respond to the user's interaction event.
Wherein the browser window is a window created based on a browser engine deployed within the application.
Illustratively, a browser engine Chromium embedded framework (Chromium Embedded Framework, CEF) technique for embedding a browser engine within an application may be used in a c++ language environment; the CEF initialization function is invoked to start and configure the CEF during use of the technology to embed an open source browser engine within the application.
Illustratively, the purpose of the initialization function is to properly set and initiate the CEF in the embedded environment so that web content may be displayed in the application using the embedded browser engine, user interactions handled, etc. During the initialization process, the CEF performs a series of configuration and preparation steps to ensure that the browser engine is functioning properly and meets the requirements of the application.
Illustratively, after CEF initialization, the programming process may be performed and a browser window created in a C++ language environment.
It should be noted that the foregoing describes creating the browser window and the native window content in the c++ language environment, and the window creation process may also be performed in the c# language environment or the python language environment, which is not limited herein.
At step 320, an overlay binding is created between the browser window and the native window, resulting in a rendered window.
Wherein the overlay binding relationship is used to overlay the browser window on the native window.
Illustratively, after obtaining the browser window and the native window, embedding the browser window into the native window to establish an overlay binding relationship between the browser window and the native window. In the overlay binding relationship, the browser window is positioned at the upper layer of the original window, and the rendering window is obtained by integrating the browser window and the original window.
As shown in fig. 4, in which a native window 410 and a browser window 420 are displayed, the browser window 420 is placed on the native window 410, thereby establishing an overlay binding relationship between the native window 410 and the browser window 420, and resulting in a rendered window.
Step 330, obtain rendering data.
The rendering data corresponds to a window data identifier, and the window data identifier is used for representing a window adopted when rendering the rendering data.
The rendering data is schematically content which needs to be rendered and displayed on the interface in the running process of the application program, different rendering data are respectively corresponding to window data identifiers, and the window data identifiers are used for representing windows adopted when the rendering data are rendered.
Alternatively, in the running process of the application program, not only the rendering data required to be rendered in the running process of the application program itself may be obtained, but also the rendering data representing the instant situation may be obtained, and the two types of rendering data may be obtained at the same time as the overall rendering data, etc.
In an alternative embodiment, the acquisition of rendering data for rendering in a native window is described as follows.
In some embodiments, an application running in a Windows system typically performs a rendering process of rendering data of video, audio, etc., by creating a multimedia programming interface (direc eXtension).
Wherein DirectX is a set of APIs provided by microsoft, and is mainly used for game development, multimedia applications, and other applications requiring real-time graphics and audio processing; directX provides an API for graphics rendering as a set of components in Windows systems, allowing developers to draw Two-Dimensional (2D) and Three-Dimensional (3D) graphics using the graphics hardware of a computer, and also allowing various applications (e.g., game software, etc.) to be used directly in conjunction with video and audio hardware, by accessing a graphics processing unit (Graphic Processing Unit, GPU) for high performance graphics rendering such as Three-Dimensional scene rendering, texture mapping, lighting effects, etc. Namely: dircetX is a core component for performing rendering.
In some embodiments, in addition to creating DircetX, in order to manage exchanges between Front buffers (Front buffers) and Back buffers (Back buffers) to achieve a smooth graphical display, it is also necessary to create exchange chains associated with DircetX. A switch chain is a mechanism for switching between front and back buffers. For example: at the end of each frame, the image in the rear buffer is swapped to the front buffer for presentation on the screen. This switching process is managed by a switching chain.
In some embodiments, a texture object may also be created and associated with the back buffer of the swap chain. The association process is used to take texture as a rendering target in graphics rendering to display texture objects on a screen.
Illustratively, the texture object may be implemented as a 2D image containing graphics data, but may also be a 3D map of other types of data, a volume texture, etc., typically determined according to the needs of the application. Optionally, the process of creating texture objects is done through a specific interface in DircetX.
In some embodiments, to create complex user interfaces and graphical effects, a DirectComposition device, which is an object for creating and managing DirectComposition components, is also typically created with the help of a direct composition (dcomp. Lib) library (dcomp. Lib), which is a component in DirectX that provides a high-performance, window-based, graphical composition engine.
Illustratively, the DirectComposition component provides advanced graphics composition and rendering functions, and the DirectComposition library (abbreviated dcomp. Lib) is a library file that is used to link and invoke these functions.
Illustratively, the DirectX comprises Direct2D special for 2D graphics rendering, direct3D special for 3D graphics rendering and the like, and a DirectComposition component is combined with the Direct2D and/or the Direct3D, so that a complex graphics effect can be created.
Optionally, a dcomposition creation device method provided in dcomp.lib is used to create a DirectComposition device, and a combined target object is created by the DirectComposition device. DCompositionCreateDevice is a function of dcomp.
The created combined target object can be regarded as a graphic container, and other DirectComposition objects can be contained in the graphic container; binding the combined target object on the window handle corresponding to the original window.
Illustratively, the native window is used for rendering data generated by the application running on the Windows system itself; the window handle of the native window is an integer value that is used to uniquely identify and reference the window. In Windows systems, each visible window has a unique window handle. A window handle is a reference that allows a program to interact with an operating system through an identifier to perform a series of tasks associated with a window.
Illustratively, the combined target object is bound to the window handle of the native window to render the combined target object on the native window.
In some embodiments, a visual object may also be created using a DirectComposition device, which in turn binds the exchange chain to it and sets it up as the root visual object of the visual tree.
Illustratively, the visual object is created for the purpose of building a graphic tree for graphic composition and composition on the screen. Visual objects are basic elements in DirectComposition, which may contain layers, bitmaps, etc., and may be used to implement complex graphical effects and user interfaces; binding the created visual object with the exchange chain to present the visual object on the screen.
In some embodiments, invoking the commit method of the DirectComposition device submits the command batch to the DirectComposition for processing so that the generated composite object will be displayed on the native window.
Illustratively, there is a transactional notion in directcomposition, a method call made to a graphics tree can be considered part of a transaction, typically combining a series of method calls into one transaction, and then committing at once is performed in an atomic manner.
The judgment process is executed through the IDComposition device 2:Commit method, and the call is only validated when the IDComposition device 2:Commit is called, and all the suspending method calls of the device are executed simultaneously. DirectComposition has no ability to render elements but rather combines rendered bitmaps.
The method comprises the steps that a combination target object is created, a visual object calls a setconnection binding bitmap (namely a layer), a plurality of visual objects are combined to obtain a composite object, and the composite object is an object to be finally presented on a native window.
The synthetic object is the rendering data to be rendered on the native window; the above describes the acquisition of rendering data for rendering on a native window.
In an alternative embodiment, the acquisition of rendering data for rendering in a browser window is described as follows.
Optionally, the rendering data rendered on the browser window is instant data acquired by the browser engine, and has smaller relevance to the application program itself; typically involving the use of a corresponding developer tool of a browser engine, browser extension, or other automated test tool generation.
And step 340, adjusting transparency parameters of the browser window in the rendering window in response to the first rendering data corresponding to the first window data identifier, so as to obtain an adjustment window.
Wherein the first window data identification is used to characterize the rendering of the first rendering data through the native window.
Schematically, the above-mentioned composite object is regarded as first rendering data, where the first rendering data characterizes data that needs to be rendered through a native window among the obtained multiple rendering data.
After the first rendering data is determined, in order to avoid the shading effect of the browser window on the native window when the first rendering data is rendered on the native window in the rendering window, the transparency parameter of the browser window can be adjusted to obtain an adjusted window.
Optionally, the adjustment window is used to represent a rendering window after adjustment of the browser window. The adjustment window represents the window of which the lower layer is a native window and the upper layer is an adjusted browsing window.
In an alternative embodiment, responsive to the first rendering data corresponding to the first window data identification, a transparency channel corresponding to the browser window is determined from the rendering window.
Illustratively, a plurality of pixel positions are distributed on the browser window, each pixel position is used for representing a pixel, a plurality of pixels forming the browser window are determined, namely, the pixels corresponding to the pixel positions are determined.
Alternatively, each pixel is expressed by four channels including three color channels (RGB channels) and one channel expressing transparency (a channel), which may also be referred to as a transparency channel.
Wherein the transparency channel is used to characterize transparency properties of a plurality of pixels that make up the browser window.
Illustratively, the transparency channel has a value in the range of 0 to 255, where 0 means completely transparent and 255 means completely opaque. Then when the transparency channel for a certain pixel is 0, the attribute representing the transparency of that pixel is represented as a completely transparent form; when the transparency channel for a pixel is 255, the transparency attribute representing that pixel is represented in a completely opaque form.
In an alternative embodiment, the transparency channels corresponding to the pixels are assigned by taking the first value as the transparency parameter, so as to obtain the adjustment window.
Wherein the first value is used to characterize the browser window in a transparent form within the rendering window.
Illustratively, the first value of 0 indicates that the transparency attribute of the pixel is set to be in a transparent form, and then the transparency parameter is taken as 0, and a plurality of pixel points corresponding to the browser window are assigned, so that an adjustment window is obtained.
Step 350, performing a data rendering process on the first rendering data by adjusting a native window in the window to obtain a data rendering picture.
Illustratively, the first rendering data is rendering data that is rendered through a native window, the first rendering data being rendered on the native window; and based on the fact that the transparency parameters corresponding to the pixels in the browser window are respectively assigned to 0, the browser window is represented to be in a completely transparent form, so that after the data rendering process is executed on the first rendering data, the transparent browser window does not cover the content displayed by the original window.
Optionally, the data rendering frame is a frame displayed in a rendering window, the rendering window is window content presented on a screen, and the browser-based window is in a transparent form, so that the frame content of the first rendering data rendered by the native window positioned at the lower layer is presented in the data rendering frame.
It should be noted that the above is only an illustrative example, and the embodiments of the present application are not limited thereto.
In an alternative embodiment, the window rendering method described above is performed by a first device.
Illustratively, the first device is implemented as a terminal device; alternatively, the first device is implemented as a server or the like.
In some embodiments, a network speed corresponding to the first device at the current time is obtained.
Wherein the network speed is used to characterize the speed at which the first device is transmitting data. For example: network speed is 3.2M/s, etc.
In some embodiments, in response to the network speed not reaching the preset network speed, the transparency parameter of the browser window within the rendering window is adjusted to obtain an adjusted window.
Schematically, the network speed is periodically compared with a preset network speed; or comparing the current network speed with a preset network speed in real time, and the like. When the network speed is determined to not reach the preset network speed, the rendering process is not suitable for being executed through the browser window with higher instantaneity on the current rendering data, so that the transparency parameter of the browser window in the rendering window can be adjusted, and an adjustment window is obtained.
In some embodiments, the data rendering picture is obtained by performing a data rendering process on the rendering data by adjusting a native window in the window.
In an alternative embodiment, the data type to which the rendering data corresponds is determined.
Wherein the data type is used to characterize the multimedia presentation of the rendering data. Illustratively, the rendering data is in the form of video; and/or rendering the data in the form of an image; and/or rendering the data in text form, etc.
In some embodiments, in response to the rendering data corresponding to the first data type, adjusting a transparency parameter of a browser window within the rendering window to obtain an adjustment window; and executing a data rendering process on the rendering data by adjusting a native window in the window to obtain a data rendering picture.
Wherein the first data type is used to characterize the rendering data as video. Namely: when the rendering data is determined to be in the video form, the rendering data in the video form is considered to have higher requirements on the performance of the device, so that the rendering data can be subjected to data rendering through a native window with stronger stability, and a data rendering picture is obtained.
In some embodiments, in response to the rendering data corresponding to the second data type, the color channel parameters of the browser window in the rendering window are adjusted through the data color information corresponding to the rendering data, so as to obtain the data rendering picture.
Wherein the second data type is used to characterize rendering data in a multimedia presentation form other than a video form. Namely: when the rendering data is determined to be in an image form, a text form and the like other than the video form, the rendering data in the video form is considered to have lower requirements on the performance of the equipment, so that the rendering data can be subjected to data rendering through a browser window with higher instantaneity, and a data rendering picture is obtained.
In summary, by creating the overlay binding relationship between the two, the transparency parameter of the browser window can be flexibly adjusted according to the window data identifier required to be adopted when rendering the rendering data, so that the purpose of flexibly adjusting the relationship between the native window and the browser window is achieved, the display accuracy of the picture is not affected, the high performance of the native window and the instantaneity of the browser window can be comprehensively exerted, and the picture rendering efficiency is greatly improved.
In the embodiment of the application, when first rendering data rendered by the native window is required to be rendered, after transparency parameters of a browser window in the rendering window are adjusted, the adjusting window is obtained, the first rendering data are further rendered to the native window in the adjusting window, the rendering effect when the first rendering data are presented in the native window is prevented from being interfered by the background color of the browser window, the rendering effect of the browser window is flexibly adjusted on the basis that the native window is covered by the browser window, the advantage of high performance of the native window and the instant characteristic of the browser window are comprehensively exerted, and the picture rendering efficiency is improved.
In an optional embodiment, when the window data identifier corresponding to the rendering data indicates that the rendering data is jointly rendered through the native window and the browser window, the rendering data may be referred to as second rendering data, and the corresponding window data identifier may be referred to as second window data identifier, so as to obtain the data rendering picture. Illustratively, as shown in fig. 5, the embodiment shown in fig. 2 described above may also be implemented as steps 510 through 550 described below.
Step 510, a native window and a browser window are obtained.
The native window is a window created based on a program frame corresponding to the application program, and the browser window is a window created based on a browser engine deployed in the application program.
Step 510 is already described in step 210 and step 310, and will not be described again here.
And step 520, creating an overlay binding relation between the browser window and the native window to obtain a rendering window.
Wherein the overlay binding relationship is used to overlay the browser window on the native window.
Step 520 has already been described in step 220 and step 320, and will not be described here again.
In step 530, rendering data is obtained.
The rendering data corresponds to a window data identifier, and the window data identifier is used for representing a window adopted when rendering the rendering data.
The rendering data is schematically content which needs to be rendered and displayed on the interface in the running process of the application program, different rendering data are respectively corresponding to window data identifiers, and the window data identifiers are used for representing windows adopted when the rendering data are rendered.
In an alternative embodiment, the content of the rendering data for rendering in the native window may be obtained by referring to the content in step 330, which is not described herein.
In an alternative embodiment, the acquisition of rendering data for rendering in a browser window is described as follows.
Optionally, the rendering data rendered on the browser window is instant data acquired by the browser engine, and has smaller relevance to the application program itself; it generally involves retrieval using a corresponding developer tool of a browser engine or a related Web API.
And step 540, in response to the second rendering data corresponding to the second window data identifier, adjusting transparency parameters of the browser window in the rendering window to obtain an adjustment window.
Wherein the second window data identification is used to characterize the joint rendering of the second rendering data by the native window and the browser window.
Illustratively, the rendering data is implemented in the form of a rendering data packet, which includes not only the rendering data that needs to be rendered by the native window, but also the rendering data that needs to be rendered by the browser window, and the rendering data packet is collectively referred to as second rendering data.
Optionally, the adjustment window is used to represent a rendering window after adjustment of the browser window. The adjustment window represents the window of which the lower layer is a native window and the upper layer is an adjusted browsing window.
In an alternative embodiment, responsive to the second rendering data corresponding to the second window data identification, a transparency channel corresponding to the browser window is determined from the rendering window.
Wherein the transparency channel is used to characterize transparency properties of a plurality of pixels that make up the browser window. Illustratively, the transparency channel has a value in the range of 0 to 255, where 0 means completely transparent and 255 means completely opaque.
In an alternative embodiment, the transparency channels corresponding to the pixels are assigned by taking the second value as the transparency parameter, so as to obtain the adjustment window.
The second value is used for adjusting transparency expression of a window background of the browser window in the rendering window.
Wherein the transparency representation is used to reflect the transparency level of the window background.
Optionally, the transparency representation characterizes the window background in a transparent form.
The second value is schematically implemented as the first value 0, which is used for indicating that the transparency attribute of the pixel is set to be in a transparent form, and then the value 0 is used as the transparency parameter to assign values to a plurality of pixel points corresponding to the browser window, so as to obtain the adjustment window.
Optionally, the transparency representation characterizes the window background in a semi-transparent form.
Illustratively, the second value is implemented as 128 for indicating that the transparency attribute of the pixel is set to a semi-transparent form; alternatively, the second value is implemented as 2, which is used to indicate that the transparency attribute of the pixel is set to a nearly transparent form, a case where the transparency is large in a semitransparent form, or the like. The second value may be implemented as a default configured value or a value configured by the user, which is not limited herein.
Step 550, performing a data rendering process on the second rendering data by adjusting the window, so as to obtain a data rendering picture.
Illustratively, the second rendering data is rendering data that is rendered together through the native window and the browser window, and when the data rendering process is performed on the second rendering data through the adjustment window, the data respectively rendered by the native window and the adjusted browser window are respectively rendered, so as to obtain a data rendering picture.
In an alternative embodiment, the data rendering process is performed on the first sub-rendering data by adjusting a native window in the windows; and executing a data rendering process on the second sub-rendering data through the adjusted browser window in the adjustment window to obtain a data rendering picture.
Wherein the first sub-rendering data is data in which rendering is performed by the native window in the second rendering data; the second sub-rendering data is data in which rendering is performed by the browser window in the second rendering data.
Illustratively, the second rendering data is implemented as a rendering data packet including a first sub-rendering data partially rendered by the native window and a second sub-rendering data partially rendered by the browser window.
After the browser window in the rendering window is adjusted to obtain an adjusted window, rendering the first sub-rendering data through a native window in the adjusted window; and rendering the second sub-rendering data through the adjusted browser window in the adjustment window, so as to obtain a data rendering picture after the second rendering data is rendered to the adjustment window.
For example: the second rendering data comprises video data to be rendered on the native window and barrage data to be rendered on the browser window; and after the browser window in the rendering window is adjusted to be in a transparent form, an adjusting window is obtained, video data is rendered on a primary window in the adjusting window, bullet screen data is rendered on the browser window adjusted in the adjusting window, so that video content for displaying bullet screen content is obtained, and the video content comprising the bullet screen content is called a data rendering picture.
The limitation that the video data and the barrage data are singly acquired in a native mode or a browser mode is avoided, so that the limitation problem that the video data and the barrage data are singly rendered to a native window or a browser window can be avoided; the original window at the bottom layer and the browsing window at the top layer after the transparency are combined, the aim of rendering different data to different windows in a targeted manner without interfering with content presentation is achieved, and the content presentation efficiency and the content presentation flexibility are improved.
It should be noted that the above is only an illustrative example, and the embodiments of the present application are not limited thereto.
In summary, by creating the overlay binding relationship between the two, the transparency parameter of the browser window can be flexibly adjusted according to the window data identifier required to be adopted when rendering the rendering data, so that the purpose of flexibly adjusting the relationship between the native window and the browser window is achieved, the display accuracy of the picture is not affected, the high performance of the native window and the instantaneity of the browser window can be comprehensively exerted, and the picture rendering efficiency is greatly improved.
In the embodiment of the application, when the second rendering data which is cooperatively rendered by the native window and the browser window is required to be rendered, the transparency parameter of the browser window in the rendering window is adjusted to obtain an adjusted window, the first sub rendering data in the second rendering data is further rendered to the native window in the adjusted window, the second sub rendering data in the second rendering data is further rendered to the adjusted browser window in the adjusted window, the content which is required to be displayed on the native window is timely presented through the browser window while the background color of the browser window is prevented from interfering with the rendering effect which is presented in the native window, so that the advantage of high performance of the native window and the characteristic of instantaneity of the browser window are comprehensively exerted, the layout selection in an application program is enriched while the picture rendering efficiency is improved, the flexible custom picture is supported, and the user experience is improved.
In an alternative embodiment, when the window data identifier corresponding to the rendering data indicates that the rendering data is individually rendered through the browser window, the rendering data may be referred to as third rendering data, and the corresponding window data identifier may be referred to as third window data identifier, so as to obtain the data rendering picture. Illustratively, as shown in fig. 6, the embodiment shown in fig. 2 described above may also be implemented as steps 610 through 640 below.
Step 610, a native window and a browser window are obtained.
The native window is a window created based on a program frame corresponding to the application program, and the browser window is a window created based on a browser engine deployed in the application program.
Step 610 is already described in step 210 and step 310, and will not be described here again.
Step 620, creating an overlay binding relationship between the browser window and the native window, resulting in a rendered window.
Wherein the overlay binding relationship is used to overlay the browser window on the native window.
Step 620 is already described in step 220 and step 320, and will not be described here again.
Step 630, obtain rendering data.
The rendering data corresponds to a window data identifier, and the window data identifier is used for representing a window adopted when rendering the rendering data.
In an alternative embodiment, the content of the rendering data may be obtained by referring to the content in step 330 and step 430, which are not described herein.
Step 640, in response to the third window data identifier corresponding to the third rendering data, adjusting the color channel parameters of the browser window in the rendering window with the data color information corresponding to the third rendering data, and rendering to obtain a data rendering picture corresponding to the third rendering data.
Wherein the third window data identification is used to characterize rendering of the third rendering data through the browser window.
Illustratively, the rendering data is implemented as instant data that needs to be displayed by the browser window, and the instant data is collectively referred to as third rendering data. And determining data color information represented by the third rendering number when the rendering data needing to be rendered through the rendering window is determined to be the third rendering data corresponding to the third window data identification, so that channel parameters respectively corresponding to a plurality of pixels in the browser window are directly adjusted through the data color information, and the third rendering data is rendered to the browser window in the rendering window.
Optionally, the channel parameters of the browser window are implemented as parameters corresponding to four channels, each comprising three color channels (RGB channels) and one expression transparency channel (a channel). The data color information corresponding to the third rendering data is used for representing the color channel value and the transparency channel value corresponding to each pixel respectively.
For example: the data color information corresponding to the third rendering data comprises a pixel value 1 and a pixel value 2, wherein an R value corresponding to the pixel value 1 is 255, a G value is 182, a B value is 193 and an A value is 23, and the color of the pixel 1 represented by the pixel value 1 is more transparent light pink; the pixel value 2 corresponds to an R value of 210, a G value of 105, a B value of 30, an a value of 255, and represents a chocolate color in which the color of the pixel 2 represented by the pixel value 2 is opaque, that is: the color and transparency of the pixel are determined based on the R value, the G value, the B value and the A value; alternatively, only three channels may be used to characterize the color of the pixel, i.e., the R, G, and B values are known to determine the pixel color condition, etc.
Illustratively, the third rendering data is rendered onto the browser window in the rendering windows based on the above process, so that the content presented on the browser window is rendered as the rendered data.
It should be noted that the above is only an illustrative example, and the embodiments of the present application are not limited thereto.
In summary, by creating the overlay binding relationship between the two, the transparency parameter of the browser window can be flexibly adjusted according to the window data identifier required to be adopted when rendering the rendering data, so that the purpose of flexibly adjusting the relationship between the native window and the browser window is achieved, the display accuracy of the picture is not affected, the high performance of the native window and the instantaneity of the browser window can be comprehensively exerted, and the picture rendering efficiency is greatly improved.
In the embodiment of the application, when the third rendering data rendered by the browser window needs to be rendered, the channel parameters of the browser window in the rendering window are adjusted through the data color information corresponding to the third rendering data, so that the third rendering data is directly rendered on the browser window positioned on the upper layer of the rendering window, and a data rendering picture is presented through a plurality of pixels on the browser window. The problem that the native window needs additional design is avoided, and layout selection in the application program is enriched, so that the development of more complex and high-performance graphic effects is facilitated.
In an alternative embodiment, the application running under the Windows operating system performs the above-described window rendering method, and thus the above-described window rendering method may also be referred to as "a method for implementing a hybrid application by a Windows client".
In the related art, under the Windows system, the application program development usually adopts a hybrid application mode (such as a mode of embedding the native application container into the Web browser), and carries high-performance service scenes through the native application container, such as: instant messaging (Instant Messaging, IM), audio video, games, etc.; the Web browser is responsible for some dynamic and cross-platform business scenes with frequent function iteration.
Wherein both native and Web are typically split apart from each other, presented as a layout as shown in fig. 7; the native window 710 corresponding to the native application container and the browser window 720 corresponding to the Web browser are implemented in a layout form divided from each other.
In some embodiments, the window rendering method provides a method for realizing flexible and efficient hybrid application, which supports video rendering on a native window, and the background of a browser window is set to be transparent and then is overlapped on the native window, so that a native window and a Web window are displayed in the same area, and scene requirements such as live broadcasting or games are met.
Optionally, in the process of executing the window rendering method, the method is realized by mainly applying CEF technology and combining DirectComposition with window technology; wherein directcomposition combining window techniques are used to combine different bitmaps together, each window can be considered a layer.
Illustratively, the flow of the window rendering method is implemented as follows.
(1) A win32gui library is used to create a native window, register classes for the native window and create window instances.
(2) A DirectX device and a switching chain associated with the DirectX device are created, the DirectX device is a core component for rendering, and the switching chain manages switching of buffering before and after.
(3) A texture object (a 2D image containing graphics data) is created, associating the texture with the background buffer of the swap chain.
(4) A DirectComposition device is created using the DCompositionCreateDevice method provided in dcomp. Lib, a composition target object is created by the DirectComposition device and bound to the window handle created in (1).
(5) Creating a visual object by using a DirectComposition device, binding the exchange chain created in (2) with the visual object, and setting the exchange chain into a root visual object of a visual tree.
(6) And finally, calling a commit method of the DirectComposition device to submit the command batch to the DirectComposition for processing, and displaying the generated composite object on the target window created in the step (1).
(7) And (3) calling a CEF initialization function to create a CEF browser window, and embedding the CEF browser window into the native window created in the step (1).
(8) In the CefClient item of the CEF browser, the populatebrowser settings method in the MainContextImpl class is modified, a specific Url is intercepted, and the transparent channel a value of the background color (background_color) is set to 0.
(9) So far, both native and Web pages can be displayed in the same area.
It should be noted that the above is only an illustrative example, and the embodiments of the present application are not limited thereto.
In summary, by creating the overlay binding relationship between the two, the transparency parameter of the browser window can be flexibly adjusted according to the window data identifier required to be adopted when rendering the rendering data, so that the purpose of flexibly adjusting the relationship between the native window and the browser window is achieved, the display accuracy of the picture is not affected, the high performance of the native window and the instantaneity of the browser window can be comprehensively exerted, and the picture rendering efficiency is greatly improved.
In the embodiment of the application, the active window and the Web window can be displayed in the same area at the same time, the advantages of the active window and the Web window are integrated, the selection of the layout of the application program is enriched, the flexible custom picture is supported, and the user experience is improved; in addition, by combining with the DirectComposition combined window technology, GPU (graphic processing Unit) accelerated rendering can be used, rendering efficiency is improved, CPU (Central processing Unit) load is reduced, and smoother animation and faster response time are realized; in addition, the rendering process based on the rendering window is favorable for supporting graphic effects with complex development effects and high performance, the background color of the specific url of the CEF kernel code at the bottom layer is modified, the original page is not influenced, the display of non-transparent elements is not influenced, and the method has remarkable efficiency and performance improvement for graphic intensive application.
Referring to fig. 8, a block diagram of a window rendering apparatus according to an exemplary embodiment of the present application is shown, where the apparatus includes the following modules:
the window acquisition module 810 is configured to acquire a native window and a browser window, where the native window is a window created based on a program frame corresponding to an application program, and the browser window is a window created based on a browser engine deployed in the application program;
a relationship creation module 820, configured to create an overlay binding relationship between the browser window and the native window, to obtain a rendering window, where the overlay binding relationship is used to overlay the browser window on the native window;
the data acquisition module 830 is configured to acquire rendering data, where the rendering data corresponds to a window data identifier, and the window data identifier is used to characterize a window adopted when rendering the rendering data;
the data rendering module 840 is configured to adjust a transparency parameter of the browser window in the rendering window based on a window data identifier corresponding to the rendering data, and render a data rendering frame corresponding to the rendering data, where the transparency parameter is used to characterize a value of a window transparency channel.
In an optional embodiment, the data rendering module 840 is further configured to adjust the transparency parameter of the browser window in the rendering window in response to a first window data identifier corresponding to first rendering data, to obtain an adjusted window, where the first window data identifier is used to characterize rendering of the first rendering data through the native window; and executing a data rendering process on the first rendering data through the native window in the adjustment window to obtain the data rendering picture.
In an optional embodiment, the data rendering module 840 is further configured to determine, from the rendering window, a transparency channel corresponding to the browser window in response to the first rendering data corresponding to the first window data identifier, the transparency channel being configured to characterize transparency properties of a plurality of pixels that make up the browser window; and assigning values to the transparency channels corresponding to the pixels respectively by taking the first value as the transparency parameter to obtain the adjustment window, wherein the first value is used for representing the browser window in a transparent form in the rendering window.
In an optional embodiment, the data rendering module 840 is further configured to adjust the transparency parameter of the browser window in the rendering window in response to a second rendering data identifier corresponding to a second window data identifier, to obtain an adjusted window, where the second window data identifier is used to characterize rendering the second rendering data through the native window and the browser window together; and executing a data rendering process on the second rendering data through the adjusting window to obtain a data rendering picture.
In an optional embodiment, the data rendering module 840 is further configured to determine, from the rendering window, a transparency channel corresponding to the browser window in response to the second rendering data corresponding to the second window data identifier, the transparency channel being configured to characterize transparency properties of a plurality of pixels that make up the browser window; and assigning values to the transparency channels corresponding to the pixels respectively by taking the second value as the transparency parameter to obtain the adjustment window, wherein the second value is used for adjusting the transparency performance of the window background of the browser window in the rendering window.
In an alternative embodiment, the data rendering module 840 is further configured to perform a data rendering process on first sub-rendering data through the native window in the adjustment window, where the first sub-rendering data is data of the second rendering data that is rendered by the native window; and executing a data rendering process on second sub-rendering data through the adjusted browser window in the adjustment window to obtain the data rendering picture, wherein the second sub-rendering data is data of the second rendering data, which is rendered by the browser window.
In an optional embodiment, the data rendering module 840 is further configured to, in response to a third window data identifier corresponding to third rendering data, adjust a color parameter of the browser window in the rendering window according to data color information corresponding to the third rendering data, and render a data rendering frame corresponding to the third rendering data; wherein the third window data identification is used to characterize rendering of the third rendering data through the browser window.
In an optional embodiment, the data rendering module 840 is further configured to obtain a network speed corresponding to the first device at the current time, where the network speed is used to characterize a speed of data transmission by the first device; responding to the network speed not reaching a preset network speed, and adjusting the transparency parameter of the browser window in the rendering window to obtain an adjustment window; and executing a data rendering process on the rendering data through the native window in the adjustment window to obtain the data rendering picture.
In an alternative embodiment, the data rendering module 840 is further configured to determine a data type corresponding to the rendering data, where the data type is used to characterize a multimedia presentation form of the rendering data; responding to the rendering data corresponding to a first data type, and adjusting the transparency parameter of the browser window in the rendering window to obtain an adjustment window; executing a data rendering process on the rendering data through the native window in the adjustment window to obtain the data rendering picture; the first data type is used for representing that the rendering data is in a video form; responding to the second data type corresponding to the rendering data, and adjusting color channel parameters of the browser window in the rendering window through data color information corresponding to the rendering data to obtain the data rendering picture; the second data type is used to characterize the rendering data as being presented in a multimedia presentation other than the video form.
In summary, by creating the overlay binding relationship between the two, the transparency parameter of the browser window can be flexibly adjusted according to the window data identifier required to be adopted when rendering the rendering data, so that the purpose of flexibly adjusting the relationship between the native window and the browser window is achieved, the display accuracy of the picture is not affected, the high performance of the native window and the instantaneity of the browser window can be comprehensively exerted, and the picture rendering efficiency is greatly improved.
It should be noted that: the window rendering device provided in the above embodiment is only exemplified by the division of the above functional modules, and in practical application, the above functional allocation may be performed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules, so as to complete all or part of the functions described above. In addition, the window rendering device and the window rendering method provided in the foregoing embodiments belong to the same concept, and detailed implementation processes of the window rendering device and the window rendering method are detailed in the method embodiments, which are not repeated herein.
Fig. 9 shows a schematic structural diagram of a server according to an exemplary embodiment of the present application. Specifically, the following structure is included.
The server 900 includes a central processing unit (Central Processing Unit, CPU) 901, a system Memory 904 including a random access Memory (Random Access Memory, RAM) 902 and a Read Only Memory (ROM) 903, and a system bus 905 connecting the system Memory 904 and the central processing unit 901. The server 900 also includes a mass storage device 906 for storing an operating system 913, application programs 914, and other program modules 915.
The mass storage device 906 is connected to the central processing unit 901 through a mass storage controller (not shown) connected to the system bus 905. The mass storage device 906 and its associated computer-readable media provide non-volatile storage for the server 900. That is, the mass storage device 906 may include a computer readable medium (not shown) such as a hard disk or compact disc read only memory (Compact Disc Read Only Memory, CD-ROM) drive.
Computer readable media may include computer storage media and communication media without loss of generality. Computer storage media includes volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data.
According to various embodiments of the present application, server 900 may also operate by a remote computer connected to the network through a network, such as the Internet. I.e., the server 900 may be connected to the network 912 through a network interface unit 911 coupled to the system bus 905, or other types of networks or remote computer systems (not shown) may be coupled using the network interface unit 911.
The memory also includes one or more programs, one or more programs stored in the memory and configured to be executed by the CPU.
Embodiments of the present application also provide a computer device, where the computer device includes a processor and a memory, where the memory stores at least one instruction, at least one program, a code set, or an instruction set, and where the at least one instruction, the at least one program, the code set, or the instruction set is loaded and executed by the processor to implement the window rendering method provided by the foregoing method embodiments. Alternatively, the computer device may be a terminal or a server.
Embodiments of the present application also provide a computer readable storage medium having at least one instruction, at least one program, a code set, or an instruction set stored thereon, where the at least one instruction, the at least one program, the code set, or the instruction set is loaded and executed by a processor to implement the window rendering method provided by the foregoing method embodiments.
Embodiments of the present application also provide a computer program product or computer program comprising computer instructions stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device performs the window rendering method according to any one of the above embodiments.
Alternatively, the computer-readable storage medium may include: read Only Memory (ROM), random access Memory (RAM, random Access Memory), solid state disk (SSD, solid State Drives), or optical disk, etc. The random access memory may include resistive random access memory (ReRAM, resistance Random Access Memory) and dynamic random access memory (DRAM, dynamic Random Access Memory), among others. The foregoing embodiment numbers of the present application are merely for describing, and do not represent advantages or disadvantages of the embodiments.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program for instructing relevant hardware, where the program may be stored in a computer readable storage medium, and the storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
The foregoing description of the preferred embodiments is merely exemplary in nature and is in no way intended to limit the invention, since it is intended that all modifications, equivalents, improvements, etc. that fall within the spirit and scope of the invention.
Claims (13)
1. A method of window rendering, the method comprising:
the method comprises the steps of obtaining a native window and a browser window, wherein the native window is a window created based on a program framework corresponding to an application program, and the browser window is a window created based on a browser engine deployed in the application program;
creating an overlay binding relation between the browser window and the native window to obtain a rendering window, wherein the overlay binding relation is used for overlaying the browser window on the native window;
acquiring rendering data, wherein the rendering data corresponds to a window data identifier, and the window data identifier is used for representing a window adopted when the rendering data is rendered;
and adjusting transparency parameters of the browser window in the rendering window based on the window data identifier corresponding to the rendering data, rendering to obtain a data rendering picture corresponding to the rendering data, wherein the transparency parameters are used for representing the value of a window transparency channel.
2. The method according to claim 1, wherein the adjusting the transparency parameter of the browser window in the rendering window based on the window data identifier corresponding to the rendering data, rendering to obtain the data rendering frame corresponding to the rendering data, includes:
responding to a first window data identifier corresponding to first rendering data, and adjusting the transparency parameter of the browser window in the rendering window to obtain an adjustment window, wherein the first window data identifier is used for representing rendering of the first rendering data through the native window;
and executing a data rendering process on the first rendering data through the native window in the adjustment window to obtain the data rendering picture.
3. The method of claim 2, wherein the adjusting the transparency parameter of the browser window within the rendering window in response to the first rendering data corresponding to a first window data identifier, comprises:
determining a transparency channel corresponding to the browser window from the rendering window in response to a first window data identifier corresponding to the first rendering data, wherein the transparency channel is used for representing transparency attributes of a plurality of pixels forming the browser window;
And assigning values to the transparency channels corresponding to the pixels respectively by taking the first value as the transparency parameter to obtain the adjustment window, wherein the first value is used for representing the browser window in a transparent form in the rendering window.
4. The method according to claim 1, wherein the adjusting the transparency parameter of the browser window in the rendering window based on the window data identifier corresponding to the rendering data, rendering to obtain the data rendering frame corresponding to the rendering data, includes:
responding to a second rendering data corresponding to a second window data identifier, and adjusting the transparency parameter of the browser window in the rendering window to obtain an adjustment window, wherein the second window data identifier is used for representing that the second rendering data is jointly rendered through the native window and the browser window;
and executing a data rendering process on the second rendering data through the adjusting window to obtain a data rendering picture.
5. The method of claim 4, wherein the adjusting the transparency parameter of the browser window within the rendering window in response to the second rendering data corresponding to the second window data identifier, comprises:
Determining a transparency channel corresponding to the browser window from the rendering window in response to the second window data identifier corresponding to the second rendering data, wherein the transparency channel is used for representing transparency attributes of a plurality of pixels forming the browser window;
and assigning values to the transparency channels corresponding to the pixels respectively by taking the second value as the transparency parameter to obtain the adjustment window, wherein the second value is used for adjusting the transparency performance of the window background of the browser window in the rendering window.
6. The method according to claim 4, wherein the performing a data rendering process on the second rendering data through the adjustment window to obtain a data rendering screen includes:
performing a data rendering process on first sub-rendering data by the native window in the adjustment window, the first sub-rendering data being data of the second rendering data that is rendered by the native window;
and executing a data rendering process on second sub-rendering data through the adjusted browser window in the adjustment window to obtain the data rendering picture, wherein the second sub-rendering data is data of the second rendering data, which is rendered by the browser window.
7. The method according to claim 1, wherein the adjusting the transparency parameter of the browser window in the rendering window based on the window data identifier corresponding to the rendering data, rendering to obtain the data rendering frame corresponding to the rendering data, includes:
responding to a third window data identifier corresponding to third rendering data, adjusting color channel parameters of the browser window in the rendering window according to data color information corresponding to the third rendering data, and rendering to obtain a data rendering picture corresponding to the third rendering data;
wherein the third window data identification is used to characterize rendering of the third rendering data through the browser window.
8. The method of claim 1, wherein the method is performed by a first device;
the method further comprises the steps of:
acquiring a network speed corresponding to the first equipment at the current moment, wherein the network speed is used for representing the speed of the first equipment for data transmission;
responding to the network speed not reaching a preset network speed, and adjusting the transparency parameter of the browser window in the rendering window to obtain an adjustment window;
And executing a data rendering process on the rendering data through the native window in the adjustment window to obtain the data rendering picture.
9. The method according to claim 1, wherein the method further comprises:
determining a data type corresponding to the rendering data, wherein the data type is used for representing a multimedia expression form of the rendering data;
responding to the rendering data corresponding to a first data type, and adjusting the transparency parameter of the browser window in the rendering window to obtain an adjustment window; executing a data rendering process on the rendering data through the native window in the adjustment window to obtain the data rendering picture; the first data type is used for representing that the rendering data is in a video form;
responding to the second data type corresponding to the rendering data, and adjusting color channel parameters of the browser window in the rendering window through data color information corresponding to the rendering data to obtain the data rendering picture; the second data type is used to characterize the rendering data as being presented in a multimedia presentation other than the video form.
10. A window rendering apparatus, the apparatus comprising:
the window acquisition module is used for acquiring a native window and a browser window, wherein the native window is a window created based on a program frame corresponding to an application program, and the browser window is a window created based on a browser engine deployed in the application program;
the relation creation module is used for creating an overlay binding relation between the browser window and the native window to obtain a rendering window, and the overlay binding relation is used for overlaying the browser window on the native window;
the data acquisition module is used for acquiring rendering data, wherein the rendering data corresponds to a window data identifier, and the window data identifier is used for representing a window adopted when the rendering data is rendered;
the data rendering module is used for adjusting transparency parameters of the browser window in the rendering window based on the window data identifier corresponding to the rendering data, rendering to obtain a data rendering picture corresponding to the rendering data, and the transparency parameters are used for representing the value of a window transparency channel.
11. A computer device comprising a processor and a memory having stored therein at least one instruction, at least one program, code set or instruction set, the at least one instruction, at least one program, code set or instruction set being loaded and executed by the processor to implement the window rendering method of any of claims 1 to 9.
12. A computer readable storage medium having stored therein at least one instruction, at least one program, code set, or instruction set, the at least one instruction, the at least one program, the code set, or instruction set being loaded and executed by a processor to implement the window rendering method of any of claims 1 to 9.
13. A computer program product comprising a computer program or instructions which, when executed by a processor, implements a window rendering method as claimed in any one of claims 1 to 9.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311740743.8A CN117707676A (en) | 2023-12-15 | 2023-12-15 | Window rendering method, device, equipment, storage medium and program product |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311740743.8A CN117707676A (en) | 2023-12-15 | 2023-12-15 | Window rendering method, device, equipment, storage medium and program product |
Publications (1)
Publication Number | Publication Date |
---|---|
CN117707676A true CN117707676A (en) | 2024-03-15 |
Family
ID=90154992
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202311740743.8A Pending CN117707676A (en) | 2023-12-15 | 2023-12-15 | Window rendering method, device, equipment, storage medium and program product |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN117707676A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN118377726A (en) * | 2024-06-24 | 2024-07-23 | 北京辰信领创信息技术有限公司 | Web application automatic test method and computer device |
-
2023
- 2023-12-15 CN CN202311740743.8A patent/CN117707676A/en active Pending
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN118377726A (en) * | 2024-06-24 | 2024-07-23 | 北京辰信领创信息技术有限公司 | Web application automatic test method and computer device |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2022116759A1 (en) | Image rendering method and apparatus, and computer device and storage medium | |
CN103530018B (en) | The method for building up and mobile terminal at widget interface in Android operation system | |
EP3657327A1 (en) | Method for rendering game, and method, apparatus and device for generating game resource file | |
CN107632824A (en) | A kind of generation method of augmented reality module, generating means and generation system | |
US9396564B2 (en) | Atlas generation based on client video configuration | |
CN112316433B (en) | Game picture rendering method, device, server and storage medium | |
CN112307403B (en) | Page rendering method and device, storage medium and terminal | |
CN111476851A (en) | Image processing method, image processing device, electronic equipment and storage medium | |
WO2022033162A1 (en) | Model loading method and related apparatus | |
CN117707676A (en) | Window rendering method, device, equipment, storage medium and program product | |
WO2023197762A1 (en) | Image rendering method and apparatus, electronic device, computer-readable storage medium, and computer program product | |
CN112799801A (en) | Method, device, equipment and medium for drawing simulation mouse pointer | |
CN117009011A (en) | Data processing method, device, equipment and readable storage medium | |
CN112783660A (en) | Resource processing method and device in virtual scene and electronic equipment | |
CN113192173B (en) | Image processing method and device of three-dimensional scene and electronic equipment | |
WO2023160041A1 (en) | Image rendering method and apparatus, computer device, computer-readable storage medium and computer program product | |
CN117311708A (en) | Dynamic modification method and device for resource display page in 3D scene of webpage end | |
CN116503529A (en) | Rendering, 3D picture control method, electronic device, and computer-readable storage medium | |
JP7301453B2 (en) | IMAGE PROCESSING METHOD, IMAGE PROCESSING APPARATUS, COMPUTER PROGRAM, AND ELECTRONIC DEVICE | |
CN113144606A (en) | Skill triggering method of virtual object and related equipment | |
CN111243069A (en) | Scene switching method and system of Unity3D engine | |
CN117708454A (en) | Webpage content processing method, device, equipment, storage medium and program product | |
CN118170284B (en) | Window rendering method, device, equipment and medium | |
CN117014689A (en) | Bullet screen display method and device and electronic equipment | |
CN114049425B (en) | Illumination simulation method, device, equipment and storage medium in image |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |