Layer filtering method for implementing enhanced display in android system
By performing format, transparency, texture filtering, and name judgment on layers in the Android system, display enhancement is only performed on video layers, solving the problems of ineffective display enhancement and high power consumption in existing technologies, and achieving accurate filtering and improved stability.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- HANGZHOU ARCVIDEO TECHNOLOGY CO LTD
- Filing Date
- 2026-03-26
- Publication Date
- 2026-06-19
AI Technical Summary
The existing display enhancement technology in Android systems cannot take effect at the system level, lacks universality, is ineffective for unadapted applications, has high computational overhead and power consumption, and may introduce artifacts.
By comprehensively judging layer format, transparency, whether texture filtering is enabled, layer name and rendering status in the Android system, display enhancement processing is performed only on the target layer, and the rendering process of RenderEngine's drawLayers() is used for filtering and rendering mark management.
It achieves precise filtering of video target layers, avoids repeated rendering, reduces system power consumption, improves display stability and efficiency, and is easy to integrate at the system level.
Smart Images

Figure CN122240227A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of mobile terminal display processing technology, specifically relating to a layer filtering method for enhancing display in the Android system. Background Technology
[0002] With the improvement of mobile device performance, display enhancement technologies (such as super-resolution, image sharpening, HDR enhancement, etc.) are widely used to improve the user's visual experience. The graphics rendering of the Android system is usually completed through the collaboration of components such as the display compositor (SurfaceFlinger) and the hardware compositor (HWC). The application's view content is finally composited into layers for display.
[0003] Currently, most display enhancements are handled at the application layer, meaning each application enhances its content automatically during rendering. This approach cannot be applied at the system level, is ineffective for unadapted applications, and lacks universality. System-level display enhancement methods, if they enhance the entire screen frame buffer, incur high computational overhead and power consumption, and may unnecessarily process unnecessary layers such as system UI elements and bullet comments, potentially introducing artifacts. Therefore, it is necessary to accurately and efficiently identify and filter out layers that truly require enhancement (such as SurfaceView content like videos and games) within the system rendering pipeline. Summary of the Invention
[0004] In view of the above problems, the present invention provides a layer filtering method for implementing enhanced display in Android system. This method comprehensively judges the layer format, transparency, whether texture filtering is enabled, whether the layer name contains special strings, and the layer rendering state to ensure that the display enhancement function only applies to the appropriate layers and maintains the correctness and stability of the processing when the layer state changes.
[0005] To solve the above-mentioned technical problems, the present invention adopts the following technical solution: A layer filtering method for enhanced display in Android system, applied to the drawLayers() rendering process of RenderEngine, includes the following steps: S10, each time the drawlayer function is called, the display enhancement rendering flag is reset to false; if there are multiple display enhancements to be processed, the display enhancement rendering flag of each pending display enhancement is reset to false. S20, each time the drawlayer function renders the layers to be drawn in the Z-axis order. For each layer, the following processing is performed: layer filtering conditions are judged. When the system is ready to draw a layer, the filtering conditions are checked in turn. When all filtering conditions are met, the layer is marked as a candidate layer for display enhancement and enters the layer processing; otherwise, the enhancement processing is skipped and the original process is used for rendering.
[0006] Preferably, the filtering conditions in S20 include: Determine if the pixel data format of this layer is a format with an alpha channel and if the global alpha blending value is greater than 0; Determine whether texture filtering is enabled for this layer; Determine whether the name or associated identifier of the layer contains a string that represents the name of the video playback layer.
[0007] Preferably, marking the layer as a candidate layer for display enhancement and entering layer processing includes: when the Alpha type is kOpaque_SkAlphaType, directly entering the display enhancement rendering logic; and after successful display enhancement rendering, setting the rendering flag corresponding to the layer to true.
[0008] Preferably, marking the layer as a candidate layer for display enhancement and entering layer processing includes: when the Alpha type is not kOpaque_SkAlphaType, determining whether the rendering flag corresponding to the layer is true; if it is true, skipping the display enhancement processing and directly entering the subsequent compositing process; if it is false, entering the display enhancement rendering logic, and updating the rendering flag to true after successful rendering.
[0009] The layer filtering method for enhanced display implemented in the Android system described above, during the system compositing stage, performs a one-time display enhancement process only on the target video layer through multi-condition filtering and rendering state control, balancing display effect, system stability, and performance. Compared with existing technologies, this invention has at least the following beneficial effects: (1) Precisely filter target layers. By judging the layer's data format, transparency, layer name, and texture filtering conditions, ensure that display enhancement is performed only on video target layers.
[0010] (2) Prevent redundant rendering enhancements. By controlling rendering flags, the same layer is prevented from undergoing display enhancement processing multiple times. This reduces unnecessary GPU rendering operations, lowers system power consumption, and improves overall display stability.
[0011] (3) Easy to integrate at the system level. It can be directly integrated into the drawLayers() rendering process of Android RenderEngine without modifying the application layer logic, which is stable and efficient. Attached Figure Description
[0012] Figure 1 This is a flowchart illustrating the steps of a layer filtering method for enhancing display in an Android system, according to an embodiment of the present invention. Detailed Implementation
[0013] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0014] See Figure 1 The diagram shows a flowchart of a layer filtering method for enhanced display in an Android system according to an embodiment of the present invention. Applied to the `drawLayers()` rendering process of `RenderEngine`, it includes the following steps: S10, each time the drawlayer function is called, the display enhancement rendering flag is reset to false; if there are multiple display enhancements to be processed, the display enhancement rendering flag of each pending display enhancement is reset to false. S20, each time the drawlayer function renders the layers to be drawn in the Z-axis order. For each layer, the following processing is performed: layer filtering conditions are judged. When the system is ready to draw a layer, the filtering conditions are checked in turn. When all filtering conditions are met, the layer is marked as a candidate layer for display enhancement and enters the layer processing; otherwise, the enhancement processing is skipped and the original process is used for rendering.
[0015] The `drawLayers()` function in `RenderEngine` is a core function in the Android system's display subsystem (SurfaceFlinger), primarily used in the GPU Composition stage. When the hardware compositor (HWC) cannot handle all layers (e.g., due to an excessive number of layers, the use of blending modes or transformations not supported by HWC), SurfaceFlinger will delegate these layers to the GPU for software compositing, and `drawLayers()` is the key entry point for executing this rendering process.
[0016] Furthermore, in a specific application example, the filtering conditions in S20 include: determining whether the pixel data format of the layer is a format with an alpha channel and whether the global alpha blending value is greater than 0; determining whether texture filtering is enabled for the layer; and determining whether the name or associated identifier of the layer contains a specific key string.
[0017] Specifically, a global alpha blending value greater than 0 (i.e., the layer is not completely transparent), that is, format == RGBA && alpha > 0. The alpha channel is an additional data channel in computer graphics used to control the transparency or opacity of an image. In the common RGBA color model: R (Red) represents the red channel, G (Green) represents the green channel, B (Blue) represents the blue channel, and A (Alpha) represents the alpha channel.
[0018] To determine whether texture filtering is enabled for a layer, use the condition `useTextureFiltering == true`. This usually indicates that the layer contains image content that needs to be smoothly scaled and is suitable for enhancement processing.
[0019] Check if the layer's name or associated identifier contains a string representing the video playback layer name, such as "SurfaceView[" and "(BLAST)#". Most existing video player layer names contain such identifiers.
[0020] In another specific application example, marking the layer as a candidate layer for display enhancement and entering the layer processing includes: when the Alpha type is kOpaque_SkAlphaType, directly entering the display enhancement rendering logic; after the display enhancement rendering is successful, setting the rendering flag corresponding to the layer to true.
[0021] When the Alpha type is not kOpaque_SkAlphaType, it checks whether the rendering flag corresponding to the layer is true. If true, the display enhancement processing is skipped, and the subsequent compositing process is directly entered. If false, the display enhancement rendering logic is entered, and the rendering flag is updated to true after successful rendering. The aforementioned display enhancement logic may include color enhancement implemented using OpenGL or Skiashader in existing technologies, or it may include operations such as super-resolution processing.
[0022] `kOpaque_SkAlphaType` is an enumeration value defined in the Skia graphics library (the underlying drawing engine of the Android system, also used by Chrome, Flutter, etc.) to describe the alpha type of a bitmap or canvas. `kOpaque_SkAlphaType` indicates that the image data is completely opaque. The alpha value of each pixel in the image is considered to be 1.0 (or 255).
[0023] The layer filtering method for enhanced display in the Android system described above filters layers based on multiple conditions, including layer data format, transparency, whether texture filtering is enabled, and whether the layer name contains specific characters. This ensures accurate layer filtering, guaranteeing that display enhancement is only applied to video-related target layers. For candidate layers for display enhancement, further decisions are made based on alpha type and layer rendering flags. Layer rendering flag state management is implemented, resetting the rendering flags before each rendering. This control over rendering flags prevents the same layer from undergoing display enhancement multiple times. This reduces unnecessary GPU rendering operations, lowers system power consumption, and improves overall display stability.
[0024] It should be understood that the exemplary embodiments described herein are illustrative and not restrictive. Although one or more embodiments of the invention have been described in conjunction with the accompanying drawings, those skilled in the art will understand that various changes in form and detail may be made without departing from the spirit and scope of the invention as defined by the appended claims.
Claims
1. A layer filtering method for enhancing display in an Android system, characterized in that, The rendering process applied to the `drawLayers()` method of the `RenderEngine` includes the following steps: S10, each time the drawlayer function is called, the display enhancement rendering flag is reset to false; if there are multiple display enhancements to be processed, the display enhancement rendering flag of each pending display enhancement is reset to false. S20, each time the drawlayer function renders the layers to be drawn in the Z-axis order. For each layer, the following processing is performed: layer filtering conditions are judged. When the system is ready to draw a layer, the filtering conditions are checked in turn. When all filtering conditions are met, the layer is marked as a candidate layer for display enhancement and enters the layer processing; otherwise, the enhancement processing is skipped and the original process is used for rendering.
2. The layer filtering method for enhanced display in the Android system as described in claim 1, characterized in that, The filtering conditions in S20 include: Determine if the pixel data format of this layer is a format with an alpha channel and if the global alpha blending value is greater than 0; Determine whether texture filtering is enabled for this layer; Determine whether the name or associated identifier of the layer contains a string that represents the name of the video playback layer.
3. The layer filtering method for enhanced display in the Android system as described in claim 2, characterized in that, Marking the layer as a candidate layer for display enhancement and entering layer processing includes: when the Alpha type is kOpaque_SkAlphaType, directly enter the display enhancement rendering logic; after the display enhancement rendering is successful, set the rendering flag corresponding to the layer to true.
4. The layer filtering method for enhanced display in the Android system as described in claim 2, characterized in that, Marking the layer as a candidate layer for display enhancement and entering layer processing includes: when the Alpha type is not kOpaque_SkAlphaType, determining whether the rendering flag corresponding to the layer is true; if it is true, skipping the display enhancement processing and directly entering the subsequent compositing process; if it is false, entering the display enhancement rendering logic, and updating the rendering flag to true after successful rendering.