OSDev.org
https://forum.osdev.org/

Dirty areas in gui
https://forum.osdev.org/viewtopic.php?f=1&t=54640
Page 1 of 1

Author:  Kamal123 [ Sun Sep 26, 2021 12:19 pm ]
Post subject:  Dirty areas in gui

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!!...

Author:  mid [ Sun Sep 26, 2021 12:37 pm ]
Post subject:  Re: Dirty areas in gui

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.

Author:  Kamal123 [ Sun Sep 26, 2021 1:35 pm ]
Post subject:  Re: Dirty areas in gui

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?

Author:  mid [ Sun Sep 26, 2021 2:52 pm ]
Post subject:  Re: Dirty areas in gui

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.

Author:  Kamal123 [ Mon Sep 27, 2021 8:45 am ]
Post subject:  Re: Dirty areas in gui

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?

Author:  mid [ Tue Sep 28, 2021 12:08 pm ]
Post subject:  Re: Dirty areas in gui

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?

Author:  Kamal123 [ Tue Sep 28, 2021 1:08 pm ]
Post subject:  Re: Dirty areas in gui

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

Page 1 of 1 All times are UTC - 6 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/