[Bf-blender-cvs] [cbc5388a4a] blender2.8: Minor cleanup in sequencer_draw.c

Luca Rood noreply at git.blender.org
Thu Feb 16 21:53:01 CET 2017


Commit: cbc5388a4ab1739612e4ec0c5850b9bb1ab3f1f5
Author: Luca Rood
Date:   Thu Feb 16 18:44:37 2017 -0200
Branches: blender2.8
https://developer.blender.org/rBcbc5388a4ab1739612e4ec0c5850b9bb1ab3f1f5

Minor cleanup in sequencer_draw.c

Minor style cleanup, and also replaced manual checker drawing by a call
to `imm_draw_checker_box`.

Part of T49043

===================================================================

M	source/blender/editors/space_sequencer/sequencer_draw.c

===================================================================

diff --git a/source/blender/editors/space_sequencer/sequencer_draw.c b/source/blender/editors/space_sequencer/sequencer_draw.c
index 9c9f47d55f..130fe12f67 100644
--- a/source/blender/editors/space_sequencer/sequencer_draw.c
+++ b/source/blender/editors/space_sequencer/sequencer_draw.c
@@ -1030,8 +1030,7 @@ static void sequencer_draw_borders(const SpaceSeq *sseq, const View2D *v2d, cons
 	/* border */
 	setlinestyle(3);
 
-	VertexFormat *format = immVertexFormat();
-	unsigned pos = add_attrib(format, "pos", GL_FLOAT, 2, KEEP_FLOAT);
+	unsigned int pos = add_attrib(immVertexFormat(), "pos", GL_FLOAT, 2, KEEP_FLOAT);
 
 	immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR);
 	immUniformThemeColor(TH_BACK);
@@ -1070,16 +1069,7 @@ static void sequencer_draw_background(
 	/* only draw alpha for main buffer */
 	if (sseq->mainb == SEQ_DRAW_IMG_IMBUF) {
 		if ((sseq->flag & SEQ_USE_ALPHA) && !draw_overlay) {
-			unsigned int pos = add_attrib(immVertexFormat(), "pos", GL_FLOAT, 2, KEEP_FLOAT);
-			immBindBuiltinProgram(GPU_SHADER_2D_CHECKER);
-
-			immUniform4f("color1", 0.15f, 0.15f, 0.15f, 1.0f);
-			immUniform4f("color2", 0.2f, 0.2f, 0.2f, 1.0f);
-			immUniform1i("size", 8);
-
-			immRectf(pos, v2d->tot.xmin, v2d->tot.ymin, v2d->tot.xmax, v2d->tot.ymax);
-
-			immUnbindProgram();
+			imm_draw_checker_box(v2d->tot.xmin, v2d->tot.ymin, v2d->tot.xmax, v2d->tot.ymax);
 		}
 	}
 }




More information about the Bf-blender-cvs mailing list