Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/editors/space_clip')
-rw-r--r--source/blender/editors/space_clip/clip_buttons.c2
-rw-r--r--source/blender/editors/space_clip/clip_dopesheet_draw.c18
-rw-r--r--source/blender/editors/space_clip/clip_draw.c144
-rw-r--r--source/blender/editors/space_clip/clip_graph_draw.c20
-rw-r--r--source/blender/editors/space_clip/clip_utils.c4
-rw-r--r--source/blender/editors/space_clip/space_clip.c20
6 files changed, 104 insertions, 104 deletions
diff --git a/source/blender/editors/space_clip/clip_buttons.c b/source/blender/editors/space_clip/clip_buttons.c
index db5f6c2451c..6953b7cfb71 100644
--- a/source/blender/editors/space_clip/clip_buttons.c
+++ b/source/blender/editors/space_clip/clip_buttons.c
@@ -107,7 +107,7 @@ void uiTemplateMovieClip(uiLayout *layout, bContext *C, PointerRNA *ptr, const c
uiLayoutSetContextPointer(layout, "edit_movieclip", &clipptr);
if (!compact)
- uiTemplateID(layout, C, ptr, propname, NULL, "CLIP_OT_open", NULL, UI_TEMPLATE_ID_FILTER_ALL);
+ uiTemplateID(layout, C, ptr, propname, NULL, "CLIP_OT_open", NULL, UI_TEMPLATE_ID_FILTER_ALL, false);
if (clip) {
uiLayout *col;
diff --git a/source/blender/editors/space_clip/clip_dopesheet_draw.c b/source/blender/editors/space_clip/clip_dopesheet_draw.c
index 76450cba3cb..2aa0a3e2b9a 100644
--- a/source/blender/editors/space_clip/clip_dopesheet_draw.c
+++ b/source/blender/editors/space_clip/clip_dopesheet_draw.c
@@ -130,8 +130,8 @@ void clip_draw_dopesheet_main(SpaceClip *sc, ARegion *ar, Scene *scene)
uint keyframe_len = 0;
- Gwn_VertFormat *format = immVertexFormat();
- uint pos_id = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT);
+ GPUVertFormat *format = immVertexFormat();
+ uint pos_id = GPU_vertformat_attr_add(format, "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT);
immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR);
/* don't use totrect set, as the width stays the same
@@ -215,14 +215,14 @@ void clip_draw_dopesheet_main(SpaceClip *sc, ARegion *ar, Scene *scene)
if (keyframe_len > 0) {
/* draw keyframe markers */
format = immVertexFormat();
- pos_id = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT);
- uint size_id = GWN_vertformat_attr_add(format, "size", GWN_COMP_F32, 1, GWN_FETCH_FLOAT);
- uint color_id = GWN_vertformat_attr_add(format, "color", GWN_COMP_F32, 4, GWN_FETCH_FLOAT);
- uint outline_color_id = GWN_vertformat_attr_add(format, "outlineColor", GWN_COMP_U8, 4, GWN_FETCH_INT_TO_FLOAT_UNIT);
+ pos_id = GPU_vertformat_attr_add(format, "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT);
+ uint size_id = GPU_vertformat_attr_add(format, "size", GPU_COMP_F32, 1, GPU_FETCH_FLOAT);
+ uint color_id = GPU_vertformat_attr_add(format, "color", GPU_COMP_F32, 4, GPU_FETCH_FLOAT);
+ uint outline_color_id = GPU_vertformat_attr_add(format, "outlineColor", GPU_COMP_U8, 4, GPU_FETCH_INT_TO_FLOAT_UNIT);
immBindBuiltinProgram(GPU_SHADER_KEYFRAME_DIAMOND);
GPU_enable_program_point_size();
- immBegin(GWN_PRIM_POINTS, keyframe_len);
+ immBegin(GPU_PRIM_POINTS, keyframe_len);
/* all same size with black outline */
immAttrib1f(size_id, 2.0f * STRIP_HEIGHT_HALF);
@@ -315,8 +315,8 @@ void clip_draw_dopesheet_channels(const bContext *C, ARegion *ar)
*/
float y = (float) CHANNEL_FIRST;
- Gwn_VertFormat *format = immVertexFormat();
- uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT);
+ GPUVertFormat *format = immVertexFormat();
+ uint pos = GPU_vertformat_attr_add(format, "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT);
immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR);
diff --git a/source/blender/editors/space_clip/clip_draw.c b/source/blender/editors/space_clip/clip_draw.c
index 164565192fd..ebdf5342172 100644
--- a/source/blender/editors/space_clip/clip_draw.c
+++ b/source/blender/editors/space_clip/clip_draw.c
@@ -80,7 +80,7 @@ static void draw_keyframe(int frame, int cfra, int sfra, float framelen, int wid
int x = (frame - sfra) * framelen;
if (width == 1) {
- immBegin(GWN_PRIM_LINES, 2);
+ immBegin(GPU_PRIM_LINES, 2);
immVertex2i(pos, x, 0);
immVertex2i(pos, x, height * UI_DPI_FAC);
immEnd();
@@ -167,7 +167,7 @@ static void draw_movieclip_cache(SpaceClip *sc, ARegion *ar, MovieClip *clip, Sc
BKE_movieclip_get_cache_segments(clip, &sc->user, &totseg, &points);
ED_region_cache_draw_cached_segments(ar, totseg, points, sfra, efra);
- uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_I32, 2, GWN_FETCH_INT_TO_FLOAT);
+ uint pos = GPU_vertformat_attr_add(immVertexFormat(), "pos", GPU_COMP_I32, 2, GPU_FETCH_INT_TO_FLOAT);
immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR);
/* track */
@@ -248,7 +248,7 @@ static void draw_movieclip_cache(SpaceClip *sc, ARegion *ar, MovieClip *clip, Sc
ED_region_cache_draw_curfra_label(sc->user.framenr, x, 8.0f * UI_DPI_FAC);
- pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_I32, 2, GWN_FETCH_INT_TO_FLOAT);
+ pos = GPU_vertformat_attr_add(immVertexFormat(), "pos", GPU_COMP_I32, 2, GPU_FETCH_INT_TO_FLOAT);
immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR);
/* solver keyframes */
@@ -290,7 +290,7 @@ static void draw_movieclip_muted(ARegion *ar, int width, int height, float zoomx
{
int x, y;
- uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT);
+ uint pos = GPU_vertformat_attr_add(immVertexFormat(), "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT);
immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR);
/* find window pixel coordinates of origin */
@@ -349,18 +349,18 @@ static void draw_stabilization_border(SpaceClip *sc, ARegion *ar, int width, int
/* draw boundary border for frame if stabilization is enabled */
if (sc->flag & SC_SHOW_STABLE && clip->tracking.stabilization.flag & TRACKING_2D_STABILIZATION) {
- const uint shdr_pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT);
+ const uint shdr_pos = GPU_vertformat_attr_add(immVertexFormat(), "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT);
/* Exclusive OR allows to get orig value when second operand is 0,
* and negative of orig value when second operand is 1. */
glEnable(GL_COLOR_LOGIC_OP);
glLogicOp(GL_XOR);
- gpuPushMatrix();
- gpuTranslate2f(x, y);
+ GPU_matrix_push();
+ GPU_matrix_translate_2f(x, y);
- gpuScale2f(zoomx, zoomy);
- gpuMultMatrix(sc->stabmat);
+ GPU_matrix_scale_2f(zoomx, zoomy);
+ GPU_matrix_mul(sc->stabmat);
immBindBuiltinProgram(GPU_SHADER_2D_LINE_DASHED_UNIFORM_COLOR);
@@ -377,7 +377,7 @@ static void draw_stabilization_border(SpaceClip *sc, ARegion *ar, int width, int
immUnbindProgram();
- gpuPopMatrix();
+ GPU_matrix_pop();
glDisable(GL_COLOR_LOGIC_OP);
}
@@ -452,7 +452,7 @@ static void draw_track_path(SpaceClip *sc, MovieClip *UNUSED(clip), MovieTrackin
i++;
}
- uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT);
+ uint pos = GPU_vertformat_attr_add(immVertexFormat(), "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT);
immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR);
@@ -463,7 +463,7 @@ static void draw_track_path(SpaceClip *sc, MovieClip *UNUSED(clip), MovieTrackin
if ((b - a - 1) >= 1) {
GPU_point_size(5.0f);
- immBegin(GWN_PRIM_POINTS, b - a - 1);
+ immBegin(GPU_PRIM_POINTS, b - a - 1);
for (i = a; i < b; i++) {
if (i != curindex) {
@@ -478,7 +478,7 @@ static void draw_track_path(SpaceClip *sc, MovieClip *UNUSED(clip), MovieTrackin
if ((b - a) >= 2) {
GPU_line_width(3.0f);
- immBegin(GWN_PRIM_LINE_STRIP, b - a);
+ immBegin(GPU_PRIM_LINE_STRIP, b - a);
for (i = a; i < b; i++) {
immVertex2f(pos, path[i][0], path[i][1]);
@@ -494,7 +494,7 @@ static void draw_track_path(SpaceClip *sc, MovieClip *UNUSED(clip), MovieTrackin
if ((curindex - a) >= 1) {
immUniformThemeColor(TH_PATH_BEFORE);
- immBegin(GWN_PRIM_POINTS, curindex - a);
+ immBegin(GPU_PRIM_POINTS, curindex - a);
for (i = a; i < curindex; i++) {
immVertex2f(pos, path[i][0], path[i][1]);
@@ -506,7 +506,7 @@ static void draw_track_path(SpaceClip *sc, MovieClip *UNUSED(clip), MovieTrackin
if ((b - curindex - 1) >= 1) {
immUniformThemeColor(TH_PATH_AFTER);
- immBegin(GWN_PRIM_POINTS, b - curindex - 1);
+ immBegin(GPU_PRIM_POINTS, b - curindex - 1);
for (i = curindex + 1; i < b; i++) {
immVertex2f(pos, path[i][0], path[i][1]);
@@ -521,7 +521,7 @@ static void draw_track_path(SpaceClip *sc, MovieClip *UNUSED(clip), MovieTrackin
if ((curindex - a + 1) >= 2) {
immUniformThemeColor(TH_PATH_BEFORE);
- immBegin(GWN_PRIM_LINE_STRIP, curindex - a + 1);
+ immBegin(GPU_PRIM_LINE_STRIP, curindex - a + 1);
for (i = a; i <= curindex; i++) {
immVertex2f(pos, path[i][0], path[i][1]);
@@ -533,7 +533,7 @@ static void draw_track_path(SpaceClip *sc, MovieClip *UNUSED(clip), MovieTrackin
if ((b - curindex) >= 2) {
immUniformThemeColor(TH_PATH_AFTER);
- immBegin(GWN_PRIM_LINE_STRIP, b - curindex);
+ immBegin(GPU_PRIM_LINE_STRIP, b - curindex);
for (i = curindex; i < b; i++) {
immVertex2f(pos, path[i][0], path[i][1]);
@@ -579,12 +579,12 @@ static void draw_marker_outline(SpaceClip *sc, MovieTrackingTrack *track, MovieT
{
GPU_point_size(tiny ? 3.0f : 4.0f);
- immBegin(GWN_PRIM_POINTS, 1);
+ immBegin(GPU_PRIM_POINTS, 1);
immVertex2f(position, pos[0], pos[1]);
immEnd();
}
else {
- immBegin(GWN_PRIM_LINES, 8);
+ immBegin(GPU_PRIM_LINES, 8);
immVertex2f(position, pos[0] + px[0] * 2, pos[1]);
immVertex2f(position, pos[0] + px[0] * 8, pos[1]);
@@ -603,11 +603,11 @@ static void draw_marker_outline(SpaceClip *sc, MovieTrackingTrack *track, MovieT
}
/* pattern and search outline */
- gpuPushMatrix();
- gpuTranslate2fv(marker_pos);
+ GPU_matrix_push();
+ GPU_matrix_translate_2fv(marker_pos);
if (sc->flag & SC_SHOW_MARKER_PATTERN) {
- immBegin(GWN_PRIM_LINE_LOOP, 4);
+ immBegin(GPU_PRIM_LINE_LOOP, 4);
immVertex2fv(position, marker->pattern_corners[0]);
immVertex2fv(position, marker->pattern_corners[1]);
immVertex2fv(position, marker->pattern_corners[2]);
@@ -625,7 +625,7 @@ static void draw_marker_outline(SpaceClip *sc, MovieTrackingTrack *track, MovieT
marker->search_max[1]);
}
- gpuPopMatrix();
+ GPU_matrix_pop();
}
static void track_colors(MovieTrackingTrack *track, int act, float col[3], float scol[3])
@@ -705,14 +705,14 @@ static void draw_marker_areas(SpaceClip *sc, MovieTrackingTrack *track, MovieTra
immUniform1f("dash_factor", 2.0f); /* Solid "line" */
- immBegin(GWN_PRIM_POINTS, 1);
+ immBegin(GPU_PRIM_POINTS, 1);
immVertex2f(shdr_pos, pos[0], pos[1]);
immEnd();
}
else {
immUniform1f("dash_factor", 2.0f); /* Solid line */
- immBegin(GWN_PRIM_LINES, 8);
+ immBegin(GPU_PRIM_LINES, 8);
immVertex2f(shdr_pos, pos[0] + px[0] * 3, pos[1]);
immVertex2f(shdr_pos, pos[0] + px[0] * 7, pos[1]);
@@ -735,7 +735,7 @@ static void draw_marker_areas(SpaceClip *sc, MovieTrackingTrack *track, MovieTra
glEnable(GL_COLOR_LOGIC_OP);
glLogicOp(GL_XOR);
- immBegin(GWN_PRIM_LINES, 2);
+ immBegin(GPU_PRIM_LINES, 2);
immVertex2fv(shdr_pos, pos);
immVertex2fv(shdr_pos, marker_pos);
immEnd();
@@ -745,8 +745,8 @@ static void draw_marker_areas(SpaceClip *sc, MovieTrackingTrack *track, MovieTra
}
/* pattern */
- gpuPushMatrix();
- gpuTranslate2fv(marker_pos);
+ GPU_matrix_push();
+ GPU_matrix_translate_2fv(marker_pos);
if (track->flag & TRACK_LOCKED) {
if (act) {
@@ -783,7 +783,7 @@ static void draw_marker_areas(SpaceClip *sc, MovieTrackingTrack *track, MovieTra
}
if ((track->pat_flag & SELECT) == sel && (sc->flag & SC_SHOW_MARKER_PATTERN)) {
- immBegin(GWN_PRIM_LINE_LOOP, 4);
+ immBegin(GPU_PRIM_LINE_LOOP, 4);
immVertex2fv(shdr_pos, marker->pattern_corners[0]);
immVertex2fv(shdr_pos, marker->pattern_corners[1]);
immVertex2fv(shdr_pos, marker->pattern_corners[2]);
@@ -800,12 +800,12 @@ static void draw_marker_areas(SpaceClip *sc, MovieTrackingTrack *track, MovieTra
marker->search_max[0], marker->search_max[1]);
}
- gpuPopMatrix();
+ GPU_matrix_pop();
/* Restore default shader */
immUnbindProgram();
- const uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT);
+ const uint pos = GPU_vertformat_attr_add(immVertexFormat(), "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT);
BLI_assert(pos == shdr_pos);
UNUSED_VARS_NDEBUG(pos);
@@ -857,7 +857,7 @@ static void draw_marker_slide_triangle(float x, float y, float dx, float dy, int
tdy += px[1];
}
- immBegin(GWN_PRIM_TRIS, 3);
+ immBegin(GPU_PRIM_TRIS, 3);
immVertex2f(pos, x, y);
immVertex2f(pos, x - tdx, y);
immVertex2f(pos, x, y + tdy);
@@ -884,8 +884,8 @@ static void draw_marker_slide_zones(SpaceClip *sc, MovieTrackingTrack *track, Mo
immUniformThemeColor(TH_MARKER_OUTLINE);
}
- gpuPushMatrix();
- gpuTranslate2fv(marker_pos);
+ GPU_matrix_push();
+ GPU_matrix_translate_2fv(marker_pos);
dx = 6.0f / width / sc->zoom;
dy = 6.0f / height / sc->zoom;
@@ -935,7 +935,7 @@ static void draw_marker_slide_zones(SpaceClip *sc, MovieTrackingTrack *track, Mo
GPU_line_width(outline ? 3.0f : 1.0f);
- immBegin(GWN_PRIM_LINES, 2);
+ immBegin(GPU_PRIM_LINES, 2);
immVertex2f(pos, 0.0f, 0.0f);
immVertex2fv(pos, tilt_ctrl);
immEnd();
@@ -944,7 +944,7 @@ static void draw_marker_slide_zones(SpaceClip *sc, MovieTrackingTrack *track, Mo
draw_marker_slide_square(tilt_ctrl[0], tilt_ctrl[1], patdx, patdy, outline, px, pos);
}
- gpuPopMatrix();
+ GPU_matrix_pop();
}
static void draw_marker_texts(SpaceClip *sc, MovieTrackingTrack *track, MovieTrackingMarker *marker,
@@ -1141,18 +1141,18 @@ static void draw_plane_marker_image(Scene *scene,
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, ibuf->x, ibuf->y, 0, GL_RGBA,
GL_UNSIGNED_BYTE, display_buffer);
- gpuPushMatrix();
- gpuMultMatrix(gl_matrix);
+ GPU_matrix_push();
+ GPU_matrix_mul(gl_matrix);
- Gwn_VertFormat *imm_format = immVertexFormat();
- uint pos = GWN_vertformat_attr_add(imm_format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT);
- uint texCoord = GWN_vertformat_attr_add(imm_format, "texCoord", GWN_COMP_F32, 2, GWN_FETCH_FLOAT);
+ GPUVertFormat *imm_format = immVertexFormat();
+ uint pos = GPU_vertformat_attr_add(imm_format, "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT);
+ uint texCoord = GPU_vertformat_attr_add(imm_format, "texCoord", GPU_COMP_F32, 2, GPU_FETCH_FLOAT);
immBindBuiltinProgram(GPU_SHADER_2D_IMAGE_COLOR);
immUniformColor4f(1.0f, 1.0f, 1.0f, plane_track->image_opacity);
immUniform1i("image", 0);
- immBegin(GWN_PRIM_TRI_FAN, 4);
+ immBegin(GPU_PRIM_TRI_FAN, 4);
immAttrib2f(texCoord, 0.0f, 0.0f);
immVertex2f(pos, 0.0f, 0.0f);
@@ -1170,7 +1170,7 @@ static void draw_plane_marker_image(Scene *scene,
immUnbindProgram();
- gpuPopMatrix();
+ GPU_matrix_pop();
glBindTexture(GL_TEXTURE_2D, 0);
@@ -1206,7 +1206,7 @@ static void draw_plane_marker_ex(SpaceClip *sc, Scene *scene, MovieTrackingPlane
}
if (draw_plane_quad || is_selected_track) {
- const uint shdr_pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT);
+ const uint shdr_pos = GPU_vertformat_attr_add(immVertexFormat(), "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT);
immBindBuiltinProgram(GPU_SHADER_2D_LINE_DASHED_UNIFORM_COLOR);
@@ -1239,7 +1239,7 @@ static void draw_plane_marker_ex(SpaceClip *sc, Scene *scene, MovieTrackingPlane
}
/* Draw rectangle itself. */
- immBegin(GWN_PRIM_LINE_LOOP, 4);
+ immBegin(GPU_PRIM_LINE_LOOP, 4);
immVertex2fv(shdr_pos, plane_marker->corners[0]);
immVertex2fv(shdr_pos, plane_marker->corners[1]);
immVertex2fv(shdr_pos, plane_marker->corners[2]);
@@ -1252,7 +1252,7 @@ static void draw_plane_marker_ex(SpaceClip *sc, Scene *scene, MovieTrackingPlane
immUniformColor3f(1.0f, 0.0f, 0.0f);
- immBegin(GWN_PRIM_LINES, 2);
+ immBegin(GPU_PRIM_LINES, 2);
getArrowEndPoint(width, height, sc->zoom, plane_marker->corners[0], plane_marker->corners[1], end_point);
immVertex2fv(shdr_pos, plane_marker->corners[0]);
@@ -1262,7 +1262,7 @@ static void draw_plane_marker_ex(SpaceClip *sc, Scene *scene, MovieTrackingPlane
immUniformColor3f(0.0f, 1.0f, 0.0f);
- immBegin(GWN_PRIM_LINES, 2);
+ immBegin(GPU_PRIM_LINES, 2);
getArrowEndPoint(width, height, sc->zoom, plane_marker->corners[0], plane_marker->corners[3], end_point);
immVertex2fv(shdr_pos, plane_marker->corners[0]);
@@ -1342,13 +1342,13 @@ static void draw_tracking_tracks(SpaceClip *sc, Scene *scene, ARegion *ar, Movie
UI_view2d_view_to_region_fl(&ar->v2d, 0.0f, 0.0f, &x, &y);
- gpuPushMatrix();
- gpuTranslate2f(x, y);
+ GPU_matrix_push();
+ GPU_matrix_translate_2f(x, y);
- gpuPushMatrix();
- gpuScale2f(zoomx, zoomy);
- gpuMultMatrix(sc->stabmat);
- gpuScale2f(width, height);
+ GPU_matrix_push();
+ GPU_matrix_scale_2f(zoomx, zoomy);
+ GPU_matrix_mul(sc->stabmat);
+ GPU_matrix_scale_2f(width, height);
act_track = BKE_tracking_track_get_active(tracking);
@@ -1414,7 +1414,7 @@ static void draw_tracking_tracks(SpaceClip *sc, Scene *scene, ARegion *ar, Movie
}
}
- uint position = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT);
+ uint position = GPU_vertformat_attr_add(immVertexFormat(), "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT);
immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR);
@@ -1519,7 +1519,7 @@ static void draw_tracking_tracks(SpaceClip *sc, Scene *scene, ARegion *ar, Movie
immUniformColor3f(1.0f, 0.0f, 0.0f);
}
- immBegin(GWN_PRIM_POINTS, 1);
+ immBegin(GPU_PRIM_POINTS, 1);
if (undistort) {
immVertex2f(position, pos[0] / width, pos[1] / (height * aspy));
@@ -1539,7 +1539,7 @@ static void draw_tracking_tracks(SpaceClip *sc, Scene *scene, ARegion *ar, Movie
immUnbindProgram();
- gpuPopMatrix();
+ GPU_matrix_pop();
if (sc->flag & SC_SHOW_NAMES) {
/* scaling should be cleared before drawing texts, otherwise font would also be scaled */
@@ -1565,7 +1565,7 @@ static void draw_tracking_tracks(SpaceClip *sc, Scene *scene, ARegion *ar, Movie
}
}
- gpuPopMatrix();
+ GPU_matrix_pop();
if (marker_pos)
MEM_freeN(marker_pos);
@@ -1592,13 +1592,13 @@ static void draw_distortion(SpaceClip *sc, ARegion *ar, MovieClip *clip,
UI_view2d_view_to_region_fl(&ar->v2d, 0.0f, 0.0f, &x, &y);
- gpuPushMatrix();
- gpuTranslate2f(x, y);
- gpuScale2f(zoomx, zoomy);
- gpuMultMatrix(sc->stabmat);
- gpuScale2f(width, height);
+ GPU_matrix_push();
+ GPU_matrix_translate_2f(x, y);
+ GPU_matrix_scale_2f(zoomx, zoomy);
+ GPU_matrix_mul(sc->stabmat);
+ GPU_matrix_scale_2f(width, height);
- uint position = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT);
+ uint position = GPU_vertformat_attr_add(immVertexFormat(), "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT);
immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR);
@@ -1675,7 +1675,7 @@ static void draw_distortion(SpaceClip *sc, ARegion *ar, MovieClip *clip,
immUniformColor3f(1.0f, 0.0f, 0.0f);
for (i = 0; i <= n; i++) {
- immBegin(GWN_PRIM_LINE_STRIP, n + 1);
+ immBegin(GPU_PRIM_LINE_STRIP, n + 1);
for (j = 0; j <= n; j++) {
immVertex2fv(position, grid[i][j]);
@@ -1685,7 +1685,7 @@ static void draw_distortion(SpaceClip *sc, ARegion *ar, MovieClip *clip,
}
for (j = 0; j <= n; j++) {
- immBegin(GWN_PRIM_LINE_STRIP, n + 1);
+ immBegin(GPU_PRIM_LINE_STRIP, n + 1);
for (i = 0; i <= n; i++) {
immVertex2fv(position, grid[i][j]);
@@ -1743,7 +1743,7 @@ static void draw_distortion(SpaceClip *sc, ARegion *ar, MovieClip *clip,
sub_v2_v2v2(dpos, npos, pos);
mul_v2_fl(dpos, 1.0f / steps);
- immBegin(GWN_PRIM_LINE_STRIP, steps + 1);
+ immBegin(GPU_PRIM_LINE_STRIP, steps + 1);
for (j = 0; j <= steps; j++) {
BKE_tracking_distort_v2(tracking, pos, tpos);
@@ -1756,7 +1756,7 @@ static void draw_distortion(SpaceClip *sc, ARegion *ar, MovieClip *clip,
}
}
else if (stroke->totpoints == 1) {
- immBegin(GWN_PRIM_POINTS, 1);
+ immBegin(GPU_PRIM_POINTS, 1);
immVertex2f(position, stroke->points[0].x + offsx, stroke->points[0].y + offsy);
immEnd();
}
@@ -1774,7 +1774,7 @@ static void draw_distortion(SpaceClip *sc, ARegion *ar, MovieClip *clip,
immUnbindProgram();
- gpuPopMatrix();
+ GPU_matrix_pop();
}
void clip_draw_main(const bContext *C, SpaceClip *sc, ARegion *ar)
@@ -1871,8 +1871,8 @@ void clip_draw_grease_pencil(bContext *C, int onlyv2d)
* associated with the clip is already drawn in draw_distortion
*/
if ((sc->flag & SC_MANUAL_CALIBRATION) == 0 || is_track_source) {
- gpuPushMatrix();
- gpuMultMatrix(sc->unistabmat);
+ GPU_matrix_push();
+ GPU_matrix_mul(sc->unistabmat);
if (is_track_source) {
MovieTrackingTrack *track = BKE_tracking_track_get_active(&sc->clip->tracking);
@@ -1881,13 +1881,13 @@ void clip_draw_grease_pencil(bContext *C, int onlyv2d)
int framenr = ED_space_clip_get_clip_frame_number(sc);
MovieTrackingMarker *marker = BKE_tracking_marker_get(track, framenr);
- gpuTranslate2fv(marker->pos);
+ GPU_matrix_translate_2fv(marker->pos);
}
}
ED_gpencil_draw_2dimage(C);
- gpuPopMatrix();
+ GPU_matrix_pop();
}
}
else {
diff --git a/source/blender/editors/space_clip/clip_graph_draw.c b/source/blender/editors/space_clip/clip_graph_draw.c
index 34720b3a627..cc8541d9fd7 100644
--- a/source/blender/editors/space_clip/clip_graph_draw.c
+++ b/source/blender/editors/space_clip/clip_graph_draw.c
@@ -91,11 +91,11 @@ static void tracking_segment_start_cb(void *userdata, MovieTrackingTrack *track,
immUniformColor4fv(col);
if (is_point) {
- immBeginAtMost(GWN_PRIM_POINTS, 1);
+ immBeginAtMost(GPU_PRIM_POINTS, 1);
}
else {
/* Graph can be composed of smaller segments, if any marker is disabled */
- immBeginAtMost(GWN_PRIM_LINE_STRIP, track->markersnr);
+ immBeginAtMost(GPU_PRIM_LINE_STRIP, track->markersnr);
}
}
@@ -119,13 +119,13 @@ static void tracking_segment_knot_cb(void *userdata, MovieTrackingTrack *track,
if (sel == data->sel) {
immUniformThemeColor(sel ? TH_HANDLE_VERTEX_SELECT : TH_HANDLE_VERTEX);
- gpuPushMatrix();
- gpuTranslate2f(scene_framenr, val);
- gpuScale2f(1.0f / data->xscale * data->hsize, 1.0f / data->yscale * data->hsize);
+ GPU_matrix_push();
+ GPU_matrix_translate_2f(scene_framenr, val);
+ GPU_matrix_scale_2f(1.0f / data->xscale * data->hsize, 1.0f / data->yscale * data->hsize);
imm_draw_circle_wire_2d(data->pos, 0, 0, 0.7, 8);
- gpuPopMatrix();
+ GPU_matrix_pop();
}
}
@@ -237,11 +237,11 @@ static void tracking_error_segment_start_cb(void *userdata, MovieTrackingTrack *
immUniformColor4fv(col);
if (is_point) { /* This probably never happens here, but just in case... */
- immBeginAtMost(GWN_PRIM_POINTS, 1);
+ immBeginAtMost(GPU_PRIM_POINTS, 1);
}
else {
/* Graph can be composed of smaller segments, if any marker is disabled */
- immBeginAtMost(GWN_PRIM_LINE_STRIP, track->markersnr);
+ immBeginAtMost(GPU_PRIM_LINE_STRIP, track->markersnr);
}
}
}
@@ -300,7 +300,7 @@ static void draw_frame_curves(SpaceClip *sc, unsigned int pos)
}
if (!lines) {
- immBeginAtMost(GWN_PRIM_LINE_STRIP, reconstruction->camnr);
+ immBeginAtMost(GPU_PRIM_LINE_STRIP, reconstruction->camnr);
lines = 1;
}
@@ -328,7 +328,7 @@ void clip_draw_graph(SpaceClip *sc, ARegion *ar, Scene *scene)
UI_view2d_grid_free(grid);
if (clip) {
- uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT);
+ uint pos = GPU_vertformat_attr_add(immVertexFormat(), "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT);
immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR);
GPU_point_size(3.0f);
diff --git a/source/blender/editors/space_clip/clip_utils.c b/source/blender/editors/space_clip/clip_utils.c
index c94853d4233..19d321a53bf 100644
--- a/source/blender/editors/space_clip/clip_utils.c
+++ b/source/blender/editors/space_clip/clip_utils.c
@@ -273,7 +273,7 @@ void clip_draw_sfra_efra(View2D *v2d, Scene *scene)
GPU_blend_set_func_separate(GPU_SRC_ALPHA, GPU_ONE_MINUS_SRC_ALPHA, GPU_ONE, GPU_ONE_MINUS_SRC_ALPHA);
GPU_blend(true);
- uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT);
+ uint pos = GPU_vertformat_attr_add(immVertexFormat(), "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT);
immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR);
immUniformColor4f(0.0f, 0.0f, 0.0f, 0.4f);
@@ -287,7 +287,7 @@ void clip_draw_sfra_efra(View2D *v2d, Scene *scene)
/* thin lines where the actual frames are */
GPU_line_width(1.0f);
- immBegin(GWN_PRIM_LINES, 4);
+ immBegin(GPU_PRIM_LINES, 4);
immVertex2f(pos, (float)SFRA, v2d->cur.ymin);
immVertex2f(pos, (float)SFRA, v2d->cur.ymax);
immVertex2f(pos, (float)EFRA, v2d->cur.ymin);
diff --git a/source/blender/editors/space_clip/space_clip.c b/source/blender/editors/space_clip/space_clip.c
index 4ac9010d3b5..4f9fd9c65d7 100644
--- a/source/blender/editors/space_clip/space_clip.c
+++ b/source/blender/editors/space_clip/space_clip.c
@@ -236,7 +236,7 @@ static SpaceLink *clip_new(const ScrArea *sa, const Scene *scene)
sc = MEM_callocN(sizeof(SpaceClip), "initclip");
sc->spacetype = SPACE_CLIP;
sc->flag = SC_SHOW_MARKER_PATTERN | SC_SHOW_TRACK_PATH |
- SC_SHOW_GRAPH_TRACKS_MOTION | SC_SHOW_GRAPH_FRAMES | SC_SHOW_GPENCIL;
+ SC_SHOW_GRAPH_TRACKS_MOTION | SC_SHOW_GRAPH_FRAMES | SC_SHOW_ANNOTATION;
sc->zoom = 1.0f;
sc->path_length = 20;
sc->scopes.track_preview_height = 120;
@@ -847,7 +847,7 @@ static int clip_context(const bContext *C, const char *member, bContextDataResul
}
/* dropboxes */
-static bool clip_drop_poll(bContext *UNUSED(C), wmDrag *drag, const wmEvent *UNUSED(event))
+static bool clip_drop_poll(bContext *UNUSED(C), wmDrag *drag, const wmEvent *UNUSED(event), const char **UNUSED(tooltip))
{
if (drag->type == WM_DRAG_PATH)
if (ELEM(drag->icon, 0, ICON_FILE_IMAGE, ICON_FILE_MOVIE, ICON_FILE_BLANK)) /* rule might not work? */
@@ -1185,18 +1185,18 @@ static void clip_main_region_draw(const bContext *C, ARegion *ar)
show_cursor |= sc->around == V3D_AROUND_CURSOR;
if (show_cursor) {
- gpuPushMatrix();
- gpuTranslate2f(x, y);
- gpuScale2f(zoomx, zoomy);
- gpuMultMatrix(sc->stabmat);
- gpuScale2f(width, height);
+ GPU_matrix_push();
+ GPU_matrix_translate_2f(x, y);
+ GPU_matrix_scale_2f(zoomx, zoomy);
+ GPU_matrix_mul(sc->stabmat);
+ GPU_matrix_scale_2f(width, height);
ED_image_draw_cursor(ar, sc->cursor);
- gpuPopMatrix();
+ GPU_matrix_pop();
}
clip_draw_cache_and_notes(C, sc, ar);
- if (sc->flag & SC_SHOW_GPENCIL) {
+ if (sc->flag & SC_SHOW_ANNOTATION) {
/* Grease Pencil */
clip_draw_grease_pencil((bContext *)C, true);
}
@@ -1204,7 +1204,7 @@ static void clip_main_region_draw(const bContext *C, ARegion *ar)
/* reset view matrix */
UI_view2d_view_restore(C);
- if (sc->flag & SC_SHOW_GPENCIL) {
+ if (sc->flag & SC_SHOW_ANNOTATION) {
/* draw Grease Pencil - screen space only */
clip_draw_grease_pencil((bContext *)C, false);
}