CN112347380A - Window rendering method and related equipment - Google Patents

Window rendering method and related equipment Download PDF

Info

Publication number
CN112347380A
CN112347380A CN201910729361.2A CN201910729361A CN112347380A CN 112347380 A CN112347380 A CN 112347380A CN 201910729361 A CN201910729361 A CN 201910729361A CN 112347380 A CN112347380 A CN 112347380A
Authority
CN
China
Prior art keywords
window
sub
rendering
screen
service function
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
Application number
CN201910729361.2A
Other languages
Chinese (zh)
Inventor
潘梅
李杨
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201910729361.2A priority Critical patent/CN112347380A/en
Publication of CN112347380A publication Critical patent/CN112347380A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/954Navigation, e.g. using categorised browsing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/957Browsing optimisation, e.g. caching or content distillation
    • G06F16/9577Optimising the visualization of content, e.g. distillation of HTML documents
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T1/00General purpose image data processing
    • G06T1/20Processor architectures; Processor configuration, e.g. pipelining
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T1/00General purpose image data processing
    • G06T1/60Memory management

Abstract

The embodiment of the invention discloses a window rendering method and related equipment, which comprises the following steps: firstly, determining a service function realized by each functional area in a plurality of functional areas contained in a target window and a function type of the service function; then decomposing the target window according to the function type to obtain a first sub-window and a second sub-window; and then rendering the first sub-window in an off-screen rendering mode and rendering the second sub-window in a screen rendering mode. By adopting the embodiment of the invention, the rendering performance of the special-shaped window can be improved, so that the smoothness of window picture display is improved.

Description

