Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_image/space_image.c
| Show First 20 Lines • Show All 579 Lines • ▼ Show 20 Lines | static void image_main_region_draw(const bContext *C, ARegion *ar) | ||||
| Depsgraph *depsgraph = CTX_data_expect_evaluated_depsgraph(C); | Depsgraph *depsgraph = CTX_data_expect_evaluated_depsgraph(C); | ||||
| Mask *mask = NULL; | Mask *mask = NULL; | ||||
| bool show_uvedit = false; | bool show_uvedit = false; | ||||
| bool show_curve = false; | bool show_curve = false; | ||||
| Scene *scene = CTX_data_scene(C); | Scene *scene = CTX_data_scene(C); | ||||
| ViewLayer *view_layer = CTX_data_view_layer(C); | ViewLayer *view_layer = CTX_data_view_layer(C); | ||||
| View2D *v2d = &ar->v2d; | View2D *v2d = &ar->v2d; | ||||
| // View2DScrollers *scrollers; | // View2DScrollers *scrollers; | ||||
| float col[3]; | |||||
| /* XXX This is in order to draw UI batches with the DRW | /* XXX This is in order to draw UI batches with the DRW | ||||
| * old context since we now use it for drawing the entire area. */ | * old context since we now use it for drawing the entire area. */ | ||||
| gpu_batch_presets_reset(); | gpu_batch_presets_reset(); | ||||
| GPUViewport *viewport = | GPUViewport *viewport = | ||||
| ar->draw_buffer->viewport[ar->draw_buffer->stereo ? sima->iuser.multiview_eye : 0]; | ar->draw_buffer->viewport[ar->draw_buffer->stereo ? sima->iuser.multiview_eye : 0]; | ||||
| DefaultFramebufferList *fbl = GPU_viewport_framebuffer_list_get(viewport); | DefaultFramebufferList *fbl = GPU_viewport_framebuffer_list_get(viewport); | ||||
| GPU_framebuffer_bind(fbl->default_fb); | GPU_framebuffer_bind(fbl->default_fb); | ||||
| /* XXX not supported yet, disabling for now */ | /* XXX not supported yet, disabling for now */ | ||||
| scene->r.scemode &= ~R_COMP_CROP; | scene->r.scemode &= ~R_COMP_CROP; | ||||
| /* clear and setup matrix */ | /* clear and setup matrix */ | ||||
| UI_GetThemeColor3fv(TH_BACK, col); | |||||
| GPU_clear_color(col[0], col[1], col[2], 0.0f); | |||||
| GPU_clear(GPU_COLOR_BIT); | |||||
| GPU_depth_test(false); | |||||
| image_user_refresh_scene(C, sima); | image_user_refresh_scene(C, sima); | ||||
| /* we set view2d from own zoom and offset each time */ | /* we set view2d from own zoom and offset each time */ | ||||
| image_main_region_set_view2d(sima, ar); | image_main_region_set_view2d(sima, ar); | ||||
| /* we draw image in pixelspace */ | /* we draw image in pixelspace */ | ||||
| if ((U.experimental.flag & | |||||
| (USER_EXPERIMENTAL_ALL | USER_EXPERIMENTAL_USE_DRAW_MANAGER_FOR_UV_IMAGE_EDITOR)) != 0) { | |||||
| DRW_draw_view(C); | |||||
| return; | |||||
| } | |||||
| else { | |||||
| float col[3]; | |||||
| UI_GetThemeColor3fv(TH_BACK, col); | |||||
| GPU_clear_color(col[0], col[1], col[2], 0.0f); | |||||
| GPU_clear(GPU_COLOR_BIT); | |||||
| GPU_depth_test(false); | |||||
| draw_image_main(C, ar); | draw_image_main(C, ar); | ||||
| } | |||||
| /* and uvs in 0.0-1.0 space */ | /* and uvs in 0.0-1.0 space */ | ||||
| UI_view2d_view_ortho(v2d); | UI_view2d_view_ortho(v2d); | ||||
| ED_region_draw_cb_draw(C, ar, REGION_DRAW_PRE_VIEW); | ED_region_draw_cb_draw(C, ar, REGION_DRAW_PRE_VIEW); | ||||
| ED_uvedit_draw_main(sima, scene, view_layer, obedit, obact, depsgraph); | ED_uvedit_draw_main(sima, scene, view_layer, obedit, obact, depsgraph); | ||||
| ▲ Show 20 Lines • Show All 489 Lines • Show Last 20 Lines | |||||