[Bf-blender-cvs] [73bf98912a0] temp-lineart-contained: Revert "LineArt: Alternating triangle adding direction"

YimingWu noreply at git.blender.org
Fri Apr 22 10:42:54 CEST 2022


Commit: 73bf98912a056f81fb68695de825b7b72f1b313b
Author: YimingWu
Date:   Fri Apr 22 16:41:36 2022 +0800
Branches: temp-lineart-contained
https://developer.blender.org/rB73bf98912a056f81fb68695de825b7b72f1b313b

Revert "LineArt: Alternating triangle adding direction"

Doesn't really have much performance impact thus reverting.

This reverts commit c151c54a586ed8f51a050de73cb6fcd190e54ec6.

===================================================================

M	source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c

===================================================================

diff --git a/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c b/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c
index dd3d5f3f5d8..d0f5086a822 100644
--- a/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c
+++ b/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c
@@ -4715,7 +4715,6 @@ static void lineart_add_triangles_worker(TaskPool *__restrict UNUSED(pool), Line
     int x1, x2, y1, y2;
     int r, co;
     LineartRenderBuffer *rb = th->rb;
-    int _dir_control = 0;
 
     for (i = 0; i < lim; i++) {
       if ((tri->flags & LRT_CULL_USED) || (tri->flags & LRT_CULL_DISCARD)) {
@@ -4723,26 +4722,17 @@ static void lineart_add_triangles_worker(TaskPool *__restrict UNUSED(pool), Line
         continue;
       }
       if (lineart_get_triangle_bounding_areas(rb, tri, &y1, &y2, &x1, &x2)) {
-        _dir_control++;
         for (co = x1; co <= x2; co++) {
           for (r = y1; r <= y2; r++) {
-            int col = co, row = r;
-            if (_dir_control % 2) {
-              col = x2 - (co - x1);
-            }
-            if ((_dir_control / 2) % 2) {
-              row = y2 - (r - y1);
-            }
-            lineart_bounding_area_link_triangle(
-                rb,
-                &rb->initial_bounding_areas[row * LRT_BA_ROWS + col],
-                tri,
-                0,
-                1,
-                0,
-                (!(tri->flags & LRT_TRIANGLE_NO_INTERSECTION)),
-                true,
-                th);
+            lineart_bounding_area_link_triangle(rb,
+                                                &rb->initial_bounding_areas[r * LRT_BA_ROWS + co],
+                                                tri,
+                                                0,
+                                                1,
+                                                0,
+                                                (!(tri->flags & LRT_TRIANGLE_NO_INTERSECTION)),
+                                                true,
+                                                th);
           }
         }
       } /* Else throw away. */



More information about the Bf-blender-cvs mailing list