X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fmesa%2Fdrivers%2Fdri%2Fswrast%2Fswrast_priv.h;h=77670d89a5ec5792c2d85ffc51c0bdc10a5f71b8;hb=42910ebe7b9748c0ecb6a597bae3e7d43c7e170f;hp=a3e3922f128755bf2e322af9318c0de7a74c42df;hpb=95eb6422c718d3d4ef34ec35bffa83307025793d;p=mesa.git diff --git a/src/mesa/drivers/dri/swrast/swrast_priv.h b/src/mesa/drivers/dri/swrast/swrast_priv.h index a3e3922f128..77670d89a5e 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,18 +23,14 @@ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -/* - * Authors: - * George Sapountzis - */ - #ifndef _SWRAST_PRIV_H #define _SWRAST_PRIV_H #include #include -#include "mtypes.h" +#include "main/mtypes.h" +#include "dri_sw.h" /** @@ -43,13 +40,13 @@ #define DEBUG_SPAN 0 #if DEBUG_CORE -#define TRACE _mesa_printf("--> %s\n", __FUNCTION__) +#define TRACE printf("--> %s\n", __FUNCTION__) #else #define TRACE #endif #if DEBUG_SPAN -#define TRACE_SPAN _mesa_printf("--> %s\n", __FUNCTION__) +#define TRACE_SPAN printf("--> %s\n", __FUNCTION__) #else #define TRACE_SPAN #endif @@ -58,53 +55,61 @@ /** * Data types */ -struct __DRIscreenRec { - int num; - - const __DRIextension **extensions; +struct dri_context +{ + /* mesa, base class, must be first */ + GLcontext Base; - const __DRIswrastLoaderExtension *swrast_loader; + /* dri */ + __DRIcontext *cPriv; }; -struct __DRIcontextRec { - GLcontext Base; - - void *loaderPrivate; +static INLINE struct dri_context * +dri_context(__DRIcontext * driContextPriv) +{ + return (struct dri_context *)driContextPriv->driverPrivate; +} - __DRIscreen *driScreenPriv; -}; +static INLINE struct dri_context * +swrast_context(GLcontext *ctx) +{ + return (struct dri_context *) ctx; +} -struct __DRIdrawableRec { +struct dri_drawable +{ + /* mesa, base class, must be first */ GLframebuffer Base; - void *loaderPrivate; - - __DRIscreen *driScreenPriv; + /* dri */ + __DRIdrawable *dPriv; /* scratch row for optimized front-buffer rendering */ char *row; }; -struct swrast_renderbuffer { - struct gl_renderbuffer Base; - - /* renderbuffer pitch (in bytes) */ - GLuint pitch; -}; - -static inline __DRIcontext * -swrast_context(GLcontext *ctx) +static INLINE struct dri_drawable * +dri_drawable(__DRIdrawable * driDrawPriv) { - return (__DRIcontext *) ctx; + 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; } -static inline struct swrast_renderbuffer * +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) { return (struct swrast_renderbuffer *) rb; @@ -114,11 +119,10 @@ swrast_renderbuffer(struct gl_renderbuffer *rb) /** * Pixel formats we support */ -#define PF_CI8 1 /**< Color Index mode */ -#define PF_A8R8G8B8 2 /**< 32-bit TrueColor: 8-A, 8-R, 8-G, 8-B bits */ -#define PF_R5G6B5 3 /**< 16-bit TrueColor: 5-R, 6-G, 5-B bits */ -#define PF_R3G3B2 4 /**< 8-bit TrueColor: 3-R, 3-G, 2-B bits */ - +#define PF_A8R8G8B8 1 /**< 32bpp TrueColor: 8-A, 8-R, 8-G, 8-B bits */ +#define PF_R5G6B5 2 /**< 16bpp TrueColor: 5-R, 6-G, 5-B bits */ +#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).