[Bf-blender-cvs] [78d9a0a563] blender2.8: OpenGL immediate mode: finish file_draw.c

Luca Rood noreply at git.blender.org
Tue Mar 7 05:46:13 CET 2017


Commit: 78d9a0a563962b75978a922fb9ee716905374428
Author: Luca Rood
Date:   Mon Mar 6 23:36:14 2017 -0300
Branches: blender2.8
https://developer.blender.org/rB78d9a0a563962b75978a922fb9ee716905374428

OpenGL immediate mode: finish file_draw.c

Part of T49043

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

M	source/blender/editors/space_file/file_draw.c

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

diff --git a/source/blender/editors/space_file/file_draw.c b/source/blender/editors/space_file/file_draw.c
index 4101a36d48..a1bd1f2542 100644
--- a/source/blender/editors/space_file/file_draw.c
+++ b/source/blender/editors/space_file/file_draw.c
@@ -460,15 +460,18 @@ static void draw_background(FileLayout *layout, View2D *v2d)
 	int i;
 	int sy;
 
-	UI_ThemeColorShade(TH_BACK, -7);
+	unsigned int pos = add_attrib(immVertexFormat(), "pos", COMP_F32, 2, KEEP_FLOAT);
+	immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR);
+	immUniformThemeColorShade(TH_BACK, -7);
 
 	/* alternating flat shade background */
 	for (i = 0; (i <= layout->rows); i += 2) {
 		sy = (int)v2d->cur.ymax - i * (layout->tile_h + 2 * layout->tile_border_y) - layout->tile_border_y;
 
-		glRectf(v2d->cur.xmin, (float)sy, v2d->cur.xmax, (float)(sy + layout->tile_h + 2 * layout->tile_border_y));
-		
+		immRectf(pos, v2d->cur.xmin, (float)sy, v2d->cur.xmax, (float)(sy + layout->tile_h + 2 * layout->tile_border_y));
 	}
+
+	immUnbindProgram();
 }
 
 static void draw_dividers(FileLayout *layout, View2D *v2d)
@@ -607,9 +610,6 @@ void file_draw_list(const bContext *C, ARegion *ar)
 
 		BLI_join_dirfile(path, sizeof(path), root, file->relpath);
 
-		UI_ThemeColor4(TH_TEXT);
-
-
 		if (!(file_selflag & FILE_SEL_EDITING)) {
 			if ((params->highlight_file == i) || (file_selflag & FILE_SEL_HIGHLIGHTED) ||
 			    (file_selflag & FILE_SEL_SELECTED))




More information about the Bf-blender-cvs mailing list