Properly support the opaque flag in Skia RenderEngine
When the opaque flag is present, the alpha channel from the image is not used for compositing. But, a layer-wide alpha bit can still be used for blending, which means the src blending mode can't be used. Other solutions like lying about the pixel format don't map cleanly to formats other than RGBA8888 as well. So, we apply a color filter that is adding a solid black with the input image, which on the vast majority of formats floods the alpha channel to 1.0 as desired. The one exception may be FP16 since color values are allowed to be beyond 1.0, but we don't support FP16 destination buffers anyways. Bug: 173419151 Test: SurfaceFlinger_test:LayerTypeAndRenderTypeTransactionTests/LayerTypeAndRenderTypeTransactionTest#SetFlagsOpaque Change-Id: Iec26706bc304df97b55eb2900bbacf13865708ea
Loading
Please register or sign in to comment