Merge branch 'master' into blender2.8
[blender.git] / source / blender / editors / screen / screendump.c
index 8274ca6..63b9fe4 100644 (file)
@@ -54,7 +54,9 @@
 #include "BKE_writeavi.h"
 
 #include "BIF_gl.h"
-#include "BIF_glutil.h"
+
+#include "GPU_immediate.h"
+#include "GPU_immediate_util.h"
 
 #include "RNA_access.h"
 #include "RNA_define.h"
@@ -273,7 +275,7 @@ static void screenshot_draw(bContext *UNUSED(C), wmOperator *op)
 
        /* main draw call */
        RNA_pointer_create(NULL, op->type->srna, op->properties, &ptr);
-       uiDefAutoButsRNA(layout, &ptr, screenshot_draw_check_prop, '\0');
+       uiDefAutoButsRNA(layout, &ptr, screenshot_draw_check_prop, UI_BUT_LABEL_ALIGN_NONE, false);
 }
 
 static int screenshot_poll(bContext *C)
@@ -451,25 +453,24 @@ static void screenshot_startjob(void *sjv, short *stop, short *do_update, float
 /* Helper callback for drawing the cursor itself */
 static void screencast_draw_cursor(bContext *UNUSED(C), int x, int y, void *UNUSED(p_ptr))
 {
+       glEnable(GL_LINE_SMOOTH);
+       glEnable(GL_BLEND);
 
-       glPushMatrix();
+       Gwn_VertFormat *format = immVertexFormat();
+       unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT);
 
-       glTranslatef((float)x, (float)y, 0.0f);
+       immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR);
 
+       immUniformColor4ub(0, 0, 0, 32);
+       imm_draw_circle_fill_2d(pos, (float)x, (float)y, 20, 40);
 
-       glEnable(GL_LINE_SMOOTH);
-       glEnable(GL_BLEND);
-
-       glColor4ub(0, 0, 0, 32);
-       glutil_draw_filled_arc(0.0, M_PI * 2.0, 20, 40);
+       immUniformColor4ub(255, 255, 255, 128);
+       imm_draw_circle_wire_2d(pos, (float)x, (float)y, 20, 40);
 
-       glColor4ub(255, 255, 255, 128);
-       glutil_draw_lined_arc(0.0, M_PI * 2.0, 20, 40);
+       immUnbindProgram();
 
        glDisable(GL_BLEND);
        glDisable(GL_LINE_SMOOTH);
-
-       glPopMatrix();
 }
 
 /* Turn brush cursor in 3D view on/off */