diff options
author | Matthieu Herrb <matthieu@cvs.openbsd.org> | 2021-11-11 09:03:17 +0000 |
---|---|---|
committer | Matthieu Herrb <matthieu@cvs.openbsd.org> | 2021-11-11 09:03:17 +0000 |
commit | 79250ad1e2b76f2ba5aa8d6dc0134c6c07ceac3a (patch) | |
tree | 6d31264b9d5ca7fc0d7c690ef6a3340917c949e4 /xserver/glamor/glamor_render.c | |
parent | 0c0a487400d29e7404b66758c41ad54ee01d46ee (diff) |
Update to xserver 21.1.0
Diffstat (limited to 'xserver/glamor/glamor_render.c')
-rw-r--r-- | xserver/glamor/glamor_render.c | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/xserver/glamor/glamor_render.c b/xserver/glamor/glamor_render.c index d5737018f..2af65bf93 100644 --- a/xserver/glamor/glamor_render.c +++ b/xserver/glamor/glamor_render.c @@ -529,7 +529,7 @@ glamor_set_composite_texture(glamor_screen_private *glamor_priv, int unit, * sometimes get zero bits in the R channel, which is harmless. */ glamor_bind_texture(glamor_priv, GL_TEXTURE0 + unit, fbo, - glamor_fbo_red_is_alpha(glamor_priv, dest_priv->fbo)); + dest_priv->fbo->is_red); repeat_type = picture->repeatType; switch (picture->repeatType) { case RepeatNone: @@ -772,23 +772,31 @@ static Bool glamor_render_format_is_supported(PicturePtr picture) { PictFormatShort storage_format; + glamor_screen_private *glamor_priv; + struct glamor_format *f; /* Source-only pictures should always work */ if (!picture->pDrawable) return TRUE; - storage_format = format_for_depth(picture->pDrawable->depth); + glamor_priv = glamor_get_screen_private(picture->pDrawable->pScreen); + f = &glamor_priv->formats[picture->pDrawable->depth]; + + if (!f->rendering_supported) + return FALSE; + + storage_format = f->render_format; switch (picture->format) { - case PICT_x2r10g10b10: + case PICT_a2r10g10b10: return storage_format == PICT_x2r10g10b10; case PICT_a8r8g8b8: case PICT_x8r8g8b8: return storage_format == PICT_a8r8g8b8 || storage_format == PICT_x8r8g8b8; - case PICT_a8: - return storage_format == PICT_a8; + case PICT_a1r5g5b5: + return storage_format == PICT_x1r5g5b5; default: - return FALSE; + return picture->format == storage_format; } } @@ -898,7 +906,7 @@ glamor_composite_choose_shader(CARD8 op, } if (dest_pixmap->drawable.bitsPerPixel <= 8 && - glamor_priv->one_channel_format == GL_RED) { + glamor_priv->formats[8].format == GL_RED) { key.dest_swizzle = SHADER_DEST_SWIZZLE_ALPHA_TO_RED; } else { key.dest_swizzle = SHADER_DEST_SWIZZLE_DEFAULT; @@ -1091,7 +1099,7 @@ glamor_composite_set_shader_blend(glamor_screen_private *glamor_priv, } } - if (glamor_priv->gl_flavor != GLAMOR_GL_ES2) + if (!glamor_priv->is_gles) glDisable(GL_COLOR_LOGIC_OP); if (op_info->source_blend == GL_ONE && op_info->dest_blend == GL_ZERO) { |