Page 1 of 1
Dirty areas in gui
Posted: Sun Sep 26, 2021 12:19 pm
by Kamal123
Hi, In compositing window manager, how clients tells the window manager for each dirty areas to repaint? Does it sends a list of rectangles to server? Or server detects dirty areas by pixel comparison of previous rendered image and currently rendering image?
How do live games updates each dirty areas? If clients sends dirty list every time, then server side will become slow!!...
Re: Dirty areas in gui
Posted: Sun Sep 26, 2021 12:37 pm
by mid
In my design, clients only handle the main content and respond to events, analogous to HTML & JavaScript in a web page. The server is what handles all of the drawing and layouting. In the case clients absolutely need to draw manually, they send drawing commands to the server or, in the worst case, send one "update entire window" command when needed.
Kamal123 wrote:If clients sends dirty list every time, then server side will become slow!!...
Usually games redraw the entire screen each frame anyway (and they
must if using perspective 3D) so this is only a problem if you're considering very old hardware. EDIT: Or huge framebuffers.
Re: Dirty areas in gui
Posted: Sun Sep 26, 2021 1:35 pm
by Kamal123
mid wrote:In my design, clients only handle the main content and respond to events, analogous to HTML & JavaScript in a web page. The server is what handles all of the drawing and layouting. In the case clients absolutely need to draw manually, they send drawing commands to the server or, in the worst case, send one "update entire window" command when needed.
Kamal123 wrote:If clients sends dirty list every time, then server side will become slow!!...
Usually games redraw the entire screen each frame anyway (and they
must if using perspective 3D) so this is only a problem if you're considering very old hardware.
Thanks for your reply, what happens if two or more clients are sending dirty area update message to the server at same time? Server can't handle two messages at same time. How do you solve that problem?
Re: Dirty areas in gui
Posted: Sun Sep 26, 2021 2:52 pm
by mid
Kamal123 wrote:Thanks for your reply, what happens if two or more clients are sending dirty area update message to the server at same time? Server can't handle two messages at same time. How do you solve that problem?
Well, the simple answer is that it can't be at the same time. Either you use a synchronous model where the first task to run will send the message first, and thus interrupt the server first, or you use an asynchronous model where the server will have to process the messages serially.
Re: Dirty areas in gui
Posted: Mon Sep 27, 2021 8:45 am
by Kamal123
mid wrote:Kamal123 wrote:Thanks for your reply, what happens if two or more clients are sending dirty area update message to the server at same time? Server can't handle two messages at same time. How do you solve that problem?
Well, the simple answer is that it can't be at the same time. Either you use a synchronous model where the first task to run will send the message first, and thus interrupt the server first, or you use an asynchronous model where the server will have to process the messages serially.
Hi, thank you, I have implemented a model in which some clients tell the server to draw the window in every frames and second model is that some window which don't require live updates will send dirty rectangles to the server, for specific areas to be updated. Suppose I have a 2d game running, which requires live updates, then it will tell the server to set the live update bit and render the window in every frames, for which my mouse cursor movement become slow. How do you fix mouse movement speed, even when the whole screen is updating? I use dirty areas for mouse movement, like old position gets repainted. How do you make mouse movements smooth , while whole screen is updating?
Re: Dirty areas in gui
Posted: Tue Sep 28, 2021 12:08 pm
by mid
Kamal123 wrote:Hi, thank you, I have implemented a model in which some clients tell the server to draw the window in every frames and second model is that some window which don't require live updates will send dirty rectangles to the server, for specific areas to be updated. Suppose I have a 2d game running, which requires live updates, then it will tell the server to set the live update bit and render the window in every frames, for which my mouse cursor movement become slow. How do you fix mouse movement speed, even when the whole screen is updating? I use dirty areas for mouse movement, like old position gets repainted. How do you make mouse movements smooth , while whole screen is updating?
I can't really help you here, since we're delving into implementation details. Does it (the mouse) become slow overall or only when in front of the game?
Re: Dirty areas in gui
Posted: Tue Sep 28, 2021 1:08 pm
by Kamal123
mid wrote:Kamal123 wrote:Hi, thank you, I have implemented a model in which some clients tell the server to draw the window in every frames and second model is that some window which don't require live updates will send dirty rectangles to the server, for specific areas to be updated. Suppose I have a 2d game running, which requires live updates, then it will tell the server to set the live update bit and render the window in every frames, for which my mouse cursor movement become slow. How do you fix mouse movement speed, even when the whole screen is updating? I use dirty areas for mouse movement, like old position gets repainted. How do you make mouse movements smooth , while whole screen is updating?
I can't really help you here, since we're delving into implementation details. Does it (the mouse) become slow overall or only when in front of the game?
Only in front of games where screen update is occurring at every frame. But for normal windows, movement of cursor is smooth. I use ps/2 mouse