[i915] Move meta_draw_quad into the vtbl with other meta operations.

This commit is contained in:
Eric Anholt 2007-12-20 08:19:42 -08:00
parent 2761cfce46
commit fcd1e9dad6
7 changed files with 42 additions and 47 deletions

View 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,

View 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);

View 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);

View 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;
}

View 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

View 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;
}

View 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"