Skip to content

glamor: replace rendering_supported with rendering levels

Konstantin requested to merge rilian-la-te/xserver:glamor-fix-red into master

For now, we can use a Glamor pixmap with 3 different paths:

  1. As CPU-bound pixmap, when pixmap lives entirely on CPU and working via fallback paths (1-bit pixmaps, or small enough glyph pictures)
  2. As texture-only source, which is uploaded via glTexImage2D, and next processed via shader to render target with different format. This is all mask textures, CBCR format textures and all textures which created with GLAMOR_CREATE_FBO_NO_FBO.
  3. As destinations, which will end up read via glReadPixels after all.

So, reflect this levels in rendering_supported value, which is changed from boolean to enum.

Also, rewrite checking to always add a format with appropriate level inside formats array, because if we will not do this, we can end with "funny" things like glamor_get_rgba_from_pixel will return FALSE with valid X format.

Also it fixes all 8-bit formats for GLES2.

Fixes #1362 (closed) Fixes #1411 (closed)

This is an alternative to !1158 (merged).

CC: @anholt

Edited by Konstantin

Merge request reports