简体   繁体   中英

why google android do costly alpha blending?

In android the when alpha blending is used on a view the view is rendered into an opengl texture then the texture is rendered on the frame-buffer with the alpha value...I was wondering why they do that, isn't less costly to just render the view into the target buffer directly with the alpha value??? or is there something I am missing here?

You're missing that something has to do the blending to get the final colour, for this there are 3 options:

  1. Use the GPU to blend with the framebuffer.
  2. Blend to the framebuffer in hardware.
  3. Use image composing/processing hardware to blend.

If you're wondering why the framebuffer isn't directly accessed, the reason for rendering to the texture is to do with destination alpha, that is the alpha value that will be stored in the texture. This will exist in case there is something beneath the transparent parts of the View. The optimization you suggest could only be used if the View is guaranteed to be opaque.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM