code provided by Stephane Soppera: ImageWindow and Node previews now draw
in correct premul-alpha, eliminating bad black lines in alpha areas.
This commit is contained in:
Ton Roosendaal 2006-07-20 11:01:49 +00:00
parent 0128c401b9
commit cebb1f9465
2 changed files with 3 additions and 0 deletions

@ -1591,6 +1591,7 @@ void drawimagespace(ScrArea *sa, void *spacedata)
if(sima->flag & SI_USE_ALPHA) {
sima_draw_alpha_backdrop(sima, x1, y1, (float)ibuf->x, (float)ibuf->y);
glEnable(GL_BLEND);
glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
}
/* detect if we need to redo the curve map.

@ -1220,9 +1220,11 @@ static void node_draw_preview(bNodePreview *preview, rctf *prv)
glPixelZoom(scale, scale);
glEnable(GL_BLEND);
glBlendFunc( GL_ONE, GL_ONE_MINUS_SRC_ALPHA ); /* premul graphics */
glaDrawPixelsTex(prv->xmin, prv->ymin, preview->xsize, preview->ysize, GL_FLOAT, preview->rect);
glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA );
glDisable(GL_BLEND);
glPixelZoom(1.0f, 1.0f);