diff options
author | Ton Roosendaal <ton@blender.org> | 2006-07-20 15:01:49 +0400 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2006-07-20 15:01:49 +0400 |
commit | cebb1f94654d73140c8dae7e3701217ca4896e43 (patch) | |
tree | 05de74b6c7c4c4be13324199f28c14f9f6c406f0 | |
parent | 0128c401b9d765ac83dc243f83039a488d3505c7 (diff) |
Bugfix #4734
code provided by Stephane Soppera: ImageWindow and Node previews now draw
in correct premul-alpha, eliminating bad black lines in alpha areas.
-rw-r--r-- | source/blender/src/drawimage.c | 1 | ||||
-rw-r--r-- | source/blender/src/drawnode.c | 2 |
2 files changed, 3 insertions, 0 deletions
diff --git a/source/blender/src/drawimage.c b/source/blender/src/drawimage.c index 6b1a23c2040..5486c093bcf 100644 --- a/source/blender/src/drawimage.c +++ b/source/blender/src/drawimage.c @@ -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. diff --git a/source/blender/src/drawnode.c b/source/blender/src/drawnode.c index a0da2d41ba4..dc0285e6934 100644 --- a/source/blender/src/drawnode.c +++ b/source/blender/src/drawnode.c @@ -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); |