i965: Resolve GCC sign-compare warning.
[mesa.git] / src / mesa / drivers / dri / swrast / swrast_priv.h
index 6679061a983163a8cc7c1f82439b02c1b40b825e..a6ab53529f8741eab75682851b17bdf80be11fbe 100644 (file)
@@ -1,6 +1,5 @@
 /*
  * Mesa 3-D graphics library
- * Version:  7.1
  *
  * Copyright (C) 1999-2008  Brian Paul   All Rights Reserved.
  * Copyright 2008, 2010 George Sapountzis <gsapountzis@gmail.com>
  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
  */
 
 
@@ -30,7 +30,8 @@
 #include <GL/gl.h>
 #include <GL/internal/dri_interface.h>
 #include "main/mtypes.h"
-#include "drisw_util.h"
+#include "dri_util.h"
+#include "swrast/s_context.h"
 
 
 /**
 #define DEBUG_SPAN     0
 
 #if DEBUG_CORE
-#define TRACE printf("--> %s\n", __FUNCTION__)
+#define TRACE printf("--> %s\n", __func__)
 #else
 #define TRACE
 #endif
 
 #if DEBUG_SPAN
-#define TRACE_SPAN printf("--> %s\n", __FUNCTION__)
+#define TRACE_SPAN printf("--> %s\n", __func__)
 #else
 #define TRACE_SPAN
 #endif
 struct dri_context
 {
     /* mesa, base class, must be first */
-    GLcontext Base;
+    struct gl_context Base;
 
     /* dri */
     __DRIcontext *cPriv;
 };
 
-static INLINE struct dri_context *
+static inline struct dri_context *
 dri_context(__DRIcontext * driContextPriv)
 {
     return (struct dri_context *)driContextPriv->driverPrivate;
 }
 
-static INLINE struct dri_context *
-swrast_context(GLcontext *ctx)
+static inline struct dri_context *
+swrast_context(struct gl_context *ctx)
 {
     return (struct dri_context *) ctx;
 }
@@ -79,7 +80,7 @@ swrast_context(GLcontext *ctx)
 struct dri_drawable
 {
     /* mesa, base class, must be first */
-    GLframebuffer Base;
+    struct gl_framebuffer Base;
 
     /* dri */
     __DRIdrawable *dPriv;
@@ -88,20 +89,25 @@ struct dri_drawable
     char *row;
 };
 
-static INLINE struct dri_drawable *
+static inline struct dri_drawable *
 dri_drawable(__DRIdrawable * driDrawPriv)
 {
     return (struct dri_drawable *)driDrawPriv->driverPrivate;
 }
 
-static INLINE struct dri_drawable *
-swrast_drawable(GLframebuffer *fb)
+static inline struct dri_drawable *
+swrast_drawable(struct gl_framebuffer *fb)
 {
     return (struct dri_drawable *) fb;
 }
 
-struct swrast_renderbuffer {
-    struct gl_renderbuffer Base;
+struct dri_swrast_renderbuffer {
+    struct swrast_renderbuffer Base;
+    __DRIdrawable *dPriv;
+
+    /* GL_MAP_*_BIT, used for mapping of front buffer. */
+    GLbitfield map_mode;
+   int map_x, map_y, map_w, map_h;
 
     /* renderbuffer pitch (in bytes) */
     GLuint pitch;
@@ -109,10 +115,10 @@ struct swrast_renderbuffer {
     GLuint bpp;
 };
 
-static INLINE struct swrast_renderbuffer *
-swrast_renderbuffer(struct gl_renderbuffer *rb)
+static inline struct dri_swrast_renderbuffer *
+dri_swrast_renderbuffer(struct gl_renderbuffer *rb)
 {
-    return (struct swrast_renderbuffer *) rb;
+    return (struct dri_swrast_renderbuffer *) rb;
 }
 
 
@@ -125,14 +131,4 @@ swrast_renderbuffer(struct gl_renderbuffer *rb)
 #define PF_X8R8G8B8   4                /**< 32bpp TrueColor:  8-R, 8-G, 8-B bits */
 
 
-/* swrast_span.c */
-
-extern void
-swrast_set_span_funcs_back(struct swrast_renderbuffer *xrb,
-                          GLuint pixel_format);
-
-extern void
-swrast_set_span_funcs_front(struct swrast_renderbuffer *xrb,
-                           GLuint pixel_format);
-
 #endif /* _SWRAST_PRIV_H_ */