-const struct st_tracked_state st_update_polygon_stipple = {
- "st_update_polygon_stipple", /* name */
- { /* dirty */
- (_NEW_POLYGONSTIPPLE), /* mesa */
- 0, /* st */
- },
- update_stipple /* update */
-};
+/** 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);
+ assert(sz == sizeof(ctx->PolygonStipple));
+
+ if (memcmp(st->state.poly_stipple, ctx->PolygonStipple, sz)) {
+ /* state has changed */
+ struct pipe_poly_stipple newStipple;
+
+ memcpy(st->state.poly_stipple, ctx->PolygonStipple, sz);
+
+ 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);
+ }
+}