[haiku-commits] Re: haiku: hrev44039 - src/kits/interface headers/os/interface src/preferences/keymap

  • From: "Adrien Destugues" <pulkomandy@xxxxxxxxxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Thu, 19 Apr 2012 19:11:29 +0200

Le Thu, 19 Apr 2012 19:06:05 +0200, John Scipione <jscipione@xxxxxxxxx> a écrit:

About the tearing issues with the corners, I floored all the
dimensions in Deskcalc and that didn't seem to help, so much for the
theory that there is a bug in app server related to this. Also, I
created an "optimized" version of drawing the buttons with rounded
corners using FillRoundRect() specifying a gradient (since
StrokeRoundRect() can't take a gradient parameter) and this makes the
tearing happen over the entire surface of the button instead of just
the corners. The buttons flash at you when resizing. So, this didn't
have the optimization effect I was looking for either.
Back to the drawing board I guess.
I am still not convinced that the drawing time is the issue though
because like I said, you don't see the same effect in Keymap. There
may be a problem with the way I'm doing clipping. I could really use
some help here.

In keymap, you have no way to resize the buttons.
When resizing deskcalc, you have to invalidate all the buttons at once and redraw them all. Of course, this is an expansive operation.

To avoid the tearing and flickering, the solution is to draw to a BBitmap, then copy the finished result to the actual BView. The tearing happens because you are drawing a complex object with several layers, and you can see the drawing as it goes. Using fillroundrect will make things even worse, because it draws over the whole button.


Other related posts: