sync with OpenBSD -current

This commit is contained in:
purplerain 2025-01-10 01:40:29 +00:00
parent 4b49aefbb1
commit 1fd36b57f8
Signed by: purplerain
GPG key ID: F42C07F07E2E35B7
945 changed files with 81965 additions and 59988 deletions

View file

@ -586,10 +586,10 @@ glamor_setup_formats(ScreenPtr screen)
if (glamor_priv->is_gles) {
assert(X_BYTE_ORDER == X_LITTLE_ENDIAN);
glamor_add_format(screen, 24, PICT_x8b8g8r8,
GL_RGBA8, GL_RGBA, GL_UNSIGNED_BYTE, TRUE);
glamor_add_format(screen, 32, PICT_a8b8g8r8,
GL_RGBA8, GL_RGBA, GL_UNSIGNED_BYTE, TRUE);
glamor_add_format(screen, 24, PICT_x8r8g8b8,
GL_BGRA, GL_BGRA, GL_UNSIGNED_BYTE, TRUE);
glamor_add_format(screen, 32, PICT_a8r8g8b8,
GL_BGRA, GL_BGRA, GL_UNSIGNED_BYTE, TRUE);
} else {
glamor_add_format(screen, 24, PICT_x8r8g8b8,
GL_RGBA, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV, TRUE);

View file

@ -101,7 +101,11 @@ glamor_poly_glyph_blt_gl(DrawablePtr drawable, GCPtr gc,
int pt_x_i = glyph_x + xx;
int pt_y_i = glyph_y + yy;
#if BITMAP_BIT_ORDER == MSBFirst
if (!(*glyph & (128 >> (xx & 7))))
#else
if (!(*glyph & (1 << (xx & 7))))
#endif
continue;
if (!RegionContainsPoint(clip, pt_x_i, pt_y_i, NULL))
@ -208,7 +212,11 @@ glamor_push_pixels_gl(GCPtr gc, PixmapPtr bitmap,
for (yy = 0; yy < h; yy++) {
uint8_t *bitmap_row = bitmap_data + yy * bitmap_stride;
for (xx = 0; xx < w; xx++) {
#if BITMAP_BIT_ORDER == MSBFirst
if (bitmap_row[xx / 8] & (128 >> xx % 8) &&
#else
if (bitmap_row[xx / 8] & (1 << xx % 8) &&
#endif
RegionContainsPoint(clip,
x + xx,
y + yy,

View file

@ -94,7 +94,7 @@ glamor_get_tex_format_type_from_pictformat(ScreenPtr pScreen,
*tex_format = GL_BGRA;
*tex_type = GL_UNSIGNED_INT_8_8_8_8;
} else {
*tex_format = GL_RGBA;
*tex_format = GL_BGRA;
*tex_type = GL_UNSIGNED_BYTE;
swizzle[0] = GL_GREEN;
@ -113,12 +113,9 @@ glamor_get_tex_format_type_from_pictformat(ScreenPtr pScreen,
*tex_format = GL_BGRA;
*tex_type = GL_UNSIGNED_INT_8_8_8_8_REV;
} else {
*tex_format = GL_RGBA;
*tex_format = GL_BGRA;
*tex_type = GL_UNSIGNED_BYTE;
swizzle[0] = GL_BLUE;
swizzle[2] = GL_RED;
if (!is_little_endian)
byte_swap_swizzle(swizzle);
break;

View file

@ -235,7 +235,11 @@ static const char fs_vars_text[] =
static const char fs_exec_text[] =
" ivec2 itile_texture = ivec2(glyph_pos);\n"
#if BITMAP_BIT_ORDER == MSBFirst
" uint x = uint(7) - uint(itile_texture.x & 7);\n"
#else
" uint x = uint(itile_texture.x & 7);\n"
#endif
" itile_texture.x >>= 3;\n"
" uint texel = texelFetch(font, itile_texture, 0).x;\n"
" uint bit = (texel >> x) & uint(1);\n"
@ -244,7 +248,11 @@ static const char fs_exec_text[] =
static const char fs_exec_te[] =
" ivec2 itile_texture = ivec2(glyph_pos);\n"
#if BITMAP_BIT_ORDER == MSBFirst
" uint x = uint(7) - uint(itile_texture.x & 7);\n"
#else
" uint x = uint(itile_texture.x & 7);\n"
#endif
" itile_texture.x >>= 3;\n"
" uint texel = texelFetch(font, itile_texture, 0).x;\n"
" uint bit = (texel >> x) & uint(1);\n"