OpenGL: stipple support added to basic GLSL shader
[blender.git] / source / blender / editors / interface / interface_draw.c
index ae2e674416067c3ee1d9b307cc3eccd649fda911..a3adf65cd84c874073b70b39dffeede286eca351 100644 (file)
@@ -1133,14 +1133,17 @@ void ui_draw_but_COLORBAND(uiBut *but, uiWidgetColors *UNUSED(wcol), const rcti
        sizey_solid = sizey / 4;
        y1 = rect->ymin;
 
+       /* Drawing the checkerboard.
+        * This could be optimized with a single checkerboard shader,
+        * instead of drawing twice and using stippling the second time. */
        /* layer: background, to show tranparency */
        glColor4ub(UI_ALPHA_CHECKER_DARK, UI_ALPHA_CHECKER_DARK, UI_ALPHA_CHECKER_DARK, 255);
        glRectf(x1, y1, x1 + sizex, rect->ymax);
-       glEnable(GL_POLYGON_STIPPLE);
+       GPU_basic_shader_bind(GPU_SHADER_STIPPLE | GPU_SHADER_USE_COLOR);
        glColor4ub(UI_ALPHA_CHECKER_LIGHT, UI_ALPHA_CHECKER_LIGHT, UI_ALPHA_CHECKER_LIGHT, 255);
-       glPolygonStipple(stipple_checker_8px);
+       GPU_basic_shader_stipple(GPU_SHADER_STIPPLE_CHECKER_8PX);
        glRectf(x1, y1, x1 + sizex, rect->ymax);
-       glDisable(GL_POLYGON_STIPPLE);
+       GPU_basic_shader_bind(GPU_SHADER_USE_COLOR);
 
        /* layer: color ramp */
        glShadeModel(GL_FLAT);