diff options
Diffstat (limited to 'source/blender/draw/intern')
-rw-r--r-- | source/blender/draw/intern/DRW_render.h | 6 | ||||
-rw-r--r-- | source/blender/draw/intern/draw_armature.c | 4 | ||||
-rw-r--r-- | source/blender/draw/intern/draw_common.c | 4 | ||||
-rw-r--r-- | source/blender/draw/intern/draw_common.h | 6 | ||||
-rw-r--r-- | source/blender/draw/intern/draw_manager.c | 38 | ||||
-rw-r--r-- | source/blender/draw/intern/draw_view.c | 10 |
6 files changed, 34 insertions, 34 deletions
diff --git a/source/blender/draw/intern/DRW_render.h b/source/blender/draw/intern/DRW_render.h index 2bb957c8e43..8d89454fa6a 100644 --- a/source/blender/draw/intern/DRW_render.h +++ b/source/blender/draw/intern/DRW_render.h @@ -382,8 +382,8 @@ struct DefaultTextureList *DRW_viewport_texture_list_get(void); void DRW_viewport_request_redraw(void); -/* SceneLayers */ -void **DRW_scene_layer_engine_data_get(DrawEngineType *engine_type, void (*callback)(void *storage)); +/* ViewLayers */ +void **DRW_view_layer_engine_data_get(DrawEngineType *engine_type, void (*callback)(void *storage)); /* Objects */ void **DRW_object_engine_data_get( @@ -438,7 +438,7 @@ typedef struct DRWContextState { struct View3D *v3d; /* 'CTX_wm_view3d(C)' */ struct Scene *scene; /* 'CTX_data_scene(C)' */ - struct SceneLayer *scene_layer; /* 'CTX_data_scene_layer(C)' */ + struct ViewLayer *view_layer; /* 'CTX_data_view_layer(C)' */ /* Use 'scene->obedit' for edit-mode */ struct Object *obact; /* 'OBACT' */ diff --git a/source/blender/draw/intern/draw_armature.c b/source/blender/draw/intern/draw_armature.c index 90a50110698..58cf3aaf6cc 100644 --- a/source/blender/draw/intern/draw_armature.c +++ b/source/blender/draw/intern/draw_armature.c @@ -1413,11 +1413,11 @@ static void DRW_shgroup_armature( } void DRW_shgroup_armature_object( - Object *ob, SceneLayer *scene_layer, DRWPass *pass_bone_solid, DRWPass *pass_bone_wire, DRWPass *UNUSED(pass_bone_envelope), + Object *ob, ViewLayer *view_layer, DRWPass *pass_bone_solid, DRWPass *pass_bone_wire, DRWPass *UNUSED(pass_bone_envelope), DRWShadingGroup *shgrp_relationship_lines) { float *color; - DRW_object_wire_theme_get(ob, scene_layer, &color); + DRW_object_wire_theme_get(ob, view_layer, &color); DRW_shgroup_armature(ob, pass_bone_solid, pass_bone_wire, NULL, shgrp_relationship_lines); draw_armature_pose(ob, color); diff --git a/source/blender/draw/intern/draw_common.c b/source/blender/draw/intern/draw_common.c index bb7b4d7d513..b52c8e280b3 100644 --- a/source/blender/draw/intern/draw_common.c +++ b/source/blender/draw/intern/draw_common.c @@ -373,10 +373,10 @@ DRWShadingGroup *shgroup_instance_mball_helpers(DRWPass *pass, struct Gwn_Batch * Get the wire color theme_id of an object based on it's state * \a r_color is a way to get a pointer to the static color var associated */ -int DRW_object_wire_theme_get(Object *ob, SceneLayer *scene_layer, float **r_color) +int DRW_object_wire_theme_get(Object *ob, ViewLayer *view_layer, float **r_color) { const bool is_edit = (ob->mode & OB_MODE_EDIT) != 0; - const bool active = (scene_layer->basact && scene_layer->basact->object == ob); + const bool active = (view_layer->basact && view_layer->basact->object == ob); /* confusing logic here, there are 2 methods of setting the color * 'colortab[colindex]' and 'theme_id', colindex overrides theme_id. * diff --git a/source/blender/draw/intern/draw_common.h b/source/blender/draw/intern/draw_common.h index 51b7a25490f..0bdb79b3a40 100644 --- a/source/blender/draw/intern/draw_common.h +++ b/source/blender/draw/intern/draw_common.h @@ -30,7 +30,7 @@ struct DRWPass; struct DRWShadingGroup; struct Gwn_Batch; struct Object; -struct SceneLayer; +struct ViewLayer; /* Used as ubo but colors can be directly referenced as well */ /* Keep in sync with: common_globals_lib.glsl (globalsBlock) */ @@ -106,12 +106,12 @@ struct DRWShadingGroup *shgroup_instance_bone_envelope_wire(struct DRWPass *pass struct DRWShadingGroup *shgroup_instance_bone_envelope_solid(struct DRWPass *pass, struct Gwn_Batch *geom, float (*obmat)[4]); struct DRWShadingGroup *shgroup_instance_mball_helpers(struct DRWPass *pass, struct Gwn_Batch *geom); -int DRW_object_wire_theme_get(struct Object *ob, struct SceneLayer *scene_layer, float **r_color); +int DRW_object_wire_theme_get(struct Object *ob, struct ViewLayer *view_layer, float **r_color); float *DRW_color_background_blend_get(int theme_id); /* draw_armature.c */ void DRW_shgroup_armature_object( - struct Object *ob, struct SceneLayer *scene_layer, + struct Object *ob, struct ViewLayer *view_layer, struct DRWPass *pass_bone_solid, struct DRWPass *pass_bone_wire, struct DRWPass *pass_bone_envelope, struct DRWShadingGroup *shgrp_relationship_lines); diff --git a/source/blender/draw/intern/draw_manager.c b/source/blender/draw/intern/draw_manager.c index 672149b9e43..1e0061bc29c 100644 --- a/source/blender/draw/intern/draw_manager.c +++ b/source/blender/draw/intern/draw_manager.c @@ -2699,23 +2699,23 @@ void DRW_viewport_request_redraw(void) /* -------------------------------------------------------------------- */ -/** \name SceneLayers (DRW_scenelayer) +/** \name ViewLayers (DRW_scenelayer) * \{ */ -void **DRW_scene_layer_engine_data_get(DrawEngineType *engine_type, void (*callback)(void *storage)) +void **DRW_view_layer_engine_data_get(DrawEngineType *engine_type, void (*callback)(void *storage)) { - SceneLayerEngineData *sled; + ViewLayerEngineData *sled; - for (sled = DST.draw_ctx.scene_layer->drawdata.first; sled; sled = sled->next) { + for (sled = DST.draw_ctx.view_layer->drawdata.first; sled; sled = sled->next) { if (sled->engine_type == engine_type) { return &sled->storage; } } - sled = MEM_callocN(sizeof(SceneLayerEngineData), "SceneLayerEngineData"); + sled = MEM_callocN(sizeof(ViewLayerEngineData), "ViewLayerEngineData"); sled->engine_type = engine_type; sled->free = callback; - BLI_addtail(&DST.draw_ctx.scene_layer->drawdata, sled); + BLI_addtail(&DST.draw_ctx.view_layer->drawdata, sled); return &sled->storage; } @@ -3062,9 +3062,9 @@ static void DRW_engines_enable_external(void) use_drw_engine(DRW_engine_viewport_external_type.draw_engine); } -static void DRW_engines_enable(const Scene *scene, SceneLayer *scene_layer, RenderEngineType *engine) +static void DRW_engines_enable(const Scene *scene, ViewLayer *view_layer, RenderEngineType *engine) { - Object *obact = OBACT(scene_layer); + Object *obact = OBACT(view_layer); const int mode = CTX_data_mode_enum_ex(scene->obedit, obact); DRW_engines_enable_from_engine(engine); @@ -3227,7 +3227,7 @@ void DRW_notify_view_update(const bContext *C) RegionView3D *rv3d = ar->regiondata; Scene *scene = DEG_get_evaluated_scene(graph); RenderEngineType *engine = CTX_data_engine(C); - SceneLayer *scene_layer = CTX_data_scene_layer(C); + ViewLayer *view_layer = CTX_data_view_layer(C); if (rv3d->viewport == NULL) { return; @@ -3239,10 +3239,10 @@ void DRW_notify_view_update(const bContext *C) DST.viewport = rv3d->viewport; DST.draw_ctx = (DRWContextState){ - ar, rv3d, v3d, scene, scene_layer, OBACT(scene_layer), engine, C, + ar, rv3d, v3d, scene, view_layer, OBACT(view_layer), engine, C, }; - DRW_engines_enable(scene, scene_layer, engine); + DRW_engines_enable(scene, view_layer, engine); for (LinkData *link = DST.enabled_engines.first; link; link = link->next) { DrawEngineType *draw_engine = link->data; @@ -3291,7 +3291,7 @@ void DRW_draw_render_loop_ex( const bContext *evil_C) { Scene *scene = DEG_get_evaluated_scene(graph); - SceneLayer *scene_layer = DEG_get_evaluated_scene_layer(graph); + ViewLayer *view_layer = DEG_get_evaluated_view_layer(graph); RegionView3D *rv3d = ar->regiondata; DST.draw_ctx.evil_C = evil_C; @@ -3303,7 +3303,7 @@ void DRW_draw_render_loop_ex( GPU_viewport_engines_data_validate(DST.viewport, DRW_engines_get_hash()); DST.draw_ctx = (DRWContextState){ - ar, rv3d, v3d, scene, scene_layer, OBACT(scene_layer), engine, + ar, rv3d, v3d, scene, view_layer, OBACT(view_layer), engine, /* reuse if caller sets */ DST.draw_ctx.evil_C, @@ -3312,7 +3312,7 @@ void DRW_draw_render_loop_ex( DRW_viewport_var_init(); /* Get list of enabled engines */ - DRW_engines_enable(scene, scene_layer, engine); + DRW_engines_enable(scene, view_layer, engine); /* Update ubos */ DRW_globals_update(); @@ -3466,9 +3466,9 @@ void DRW_draw_select_loop( { Scene *scene = DEG_get_evaluated_scene(graph); RenderEngineType *engine = RE_engines_find(scene->view_render.engine_id); - SceneLayer *scene_layer = DEG_get_evaluated_scene_layer(graph); + ViewLayer *view_layer = DEG_get_evaluated_view_layer(graph); #ifndef USE_GPU_SELECT - UNUSED_VARS(vc, scene, scene_layer, v3d, ar, rect); + UNUSED_VARS(vc, scene, view_layer, v3d, ar, rect); #else RegionView3D *rv3d = ar->regiondata; @@ -3517,7 +3517,7 @@ void DRW_draw_select_loop( /* Instead of 'DRW_context_state_init(C, &DST.draw_ctx)', assign from args */ DST.draw_ctx = (DRWContextState){ - ar, rv3d, v3d, scene, scene_layer, OBACT(scene_layer), engine, (bContext *)NULL, + ar, rv3d, v3d, scene, view_layer, OBACT(view_layer), engine, (bContext *)NULL, }; DRW_viewport_var_init(); @@ -3584,7 +3584,7 @@ void DRW_draw_depth_loop( { Scene *scene = DEG_get_evaluated_scene(graph); RenderEngineType *engine = RE_engines_find(scene->view_render.engine_id); - SceneLayer *scene_layer = DEG_get_evaluated_scene_layer(graph); + ViewLayer *view_layer = DEG_get_evaluated_view_layer(graph); RegionView3D *rv3d = ar->regiondata; /* backup (_never_ use rv3d->viewport) */ @@ -3614,7 +3614,7 @@ void DRW_draw_depth_loop( /* Instead of 'DRW_context_state_init(C, &DST.draw_ctx)', assign from args */ DST.draw_ctx = (DRWContextState){ - ar, rv3d, v3d, scene, scene_layer, OBACT(scene_layer), engine, (bContext *)NULL, + ar, rv3d, v3d, scene, view_layer, OBACT(view_layer), engine, (bContext *)NULL, }; DRW_viewport_var_init(); diff --git a/source/blender/draw/intern/draw_view.c b/source/blender/draw/intern/draw_view.c index 8ed51fcd7f6..474d6ac8769 100644 --- a/source/blender/draw/intern/draw_view.c +++ b/source/blender/draw/intern/draw_view.c @@ -611,9 +611,9 @@ void DRW_draw_background(void) /* **************************** 3D Cursor ******************************** */ -static bool is_cursor_visible(Scene *scene, SceneLayer *scene_layer) +static bool is_cursor_visible(Scene *scene, ViewLayer *view_layer) { - Object *ob = OBACT(scene_layer); + Object *ob = OBACT(view_layer); /* don't draw cursor in paint modes, but with a few exceptions */ if (ob && ob->mode & OB_MODE_ALL_PAINT) { @@ -625,7 +625,7 @@ static bool is_cursor_visible(Scene *scene, SceneLayer *scene_layer) } /* exception: object in texture paint mode, clone brush, use_clone_layer disabled */ else if (ob->mode & OB_MODE_TEXTURE_PAINT) { - const Paint *p = BKE_paint_get_active(scene, scene_layer); + const Paint *p = BKE_paint_get_active(scene, view_layer); if (p && p->brush && p->brush->imagepaint_tool == PAINT_TOOL_CLONE) { if ((scene->toolsettings->imapaint.flag & IMAGEPAINT_PROJECT_LAYER_CLONE) == 0) { @@ -647,14 +647,14 @@ void DRW_draw_cursor(void) View3D *v3d = draw_ctx->v3d; RegionView3D *rv3d = draw_ctx->rv3d; Scene *scene = draw_ctx->scene; - SceneLayer *scene_layer = draw_ctx->scene_layer; + ViewLayer *view_layer = draw_ctx->view_layer; glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); glDepthMask(GL_FALSE); glDisable(GL_DEPTH_TEST); glLineWidth(1.0f); - if (is_cursor_visible(scene, scene_layer)) { + if (is_cursor_visible(scene, view_layer)) { float *co = ED_view3d_cursor3d_get(scene, v3d); unsigned char crosshair_color[3]; |