Display method and device for draggable window, electronic equipment and storage medium

By creating mask layers on Android devices and updating their location in real time, the screen sluggishness and incompleteness caused by insufficient device performance when dragging and dropping windows is solved, achieving a smoother user experience.

CN119201307APending Publication Date: 2024-12-27ALLWINNER TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411089768.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-09
Publication Date
2024-12-27

AI Technical Summary

Technical Problem

On Android tablets and embedded devices, the screen sluggishness, incompleteness and black screen problems caused by insufficient device performance when dragging and dropping the window affects the user experience.

Method used

Create a mask layer overlay on the application layer, update the mask layer position in real time, and remove the mask layer after drawing and rendering through the rendering thread to avoid the drawing and rendering of the application layer during dragging and dropping.

Benefits of technology

Improve the smoothness and smoothness of the picture during the drag and drop window, avoiding the picture incompleteness and lag, and improving the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119201307A_ABST
    Figure CN119201307A_ABST
Patent Text Reader

Abstract

The invention provides a display method and device for a draggable window, electronic equipment and a storage medium, and is applied to Android id system equipment, the method comprises the following steps: in response to a dragging behavior for a display window, creating a mask layer, and enabling the mask layer to cover an application layer, the display window being located in the application layer; the mask layer is displayed in real time in the process of dragging the display window, and the position of the mask layer is updated in real time according to the width and height information of the application layer; in the process of dragging the display window, the application layer is drawn and rendered through the rendering thread, the mask layer is removed after drawing and rendering are finished, and the application layer is displayed. According to the method provided by the invention, in the process of dragging the window, the application layer is displayed only after drawing and rendering of the application layer are finished, so that the problem of picture incompleteness in the dragging process is avoided, and the picture transition effect of the application layer is smoother.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of application window display, and in particular to a method, device, electronic device, and storage medium for displaying a draggable window. Background Art

[0002] On Android platform devices, the function of dragging and zooming with draggable windows has been widely used. Various Android phones have the function of dragging and zooming in and out after dragging the draggable window, which is convenient for users to switch between multiple tasks more flexibly and efficiently. However, in Android tablet products or other types of embedded products, the draggable windows on such devices may have problems such as slow and incomplete images during the dragging process, flickering when the draggable window is maximized and minimized, and a black screen in a certain area when the draggable window becomes full screen. The reason is that there is a problem with the buffer synchronization between the application drawing on the Android system and the SurfaceFlinker. On mobile devices, due to the high performance of mobile phone chips, the impact of this problem on user experience can be ignored. On embedded devices, due to cost considerations, the performance of the internal chip is lower than that of mobile phones, so it will have a greater impact on the user's visual experience. Summary of the invention

[0003] The present invention aims to solve at least one of the technical problems existing in the prior art. To this end, the present invention provides a method, device, electronic device, and storage medium for displaying a draggable window, which can solve the screen problem caused by insufficient device performance during the dragging process of the draggable window.

[0004] In a first aspect, an embodiment of the present invention provides a method for displaying a draggable window, characterized in that the method is applied to an Android system device and includes:

[0005] In response to the dragging behavior of the display window, a mask layer is created, so that the mask layer covers the application layer, wherein the display window is located in the application layer;

[0006] During the process of dragging the display window, the mask layer is displayed in real time, and the position of the mask layer is updated in real time according to the width and height information of the application layer;

[0007] During the process of dragging the display window, the application layer is drawn and rendered through a rendering thread, and after the drawing and rendering are completed, the mask layer is removed to display the application layer.

[0008] In some embodiments of the present invention, in response to the dragging behavior of the display window, creating a mask layer so that the mask layer covers the application layer, wherein the display window is located at the application layer, comprises:

[0009] In response to the dragging behavior of the display window, acquiring icon information of the display window, and creating a background layer and an icon layer according to the icon information;

