[Bf-blender-cvs] [49441a35954] temp-lineart-contained: LineArt: General cleanups for names and order.
YimingWu
noreply at git.blender.org
Fri Mar 12 05:37:37 CET 2021
Commit: 49441a3595485643300b767725a93ad74d6cdcea
Author: YimingWu
Date: Fri Mar 12 12:36:04 2021 +0800
Branches: temp-lineart-contained
https://developer.blender.org/rB49441a3595485643300b767725a93ad74d6cdcea
LineArt: General cleanups for names and order.
===================================================================
M source/blender/gpencil_modifiers/intern/MOD_gpencillineart.c
M source/blender/gpencil_modifiers/intern/lineart/ED_lineart.h
M source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c
M source/blender/gpencil_modifiers/intern/lineart/lineart_ops.c
===================================================================
diff --git a/source/blender/gpencil_modifiers/intern/MOD_gpencillineart.c b/source/blender/gpencil_modifiers/intern/MOD_gpencillineart.c
index 30c14631614..9dab0717ddc 100644
--- a/source/blender/gpencil_modifiers/intern/MOD_gpencillineart.c
+++ b/source/blender/gpencil_modifiers/intern/MOD_gpencillineart.c
@@ -90,7 +90,7 @@ static void generate_strokes_actual(
printf("LRT: Generating from modifier.\n");
}
- ED_lineart_gpencil_generate_with_type(
+ ED_lineart_gpencil_generate(
lmd->render_buffer,
depsgraph,
ob,
diff --git a/source/blender/gpencil_modifiers/intern/lineart/ED_lineart.h b/source/blender/gpencil_modifiers/intern/lineart/ED_lineart.h
index c9dac052397..363cb82c298 100644
--- a/source/blender/gpencil_modifiers/intern/lineart/ED_lineart.h
+++ b/source/blender/gpencil_modifiers/intern/lineart/ED_lineart.h
@@ -527,16 +527,15 @@ struct GpencilModifierData;
void ED_lineart_gpencil_generate(LineartRenderBuffer *rb,
struct Depsgraph *depsgraph,
- Object *gpencil_object,
- float (*gp_obmat_inverse)[4],
- struct bGPDlayer *UNUSED(gpl),
+ struct Object *ob,
+ struct bGPDlayer *gpl,
struct bGPDframe *gpf,
+ char source_type,
+ void *source_reference,
int level_start,
int level_end,
- int material_nr,
- struct Object *source_object,
- struct Collection *source_collection,
- int types,
+ int mat_nr,
+ short line_types,
unsigned char transparency_flags,
unsigned char transparency_mask,
short thickness,
@@ -546,26 +545,6 @@ void ED_lineart_gpencil_generate(LineartRenderBuffer *rb,
const char *vgname,
int modifier_flags);
-void ED_lineart_gpencil_generate_with_type(LineartRenderBuffer *rb,
- struct Depsgraph *depsgraph,
- struct Object *ob,
- struct bGPDlayer *gpl,
- struct bGPDframe *gpf,
- char source_type,
- void *source_reference,
- int level_start,
- int level_end,
- int mat_nr,
- short line_types,
- unsigned char transparency_flags,
- unsigned char transparency_mask,
- short thickness,
- float opacity,
- float pre_sample_length,
- const char *source_vgname,
- const char *vgname,
- int modifier_flags);
-
float ED_lineart_chain_compute_length(LineartRenderLineChain *rlc);
struct wmOperatorType;
diff --git a/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c b/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c
index 02f9f8e1dbb..e34e916dbec 100644
--- a/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c
+++ b/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c
@@ -112,18 +112,18 @@ static void lineart_bounding_area_link_triangle(LineartRenderBuffer *rb,
int recursive_level,
bool do_intersection);
-static int lineart_triangle_line_imagespace_intersection_v2(SpinLock *spl,
- const LineartRenderTriangle *rt,
- const LineartRenderLine *rl,
- const double *override_camera_loc,
- const bool override_cam_is_persp,
- const bool allow_overlapping_edges,
- const double vp[4][4],
- const double *camera_dir,
- const float cam_shift_x,
- const float cam_shift_y,
- double *from,
- double *to);
+static int lineart_triangle_line_image_space_occlusion(SpinLock *spl,
+ const LineartRenderTriangle *rt,
+ const LineartRenderLine *rl,
+ const double *override_camera_loc,
+ const bool override_cam_is_persp,
+ const bool allow_overlapping_edges,
+ const double vp[4][4],
+ const double *camera_dir,
+ const float cam_shift_x,
+ const float cam_shift_y,
+ double *from,
+ double *to);
static void lineart_add_line_to_list(LineartRenderBuffer *rb, LineartRenderLine *rl);
@@ -304,42 +304,6 @@ static void lineart_line_cut(LineartRenderBuffer *rb,
rl->min_occ = min_occ;
}
-static int lineart_occlusion_make_task_info(LineartRenderBuffer *rb, LineartRenderTaskInfo *rti)
-{
- LineartRenderLine *data;
- int i;
- int res = 0;
-
- BLI_spin_lock(&rb->lock_task);
-
-#define LRT_ASSIGN_OCCLUSION_TASK(name) \
- if (rb->name##_managed) { \
- data = rb->name##_managed; \
- rti->name = (void *)data; \
- for (i = 0; i < LRT_THREAD_LINE_COUNT && data; i++) { \
- data = data->next; \
- } \
- rti->name##_end = data; \
- rb->name##_managed = data; \
- res = 1; \
- } \
- else { \
- rti->name = NULL; \
- }
-
- LRT_ASSIGN_OCCLUSION_TASK(contour);
- LRT_ASSIGN_OCCLUSION_TASK(intersection);
- LRT_ASSIGN_OCCLUSION_TASK(crease);
- LRT_ASSIGN_OCCLUSION_TASK(material);
- LRT_ASSIGN_OCCLUSION_TASK(edge_mark);
-
-#undef LRT_ASSIGN_OCCLUSION_TASK
-
- BLI_spin_unlock(&rb->lock_task);
-
- return res;
-}
-
/* To see if given line is connected to an adjacent intersection line. */
BLI_INLINE bool lineart_occlusion_is_adjacent_intersection(LineartRenderLine *rl,
LineartRenderTriangle *rt)
@@ -379,18 +343,18 @@ static void lineart_occlusion_single_line(LineartRenderBuffer *rb,
continue;
}
rt->testing[thread_id] = rl;
- if (lineart_triangle_line_imagespace_intersection_v2(&rb->lock_task,
- (void *)rt,
- rl,
- rb->camera_pos,
- rb->cam_is_persp,
- rb->allow_overlapping_edges,
- rb->view_projection,
- rb->view_vector,
- rb->shift_x,
- rb->shift_y,
- &l,
- &r)) {
+ if (lineart_triangle_line_image_space_occlusion(&rb->lock_task,
+ (void *)rt,
+ rl,
+ rb->camera_pos,
+ rb->cam_is_persp,
+ rb->allow_overlapping_edges,
+ rb->view_projection,
+ rb->view_vector,
+ rb->shift_x,
+ rb->shift_y,
+ &l,
+ &r)) {
lineart_line_cut(rb, rl, l, r, rt->base.transparency_mask);
if (rl->min_occ > rb->max_occlusion_level) {
/* No need to caluclate any longer on this line because no level more than set value is
@@ -404,6 +368,42 @@ static void lineart_occlusion_single_line(LineartRenderBuffer *rb,
}
}
+static int lineart_occlusion_make_task_info(LineartRenderBuffer *rb, LineartRenderTaskInfo *rti)
+{
+ LineartRenderLine *data;
+ int i;
+ int res = 0;
+
+ BLI_spin_lock(&rb->lock_task);
+
+#define LRT_ASSIGN_OCCLUSION_TASK(name) \
+ if (rb->name##_managed) { \
+ data = rb->name##_managed; \
+ rti->name = (void *)data; \
+ for (i = 0; i < LRT_THREAD_LINE_COUNT && data; i++) { \
+ data = data->next; \
+ } \
+ rti->name##_end = data; \
+ rb->name##_managed = data; \
+ res = 1; \
+ } \
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list