X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fmesa%2Fdrivers%2Fdri%2Fswrast%2Fswrast_priv.h;h=6679061a983163a8cc7c1f82439b02c1b40b825e;hb=0203136e69bfa711edd69a4f69c4539cd877b5cb;hp=c83c64b4873b920fffc7c9ca787fe78c7c436d66;hpb=6e376485c10896229f7bfaf5b0cce9c8b67f61b1;p=mesa.git diff --git a/src/mesa/drivers/dri/swrast/swrast_priv.h b/src/mesa/drivers/dri/swrast/swrast_priv.h index c83c64b4873..6679061a983 100644 --- a/src/mesa/drivers/dri/swrast/swrast_priv.h +++ b/src/mesa/drivers/dri/swrast/swrast_priv.h @@ -3,6 +3,7 @@ * Version: 7.1 * * Copyright (C) 1999-2008 Brian Paul All Rights Reserved. + * Copyright 2008, 2010 George Sapountzis * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -22,11 +23,6 @@ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -/* - * Authors: - * George Sapountzis - */ - #ifndef _SWRAST_PRIV_H #define _SWRAST_PRIV_H @@ -34,7 +30,7 @@ #include #include #include "main/mtypes.h" -#include "dri_sw.h" +#include "drisw_util.h" /** @@ -59,27 +55,60 @@ /** * Data types */ -struct swrast_renderbuffer { - struct gl_renderbuffer Base; +struct dri_context +{ + /* mesa, base class, must be first */ + GLcontext Base; - /* renderbuffer pitch (in bytes) */ - GLuint pitch; - /* bits per pixel of storage */ - GLuint bpp; + /* dri */ + __DRIcontext *cPriv; }; -static INLINE __DRIcontext * +static INLINE struct dri_context * +dri_context(__DRIcontext * driContextPriv) +{ + return (struct dri_context *)driContextPriv->driverPrivate; +} + +static INLINE struct dri_context * swrast_context(GLcontext *ctx) { - return (__DRIcontext *) ctx; + return (struct dri_context *) ctx; +} + +struct dri_drawable +{ + /* mesa, base class, must be first */ + GLframebuffer Base; + + /* dri */ + __DRIdrawable *dPriv; + + /* scratch row for optimized front-buffer rendering */ + char *row; +}; + +static INLINE struct dri_drawable * +dri_drawable(__DRIdrawable * driDrawPriv) +{ + return (struct dri_drawable *)driDrawPriv->driverPrivate; } -static INLINE __DRIdrawable * +static INLINE struct dri_drawable * swrast_drawable(GLframebuffer *fb) { - return (__DRIdrawable *) fb; + return (struct dri_drawable *) fb; } +struct swrast_renderbuffer { + struct gl_renderbuffer Base; + + /* renderbuffer pitch (in bytes) */ + GLuint pitch; + /* bits per pixel of storage */ + GLuint bpp; +}; + static INLINE struct swrast_renderbuffer * swrast_renderbuffer(struct gl_renderbuffer *rb) { @@ -95,14 +124,6 @@ swrast_renderbuffer(struct gl_renderbuffer *rb) #define PF_R3G3B2 3 /**< 8bpp TrueColor: 3-R, 3-G, 2-B bits */ #define PF_X8R8G8B8 4 /**< 32bpp TrueColor: 8-R, 8-G, 8-B bits */ -/** - * Renderbuffer pitch alignment (in bits). - * - * The xorg loader requires padding images to 32 bits. However, this should - * become a screen/drawable parameter XXX - */ -#define PITCH_ALIGN_BITS 32 - /* swrast_span.c */