This is patch [#6772] Background image drawing speedup

Thanks goto Matthew Plough (meestaplu)

I've tested it on linux with both an nvidia and an ATI card,
I've also tested it on a mac and solaris, as well as through a
remote display.  So I think this one is pretty safe.  
If it causes problems on older systems we can revert it
but I don't think we will have any issues with it.

Kent
This commit is contained in:
Kent Mein 2007-09-13 14:33:21 +00:00
parent b034822664
commit 56dba39261
2 changed files with 6 additions and 2 deletions

@ -1869,6 +1869,7 @@ static void node_draw_preview(bNodePreview *preview, rctf *prv)
glEnable(GL_BLEND);
glBlendFunc( GL_ONE, GL_ONE_MINUS_SRC_ALPHA ); /* premul graphics */
glColor4f(1.0, 1.0, 1.0, 1.0);
glaDrawPixelsTex(prv->xmin, prv->ymin, preview->xsize, preview->ysize, GL_FLOAT, preview->rect);
glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA );

@ -436,10 +436,13 @@ static void draw_bgpic(void)
glPushMatrix();
glaDefine2DArea(&curarea->winrct);
glEnable(GL_BLEND);
glPixelTransferf(GL_ALPHA_SCALE, (1.0f-bgpic->blend));
glPixelZoom(zoomx, zoomy);
glaDrawPixelsSafe(x1, y1, ibuf->x, ibuf->y, ibuf->x, GL_RGBA, GL_UNSIGNED_BYTE, ibuf->rect);
glColor4f(1.0, 1.0, 1.0, 1.0-bgpic->blend);
glaDrawPixelsTex(x1, y1, ibuf->x, ibuf->y, GL_UNSIGNED_BYTE, ibuf->rect);
glPixelZoom(1.0, 1.0);
glPixelTransferf(GL_ALPHA_SCALE, 1.0f);