[Bf-blender-cvs] [eaf7d36d66e] master: UI: Graph Editor: Draw Handles Lines With Smoothing

Hans Goudey noreply at git.blender.org
Fri May 15 21:13:06 CEST 2020


Commit: eaf7d36d66e551c3262d69f472b4028aeccb7e97
Author: Hans Goudey
Date:   Fri May 15 15:12:58 2020 -0400
Branches: master
https://developer.blender.org/rBeaf7d36d66e551c3262d69f472b4028aeccb7e97

UI: Graph Editor: Draw Handles Lines With Smoothing

Enabling "Use High Quality Display" in the graph editor enables
AA for the curves, this enables it for bezier handles too.

Differential Revision: https://developer.blender.org/D7740

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

M	source/blender/editors/space_graph/graph_draw.c

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

diff --git a/source/blender/editors/space_graph/graph_draw.c b/source/blender/editors/space_graph/graph_draw.c
index eac87caf777..68fef5e921f 100644
--- a/source/blender/editors/space_graph/graph_draw.c
+++ b/source/blender/editors/space_graph/graph_draw.c
@@ -343,6 +343,10 @@ static void draw_fcurve_handles(SpaceGraph *sipo, FCurve *fcu)
   uint color = GPU_vertformat_attr_add(
       format, "color", GPU_COMP_U8, 4, GPU_FETCH_INT_TO_FLOAT_UNIT);
   immBindBuiltinProgram(GPU_SHADER_2D_FLAT_COLOR);
+  if ((sipo->flag & SIPO_BEAUTYDRAW_OFF) == 0) {
+    GPU_line_smooth(true);
+  }
+  GPU_blend(true);
 
   immBeginAtMost(GPU_PRIM_LINES, 4 * 2 * fcu->totvert);
 
@@ -419,6 +423,10 @@ static void draw_fcurve_handles(SpaceGraph *sipo, FCurve *fcu)
 
   immEnd();
   immUnbindProgram();
+  GPU_blend(false);
+  if ((sipo->flag & SIPO_BEAUTYDRAW_OFF) == 0) {
+    GPU_line_smooth(false);
+  }
 }
 
 /* Samples ---------------- */
@@ -1181,9 +1189,7 @@ void graph_draw_curves(bAnimContext *ac, SpaceGraph *sipo, ARegion *region, shor
 
           if (do_handles) {
             /* only draw handles/vertices on keyframes */
-            GPU_blend(true);
             draw_fcurve_handles(sipo, fcu);
-            GPU_blend(false);
           }
 
           draw_fcurve_vertices(region, fcu, do_handles, (sipo->flag & SIPO_SELVHANDLESONLY));



More information about the Bf-blender-cvs mailing list