[0010] Performing RGB color mixing on the system theme color and the application background color to obtain a background color, adjusting the color of the background layer according to the background color, and making the background layer cover the application layer;

[0011] Setting parameter information of an icon view, and mounting the icon view on the icon layer;

[0012] The hierarchical order of the icon layer, the background layer and the application layer is adjusted so that the icon layer is located at the top layer, the background layer is located at the next layer of the icon layer, and the application layer is located at the bottom layer.

[0013] In some embodiments of the present invention, the step of setting parameter information of the icon view and mounting the icon view on the icon layer includes:

[0014] Adding the icon view to the buffer of the icon layer through a view rendering component and a window management component, wherein the buffer combines the icon view with the icon layer;

[0015] The system's buffer tree renders the synthesized icon layer to achieve mounting of the icon view.

[0016] In some embodiments of the present invention, the step of creating a mask layer according to the icon information of the display window in response to the dragging behavior of the display window, so that the mask layer covers the application layer, further includes:

[0017] The parent node of the background layer and the parent node of the icon layer are both set as the application layer, so that the background layer and the icon layer can change with the size of the application layer;

[0018] The relative positions of the icon layer and the background layer are adjusted according to the icon information so that the icon layer is always located on the background layer.

[0019] In some embodiments of the present invention, the step of displaying the mask layer in real time during the process of dragging the display window, and updating the position of the mask layer in real time according to the width and height information of the application layer includes:

[0020] Calling a transaction submission function to notify the rendering management component, after receiving the notification and when the next vertical synchronization signal arrives, the rendering management component applies the change information of the icon layer and the change information of the background layer to the rendering thread, and updates the current layer state;

[0021] The background layer and the icon layer are rendered by a hardware synthesizer to obtain an updated position of the mask layer.

[0022] In some embodiments of the present invention, during the process of dragging the display window, the step of drawing and rendering the application layer by a rendering thread, removing the mask layer after the drawing and rendering are completed, and displaying the application layer includes:

[0023] During the process of dragging the mask layer, synchronizing the buffer of the application layer with the buffer of the mask layer, and applying the change information of the application layer to the rendering thread;

[0024] After drawing and rendering are completed, the mask layer is removed, and the latest frame at the current moment in the rendering thread is refreshed to display the application layer.

[0025] In some embodiments of the present invention, the step of removing the mask layer after the drawing and rendering are completed, and refreshing the latest frame at the current moment in the rendering thread to display the application layer includes:

[0026] After drawing and rendering are completed, checking whether the buffer of the application layer is updated within a first preset time;

[0027] When the buffer of the application layer does not need to be updated within a first preset time and the dragging behavior cannot be detected, the latest frame at the current moment in the rendering thread is refreshed to display the application layer.

[0028] In a second aspect, an embodiment of the present invention provides a display device, comprising at least one control processor and a memory for communicating with the at least one control processor; the memory stores instructions executable by the at least one control processor, and the instructions are executed by the at least one control processor so that the at least one control processor can execute the method for displaying a draggable window as described in the first aspect above.

[0029] In a third aspect, an embodiment of the present invention provides an electronic device, comprising the display device as described in the second aspect above.

[0030] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium storing computer-executable instructions, wherein the computer-executable instructions are used to execute the method for displaying a draggable window as described in the first aspect above.

[0031] The method for displaying a draggable window according to an embodiment of the present invention has at least the following beneficial effects: according to the method provided by the present invention, when a user drags a display window on an Android system device, the system generates a mask layer according to the application information of the display window, and adjusts the layer order to mask the mask layer above the application layer of the display window, so that when the user is dragging the window, the terminal device only needs to render and display a single mask layer, and there is no need to display the drawing and rendering process of the application layer. The application layer is displayed only after the drawing and rendering of the application layer are completed, which avoids the problem of incomplete picture during the dragging process and makes the transition effect of the application layer picture smoother. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] Figure 1 This is one of the flow charts of a method for displaying a draggable window provided by an embodiment of the present invention;