Window rendering method and related equipment
Technical Field
The present invention relates to the field of image processing technologies, and in particular, to a window rendering method and related devices.
Background
In the window display process, common rendering modes include screen rendering and off-screen rendering. The screen rendering refers to a mode in which a browser engine renders contents of hypertext Markup Language (HTML)/Cascading Style Sheets (CSS)/javascript (js) and then directly outputs the contents to a screen. Off-screen rendering refers to a mode that a browser engine renders HTML/CSS/JS content into a bitmap and outputs the bitmap to an internal memory. Currently, off-screen rendering is generally used for Processing live windows, an application program independently develops a local drawing bitmap during off-screen rendering, and accelerated synthesis of a Graphics Processing Unit (GPU) is completed by a Central Processing Unit (CPU) and is presented to a screen by the GPU. Especially when the video is played in the window, the frame rate is low, and if no special processing is added, the user can obviously feel the pause phenomenon of the high-definition picture.
Disclosure of Invention
The invention provides a window rendering method and related equipment, which can improve the rendering performance of a special-shaped window, thereby improving the fluency of window picture display.
In a first aspect, an embodiment of the present invention provides a window rendering method, including:
determining a service function realized by each functional area in a plurality of functional areas contained in a target window and a function type of the service function;
decomposing the target window according to the function type to obtain a first sub-window and a second sub-window;
rendering the first sub-window in an off-screen rendering mode, and rendering the second sub-window in a screen rendering mode.
Wherein the first and second sub-windows include at least one functional area of the plurality of functional areas; the function type comprises a pixel mixing type, and the service function of the pixel mixing type is realized based on a pixel mixing technology;
the decomposing the target window according to the function type to obtain a first sub-window and a second sub-window comprises:
if the service function realized by the functional area comprises the pixel mixed service function, determining that the functional area belongs to the first sub-window; otherwise, determining that the functional area belongs to the second sub-window.
Wherein, after the rendering the first sub-window in an off-screen rendering manner and the rendering the second sub-window in a screen rendering manner, the method further comprises:
and carrying out synchronous processing on the first sub-window and the second sub-window, wherein the synchronous processing comprises synchronous displacement.
Wherein the synchronizing the first sub-window and the second sub-window comprises:
acquiring position information of the first sub-window and the second sub-window according to a preset time interval;
determining whether other windows are arranged between the first sub-window and the second sub-window according to the position information;
and when other windows are spaced between the first sub-window and the second sub-window, adjusting the position of the first sub-window and/or the second sub-window.
Wherein the synchronizing the first sub-window and the second sub-window comprises:
controlling the second sub-window to monitor the displacement synchronization message of the first sub-window and controlling the second sub-window to displace according to the displacement synchronization message; and
and controlling the first sub-window to monitor the focus message of the second sub-window and controlling the first sub-window to shift according to the focus message.
The target window corresponds to a main thread and a sub-thread;
the rendering the first sub-window in an off-screen rendering manner and the rendering the second sub-window in a screen rendering manner includes:
rendering the first sub-window in the main thread according to the off-screen rendering mode, and rendering the second sub-window in the sub-thread according to the screen rendering mode.
Wherein, after the rendering the first sub-window in an off-screen rendering manner and the rendering the second sub-window in a screen rendering manner, the method further comprises:
and performing synchronous processing on the first sub-window and the second sub-window in the sub-thread.
Wherein the first child window is a logical parent window of the second child window; the second sub-window is a top-level window.
In a second aspect, an embodiment of the present invention provides a window rendering apparatus, including:
the information determining module is used for determining a service function realized by each functional area in a plurality of functional areas contained in the target window and the function type of the service function;
the window decomposition module is used for decomposing the target window according to the function type to obtain a first sub-window and a second sub-window;
and the window rendering module is used for rendering the first sub-window in an off-screen rendering mode and rendering the second sub-window in a screen rendering mode.
Wherein the first and second sub-windows include at least one functional area of the plurality of functional areas; the function type comprises a pixel mixing type, and the service function of the pixel mixing type is realized based on a pixel mixing technology;
the window decomposition module is further configured to:
if the service function realized by the functional area comprises the pixel mixed service function, determining that the functional area belongs to the first sub-window; otherwise, determining that the functional area belongs to the second sub-window.
Wherein the apparatus further comprises a synchronization processing module configured to:
and carrying out synchronous processing on the first sub-window and the second sub-window, wherein the synchronous processing comprises synchronous displacement.
Wherein the synchronization processing module is further configured to:
acquiring position information of the first sub-window and the second sub-window according to a preset time interval;
determining whether other windows are arranged between the first sub-window and the second sub-window according to the position information;
and when other windows are spaced between the first sub-window and the second sub-window, adjusting the position of the first sub-window and/or the second sub-window.
Wherein the synchronization processing module is further configured to:
controlling the second sub-window to monitor the displacement synchronization message of the first sub-window and controlling the second sub-window to displace according to the displacement synchronization message; and
and controlling the first sub-window to monitor the focus message of the second sub-window and controlling the first sub-window to shift according to the focus message.
The target window corresponds to a main thread and a sub-thread;
the window rendering module is further to:
rendering the first sub-window in the main thread according to the off-screen rendering mode, and rendering the second sub-window in the sub-thread according to the screen rendering mode.
Wherein the synchronization processing module is further configured to:
and performing the synchronous processing on the first sub-window and the second sub-window in the sub-thread.
Wherein the first child window is a logical parent window of the second child window; the second sub-window is a top-level window.
In a third aspect, an embodiment of the present invention provides a window rendering device, including: the window rendering method comprises a processor, a memory and a communication bus, wherein the communication bus is used for realizing connection communication between the processor and the memory, and the processor executes a program stored in the memory for realizing the steps in the window rendering method provided by the first aspect.
In one possible design, the entity identification device provided by the invention may comprise a module for executing corresponding behaviors in the method. The modules may be software and/or hardware.
Yet another aspect of embodiments of the present invention provides a computer-readable storage medium having stored thereon a plurality of instructions adapted to be loaded by a processor and to perform a method according to the above-described aspects.
Yet another aspect of embodiments of the present invention provides a computer program product comprising instructions which, when run on a computer, cause the computer to perform the method of the above aspects.
Firstly, determining a service function realized by each functional area in a plurality of functional areas contained in a target window and a function type of the service function; then decomposing the target window according to the function type to obtain a first sub-window and a second sub-window; and then rendering the first sub-window in an off-screen rendering mode and rendering the second sub-window in a screen rendering mode. The method can improve the fluency of window pictures and the performance of window rendering, reduce occupied content and lighten the burden of a CPU.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments or the background art of the present invention, the drawings required to be used in the embodiments or the background art of the present invention will be described below.
Fig. 1 is a schematic flowchart of a window rendering method according to an embodiment of the present invention;
FIG. 2 is a schematic view of a stacked window stack provided by an embodiment of the present invention;
FIG. 3 is a schematic diagram of a target window provided by an embodiment of the present invention;
FIG. 4 is a flowchart illustrating another window rendering method according to an embodiment of the present invention;
FIG. 5 is a schematic diagram of a practical application scenario provided by an embodiment of the present invention
Fig. 6 is a schematic structural diagram of a window rendering apparatus according to an embodiment of the present invention;
fig. 7 is a schematic structural diagram of a window rendering device according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Referring to fig. 1, fig. 1 is a schematic flowchart of a window rendering method according to an embodiment of the present invention, where the method includes, but is not limited to, the following steps:
s101, determining a service function realized by each functional area in a plurality of functional areas contained in a target window and a function type of the service function.
In a specific implementation, the target window may be a special-shaped window that can be decomposed into a plurality of sub-windows, such as a "return" font window, a "field" font window, and the like. Meanwhile, the target window is also a layer window (layer window), which may include a plurality of functional areas, each for implementing at least one service function. For example, as shown in fig. 2, the online classroom window includes a live area where teachers speak classes online and a chat area where teachers and students communicate online. The service function realized in the live broadcast area comprises a painting brush function required by a teacher in a lecture mode, a function of loading a webpage (such as a webpage which is searched by the teacher on line and displayed to students) or other program windows (such as a PowerPoint window for displaying courseware), and the like, and the service function realized in the chat area is real-time interaction among multiple users (the teacher and the students). In the present invention, all the service functions implemented by the target window are divided into a pixel hybrid service function and a non-pixel hybrid service function. As the name implies, the pixel blending type service function is implemented based on a pixel blending technique, for example, a brush function. Among them, the commonly used pixel blending techniques include alpha (alpha, α) blending technique, which means that one window control (frame) is overlaid on another frame, and the upper frame does not completely obscure the lower frame, that is, a partial area in the upper layer of frame is transparent, wherein the pixels of the two frames are blended according to the preset α value. Non-pixel-blending business functions refer to other business functions that need not be implemented using pixel-blending techniques.
S102, decomposing the target window according to the function type to obtain a first sub-window and a second sub-window.
In a specific implementation, the first sub-window and the second sub-window respectively include at least one functional region. And for each functional area, if the service function realized by the functional area comprises a pixel mixed service function, determining that the functional area belongs to a first sub-window, and otherwise, determining that the functional area belongs to a second sub-window. As shown in fig. 2, the online classroom window based on the Windows system includes a live broadcast area and a chat area, wherein the brush function implemented in the live broadcast area is a pixel-mixed service function, and thus the live broadcast area is divided into a first sub-window. The multi-user real-time interaction function realized by the chat area does not need to utilize a pixel mixing technology, and belongs to a non-pixel mixing type service function, so that the chat area is divided into the second sub-windows. And finally obtaining a first sub-window consisting of the live broadcast areas, namely the live broadcast window, and a second sub-window consisting of the chat areas, namely the chat window. In addition, as shown in fig. 2, the window display areas of the live window and the chat window can be hollowed by using the interface provided by the Windows system, and the hollowed areas currently display the background desktops of the computers.
It should be noted that, starting from Windows2000, Windows operating systems start to adopt a hierarchical windowing mechanism. Under this mechanism, multiple windows may be stacked to form a stack of stacked windows, which are oriented along an imaginary axis that extends perpendicular to and outward from the screen, which is commonly referred to as the Z-axis. And each window in the laminated window stack is sequentially laminated by taking the Z axis as a reference axis, wherein each window has a lamination order (Z-order) which is used for indicating that the window is positioned at the layer of the laminated window stack and can also indicate the display sequence of the windows. As shown in fig. 3, the stacked window stack includes 3 windows, wherein the Z-order of the top window is 3, the second window is stacked below the top window along the Z-axis, the Z-order is 2, the third window is also the bottom window, and is stacked below the second window along the Z-axis, and the Z-order is 1. In addition, there are also dependencies between windows, such as parent/child relationships, sibling relationships, etc. Wherein, the child window is the next level window derived from the parent window, and the sibling windows are two windows derived from the same level catalog of the same parent window.
Based on the above description, the present invention further describes the first child window and the second child window-1) the second child window is a window without a parent window, and is usually placed on the top as the top window; 2) the first child window is a logic parent window of the second child window, and the second child window stores a handle of the first child window.
S103, rendering the first sub-window in an off-screen rendering mode and rendering the second sub-window in a screen rendering mode.
In a specific implementation, in order to implement the fluency of real-time image display, a window that needs to implement the pixel-mixed service function should be rendered in an off-screen rendering manner. The non-pixel mixed service function only requires normal display of the picture, and the requirement on the real-time performance of the picture display is lower than that of the pixel mixed service function, so that the second sub-window only needs to be rendered in a screen rendering mode. The fundamental reason is that in the screen rendering mode, the rendering operation of the GPU is performed in the current screen buffer, and the off-screen rendering mode opens up a buffer area in addition to the current screen buffer for completing the rendering of the window, so that when the screen refresh rate requirement is high, the off-screen rendering can better meet the requirement of the fluency of the screen. However, it can also be seen that compared with screen rendering, off-screen rendering takes up more memory and increases the processing burden of the CPU. Therefore, the target window is firstly decomposed into a plurality of sub-windows, and then a proper rendering mode is selected according to the actual situation of each sub-window, so that the purposes of reducing occupied memory and lightening the burden of a CPU are achieved.
It should be noted that, in an extreme case, each of the plurality of functional regions of the target window does not include the pixel hybrid service function, and the target window may be decomposed into a plurality of logical sub-windows according to the logical relationship between the functional regions, and each logical sub-window may be rendered by directly using a screen rendering method.
In the embodiment of the invention, firstly, the service function realized by each functional area in a plurality of functional areas contained in a target window and the function type of the service function are determined; then decomposing the target window according to the function type to obtain a first sub-window and a second sub-window; and then rendering the first sub-window in an off-screen rendering mode and rendering the second sub-window in a screen rendering mode. The memory occupied by window rendering can be reduced, and the burden of a CPU (central processing unit) can be reduced, so that the smoothness of window picture display and the performance of window rendering can be improved.
Referring to fig. 4, fig. 4 is a schematic flowchart of another window rendering method according to an embodiment of the present invention, where the method includes, but is not limited to, the following steps:
s401, determining a service function realized by each functional area in a plurality of functional areas contained in a target window and a function type of the service function. This step is the same as S101 in the previous embodiment, and is not described again.
S402, decomposing the target window according to the function type to obtain a first sub-window and a second sub-window. This step is the same as S102 in the previous embodiment, and is not described again.
S403, rendering the first sub-window in an off-screen rendering mode and rendering the second sub-window in a screen rendering mode. This step is the same as S103 in the previous embodiment, and is not described again.
S404, performing synchronous processing on the first sub-window and the second sub-window.
In a specific implementation, the first child window is a logical parent window of the second child window, and when any one of the first child window and the second child window moves, synchronous displacement processing needs to be performed on the other child window. In one aspect, the second sub-window may monitor a displacement synchronization message of the first sub-window, where the displacement synchronization message may be, but is not limited to, displacement information broadcasted or sent to the second sub-window after the first sub-window moves around, the displacement information may include a direction and an amplitude of displacement, and the second sub-window may perform synchronous displacement according to the displacement synchronization message. The synchronous shift may further include synchronously hiding the second sub-window/the first sub-window when the first sub-window/the second sub-window is hidden.
On the other hand, the first sub-window can be controlled to monitor the focus message of the second sub-window, and the first sub-window is controlled to shift according to the monitored focus message. Where in a Windows system the focus determines which input box in that window/control/window receives the keyboard input information. When the user uses the keyboard to input by using some kind of input (such as a dog search input method), a candidate frame of the input content will appear correspondingly, and the candidate frame comes from an application program corresponding to the input method, so that a window receiving the keyboard input needs to be synchronously shifted correspondingly to display the candidate frame at a proper place. Corresponding to the present invention, if the second sub-window is synchronously shifted corresponding to the input content candidate frame, the first sub-window also needs to be synchronously shifted with the second sub-window.
After the target window is decomposed into the first child window and the second child window, there is no actual parent-child relationship between the first child window and the second child window, although the first child window is a logical parent of the second child window. Therefore, the operating system does not perform synchronous management on the two windows, so that the problem that the first sub-window/the second sub-window move frequently and the second sub-window/the first sub-window cannot move synchronously therewith often occurs, and two separated sub-windows are seen from the user perspective. And the synchronous displacement processing of the first sub-window and the second sub-window can effectively solve the problem.
Optionally, the stacking order of the first sub-window and the second sub-window in the stack of stacked windows may be adjusted synchronously. Specifically, the position information of the first sub-window and the second sub-window may be acquired according to a preset time interval, where the preset time interval may be 10 microseconds, 10 milliseconds, and the like. The position information may be, but is not limited to, z-order, and for a stack of stacked windows, the windows therein may be traversed by the GetTopWindow function and the GetNextWindow function to obtain the z-order of the desired window. Then, based on the position information, it is determined whether the first sub-window and the second sub-window are spaced apart from each other, i.e., whether the first sub-window and the second sub-window are close to each other in the Z-axis, and whether another window (e.g., a browser window) is sandwiched therebetween. For example, as shown in fig. 3, the z-orders of the first sub-window and the second sub-window are 1 and 3, respectively, the second sub-window is a top layer window, and the first sub-window is a third layer (bottom layer) window, and the first sub-window and the second sub-window are separated by another window sandwiched between the first sub-window and the second sub-window, thereby forming a "sandwich window". At this time, the window sandwiched between the first sub-window and the second sub-window makes the first sub-window and the second sub-window unable to be effectively synthesized into the target window, i.e. the target window cannot achieve the same display effect as the conventional rendering method after being rendered according to the method provided by the present invention. Therefore, if other windows are spaced between the first sub-window and the second sub-window, the positions of the first sub-window and the second sub-window need to be adjusted, wherein the positions of the two windows can be adjusted simultaneously, and the position of one sub-window can be kept unchanged to adjust the position of the other sub-window. For example, when the z-orders of the first sub-window and the second sub-window are 3 and 1, respectively, the z-order of the first sub-window may be adjusted to 2, which is adjusted from the third layer window to the second layer window, so that the first sub-window and the second sub-window are close to each other.
Optionally, the target window corresponds to a main thread and a sub-thread. The method comprises the steps of rendering a first sub-window in an off-screen rendering mode in a main thread, and rendering a second sub-window in a screen rendering mode in a sub-thread. Meanwhile, the synchronous processing operation of the first sub-window and the second sub-window is also performed in the sub-thread. Considering that if the creation (rendering) of two sub-windows is performed in the main thread, the synchronization problem of the two sub-windows is easily handled, which causes thread congestion, the above-described method of decomposing the task into sub-threads is adopted.
In the embodiment of the invention, firstly, the service function realized by each functional area in a plurality of functional areas contained in a target window and the function type of the service function are determined; then decomposing the target window according to the function type to obtain a first sub-window and a second sub-window; then rendering the first sub-window in an off-screen rendering mode and rendering the second sub-window in a screen rendering mode; and finally, carrying out synchronous processing on the first sub-window and the second sub-window. Taking the online classroom window shown in fig. 2 as an example, the online classroom window includes a live area and a chat area before being decomposed. Then, because the live broadcast area comprises a pixel mixed type service function, namely a painting brush function, the live broadcast area is divided into a first sub-window to obtain a live broadcast window, and the chat area does not comprise any pixel mixed type service function, the chat area is divided into a second sub-window to obtain a chat window. Then, as shown in fig. 5, for the live view window, rendering the live view window into a bitmap according to an off-screen rendering mode, outputting the bitmap to the memory to obtain a memory bitmap, and then performing pixel mixing on the memory bitmap and the computer screen by using an alpha mixing technology to obtain an off-screen rendering result of the live view window. For the chat window, the bitmap can be rendered in a screen rendering mode and directly output to the screen so as to obtain a screen rendering result of the chat window. Finally, the live and chat windows are synchronized so that the only window seen from the user perspective is the undecomposed on-line classroom window.
By adopting the embodiment of the invention, the problem that the displacement of the sandwich window and the two sub-windows is not synchronous can be prevented, so that the smoothness of window picture display and the window rendering performance are improved on the premise of guaranteeing the normal display of the target window.
The method of the embodiments of the present invention is explained in detail above, and the related apparatus of the embodiments of the present invention is provided below.
Referring to fig. 6, fig. 6 is a schematic structural diagram of a window rendering apparatus according to an embodiment of the present invention, where the apparatus may include:
the information determining module 601 is configured to determine a service function implemented by each of a plurality of functional areas included in the target window and a function type of the service function.
In a specific implementation, the target window may be a special-shaped window that can be decomposed into a plurality of sub-windows, such as a "return" font window, a "field" font window, and the like. Meanwhile, the target window is also a layer window (layer window), which may include a plurality of functional areas, each for implementing at least one service function. For example, as shown in fig. 2, the online classroom window includes a live area where teachers speak classes online and a chat area where teachers and students communicate online. The service function realized in the live broadcast area comprises a painting brush function required by a teacher in a lecture mode, a function of loading a webpage (such as a webpage which is searched by the teacher on line and displayed to students) or other program windows (such as a PowerPoint window for displaying courseware), and the like, and the service function realized in the chat area is real-time interaction among multiple users (the teacher and the students). In the present invention, all the service functions implemented by the target window are divided into a pixel hybrid service function and a non-pixel hybrid service function. As the name implies, the pixel blending type service function is implemented based on a pixel blending technique, for example, a brush function. Among them, commonly used pixel blending techniques include an alpha blending technique, which means that one window control (frame) is overlaid on another frame, and the upper frame does not completely obscure the lower frame, that is, a partial region in the upper layer of frames is transparent, wherein the pixels of the two frames are blended according to a preset α value. Non-pixel-blending business functions refer to other business functions that need not be implemented using pixel-blending techniques.
And a window decomposition module 602, configured to decompose the target window according to the function type to obtain a first sub-window and a second sub-window.
In a specific implementation, the first sub-window and the second sub-window respectively include at least one functional region. And for each functional area, if the service function realized by the functional area comprises a pixel mixed service function, determining that the functional area belongs to a first sub-window, and otherwise, determining that the functional area belongs to a second sub-window. As shown in fig. 2, the online classroom window based on the Windows system includes a live broadcast area and a chat area, wherein the brush function implemented in the live broadcast area is a pixel-mixed service function, and thus the live broadcast area is divided into a first sub-window. The multi-user real-time interaction function realized by the chat area does not need to utilize a pixel mixing technology, and belongs to a non-pixel mixing type service function, so that the chat area is divided into the second sub-windows. And finally obtaining a first sub-window consisting of the live broadcast areas, namely the live broadcast window, and a second sub-window consisting of the chat areas, namely the chat window. In addition, as shown in fig. 2, the window display areas of the live window and the chat window can be hollowed by using the interface provided by the Windows system, and the hollowed areas currently display the background desktops of the computers.
It should be noted that, starting from Windows2000, Windows operating systems start to adopt a hierarchical windowing mechanism. Under this mechanism, multiple windows may be stacked to form a stack of stacked windows, which are oriented along an imaginary axis that extends perpendicular to and outward from the screen, which is commonly referred to as the Z-axis. And each window in the laminated window stack is sequentially laminated by taking the Z axis as a reference axis, wherein each window has a lamination order (Z-order) which is used for indicating that the window is positioned at the layer of the laminated window stack and can also indicate the display sequence of the windows. As shown in fig. 3, the stacked window stack includes 3 windows, wherein the Z-order of the top window is 3, the second window is stacked below the top window along the Z-axis, the Z-order is 2, the third window is also the bottom window, and is stacked below the second window along the Z-axis, and the Z-order is 1. In addition, there are also dependencies between windows, such as parent/child relationships, sibling relationships, etc. Wherein, the child window is the next level window derived from the parent window, and the sibling windows are two windows derived from the same level catalog of the same parent window.
Based on the above description, the present invention further describes the first child window and the second child window-1) the second child window is a window without a parent window, and is usually placed on the top as the top window; 2) the first child window is a logic parent window of the second child window, and the second child window stores a handle of the first child window.
A window rendering module 603, configured to render the first sub-window in an off-screen rendering manner and render the second sub-window in a screen rendering manner.
In a specific implementation, in order to implement the fluency of real-time image display, a window that needs to implement the pixel-mixed service function should be rendered in an off-screen rendering manner. The non-pixel mixed service function only requires normal display of the picture, and the requirement on the real-time performance of the picture display is lower than that of the pixel mixed service function, so that the second sub-window only needs to be rendered in a screen rendering mode. The fundamental reason is that in the screen rendering mode, the rendering operation of the GPU is performed in the current screen buffer, and the off-screen rendering mode opens up a buffer area in addition to the current screen buffer for completing the rendering of the window, so that when the screen refresh rate requirement is high, the off-screen rendering can better meet the requirement of the fluency of the screen. However, it can also be seen that compared with screen rendering, off-screen rendering takes up more memory and increases the processing burden of the CPU. Therefore, the target window is firstly decomposed into a plurality of sub-windows, and then a proper rendering mode is selected according to the actual situation of each sub-window, so that the purposes of reducing occupied memory and lightening the burden of a CPU are achieved.
Optionally, the apparatus in the embodiment of the present invention further includes a synchronization processing module, configured to perform synchronization processing on the first sub-window and the second sub-window.
In a specific implementation, the first child window is a logical parent window of the second child window, and when any one of the first child window and the second child window moves, synchronous displacement processing needs to be performed on the other child window. In one aspect, the second sub-window may monitor a displacement synchronization message of the first sub-window, where the displacement synchronization message may be, but is not limited to, displacement information broadcasted or sent to the second sub-window after the first sub-window moves around, the displacement information may include a direction and an amplitude of displacement, and the second sub-window may perform synchronous displacement according to the displacement synchronization message. The synchronous shift may further include synchronously hiding the second sub-window/the first sub-window when the first sub-window/the second sub-window is hidden.
On the other hand, the first sub-window can be controlled to monitor the focus message of the second sub-window, and the first sub-window is controlled to shift according to the monitored focus message. Where in a Windows system the focus determines which input box in that window/control/window receives the keyboard input information. When the user uses the keyboard to input by using some input method (such as a dog search input method), a candidate frame of the input content will appear correspondingly, and the candidate frame comes from an application program corresponding to the input method, so that a window receiving the keyboard input needs to be synchronously shifted correspondingly to display the candidate frame at a proper place. Corresponding to the present invention, if the second sub-window is synchronously shifted corresponding to the input content candidate frame, the first sub-window also needs to be synchronously shifted with the second sub-window.
After the target window is decomposed into the first child window and the second child window, there is no actual parent-child relationship between the first child window and the second child window, although the first child window is a logical parent of the second child window. Therefore, the operating system does not perform synchronous management on the two windows, so that the problem that the first sub-window/the second sub-window move frequently and the second sub-window/the first sub-window cannot move synchronously therewith often occurs, and two separated sub-windows are seen from the user perspective. And the synchronous displacement processing of the first sub-window and the second sub-window can effectively solve the problem.
Optionally, the stacking order of the first sub-window and the second sub-window in the stack of stacked windows may be adjusted synchronously. Specifically, the position information of the first sub-window and the second sub-window may be obtained according to a preset time interval, where the position information may be, but is not limited to, z-order, and for a stack of stacked windows, the windows in the stack of stacked windows may be traversed by a GetTopWindow function and a GetNextWindow function, so as to obtain the z-order of the desired window. Then, based on the position information, it is determined whether the first sub-window and the second sub-window are spaced apart from each other, i.e., whether the first sub-window and the second sub-window are close to each other in the Z-axis, and whether another window (e.g., a browser window) is sandwiched therebetween. For example, as shown in fig. 3, the z-orders of the first sub-window and the second sub-window are 1 and 3, respectively, the second sub-window is a top layer window, and the first sub-window is a third layer (bottom layer) window, and the first sub-window and the second sub-window are separated by another window sandwiched between the first sub-window and the second sub-window, thereby forming a "sandwich window". At this time, other windows between the first sub-window and the second sub-window make the first sub-window and the second sub-window unable to be effectively synthesized into the target window, that is, the target window cannot achieve the same display effect as the conventional rendering method after being rendered according to the method provided by the present invention. Therefore, if other windows are spaced between the first sub-window and the second sub-window, the positions of the first sub-window and the second sub-window need to be adjusted, wherein the positions of the two windows can be adjusted simultaneously, and the position of one sub-window can be kept unchanged to adjust the position of the other sub-window. For example, when the z-orders of the first sub-window and the second sub-window are 3 and 1, respectively, the z-order of the first sub-window may be adjusted to 2, which is adjusted from the third layer window to the second layer window, so that the first sub-window and the second sub-window are close to each other.
Optionally, the target window corresponds to a main thread and a sub-thread. The window rendering module 603 may further perform an operation of rendering the first sub-window in an off-screen rendering manner in the main thread, and perform an operation of rendering the second sub-window in a screen rendering manner in the sub-thread. Meanwhile, the synchronous processing operation of the first sub-window and the second sub-window is also performed in the sub-thread. Considering that if the creation (rendering) of two sub-windows is performed in the main thread, the synchronization problem of the two sub-windows is easily handled, which causes thread congestion, the above-described method of decomposing the task into sub-threads is adopted.
In the embodiment of the invention, firstly, the service function realized by each functional area in a plurality of functional areas contained in a target window and the function type of the service function are determined; then decomposing the target window according to the function type to obtain a first sub-window and a second sub-window; then rendering the first sub-window in an off-screen rendering mode and rendering the second sub-window in a screen rendering mode; and finally, carrying out synchronous processing on the first sub-window and the second sub-window. The method can reduce the memory occupied by window rendering, reduce the processing load of a CPU, and improve the fluency of window picture display and the performance of window rendering.
Referring to fig. 7, fig. 7 is a schematic structural diagram of a window rendering apparatus according to an embodiment of the present invention. As shown, the apparatus may include: at least one processor 701, at least one communication interface 702, at least one memory 703 and at least one communication bus 704.
The processor 701 may be, among other things, a central processing unit, a general purpose processor, a digital signal processor, an application specific integrated circuit, a field programmable gate array or other programmable logic device, transistor logic, a hardware component, or any combination thereof. Which may implement or perform the various illustrative logical blocks, modules, and circuits described in connection with the disclosure. The processor may also be a combination of computing functions, e.g., comprising one or more microprocessors, a digital signal processor and a microprocessor, or the like. The communication bus 704 may be a peripheral component interconnect standard PCI bus or an extended industry standard architecture EISA bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown in FIG. 7, but this is not intended to represent only one bus or type of bus. A communication bus 704 is used to enable communications among the components. The communication interface 702 of the device in the embodiment of the present invention is used for performing signaling or data communication with other node devices. The Memory 703 may include a volatile Memory, such as a Nonvolatile dynamic Random Access Memory (NVRAM), a Phase Change Random Access Memory (PRAM), a Magnetoresistive Random Access Memory (MRAM), and the like, and may further include a Nonvolatile Memory, such as at least one magnetic Disk Memory device, an Electrically Erasable Programmable Read-Only Memory (EEPROM), a flash Memory device, such as a NOR flash Memory (NOR flash Memory) or a NAND flash Memory (EEPROM), a semiconductor device, such as a Solid State Disk (SSD), and the like. The memory 703 may optionally be at least one memory device located remotely from the processor 701. A set of program codes is stored in the memory 703, and the processor 701 executes the program in the memory 703:
determining a service function realized by each functional area in a plurality of functional areas contained in a target window and a function type of the service function;
decomposing the target window according to the function type to obtain a first sub-window and a second sub-window;
rendering the first sub-window in an off-screen rendering mode, and rendering the second sub-window in a screen rendering mode.
Optionally, the first sub-window and the second sub-window include at least one functional area of the plurality of functional areas; the function type comprises a pixel mixing type, and the service function of the pixel mixing type is realized based on a pixel mixing technology;
the processor 701 is further configured to perform the following operation steps:
if the service function realized by the functional area comprises the pixel mixed service function, determining that the functional area belongs to the first sub-window; otherwise, determining that the functional area belongs to the second sub-window.
Optionally, the processor 701 is further configured to perform the following operation steps:
and carrying out synchronous processing on the first sub-window and the second sub-window, wherein the synchronous processing comprises synchronous displacement.
Optionally, the processor 701 is further configured to perform the following operation steps:
acquiring position information of the first sub-window and the second sub-window according to a preset time interval;
determining whether other windows are arranged between the first sub-window and the second sub-window according to the position information;
and when other windows are spaced between the first sub-window and the second sub-window, adjusting the position of the first sub-window and/or the second sub-window.
Optionally, the processor 701 is further configured to perform the following operation steps:
controlling the second sub-window to monitor the displacement synchronization message of the first sub-window and controlling the second sub-window to displace according to the displacement synchronization message; and
and controlling the first sub-window to monitor the focus message of the second sub-window and controlling the first sub-window to shift according to the focus message.
Optionally, the target window corresponds to a main thread and a sub-thread;
the processor 701 is further configured to perform the following operation steps:
rendering the first sub-window in the main thread according to the off-screen rendering mode, and rendering the second sub-window in the sub-thread according to the screen rendering mode.
Further, the processor may further cooperate with the memory and the communication interface to perform the operations of the window rendering apparatus in the above embodiments of the invention.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, cause the processes or functions described in accordance with the embodiments of the invention to occur, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, from one website site, computer, server, or data center to another website site, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that incorporates one or more of the available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., Solid State Disk (SSD)), among others.
The above-mentioned embodiments further explain the objects, technical solutions and advantages of the present invention in detail. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (10)

