st/mesa: Make st_cb_{bitmap,drawpixels}.h FEATURE_drawpix aware.
authorChia-I Wu <olv@lunarg.com>
Wed, 31 Mar 2010 03:54:20 +0000 (11:54 +0800)
committerChia-I Wu <olv@lunarg.com>
Wed, 12 May 2010 04:12:57 +0000 (12:12 +0800)
This change allows st_cb_{bitmap,drawpixels}.h to be used without
knowing if FEATURE_drawpix is enabled.

src/mesa/state_tracker/st_cb_bitmap.c
src/mesa/state_tracker/st_cb_bitmap.h
src/mesa/state_tracker/st_cb_drawpixels.c
src/mesa/state_tracker/st_cb_drawpixels.h
src/mesa/state_tracker/st_context.c
src/mesa/state_tracker/st_draw_feedback.c

index 6aefa7b7dfeb98b4b06b89870eeafc11b967d624..3e3076f721977ead0b3ae47e97bc63ffaa37d750 100644 (file)
@@ -53,6 +53,7 @@
 #include "cso_cache/cso_context.h"
 
 
+#if FEATURE_drawpix
 
 /**
  * glBitmaps are drawn as textured quads.  The user's bitmap pattern
@@ -859,3 +860,5 @@ st_destroy_bitmap(struct st_context *st)
       st->bitmap.cache = NULL;
    }
 }
+
+#endif /* FEATURE_drawpix */
index 81cf61981dc394fa5197745bbe3020fd0a0a29ca..8af975b74fce7a81c33fa9d88f03b12339c57d5e 100644 (file)
 #define ST_CB_BITMAP_H
 
 
+#include "main/mtypes.h"
+
+#if FEATURE_drawpix
+
 extern void
 st_init_bitmap_functions(struct dd_function_table *functions);
 
@@ -48,5 +52,33 @@ st_flush_bitmap_cache(struct st_context *st);
 extern void
 st_flush_bitmap(struct st_context *st);
 
+#else
+
+static INLINE void
+st_init_bitmap_functions(struct dd_function_table *functions)
+{
+}
+
+static INLINE void
+st_init_bitmap(struct st_context *st)
+{
+}
+
+static INLINE void
+st_destroy_bitmap(struct st_context *st)
+{
+}
+
+static INLINE void
+st_flush_bitmap_cache(struct st_context *st)
+{
+}
+
+static INLINE void
+st_flush_bitmap(struct st_context *st)
+{
+}
+
+#endif /* FEATURE_drawpix */
 
 #endif /* ST_CB_BITMAP_H */
index d8c2fb7ffba656c3bb6573602ba39b3f69d87a0f..932e8edb2504a855ebfe47e97e84b247ee453468 100644 (file)
@@ -62,6 +62,8 @@
 #include "cso_cache/cso_context.h"
 
 
+#if FEATURE_drawpix
+
 /**
  * Check if the given program is:
  * 0: MOVE result.color, fragment.color;
@@ -1144,3 +1146,5 @@ st_destroy_drawpix(struct st_context *st)
    if (st->drawpix.vert_shaders[1])
       ureg_free_tokens(st->drawpix.vert_shaders[1]);
 }
+
+#endif /* FEATURE_drawpix */
index 26fe864d185599590ff289991fe49fef7b035ca6..7d5e901ccc514a921310b55ccf4f5c98f89f1b0b 100644 (file)
 #define ST_CB_DRAWPIXELS_H
 
 
+#include "main/mtypes.h"
+
+#if FEATURE_drawpix
+
 extern void st_init_drawpixels_functions(struct dd_function_table *functions);
 
 extern void
 st_destroy_drawpix(struct st_context *st);
 
+#else
+
+static INLINE void
+st_init_drawpixels_functions(struct dd_function_table *functions)
+{
+}
+
+static INLINE void
+st_destroy_drawpix(struct st_context *st)
+{
+}
+
+#endif /* FEATURE_drawpix */
 
 #endif /* ST_CB_DRAWPIXELS_H */
index 24360fa8bc7a03c7a52a9d815dbc2f9871231116..bab54811b4e0663cb349d6c4acabd55f08c53174 100644 (file)
 #include "st_cb_bufferobjects.h"
 #include "st_cb_clear.h"
 #include "st_cb_condrender.h"
-#if FEATURE_drawpix
 #include "st_cb_drawpixels.h"
 #include "st_cb_rasterpos.h"
-#endif
 #if FEATURE_OES_draw_texture
 #include "st_cb_drawtex.h"
 #endif
@@ -130,7 +128,7 @@ st_create_context_priv( GLcontext *ctx, struct pipe_context *pipe )
    /* state tracker needs the VBO module */
    _vbo_CreateContext(ctx);
 
-#if FEATURE_feedback || FEATURE_drawpix
+#if FEATURE_feedback || FEATURE_rastpos
    st->draw = draw_create(pipe); /* for selection/feedback */
 
    /* Disable draw options that might convert points/lines to tris, etc.
@@ -226,7 +224,7 @@ static void st_destroy_context_priv( struct st_context *st )
 {
    uint i;
 
-#if FEATURE_feedback || FEATURE_drawpix
+#if FEATURE_feedback || FEATURE_rastpos
    draw_destroy(st->draw);
 #endif
    st_destroy_atoms( st );
@@ -236,10 +234,8 @@ static void st_destroy_context_priv( struct st_context *st )
    st_destroy_blit(st);
 #endif
    st_destroy_clear(st);
-#if FEATURE_drawpix
    st_destroy_bitmap(st);
    st_destroy_drawpix(st);
-#endif
 #if FEATURE_OES_draw_texture
    st_destroy_drawtex(st);
 #endif
@@ -308,11 +304,9 @@ void st_init_driver_functions(struct dd_function_table *functions)
 #endif
    st_init_bufferobject_functions(functions);
    st_init_clear_functions(functions);
-#if FEATURE_drawpix
    st_init_bitmap_functions(functions);
    st_init_drawpixels_functions(functions);
    st_init_rasterpos_functions(functions);
-#endif
 
 #if FEATURE_OES_draw_texture
    st_init_drawtex_functions(functions);
index a1f70e869362a8f70714f58848722fefd66f98af..5cf2666334129234baa0627d6696df5404685f24 100644 (file)
@@ -45,7 +45,7 @@
 #include "draw/draw_context.h"
 
 
-#if FEATURE_feedback || FEATURE_drawpix
+#if FEATURE_feedback || FEATURE_rastpos
 
 /**
  * Set the (private) draw module's post-transformed vertex format when in
@@ -279,5 +279,5 @@ st_feedback_draw_vbo(GLcontext *ctx,
    }
 }
 
-#endif /* FEATURE_feedback || FEATURE_drawpix */
+#endif /* FEATURE_feedback || FEATURE_rastpos */