[Scummvm-devel] blendPixelPtr()

Marcus Comstedt marcus at mc.pp.se
Fri Jan 10 17:32:45 CET 2014


Willem Jan Palenstijn <wjp at usecode.org> writes:

> Specifically, the commit you mentioned was intended to fix this bug:
> http://i.imgur.com/AUxjJ.jpg 

Ok, found the bug.  The AA code seems to be working fine, the problem
is just that the Android backend is using the wrong blend mode for the
overlay.  Since the overlay is specified to use pre-multiplied alpha,
the blend mode needs to be

  glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA)

not

  glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA)

By fixing this the rounded corners appear correct.

Although I must confess I'm slightly puzzled by this result; even
thought the blend function was wrong, I would have expected the
resulting overlay pixels to have alpha=1.0, in which case there should
be no difference between the two blend functions (becase SRC_ALPHA ==
ONE).  Isn't the background gradient fully opaque?


  // Marcus






More information about the Scummvm-devel mailing list