forked from bartvdbraak/blender
Bugfix #4734
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:
parent
0128c401b9
commit
cebb1f9465
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user