[0033] Figure 2 is a schematic diagram of the relationship between a mask layer and an application layer provided by an embodiment of the present invention;

[0034] Figure 3 This is a schematic diagram of the process by which the Andor id system mounts the icon view to the icon layer;

[0035] Figure 4 This is a second flowchart of a method for displaying a draggable window provided by another embodiment of the present invention;

[0036] Figure 5 is a structural diagram of a display device provided by another embodiment of the present invention. DETAILED DESCRIPTION

[0037] Embodiments of the present invention are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and cannot be understood as limiting the present invention.

[0038] In the description of the present invention, it should be understood that descriptions involving orientations, such as up, down, front, back, left, right, etc., and orientations or positional relationships indicated are based on the orientations or positional relationships shown in the accompanying drawings, and are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore should not be understood as a limitation on the present invention.

[0039] In the description of the present invention, "several" means one or more, "more" means more than two, "greater than", "less than", "exceed" etc. are understood as not including the number itself, and "above", "below", "within" etc. are understood as including the number itself. If there is a description of "first" or "second", it is only used for the purpose of distinguishing the technical features, and cannot be understood as indicating or implying the relative importance or implicitly indicating the number of the indicated technical features or implicitly indicating the order of the indicated technical features.

[0040] In the description of the present invention, unless otherwise clearly defined, terms such as setting, installing, connecting, etc. should be understood in a broad sense, and technicians in the relevant technical field can reasonably determine the specific meanings of the above terms in the present invention based on the specific content of the technical solution.

[0041] An embodiment of the present invention provides a method provided by the present invention. When a user drags a display window on an Android system device, the system generates a mask layer according to the application information of the display window, and adjusts the layer order to mask the mask layer above the application layer of the display window, so that when the user drags the window, the terminal device only needs to render and display a single mask layer, and there is no need to display the drawing and rendering process of the application layer. The application layer is displayed only after the drawing and rendering of the application layer are completed, which avoids the problem of incomplete picture during the dragging process and makes the application layer picture transition effect smoother and more fluent.

[0042] The concepts involved in this application are explained below:

[0043] Android: Android is a free and open source mobile operating system based on the Linux kernel (excluding GNU components). It is mainly used in mobile devices such as smartphones and tablets, and is led and developed by Google and the Open Handset Alliance in the United States.

[0044] Android framework layer: refers to the software layer that provides basic services and APIs for applications. It is located between the core library and application framework of the Android operating system, providing developers with the tools and interfaces needed to build applications;

[0045] HWC: Hardware Composer, a module in the Hardware Abstraction Layer (HAL) for efficiently compositing multiple graphics layers. It allows the system to perform layer synthesis directly at the hardware level, thereby reducing dependence on GPU resources, improving overall performance and reducing power consumption;

[0046] SurfaceFlinger: is a core service responsible for synthesizing and rendering all display content and finally outputting it to the display device. It improves the performance and smoothness of graphics rendering by using hardware acceleration and double buffering mechanisms, and can manage multiple Surface objects, each of which contains a graphics buffer;

[0047] SurfaceControlViewHost, WindowlessWindowManager: Two components in the Android system used to implement specific UI rendering functions. They work together to support cross-process UI display and special window management;

[0048] SurfaceControl: SurfaceControl is a class in the Android operating system, which is part of the Android framework layer and is mainly used to manage operations related to Surface. Surface is a low-level object used for graphics rendering in Android. It represents a graphics buffer that can be used to display images, videos, or other graphics content.

[0049] Buffer: Buffer is used to temporarily store data between different components and processes;

[0050] Fence signal: A synchronization mechanism used to control the order of operations between different processes or threads to ensure that resources are ready before being accessed.

[0051] The control method of the embodiment of the present invention is further described below based on the accompanying drawings.

[0052] Reference Figure 1 , Figure 1 A flowchart of a method for displaying a draggable window provided by an embodiment of the present invention is applied to an Android system device, and the method includes but is not limited to the following steps:

[0053] Step S100, in response to the dragging behavior of the display window, creating a mask layer so that the mask layer covers the application layer, wherein the display window is located in the application layer;

[0054] Step S200, during the process of dragging the display window, the mask layer is displayed in real time, and the position of the mask layer is updated in real time according to the width and height information of the application layer;

[0055] Step S300, during the process of dragging the display window, the application layer is drawn and rendered through the rendering thread, and after the drawing and rendering are completed, the mask layer is removed and the application layer is displayed.

[0056] It should be noted that the display window involved in the embodiment of the present invention can be an application icon on an Android device or a small window formed by the split-screen function of the device. These display windows can be freely dragged and moved in the Android system. In the Android system, the display interface is usually displayed in layers. This mechanism allows the system to separate different visual elements into independent layers, render and synthesize them separately, and finally display a unified image on the screen. The layer involved in the display window is the application layer. The application layer is the layer normally displayed on the display interface of the Android system device. When the display window application layer moves, the Android system will render each frame of the application layer. If the performance of the display chip related to the system device is insufficient (for example, in an embedded device), it will cause the display to be stuck and incomplete, affecting the user experience. Therefore, in step S100 of the embodiment of the present invention, when it is detected that the display window of the device is dragged, the system will create a mask layer that can cover the application layer. Furthermore, in step S200, during the dragging process, the display interface will only display the mask layer; it is understandable that in response to the user's dragging behavior, it is still the application layer that performs the window dragging function, and the embodiment of the present invention only makes the mask layer appear above the application layer to block the application layer, but does not prevent the application layer from interacting with screen-related components. Further, in step S300, while the mask layer is dragged and moved above the application layer, the application layer is also synchronously drawn and rendered, so that the subsequent application layer can be quickly replaced on the display interface; when the application layer is drawn, for example, when the user no longer drags the display window, the display interface deletes the mask layer to display the application layer to avoid affecting subsequent system applications.

[0057] It should be noted that the embodiment of the present invention shields the application layer through the mask layer so that the process of constantly redrawing and rendering the application layer due to the continuous change of the display window is not displayed on the display interface. It can be understood that the embodiment of the present invention realizes the position change of the mask layer. Since the pixels of the mask layer itself will not change after the first rendering is completed, there is no need to re-render during the movement. Furthermore, the embodiment of the present invention does not omit the process of continuous drawing and rendering of the application layer. The drawing and rendering of the application layer are carried out synchronously with the dragging behavior. The embodiment of the present invention only shields the drawing and rendering process through the mask layer so that this process is not displayed on the display interface. Then, after the image displayed by the application layer is determined, for example, after the user stops dragging the display window, the image on the application layer no longer changes. At this time, displaying the application layer again will not cause problems such as freezes and incomplete images.

[0058] In addition, in one embodiment, referring to Figure 1 to Figure 3 ,exist Figure 1Step S100 of the illustrated embodiment also includes but is not limited to the following steps:

[0059] Step S110, in response to the dragging behavior of the display window, obtaining the icon information of the display window, and creating a background layer and an icon layer according to the icon information;

[0060] Step S120, performing RGB color mixing on the system theme color and the application background color to obtain a background color, adjusting the color of the background layer according to the background color, and making the background layer cover the application layer;

[0061] Step S130, setting parameter information of the icon view, and mounting the icon view on the icon layer;

[0062] Step S140, adjusting the hierarchical order of the icon layer, the background layer and the application layer so that the icon layer is located at the top layer, the background layer is located at the layer below the icon layer, and the application layer is located at the bottom layer.

