xlib: option to enable/test meta functions (disabled)
authorBrian Paul <brianp@vmware.com>
Tue, 1 Sep 2009 01:29:24 +0000 (19:29 -0600)
committerBrian Paul <brianp@vmware.com>
Tue, 1 Sep 2009 01:34:47 +0000 (19:34 -0600)
src/mesa/drivers/x11/xm_api.c
src/mesa/drivers/x11/xm_dd.c
src/mesa/drivers/x11/xmesaP.h

index 6ae5b6fd5800f3402c051a82487e7025ca9d11d2..1eb31b9d4c0ae989326fc278fd47b68519d96fe6 100644 (file)
@@ -79,6 +79,7 @@
 #include "tnl/t_context.h"
 #include "tnl/t_pipeline.h"
 #include "drivers/common/driverfuncs.h"
+#include "drivers/common/meta.h"
 
 /**
  * Global X driver lock
@@ -1641,6 +1642,9 @@ XMesaContext XMesaCreateContext( XMesaVisual v, XMesaContext share_list )
    xmesa_register_swrast_functions( mesaCtx );
    _swsetup_Wakeup(mesaCtx);
 
+   if (TEST_META_FUNCS)
+      _mesa_meta_init(mesaCtx);
+
    return c;
 }
 
@@ -1655,6 +1659,9 @@ void XMesaDestroyContext( XMesaContext c )
    FXdestroyContext( XMESA_BUFFER(mesaCtx->DrawBuffer) );
 #endif
 
+   if (TEST_META_FUNCS)
+      _mesa_meta_free( mesaCtx );
+
    _swsetup_DestroyContext( mesaCtx );
    _swrast_DestroyContext( mesaCtx );
    _tnl_DestroyContext( mesaCtx );
index 9a01465bdf9420b88cf2c2a306feb01f260bc3cc..7ee88e8058b7fdf1bf5f01eaf0b623ac6d435773 100644 (file)
@@ -51,6 +51,7 @@
 #include "swrast_setup/swrast_setup.h"
 #include "tnl/tnl.h"
 #include "tnl/t_context.h"
+#include "drivers/common/meta.h"
 #include "xmesaP.h"
 
 
@@ -1147,13 +1148,19 @@ xmesa_init_driver_functions( XMesaVisual xmvisual,
    driver->IndexMask = index_mask;
    driver->ColorMask = color_mask;
    driver->Enable = enable;
-   driver->Clear = clear_buffers;
+   if (TEST_META_FUNCS)
+      driver->Clear = _mesa_meta_clear;
+   else
+      driver->Clear = clear_buffers;
    driver->Viewport = xmesa_viewport;
 #ifndef XFree86Server
    driver->CopyPixels = xmesa_CopyPixels;
-   if (xmvisual->undithered_pf == PF_8R8G8B &&
-       xmvisual->dithered_pf == PF_8R8G8B &&
-       xmvisual->BitsPerPixel == 32) {
+   if (TEST_META_FUNCS) {
+      driver->DrawPixels = _mesa_meta_draw_pixels;
+   }
+   else if (xmvisual->undithered_pf == PF_8R8G8B &&
+            xmvisual->dithered_pf == PF_8R8G8B &&
+            xmvisual->BitsPerPixel == 32) {
       driver->DrawPixels = xmesa_DrawPixels_8R8G8B;
    }
    else if (xmvisual->undithered_pf == PF_5R6G5B) {
index 65e747d7b9d18ef0b04edaf4346a788fc7e99e12..25db55862e6a5b6487630b2dce0bf2abe1601cce 100644 (file)
@@ -581,4 +581,8 @@ extern void xmesa_register_swrast_functions( GLcontext *ctx );
 #define ENABLE_EXT_timer_query 0 /* may not have 64-bit GLuint64EXT */
 #endif
 
+
+#define TEST_META_FUNCS 0
+
+
 #endif