[i915] Move meta_draw_quad into the vtbl with other meta operations.
authorEric Anholt <eric@anholt.net>
Thu, 20 Dec 2007 16:19:42 +0000 (08:19 -0800)
committerEric Anholt <eric@anholt.net>
Thu, 20 Dec 2007 16:19:42 +0000 (08:19 -0800)
src/mesa/drivers/dri/i915/intel_context.h
src/mesa/drivers/dri/i915/intel_pixel_copy.c
src/mesa/drivers/dri/i915/intel_pixel_draw.c
src/mesa/drivers/dri/i915/intel_tris.c
src/mesa/drivers/dri/i915/intel_tris.h
src/mesa/drivers/dri/intel/intel_buffers.c
src/mesa/drivers/dri/intel/intel_screen.c

index 6f0051ed8b98c728c5b50173d2de6c60a4bb884d..25486ed001bb4ccfa503047048cfa8791d3d1d91 100644 (file)
@@ -112,6 +112,14 @@ struct intel_context
                                 struct intel_region * draw_region,
                                 struct intel_region * depth_region);
 
+      void (*meta_draw_quad)(struct intel_context *intel,
+                            GLfloat x0, GLfloat x1,
+                            GLfloat y0, GLfloat y1,
+                            GLfloat z,
+                            GLuint color, /* ARGB32 */
+                            GLfloat s0, GLfloat s1,
+                            GLfloat t0, GLfloat t1);
+
       void (*meta_color_mask) (struct intel_context * intel, GLboolean);
 
       void (*meta_stencil_replace) (struct intel_context * intel,
index 0bda2d863f32c84b4942d904b23fc0315eb34aa7..c453097e55e692f90a12c8263fca61fde1aad860 100644 (file)
@@ -219,13 +219,13 @@ do_texture_copypixels(GLcontext * ctx,
       /* Just use the regular cliprect mechanism...  Does this need to
        * even hold the lock???
        */
-      intel_meta_draw_quad(intel, 
-                          dstx, 
-                          dstx + width * ctx->Pixel.ZoomX, 
-                          dPriv->h - (dsty + height * ctx->Pixel.ZoomY), 
-                          dPriv->h - (dsty), 0,   /* XXX: what z value? */
-                           0x00ff00ff,
-                           srcx, srcx + width, srcy, srcy + height);
+      intel->vtbl.meta_draw_quad(intel,
+                                dstx,
+                                dstx + width * ctx->Pixel.ZoomX,
+                                dPriv->h - (dsty + height * ctx->Pixel.ZoomY),
+                                dPriv->h - (dsty), 0, /* XXX: what z value? */
+                                0x00ff00ff,
+                                srcx, srcx + width, srcy, srcy + height);
 
     out:
       intel->vtbl.leave_meta_state(intel);
index 0fea9a1d01a93f1803019f1022c0ecd23ff3b01f..566f884be0cdf1e58e306955442f899b14d96bb2 100644 (file)
@@ -170,13 +170,13 @@ do_texture_drawpixels(GLcontext * ctx,
        * incorrect coordinate space.  Does this even need to hold the
        * lock???
        */
-      intel_meta_draw_quad(intel,
-                           dstx, dstx + width * ctx->Pixel.ZoomX,
-                           dPriv->h - (y + height * ctx->Pixel.ZoomY),
-                           dPriv->h - (y),
-                           -ctx->Current.RasterPos[2] * .5,
-                           0x00ff00ff,
-                           srcx, srcx + width, srcy + height, srcy);
+      intel->vtbl.meta_draw_quad(intel,
+                                dstx, dstx + width * ctx->Pixel.ZoomX,
+                                dPriv->h - (y + height * ctx->Pixel.ZoomY),
+                                dPriv->h - (y),
+                                -ctx->Current.RasterPos[2] * .5,
+                                0x00ff00ff,
+                                srcx, srcx + width, srcy + height, srcy);
     out:
       intel->vtbl.leave_meta_state(intel);
       intel_batchbuffer_flush(intel->batch);
index 474113cd6328a7f685ffaae9ea1876eaa1625873..61b0bb3fd31507fceecc033acdbd2fa1443cc384 100644 (file)
@@ -1066,7 +1066,7 @@ union fi
 /**********************************************************************/
 /*             Used only with the metaops callbacks.                  */
 /**********************************************************************/
-void
+static void
 intel_meta_draw_poly(struct intel_context *intel,
                      GLuint n,
                      GLfloat xy[][2],
@@ -1101,7 +1101,7 @@ intel_meta_draw_poly(struct intel_context *intel,
        UNLOCK_HARDWARE(intel);
 }
 
-void
+static void
 intel_meta_draw_quad(struct intel_context *intel,
                      GLfloat x0, GLfloat x1,
                      GLfloat y0, GLfloat y1,
@@ -1143,6 +1143,7 @@ intel_meta_draw_quad(struct intel_context *intel,
 void
 intelInitTriFuncs(GLcontext * ctx)
 {
+   struct intel_context *intel = intel_context(ctx);
    TNLcontext *tnl = TNL_CONTEXT(ctx);
    static int firsttime = 1;
 
@@ -1159,4 +1160,6 @@ intelInitTriFuncs(GLcontext * ctx)
    tnl->Driver.Render.BuildVertices = _tnl_build_vertices;
    tnl->Driver.Render.CopyPV = _tnl_copy_pv;
    tnl->Driver.Render.Interp = _tnl_interp;
+
+   intel->vtbl.meta_draw_quad = intel_meta_draw_quad;
 }
index b7bae8cd3bc4083675c40c3df3cd7d46bb68c828..021e5c6450050350f40f4a37be5e9f681b0664e6 100644 (file)
@@ -51,19 +51,4 @@ extern void intelWrapInlinePrimitive(struct intel_context *intel);
 GLuint *intelExtendInlinePrimitive(struct intel_context *intel,
                                    GLuint dwords);
 
-
-void intel_meta_draw_quad(struct intel_context *intel,
-                          GLfloat x0, GLfloat x1,
-                          GLfloat y0, GLfloat y1,
-                          GLfloat z,
-                          GLuint color,
-                          GLfloat s0, GLfloat s1, GLfloat t0, GLfloat t1);
-
-void intel_meta_draw_poly(struct intel_context *intel,
-                          GLuint n,
-                          GLfloat xy[][2],
-                          GLfloat z, GLuint color, GLfloat tex[][2]);
-
-
-
 #endif
index 98928955102b651a45a1566ea8a1cf39a6f11a77..098c3e345111554e590e91e207a5cf102afff00b 100644 (file)
@@ -31,7 +31,6 @@
 #include "intel_buffers.h"
 #include "intel_depthstencil.h"
 #include "intel_fbo.h"
-#include "intel_tris.h"
 #include "intel_regions.h"
 #include "intel_batchbuffer.h"
 #include "intel_reg.h"
@@ -420,13 +419,14 @@ intelClearWithTris(struct intel_context *intel, GLbitfield mask)
       else
         intel->vtbl.meta_no_depth_write(intel);
 
-      intel_meta_draw_quad(intel,
-                          fb->_Xmin,
-                          fb->_Xmax,
-                          fb->_Ymin,
-                          fb->_Ymax,
-                          intel->ctx.Depth.Clear, intel->ClearColor8888,
-                          0, 0, 0, 0);   /* texcoords */
+      intel->vtbl.meta_draw_quad(intel,
+                                fb->_Xmin,
+                                fb->_Xmax,
+                                fb->_Ymin,
+                                fb->_Ymax,
+                                intel->ctx.Depth.Clear,
+                                intel->ClearColor8888,
+                                0, 0, 0, 0);   /* texcoords */
 
       mask &= ~(BUFFER_BIT_BACK_LEFT | BUFFER_BIT_STENCIL | BUFFER_BIT_DEPTH);
    }
@@ -448,13 +448,13 @@ intelClearWithTris(struct intel_context *intel, GLbitfield mask)
         /* XXX: Using INTEL_BATCH_NO_CLIPRECTS here is dangerous as the
          * drawing origin may not be correctly emitted.
          */
-        intel_meta_draw_quad(intel,
-                             fb->_Xmin,
-                             fb->_Xmax,
-                             fb->_Ymin,
-                             fb->_Ymax,
-                             0, intel->ClearColor8888,
-                             0, 0, 0, 0);   /* texcoords */
+        intel->vtbl.meta_draw_quad(intel,
+                                   fb->_Xmin,
+                                   fb->_Xmax,
+                                   fb->_Ymin,
+                                   fb->_Ymax,
+                                   0, intel->ClearColor8888,
+                                   0, 0, 0, 0);   /* texcoords */
 
         mask &= ~bufBit;
       }
index e1f62bd70ef4de8fcfd3cdae632f5b6fd4008279..b64908154857358032185843b539a24104b5e711 100644 (file)
@@ -41,7 +41,6 @@
 #include "intel_buffers.h"
 #include "intel_tex.h"
 #include "intel_span.h"
-#include "intel_tris.h"
 #include "intel_ioctl.h"
 #include "intel_fbo.h"