Changeset View
Changeset View
Standalone View
Standalone View
source/blender/draw/intern/draw_manager.c
| Show First 20 Lines • Show All 1,447 Lines • ▼ Show 20 Lines | |||||
| { | { | ||||
| Scene *scene = DEG_get_evaluated_scene(depsgraph); | Scene *scene = DEG_get_evaluated_scene(depsgraph); | ||||
| ViewLayer *view_layer = DEG_get_evaluated_view_layer(depsgraph); | ViewLayer *view_layer = DEG_get_evaluated_view_layer(depsgraph); | ||||
| RegionView3D *rv3d = ar->regiondata; | RegionView3D *rv3d = ar->regiondata; | ||||
| const bool do_annotations = ( | const bool do_annotations = ( | ||||
| ((v3d->flag2 & V3D_SHOW_ANNOTATION) != 0) && | ((v3d->flag2 & V3D_SHOW_ANNOTATION) != 0) && | ||||
| ((v3d->flag2 & V3D_HIDE_OVERLAYS) == 0)); | ((v3d->flag2 & V3D_HIDE_OVERLAYS) == 0)); | ||||
| const bool do_camera_frame = !DST.options.is_image_render; | |||||
| DST.draw_ctx.evil_C = evil_C; | DST.draw_ctx.evil_C = evil_C; | ||||
| DST.viewport = viewport; | DST.viewport = viewport; | ||||
| /* Setup viewport */ | /* Setup viewport */ | ||||
| GPU_viewport_engines_data_validate(DST.viewport, DRW_engines_get_hash()); | GPU_viewport_engines_data_validate(DST.viewport, DRW_engines_get_hash()); | ||||
| DST.draw_ctx = (DRWContextState){ | DST.draw_ctx = (DRWContextState){ | ||||
| ▲ Show 20 Lines • Show All 64 Lines • ▼ Show 20 Lines | #endif | ||||
| /* Start Drawing */ | /* Start Drawing */ | ||||
| DRW_state_reset(); | DRW_state_reset(); | ||||
| DRW_hair_update(); | DRW_hair_update(); | ||||
| drw_engines_draw_background(); | drw_engines_draw_background(); | ||||
| /* WIP, single image drawn over the camera view (replace) */ | |||||
| bool do_bg_image = false; | |||||
| if (rv3d->persp == RV3D_CAMOB) { | |||||
| Object *cam_ob = v3d->camera; | |||||
| if (cam_ob && cam_ob->type == OB_CAMERA) { | |||||
| Camera *cam = cam_ob->data; | |||||
| if (!BLI_listbase_is_empty(&cam->bg_images)) { | |||||
| do_bg_image = true; | |||||
| } | |||||
| } | |||||
| } | |||||
| GPU_framebuffer_bind(DST.default_framebuffer); | GPU_framebuffer_bind(DST.default_framebuffer); | ||||
| if (do_bg_image) { | |||||
| ED_view3d_draw_bgpic_test(scene, depsgraph, ar, v3d, false, do_camera_frame); | |||||
| } | |||||
| DRW_draw_callbacks_pre_scene(); | DRW_draw_callbacks_pre_scene(); | ||||
| if (DST.draw_ctx.evil_C) { | if (DST.draw_ctx.evil_C) { | ||||
| ED_region_draw_cb_draw(DST.draw_ctx.evil_C, DST.draw_ctx.ar, REGION_DRAW_PRE_VIEW); | ED_region_draw_cb_draw(DST.draw_ctx.evil_C, DST.draw_ctx.ar, REGION_DRAW_PRE_VIEW); | ||||
| } | } | ||||
| drw_engines_draw_scene(); | drw_engines_draw_scene(); | ||||
| #ifdef __APPLE__ | #ifdef __APPLE__ | ||||
| ▲ Show 20 Lines • Show All 55 Lines • ▼ Show 20 Lines | if ((v3d->flag2 & V3D_HIDE_OVERLAYS) == 0) { | ||||
| GPU_depth_test(false); | GPU_depth_test(false); | ||||
| DRW_draw_gizmo_2d(); | DRW_draw_gizmo_2d(); | ||||
| GPU_depth_test(true); | GPU_depth_test(true); | ||||
| } | } | ||||
| } | } | ||||
| DRW_stats_reset(); | DRW_stats_reset(); | ||||
| if (do_bg_image) { | |||||
| ED_view3d_draw_bgpic_test(scene, depsgraph, ar, v3d, true, do_camera_frame); | |||||
| } | |||||
| if (G.debug_value > 20 && G.debug_value < 30) { | if (G.debug_value > 20 && G.debug_value < 30) { | ||||
| GPU_depth_test(false); | GPU_depth_test(false); | ||||
| rcti rect; /* local coordinate visible rect inside region, to accommodate overlapping ui */ | rcti rect; /* local coordinate visible rect inside region, to accommodate overlapping ui */ | ||||
| ED_region_visible_rect(DST.draw_ctx.ar, &rect); | ED_region_visible_rect(DST.draw_ctx.ar, &rect); | ||||
| DRW_stats_draw(&rect); | DRW_stats_draw(&rect); | ||||
| GPU_depth_test(true); | GPU_depth_test(true); | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 1,295 Lines • Show Last 20 Lines | |||||