[0063] It should be noted that in step S110 to step S140, the mask layer described in the embodiment of the present invention includes a background layer and an icon layer, wherein the background layer is used to simulate the background of the display interface of the system device, and the icon layer is used to simulate the dragged display window. Before creating the background layer and the display window, it is necessary to obtain the icon information of the display window, which includes but is not limited to color, size, position, parent-child relationship, and z-order hierarchy relationship. For a simplified diagram of the relationship between the background layer, icon layer, and application layer, refer to Figure 2 . After creating the background layer and the icon layer according to the icon information, since the above steps only create two basic layers, it is also necessary to adjust the color of the background layer, and mount the icon view (such as the APP icon, the shape of the window, etc.) on the icon layer to simulate the application layer, so that the user can observe the actual situation of the application view according to the background layer and the icon layer. In Android, each window (Window) is represented by a Surface to represent the layer information, and SurfaceContro l is a class used to control the Surface. When the Surface needs to make a series of changes (such as resizing, position adjustment, transparency adjustment, etc.), we can use the internal class of SurfaceContro l, Transact ion, to control these attribute changes; in order to make the mask layer appear on the application layer, it is also necessary to adjust the z-order of each layer so that the mask layer is located above the application layer, and the application layer will not be displayed at this time. Specifically, the embodiment of the present invention modifies the value of z-order through the Transact ion.setLayer function. The larger the value of z-order, the closer it is to the user when it is finally displayed on the screen.

[0064] In addition, in one embodiment, Figure 1 Step S130 in the illustrated embodiment also includes but is not limited to the following steps:

[0065] Step S131, adding the icon view to the buffer of the icon layer through the view rendering component and the window management component, and the buffer combines the icon view with the icon layer;

[0066] Step S132: the system's buffer tree renders the synthesized icon layer to mount the icon view.

[0067] It should be noted that, refer to Figure 3 In the embodiment of the present invention, the method for setting the icon view to the icon layer adopts a transaction submission method, and the process of the transaction submission method includes but is not limited to: using the combination of the pair of components SurfaceControlViewHost+WindowlessWindowManager, directly rendering the content contained in the icon view to the corresponding SurfaceControl, and then adding it to the layer tree of SurfaceFlinger. The pair of component combinations provided in the above-mentioned embodiment has the ability to display View across processes, and the icon view can be set to the SurfaceControl of the icon layer by calling the SurfaceControlViewHost.setView method in SurfaceControlViewHost.

[0068] In addition, in one embodiment, Figure 1 Step S100 of the illustrated embodiment also includes but is not limited to the following steps:

[0069] Step S150, setting the parent node of the background layer and the parent node of the icon layer as the application layer, so that the background layer and the icon layer can change with the size of the application layer;

[0070] Step S160, adjusting the relative positions of the icon layer and the background layer according to the icon information, so that the icon layer is always located on the background layer.

[0071] It should be noted that in step S150 to step S160, in the Android system, the graphical interface is composed of multiple layers, and these layers are organized together through specific node relationships for management and rendering. The mask layer of the embodiment of the present invention is composed of a background layer and an icon layer, and their parent nodes are both application layers, so that the background layer and the icon layer can change with the size of the application layer. Specifically, the embodiment of the present invention sets the parent-child relationship of the layer through the Transaction.setParent function. Furthermore, in step S220, the icon layer is always located at the center of the background layer. The purpose is to ensure the visual consistency of the display interface in the user's perception after the masking layer blocks the application layer, and at the same time make the movement of the icon layer more integrated; specifically, the embodiment of the present invention uses the Transaction.setPos it ion function to set the position of the layer.

[0072] In addition, in one embodiment, Figure 1 Step S200 in the illustrated embodiment also includes but is not limited to the following steps:

[0073] Step S210, calling the transaction submission function to notify the rendering management component, after receiving the notification and when the next vertical synchronization signal arrives, the rendering management component applies the change information of the icon layer and the change information of the background layer to the rendering thread, and updates the current layer state;

[0074] Step S220, rendering the background layer and the icon layer through the hardware synthesizer to obtain the updated position of the mask layer.

