[Bf-blender-cvs] [c872e87bd45] blender-v2.90-release: Fix T79309: Safe Areas are not visible

Campbell Barton noreply at git.blender.org
Thu Aug 6 11:00:15 CEST 2020


Commit: c872e87bd45acec5c986a64b1f6a60617174c286
Author: Campbell Barton
Date:   Thu Aug 6 18:28:22 2020 +1000
Branches: blender-v2.90-release
https://developer.blender.org/rBc872e87bd45acec5c986a64b1f6a60617174c286

Fix T79309: Safe Areas are not visible

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

M	source/blender/editors/space_view3d/view3d_draw.c
M	source/blender/gpu/GPU_immediate.h
M	source/blender/gpu/intern/gpu_immediate.c

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

diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c
index c062a8de361..1af0cc074fc 100644
--- a/source/blender/editors/space_view3d/view3d_draw.c
+++ b/source/blender/editors/space_view3d/view3d_draw.c
@@ -668,7 +668,8 @@ static void drawviewborder(Scene *scene, Depsgraph *depsgraph, ARegion *region,
 
   /* safety border */
   if (ca) {
-    immUniformThemeColorBlend(TH_VIEW_OVERLAY, TH_BACK, 0.25f);
+    GPU_blend(true);
+    immUniformThemeColorAlpha(TH_VIEW_OVERLAY, 0.75f);
 
     if (ca->dtx & CAM_DTX_CENTER) {
       float x3, y3;
@@ -778,6 +779,8 @@ static void drawviewborder(Scene *scene, Depsgraph *depsgraph, ARegion *region,
        * 2.0f round corner effect was nearly not visible anyway... */
       imm_draw_box_wire_2d(shdr_pos, rect.xmin, rect.ymin, rect.xmax, rect.ymax);
     }
+
+    GPU_blend(false);
   }
 
   immUnbindProgram();
diff --git a/source/blender/gpu/GPU_immediate.h b/source/blender/gpu/GPU_immediate.h
index 698c4585d20..33880010ef7 100644
--- a/source/blender/gpu/GPU_immediate.h
+++ b/source/blender/gpu/GPU_immediate.h
@@ -141,6 +141,7 @@ void immBindBuiltinProgram(eGPUBuiltinShader shader_id);
 
 /* Extend immUniformColor to take Blender's themes */
 void immUniformThemeColor(int color_id);
+void immUniformThemeColorAlpha(int color_id, float a);
 void immUniformThemeColor3(int color_id);
 void immUniformThemeColorShade(int color_id, int offset);
 void immUniformThemeColorShadeAlpha(int color_id, int color_offset, int alpha_offset);
diff --git a/source/blender/gpu/intern/gpu_immediate.c b/source/blender/gpu/intern/gpu_immediate.c
index 4f5cb3fcc91..1e99371f9a1 100644
--- a/source/blender/gpu/intern/gpu_immediate.c
+++ b/source/blender/gpu/intern/gpu_immediate.c
@@ -934,6 +934,14 @@ void immUniformThemeColor(int color_id)
   immUniformColor4fv(color);
 }
 
+void immUniformThemeColorAlpha(int color_id, float a)
+{
+  float color[4];
+  UI_GetThemeColor3fv(color_id, color);
+  color[3] = a;
+  immUniformColor4fv(color);
+}
+
 void immUniformThemeColor3(int color_id)
 {
   float color[3];



More information about the Bf-blender-cvs mailing list