Merge commit 'origin/master' into gallium-0.2
[mesa.git] / src / mesa / drivers / dri / common / drirenderbuffer.h
index bd07bc790f21dbba89a66578196837eee80f7977..cf55286b30fd066e1302be52517db8b5d1e92cd3 100644 (file)
@@ -10,7 +10,9 @@
 #ifndef DRIRENDERBUFFER_H
 #define DRIRENDERBUFFER_H
 
-#include "mtypes.h"
+#include "main/mtypes.h"
+#include "dri_util.h"
+
 
 typedef struct {
    struct gl_renderbuffer Base;
@@ -38,24 +40,39 @@ typedef struct {
     */
    GLint flippedOffset;
    GLint flippedPitch;
-   GLubyte *flippedData;  /* mmap'd memory, if used */
+   GLvoid *flippedData;  /* mmap'd address of buffer memory, if used */
+
+   /* Pointer to corresponding __DRIdrawablePrivate.  This is used to compute
+    * the window's position within the framebuffer.
+    */
+   __DRIdrawablePrivate *dPriv;
 
    /* XXX this is for radeon/r200 only.  We should really create a new
     * r200Renderbuffer class, derived from this class...  not a huge deal.
     */
    GLboolean depthHasSurface;
 
-   /* XXX this is for s3v only.  A handy flag to know if this is the back
-    * color buffer.
+   /**
+    * A handy flag to know if this is the back color buffer.
+    * 
+    * \note
+    * This is currently only used by s3v and tdfx.
     */
    GLboolean backBuffer;
 } driRenderbuffer;
 
 
 extern driRenderbuffer *
-driNewRenderbuffer(GLenum format, GLint cpp, GLint offset, GLint pitch);
+driNewRenderbuffer(GLenum format, GLvoid *addr,
+                   GLint cpp, GLint offset, GLint pitch,
+                   __DRIdrawablePrivate *dPriv);
 
 extern void
 driFlipRenderbuffers(struct gl_framebuffer *fb, GLboolean flipped);
 
+
+extern void
+driUpdateFramebufferSize(GLcontext *ctx, const __DRIdrawablePrivate *dPriv);
+
+
 #endif /* DRIRENDERBUFFER_H */