intel: Use rb->Data and rb->RowStride to handle spans Y flipping.
authorEric Anholt <eric@anholt.net>
Tue, 31 May 2011 22:33:36 +0000 (15:33 -0700)
committerEric Anholt <eric@anholt.net>
Mon, 13 Jun 2011 22:56:36 +0000 (15:56 -0700)
This is already pointing at 0 or Height - 1 and with an appropriate
pitch, so no need to recompute those values per customization of the
spans code.  Cuts 3 out of 21kb of the compiled size.

Reviewed-by: Chad Versace <chad@chad-versace.us>
src/mesa/drivers/dri/intel/intel_span.c

index a4a1d6bd6ebe5f7e712b42e874dc394c5259ddda..aa83b3c128a2537ae475e524a46e838450a59a29 100644 (file)
@@ -55,21 +55,18 @@ intel_set_span_functions(struct intel_context *intel,
 
 #define LOCAL_VARS                                                     \
    struct intel_renderbuffer *irb = intel_renderbuffer(rb);            \
-   const GLint yScale = rb->Name ? 1 : -1;                             \
-   const GLint yBias = rb->Name ? 0 : rb->Height - 1;                  \
    int minx = 0, miny = 0;                                             \
    int maxx = rb->Width;                                               \
    int maxy = rb->Height;                                              \
-   int pitch = irb->region->pitch * irb->region->cpp;                  \
-   void *buf = irb->region->buffer->virtual;                           \
+   int pitch = rb->RowStride * irb->region->cpp;                       \
+   void *buf = rb->Data;                                               \
    GLuint p;                                                           \
-   (void) p;                                                           \
-   (void)buf; (void)pitch; /* unused for non-gttmap. */                        \
+   (void) p;
 
 #define HW_CLIPLOOP()
 #define HW_ENDCLIPLOOP()
 
-#define Y_FLIP(_y) ((_y) * yScale + yBias)
+#define Y_FLIP(_y) (_y)
 
 #define HW_LOCK()