1. A method of window rendering, the method comprising:
determining a service function realized by each functional area in a plurality of functional areas contained in a target window and a function type of the service function;
decomposing the target window according to the function type to obtain a first sub-window and a second sub-window;
rendering the first sub-window in an off-screen rendering mode, and rendering the second sub-window in a screen rendering mode.
2. The method of claim 1, wherein the first and second sub-windows comprise at least one functional area of the plurality of functional areas; the function type comprises a pixel mixing type, and the service function of the pixel mixing type is realized based on a pixel mixing technology;
the decomposing the target window according to the function type to obtain a first sub-window and a second sub-window comprises:
if the service function realized by the functional area comprises the pixel mixed service function, determining that the functional area belongs to the first sub-window; otherwise, determining that the functional area belongs to the second sub-window.
3. The method of claim 2, wherein after rendering the first sub-window in an off-screen rendering manner and rendering the second sub-window in a screen rendering manner, further comprising:
and carrying out synchronous processing on the first sub-window and the second sub-window, wherein the synchronous processing comprises synchronous displacement.
4. The method of claim 3, wherein the synchronizing the first sub-window and the second sub-window comprises:
acquiring position information of the first sub-window and the second sub-window according to a preset time interval;
determining whether other windows are arranged between the first sub-window and the second sub-window according to the position information;
and when other windows are spaced between the first sub-window and the second sub-window, adjusting the position of the first sub-window and/or the second sub-window.
5. The method of claim 3, wherein the synchronizing the first sub-window and the second sub-window comprises:
controlling the second sub-window to monitor the displacement synchronization message of the first sub-window and controlling the second sub-window to displace according to the displacement synchronization message; and
and controlling the first sub-window to monitor the focus message of the second sub-window and controlling the first sub-window to shift according to the focus message.
6. The method of claim 3, wherein the target window corresponds to one main thread and one sub-thread;
the rendering the first sub-window in an off-screen rendering manner and the rendering the second sub-window in a screen rendering manner includes:
rendering the first sub-window in the main thread according to the off-screen rendering mode, and rendering the second sub-window in the sub-thread according to the screen rendering mode.
7. The method of claim 6, wherein after rendering the first sub-window in an off-screen rendering manner and rendering the second sub-window in a screen rendering manner, further comprising:
and performing synchronous processing on the first sub-window and the second sub-window in the sub-thread.
8. The method of any of claims 1-7, wherein the first child window is a logical parent window of the second child window; the second sub-window is a top-level window.
9. A window rendering apparatus, the apparatus comprising:
the information determining module is used for determining a service function realized by each functional area in a plurality of functional areas contained in the target window and the function type of the service function;
the window decomposition module is used for decomposing the target window according to the function type to obtain a first sub-window and a second sub-window;
and the window rendering module is used for rendering the first sub-window in an off-screen rendering mode and rendering the second sub-window in a screen rendering mode.
10. A computer-readable storage medium storing a plurality of instructions adapted to be loaded by a processor and to perform the method according to any one of claims 1 to 8.
CN201910729361.2A 2019-08-07 2019-08-07 Window rendering method and related equipment Pending CN112347380A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910729361.2A CN112347380A (en) 2019-08-07 2019-08-07 Window rendering method and related equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910729361.2A CN112347380A (en) 2019-08-07 2019-08-07 Window rendering method and related equipment