[0075] It should be noted that if Figure 3 As shown, in steps S210 to S220, the mask layer sets the layer's z-order hierarchy, position, parent-child relationship and other properties through the layer interface provided in the Android framework. Then, through the transaction submission method, the layer status is updated and handed over to the HWC (i.e., hardware synthesizer) for synthesis and rendering, and finally displayed on the terminal. Specifically, after setting the layer properties according to the method of the embodiment of the above aspect, it is also necessary to call the SurfaceControl.Transaction.apply method. This method notifies SurfaceF l inger in a cross-process manner through the carrier SurfaceComposerCl ient. SurfaceF l inger will apply these layer change information to the rendering thread when the next vsync signal (i.e., vertical synchronization signal) arrives, change the properties of the current layer, and obtain the updated position of the mask layer.

[0076] In addition, in one embodiment, Figure 1 Step S300 in the illustrated embodiment also includes but is not limited to the following steps:

[0077] Step S310, in the process of dragging the mask layer, synchronizing the buffer of the application layer with the buffer of the mask layer, and applying the change information of the application layer to the rendering thread;

[0078] Step S320, after drawing and rendering are completed, the mask layer is removed, and the latest frame at the current moment in the rendering thread is refreshed to display the application layer.

[0079] It should be noted that in step S310 to step S330, the embodiment of the present invention synchronously draws and renders during the dragging process, sets buffer synchronization for the application layer and the mask layer, submits the buffer of the application layer (i.e., the buffer) and the buffer of the mask layer to SurfaceFlinger together, and finally waits for the fence signal to render. That is, in the above-mentioned embodiment, it is ensured that the image in the application layer is exactly the same as the background layer and the icon layer. When the position of the display window no longer changes, the latest frame in the rendering thread should be displayed to display the application layer. At this time, the mask layer is removed, and the user will not feel the difference in the picture.

[0080] In addition, in one embodiment, step S320 in the above embodiment also includes but is not limited to the following steps:

[0081] Step S321, after drawing and rendering are completed, check whether the buffer of the application layer is updated within a first preset time;

[0082] Step S322, when the buffer of the application layer does not need to be updated within the first preset time and the dragging behavior cannot be detected, refresh the latest frame at the current moment in the rendering thread to display the application layer.

[0083] It should be noted that in steps S321 to S322, when the position of the display window no longer changes, there will be no corresponding change information in the buffer of the application layer. SurfaceFlinker will use the new buffer to refresh the screen when the next vertical synchronization signal arrives to display the updated application layer.

[0084] like Figure 5 As shown, Figure 5 is a structural diagram of a display device provided by an embodiment of the present invention. The present invention also provides a display device, including:

[0085] The processor 801 may be implemented by a general-purpose central processing unit (CPU), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of the present application;

[0086] The memory 802 can be implemented in the form of a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 802 can store an operating system and other application programs. When the technical solutions provided in the embodiments of this specification are implemented by software or firmware, the relevant program codes are stored in the memory 802, and the processor 801 calls and executes the method of the embodiments of this application;

[0087] Input / output interface 803, used to implement information input and output;

[0088] The communication interface 804 is used to realize the communication interaction between the present apparatus and other devices. The communication can be realized through a wired manner (such as USB, network cable, etc.) or a wireless manner (such as mobile network, WI FI, Bluetooth, etc.);

[0089] A bus 805 that transmits information between the various components of the device (e.g., the processor 801, the memory 802, the input / output interface 803, and the communication interface 804);

[0090] The processor 801 , the memory 802 , the input / output interface 803 and the communication interface 804 are connected to each other in communication within the device via a bus 805 .

[0091] An embodiment of the present application also provides an electronic device, comprising the display device as described above.

[0092] An embodiment of the present application further provides a storage medium, which is a computer-readable storage medium and stores a computer program. When the computer program is executed by a processor, the above-mentioned method for displaying a draggable window is implemented.

[0093] As a non-transient computer-readable storage medium, the memory can be used to store non-transient software programs and non-transient computer executable programs. In addition, the memory may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage devices. In some embodiments, the memory may optionally include a memory remotely arranged relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned networks include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and a combination thereof. The device embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and are implemented to be located in one place, or may also be distributed to multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the present embodiment.

[0094] The following is an overall embodiment of the present invention:

[0095] Reference Figure 4, a specific process of an embodiment of the present invention is: a. When the application layer starts to be dragged, the icon information is obtained, and the background layer and the icon layer are created. The color, size, position, parent-child relationship and z-order hierarchical relationship of the layer are set by means of transactions. b. In the process of dragging the display window in the application layer, the width and height information of the application layer is obtained to update the position of the icon layer so that it is always located in the middle of the background layer, and then the rendering thread is made to draw and render the background layer and the icon layer. c. While dragging the display window, the application layer is drawn and rendered. After the application layer is drawn, the background layer and the icon layer are removed, and the current rendering thread frame is refreshed to display the application layer. Specifically, the mask layer sets the z-order hierarchical relationship, position and parent-child relationship of the layer through the layer interface of the Android framework layer. Then, the layer state is updated by means of transaction submission, and it is handed over to the HWC for synthetic rendering, and finally displayed on the terminal. Further, in Android, each window (Window) is represented by a Surface to represent the layer information, and SurfaceControl is a class used to control the Surface. When Surface needs to make a series of changes (such as resizing, position adjustment, transparency adjustment, etc.), we can use SurfaceControl's internal class Transaction to control these property changes. Among them, Transaction.setLayer is used to set the hierarchical relationship of the layer. The larger the z-order value, the closer it is to the user when it is finally displayed on the screen. Transaction.setPos it ion is used to set the position of the layer. Transaction.setParent is used to set the parent-child relationship of the layer. Furthermore, the combination of SurfaceControlViewHost+WindowlessWindowManager can be used to render the icon view content directly to the corresponding SurfaceControl, and then add it to the layer tree of SurfaceFlinger. This combination has the ability to display View across processes. The icon view is set to the SurfaceControl of the icon layer by calling the SurfaceControlViewHost.setView method. After setting the layer properties, you also need to call the SurfaceControl.Transaction.apply method. This method notifies SurfaceFlinger in a cross-process manner through the carrier SurfaceComposerClient.SurfaceFlinger will apply these layer change information to the rendering thread when the next vsync signal arrives, and change the properties of the current layer. In the embodiment of the present invention, the mask layer is composed of a background layer and an icon layer, and their parent nodes are both application layers. Their z-order layer hierarchy relationship is: icon layer > background layer > application layer. The application layer is at the bottom, and the icon layer is at the top.

[0096] It will be appreciated by those skilled in the art that all or some of the steps and systems in the disclosed method above may be implemented as software, firmware, hardware and appropriate combinations thereof. Some physical components or all physical components may be implemented as software executed by a processor, such as a central processing unit, a digital signal processor or a microprocessor, or may be implemented as hardware, or may be implemented as an integrated circuit, such as an application specific integrated circuit. Such software may be distributed on a computer-readable medium, which may include a computer storage medium (or a non-transitory medium) and a communication medium (or a temporary medium). As known to those skilled in the art, the term computer storage medium includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules or other data). Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technologies, CD-ROM, digital versatile disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tapes, disk storage or other magnetic storage devices, or any other medium that may be used to store desired information and may be accessed by a computer. Furthermore, it is well known to those skilled in the art that communication media typically include computer readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media.

[0097] The above is a specific description of the preferred implementation of the present invention, but the present invention is not limited to the above-mentioned implementation mode. Technical personnel familiar with the field can also make various equivalent deformations or substitutions under the shared conditions without violating the spirit of the present invention. These equivalent deformations or substitutions are all included in the scope defined by the claims of the present invention.

Claims

