[Bf-blender-cvs] [3fa665f56dc] blender2.8: Draw Manager: Fix Gradient Background

Clément Foucault noreply at git.blender.org
Thu Apr 20 13:07:56 CEST 2017


Commit: 3fa665f56dc82d2fe379a6d79f335fc696cec626
Author: Clément Foucault
Date:   Wed Apr 19 18:07:58 2017 +0200
Branches: blender2.8
https://developer.blender.org/rB3fa665f56dc82d2fe379a6d79f335fc696cec626

Draw Manager: Fix Gradient Background

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

M	source/blender/draw/intern/draw_view.c

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

diff --git a/source/blender/draw/intern/draw_view.c b/source/blender/draw/intern/draw_view.c
index 66542e221b1..b6a27c88a9e 100644
--- a/source/blender/draw/intern/draw_view.c
+++ b/source/blender/draw/intern/draw_view.c
@@ -553,6 +553,9 @@ void DRW_draw_background(void)
 	glStencilMask(0xFF);
 
 	if (UI_GetThemeValue(TH_SHOW_BACK_GRAD)) {
+		float m[4][4];
+		unit_m4(m);
+
 		/* Gradient background Color */
 		glDisable(GL_DEPTH_TEST);
 
@@ -561,6 +564,10 @@ void DRW_draw_background(void)
 		unsigned color = VertexFormat_add_attrib(format, "color", COMP_U8, 3, NORMALIZE_INT_TO_FLOAT);
 		unsigned char col_hi[3], col_lo[3];
 
+		gpuPushMatrix();
+		gpuLoadIdentity();
+		gpuLoadProjectionMatrix(m);
+
 		immBindBuiltinProgram(GPU_SHADER_2D_SMOOTH_COLOR);
 
 		UI_GetThemeColor3ubv(TH_LOW_GRAD, col_lo);
@@ -578,6 +585,8 @@ void DRW_draw_background(void)
 
 		immUnbindProgram();
 
+		gpuPopMatrix();
+
 		glClear(GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
 	}
 	else {




More information about the Bf-blender-cvs mailing list