diff options
author | Alexander Romanov <a.romanov@blend4web.com> | 2015-12-26 00:57:50 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2015-12-27 00:15:23 +0300 |
commit | 700c40e2f9b59b7e780429fdc10fb0d2d5d117a1 (patch) | |
tree | 8a6ed722fba1e652fe9756276c83da3467f396aa /source/blender/editors/space_sequencer | |
parent | 58cf3327e481cea3dbd2c1c0b89b02d4d2ca7be4 (diff) |
OpenGL: stipple support added to basic GLSL shader
The is intended to replace the deprecated glPolygonStipple() calls with a shader
based alternative, once we switch over to GLSL shaders.
Reviewers: brecht
Differential Revision: https://developer.blender.org/D1688
Diffstat (limited to 'source/blender/editors/space_sequencer')
-rw-r--r-- | source/blender/editors/space_sequencer/sequencer_draw.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/source/blender/editors/space_sequencer/sequencer_draw.c b/source/blender/editors/space_sequencer/sequencer_draw.c index deb0a3f6d03..393e7292d64 100644 --- a/source/blender/editors/space_sequencer/sequencer_draw.c +++ b/source/blender/editors/space_sequencer/sequencer_draw.c @@ -281,14 +281,14 @@ static void drawseqwave(const bContext *C, SpaceSeq *sseq, Scene *scene, Sequenc static void drawmeta_stipple(int value) { if (value) { - glEnable(GL_POLYGON_STIPPLE); - glPolygonStipple(stipple_halftone); + GPU_basic_shader_bind(GPU_SHADER_STIPPLE | GPU_SHADER_USE_COLOR); + GPU_basic_shader_stipple(GPU_SHADER_STIPPLE_HALFTONE); glEnable(GL_LINE_STIPPLE); glLineStipple(1, 0x8888); } else { - glDisable(GL_POLYGON_STIPPLE); + GPU_basic_shader_bind(GPU_SHADER_USE_COLOR); glDisable(GL_LINE_STIPPLE); } } @@ -586,8 +586,8 @@ void draw_shadedstrip(Sequence *seq, unsigned char col[3], float x1, float y1, f float ymid1, ymid2; if (seq->flag & SEQ_MUTE) { - glEnable(GL_POLYGON_STIPPLE); - glPolygonStipple(stipple_halftone); + GPU_basic_shader_bind(GPU_SHADER_STIPPLE | GPU_SHADER_USE_COLOR); + GPU_basic_shader_stipple(GPU_SHADER_STIPPLE_HALFTONE); } ymid1 = (y2 - y1) * 0.25f + y1; @@ -634,7 +634,7 @@ void draw_shadedstrip(Sequence *seq, unsigned char col[3], float x1, float y1, f glEnd(); if (seq->flag & SEQ_MUTE) { - glDisable(GL_POLYGON_STIPPLE); + GPU_basic_shader_bind(GPU_SHADER_USE_COLOR); } } @@ -801,32 +801,32 @@ static void draw_seq_strip(const bContext *C, SpaceSeq *sseq, Scene *scene, AReg /* draw lock */ if (seq->flag & SEQ_LOCK) { - glEnable(GL_POLYGON_STIPPLE); + GPU_basic_shader_bind(GPU_SHADER_STIPPLE | GPU_SHADER_USE_COLOR); glEnable(GL_BLEND); /* light stripes */ glColor4ub(255, 255, 255, 32); - glPolygonStipple(stipple_diag_stripes_pos); + GPU_basic_shader_stipple(GPU_SHADER_STIPPLE_DIAG_STRIPES); glRectf(x1, y1, x2, y2); /* dark stripes */ glColor4ub(0, 0, 0, 32); - glPolygonStipple(stipple_diag_stripes_neg); + GPU_basic_shader_stipple(GPU_SHADER_STIPPLE_DIAG_STRIPES_SWAP); glRectf(x1, y1, x2, y2); - glDisable(GL_POLYGON_STIPPLE); + GPU_basic_shader_bind(GPU_SHADER_USE_COLOR); glDisable(GL_BLEND); } if (!BKE_sequence_is_valid_check(seq)) { - glEnable(GL_POLYGON_STIPPLE); + GPU_basic_shader_bind(GPU_SHADER_STIPPLE | GPU_SHADER_USE_COLOR); /* panic! */ glColor4ub(255, 0, 0, 255); - glPolygonStipple(stipple_diag_stripes_pos); + GPU_basic_shader_stipple(GPU_SHADER_STIPPLE_DIAG_STRIPES); glRectf(x1, y1, x2, y2); - glDisable(GL_POLYGON_STIPPLE); + GPU_basic_shader_bind(GPU_SHADER_USE_COLOR); } color3ubv_from_seq(scene, seq, col); |