[Bf-blender-cvs] [424156108ad] uvimage-editor-drawing: Merge branch 'master' into uvimage-editor-drawing
Jeroen Bakker
noreply at git.blender.org
Mon Aug 24 08:36:02 CEST 2020
Commit: 424156108ad736533d70dcd9cf9cb302f90344c5
Author: Jeroen Bakker
Date: Mon Aug 24 08:35:56 2020 +0200
Branches: uvimage-editor-drawing
https://developer.blender.org/rB424156108ad736533d70dcd9cf9cb302f90344c5
Merge branch 'master' into uvimage-editor-drawing
===================================================================
===================================================================
diff --cc source/blender/editors/space_image/space_image.c
index 8a05ba9da73,a806e3e25d1..860e1aada6f
--- a/source/blender/editors/space_image/space_image.c
+++ b/source/blender/editors/space_image/space_image.c
@@@ -672,48 -688,21 +671,47 @@@ static void image_main_region_draw(cons
show_curve = true;
}
- ED_region_draw_cb_draw(C, region, REGION_DRAW_POST_VIEW);
+ /* we draw image in pixelspace */
+ if (U.experimental.use_drw_image_editor) {
+ DRW_draw_view(C);
+ draw_image_main_helpers(C, region);
- if (sima->flag & SI_SHOW_GPENCIL) {
- /* Grease Pencil too (in addition to UV's) */
- draw_image_grease_pencil((bContext *)C, true);
+ /* sample line */
+ UI_view2d_view_ortho(v2d);
+ draw_image_sample_line(sima);
+ UI_view2d_view_restore(C);
}
+ else {
+ float col[3];
+ /* clear and setup matrix */
+ UI_GetThemeColor3fv(TH_BACK, col);
+ srgb_to_linearrgb_v3_v3(col, col);
+ GPU_clear_color(col[0], col[1], col[2], 1.0f);
- GPU_clear(GPU_COLOR_BIT);
+ GPU_depth_test(GPU_DEPTH_NONE);
+ draw_image_main(C, region);
+
+ /* and uvs in 0.0-1.0 space */
+ UI_view2d_view_ortho(v2d);
+
+ ED_region_draw_cb_draw(C, region, REGION_DRAW_PRE_VIEW);
+
+ ED_uvedit_draw_main(sima, scene, view_layer, obedit, obact, depsgraph);
- /* sample line */
- draw_image_sample_line(sima);
+ ED_region_draw_cb_draw(C, region, REGION_DRAW_POST_VIEW);
- UI_view2d_view_restore(C);
+ if (sima->flag & SI_SHOW_GPENCIL) {
+ /* Grease Pencil too (in addition to UV's) */
+ draw_image_grease_pencil((bContext *)C, true);
+ }
+ /* sample line */
+ draw_image_sample_line(sima);
+
+ UI_view2d_view_restore(C);
- if (sima->flag & SI_SHOW_GPENCIL) {
- /* draw Grease Pencil - screen space only */
- draw_image_grease_pencil((bContext *)C, false);
+ if (sima->flag & SI_SHOW_GPENCIL) {
+ /* draw Grease Pencil - screen space only */
+ draw_image_grease_pencil((bContext *)C, false);
+ }
}
if (mask) {
More information about the Bf-blender-cvs
mailing list