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

  • From: John Scipione <jscipione@xxxxxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Sat, 21 Apr 2012 18:44:55 -0400

> On Fri, Apr 20, 2012 at 11:10 AM, Stephan Aßmus <superstippi@xxxxxx> wrote:
> > On 20.04.2012 09:36, John Scipione wrote:
> > The main problem seems to be in BControlLook. The button corner can
> > optionally use alpha transparency. There are two problems. One is that it
> > can't detect when to use alpha transparency, since the conditions are not
> > met by the view attached to the bitmap (parent view does not draw over it).
> > This can be fixed by requesting alpha transparency in the frame rendering
> > with a new flag in the flags field.
> > I don't know what I was thinking... But then you hit the second problem. For
> > rendering into a fully transparent bitmap, you need a different kind of
> > alpha blending. You need "compositing", while when you draw onto an opaque
> > surface such as the screen, you need "overlay" alpha mode. Overlay is
> > faster, since it does not compute the target pixel alpha, since the target
> > pixel is already assumed to be fully opaque. This problem can of course be
> > fixed with two different flags for requesting alpha blended frames.
>
> > Once you did that, you need to update the code that you just posted, to draw
> > the bitmap with overlay alpha mode or B_OP_OVER will work as well. Default
> > for BViews is B_OP_COPY, which ignores the alpha channel in bitmaps.


I set the buttonView to use B_OP_OVER and then altered ControlLook to
use either B_OP_OVER or B_OP_ALPHA with every combination of
B_CONSTANT_ALPHA/B_PIXEL_ALPHA and B_ALPHA_OVERLAY/B_ALPHA_COMPOSITE
and still am not getting it to look right. Although, I am getting
closer I think:

http://imagebin.org/209136

Here it looks like the rounded corners are now getting drawn correctly
(in B_OP_ALPHA mode) but the edge and frame colors not. So, I just
have to figure out what I'm doing differently for the edge and frame
compared to the corners.

John Scipione

Other related posts: