Display method and related equipment
By detecting the color gamut of window resources and performing corresponding color gamut conversion, the problems of color distortion and resource waste in multi-window display are solved, and more efficient color gamut management is achieved.
Patent Information
- Application Number
- CN202510727879.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-30
- Publication Date
- 2025-09-26
AI Technical Summary
In a multi-window display environment, existing technologies cannot effectively distinguish between wide color gamut and non-wide color gamut resources, resulting in color distortion or waste of system resources.
By detecting whether the window to be displayed on the screen contains wide color gamut resources, if so, it is converted to wide color gamut rendering, otherwise it is based on non-wide color gamut rendering to avoid unnecessary color gamut conversion.
It avoids color distortion of wide color gamut resources and waste of system resources, and achieves more accurate color gamut management.
Smart Images

Figure CN120704780A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a display method and related equipment. Background Art
[0002] A color gamut is the set of displayable or outputtable colors in a color space. The visible spectrum in nature constitutes the largest color gamut, encompassing all colors perceptible to the human eye. In the field of digital display technology, to meet the color requirements of different application scenarios, the industry has defined a variety of standard color gamuts, such as sRGB, Adobe RGB, and Display-P3. sRGB is widely used as a universal standard, while color gamuts encompassing a wider range of colors (such as Adobe RGB and Display-P3) are referred to as wide color gamuts. Currently, most display devices support wide color gamut displays.
[0003] In modern display systems, multiple windows can be displayed simultaneously on the same display device. The windows to be displayed in these multiple windows may contain multiple color gamut resources, and the same window may also contain multiple color gamut resources. How the display device displays based on multiple color gamut resources is a problem that technicians in this field are studying. Summary of the Invention
[0004] The embodiments of the present application provide a display method and related devices, which can detect whether the window to be displayed on the screen contains wide color gamut resources. If the window contains wide color gamut resources, the non-wide color gamut resources can be converted to the wide color gamut, and the screen content is rendered based on the wide color gamut. In the embodiments of the present application, occlusion judgment can also be performed on the window containing wide color gamut resources. If the window containing wide color gamut resources is not fully occluded, the non-wide color gamut resources can be converted to the wide color gamut, and the screen content is rendered based on the wide color gamut to avoid color distortion of the wide color gamut resources displayed on the screen. If the window containing wide color gamut resources is fully occluded, the electronic device renders the screen content based on the non-wide color gamut, reduces unnecessary color gamut conversion, and avoids wasting system resources.
[0005] In a first aspect, an embodiment of the present application provides a display method, which may include: an electronic device may detect a first event for triggering the display of a first window on the screen, and the first window may be a third window of a first application. In response to the first event, the electronic device may be informed of the resources used to render the first window, such as images, videos, etc. The electronic device may then determine the color gamut of the resources based on the information of these resources (such as a color profile, etc.). If there are resources of the first color gamut among the resources used by the first window, the electronic device may convert the resources of the second color gamut in the screen content to the first color gamut when rendering the screen content.
[0006] The color range of the first color gamut can be wider than the color range of the second color gamut. That is, the first color gamut can present more colors than the second color gamut. For example, the first color gamut can be the Display-P3 color gamut, and the second color gamut can be the sRGB color gamut.
[0007] The screen content may include only the first window or the first window and the second window. That is, if the resources used by the first window include resources in the first color gamut, the electronic device may convert the resources in the second color gamut in the first window to the first color gamut when rendering the first window. The electronic device may also convert the resources in the second color gamut in the first window and the resources in the second color gamut in the second window to the first color gamut when rendering the first and second windows on the screen.
[0008] By implementing the method provided in the first aspect, the electronic device can determine whether the screen contains resources of the first color gamut, that is, resources of the wide color gamut, and when it contains wide color gamut resources, it can render based on the wide color gamut to avoid color distortion of the wide color gamut resources.
[0009] In conjunction with the first aspect, in some embodiments, the electronic device obtaining the resources used to render the first window may include: the electronic device obtaining a resource file, such as an image file, of the resources used by the first window, or information indicating the resources used by the first window. The resource information indicating the resources may include one or more of the following: a resource storage location, a resource name, a resource identifier, etc. The electronic device may obtain the resource file from a storage area of the electronic device or a server based on the resource information indicating the resources.
[0010] In conjunction with the first aspect, in some embodiments, the electronic device may further obtain the color gamut of the first window. If the color gamut of the first window is the first color gamut, the electronic device may convert the second color gamut resources in the screen content to the first color gamut when rendering the screen content.
[0011] In conjunction with the first aspect, in some embodiments, the first window is not fully obscured on the screen. Fully obscured means that the proportion of the first window obscured is greater than a first threshold. The first threshold is a reference value for determining whether the first window is fully obscured. The electronic device can determine whether the first window is fully obscured and, only when the first window is not fully obscured, convert resources in the second color gamut to the first color gamut and render screen content based on the first color gamut. If the first window is fully obscured, resources in the second color gamut are not converted to the first color gamut, thereby avoiding unnecessary color gamut conversion operations that waste system resources.
[0012] In conjunction with the first aspect, in some embodiments, resources in the second color gamut in the screen content can be distributed across one or more of the following windows: a first window and a second window. The second window is the fourth window of the first application or the window of the second application. The third and fourth windows of the first application can be different windows of the first application. When the electronic device detects that the first window contains resources in the first color gamut, it can convert the resources in the second color gamut in all windows on the screen to the first color gamut during rendering, thereby ensuring that the color gamut of the data being displayed is uniform.
[0013] In combination with the first aspect, in some embodiments, the rendering node tree of the screen can be used to describe the rendering instructions and color gamut of the screen content. The rendering node tree of the screen can contain multiple rendering nodes, and each resource can correspond to one or more rendering nodes. The resource of the first color gamut can correspond to the first node on the rendering node tree of the screen, and the first node can be the last rendering node on the rendering node tree whose color gamut is the first color gamut. When the resource of the first color gamut exits the display, the electronic device can first maintain the color gamut of the screen content as the first color gamut when rendering the screen content based on the updated rendering node tree. After the first duration, the electronic device can switch the color gamut of the screen content to the second color gamut when rendering the screen content. The updated rendering node tree does not contain the first node. By setting the first duration, the electronic device can maintain rendering based on the first color gamut for a period of time after the resource of the first color gamut exits the display, and then switch to the second color gamut for rendering after a period of time, thereby avoiding the problem of cache invalidation caused by repeated changes of the resource of the first color gamut in a short period of time.
[0014] In combination with the first aspect, in some embodiments, after the electronic device learns the resources used by the first window and determines the color gamut of the resources in response to the first event, it also includes: the electronic device sets the color gamut of the rendering node on the rendering node tree of the screen.
[0015] In conjunction with the first aspect, in some embodiments, the method further includes: the electronic device detects a second event for refreshing the first window. In response to the second event, the electronic device can learn about the new resources used by the first window, determine the color gamut of the new resources, and then update the color gamut of the rendering node on the rendering node tree of the screen. The color gamut of the rendering node is updated in real time based on the resource change status of the first window, so that the electronic device can promptly grasp the color gamut of the window resources through the rendering node tree, conveniently monitor whether there are resources of the first color gamut in the resources used by the first window, and make corresponding color gamut conversions in a timely manner.
[0016] In combination with the first aspect, in some embodiments, the rendering node tree of the screen may include a rendering node tree of the first window, and the rendering node tree of the first window may include a quantity mark bit, which can be used to indicate whether there are resources of the first color gamut in the resources used by the first window.
[0017] In combination with the first aspect, in some embodiments, the quantity mark bit is used to indicate whether there are resources of the first color gamut in the resources used by the first window, specifically including: when the value of the quantity mark bit is greater than zero, there are resources of the first color gamut in the resources used by the first window; when the value of the quantity mark bit is not greater than zero, there are no resources of the first color gamut in the resources used by the first window. The value of the quantity mark bit records the number of rendering nodes whose color gamut is the first color gamut in the rendering node tree of the first window. Before rendering each frame of content, the electronic device does not need to traverse and query whether there are resources of the first color gamut in the resources used by the first window, but can directly read the quantity mark bit on the rendering node tree of the first window to determine whether there are resources of the first color gamut in the resources used by the first window, thereby improving efficiency.
[0018] In conjunction with the first aspect, in some embodiments, a first operating system runs on the electronic device, and a first application runs on the first operating system. The first application may include program code for calling a first interface. The first interface is used by the first application to inform the first operating system of the resources of the first window. When the first application passes a resource file of the resources of the first window to the first operating system through the first interface, the input parameters of the first interface may include the resource file of the resources of the first window; when the first application calls the first interface to pass indication information of the resources of the first window to the first operating system, the input parameters of the first interface include the indication information.
[0019] In conjunction with the first aspect, in some embodiments, a first application includes program code for calling a second interface. The second interface is used by the first application to transmit the color gamut of the first window to the first operating system. The electronic device obtaining the color gamut of the first window specifically includes: the electronic device obtaining the color gamut of the first window transmitted by the first application through the second interface.
[0020] In conjunction with the first aspect, in some embodiments, the first operating system includes a rendering service. The second interface is specifically configured for the first application to transmit the color gamut of the window of the first application to the rendering service. The electronic device converts resources of the second color gamut in the screen content to the first color gamut when rendering the screen content, specifically including: when the electronic device renders the screen content via the rendering service, converting resources of the second color gamut in the screen content to the first color gamut.
[0021] In conjunction with the first aspect, in some embodiments, an electronic device displays screen content in a first color gamut. The electronic device may set the color gamut of a rendering buffer to the first color gamut, where the rendering buffer is used to store rendering results of the screen content. The electronic device transmits the rendering results and the color gamut of the rendering buffer to a display, and controls the display to display the rendering results in the rendering buffer in the first color gamut.
[0022] In a second aspect, embodiments of the present application provide an electronic device, which may include a memory and a processor. The memory may store a computer program, and when the processor executes the computer program, the method described in the first aspect and any possible implementation of the first aspect may be performed.
[0023] In a third aspect, an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the method described in the first aspect and any possible implementation method of the first aspect can be implemented.
[0024] In a fourth aspect, an embodiment of the present application provides a computer program product, which, when executed by a processor, can implement the method described in the first aspect and any possible implementation manner of the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the background technology, the drawings required for use in the embodiments of the present application or the background technology will be described below.
[0026] Figure 1 The boundaries of different color gamuts in the CIE diagram are shown;
[0027] Figure 2 A comparison chart of the same window displayed in a wide color gamut control and a non-wide color gamut space;
[0028] Figure 3 The overall process of the display method provided by the embodiment of the present application is exemplified;
[0029] Figure 4 The implementation process of the first embodiment is exemplified;
[0030] Figure 5 A rendering node tree is exemplarily shown;
[0031] Figure 6 The implementation process of the second embodiment is exemplified;
[0032] Figure 7 A window hierarchy tree is shown as an example;
[0033] Figure 8The implementation process of the third embodiment is exemplified;
[0034] Figure 9 An updated rendering node tree is exemplarily shown;
[0035] Figure 10 The electronic device 10 provided in an embodiment of the present application is exemplarily shown;
[0036] Figure 11 A display system in an electronic device 10 is shown;
[0037] Figure 12 The operating system of the electronic device 10 is exemplarily shown. DETAILED DESCRIPTION
[0038] The terms used in the following embodiments of the present application are only for the purpose of describing specific embodiments and are not intended to limit the present application.
[0039] Color gamut is usually represented by a polygonal area on a two-dimensional chromaticity diagram. The CIE 1931XYZ color space established by the International Commission on Illumination (CIE) in 1931 is a benchmark framework for color gamut quantification. It defines the visible light color range through the spectral response curve of the cone cells of the human eye. All color gamuts (such as sRGB, Adobe RGB, Display-P3, etc.) can be expressed in terms of chromaticity coordinates (such as the coordinates of the three primary colors red, green, and blue). Figure 1 The boundaries are drawn in the CIE diagram shown to form triangular or polygonal areas.
[0040] Color gamut coverage is a key indicator used to describe color gamut. sRGB, Adobe RGB, and Display-P3 cover approximately 35%, 59%, and 45% of the visible colors of CIE 1931, respectively. The greater the color gamut coverage of a color gamut, the wider the range of colors it can present. Figure 1 As shown in the CIE chromaticity diagram, the color coverage range can be presented in the following hierarchical nested structure: Adobe RGB > Display-P3 > sRGB. Among them, Display-P3 completely covers sRGB.
[0041] In different color gamuts, colors can be represented by the three primary colors red (R), green (G), and blue (B), such as hexadecimal RGB values (such as #FF0000), or three primary color coordinates (R, G, B). However, the RGB values or three primary color coordinates corresponding to the same color in different color gamuts are different. Figure 1As shown, a color may have an RGB value of #FF0000 in the sRGB color gamut, while its RGB value in the Display-P3 color gamut may be #EA3323 (this is just an example; different color gamut mapping rules may correspond to different values). #FF0000 in the Display-P3 color gamut corresponds to a different color. Furthermore, the color corresponding to #FF0000 in the Display-P3 color gamut exceeds the sRGB color range and cannot be represented in the sRGB color gamut.
[0042] Color gamut conversion is a key process in color management, used to convert colors from the source color gamut to the target color gamut. One method is to achieve color gamut color coordinate conversion through a 3×3 color gamut conversion matrix, which converts the RGB primary color coordinates of the source color gamut to the target color gamut through a 3×3 matrix. For example, the color gamut conversion matrix from sRGB color gamut to Display-P3 can be M sRGB-P3 , then we can use the formula X P3 =M sRGB-P3 X sRGB Convert the three primary color coordinates of a color in the sRGB color space to the three primary color coordinates in the P3 color space. sRGB To change the color's three primary color coordinates in the sRGB color space, X P3 The three primary color coordinates of the color in the Display-P3 color gamut.
[0043] The color range of wide color gamut is wider than that of non-wide color gamut. When converting color gamut resources to non-wide color gamut, the colors in the wide color gamut that exceed the non-wide color gamut boundary need to be processed by color gamut clipping or color gamut compression, resulting in color distortion, which can be manifested as visual defects such as reduced saturation and hue shift. For example, Figure 2 (a) in the figure shows the result of Display-P3 resource displayed in the Display-P3 color gamut. Figure 2 (b) shows the display result after converting Display-P3 resources to sRGB color gamut. Figure 2 (a) and Figure 2 As can be seen from (b) in the figure, since the brighter color of triangle 10 in the Display-P3 color gamut exceeds the color range of the sRGB color gamut, the sRGB color gamut cannot display this color. Therefore, after the color gamut conversion, the color of triangle 10 is compressed to the sRGB color gamut, and finally displayed. Figure 2 The darker colors shown in (b) above result in color distortion. However, because the color range of the Display-P3 color gamut covers the color range of the sRGB color gamut, the colors will not be distorted when converting sRGB resources to the Display-P3 color gamut.
[0044] Two display methods are introduced below.
[0045] 1. Display method based on separated rendering architecture
[0046] A window may refer to a user interface of an application. One or more windows may be displayed simultaneously on the screen of an electronic device, and the one or more windows may be from different applications.
[0047] In a separate rendering architecture, an application can render window content through its own rendering thread and generate a bitmap that carries the window content. The bitmap is then passed to the surface compositor (SurfaceFlinger). When an application renders window content through its own rendering thread, it can declare a color gamut. The rendering engine can then perform rendering based on the color gamut declared by the application and generate a bitmap of the corresponding color gamut. After SurfaceFlinger obtains the application's bitmap, it can synthesize the application's bitmap with the hardware compositing strategy module (HWC). When the screen includes multiple windows of multiple applications, SurfaceFlinger can receive multiple bitmaps with different color gamuts. SurfaceFlinger can then convert multiple bitmaps with different color gamuts to a unified color gamut when synthesizing the bitmaps, for example, converting multiple bitmaps with different color gamuts to the Display-P3 color gamut. After synthesizing the bitmap of the application, SurfaceFlinger / HWC can fill the synthesized bitmap into the frame buffer (Frame Buffer) and pass it to the display subsystem (DSS) of the electronic device. After getting the synthesized bitmap, DSS can display the synthesized bitmap on the screen.
[0048] However, in this display method, when the window contains wide color gamut content, for example, when the window contains content in the Display-P3 color gamut, if the application does not declare the window's color gamut as the Display-P3 color gamut, the rendering engine will default to the sRGB color gamut during rendering and convert the content of the Display-P3 color gamut to the sRGB color gamut for rendering, resulting in colors that exceed the sRGB color gamut color range being truncated or compressed to the boundary of the sRGB color gamut, causing color distortion.
[0049] 2. Display method based on unified rendering architecture
[0050] In the unified rendering architecture, the application does not include a rendering thread. The application passes the content to be rendered to the unified rendering service, and then the unified rendering service renders all the content on the screen, including the content of multiple windows from different applications. In the unified rendering architecture, electronic devices can use the unified rendering service to render all window contents to be displayed on the screen into a unified rendering buffer. Based on this, the color gamut of the unified rendering buffer can be set to a wide color gamut, and then the rendering engine can convert the non-wide color gamut content to be displayed on the screen to a wide color gamut for rendering. After the rendering engine completes the rendering, it can generate a bitmap containing the contents of all windows on the screen, and the DSS can display the bitmap on the screen.
[0051] However, in this rendering method, even if the screen does not contain wide color gamut content or the window containing wide color gamut content on the screen is blocked, the rendering engine will still convert the non-wide color gamut content to the wide color gamut during rendering. For example, two windows are to be displayed on the screen: window A and window B. Among them, window A contains content in the P3 color gamut, and window B only contains content in the sRGB color gamut, and window A is completely blocked by window B. At this time, the rendering engine will still perform a color gamut conversion operation when rendering the screen content to convert the sRGB content in window B to the P3 color gamut. The color effect of sRGB content displayed in the P3 color gamut is the same as the color effect displayed in the sRGB color gamut. This unnecessary color gamut conversion operation will cause a waste of system resources (such as the computing resources of the graphics processor).
[0052] The present application provides a display method in which an electronic device 10 can determine whether the resources used by a window on the screen include wide color gamut resources. If so, the electronic device 10 can render the screen content based on the wide color gamut and convert the non-wide color gamut resources used by the window on the screen to the wide color gamut when rendering the screen content, thereby avoiding color distortion. If not, the electronic device 10 can render the screen content based on the non-wide color gamut and not perform the color gamut conversion operation, thereby avoiding resource waste.
[0053] The display method provided in the embodiment of the present application can be applied to electronic devices such as smart phones, tablet computers, personal computers (PCs), augmented reality (AR) devices, virtual reality (VR) devices, artificial intelligence (AI) devices, wearable devices (such as smart watches, smart glasses), sports equipment, etc. The electronic device can be Figure 10 An electronic device 10 is shown.
[0054] In an embodiment of the present application, a first operating system may be running on the electronic device 10. The first operating system provides a first interface to the application, so that the application can notify the first operating system, such as ArkUI, of the resources used by the application by calling the first interface. In this way, the first operating system can obtain the resources used by the application and further understand which color gamut resources are included in the application window.
[0055] ArkUI is a user interface development framework that can be part of a first operating system. ArkUI can provide a complete infrastructure for application user interface (UI) development, including concise UI syntax, rich UI features (components, layouts, animations, and interactive events), and real-time interface preview tools, etc., which can support developers in developing visual interfaces. In an embodiment of the present application, ArkUI can obtain the resources of the application's window, determine the color gamut of the resources, and then pass the color gamut of the resources to the system rendering service of the first operating system.
[0056] In one implementation, an application can directly pass its used resources, such as images, to the first operating system by calling a first interface, so that the first operating system can analyze which color gamut resources are included in the application window. In this implementation, the input parameters (or simply parameters) of the first interface can include resource files, such as image files.
[0057] In another implementation, the application can transmit information indicating the resources it uses, such as the resource storage location, resource name, and resource ID, to the first operating system by calling the first interface. The first operating system can then obtain the resources used by the application based on the information and analyze which color gamut resources are included in the application window. In this implementation, the parameters transmitted by the first interface may include the resource storage location, resource name, and resource ID.
[0058] A first application may be running on a first operating system. Accordingly, the first application may include program code that calls a first interface to inform the first operating system of the resources it uses, allowing the first operating system to analyze whether the content in the application window contains wide color gamut content. In some embodiments, the first application may also call the first interface to inform the first operating system whether the resources in the first window contain wide color gamut resources.
[0059] The first application may be a system application, such as "Phone", "SMS", "Camera", "Explorer", "Control Panel", etc. The first application may also be a third-party application.
[0060] Figure 3The overall process of the display method provided by the embodiment of the present application is exemplified as follows:
[0061] S101: The electronic device 10 detects a first event. The first event may be used to trigger display of a first window on the screen, where the first window may be the third window of a first application.
[0062] The first event may be a first internal event, a first user behavior event, or the like.
[0063] The first internal event may be an event that triggers the display of the first window on the screen due to internal factors such as the operating mechanism or state change of the system or application itself. For example, when the battery power of the electronic device 10 drops below a set threshold, a window may be triggered to be displayed to remind the user that the battery power is low. For another example, when a background task (such as file downloading, video transcoding, etc.) running on the electronic device 10 is completed, a window may be triggered to be displayed to notify the user that the task has been completed.
[0064] The first user behavior event may be an event generated by a user operation on the electronic device 10. For example, the electronic device 10 receives a user instruction for opening a window of a first application, including a voice instruction, a touch operation, and the like.
[0065] S102. In response to the first event, the electronic device 10 obtains the resources used by the first window through the first interface, and determines the color gamut of the resources used by the first window.
[0066] The resources used by the first window may include one or more items, such as images, videos, and the like.
[0067] In response to the first event, the first application can load resources used by the first window from a storage area of the electronic device 10 or a server. The first application can transmit the resources used by the first window to the first operating system via the first interface, or the first application can transmit information indicating the resources used by the first window to the first operating system via the first interface, and the first operating system can obtain the resources used by the first window from the electronic device 10 or the server using the information indicating the resources used by the first window. After obtaining the resources used by the first window, the first operating system can determine the color gamut of the resources of the first content by analyzing the resources used by the first window.
[0068] The resources used by the first window may carry color gamut identification information, and the first operating system may determine the color gamut of the resources used by the first window through the color gamut identification information. The color gamut identification information may be metadata embedded in the resources, used to declare the color gamut of the resources. For example, the color space information in the image file header may declare that the color gamut of the image is the sRGB color gamut, the encoding parameters of the video stream may declare that the color gamut of the video resource is the Display-P3 color gamut, and so on. The resources used by the first window may not carry color gamut identification information. For resources that do not carry color gamut identification information, the first operating system may also determine the color gamut of the resources used by the first window by parsing the resources.
[0069] S103. If the resources used by the first window include resources in the first color gamut, the electronic device 10 converts the resources in the second color gamut in the screen content to the first color gamut when rendering the screen content.
[0070] The color range of the first color gamut can be wider than the color range of the second color gamut. For example, the first color gamut can be the Display-P3 color gamut, and the second color gamut can be the sRGB color gamut. The color range of the Display-P3 color gamut is wider than the color range of sRGB, and the color range of Display-P3 can completely cover the sRGB color gamut. Based on this, the colors of the sRGB color gamut can be completely mapped to the Display-P3 color gamut without color distortion. In other words, the colors of the second color gamut will not be distorted when converted to the first color gamut.
[0071] If the resources used by the first window include resources in the first color gamut, it can be indicated that the first window contains content in the first color gamut, that is, content in the wide color gamut, and it can be determined that the screen content of the electronic device 10 includes content in the first color gamut. Then, the electronic device 10 can render the screen content based on the first color gamut and convert all resources in the second color gamut in the screen content to the first color gamut when rendering the screen content.
[0072] When electronic device 10 renders screen content, it performs color processing and output of the screen content through a rendering engine. Rendering screen content based on the first color gamut may involve the rendering engine performing color processing and output of the screen content based on the first color gamut. The rendering engine may convert resources in the second color gamut from the second color gamut to the first color gamut using methods such as a color gamut conversion matrix. For resources in the first color gamut, electronic device 10 may render them directly without performing color gamut conversion.
[0073] The resources of the second color gamut in the screen content of electronic device 10 can be distributed in one or more of the following windows: a first window and a second window. The first window can include both resources of the first color gamut and resources of the second color gamut. The first window can also include only resources of the first color gamut, while the resources of the second color gamut can be distributed in another window on the screen, i.e., a second window. The second window can be a window of the first application other than the first window, i.e., a fourth window, or a window of a second application.
[0074] Multiple windows of a first application may be open on the screen of electronic device 10. In addition to the first window, other windows may use resources in the second color gamut. Multiple applications, namely second applications, may be running simultaneously on electronic device 10. The windows of the second application may be superimposed on each other or displayed side by side on the screen. If the color gamut of the resources used by the windows of the second application is the second color gamut, electronic device 10 may convert the resources in the second color gamut used by the windows of the second application to the first color gamut.
[0075] The display method provided in the embodiment of the present application is briefly introduced in the foregoing. The display method provided in the embodiment of the present application is described in detail below through three specific embodiments.
[0076] Example 1
[0077] In the first embodiment, the electronic device 10 can render and display screen content at a fixed frame rate or a variable frame rate. Before starting to render a frame of screen content, the electronic device 10 can first detect whether the first window contains resources in the first color gamut. If the first window contains resources in the first color gamut, the window color gamut of the first window can be marked as the first color gamut, and the first window can be a first color gamut window. Then, the electronic device can render and display the screen content based on the first color gamut. If the first window does not contain resources in the first color gamut, the screen content can be rendered and displayed based on the second color gamut.
[0078] In the first embodiment, the first color gamut may be exemplified as the Display-P3 color gamut, and the second color gamut may be exemplified as the sRGB color gamut.
[0079] Figure 4 The implementation process of Example 1 is exemplified below.
[0080] S401: The electronic device 10 detects a first event. The first event may be used to trigger display of a first window on the screen of the electronic device. The first window may be a window of a first application.
[0081] The specific content of S401 can be found in step S101 and will not be repeated here.
[0082] S402. In response to the first event, the electronic device 10 may obtain the resources used by the first window through the first interface, and determine the color gamut of the resources used by the first window.
[0083] The electronic device 10 may include functional modules for managing rendering. These functional modules may be used to identify the color gamut of resources and manage the rendering color gamut. The embodiment of the present application is described by taking the first operating system of the electronic device 10 including ArkUI and a rendering service as an example.
[0084] In one implementation, the first application can inform ArkUI of the resources used by the first window through the first interface. As described above, the first application can pass the resource file of the resources used by the first window, or the flag information of the resources used by the first window to ArkUI through the first interface, and ArkUI can obtain the resources used by the first window based on the flag information of the resources. After ArkUI obtains the resources used by the first window, it can determine the color gamut of the resources used by the first window based on the International Color Consortium (ICC) profile of the resources. The ICC profile is a technical file used for standardized color management. For example, an ICC profile can be embedded in an image to declare the color gamut used by the image.
[0085] After ArkUI determines the color gamut of the resources used by the first window, it can pass the color gamut of the resources used by the first window to the rendering service, so that the rendering service can determine the window color gamut of the first window based on the color gamut of the resources and determine whether to render the screen content based on the first color gamut.
[0086] The rendering service may be a rendering service of the first operating system or a rendering service of the first application.
[0087] S403. The electronic device 10 may mark the color gamut of the rendering node on the rendering node tree of the first window according to the color gamut of the resource used by the first window.
[0088] The rendering node tree of the first window may be a sub-rendering tree of the rendering node tree of the screen. The rendering node tree of the screen may include a screen root node and multiple sub-rendering trees, each of which may correspond to a window on the screen. Figure 5 The following example shows a rendering node tree of a screen. Figure 5 As shown, the rendering node tree of the screen may include a screen root node, a rendering node tree of window 1 , a rendering node tree of window 2 , and a rendering node tree of window 3 .
[0089] The rendering node tree of a window may include a window node (the parent node of the rendering node tree of the window) and one or more rendering nodes (child nodes of the rendering node tree of the window). Figure 5 As shown, the rendering node tree of window 1 may include window node 1, rendering node 1, rendering node 2, rendering node 3, rendering node 4, and rendering node 5; the rendering tree of window 2 may include window node 2, rendering node 6, rendering node 7, and rendering node 8; and the rendering tree of window 3 may include window node 3, rendering node 9, and rendering node 10.
[0090] The window's render node tree can contain information such as rendering instructions and rendering properties for the window's content. A resource in a window can correspond to one or more render nodes in the window's render node tree. These one or more render nodes can contain rendering information for the resource, including rendering instructions, rendering properties, and so on.
[0091] For example, window 1 may be exemplified as the first window, the rendering node tree of window 1 may be exemplified as the rendering node tree of the first window, and the rendering node tree of window 1 may include rendering information of the first window.
[0092] In an embodiment of the present application, the rendering nodes on the rendering node tree of the window may further include a color gamut tag. The system rendering service of the electronic device 10 may tag the color gamut of each rendering node according to the color gamut of the resource used by the first window. For example, the rendering service may receive the color gamut of the first resource transmitted by ArkUI. The first resource may be a resource used by the first window, and the first resource may correspond to the first node on the rendering node tree. The color gamut of the first resource may be exemplified by the Display-P3 color gamut (P3 color gamut for short). Based on the color gamut of the first resource, the electronic device 10 may mark the color gamut of the first node (such as rendering node 5) as the P3 color gamut on the rendering node tree of the first window. Figure 5 As shown, the system rendering service of the electronic device 10 marks the rendering nodes 1, 2, and 3 of the first window as the sRGB color gamut, and marks the rendering nodes 4 and 5 as the P3 color gamut according to the color gamut of the resources used by the received first window.
[0093] In the first embodiment, a rendering node marked as a first color gamut can be referred to as a first color gamut node. An example of the first color gamut is the P3 color gamut. For example, if the color gamut of rendering node 5 is marked as the P3 color gamut, rendering node 5 is a first color gamut node. Alternatively, rendering node 5 can be directly referred to as a P3 node.
[0094] In some embodiments, the rendering service may also mark only the nodes whose color gamut is the first color gamut, and not mark the nodes whose color gamut is not the first color gamut. Figure 5 The rendering nodes 4 and 5 are marked as the first color gamut nodes (P3 nodes), and the color gamut marking process is not performed on other rendering nodes.
[0095] S404. The electronic device 10 records the number of first color gamut nodes in the rendering node tree of the first window.
[0096] The window node of the first window may include a quantity flag, which may be used to indicate whether resources used by the first window include resources in the first color gamut. When the value of the quantity flag is greater than zero, resources used by the first window include resources in the first color gamut. When the value of the quantity flag is not greater than zero, resources used by the first window include resources in the first color gamut.
[0097] The quantity mark bit can record the number of rendering nodes whose color domain is the first color domain in the rendering node tree of the first window. The value of the quantity mark bit can be an integer not less than 0. Figure 5 In the rendering node tree shown, the rendering node tree of window 1 includes two first color gamut nodes (P3 nodes), namely rendering node 4 and rendering node 5, so the value of the quantity flag bit in window node 1 can be 2. The rendering node tree of window 2 does not include the first color gamut node, so the value of the quantity flag bit in window node 2 can be 0. The rendering node tree of window 3 does not include the first color gamut node, so the value of the quantity flag bit in window node 3 can be 0.
[0098] The electronic device 10 can determine whether the first window contains resources of the first color gamut based on the value of the number mark bit of the window node of the first window. When the value of the number mark bit of the window node of the first window is greater than 0, it can be determined that the first window contains resources of the first color gamut. When the value of the number mark bit of the window node of the first window is 0, it can be determined that the first window does not include resources of the first color gamut. Figure 5 In the rendering node tree shown, based on the values of the quantity flags of window node 1, window node 2, and window node 3, it can be determined that window 1 includes resources of the first color gamut, while window 2 and window 3 do not include resources of the first color gamut.
[0099] S405. If the number of first color gamut nodes included in the rendering node tree of the first window is greater than zero, the window color gamut of the first window may be marked as the first color gamut, and the first window is a first color gamut window.
[0100] In the first embodiment, when the electronic device 10 determines that the first window contains resources of the first color gamut based on the number of first color gamut nodes, that is, when the number of first color gamut nodes in the first window is greater than zero, the window color gamut of the first window can be marked as the first color gamut, indicating that the electronic device 10 needs to render the content of the first window based on the first color gamut. When the electronic device 10 determines that the first window does not contain content of the first color gamut based on the number of first color gamut nodes, that is, when the number of first color gamut nodes in the first window is zero, the window color gamut of the first window can be marked as the second color gamut, and the first window is a second color gamut window. The second color gamut can be exemplified by the sRGB color gamut.
[0101] In the embodiment of the present application, a window whose window gamut is marked as the first color gamut can be referred to as a first color gamut window. For example, Figure 5 If window 1 in contains 2 first color gamut nodes, the window color gamut of window 1 is marked as the first color gamut, and window 1 is the first color gamut window. Figure 5 In the example, since neither window 2 nor window 3 includes the first color gamut node, the window color gamuts of window 2 and window 3 can be marked as the second color gamut, and window 2 and window 3 are second color gamut windows.
[0102] In other embodiments, the electronic device 10 may further determine whether to mark the window color gamut of the first window as the first color gamut based on the settings of the first application. If the first application sets the color gamut of the first window to the first color gamut, the window color gamut of the first window may be marked as the first color gamut. The first application may include program code for calling the second interface, and the electronic device 10 may further obtain the color gamut of the window of the first application transmitted by the first application through the second interface, such as the color gamut of the first window.
[0103] In some embodiments, the color gamut of the first window may be declared by the developer in the code of the first application. For example, the code of the first application may include the following code: Window_ColorSpace = NSColorSpace.displayP3, which is used to declare that the color gamut of the window of the first application is the P3 color gamut. In other embodiments, the first application may also provide an external interface so that consumers can modify the color gamut of the window of the first application through the external interface. For example, the electronic device may display a UI control for setting the window color gamut in the property settings window of the first application. When a user operation acting on this UI control is detected, the electronic device adaptively modifies the color gamut of the window of the first application. In some embodiments, the color gamuts of different windows of the first application may be different.
[0104] To sum up, in an embodiment of the present application, when the first application sets the first color gamut for the first window, or the number of first color gamut nodes in the rendering node tree of the first window is greater than zero, the color gamut of the first window can be marked as the first color gamut, and the first window is a first color gamut window.
[0105] S406. If the first window is a first color gamut window, the electronic device 10 may render and display the screen content based on the first color gamut.
[0106] When the electronic device renders the content to be displayed on the screen through the system rendering service, the resource of the second color gamut to be displayed is converted into the first color gamut.
[0107] In an embodiment of the present application, the electronic device 10 can render screen content based on the first color gamut by setting the color gamut of the rendering buffer corresponding to the current frame to the first color gamut. The rendering buffer can be a block of memory allocated by the electronic device 10 for the rendering service to store rendering results. The rendering buffer can store a pixel data matrix, where each element can correspond to a physical pixel on the screen.
[0108] In embodiment 1, the rendering buffer may include a color gamut setting. When rendering screen content, the electronic device 10 can switch the rendering color gamut by setting the color gamut of the rendering buffer. After determining that the window color gamut of the first window is the first color gamut, the electronic device 10 can set the color gamut of the rendering buffer of the electronic device 10 to the first color gamut. When rendering the current frame, the rendering engine of the electronic device 10 can determine that the color gamut space of the current frame rendering is the first color gamut based on the color gamut setting of the rendering buffer. The rendering engine can then configure the color management parameters corresponding to the first color gamut to ensure that the first color gamut content can be correctly rendered. For example, the rendering engine can pre-set the color gamut conversion matrix from the second color gamut to the first color gamut before starting rendering. During rendering, the color information of the second color gamut resource can be converted to the first color gamut through the color gamut conversion matrix, and the converted color pixel values (such as RGB values) can be filled into the pixel data matrix of the rendering buffer. The electronic device 10 can directly fill the color pixel values of the first color gamut resource into the pixel matrix of the rendering buffer.
[0109] After rendering is completed, the electronic device 10 can transmit the pixel data in the rendering buffer and the color gamut of the rendering buffer to the display through an interface such as DisplayPort. For example, the electronic device 10 can finally drive the display to display this frame of screen content according to the first color gamut based on the timing signal (VSync / HSync).
[0110] In other embodiments, when multiple windows are displayed on the screen of the electronic device 10, such as a first window and a second window, the electronic device 10 may respectively determine the window color gamut of the first window and the window color gamut of the second window. After the electronic device 10 determines that the window color gamut of the first window is the first color gamut, the first window may be rendered based on the first color gamut. The window color gamut recognition result of the first window may not affect the rendering of the second window. The electronic device 10 may determine the window color gamut of the second window based on the color gamut of the resource of the second window or the color gamut of the second window. If the window color gamut of the second window is the first color gamut, the electronic device 10 may render based on the first color gamut when rendering the second window; if the window color gamut of the second window is the second color gamut, the electronic device 10 may render based on the second color gamut when rendering the second window.
[0111] Example 2
[0112] In the second embodiment, after determining that the first window is a first color gamut window, the electronic device 10 may further perform an occlusion determination on the first window. If the first window is not sufficiently occluded, the electronic device 10 may render and display the screen content based on the first color gamut. If the first window is sufficiently occluded, the electronic device 10 may render and display the screen content based on the second color gamut.
[0113] Figure 6 The following is an example of the implementation process of the second embodiment.
[0114] The specific contents of S601-S605 can be found in steps S401-S405 in the first embodiment, which will not be repeated here.
[0115] S606. If the first window is a first color gamut window, the electronic device 10 determines whether the first window is sufficiently blocked.
[0116] In the second embodiment, the electronic device 10 can determine whether the first window is fully blocked based on the proportion of the first window being blocked. Specifically, when the proportion of the first window being blocked is greater than the first threshold, the electronic device 10 can determine that the first window is fully blocked; when the proportion of the first window being blocked is not greater than the first threshold, the electronic device 10 can determine that the first window is not fully blocked. The first threshold is a benchmark value for determining whether the first window is fully blocked. The first threshold can be a default threshold set by the developer during the development process, an empirical value, or a dynamic value set according to the device status or window status, etc. For example, the first threshold can be 80%. If the proportion of the first window being blocked is greater than 80%, the electronic device 10 can determine that the first window is fully blocked. If the proportion of the first window being blocked is not greater than 80%, it can be determined that the first window is not fully blocked.
[0117] The electronic device 10 can calculate the proportion of the first window that is blocked based on the display hierarchy relationship between the first window and other windows on the screen, as well as the display position, size and other relationships. The electronic device 10 can build a window hierarchy tree based on the hierarchy information of the window. In this window hierarchy tree, the top-level window (the window with the highest hierarchy) can be located at the top of the tree, and the bottom-level window (the window with the lowest hierarchy) can be located at the bottom of the tree. The hierarchy information of the window can be determined based on the Z order of the window. The larger the Z order of a window, the higher its display hierarchy. That is, a window with a higher Z order can be displayed on the upper layer of a window with a lower Z order. For example, the Z order of window 1 is a-1, the Z order of window 2 is a, and the Z order of window 3 is a+1. Window 2 can be displayed on the upper layer of window 1, and window 3 can be displayed on the upper layer of window 1 and window 2. In Figure 6 In the window hierarchy tree shown, window 3 may be at the top of the tree, window 2 may be a child node of window 3, and window 1 may be a child node of window 2. Through the window hierarchy tree, the electronic device 10 may determine that the windows displayed on the upper layer of the first window (assuming the first window is window 1) may include window 2 and window 3. The upper window may block the lower window. Figure 7 As shown, window 3 can block window 2 and window 1, and window 2 can block window 1.
[0118] The window nodes in the window hierarchy tree may also include information such as the window's position coordinates and size for determining the window display area, such as the coordinates of the upper left corner and the lower right corner of a rectangular window on the screen, or the coordinates of the upper left corner of a rectangular window on the screen and the width and height of the rectangular window. Based on this, the electronic device 10 can traverse the window nodes above the first window in the window hierarchy tree from top to bottom, and calculate the overlapping area between each window above the first window and the first window. This overlapping area can be the area blocked by the first window. Taking the first window as an example, Figure 5 Taking window 1 in the figure as an example, window 2 and window 3 are located above window 1 in the window hierarchy tree. The electronic device 10 can calculate the overlapping area of window 3 and window 1, and the overlapping area of window 2 and window 1 in sequence. The overlapping area of window 2 and window 1 is the area of window 1 blocked by window 2, and the overlapping area of window 3 and window 1 is the area of window 1 blocked by window 3. The electronic device 10 can obtain the proportion of the first window being blocked based on the calculated window overlapping area. For example, the proportion of window 1 blocked by window 3 can be the proportion of the overlapping area of window 2 and window 1 in window 2, and the proportion of window 1 blocked by window 2 can be the proportion of the overlapping area of window 1 and window 2 in window 2.
[0119] It should be noted that if the first window is at the top of the window hierarchy tree, it can be directly determined that the first window is not fully obscured. For example, if window 3 is at the top of the window hierarchy tree, window 3 has the highest level and is not obscured by other windows on the screen. If the obscuration ratio of window 3 is 0%, then window 3 is not fully obscured.
[0120] In other embodiments, the electronic device 10 may also use other methods to determine whether the first window is fully blocked. For example, the electronic device 10 may determine whether the first window is fully blocked based on the pixels occupied by the first window on the screen and the depth of each pixel. The embodiments of the present application do not limit this.
[0121] In other embodiments, the electronic device 10 may further perform an occlusion determination on the resources of the first color gamut in the first window. If the resources of the first color gamut in the first window are not occluded, the electronic device 10 may render and display the screen content based on the first color gamut.
[0122] S607: If the first window is not sufficiently blocked, the electronic device 10 may render and display the screen content based on the first color gamut.
[0123] The implementation method of S607 may be the same as the implementation method of S406, and will not be described in detail here.
[0124] In the second embodiment, by performing occlusion judgment on the window containing wide color gamut resources, wide color gamut rendering is performed only when the wide color gamut window is not fully occluded, thereby avoiding unnecessary waste of resources and improving the operating efficiency of the electronic device 10.
[0125] Example 3
[0126] In the third embodiment, while electronic device 10 is displaying a first window, the resources used by the first window may change. In response, electronic device 10 may also re-determine the window color gamut of the first window by updating the rendering node tree of the first window. Electronic device 10 may then render the screen content based on the updated rendering node tree.
[0127] Figure 8 The implementation process of Example 3 is exemplified below.
[0128] The specific contents of S801-S807 can be found in steps S601-S607 in the second embodiment, which will not be repeated here.
[0129] S808. The electronic device 10 detects a second event.
[0130] During the display of the first window, the electronic device 10 may detect a second event. The second event may be used to refresh the content of the first window. The second event may be a second internal event or a second user behavior event. The second internal event may be an event that causes a window content refresh to be triggered by the internal system of the electronic device or the logic of the application itself, such as automatic switching of advertising column content, weather forecast data updates, real-time stock quote updates, etc. The second user behavior event may be a series of actions that the user actively performs on the electronic device to change the window content, such as opening or closing an image in a window, switching document pages, clicking search on a search page, etc.
[0131] S809. In response to the second event, the electronic device 10 updates the rendering node tree of the first window and the window color gamut of the first window.
[0132] In response to the second event, the electronic device 10 can obtain the new resources used by the first window and determine the color gamut of the new resources, then update the color gamut of the rendering node on the rendering node tree of the first window and the value of the quantity mark bit of the window node, and then redetermine the window color gamut of the first window based on the updated quantity mark bit.
[0133] In response to different second events, the electronic device 10 makes different modifications to the rendering node tree of the first window, including: updating the color gamut of the rendering node and updating the quantity mark when the color gamut of the resource changes, adding a rendering node to the rendering node tree and updating the quantity mark when a new resource is added to the first window, and deleting the rendering node and updating the quantity mark when the resource exits display.
[0134] Expand below:
[0135] (1) The color gamut of the resource of the first window changes
[0136] S10. The system rendering service of the electronic device 10 receives the updated color gamut of the resource delivered by ArkUI.
[0137] In some embodiments, in response to the second event, the resource of the first window may change, and the changed resource may have a color gamut different from the original resource. Then, the rendering service of the electronic device 10 may receive the color gamut of the updated resource delivered by ArkUI.
[0138] For example, Figure 9For example, the resource corresponding to render node 4 in the original image is a P3 color gamut image. In response to the second event, the resource corresponding to render node 4 is updated to an sRGB color gamut image. For another example, the resource corresponding to render node 11 is an sRGB color gamut image. In response to the second event, the resource corresponding to render node 9 is updated to a P3 color gamut image. The system rendering service of electronic device 10 can then receive the updated color gamuts of the resources corresponding to render nodes 4 and 9, transmitted by ArkUI.
[0139] S11. The system rendering service of the electronic device 10 updates the color gamut of the rendering node in the rendering node tree of the first window.
[0140] After receiving the updated color gamut of the resource transmitted by ArkUI, the rendering service of the electronic device 10 will find the corresponding rendering node in the rendering node tree of the first window and update its color gamut mark.
[0141] Figure 9 An updated rendering node tree is exemplarily shown.
[0142] like Figure 9 As shown, the rendering service of the electronic device 10 can update the color gamut of the rendering node 4 from the P3 color gamut to the sRGB color gamut, and update the color gamut of the rendering node 9 from the sRGB color gamut to the P3 color gamut.
[0143] S12. The system rendering service of the electronic device 10 updates the value of the quantity mark bit in the window node of the first window.
[0144] If a rendering node was originally a first-gamut node (such as a P3 node) and now becomes a non-first-gamut node (such as an sRGB node), the value of the quantity flag in the window node of the first window needs to be reduced by 1. Conversely, if a rendering node was originally not a first-gamut node and now becomes a first-gamut node, the value of the quantity flag in the window node of the first window needs to be increased by 1.
[0145] For example, the rendering service of the electronic device 10 may reduce the value of the quantity mark bit of the window node 1 by one, and increase the value of the quantity mark bit of the window node 3 by one.
[0146] (2) Adding new resources in the first window
[0147] S20. The rendering service of the electronic device 10 may receive the information of the newly added resources transmitted by ArkUI, including color gamut, layout information, etc.
[0148] S21. The rendering service of the electronic device 10 adds a new rendering node to the rendering node tree of the first window.
[0149] The rendering service of the electronic device 10 may determine the position of the rendering node corresponding to the newly added resource in the rendering node tree of the first window according to the received layout information, and then create a new rendering node at the position.
[0150] like Figure 9 As shown, the rendering service of the electronic device 10 creates a new rendering node 11 as a child node of the rendering node 7 at the corresponding position of the rendering node tree of the window 2 .
[0151] S22. The rendering service of the electronic device 10 marks the color gamut for the newly added rendering node.
[0152] The rendering service of the electronic device 10 sets a color gamut for the newly added rendering node according to the color gamut of the received resource. If the color gamut of the newly added resource is the first color gamut, the color gamut flag of the newly added rendering node will be set to the first color gamut.
[0153] like Figure 9 As shown, the rendering service of the electronic device 10 marks the color gamut of the rendering node 11 as the P3 color gamut.
[0154] S23. The rendering service of the electronic device 10 updates the value of the quantity mark bit in the window node of the first window.
[0155] If the color gamut of the newly added rendering node is marked as the first color gamut, the value of the quantity flag bit in the window node of the first window needs to be increased by one.
[0156] For example, after a rendering node 11 whose color gamut is the first color gamut (P color gamut) is newly added to the rendering node tree of window 2, the rendering service of electronic device 10 may increase the value of the quantity flag bit in the window node of window 2 by 1.
[0157] (3) Resource exit display in the first window
[0158] S30. The rendering service of the electronic device 10 deletes a node in the rendering node tree of the first window.
[0159] The electronic device 10 finds a rendering node corresponding to the resource that exits display in the rendering node tree of the first window, and then removes the rendering node from the rendering node tree.
[0160] For example, if the electronic device 10 no longer displays the resource corresponding to the window node 5 in the window 1 , the electronic device 10 may remove the rendering node 5 from the rendering node tree of the window 1 .
[0161] S31. If the deleted node is the first color gamut node, the rendering service of the electronic device 10 decrements the value of the number flag of the window nodes of the first window by one after a first delay.
[0162] When deleting a node, the rendering service of the electronic device 10 may check the color gamut flag of the node to determine whether it is a first color gamut node. If the deleted node is a first color gamut node, the rendering service of the electronic device 10 will not immediately reduce the value of the quantity flag in the window node, but will perform the reduction operation after a first delay by setting a timer or using other delay mechanisms.
[0163] The first duration is the delay waiting time introduced by the rendering service of the electronic device 10 when deleting the first color gamut node. The first duration can be the default delay duration set by the developer during development, or it can be a dynamic duration set based on the device conditions such as the system load of the electronic device 10 or the screen refresh frame rate. In Example 3, the first duration can be exemplified as 30s. For example, if the color gamut of the rendering node 5 is marked as the first color gamut (P3 color gamut), the system rendering service of the electronic device 10 can delete the rendering node 5 from the rendering node tree, and after waiting for the first duration (30s), reduce the value of the number mark bit of the window node of window 1 by one.
[0164] When deleting a node, the rendering service of the electronic device 10 can check whether the value of the quantity mark bit of the window node of the first window is 1. If so, the electronic device 10 can reduce the value of the quantity mark bit by one after waiting for the first time period, that is, change it to 0; if not, the electronic device 10 can immediately reduce the value of the quantity mark bit by one. For example, the rendering service of the electronic device 10 can first change the color gamut of the rendering node 4 in the rendering node tree of window 1 from the P3 color gamut to the sRGB color gamut. At this time, the value of the quantity mark bit of window 1 is 2. The electronic device 10 can immediately reduce the value of the quantity mark bit by one, and update the value of the quantity mark bit to 1. Then, the electronic device 10 removes the rendering node 5 from the rendering node tree of window 1. At this time, the electronic device 10 can reduce the value of the quantity mark bit by one after waiting for 30s, so that the value of the quantity mark bit is updated from 1 to 0.
[0165] After the rendering service of the electronic device 10 updates the rendering node and updates the value of the quantity mark bit of the first window, the window color gamut of the first window can be re-determined based on the value of the updated quantity mark bit. If the value of the updated quantity mark bit is zero, the window color gamut of the first window is switched to the second color gamut. If the value of the updated quantity mark bit is greater than zero, the window color gamut of the first window remains the first color gamut. For example, if the value of the quantity mark bit of window 1 is updated from 2 to 0, the window color gamut of window 1 can be updated from the first color gamut to the second color gamut; if the value of the quantity mark bit of window 2 is updated from 0 to 1, the window color gamut of window 2 can be updated from the second color gamut to the first color gamut; if the value of the quantity mark bit of window 3 is updated from 0 to 1, the window color gamut of window 3 can be updated from the second color gamut to the first color gamut.
[0166] In other embodiments, the electronic device 10 may not delay modifying the value of the quantity mark bit, but instead updates the window color gamut of the first window to the first color gamut after detecting that the value of the quantity mark bit is updated from 1 to 0 and waiting for the first period of time.
[0167] By delaying the reduction of the value of the quantity flag or delaying the modification of the window color gamut of the first window, it is possible to achieve that after all resources in the first color gamut on the screen are no longer displayed, the screen content can be rendered and displayed based on the first color gamut for a period of time. After a period of time, the color gamut of the rendering buffer is switched to the second color gamut, and the electronic device 10 renders and displays the screen content based on the second color gamut. This avoids the problem of cache invalidation caused by frequent up and down tree movement of the first color gamut node.
[0168] For example, the first resource may be the only resource of the first color gamut on the screen, the first resource may correspond to the first node, the first node may be the only first color gamut node on the screen rendering node tree, and the value of the quantity flag of the first window may be 1. In response to the second event, the first resource exits display, and the electronic device 10 removes the first node from the rendering node tree. The electronic device 10 may then update the value of the quantity flag of the first window from 1 to 0 after a first delay, and immediately update the window color gamut of the first window to the second color gamut after updating the quantity flag. Alternatively, the electronic device 10 may immediately update the value of the quantity flag from 1 to 0, and switch the window color gamut of the first window to the second color gamut after a first delay. In this way, within the first time period after the first resource exits display, the window color gamut of the first window is not updated to the second color gamut, the electronic device 10 still sets the color gamut of the rendering buffer to the first color gamut, renders the screen content based on the first color gamut, and converts the resources of the second color gamut to the first color gamut. After waiting for the first period of time, when rendering the latest frame of screen content, the electronic device 10 can detect that the window color gamut of the first window is updated to the second color gamut and no other first color gamut windows are contained on the screen, and then set the color gamut of the rendering buffer to the second color gamut, and render the screen content based on the second color gamut.
[0169] S810. The electronic device 10 re-renders and displays the screen content based on the updated rendering node tree.
[0170] When rendering a new frame of content, the electronic device 10 can check the window color gamut of each window node in the screen's rendering node tree. If the screen's rendering node tree includes a window node whose window color gamut is the first color gamut, the electronic device 10 continues to render the screen content based on the first color gamut. If there is no window node in the screen's rendering node tree whose window color gamut is the first color gamut, the electronic device 10 can switch the color gamut of the rendering buffer from the first color gamut back to the second color gamut, and render and display the screen content based on the second color gamut.
[0171] Figure 10An electronic device 10 provided in an embodiment of the present application is exemplarily shown.
[0172] The device type of the electronic device 10 can be any of a smartphone, a tablet computer, a handheld computer, a desktop computer, a laptop computer, an ultra-mobile personal computer (UMPC), a netbook, a cellular phone, a personal digital assistant (PDA), wearable devices such as smart bracelets, smart watches, and smart glasses, extended reality (XR) devices such as augmented reality (AR), virtual reality (VR), and mixed reality (MR), in-vehicle devices, or smart city devices, etc.
[0173] like Figure 10 As shown, the electronic device 10 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.
[0174] The processor 110 may be one or more processors, which may be integrated into an integrated circuit of a system on chip (SOC). A SOC is a system-on-chip. The processor 110 may include a central processing unit (CPU), a graphics processing unit (GPU), a neural-network processing unit (NPU), etc.
[0175] The processor 110 may include one or more interfaces, such as an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input and output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface.
[0176] The processor 110 may be provided with a cache memory for storing instructions or data that have just been used or are cyclically used by the processor 110. If the processor 110 needs to use the instruction or data again, it can be directly called from the cache memory, which can reduce the waiting time of the processor 110 and improve the efficiency of program operation.
[0177] The electronic device 10 can realize the display function through the GPU, the display screen 194, and the application processor.
[0178] The CPU and GPU can be used to render and synthesize images to be displayed on the display screen 194.
[0179] Processor 110 may include one or more GPUs that execute instructions to generate or change display information. A GPU is a microprocessor for image processing and is connected to display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations. In embodiments of the present application, the GPU can be used to perform color gamut conversion using a color gamut conversion matrix, such as converting from the sRGB color gamut to the Display-P3 color gamut or converting content in the second color gamut to the first color gamut. The GPU can also be responsible for graphics rendering, performing shading based on rendering instructions and data from the CPU, as well as filling, rendering, and outputting materials.
[0180] Display screen 194 is used to display images, videos, etc. Display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a MiniLED, a MicroLED, a Micro-oLed, or a quantum dot light-emitting diode (QLED).
[0181] In some embodiments, the electronic device 10 may include one or N display screens 194, where N is a positive integer greater than 1. The external memory interface 120 may be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 10. The external memory card communicates with the processor 110 via the external memory interface 120 to implement data storage. For example, data such as music, photos, and videos can be stored on the external memory card.
[0182] The internal memory 121 may be used to store one or more computer programs. The processor 110 may execute the computer programs stored in the internal memory 121 to enable the electronic device 10 to perform the display method provided in the embodiment of the present application.
[0183] The internal memory 121 may include a program storage area and a data storage area. The program storage area may store an operating system; the program storage area may also store one or more applications (such as a gallery, contacts, etc.). The data storage area may store data (such as photos, contacts, etc.) created during the use of the electronic device 10. In some embodiments, the data storage area may be used to store resources for the first window content, the rendering node tree of the first window, the hierarchical relationship of the screen windows, rendered pixel data, and the like.
[0184] The wireless communication function of the electronic device 10 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.
[0185] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 10 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve antenna utilization. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In other embodiments, the antennas can be used in conjunction with a tuning switch.
[0186] The mobile communication module 150 can provide wireless communication solutions for electronic device 10, including 2G / 3G / 4G / 5G. The modem processor can include a modulator and a demodulator. The modulator is used to modulate the low-frequency baseband signal to be transmitted into a medium- or high-frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. The wireless communication module 160 can provide wireless communication solutions for electronic device 10, including WLAN (such as Wi-Fi), Bluetooth, Global Navigation Satellite System, frequency modulation, NFC, infrared technology, and ultra-wideband (UWB). The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via an antenna, frequency modulates and filters the electromagnetic wave signals, and transmits the processed signals to the processor 110. The wireless communication module 160 can also receive signals to be transmitted from the processor 110, frequency modulate them, amplify them, and convert them into electromagnetic waves for radiation via the antenna. For example, the wireless communication module 160 can include a Bluetooth module, a Wi-Fi module, etc.
[0187] The components in the electronic device 10 may be implemented as hardware modules, or as software modules, or as a combination of software and hardware modules.
[0188] Figure 10The device structure shown does not constitute a specific limitation on the electronic device 10. In other embodiments of the present application, the electronic device 10 may include more or fewer components than shown, or combine or separate some components, or arrange the components differently.
[0189] The above is merely an exemplary introduction to the hardware structure of electronic device 10. In some embodiments, electronic device 10 may have more or fewer components than shown in the figures, may combine two or more components, or may have a different component configuration. The various components shown in the figures may be implemented in hardware, including one or more signal processing and / or application-specific integrated circuits, software, or a combination of hardware and software.
[0190] Figure 11 A display system 100 in an electronic device 10 is shown.
[0191] The display system 100 can be used to support the implementation of the display method provided in the embodiments of the present application.
[0192] like Figure 11 As shown, the display system 100 may include an application processor (AP), a GPU, and a display.
[0193] The AP can be responsible for running the operating system on the electronic device 10, and applications can be running on the operating system. The AP can send rendering instructions to the GPU. After receiving the rendering instructions from the AP, the GPU can perform rendering and store the rendered pixel data in the rendering buffer. After the rendering is completed, the GPU can pass the pixel data and color gamut identifier to the display driver chip (Display Driver IC, DDIC) of the display. For example, the GPU can pass the pixel data and color gamut identifier to the DDIC via the MIPI interface. The DDIC can drive the OLED display based on the pixel data and the color gamut identifier. Among them, the DDIC can determine the color gamut used by the pixel data based on the color gamut identifier, and then drive the OLED to display content based on the color gamut used by the pixel data. When the color gamut identifier is a first value, the DDIC can drive the OLED to display the pixel data in the P3 color gamut; when the color gamut identifier is a second value, the DDIC can drive the OLED to display the pixel data in the sRGB color gamut. The first value can represent the P3 color gamut, and the second value can represent the sRGB color gamut.
[0194] Figure 12 The operating system of the electronic device 10 is exemplarily shown.
[0195] Electronic device 10 can run an operating system (OS), which can be various operating systems used in the industry, such as operating systems developed based on OpenHarmony, such as HarmonyOS; various open source operating systems or their derivatives, as well as other embedded operating systems; or new operating systems in the future, such as artificial intelligence-based AI operating systems. An operating system is a set of interrelated system software programs that manage and control the operation of electronic devices, utilize and run hardware and software resources, and provide public services to organize user interactions. In electronic devices, the operating system connects the physical devices at the hardware layer downward and provides an operating environment for application software upward.
[0196] like Figure 12 As shown, an operating system may generally include: an application layer, a framework layer, a system service layer, and a kernel layer.
[0197] The application layer includes application programs, which may include system applications such as "Phone," "SMS," "Camera," "Explorer," "Control Panel," and the like, as well as third-party applications. In an embodiment of the present application, an application in the application layer may pass resources corresponding to window content or identifiers of resources corresponding to window content to the framework layer.
[0198] The framework layer provides an application programming interface (API) and a programming framework for the application programs of the application layer. In an embodiment of the present application, the framework layer may include the ArkUI framework, etc. The ArkUI framework provides a complete infrastructure for the UI development of system applications, including UI functions (such as components, layouts, animations, and interactive events, etc.), as well as real-time interface preview tools. The ArkUI framework provides at least two development paradigms, including a declarative development paradigm based on ArkTS and a JS-compatible Web-like development paradigm. In an embodiment of the present application, the ArkUI framework can receive the resources of the window content and / or the identifier of the resources corresponding to the window content passed by the application layer. If the identifier of the resource is received, the ArkUI framework can obtain the corresponding resource based on this identifier. ArkUI can also parse the color gamut information of the resource, and pass the parsed color gamut information of the resource to the rendering service of the system service layer.
[0199] The system service layer includes a set of core capabilities of the system and provides services to applications through the framework layer. In the embodiment of the present application, the system service layer may include system rendering services, window management services, display services, etc.
[0200] The system rendering service may include a color gamut switching module and a rendering module. The color gamut switching module can mark the color gamut of rendering nodes based on the color gamut of the window content, count and record the number of first color gamut nodes, determine the window color gamut of the window, and so on. The rendering module performs rendering based on the color gamut determined by the color gamut switching module and processes resources such as images according to the corresponding color gamut standards, including configuring the rendering pipeline for the first color gamut and converting resources from the second color gamut to the first color gamut. The rendering module generates pixel data and writes the pixel data to the render buffer.
[0201] The window management service is responsible for creating, adding, and deleting windows, and can also lock the screen, capture the screen, etc. In an embodiment of the present application, the window management service can determine whether the first color gamut window is fully blocked based on the hierarchical relationship of the windows.
[0202] After electronic device 10 renders a frame of content, the display service can pass the pixel data in the render buffer to the kernel-layer display driver. The display service can synchronize control with the kernel-layer display driver, controlling the render buffer transfer time based on the screen refresh cycle and vertical synchronization signal to avoid screen tearing or lag. The display service can also allocate a render buffer of appropriate size to the rendering process based on the needs of the system rendering service. After passing the pixel data in the render buffer to the display driver, the display service can release the render buffer and reclaim memory resources.
[0203] The kernel layer is a layer between hardware and software. The kernel layer may include hardware drivers and the operating system kernel. In addition to providing hardware drivers, the kernel layer also supports functions such as memory management and system process management. In an embodiment of the present application, the driver subsystem of the kernel layer may include a display driver, etc. The display driver may receive pixel data transmitted from the display service, and then parse and process the received data to ensure the correctness and integrity of the data. The display driver may write the pixel data row by row or column by column into the memory of the display device according to the timing requirements of the display device, thereby achieving refresh and display of the screen content. The display driver may also provide an interface for the display service to access the display hardware, so that the system service layer of the electronic device 10 can obtain parameters such as the brightness, contrast, and resolution of the display device.
[0204] The above is merely an exemplary introduction to the operating system of the electronic device 10 . Figure 12 The illustrated operating system does not constitute a specific limitation on the electronic device 10. In other embodiments of the present application, the operating system of the electronic device 10 may include more or fewer functional modules than shown, or combine or split some functional modules, or arrange the functional modules differently.
[0205] An embodiment of the present application further provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the display method provided in the embodiment of the present application can be implemented.
[0206] The embodiment of the present application also provides a computer program product, which, when executed, can implement the display method provided in the embodiment of the present application.
[0207] The present application also provides a chip system, which includes a processor coupled to a memory, and the processor executes a computer program stored in the memory to implement the display method provided in the present application. The chip system can be a single chip or a chip module composed of multiple chips.
[0208] Those skilled in the art will appreciate that in one or more of the above examples, the functions described in the embodiments of the present application can be implemented using hardware, software, firmware, or any combination thereof. When implemented using software, these functions can be stored in a computer-readable medium or transmitted as one or more instructions or codes on a computer-readable medium. Computer-readable media include computer storage media and communication media, wherein communication media include any media that facilitates the transmission of computer programs from one place to another. The storage medium can be any available medium that can be accessed by a general-purpose or special-purpose computer.
[0209] The above specific implementation methods further explain in detail the purpose, technical solutions and beneficial effects of the embodiments of the present application. It should be understood that the above are only specific implementation methods of the embodiments of the present application and are not intended to limit the scope of protection of the embodiments of the present application. Any modifications, equivalent replacements, improvements, etc. made on the basis of the technical solutions of the embodiments of the present application should be included in the scope of protection of the embodiments of the present application.
Claims
1. A display method, characterized in that: The method comprises: The electronic device detects a first event, where the first event is used to trigger display of a first window on the screen, where the first window is the third window of the first application; In response to the first event, the electronic device learns resources used by the first window and determines a color gamut of the resources; If there are resources of the first color gamut in the resources, the electronic device converts the resources of the second color gamut in the screen content to the first color gamut when rendering the screen content, and the color range of the first color gamut is wider than the color range of the second color gamut.
2. The method according to claim 1, wherein The electronic device learning the resources used by the first window specifically includes: The electronic device obtains the resource file of the resource used by the first window or indication information of the resource used by the first window, where the indication information is used to indicate the storage location of the resource file of the resource, and the indication information includes one or more of the following: resource storage location, resource name, and resource identifier.
3. The method according to claim 1 or 2, wherein: The method further comprises: The electronic device obtains the color gamut of the first window; if the color gamut of the first window is the first color gamut, the electronic device converts the resources of the second color gamut in the screen content to the first color gamut when rendering the screen content.
4. The method according to any one of claims 1 to 3, wherein The first window is not fully blocked on the screen, where the fully blocked means that the blocking ratio of the first window is greater than a first threshold.
5. The method according to any one of claims 1 to 4, characterized in that The resources of the second color gamut in the screen content are distributed in one or more of the following windows: a first window and a second window, where the second window is the fourth window of the first application or the window of the second application.
6. The method according to any one of claims 1 to 5, wherein: The resource of the first color gamut corresponds to the first node on the rendering node tree of the screen, the first node being the last rendering node on the rendering node tree whose color gamut is the first color gamut, and the rendering node tree of the screen is used to describe the rendering instructions and color gamut of the screen content; The method further comprises: When the resource in the first color gamut exits display, the electronic device maintains the color gamut of the screen content in the first color gamut when rendering the screen content based on the updated rendering node tree, the maintaining lasting for a first duration, and after the maintaining, the electronic device switches the color gamut of the screen content to the second color gamut when rendering the screen content; The updated rendering node tree does not include the first node.
7. The method according to claims 1 to 6, characterized in that After the electronic device learns the resources used by the first window in response to the first event and determines the color gamut of the resources, the method further includes: The electronic device sets a color gamut of a rendering node on a rendering node tree of the screen.
8. The method according to claim 7, wherein The method further comprises: The electronic device detects a second event, where the second event is used to refresh the first window; In response to the second event, the electronic device learns the resources used by the first window and determines a color gamut of the resources; The electronic device updates the color gamut of the rendering node in the rendering node tree.
9. The method according to any one of claims 6 to 8, wherein: The rendering node tree of the screen includes the rendering node tree of the first window, and the rendering node tree of the first window includes a quantity flag, which is used to indicate whether there are resources of the first color gamut in the resources used by the first window.
10. The method according to claim 9, wherein The quantity flag is used to indicate whether there are resources of the first color gamut in the resources used by the first window, specifically including: When the value of the quantity flag is greater than zero, the resources used by the first window include resources of the first color gamut; When the value of the quantity flag is not greater than zero, there is no resource of the first color gamut among the resources used by the first window; The value of the quantity flag records the number of rendering nodes whose color gamut is the first color gamut in the rendering node tree of the first window.
11. The method according to any one of claims 1 to 10, wherein: A first operating system runs on the electronic device, the first operating system runs the first application, the first application includes program code that calls a first interface, wherein the first interface is used by the first application to notify the first operating system of resources of the first window; When the first application calls the first interface to transfer the resource file of the resource of the first window to the first operating system, the input parameter of the first interface includes the resource file of the resource of the first window; When the first application calls the first interface to transmit indication information of resources of the first window to the first operating system, the input parameters of the first interface include the indication information.
12. The method according to claim 11, wherein The first application includes a program code for calling a second interface, where the second interface is used by the first application to transmit the color gamut of the first window to the first operating system; The electronic device acquires the color gamut of the first window, specifically including: The electronic device obtains the color gamut of the first window transmitted by the first application through the second interface.
13. The method according to any one of claims 1 to 12, wherein: The first operating system includes a rendering service; The second interface is specifically used by the first application to transmit the color gamut of the window of the first application to the rendering service; The electronic device converts the resources of the second color gamut in the screen content to the first color gamut when rendering the screen content, specifically including: the electronic device converts the resources of the second color gamut in the screen content to the first color gamut when rendering the screen content through the rendering service.
14. The method according to claims 1 to 13, wherein The method further includes: the electronic device displaying the screen content according to the first color gamut.
15. An electronic device comprising a memory, a processor, and a computer program stored in the memory, wherein: The processor executes the computer program to implement the steps of the method according to any one of claims 1 to 14.
16. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 14 are implemented.
17. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 14 are implemented.
Citation Information
Patent Citations
Picture display method and device, mobile terminal and storage medium
CN110413360A
Interface display method and display equipment
CN117827337A
Display processing method and device, product and medium
CN117931329A
Image processor
JP2004272609A
Video editing method and electronic device
WO2023016014A1