Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

non composited screens without opengl use nasty rgb paint #3646

Closed
totaam opened this issue Oct 11, 2022 · 2 comments
Closed

non composited screens without opengl use nasty rgb paint #3646

totaam opened this issue Oct 11, 2022 · 2 comments
Labels
bug Something isn't working client encoding linux

Comments

@totaam
Copy link
Collaborator

totaam commented Oct 11, 2022

Reproduced with openbox as window manager, which doesn't support compositing and therefore no transparency. Since I run it in a VM, I don't have opengl acceleration either.
We end up calling paint_rgb24 and that fails to find a matching cairo format to use for the BGRX pixel data received:

compress:   0.1ms for    4x102  pixels at 1088,108  for wid=21    using     rgb24 with ratio  10.9%  (    1KB to     0KB), sequence   247, client_options={'rgb_format': 'BGRX', 'lz4': 3, 'encoder': 'argb'}, options={'quality': 97, 'speed': 19, 'rgb_formats': ('YUV420P', 'YUV422P', 'YUV444P', 'GBRP', 'BGRX', 'RGBX', 'RGB', 'BGR'), 'lz4': True, 'alpha': False, 'content-type': 'browser', 'window-size': (1094, 1075), 'cuda-device-context': None}
cairo_draw: backing=<cairo.ImageSurface object at 0x7fbd49b5cdb0>, size=(249, 48), render-size=(249, 48), offsets=(0, 0, 0, 0), pointer_overlay=None
cairo._do_paint_rgb(RGB24, True, 47808 <class 'memoryview'>, 0, 0, 249, 48, 249, 48, 996, typedict({'rgb_format': 'BGRA', 'quality': 100, 'has_alpha': True, 'encoder': 'webp', 'encoding': 'webp'})) set_image_surface_data=<built-in function set_image_surface_data>, use pixbuf=False
cannot set image surface data for cairo format 1 and rgb_format BGRA (rgb formats supported: ('RGB', 'RGBX', 'BGR', 'BGRX'))
nasty_rgb_via_png_paint(cairo.Format.RGB24, True, 47808, 0, 0, 249, 48, 996, 'BGRA')

Also, the window 0x18 changed its transparency attribute is Firefox creating a transparent overlay window. Not sure what to do about this one.

@totaam totaam added bug Something isn't working client linux labels Oct 11, 2022
@totaam
Copy link
Collaborator Author

totaam commented Oct 12, 2022

Very easily reproducible by running the client with 544dee1 or later:

xpra start :10 --start="xpra example transparent-window"
xpra attach :10 --env=XPRA_ALPHA=0 --no-mmap --opengl=no

The server ends up using webp in BGRA mode:

compress:   2.4ms for  320x320  pixels at    0,0    for wid=1     using      webp with ratio   0.7%  \
    (  400KB to     2KB), sequence     5, \
    client_options={'rgb_format': 'BGRA', 'quality': 100, 'has_alpha': True, 'encoder': 'webp'}, \
    options={'quality': 100, 'speed': 80, 'rgb_formats': ('BGRX', 'RGBX', 'BGR', 'RGB', 'r210', 'BGR565'), \
    'lz4': True, 'alpha': False, 'window-size': (320, 320), 'cuda-device-context': None}
nasty_rgb_via_png_paint(cairo.Format.RGB24, True, 409600, 0, 0, 320, 320, 1280, 'BGRA')

totaam added a commit that referenced this issue Oct 12, 2022
when the screen does not support transparency,
so that we don't end up sending an unused channel and the client can paint the screen without needing to filter out that data
@totaam
Copy link
Collaborator Author

totaam commented Oct 12, 2022

The commit above fixes the problem, but also uncovers another one: #3648

@totaam totaam closed this as completed Oct 12, 2022
totaam added a commit that referenced this issue Oct 13, 2022
when the screen does not support transparency,
so that we don't end up sending an unused channel and the client can paint the screen without needing to filter out that data
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working client encoding linux
Projects
None yet
Development

No branches or pull requests

1 participant