mesa/st: introduce PIPE_CAP_NO_CLIP_ON_COPY_TEX
[mesa.git] / src / mesa / state_tracker / st_atom_stipple.c
index 3918a1e495a17372e5f61178bccbfc71adfabd8d..86a4247f3269d4327b8c52c3f015b4912ba999f9 100644 (file)
@@ -60,9 +60,9 @@ invert_stipple(GLuint dest[32], const GLuint src[32], GLuint winHeight)
 }
 
 
-
-static void 
-update_stipple( struct st_context *st )
+/** Update the stipple when the pattern or window height changes */
+void
+st_update_polygon_stipple( struct st_context *st )
 {
    const struct gl_context *ctx = st->ctx;
    const GLuint sz = sizeof(st->state.poly_stipple);
@@ -74,21 +74,13 @@ update_stipple( struct st_context *st )
 
       memcpy(st->state.poly_stipple, ctx->PolygonStipple, sz);
 
-      invert_stipple(newStipple.stipple, ctx->PolygonStipple,
-                     ctx->DrawBuffer->Height);
+      if (!ctx->DrawBuffer->FlipY) {
+         memcpy(newStipple.stipple, ctx->PolygonStipple, sizeof(newStipple.stipple));
+      } else {
+         invert_stipple(newStipple.stipple, ctx->PolygonStipple,
+                        ctx->DrawBuffer->Height);
+      }
 
       st->pipe->set_polygon_stipple(st->pipe, &newStipple);
    }
 }
-
-
-/** Update the stipple when the pattern or window height changes */
-const struct st_tracked_state st_update_polygon_stipple = {
-   "st_update_polygon_stipple",                                /* name */
-   {                                                   /* dirty */
-      (_NEW_POLYGONSTIPPLE |
-       _NEW_BUFFERS),                                  /* mesa */
-      0,                                               /* st */
-   },
-   update_stipple                                      /* update */
-};