mesa: revamp glBlendFunc loopback
authorBrian Paul <brian.paul@tungstengraphics.com>
Fri, 20 Jun 2008 17:05:00 +0000 (11:05 -0600)
committerBrian Paul <brian.paul@tungstengraphics.com>
Fri, 20 Jun 2008 17:05:00 +0000 (11:05 -0600)
src/mesa/main/blend.c
src/mesa/main/dlist.c

index 742247f8e2115270f748c39e7932b717fe9c65d1..4d4a8971419b480e2f584d7b7edd85d5fb1d99ef 100644 (file)
  * \param dfactor destination factor operator.
  *
  * \sa glBlendFunc, glBlendFuncSeparateEXT
- *
- * Swizzles the inputs and calls \c glBlendFuncSeparateEXT.  This is done
- * using the \c CurrentDispatch table in the context, so this same function
- * can be used while compiling display lists.  Therefore, there is no need
- * for the display list code to save and restore this function.
  */
 void GLAPIENTRY
 _mesa_BlendFunc( GLenum sfactor, GLenum dfactor )
 {
-   GET_CURRENT_CONTEXT(ctx);
-
-   (*ctx->CurrentDispatch->BlendFuncSeparateEXT)( sfactor, dfactor,
-                                                 sfactor, dfactor );
+   _mesa_BlendFuncSeparateEXT(sfactor, dfactor, sfactor, dfactor);
 }
 
 
index 07d279da301cd870479b9b4ba0b511a58bc068f9..c672c0f8b8bf6356e3a266fb14d092723f3dad1a 100644 (file)
@@ -925,6 +925,13 @@ save_BlendFuncSeparateEXT(GLenum sfactorRGB, GLenum dfactorRGB,
 }
 
 
+static void GLAPIENTRY
+save_BlendFunc(GLenum srcfactor, GLenum dstfactor)
+{
+   save_BlendFuncSeparate(srcfactor, dstfactor, srcfactor, dstfactor);
+}
+
+
 static void GLAPIENTRY
 save_BlendColor(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha)
 {
@@ -7602,7 +7609,7 @@ _mesa_init_dlist_table(struct _glapi_table *table)
    SET_Accum(table, save_Accum);
    SET_AlphaFunc(table, save_AlphaFunc);
    SET_Bitmap(table, save_Bitmap);
-   SET_BlendFunc(table, _mesa_BlendFunc);       /* loops-back to BlendFuncSeparate */
+   SET_BlendFunc(table, _save_BlendFunc);
    SET_CallList(table, _mesa_save_CallList);
    SET_CallLists(table, _mesa_save_CallLists);
    SET_Clear(table, save_Clear);