1. A method for displaying a draggable window, characterized in that: Applied to an Android system device, the method includes: In response to the dragging behavior of the display window, a mask layer is created, so that the mask layer covers the application layer, wherein the display window is located in the application layer; During the process of dragging the display window, the mask layer is displayed in real time, and the position of the mask layer is updated in real time according to the width and height information of the application layer; During the process of dragging the display window, the application layer is drawn and rendered through a rendering thread, and after the drawing and rendering are completed, the mask layer is removed to display the application layer.

2. The method for displaying a draggable window according to claim 1, characterized in that: The step of creating a mask layer in response to the dragging of the display window, so that the mask layer covers the application layer, wherein the display window is located at the application layer, comprises: In response to the dragging behavior of the display window, acquiring icon information of the display window, and creating a background layer and an icon layer according to the icon information; Performing RGB color mixing on the system theme color and the application background color to obtain a background color, adjusting the color of the background layer according to the background color, and making the background layer cover the application layer; Setting parameter information of an icon view, and mounting the icon view on the icon layer; The hierarchical order of the icon layer, the background layer and the application layer is adjusted so that the icon layer is located at the top layer, the background layer is located at the next layer of the icon layer, and the application layer is located at the bottom layer.

3. The method for displaying a draggable window according to claim 2, characterized in that: The step of setting parameter information of the icon view and mounting the icon view on the icon layer includes: Adding the icon view to the buffer of the icon layer through a view rendering component and a window management component, wherein the buffer combines the icon view with the icon layer; The system's buffer tree renders the synthesized icon layer to achieve mounting of the icon view.

4. The method for displaying a draggable window according to claim 2, wherein: The step of creating a mask layer according to the icon information of the display window in response to the dragging behavior of the display window, so that the mask layer covers the application layer, further includes: The parent node of the background layer and the parent node of the icon layer are both set as the application layer, so that the background layer and the icon layer can change with the size of the application layer; The relative positions of the icon layer and the background layer are adjusted according to the icon information so that the icon layer is always located on the background layer.

5. The method for displaying a draggable window according to claim 2, characterized in that: The step of displaying the mask layer in real time during the process of dragging the display window, and updating the position of the mask layer in real time according to the width and height information of the application layer, comprises: Calling a transaction submission function to notify the rendering management component, after receiving the notification and when the next vertical synchronization signal arrives, the rendering management component applies the change information of the icon layer and the change information of the background layer to the rendering thread, and updates the current layer state; The background layer and the icon layer are rendered by a hardware synthesizer to obtain an updated position of the mask layer.

6. The method for displaying a draggable window according to claim 1, characterized in that: During the process of dragging the display window, the step of drawing and rendering the application layer through the rendering thread, removing the mask layer after the drawing and rendering are completed, and displaying the application layer includes: During the process of dragging the mask layer, synchronizing the buffer of the application layer with the buffer of the mask layer, and applying the change information of the application layer to the rendering thread; After drawing and rendering are completed, the mask layer is removed, and the latest frame at the current moment in the rendering thread is refreshed to display the application layer.

7. The method for displaying a draggable window according to claim 6, characterized in that: The step of removing the mask layer after the drawing and rendering are completed, and refreshing the latest frame at the current moment in the rendering thread to display the application layer comprises: After drawing and rendering are completed, checking whether the buffer of the application layer is updated within a first preset time; When the buffer of the application layer does not need to be updated within a first preset time and the dragging behavior cannot be detected, the latest frame at the current moment in the rendering thread is refreshed to display the application layer.

8. A display device, characterized in that: It includes at least one control processor and a memory for communicating with the at least one control processor; the memory stores instructions that can be executed by the at least one control processor, and the instructions are executed by the at least one control processor so that the at least one control processor can execute the method for displaying a draggable window as described in any one of claims 1 to 7.

9. An electronic device, characterized in that: A display device comprising the display device according to claim 8.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to enable a computer to execute the method for displaying a draggable window according to any one of claims 1 to 7.