Publications (1)

Publication Number Publication Date
CN112347380A true CN112347380A (en) 2021-02-09

Family

ID=74367430

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910729361.2A Pending CN112347380A (en) 2019-08-07 2019-08-07 Window rendering method and related equipment

Country Status (1)

Country Link
CN (1) CN112347380A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112947969A (en) * 2021-03-10 2021-06-11 支付宝(杭州)信息技术有限公司 Page off-screen rendering method, device, equipment and readable medium
CN113791857A (en) * 2021-09-03 2021-12-14 北京鲸鲮信息系统技术有限公司 Application window background fuzzy processing method and device in Linux system
CN113961119A (en) * 2021-09-18 2022-01-21 北京城市网邻信息技术有限公司 Information display method and device, electronic equipment and storage medium
CN113791857B (en) * 2021-09-03 2024-04-30 北京字节跳动网络技术有限公司 Application window background fuzzy processing method and device in Linux system

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112947969A (en) * 2021-03-10 2021-06-11 支付宝(杭州)信息技术有限公司 Page off-screen rendering method, device, equipment and readable medium
CN113791857A (en) * 2021-09-03 2021-12-14 北京鲸鲮信息系统技术有限公司 Application window background fuzzy processing method and device in Linux system
CN113791857B (en) * 2021-09-03 2024-04-30 北京字节跳动网络技术有限公司 Application window background fuzzy processing method and device in Linux system
CN113961119A (en) * 2021-09-18 2022-01-21 北京城市网邻信息技术有限公司 Information display method and device, electronic equipment and storage medium
CN113961119B (en) * 2021-09-18 2022-08-23 北京城市网邻信息技术有限公司 Information display method and device, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
US10346522B2 (en) Optimization for rendering web pages
US9720571B2 (en) Immersive mode for a web browser
CN105094289B (en) A kind of method, equipment and system for realizing graphical user's interactive interface
US6169546B1 (en) Global viewer scrolling system
CN111611037B (en) View object processing method for electronic book, electronic device and storage medium
US20230297222A1 (en) Page display switching method, apparatus, storage medium, and electronic device
US20160378272A1 (en) Systems and methods for providing multi-focus to applications for collaboration
CN112347380A (en) Window rendering method and related equipment
CN111432264A (en) Content display method, device and equipment based on media information stream and storage medium
CN111796826B (en) Bullet screen drawing method, device, equipment and storage medium
CN108228130B (en) Liquid crystal screen display method and device of embedded equipment
CN112596843A (en) Image processing method, image processing device, electronic equipment and computer readable storage medium
CN111836093B (en) Video playing method, device, equipment and medium
CN110570501A (en) Line animation drawing method and equipment, storage medium and electronic equipment
CN113316018B (en) Method, device and storage medium for overlaying time information on video picture display
US8913076B1 (en) Method and apparatus to improve the usability of thumbnails
CN110557578A (en) Subtitle display device and method for LED spliced screen and related equipment
JPH06124183A (en) Multiwindow system
US20200410032A1 (en) Method for acquiring webpage frame, server, and storage medium
US9948910B2 (en) Method of and apparatus for simultaneously displaying video input along with supplementary information
CN115118918A (en) Video conference marking method, system, terminal, server and storage medium
CN112214149A (en) Intelligent interactive display device, screen capture method and system thereof, and electronic equipment
CN112417344B (en) Rendering method, rendering device, electronic equipment and storage medium
CN115630622B (en) Drawing method implementation method and device based on vector graphics primitives
CN114143477B (en) Image labeling method and device

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