[Bf-blender-cvs] [def5517c59] temp-blender2.8-stable: OpenGL immediate mode: Convert leftover UI_ThemeColor calls

Luca Rood noreply at git.blender.org
Wed Feb 8 00:02:27 CET 2017


Commit: def5517c592536c8d5f502e3d8fdd6a9b0221fad
Author: Luca Rood
Date:   Tue Feb 7 20:53:20 2017 -0200
Branches: temp-blender2.8-stable
https://developer.blender.org/rBdef5517c592536c8d5f502e3d8fdd6a9b0221fad

OpenGL immediate mode: Convert leftover UI_ThemeColor calls

Some `UI_ThemeColor` calls were left in converted files, in some cases
because they were just overlooked, and in the case of text drawing,
because the new BLF color functions were not yet implemented at the
time of conversion.

Also converted one `drawcircball` call that was left in
transform_constraints.c

Part of T49043

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

M	source/blender/editors/animation/anim_channels_defines.c
M	source/blender/editors/animation/anim_draw.c
M	source/blender/editors/interface/view2d.c
M	source/blender/editors/space_action/action_draw.c
M	source/blender/editors/space_clip/clip_dopesheet_draw.c
M	source/blender/editors/transform/transform_constraints.c

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

diff --git a/source/blender/editors/animation/anim_channels_defines.c b/source/blender/editors/animation/anim_channels_defines.c
index 4163cbfe11..a7263f9fdb 100644
--- a/source/blender/editors/animation/anim_channels_defines.c
+++ b/source/blender/editors/animation/anim_channels_defines.c
@@ -3906,10 +3906,12 @@ void ANIM_channel_draw(bAnimContext *ac, bAnimListElem *ale, float yminc, float
 		
 		/* set text color */
 		/* XXX: if active, highlight differently? */
-		if (selected)
-			UI_ThemeColor(TH_TEXT_HI);
-		else
-			UI_ThemeColor(TH_TEXT);
+		if (selected) {
+			UI_FontThemeColor(fstyle->uifont_id, TH_TEXT_HI);
+		}
+		else {
+			UI_FontThemeColor(fstyle->uifont_id, TH_TEXT);
+		}
 		
 		/* get name */
 		acf->name(ale, name);
diff --git a/source/blender/editors/animation/anim_draw.c b/source/blender/editors/animation/anim_draw.c
index 58b9b8eba9..2b1163fab8 100644
--- a/source/blender/editors/animation/anim_draw.c
+++ b/source/blender/editors/animation/anim_draw.c
@@ -109,7 +109,7 @@ static void draw_cfra_number(Scene *scene, View2D *v2d, const float cfra, const
 	immUnbindProgram();
 	
 	/* draw current frame number - black text */
-	UI_ThemeColor(TH_TEXT);
+	UI_FontThemeColor(fstyle->uifont_id, TH_TEXT);
 	UI_fontstyle_draw_simple(fstyle, x - 0.25f * U.widget_unit, y + 0.15f * U.widget_unit, numstr);
 	
 	/* restore view transform */
diff --git a/source/blender/editors/interface/view2d.c b/source/blender/editors/interface/view2d.c
index 15993e4e56..2210bf1e44 100644
--- a/source/blender/editors/interface/view2d.c
+++ b/source/blender/editors/interface/view2d.c
@@ -1869,7 +1869,7 @@ void UI_view2d_scrollers_draw(const bContext *C, View2D *v2d, View2DScrollers *v
 			dfac = dfac * BLI_rcti_size_x(&hor);
 			
 			/* set starting value, and text color */
-			UI_ThemeColor(TH_TEXT);
+			UI_FontThemeColor(BLF_default(), TH_TEXT);
 			val = grid->startx;
 			
 			/* if we're clamping to whole numbers only, make sure entries won't be repeated */
@@ -1881,7 +1881,7 @@ void UI_view2d_scrollers_draw(const bContext *C, View2D *v2d, View2DScrollers *v
 			}
 			if (vs->xunits == V2D_UNIT_FRAMES)
 				grid->powerx = 1;
-			
+
 			/* draw numbers in the appropriate range */
 			if (dfac > 0.0f) {
 				float h = 0.1f * UI_UNIT_Y + (float)(hor.ymin);
diff --git a/source/blender/editors/space_action/action_draw.c b/source/blender/editors/space_action/action_draw.c
index feea9cf5b1..3fd7d74437 100644
--- a/source/blender/editors/space_action/action_draw.c
+++ b/source/blender/editors/space_action/action_draw.c
@@ -236,7 +236,7 @@ void draw_channel_strips(bAnimContext *ac, SpaceAction *saction, ARegion *ar)
 						case ANIMTYPE_SUMMARY:
 						{
 							/* reddish color from NLA */
-							UI_ThemeColor4(TH_ANIM_ACTIVE);
+							immUniformThemeColor(TH_ANIM_ACTIVE);
 							break;
 						}
 						case ANIMTYPE_SCENE:
diff --git a/source/blender/editors/space_clip/clip_dopesheet_draw.c b/source/blender/editors/space_clip/clip_dopesheet_draw.c
index 4125df155d..9fda063f19 100644
--- a/source/blender/editors/space_clip/clip_dopesheet_draw.c
+++ b/source/blender/editors/space_clip/clip_dopesheet_draw.c
@@ -340,7 +340,7 @@ void clip_draw_dopesheet_channels(const bContext *C, ARegion *ar)
 			        v2d->cur.xmax + EXTRA_SCROLL_PAD, (float) y + CHANNEL_HEIGHT_HALF);
 			immUnbindProgram();
 
-			UI_ThemeColor(sel ? TH_TEXT_HI : TH_TEXT);
+			UI_FontThemeColor(fontid, sel ? TH_TEXT_HI : TH_TEXT);
 
 			font_height = BLF_height(fontid, channel->name, sizeof(channel->name));
 			BLF_position(fontid, v2d->cur.xmin + CHANNEL_PAD,
diff --git a/source/blender/editors/transform/transform_constraints.c b/source/blender/editors/transform/transform_constraints.c
index a8183d1150..60689be550 100644
--- a/source/blender/editors/transform/transform_constraints.c
+++ b/source/blender/editors/transform/transform_constraints.c
@@ -769,8 +769,6 @@ void drawPropCircle(const struct bContext *C, TransInfo *t)
 		float tmat[4][4], imat[4][4];
 		int depth_test_enabled;
 
-		UI_ThemeColor(TH_GRID);
-
 		if (t->spacetype == SPACE_VIEW3D && rv3d != NULL) {
 			copy_m4_m4(tmat, rv3d->viewmat);
 			invert_m4_m4(imat, tmat);
@@ -803,10 +801,17 @@ void drawPropCircle(const struct bContext *C, TransInfo *t)
 		if (depth_test_enabled)
 			glDisable(GL_DEPTH_TEST);
 
+		unsigned int pos = add_attrib(immVertexFormat(), "pos", GL_FLOAT, 3, KEEP_FLOAT);
+
+		immBindBuiltinProgram(GPU_SHADER_3D_UNIFORM_COLOR);
+		immUniformThemeColor(TH_GRID);
+
 		set_inverted_drawing(1);
-		drawcircball(GL_LINE_LOOP, t->center_global, t->prop_size, imat);
+		imm_drawcircball(t->center_global, t->prop_size, imat, pos);
 		set_inverted_drawing(0);
 
+		immUnbindProgram();
+
 		if (depth_test_enabled)
 			glEnable(GL_DEPTH_TEST);




More information about the Bf-blender-cvs mailing list