[Wayland-bugs] [Bug 93094] Protocol: colored buffer
bugzilla-daemon at freedesktop.org
bugzilla-daemon at freedesktop.org
Sat Nov 28 11:01:33 PST 2015
https://bugs.freedesktop.org/show_bug.cgi?id=93094
--- Comment #6 from phizh <phizhed at gmail.com> ---
Perhaps, between us is another misunderstanding. When using wl_viewport and
wl_buffer 1x1 composer resizes to MxN. When live resizing is happening scale
and crop - fills pixels are already a compositor, not a client. And, as I
understand it, the compositor makes each time at the beginning of resizing
window. That's not what I want.
// get_colored_buffer(color, width, height, stride, format);
/*
Create a wl_buffer - cheap operation. The filling of the shared memory file -
expensive operation.
What does the composer when he is asked the colored buffer: if he has no shared
memory file with the required color, he creates it. If the file is empty, then
fills it to the necessary length ("stride * height"). If the file is not empty,
appends to the end of the required number of pixels ("stride * height -
shared_memory_file_length"). Then creates a wl_buffer, and gives it to the
client;
*/
So, now step by step:
1. "CLIENT_1" asks the compositor "get_colored_buffer(0xFF880000, 100, 100,
400, XRGB8888)";
2. Compositor creates a shared memory file "FILE_1" of length 40_000 and fills
it to the 40_000 red (because 0xFF880000) pixels in the pixel format XRGB8888.
Creates a wl_buffer from "FILE_1", and gives it wl_buffer to the "CLIENT_1";
3. "CLIENT_2" asks the compositor "get_colored_buffer(0xFF880000, 100, 100,
400, XRGB8888)";
4. The composer creates a wl_buffer from "FILE_1", and gives it wl_buffer to
the "CLIENT_2";
5. "CLIENT_1" asks the compositor "get_colored_buffer(0xFF880000, 200, 100,
800, XRGB8888)";
6. The compositor appends to a "FILE_1" 40_000 pixels. The length of the
"FILE_1" now is 80_000. Creates a wl_buffer from "FILE_1", and gives it
wl_buffer to the "CLIENT_1";
7. "CLIENT_1" asks the compositor "get_colored_buffer(0xFF880000, 10, 10, 40,
XRGB8888)";
8. The composer creates a wl_buffer from "FILE_1", and gives it wl_buffer to
the "CLIENT_1";
This leads to memory savings. Toolkit's in the future will be less CPU load
when resizing window, because they no longer have to manually fill color. Qt
application will use the same colored shared memory file, as GTK apps.
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/wayland-bugs/attachments/20151128/2b82d24e/attachment.html>
More information about the wayland-bugs
mailing list